diff options
Diffstat (limited to 'arch/m68k/kernel/setup.c')
-rw-r--r-- | arch/m68k/kernel/setup.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c index ea1e44da19b9..4d97bd2bd573 100644 --- a/arch/m68k/kernel/setup.c +++ b/arch/m68k/kernel/setup.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/string.h> | 20 | #include <linux/string.h> |
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/bootmem.h> | 22 | #include <linux/bootmem.h> |
23 | #include <linux/proc_fs.h> | ||
23 | #include <linux/seq_file.h> | 24 | #include <linux/seq_file.h> |
24 | #include <linux/module.h> | 25 | #include <linux/module.h> |
25 | #include <linux/initrd.h> | 26 | #include <linux/initrd.h> |
@@ -80,7 +81,7 @@ void (*mach_sched_init) (irq_handler_t handler) __initdata = NULL; | |||
80 | /* machine dependent irq functions */ | 81 | /* machine dependent irq functions */ |
81 | void (*mach_init_IRQ) (void) __initdata = NULL; | 82 | void (*mach_init_IRQ) (void) __initdata = NULL; |
82 | void (*mach_get_model) (char *model); | 83 | void (*mach_get_model) (char *model); |
83 | int (*mach_get_hardware_list) (char *buffer); | 84 | void (*mach_get_hardware_list) (struct seq_file *m); |
84 | /* machine dependent timer functions */ | 85 | /* machine dependent timer functions */ |
85 | unsigned long (*mach_gettimeoffset) (void); | 86 | unsigned long (*mach_gettimeoffset) (void); |
86 | int (*mach_hwclk) (int, struct rtc_time*); | 87 | int (*mach_hwclk) (int, struct rtc_time*); |
@@ -467,9 +468,9 @@ const struct seq_operations cpuinfo_op = { | |||
467 | .show = show_cpuinfo, | 468 | .show = show_cpuinfo, |
468 | }; | 469 | }; |
469 | 470 | ||
470 | int get_hardware_list(char *buffer) | 471 | #ifdef CONFIG_PROC_HARDWARE |
472 | static int hardware_proc_show(struct seq_file *m, void *v) | ||
471 | { | 473 | { |
472 | int len = 0; | ||
473 | char model[80]; | 474 | char model[80]; |
474 | unsigned long mem; | 475 | unsigned long mem; |
475 | int i; | 476 | int i; |
@@ -479,17 +480,37 @@ int get_hardware_list(char *buffer) | |||
479 | else | 480 | else |
480 | strcpy(model, "Unknown m68k"); | 481 | strcpy(model, "Unknown m68k"); |
481 | 482 | ||
482 | len += sprintf(buffer + len, "Model:\t\t%s\n", model); | 483 | seq_printf(m, "Model:\t\t%s\n", model); |
483 | for (mem = 0, i = 0; i < m68k_num_memory; i++) | 484 | for (mem = 0, i = 0; i < m68k_num_memory; i++) |
484 | mem += m68k_memory[i].size; | 485 | mem += m68k_memory[i].size; |
485 | len += sprintf(buffer + len, "System Memory:\t%ldK\n", mem >> 10); | 486 | seq_printf(m, "System Memory:\t%ldK\n", mem >> 10); |
486 | 487 | ||
487 | if (mach_get_hardware_list) | 488 | if (mach_get_hardware_list) |
488 | len += mach_get_hardware_list(buffer + len); | 489 | mach_get_hardware_list(m); |
489 | 490 | ||
490 | return len; | 491 | return 0; |
492 | } | ||
493 | |||
494 | static int hardware_proc_open(struct inode *inode, struct file *file) | ||
495 | { | ||
496 | return single_open(file, hardware_proc_show, NULL); | ||
491 | } | 497 | } |
492 | 498 | ||
499 | static const struct file_operations hardware_proc_fops = { | ||
500 | .open = hardware_proc_open, | ||
501 | .read = seq_read, | ||
502 | .llseek = seq_lseek, | ||
503 | .release = single_release, | ||
504 | }; | ||
505 | |||
506 | static int __init proc_hardware_init(void) | ||
507 | { | ||
508 | proc_create("hardware", 0, NULL, &hardware_proc_fops); | ||
509 | return 0; | ||
510 | } | ||
511 | module_init(proc_hardware_init); | ||
512 | #endif | ||
513 | |||
493 | void check_bugs(void) | 514 | void check_bugs(void) |
494 | { | 515 | { |
495 | #ifndef CONFIG_M68KFPU_EMU | 516 | #ifndef CONFIG_M68KFPU_EMU |