diff options
author | Mike Travis <travis@sgi.com> | 2008-04-08 14:43:04 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-19 13:44:59 -0400 |
commit | 9d1fe3236a1d64ab687e16b4cbbaa1383352a2c1 (patch) | |
tree | 059cd312cbc2253fd1e00809a5a937ba45120b99 /include/linux/sysdev.h | |
parent | 39106dcf85285e78f3b290022122c76f851379b8 (diff) |
cpumask: add show cpu map functions
* Add cpu_sysdev_class functions to display the following maps
with cpulist_scnprintf().
cpu_online_map
cpu_present_map
cpu_possible_map
* Small change to include/linux/sysdev.h to allow the attribute
name and label to be different (to avoid collision with the
"attr_online" entry for bringing cpus on- and off-line.)
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/sysdev.h')
-rw-r--r-- | include/linux/sysdev.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h index f752e73bf977..f2767bc6b735 100644 --- a/include/linux/sysdev.h +++ b/include/linux/sysdev.h | |||
@@ -45,12 +45,16 @@ struct sysdev_class_attribute { | |||
45 | ssize_t (*store)(struct sysdev_class *, const char *, size_t); | 45 | ssize_t (*store)(struct sysdev_class *, const char *, size_t); |
46 | }; | 46 | }; |
47 | 47 | ||
48 | #define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ | 48 | #define _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ |
49 | struct sysdev_class_attribute attr_##_name = { \ | 49 | { \ |
50 | .attr = {.name = __stringify(_name), .mode = _mode }, \ | 50 | .attr = {.name = __stringify(_name), .mode = _mode }, \ |
51 | .show = _show, \ | 51 | .show = _show, \ |
52 | .store = _store, \ | 52 | .store = _store, \ |
53 | }; | 53 | } |
54 | |||
55 | #define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) \ | ||
56 | struct sysdev_class_attribute attr_##_name = \ | ||
57 | _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) | ||
54 | 58 | ||
55 | 59 | ||
56 | extern int sysdev_class_register(struct sysdev_class *); | 60 | extern int sysdev_class_register(struct sysdev_class *); |
@@ -100,15 +104,16 @@ struct sysdev_attribute { | |||
100 | }; | 104 | }; |
101 | 105 | ||
102 | 106 | ||
103 | #define _SYSDEV_ATTR(_name,_mode,_show,_store) \ | 107 | #define _SYSDEV_ATTR(_name, _mode, _show, _store) \ |
104 | { \ | 108 | { \ |
105 | .attr = { .name = __stringify(_name), .mode = _mode }, \ | 109 | .attr = { .name = __stringify(_name), .mode = _mode }, \ |
106 | .show = _show, \ | 110 | .show = _show, \ |
107 | .store = _store, \ | 111 | .store = _store, \ |
108 | } | 112 | } |
109 | 113 | ||
110 | #define SYSDEV_ATTR(_name,_mode,_show,_store) \ | 114 | #define SYSDEV_ATTR(_name, _mode, _show, _store) \ |
111 | struct sysdev_attribute attr_##_name = _SYSDEV_ATTR(_name,_mode,_show,_store); | 115 | struct sysdev_attribute attr_##_name = \ |
116 | _SYSDEV_ATTR(_name, _mode, _show, _store); | ||
112 | 117 | ||
113 | extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *); | 118 | extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *); |
114 | extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *); | 119 | extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *); |