diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-03-26 10:24:42 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-03-26 10:24:26 -0400 |
commit | 7b4684880dfc6c45bc56039ca5eada771d7643ab (patch) | |
tree | f572dc77a13e56a417616a9b49f74a68ed1dc99a /arch/s390/kernel | |
parent | 2938af534d47891ddbced552e5d29f7b90bec609 (diff) |
[S390] eliminate cpuinfo_S390 structure
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r-- | arch/s390/kernel/processor.c | 69 | ||||
-rw-r--r-- | arch/s390/kernel/setup.c | 10 | ||||
-rw-r--r-- | arch/s390/kernel/smp.c | 8 |
3 files changed, 41 insertions, 46 deletions
diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c index 82c1872cfe80..423da1bd42a4 100644 --- a/arch/s390/kernel/processor.c +++ b/arch/s390/kernel/processor.c | |||
@@ -18,10 +18,11 @@ | |||
18 | #include <asm/lowcore.h> | 18 | #include <asm/lowcore.h> |
19 | #include <asm/param.h> | 19 | #include <asm/param.h> |
20 | 20 | ||
21 | void __cpuinit print_cpu_info(struct cpuinfo_S390 *cpuinfo) | 21 | void __cpuinit print_cpu_info(void) |
22 | { | 22 | { |
23 | pr_info("Processor %d started, address %d, identification %06X\n", | 23 | pr_info("Processor %d started, address %d, identification %06X\n", |
24 | cpuinfo->cpu_nr, cpuinfo->cpu_addr, cpuinfo->cpu_id.ident); | 24 | S390_lowcore.cpu_nr, S390_lowcore.cpu_addr, |
25 | S390_lowcore.cpu_id.ident); | ||
25 | } | 26 | } |
26 | 27 | ||
27 | /* | 28 | /* |
@@ -34,44 +35,42 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
34 | "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", | 35 | "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp", |
35 | "edat" | 36 | "edat" |
36 | }; | 37 | }; |
37 | struct cpuinfo_S390 *cpuinfo; | 38 | struct _lowcore *lc; |
38 | unsigned long n = (unsigned long) v - 1; | 39 | unsigned long n = (unsigned long) v - 1; |
39 | int i; | 40 | int i; |
40 | 41 | ||
41 | s390_adjust_jiffies(); | 42 | s390_adjust_jiffies(); |
42 | preempt_disable(); | 43 | preempt_disable(); |
43 | if (!n) { | 44 | if (!n) { |
44 | seq_printf(m, "vendor_id : IBM/S390\n" | 45 | seq_printf(m, "vendor_id : IBM/S390\n" |
45 | "# processors : %i\n" | 46 | "# processors : %i\n" |
46 | "bogomips per cpu: %lu.%02lu\n", | 47 | "bogomips per cpu: %lu.%02lu\n", |
47 | num_online_cpus(), loops_per_jiffy/(500000/HZ), | 48 | num_online_cpus(), loops_per_jiffy/(500000/HZ), |
48 | (loops_per_jiffy/(5000/HZ))%100); | 49 | (loops_per_jiffy/(5000/HZ))%100); |
49 | seq_puts(m, "features\t: "); | 50 | seq_puts(m, "features\t: "); |
50 | for (i = 0; i < 8; i++) | 51 | for (i = 0; i < 8; i++) |
51 | if (hwcap_str[i] && (elf_hwcap & (1UL << i))) | 52 | if (hwcap_str[i] && (elf_hwcap & (1UL << i))) |
52 | seq_printf(m, "%s ", hwcap_str[i]); | 53 | seq_printf(m, "%s ", hwcap_str[i]); |
53 | seq_puts(m, "\n"); | 54 | seq_puts(m, "\n"); |
54 | } | 55 | } |
55 | 56 | ||
56 | if (cpu_online(n)) { | 57 | if (cpu_online(n)) { |
57 | #ifdef CONFIG_SMP | 58 | #ifdef CONFIG_SMP |
58 | if (smp_processor_id() == n) | 59 | lc = (smp_processor_id() == n) ? |
59 | cpuinfo = &S390_lowcore.cpu_data; | 60 | &S390_lowcore : lowcore_ptr[n]; |
60 | else | ||
61 | cpuinfo = &lowcore_ptr[n]->cpu_data; | ||
62 | #else | 61 | #else |
63 | cpuinfo = &S390_lowcore.cpu_data; | 62 | lc = &S390_lowcore; |
64 | #endif | 63 | #endif |
65 | seq_printf(m, "processor %li: " | 64 | seq_printf(m, "processor %li: " |
66 | "version = %02X, " | 65 | "version = %02X, " |
67 | "identification = %06X, " | 66 | "identification = %06X, " |
68 | "machine = %04X\n", | 67 | "machine = %04X\n", |
69 | n, cpuinfo->cpu_id.version, | 68 | n, lc->cpu_id.version, |
70 | cpuinfo->cpu_id.ident, | 69 | lc->cpu_id.ident, |
71 | cpuinfo->cpu_id.machine); | 70 | lc->cpu_id.machine); |
72 | } | 71 | } |
73 | preempt_enable(); | 72 | preempt_enable(); |
74 | return 0; | 73 | return 0; |
75 | } | 74 | } |
76 | 75 | ||
77 | static void *c_start(struct seq_file *m, loff_t *pos) | 76 | static void *c_start(struct seq_file *m, loff_t *pos) |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index dd3c51736270..9c8853f21bb2 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -121,13 +121,10 @@ static struct resource data_resource = { | |||
121 | */ | 121 | */ |
122 | void __cpuinit cpu_init(void) | 122 | void __cpuinit cpu_init(void) |
123 | { | 123 | { |
124 | int addr = hard_smp_processor_id(); | ||
125 | |||
126 | /* | 124 | /* |
127 | * Store processor id in lowcore (used e.g. in timer_interrupt) | 125 | * Store processor id in lowcore (used e.g. in timer_interrupt) |
128 | */ | 126 | */ |
129 | get_cpu_id(&S390_lowcore.cpu_data.cpu_id); | 127 | get_cpu_id(&S390_lowcore.cpu_id); |
130 | S390_lowcore.cpu_data.cpu_addr = addr; | ||
131 | 128 | ||
132 | /* | 129 | /* |
133 | * Force FPU initialization: | 130 | * Force FPU initialization: |
@@ -686,7 +683,6 @@ setup_memory(void) | |||
686 | static void __init setup_hwcaps(void) | 683 | static void __init setup_hwcaps(void) |
687 | { | 684 | { |
688 | static const int stfl_bits[6] = { 0, 2, 7, 17, 19, 21 }; | 685 | static const int stfl_bits[6] = { 0, 2, 7, 17, 19, 21 }; |
689 | struct cpuinfo_S390 *cpuinfo = &S390_lowcore.cpu_data; | ||
690 | unsigned long long facility_list_extended; | 686 | unsigned long long facility_list_extended; |
691 | unsigned int facility_list; | 687 | unsigned int facility_list; |
692 | int i; | 688 | int i; |
@@ -732,7 +728,7 @@ static void __init setup_hwcaps(void) | |||
732 | if (MACHINE_HAS_HPAGE) | 728 | if (MACHINE_HAS_HPAGE) |
733 | elf_hwcap |= 1UL << 7; | 729 | elf_hwcap |= 1UL << 7; |
734 | 730 | ||
735 | switch (cpuinfo->cpu_id.machine) { | 731 | switch (S390_lowcore.cpu_id.machine) { |
736 | case 0x9672: | 732 | case 0x9672: |
737 | #if !defined(CONFIG_64BIT) | 733 | #if !defined(CONFIG_64BIT) |
738 | default: /* Use "g5" as default for 31 bit kernels. */ | 734 | default: /* Use "g5" as default for 31 bit kernels. */ |
@@ -825,7 +821,7 @@ setup_arch(char **cmdline_p) | |||
825 | setup_lowcore(); | 821 | setup_lowcore(); |
826 | 822 | ||
827 | cpu_init(); | 823 | cpu_init(); |
828 | __cpu_logical_map[0] = S390_lowcore.cpu_data.cpu_addr; | 824 | __cpu_logical_map[0] = stap(); |
829 | s390_init_cpu_topology(); | 825 | s390_init_cpu_topology(); |
830 | 826 | ||
831 | /* | 827 | /* |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index a8858634dd05..b167f74d94cd 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -372,7 +372,7 @@ static void __init smp_detect_cpus(void) | |||
372 | 372 | ||
373 | c_cpus = 1; | 373 | c_cpus = 1; |
374 | s_cpus = 0; | 374 | s_cpus = 0; |
375 | boot_cpu_addr = S390_lowcore.cpu_data.cpu_addr; | 375 | boot_cpu_addr = __cpu_logical_map[0]; |
376 | info = kmalloc(sizeof(*info), GFP_KERNEL); | 376 | info = kmalloc(sizeof(*info), GFP_KERNEL); |
377 | if (!info) | 377 | if (!info) |
378 | panic("smp_detect_cpus failed to allocate memory\n"); | 378 | panic("smp_detect_cpus failed to allocate memory\n"); |
@@ -446,7 +446,7 @@ int __cpuinit start_secondary(void *cpuvoid) | |||
446 | /* Switch on interrupts */ | 446 | /* Switch on interrupts */ |
447 | local_irq_enable(); | 447 | local_irq_enable(); |
448 | /* Print info about this processor */ | 448 | /* Print info about this processor */ |
449 | print_cpu_info(&S390_lowcore.cpu_data); | 449 | print_cpu_info(); |
450 | /* cpu_idle will call schedule for us */ | 450 | /* cpu_idle will call schedule for us */ |
451 | cpu_idle(); | 451 | cpu_idle(); |
452 | return 0; | 452 | return 0; |
@@ -564,7 +564,7 @@ int __cpuinit __cpu_up(unsigned int cpu) | |||
564 | : : "a" (&cpu_lowcore->access_regs_save_area) : "memory"); | 564 | : : "a" (&cpu_lowcore->access_regs_save_area) : "memory"); |
565 | cpu_lowcore->percpu_offset = __per_cpu_offset[cpu]; | 565 | cpu_lowcore->percpu_offset = __per_cpu_offset[cpu]; |
566 | cpu_lowcore->current_task = (unsigned long) idle; | 566 | cpu_lowcore->current_task = (unsigned long) idle; |
567 | cpu_lowcore->cpu_data.cpu_nr = cpu; | 567 | cpu_lowcore->cpu_nr = cpu; |
568 | cpu_lowcore->kernel_asce = S390_lowcore.kernel_asce; | 568 | cpu_lowcore->kernel_asce = S390_lowcore.kernel_asce; |
569 | cpu_lowcore->ipl_device = S390_lowcore.ipl_device; | 569 | cpu_lowcore->ipl_device = S390_lowcore.ipl_device; |
570 | eieio(); | 570 | eieio(); |
@@ -656,7 +656,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
656 | /* request the 0x1201 emergency signal external interrupt */ | 656 | /* request the 0x1201 emergency signal external interrupt */ |
657 | if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0) | 657 | if (register_external_interrupt(0x1201, do_ext_call_interrupt) != 0) |
658 | panic("Couldn't request external interrupt 0x1201"); | 658 | panic("Couldn't request external interrupt 0x1201"); |
659 | print_cpu_info(&S390_lowcore.cpu_data); | 659 | print_cpu_info(); |
660 | 660 | ||
661 | /* Reallocate current lowcore, but keep its contents. */ | 661 | /* Reallocate current lowcore, but keep its contents. */ |
662 | lc_order = sizeof(long) == 8 ? 1 : 0; | 662 | lc_order = sizeof(long) == 8 ? 1 : 0; |