diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-23 18:50:11 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-23 18:50:11 -0800 |
commit | 9e2d59ad580d590134285f361a0e80f0e98c0207 (patch) | |
tree | f3232be75781484193413f32ec82c21f6d8eb76e /arch/microblaze/kernel/entry.S | |
parent | 5ce1a70e2f00f0bce0cab57f798ca354b9496169 (diff) | |
parent | 235b80226b986dabcbba844968f7807866bd0bfe (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull signal handling cleanups from Al Viro:
"This is the first pile; another one will come a bit later and will
contain SYSCALL_DEFINE-related patches.
- a bunch of signal-related syscalls (both native and compat)
unified.
- a bunch of compat syscalls switched to COMPAT_SYSCALL_DEFINE
(fixing several potential problems with missing argument
validation, while we are at it)
- a lot of now-pointless wrappers killed
- a couple of architectures (cris and hexagon) forgot to save
altstack settings into sigframe, even though they used the
(uninitialized) values in sigreturn; fixed.
- microblaze fixes for delivery of multiple signals arriving at once
- saner set of helpers for signal delivery introduced, several
architectures switched to using those."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (143 commits)
x86: convert to ksignal
sparc: convert to ksignal
arm: switch to struct ksignal * passing
alpha: pass k_sigaction and siginfo_t using ksignal pointer
burying unused conditionals
make do_sigaltstack() static
arm64: switch to generic old sigaction() (compat-only)
arm64: switch to generic compat rt_sigaction()
arm64: switch compat to generic old sigsuspend
arm64: switch to generic compat rt_sigqueueinfo()
arm64: switch to generic compat rt_sigpending()
arm64: switch to generic compat rt_sigprocmask()
arm64: switch to generic sigaltstack
sparc: switch to generic old sigsuspend
sparc: COMPAT_SYSCALL_DEFINE does all sign-extension as well as SYSCALL_DEFINE
sparc: kill sign-extending wrappers for native syscalls
kill sparc32_open()
sparc: switch to use of generic old sigaction
sparc: switch sys_compat_rt_sigaction() to COMPAT_SYSCALL_DEFINE
mips: switch to generic sys_fork() and sys_clone()
...
Diffstat (limited to 'arch/microblaze/kernel/entry.S')
-rw-r--r-- | arch/microblaze/kernel/entry.S | 62 |
1 files changed, 34 insertions, 28 deletions
diff --git a/arch/microblaze/kernel/entry.S b/arch/microblaze/kernel/entry.S index c217367dfc7..0536bc021cc 100644 --- a/arch/microblaze/kernel/entry.S +++ b/arch/microblaze/kernel/entry.S @@ -354,6 +354,7 @@ C_ENTRY(_user_exception): /* Note Microblaze barrel shift is optional, so don't rely on it */ add r12, r12, r12; /* convert num -> ptr */ add r12, r12, r12; + addi r30, r0, 1 /* restarts allowed */ #ifdef DEBUG /* Trac syscalls and stored them to syscall_debug_table */ @@ -401,26 +402,27 @@ C_ENTRY(ret_from_trap): * trigger rescheduling. */ /* get thread info from current task */ lwi r11, CURRENT_TASK, TS_THREAD_INFO; - lwi r11, r11, TI_FLAGS; /* get flags in thread info */ - andi r11, r11, _TIF_NEED_RESCHED; + lwi r19, r11, TI_FLAGS; /* get flags in thread info */ + andi r11, r19, _TIF_NEED_RESCHED; beqi r11, 5f; bralid r15, schedule; /* Call scheduler */ nop; /* delay slot */ + bri 1b /* Maybe handle a signal */ -5: /* get thread info from current task*/ - lwi r11, CURRENT_TASK, TS_THREAD_INFO; - lwi r11, r11, TI_FLAGS; /* get flags in thread info */ - andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; - beqi r11, 1f; /* Signals to handle, handle them */ +5: + andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; + beqi r11, 4f; /* Signals to handle, handle them */ addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ bralid r15, do_notify_resume; /* Handle any signals */ - addi r6, r0, 1; /* Arg 2: int in_syscall */ + add r6, r30, r0; /* Arg 2: int in_syscall */ + add r30, r0, r0 /* no more restarts */ + bri 1b /* Finally, return to user state. */ -1: set_bip; /* Ints masked for state restore */ +4: set_bip; /* Ints masked for state restore */ swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE); /* save current */ VM_OFF; tophys(r1,r1); @@ -464,6 +466,7 @@ C_ENTRY(ret_from_kernel_thread): add r3, r0, r0 C_ENTRY(sys_rt_sigreturn_wrapper): + addik r30, r0, 0 /* no restarts */ brid sys_rt_sigreturn /* Do real work */ addik r5, r1, 0; /* add user context as 1st arg */ @@ -571,20 +574,20 @@ C_ENTRY(ret_from_exc): /* We're returning to user mode, so check for various conditions that trigger rescheduling. */ +1: lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */ - lwi r11, r11, TI_FLAGS; /* get flags in thread info */ - andi r11, r11, _TIF_NEED_RESCHED; + lwi r19, r11, TI_FLAGS; /* get flags in thread info */ + andi r11, r19, _TIF_NEED_RESCHED; beqi r11, 5f; /* Call the scheduler before returning from a syscall/trap. */ bralid r15, schedule; /* Call scheduler */ nop; /* delay slot */ + bri 1b /* Maybe handle a signal */ -5: lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */ - lwi r11, r11, TI_FLAGS; /* get flags in thread info */ - andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; - beqi r11, 1f; /* Signals to handle, handle them */ +5: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; + beqi r11, 4f; /* Signals to handle, handle them */ /* * Handle a signal return; Pending signals should be in r18. @@ -600,9 +603,10 @@ C_ENTRY(ret_from_exc): addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ bralid r15, do_notify_resume; /* Handle any signals */ addi r6, r0, 0; /* Arg 2: int in_syscall */ + bri 1b /* Finally, return to user state. */ -1: set_bip; /* Ints masked for state restore */ +4: set_bip; /* Ints masked for state restore */ swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE); /* save current */ VM_OFF; tophys(r1,r1); @@ -682,22 +686,23 @@ ret_from_irq: lwi r11, r1, PT_MODE; bnei r11, 2f; +1: lwi r11, CURRENT_TASK, TS_THREAD_INFO; - lwi r11, r11, TI_FLAGS; /* MS: get flags from thread info */ - andi r11, r11, _TIF_NEED_RESCHED; + lwi r19, r11, TI_FLAGS; /* MS: get flags from thread info */ + andi r11, r19, _TIF_NEED_RESCHED; beqi r11, 5f bralid r15, schedule; nop; /* delay slot */ + bri 1b /* Maybe handle a signal */ -5: lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* MS: get thread info */ - lwi r11, r11, TI_FLAGS; /* get flags in thread info */ - andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; +5: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; beqid r11, no_intr_resched /* Handle a signal return; Pending signals should be in r18. */ addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ bralid r15, do_notify_resume; /* Handle any signals */ addi r6, r0, 0; /* Arg 2: int in_syscall */ + bri 1b /* Finally, return to user state. */ no_intr_resched: @@ -815,28 +820,29 @@ dbtrap_call: /* Return point for kernel/user entry + 8 because of rtsd r15, 8 */ lwi r11, r1, PT_MODE; bnei r11, 2f; /* MS: Return to user space - gdb */ +1: /* Get current task ptr into r11 */ lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */ - lwi r11, r11, TI_FLAGS; /* get flags in thread info */ - andi r11, r11, _TIF_NEED_RESCHED; + lwi r19, r11, TI_FLAGS; /* get flags in thread info */ + andi r11, r19, _TIF_NEED_RESCHED; beqi r11, 5f; /* Call the scheduler before returning from a syscall/trap. */ bralid r15, schedule; /* Call scheduler */ nop; /* delay slot */ + bri 1b /* Maybe handle a signal */ -5: lwi r11, CURRENT_TASK, TS_THREAD_INFO; /* get thread info */ - lwi r11, r11, TI_FLAGS; /* get flags in thread info */ - andi r11, r11, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; - beqi r11, 1f; /* Signals to handle, handle them */ +5: andi r11, r19, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME; + beqi r11, 4f; /* Signals to handle, handle them */ addik r5, r1, 0; /* Arg 1: struct pt_regs *regs */ bralid r15, do_notify_resume; /* Handle any signals */ addi r6, r0, 0; /* Arg 2: int in_syscall */ + bri 1b /* Finally, return to user state. */ -1: swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE); /* save current */ +4: swi CURRENT_TASK, r0, PER_CPU(CURRENT_SAVE); /* save current */ VM_OFF; tophys(r1,r1); /* MS: Restore all regs */ |