aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m32r/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m32r/kernel')
-rw-r--r--arch/m32r/kernel/entry.S55
-rw-r--r--arch/m32r/kernel/m32r_ksyms.c29
-rw-r--r--arch/m32r/kernel/process.c4
-rw-r--r--arch/m32r/kernel/setup.c12
-rw-r--r--arch/m32r/kernel/signal.c4
-rw-r--r--arch/m32r/kernel/smpboot.c19
6 files changed, 45 insertions, 78 deletions
diff --git a/arch/m32r/kernel/entry.S b/arch/m32r/kernel/entry.S
index 3871b65f0c82..920bb742b7a2 100644
--- a/arch/m32r/kernel/entry.S
+++ b/arch/m32r/kernel/entry.S
@@ -20,7 +20,7 @@
20 * Stack layout in 'ret_from_system_call': 20 * Stack layout in 'ret_from_system_call':
21 * ptrace needs to have all regs on the stack. 21 * ptrace needs to have all regs on the stack.
22 * if the order here is changed, it needs to be 22 * if the order here is changed, it needs to be
23 * updated in fork.c:copy_process, signal.c:do_signal, 23 * updated in fork.c:copy_thread, signal.c:do_signal,
24 * ptrace.c and ptrace.h 24 * ptrace.c and ptrace.h
25 * 25 *
26 * M32Rx/M32R2 M32R 26 * M32Rx/M32R2 M32R
@@ -41,18 +41,17 @@
41 * @(0x38,sp) - syscall_nr ditto 41 * @(0x38,sp) - syscall_nr ditto
42 * @(0x3c,sp) - acc0h @(0x3c,sp) - acch 42 * @(0x3c,sp) - acc0h @(0x3c,sp) - acch
43 * @(0x40,sp) - acc0l @(0x40,sp) - accl 43 * @(0x40,sp) - acc0l @(0x40,sp) - accl
44 * @(0x44,sp) - acc1h @(0x44,sp) - psw 44 * @(0x44,sp) - acc1h @(0x44,sp) - dummy_acc1h
45 * @(0x48,sp) - acc1l @(0x48,sp) - bpc 45 * @(0x48,sp) - acc1l @(0x48,sp) - dummy_acc1l
46 * @(0x4c,sp) - psw @(0x4c,sp) - bbpsw 46 * @(0x4c,sp) - psw ditto
47 * @(0x50,sp) - bpc @(0x50,sp) - bbpc 47 * @(0x50,sp) - bpc ditto
48 * @(0x54,sp) - bbpsw @(0x54,sp) - spu (cr3) 48 * @(0x54,sp) - bbpsw ditto
49 * @(0x58,sp) - bbpc @(0x58,sp) - fp (r13) 49 * @(0x58,sp) - bbpc ditto
50 * @(0x5c,sp) - spu (cr3) @(0x5c,sp) - lr (r14) 50 * @(0x5c,sp) - spu (cr3) ditto
51 * @(0x60,sp) - fp (r13) @(0x60,sp) - spi (cr12) 51 * @(0x60,sp) - fp (r13) ditto
52 * @(0x64,sp) - lr (r14) @(0x64,sp) - orig_r0 52 * @(0x64,sp) - lr (r14) ditto
53 * @(0x68,sp) - spi (cr2) 53 * @(0x68,sp) - spi (cr2) ditto
54 * @(0x6c,sp) - orig_r0 54 * @(0x6c,sp) - orig_r0 ditto
55 *
56 */ 55 */
57 56
58#include <linux/config.h> 57#include <linux/config.h>
@@ -102,6 +101,12 @@
102#define ACC0L(reg) @(0x40,reg) 101#define ACC0L(reg) @(0x40,reg)
103#define ACC1H(reg) @(0x44,reg) 102#define ACC1H(reg) @(0x44,reg)
104#define ACC1L(reg) @(0x48,reg) 103#define ACC1L(reg) @(0x48,reg)
104#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
105#define ACCH(reg) @(0x3C,reg)
106#define ACCL(reg) @(0x40,reg)
107#else
108#error unknown isa configuration
109#endif
105#define PSW(reg) @(0x4C,reg) 110#define PSW(reg) @(0x4C,reg)
106#define BPC(reg) @(0x50,reg) 111#define BPC(reg) @(0x50,reg)
107#define BBPSW(reg) @(0x54,reg) 112#define BBPSW(reg) @(0x54,reg)
@@ -111,21 +116,6 @@
111#define LR(reg) @(0x64,reg) 116#define LR(reg) @(0x64,reg)
112#define SP(reg) @(0x68,reg) 117#define SP(reg) @(0x68,reg)
113#define ORIG_R0(reg) @(0x6C,reg) 118#define ORIG_R0(reg) @(0x6C,reg)
114#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
115#define ACCH(reg) @(0x3C,reg)
116#define ACCL(reg) @(0x40,reg)
117#define PSW(reg) @(0x44,reg)
118#define BPC(reg) @(0x48,reg)
119#define BBPSW(reg) @(0x4C,reg)
120#define BBPC(reg) @(0x50,reg)
121#define SPU(reg) @(0x54,reg)
122#define FP(reg) @(0x58,reg) /* FP = R13 */
123#define LR(reg) @(0x5C,reg)
124#define SP(reg) @(0x60,reg)
125#define ORIG_R0(reg) @(0x64,reg)
126#else
127#error unknown isa configuration
128#endif
129 119
130CF_MASK = 0x00000001 120CF_MASK = 0x00000001
131TF_MASK = 0x00000100 121TF_MASK = 0x00000100
@@ -142,7 +132,7 @@ VM_MASK = 0x00020000
142#endif 132#endif
143 133
144ENTRY(ret_from_fork) 134ENTRY(ret_from_fork)
145 ld r0, @sp+ 135 pop r0
146 bl schedule_tail 136 bl schedule_tail
147 GET_THREAD_INFO(r8) 137 GET_THREAD_INFO(r8)
148 bra syscall_exit 138 bra syscall_exit
@@ -231,7 +221,7 @@ restore_all:
231 RESTORE_ALL 221 RESTORE_ALL
232 222
233 # perform work that needs to be done immediately before resumption 223 # perform work that needs to be done immediately before resumption
234 # r9 : frags 224 # r9 : flags
235 ALIGN 225 ALIGN
236work_pending: 226work_pending:
237 and3 r4, r9, #_TIF_NEED_RESCHED 227 and3 r4, r9, #_TIF_NEED_RESCHED
@@ -320,7 +310,7 @@ ENTRY(ei_handler)
320; GET_ICU_STATUS; 310; GET_ICU_STATUS;
321 seth r0, #shigh(M32R_ICU_ISTS_ADDR) 311 seth r0, #shigh(M32R_ICU_ISTS_ADDR)
322 ld r0, @(low(M32R_ICU_ISTS_ADDR),r0) 312 ld r0, @(low(M32R_ICU_ISTS_ADDR),r0)
323 st r0, @-sp 313 push r0
324#if defined(CONFIG_SMP) 314#if defined(CONFIG_SMP)
325 /* 315 /*
326 * If IRQ == 0 --> Nothing to do, Not write IMASK 316 * If IRQ == 0 --> Nothing to do, Not write IMASK
@@ -557,7 +547,7 @@ check_end:
557#endif /* CONFIG_PLAT_M32104UT */ 547#endif /* CONFIG_PLAT_M32104UT */
558 bl do_IRQ 548 bl do_IRQ
559#endif /* CONFIG_SMP */ 549#endif /* CONFIG_SMP */
560 ld r14, @sp+ 550 pop r14
561 seth r0, #shigh(M32R_ICU_IMASK_ADDR) 551 seth r0, #shigh(M32R_ICU_IMASK_ADDR)
562 st r14, @(low(M32R_ICU_IMASK_ADDR),r0) 552 st r14, @(low(M32R_ICU_IMASK_ADDR),r0)
563#else 553#else
@@ -1015,4 +1005,3 @@ ENTRY(sys_call_table)
1015 .long sys_waitid 1005 .long sys_waitid
1016 1006
1017syscall_table_size=(.-sys_call_table) 1007syscall_table_size=(.-sys_call_table)
1018
diff --git a/arch/m32r/kernel/m32r_ksyms.c b/arch/m32r/kernel/m32r_ksyms.c
index be8b711367ec..c50330fa83b9 100644
--- a/arch/m32r/kernel/m32r_ksyms.c
+++ b/arch/m32r/kernel/m32r_ksyms.c
@@ -23,9 +23,6 @@ EXPORT_SYMBOL(boot_cpu_data);
23EXPORT_SYMBOL(dump_fpu); 23EXPORT_SYMBOL(dump_fpu);
24EXPORT_SYMBOL(__ioremap); 24EXPORT_SYMBOL(__ioremap);
25EXPORT_SYMBOL(iounmap); 25EXPORT_SYMBOL(iounmap);
26EXPORT_SYMBOL(enable_irq);
27EXPORT_SYMBOL(disable_irq);
28EXPORT_SYMBOL(disable_irq_nosync);
29EXPORT_SYMBOL(kernel_thread); 26EXPORT_SYMBOL(kernel_thread);
30EXPORT_SYMBOL(__down); 27EXPORT_SYMBOL(__down);
31EXPORT_SYMBOL(__down_interruptible); 28EXPORT_SYMBOL(__down_interruptible);
@@ -38,13 +35,6 @@ EXPORT_SYMBOL(__udelay);
38EXPORT_SYMBOL(__delay); 35EXPORT_SYMBOL(__delay);
39EXPORT_SYMBOL(__const_udelay); 36EXPORT_SYMBOL(__const_udelay);
40 37
41EXPORT_SYMBOL(__get_user_1);
42EXPORT_SYMBOL(__get_user_2);
43EXPORT_SYMBOL(__get_user_4);
44
45EXPORT_SYMBOL(strpbrk);
46EXPORT_SYMBOL(strstr);
47
48EXPORT_SYMBOL(strncpy_from_user); 38EXPORT_SYMBOL(strncpy_from_user);
49EXPORT_SYMBOL(__strncpy_from_user); 39EXPORT_SYMBOL(__strncpy_from_user);
50EXPORT_SYMBOL(clear_user); 40EXPORT_SYMBOL(clear_user);
@@ -59,11 +49,8 @@ extern void *dcache_dummy;
59EXPORT_SYMBOL(dcache_dummy); 49EXPORT_SYMBOL(dcache_dummy);
60#endif 50#endif
61EXPORT_SYMBOL(cpu_data); 51EXPORT_SYMBOL(cpu_data);
62EXPORT_SYMBOL(cpu_online_map);
63EXPORT_SYMBOL(cpu_callout_map);
64 52
65/* Global SMP stuff */ 53/* Global SMP stuff */
66EXPORT_SYMBOL(synchronize_irq);
67EXPORT_SYMBOL(smp_call_function); 54EXPORT_SYMBOL(smp_call_function);
68 55
69/* TLB flushing */ 56/* TLB flushing */
@@ -83,27 +70,11 @@ EXPORT_SYMBOL(__lshrdi3);
83EXPORT_SYMBOL(__muldi3); 70EXPORT_SYMBOL(__muldi3);
84 71
85/* memory and string operations */ 72/* memory and string operations */
86EXPORT_SYMBOL(memchr);
87EXPORT_SYMBOL(memcpy); 73EXPORT_SYMBOL(memcpy);
88/* EXPORT_SYMBOL(memcpy_fromio); // not implement yet */
89/* EXPORT_SYMBOL(memcpy_toio); // not implement yet */
90EXPORT_SYMBOL(memset); 74EXPORT_SYMBOL(memset);
91/* EXPORT_SYMBOL(memset_io); // not implement yet */
92EXPORT_SYMBOL(memmove);
93EXPORT_SYMBOL(memcmp);
94EXPORT_SYMBOL(memscan);
95EXPORT_SYMBOL(copy_page); 75EXPORT_SYMBOL(copy_page);
96EXPORT_SYMBOL(clear_page); 76EXPORT_SYMBOL(clear_page);
97
98EXPORT_SYMBOL(strcat);
99EXPORT_SYMBOL(strchr);
100EXPORT_SYMBOL(strcmp);
101EXPORT_SYMBOL(strcpy);
102EXPORT_SYMBOL(strlen); 77EXPORT_SYMBOL(strlen);
103EXPORT_SYMBOL(strncat);
104EXPORT_SYMBOL(strncmp);
105EXPORT_SYMBOL(strnlen);
106EXPORT_SYMBOL(strncpy);
107 78
108EXPORT_SYMBOL(_inb); 79EXPORT_SYMBOL(_inb);
109EXPORT_SYMBOL(_inw); 80EXPORT_SYMBOL(_inw);
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c
index 5dfc7ea45cf7..065f5e719058 100644
--- a/arch/m32r/kernel/process.c
+++ b/arch/m32r/kernel/process.c
@@ -116,6 +116,10 @@ void cpu_idle (void)
116 116
117void machine_restart(char *__unused) 117void machine_restart(char *__unused)
118{ 118{
119#if defined(CONFIG_PLAT_MAPPI3)
120 outw(1, (unsigned long)PLD_REBOOT);
121#endif
122
119 printk("Please push reset button!\n"); 123 printk("Please push reset button!\n");
120 while (1) 124 while (1)
121 cpu_relax(); 125 cpu_relax();
diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c
index 0d78942b4c76..3cd3c2988a48 100644
--- a/arch/m32r/kernel/setup.c
+++ b/arch/m32r/kernel/setup.c
@@ -9,6 +9,7 @@
9 9
10#include <linux/config.h> 10#include <linux/config.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/kernel.h>
12#include <linux/stddef.h> 13#include <linux/stddef.h>
13#include <linux/fs.h> 14#include <linux/fs.h>
14#include <linux/sched.h> 15#include <linux/sched.h>
@@ -219,8 +220,6 @@ static unsigned long __init setup_memory(void)
219extern unsigned long setup_memory(void); 220extern unsigned long setup_memory(void);
220#endif /* CONFIG_DISCONTIGMEM */ 221#endif /* CONFIG_DISCONTIGMEM */
221 222
222#define M32R_PCC_PCATCR 0x00ef7014 /* will move to m32r.h */
223
224void __init setup_arch(char **cmdline_p) 223void __init setup_arch(char **cmdline_p)
225{ 224{
226 ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); 225 ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
@@ -269,15 +268,14 @@ void __init setup_arch(char **cmdline_p)
269 paging_init(); 268 paging_init();
270} 269}
271 270
272static struct cpu cpu[NR_CPUS]; 271static struct cpu cpu_devices[NR_CPUS];
273 272
274static int __init topology_init(void) 273static int __init topology_init(void)
275{ 274{
276 int cpu_id; 275 int i;
277 276
278 for (cpu_id = 0; cpu_id < NR_CPUS; cpu_id++) 277 for_each_present_cpu(i)
279 if (cpu_possible(cpu_id)) 278 register_cpu(&cpu_devices[i], i, NULL);
280 register_cpu(&cpu[cpu_id], cpu_id, NULL);
281 279
282 return 0; 280 return 0;
283} 281}
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c
index cb33097fefc4..6498ee70bb73 100644
--- a/arch/m32r/kernel/signal.c
+++ b/arch/m32r/kernel/signal.c
@@ -118,6 +118,8 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
118#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) 118#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
119 COPY(acch); 119 COPY(acch);
120 COPY(accl); 120 COPY(accl);
121 COPY(dummy_acc1h);
122 COPY(dummy_acc1l);
121#else 123#else
122#error unknown isa configuration 124#error unknown isa configuration
123#endif 125#endif
@@ -203,6 +205,8 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
203#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R) 205#elif defined(CONFIG_ISA_M32R2) || defined(CONFIG_ISA_M32R)
204 COPY(acch); 206 COPY(acch);
205 COPY(accl); 207 COPY(accl);
208 COPY(dummy_acc1h);
209 COPY(dummy_acc1l);
206#else 210#else
207#error unknown isa configuration 211#error unknown isa configuration
208#endif 212#endif
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c
index d7ec16e7fb25..840b4348bf0c 100644
--- a/arch/m32r/kernel/smpboot.c
+++ b/arch/m32r/kernel/smpboot.c
@@ -39,8 +39,10 @@
39 * Martin J. Bligh : Added support for multi-quad systems 39 * Martin J. Bligh : Added support for multi-quad systems
40 */ 40 */
41 41
42#include <linux/module.h>
42#include <linux/config.h> 43#include <linux/config.h>
43#include <linux/init.h> 44#include <linux/init.h>
45#include <linux/kernel.h>
44#include <linux/mm.h> 46#include <linux/mm.h>
45#include <linux/smp_lock.h> 47#include <linux/smp_lock.h>
46#include <linux/irq.h> 48#include <linux/irq.h>
@@ -72,11 +74,15 @@ physid_mask_t phys_cpu_present_map;
72 74
73/* Bitmask of currently online CPUs */ 75/* Bitmask of currently online CPUs */
74cpumask_t cpu_online_map; 76cpumask_t cpu_online_map;
77EXPORT_SYMBOL(cpu_online_map);
75 78
76cpumask_t cpu_bootout_map; 79cpumask_t cpu_bootout_map;
77cpumask_t cpu_bootin_map; 80cpumask_t cpu_bootin_map;
78cpumask_t cpu_callout_map;
79static cpumask_t cpu_callin_map; 81static cpumask_t cpu_callin_map;
82cpumask_t cpu_callout_map;
83EXPORT_SYMBOL(cpu_callout_map);
84cpumask_t cpu_possible_map = CPU_MASK_ALL;
85EXPORT_SYMBOL(cpu_possible_map);
80 86
81/* Per CPU bogomips and other parameters */ 87/* Per CPU bogomips and other parameters */
82struct cpuinfo_m32r cpu_data[NR_CPUS] __cacheline_aligned; 88struct cpuinfo_m32r cpu_data[NR_CPUS] __cacheline_aligned;
@@ -110,7 +116,6 @@ static unsigned int calibration_result;
110 116
111void smp_prepare_boot_cpu(void); 117void smp_prepare_boot_cpu(void);
112void smp_prepare_cpus(unsigned int); 118void smp_prepare_cpus(unsigned int);
113static void smp_tune_scheduling(void);
114static void init_ipi_lock(void); 119static void init_ipi_lock(void);
115static void do_boot_cpu(int); 120static void do_boot_cpu(int);
116int __cpu_up(unsigned int); 121int __cpu_up(unsigned int);
@@ -177,6 +182,9 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
177 } 182 }
178 for (phys_id = 0 ; phys_id < nr_cpu ; phys_id++) 183 for (phys_id = 0 ; phys_id < nr_cpu ; phys_id++)
179 physid_set(phys_id, phys_cpu_present_map); 184 physid_set(phys_id, phys_cpu_present_map);
185#ifndef CONFIG_HOTPLUG_CPU
186 cpu_present_map = cpu_possible_map;
187#endif
180 188
181 show_mp_info(nr_cpu); 189 show_mp_info(nr_cpu);
182 190
@@ -186,7 +194,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
186 * Setup boot CPU information 194 * Setup boot CPU information
187 */ 195 */
188 smp_store_cpu_info(0); /* Final full version of the data */ 196 smp_store_cpu_info(0); /* Final full version of the data */
189 smp_tune_scheduling();
190 197
191 /* 198 /*
192 * If SMP should be disabled, then really disable it! 199 * If SMP should be disabled, then really disable it!
@@ -230,11 +237,6 @@ smp_done:
230 Dprintk("Boot done.\n"); 237 Dprintk("Boot done.\n");
231} 238}
232 239
233static void __init smp_tune_scheduling(void)
234{
235 /* Nothing to do. */
236}
237
238/* 240/*
239 * init_ipi_lock : Initialize IPI locks. 241 * init_ipi_lock : Initialize IPI locks.
240 */ 242 */
@@ -629,4 +631,3 @@ static void __init unmap_cpu_to_physid(int cpu_id, int phys_id)
629 physid_2_cpu[phys_id] = -1; 631 physid_2_cpu[phys_id] = -1;
630 cpu_2_physid[cpu_id] = -1; 632 cpu_2_physid[cpu_id] = -1;
631} 633}
632