diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2009-03-26 10:23:50 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-03-26 10:24:06 -0400 |
commit | 94f5b09d97ee1f803c76d0262e0b0d3791825d09 (patch) | |
tree | a4754dc166327d9af6757c2e20b12517a89960bb | |
parent | fc19f381b3828aa4f8a3417dbefc3418ec6bbe10 (diff) |
[S390] move sysinfo.c from drivers/s390 to arch/s390/kernel
All in sysinfo.c is core kernel code and not driver code. So move it
to arch/s390/kernel. Also includes some small cleanups.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/kernel/Makefile | 4 | ||||
-rw-r--r-- | arch/s390/kernel/sysinfo.c (renamed from drivers/s390/sysinfo.c) | 69 | ||||
-rw-r--r-- | drivers/s390/Makefile | 4 |
3 files changed, 18 insertions, 59 deletions
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile index 3edc6c6f258b..33e7aee70513 100644 --- a/arch/s390/kernel/Makefile +++ b/arch/s390/kernel/Makefile | |||
@@ -17,10 +17,12 @@ CFLAGS_smp.o := -Wno-nonnull | |||
17 | # | 17 | # |
18 | CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' | 18 | CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' |
19 | 19 | ||
20 | CFLAGS_sysinfo.o += -Iinclude/math-emu -Iarch/s390/math-emu -w | ||
21 | |||
20 | obj-y := bitmap.o traps.o time.o process.o base.o early.o setup.o \ | 22 | obj-y := bitmap.o traps.o time.o process.o base.o early.o setup.o \ |
21 | processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ | 23 | processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \ |
22 | s390_ext.o debug.o irq.o ipl.o dis.o diag.o mem_detect.o \ | 24 | s390_ext.o debug.o irq.o ipl.o dis.o diag.o mem_detect.o \ |
23 | vdso.o vtime.o | 25 | vdso.o vtime.o sysinfo.o |
24 | 26 | ||
25 | obj-y += $(if $(CONFIG_64BIT),entry64.o,entry.o) | 27 | obj-y += $(if $(CONFIG_64BIT),entry64.o,entry.o) |
26 | obj-y += $(if $(CONFIG_64BIT),reipl64.o,reipl.o) | 28 | obj-y += $(if $(CONFIG_64BIT),reipl64.o,reipl.o) |
diff --git a/drivers/s390/sysinfo.c b/arch/s390/kernel/sysinfo.c index 0eea90781385..b5e75e1061c8 100644 --- a/drivers/s390/sysinfo.c +++ b/arch/s390/kernel/sysinfo.c | |||
@@ -1,9 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/s390/sysinfo.c | 2 | * Copyright IBM Corp. 2001, 2009 |
3 | * | 3 | * Author(s): Ulrich Weigand <Ulrich.Weigand@de.ibm.com>, |
4 | * Copyright IBM Corp. 2001, 2008 | 4 | * Martin Schwidefsky <schwidefsky@de.ibm.com>, |
5 | * Author(s): Ulrich Weigand (Ulrich.Weigand@de.ibm.com) | ||
6 | * Martin Schwidefsky <schwidefsky@de.ibm.com> | ||
7 | */ | 5 | */ |
8 | 6 | ||
9 | #include <linux/kernel.h> | 7 | #include <linux/kernel.h> |
@@ -24,7 +22,7 @@ | |||
24 | 22 | ||
25 | static inline int stsi_0(void) | 23 | static inline int stsi_0(void) |
26 | { | 24 | { |
27 | int rc = stsi (NULL, 0, 0, 0); | 25 | int rc = stsi(NULL, 0, 0, 0); |
28 | return rc == -ENOSYS ? rc : (((unsigned int) rc) >> 28); | 26 | return rc == -ENOSYS ? rc : (((unsigned int) rc) >> 28); |
29 | } | 27 | } |
30 | 28 | ||
@@ -78,23 +76,6 @@ static int stsi_1_1_1(struct sysinfo_1_1_1 *info, char *page, int len) | |||
78 | return len; | 76 | return len; |
79 | } | 77 | } |
80 | 78 | ||
81 | #if 0 /* Currently unused */ | ||
82 | static int stsi_1_2_1(struct sysinfo_1_2_1 *info, char *page, int len) | ||
83 | { | ||
84 | if (stsi(info, 1, 2, 1) == -ENOSYS) | ||
85 | return len; | ||
86 | |||
87 | len += sprintf(page + len, "\n"); | ||
88 | EBCASC(info->sequence, sizeof(info->sequence)); | ||
89 | EBCASC(info->plant, sizeof(info->plant)); | ||
90 | len += sprintf(page + len, "Sequence Code of CPU: %-16.16s\n", | ||
91 | info->sequence); | ||
92 | len += sprintf(page + len, "Plant of CPU: %-16.16s\n", | ||
93 | info->plant); | ||
94 | return len; | ||
95 | } | ||
96 | #endif | ||
97 | |||
98 | static int stsi_1_2_2(struct sysinfo_1_2_2 *info, char *page, int len) | 79 | static int stsi_1_2_2(struct sysinfo_1_2_2 *info, char *page, int len) |
99 | { | 80 | { |
100 | struct sysinfo_1_2_2_extension *ext; | 81 | struct sysinfo_1_2_2_extension *ext; |
@@ -145,33 +126,15 @@ static int stsi_1_2_2(struct sysinfo_1_2_2 *info, char *page, int len) | |||
145 | if (info->secondary_capability != 0) | 126 | if (info->secondary_capability != 0) |
146 | len += sprintf(page + len, "Secondary Capability: %d\n", | 127 | len += sprintf(page + len, "Secondary Capability: %d\n", |
147 | info->secondary_capability); | 128 | info->secondary_capability); |
148 | |||
149 | return len; | 129 | return len; |
150 | } | 130 | } |
151 | 131 | ||
152 | #if 0 /* Currently unused */ | ||
153 | static int stsi_2_2_1(struct sysinfo_2_2_1 *info, char *page, int len) | ||
154 | { | ||
155 | if (stsi(info, 2, 2, 1) == -ENOSYS) | ||
156 | return len; | ||
157 | |||
158 | len += sprintf(page + len, "\n"); | ||
159 | EBCASC (info->sequence, sizeof(info->sequence)); | ||
160 | EBCASC (info->plant, sizeof(info->plant)); | ||
161 | len += sprintf(page + len, "Sequence Code of logical CPU: %-16.16s\n", | ||
162 | info->sequence); | ||
163 | len += sprintf(page + len, "Plant of logical CPU: %-16.16s\n", | ||
164 | info->plant); | ||
165 | return len; | ||
166 | } | ||
167 | #endif | ||
168 | |||
169 | static int stsi_2_2_2(struct sysinfo_2_2_2 *info, char *page, int len) | 132 | static int stsi_2_2_2(struct sysinfo_2_2_2 *info, char *page, int len) |
170 | { | 133 | { |
171 | if (stsi(info, 2, 2, 2) == -ENOSYS) | 134 | if (stsi(info, 2, 2, 2) == -ENOSYS) |
172 | return len; | 135 | return len; |
173 | 136 | ||
174 | EBCASC (info->name, sizeof(info->name)); | 137 | EBCASC(info->name, sizeof(info->name)); |
175 | 138 | ||
176 | len += sprintf(page + len, "\n"); | 139 | len += sprintf(page + len, "\n"); |
177 | len += sprintf(page + len, "LPAR Number: %d\n", | 140 | len += sprintf(page + len, "LPAR Number: %d\n", |
@@ -214,8 +177,8 @@ static int stsi_3_2_2(struct sysinfo_3_2_2 *info, char *page, int len) | |||
214 | if (stsi(info, 3, 2, 2) == -ENOSYS) | 177 | if (stsi(info, 3, 2, 2) == -ENOSYS) |
215 | return len; | 178 | return len; |
216 | for (i = 0; i < info->count; i++) { | 179 | for (i = 0; i < info->count; i++) { |
217 | EBCASC (info->vm[i].name, sizeof(info->vm[i].name)); | 180 | EBCASC(info->vm[i].name, sizeof(info->vm[i].name)); |
218 | EBCASC (info->vm[i].cpi, sizeof(info->vm[i].cpi)); | 181 | EBCASC(info->vm[i].cpi, sizeof(info->vm[i].cpi)); |
219 | len += sprintf(page + len, "\n"); | 182 | len += sprintf(page + len, "\n"); |
220 | len += sprintf(page + len, "VM%02d Name: %-8.8s\n", | 183 | len += sprintf(page + len, "VM%02d Name: %-8.8s\n", |
221 | i, info->vm[i].name); | 184 | i, info->vm[i].name); |
@@ -237,14 +200,13 @@ static int stsi_3_2_2(struct sysinfo_3_2_2 *info, char *page, int len) | |||
237 | return len; | 200 | return len; |
238 | } | 201 | } |
239 | 202 | ||
240 | |||
241 | static int proc_read_sysinfo(char *page, char **start, | 203 | static int proc_read_sysinfo(char *page, char **start, |
242 | off_t off, int count, | 204 | off_t off, int count, |
243 | int *eof, void *data) | 205 | int *eof, void *data) |
244 | { | 206 | { |
245 | unsigned long info = get_zeroed_page (GFP_KERNEL); | 207 | unsigned long info = get_zeroed_page(GFP_KERNEL); |
246 | int level, len; | 208 | int level, len; |
247 | 209 | ||
248 | if (!info) | 210 | if (!info) |
249 | return 0; | 211 | return 0; |
250 | 212 | ||
@@ -262,8 +224,8 @@ static int proc_read_sysinfo(char *page, char **start, | |||
262 | if (level >= 3) | 224 | if (level >= 3) |
263 | len = stsi_3_2_2((struct sysinfo_3_2_2 *) info, page, len); | 225 | len = stsi_3_2_2((struct sysinfo_3_2_2 *) info, page, len); |
264 | 226 | ||
265 | free_page (info); | 227 | free_page(info); |
266 | return len; | 228 | return len; |
267 | } | 229 | } |
268 | 230 | ||
269 | static __init int create_proc_sysinfo(void) | 231 | static __init int create_proc_sysinfo(void) |
@@ -272,8 +234,7 @@ static __init int create_proc_sysinfo(void) | |||
272 | proc_read_sysinfo, NULL); | 234 | proc_read_sysinfo, NULL); |
273 | return 0; | 235 | return 0; |
274 | } | 236 | } |
275 | 237 | device_initcall(create_proc_sysinfo); | |
276 | __initcall(create_proc_sysinfo); | ||
277 | 238 | ||
278 | /* | 239 | /* |
279 | * Service levels interface. | 240 | * Service levels interface. |
@@ -387,13 +348,11 @@ static __init int create_proc_service_level(void) | |||
387 | register_service_level(&service_level_vm); | 348 | register_service_level(&service_level_vm); |
388 | return 0; | 349 | return 0; |
389 | } | 350 | } |
390 | |||
391 | subsys_initcall(create_proc_service_level); | 351 | subsys_initcall(create_proc_service_level); |
392 | 352 | ||
393 | /* | 353 | /* |
394 | * Bogomips calculation based on cpu capability. | 354 | * Bogomips calculation based on cpu capability. |
395 | */ | 355 | */ |
396 | |||
397 | int get_cpu_capability(unsigned int *capability) | 356 | int get_cpu_capability(unsigned int *capability) |
398 | { | 357 | { |
399 | struct sysinfo_1_2_2 *info; | 358 | struct sysinfo_1_2_2 *info; |
diff --git a/drivers/s390/Makefile b/drivers/s390/Makefile index d0eae59bc366..0828dc839355 100644 --- a/drivers/s390/Makefile +++ b/drivers/s390/Makefile | |||
@@ -2,9 +2,7 @@ | |||
2 | # Makefile for the S/390 specific device drivers | 2 | # Makefile for the S/390 specific device drivers |
3 | # | 3 | # |
4 | 4 | ||
5 | CFLAGS_sysinfo.o += -Iinclude/math-emu -Iarch/s390/math-emu -w | 5 | obj-y += s390mach.o |
6 | |||
7 | obj-y += s390mach.o sysinfo.o | ||
8 | obj-y += cio/ block/ char/ crypto/ net/ scsi/ kvm/ | 6 | obj-y += cio/ block/ char/ crypto/ net/ scsi/ kvm/ |
9 | 7 | ||
10 | drivers-y += drivers/s390/built-in.o | 8 | drivers-y += drivers/s390/built-in.o |