summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2002-10-31 20:01:48 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2002-10-31 20:01:48 -0800
commitdc909f53602ea3bc1513d6e841e4912758d801b6 (patch)
treea2d4b6fc8b469b2f00f829d2888dd8f34388c579 /include
parenta3e77b8983416407b5aa9ebc2849714e84b978f5 (diff)
[PATCH] Update/Create core files for DriverFS Topology.
From Matthew Dobson. Update/Create core files for DriverFS Topology. This patch creates the generic structures that are (will be) embedded in the per-arch structures. Also creates calls to register these generic structures (CPUs, MemBlks, & Nodes). Note that without arch-specific structures in which to embed these structures, and an arch-specific initialization routine, these functions/structures remain unused.
Diffstat (limited to 'include')
-rw-r--r--include/linux/cpu.h12
-rw-r--r--include/linux/memblk.h32
-rw-r--r--include/linux/node.h34
3 files changed, 74 insertions, 4 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index bcf7294b967a..7fab9f205d8f 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -1,5 +1,5 @@
/*
- * cpu.h - generic cpu defition
+ * include/linux/cpu.h - generic cpu definition
*
* This is mainly for topological representation. We define the
* basic 'struct cpu' here, which can be embedded in per-arch
@@ -15,14 +15,18 @@
* See the following for how to do this:
* - drivers/base/intf.c
* - Documentation/driver-model/interface.txt
- *
*/
+#ifndef _LINUX_CPU_H_
+#define _LINUX_CPU_H_
#include <linux/device.h>
-
-extern struct device_class cpu_devclass;
+#include <linux/node.h>
struct cpu {
+ int node_id; /* The node which contains the CPU */
struct sys_device sysdev;
};
+extern void register_cpu(struct cpu *, int, struct node *);
+
+#endif /* _LINUX_CPU_H_ */
diff --git a/include/linux/memblk.h b/include/linux/memblk.h
new file mode 100644
index 000000000000..a7dab1103ebe
--- /dev/null
+++ b/include/linux/memblk.h
@@ -0,0 +1,32 @@
+/*
+ * include/linux/memblk.h - generic memblk definition
+ *
+ * This is mainly for topological representation. We define the
+ * basic 'struct memblk' here, which can be embedded in per-arch
+ * definitions of memory blocks.
+ *
+ * Basic handling of the devices is done in drivers/base/memblk.c
+ * and system devices are handled in drivers/base/sys.c.
+ *
+ * MemBlks are exported via driverfs in the class/memblk/devices/
+ * directory.
+ *
+ * Per-memblk 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_MEMBLK_H_
+#define _LINUX_MEMBLK_H_
+
+#include <linux/device.h>
+#include <linux/node.h>
+
+struct memblk {
+ int node_id; /* The node which contains the MemBlk */
+ struct sys_device sysdev;
+};
+
+extern void register_memblk(struct memblk *, int, struct node *);
+
+#endif /* _LINUX_MEMBLK_H_ */
diff --git a/include/linux/node.h b/include/linux/node.h
new file mode 100644
index 000000000000..a416b3cab960
--- /dev/null
+++ b/include/linux/node.h
@@ -0,0 +1,34 @@
+/*
+ * 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/device.h>
+
+struct node {
+ unsigned long cpumap; /* Bitmap of CPUs on the Node */
+ struct sys_root sysroot;
+};
+
+extern void register_node(struct node *, int, struct node *);
+
+#define to_node(_root) container_of(_root, struct node, sysroot)
+#define to_root(_dev) container_of(_dev, struct sys_root, dev)
+
+#endif /* _LINUX_NODE_H_ */