diff options
| author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-07-27 22:11:24 +0000 |
|---|---|---|
| committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-07-27 22:11:24 +0000 |
| commit | ce6a36c7f7c88e7ca0fda816f9282237bb86829d (patch) | |
| tree | 611bf9beb2281d34260ca87fc189a0ddc864819a /libdde-linux26/libdde_linux26/contrib/include/linux/node.h | |
| parent | bb9d6cd642f9189b8102d566c8c46a6de1d2c5f7 (diff) | |
| parent | 4fbe7358c7747a9165f776eb19addbb9baf7def2 (diff) | |
Merge branch 'upstream-merged'
Diffstat (limited to 'libdde-linux26/libdde_linux26/contrib/include/linux/node.h')
| -rw-r--r-- | libdde-linux26/libdde_linux26/contrib/include/linux/node.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/libdde-linux26/libdde_linux26/contrib/include/linux/node.h b/libdde-linux26/libdde_linux26/contrib/include/linux/node.h new file mode 100644 index 00000000..681a697b --- /dev/null +++ b/libdde-linux26/libdde_linux26/contrib/include/linux/node.h @@ -0,0 +1,72 @@ +/* + * include/linux/node.h - generic node definition + * + * This is mainly for topological representation. We define the + * basic 'struct node' here, which can be embedded in per-arch + * definitions of processors. + * + * Basic handling of the devices is done in drivers/base/node.c + * and system devices are handled in drivers/base/sys.c. + * + * Nodes are exported via driverfs in the class/node/devices/ + * directory. + * + * Per-node interfaces can be implemented using a struct device_interface. + * See the following for how to do this: + * - drivers/base/intf.c + * - Documentation/driver-model/interface.txt + */ +#ifndef _LINUX_NODE_H_ +#define _LINUX_NODE_H_ + +#include <linux/sysdev.h> +#include <linux/cpumask.h> + +struct node { + struct sys_device sysdev; +}; + +struct memory_block; +extern struct node node_devices[]; + +extern int register_node(struct node *, int, struct node *); +extern void unregister_node(struct node *node); +#ifdef CONFIG_NUMA +extern int register_one_node(int nid); +extern void unregister_one_node(int nid); +extern int register_cpu_under_node(unsigned int cpu, unsigned int nid); +extern int unregister_cpu_under_node(unsigned int cpu, unsigned int nid); +extern int register_mem_sect_under_node(struct memory_block *mem_blk, + int nid); +extern int unregister_mem_sect_under_nodes(struct memory_block *mem_blk); +#else +static inline int register_one_node(int nid) +{ + return 0; +} +static inline int unregister_one_node(int nid) +{ + return 0; +} +static inline int register_cpu_under_node(unsigned int cpu, unsigned int nid) +{ + return 0; +} +static inline int unregister_cpu_under_node(unsigned int cpu, unsigned int nid) +{ + return 0; +} +static inline int register_mem_sect_under_node(struct memory_block *mem_blk, + int nid) +{ + return 0; +} +static inline int unregister_mem_sect_under_nodes(struct memory_block *mem_blk) +{ + return 0; +} +#endif + +#define to_node(sys_device) container_of(sys_device, struct node, sysdev) + +#endif /* _LINUX_NODE_H_ */ |
