diff options
| author | Dave Kleikamp <shaggy@austin.ibm.com> | 2006-03-14 18:05:45 -0500 |
|---|---|---|
| committer | Dave Kleikamp <shaggy@austin.ibm.com> | 2006-03-14 18:05:45 -0500 |
| commit | c5111f504d2a9b0d258d7c4752b4093523315989 (patch) | |
| tree | 6a52864aff79691689aea21cb0cb928327d5de5b /arch/m32r/kernel | |
| parent | 69eb66d7da7dba2696281981347698e1693c2340 (diff) | |
| parent | a488edc914aa1d766a4e2c982b5ae03d5657ec1b (diff) | |
Merge with /home/shaggy/git/linus-clean/
Diffstat (limited to 'arch/m32r/kernel')
| -rw-r--r-- | arch/m32r/kernel/m32r_ksyms.c | 5 | ||||
| -rw-r--r-- | arch/m32r/kernel/setup.c | 6 | ||||
| -rw-r--r-- | arch/m32r/kernel/signal.c | 24 | ||||
| -rw-r--r-- | arch/m32r/kernel/sys_m32r.c | 61 |
4 files changed, 44 insertions, 52 deletions
diff --git a/arch/m32r/kernel/m32r_ksyms.c b/arch/m32r/kernel/m32r_ksyms.c index dbc8a392105f..be8b711367ec 100644 --- a/arch/m32r/kernel/m32r_ksyms.c +++ b/arch/m32r/kernel/m32r_ksyms.c | |||
| @@ -18,11 +18,6 @@ | |||
| 18 | #include <asm/irq.h> | 18 | #include <asm/irq.h> |
| 19 | #include <asm/tlbflush.h> | 19 | #include <asm/tlbflush.h> |
| 20 | 20 | ||
| 21 | #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE) | ||
| 22 | extern struct drive_info_struct drive_info; | ||
| 23 | EXPORT_SYMBOL(drive_info); | ||
| 24 | #endif | ||
| 25 | |||
| 26 | /* platform dependent support */ | 21 | /* platform dependent support */ |
| 27 | EXPORT_SYMBOL(boot_cpu_data); | 22 | EXPORT_SYMBOL(boot_cpu_data); |
| 28 | EXPORT_SYMBOL(dump_fpu); | 23 | EXPORT_SYMBOL(dump_fpu); |
diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c index c2e4dccf0112..d742037a7ccb 100644 --- a/arch/m32r/kernel/setup.c +++ b/arch/m32r/kernel/setup.c | |||
| @@ -37,12 +37,6 @@ | |||
| 37 | extern void init_mmu(void); | 37 | extern void init_mmu(void); |
| 38 | #endif | 38 | #endif |
| 39 | 39 | ||
| 40 | #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) \ | ||
| 41 | || defined(CONFIG_BLK_DEV_IDE_MODULE) \ | ||
| 42 | || defined(CONFIG_BLK_DEV_HD_MODULE) | ||
| 43 | struct drive_info_struct { char dummy[32]; } drive_info; | ||
| 44 | #endif | ||
| 45 | |||
| 46 | extern char _end[]; | 40 | extern char _end[]; |
| 47 | 41 | ||
| 48 | /* | 42 | /* |
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c index 71763f7a1d19..cb33097fefc4 100644 --- a/arch/m32r/kernel/signal.c +++ b/arch/m32r/kernel/signal.c | |||
| @@ -36,7 +36,7 @@ int do_signal(struct pt_regs *, sigset_t *); | |||
| 36 | asmlinkage int | 36 | asmlinkage int |
| 37 | sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, | 37 | sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, |
| 38 | unsigned long r2, unsigned long r3, unsigned long r4, | 38 | unsigned long r2, unsigned long r3, unsigned long r4, |
| 39 | unsigned long r5, unsigned long r6, struct pt_regs regs) | 39 | unsigned long r5, unsigned long r6, struct pt_regs *regs) |
| 40 | { | 40 | { |
| 41 | sigset_t saveset, newset; | 41 | sigset_t saveset, newset; |
| 42 | 42 | ||
| @@ -54,21 +54,21 @@ sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, | |||
| 54 | recalc_sigpending(); | 54 | recalc_sigpending(); |
| 55 | spin_unlock_irq(¤t->sighand->siglock); | 55 | spin_unlock_irq(¤t->sighand->siglock); |
| 56 | 56 | ||
| 57 | regs.r0 = -EINTR; | 57 | regs->r0 = -EINTR; |
| 58 | while (1) { | 58 | while (1) { |
| 59 | current->state = TASK_INTERRUPTIBLE; | 59 | current->state = TASK_INTERRUPTIBLE; |
| 60 | schedule(); | 60 | schedule(); |
| 61 | if (do_signal(®s, &saveset)) | 61 | if (do_signal(regs, &saveset)) |
| 62 | return regs.r0; | 62 | return regs->r0; |
| 63 | } | 63 | } |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | asmlinkage int | 66 | asmlinkage int |
| 67 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | 67 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, |
| 68 | unsigned long r2, unsigned long r3, unsigned long r4, | 68 | unsigned long r2, unsigned long r3, unsigned long r4, |
| 69 | unsigned long r5, unsigned long r6, struct pt_regs regs) | 69 | unsigned long r5, unsigned long r6, struct pt_regs *regs) |
| 70 | { | 70 | { |
| 71 | return do_sigaltstack(uss, uoss, regs.spu); | 71 | return do_sigaltstack(uss, uoss, regs->spu); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | 74 | ||
| @@ -140,11 +140,10 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, | |||
| 140 | asmlinkage int | 140 | asmlinkage int |
| 141 | sys_rt_sigreturn(unsigned long r0, unsigned long r1, | 141 | sys_rt_sigreturn(unsigned long r0, unsigned long r1, |
| 142 | unsigned long r2, unsigned long r3, unsigned long r4, | 142 | unsigned long r2, unsigned long r3, unsigned long r4, |
| 143 | unsigned long r5, unsigned long r6, struct pt_regs regs) | 143 | unsigned long r5, unsigned long r6, struct pt_regs *regs) |
| 144 | { | 144 | { |
| 145 | struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs.spu; | 145 | struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs->spu; |
| 146 | sigset_t set; | 146 | sigset_t set; |
| 147 | stack_t st; | ||
| 148 | int result; | 147 | int result; |
| 149 | 148 | ||
| 150 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) | 149 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
| @@ -158,14 +157,11 @@ sys_rt_sigreturn(unsigned long r0, unsigned long r1, | |||
| 158 | recalc_sigpending(); | 157 | recalc_sigpending(); |
| 159 | spin_unlock_irq(¤t->sighand->siglock); | 158 | spin_unlock_irq(¤t->sighand->siglock); |
| 160 | 159 | ||
| 161 | if (restore_sigcontext(®s, &frame->uc.uc_mcontext, &result)) | 160 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &result)) |
| 162 | goto badframe; | 161 | goto badframe; |
| 163 | 162 | ||
| 164 | if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st))) | 163 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->spu) == -EFAULT) |
| 165 | goto badframe; | 164 | goto badframe; |
| 166 | /* It is more difficult to avoid calling this function than to | ||
| 167 | call it and ignore errors. */ | ||
| 168 | do_sigaltstack(&st, NULL, regs.spu); | ||
| 169 | 165 | ||
| 170 | return result; | 166 | return result; |
| 171 | 167 | ||
diff --git a/arch/m32r/kernel/sys_m32r.c b/arch/m32r/kernel/sys_m32r.c index fe55b28d3725..670cb49210af 100644 --- a/arch/m32r/kernel/sys_m32r.c +++ b/arch/m32r/kernel/sys_m32r.c | |||
| @@ -29,28 +29,7 @@ | |||
| 29 | 29 | ||
| 30 | /* | 30 | /* |
| 31 | * sys_tas() - test-and-set | 31 | * sys_tas() - test-and-set |
| 32 | * linuxthreads testing version | ||
| 33 | */ | 32 | */ |
| 34 | #ifndef CONFIG_SMP | ||
| 35 | asmlinkage int sys_tas(int *addr) | ||
| 36 | { | ||
| 37 | int oldval; | ||
| 38 | unsigned long flags; | ||
| 39 | |||
| 40 | if (!access_ok(VERIFY_WRITE, addr, sizeof (int))) | ||
| 41 | return -EFAULT; | ||
| 42 | local_irq_save(flags); | ||
| 43 | oldval = *addr; | ||
| 44 | if (!oldval) | ||
| 45 | *addr = 1; | ||
| 46 | local_irq_restore(flags); | ||
| 47 | return oldval; | ||
| 48 | } | ||
| 49 | #else /* CONFIG_SMP */ | ||
| 50 | #include <linux/spinlock.h> | ||
| 51 | |||
| 52 | static DEFINE_SPINLOCK(tas_lock); | ||
| 53 | |||
| 54 | asmlinkage int sys_tas(int *addr) | 33 | asmlinkage int sys_tas(int *addr) |
| 55 | { | 34 | { |
| 56 | int oldval; | 35 | int oldval; |
| @@ -58,15 +37,43 @@ asmlinkage int sys_tas(int *addr) | |||
| 58 | if (!access_ok(VERIFY_WRITE, addr, sizeof (int))) | 37 | if (!access_ok(VERIFY_WRITE, addr, sizeof (int))) |
| 59 | return -EFAULT; | 38 | return -EFAULT; |
| 60 | 39 | ||
| 61 | _raw_spin_lock(&tas_lock); | 40 | /* atomic operation: |
| 62 | oldval = *addr; | 41 | * oldval = *addr; *addr = 1; |
| 63 | if (!oldval) | 42 | */ |
| 64 | *addr = 1; | 43 | __asm__ __volatile__ ( |
| 65 | _raw_spin_unlock(&tas_lock); | 44 | DCACHE_CLEAR("%0", "r4", "%1") |
| 45 | " .fillinsn\n" | ||
| 46 | "1:\n" | ||
| 47 | " lock %0, @%1 -> unlock %2, @%1\n" | ||
| 48 | "2:\n" | ||
| 49 | /* NOTE: | ||
| 50 | * The m32r processor can accept interrupts only | ||
| 51 | * at the 32-bit instruction boundary. | ||
| 52 | * So, in the above code, the "unlock" instruction | ||
| 53 | * can be executed continuously after the "lock" | ||
| 54 | * instruction execution without any interruptions. | ||
| 55 | */ | ||
| 56 | ".section .fixup,\"ax\"\n" | ||
| 57 | " .balign 4\n" | ||
| 58 | "3: ldi %0, #%3\n" | ||
| 59 | " seth r14, #high(2b)\n" | ||
| 60 | " or3 r14, r14, #low(2b)\n" | ||
| 61 | " jmp r14\n" | ||
| 62 | ".previous\n" | ||
| 63 | ".section __ex_table,\"a\"\n" | ||
| 64 | " .balign 4\n" | ||
| 65 | " .long 1b,3b\n" | ||
| 66 | ".previous\n" | ||
| 67 | : "=&r" (oldval) | ||
| 68 | : "r" (addr), "r" (1), "i"(-EFAULT) | ||
| 69 | : "r14", "memory" | ||
| 70 | #ifdef CONFIG_CHIP_M32700_TS1 | ||
| 71 | , "r4" | ||
| 72 | #endif /* CONFIG_CHIP_M32700_TS1 */ | ||
| 73 | ); | ||
| 66 | 74 | ||
| 67 | return oldval; | 75 | return oldval; |
| 68 | } | 76 | } |
| 69 | #endif /* CONFIG_SMP */ | ||
| 70 | 77 | ||
| 71 | /* | 78 | /* |
| 72 | * sys_pipe() is the normal C calling standard for creating | 79 | * sys_pipe() is the normal C calling standard for creating |
