diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 16:43:05 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 16:43:05 +0200 |
commit | d70b1e06eb331afe1576ac23bb9523708026ba1f (patch) | |
tree | a6e430d45f8f7f37285369dcfd863a0358080c83 /arch/hexagon/kernel/process.c | |
parent | tty: fix up atime/mtime mess, take three (diff) | |
parent | Hexagon: add v4 CS regs to core copyout macro (diff) | |
download | linux-d70b1e06eb331afe1576ac23bb9523708026ba1f.tar.xz linux-d70b1e06eb331afe1576ac23bb9523708026ba1f.zip |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rkuo/linux-hexagon-kernel
Pull Hexagon fixes from Richard Kuo:
"Changes for the Hexagon architecture (and one touching OpenRISC).
They include various fixes to make use of additional arch features and
cleanups. The largest functional change is a cleanup of the signal
and event return paths"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rkuo/linux-hexagon-kernel: (32 commits)
Hexagon: add v4 CS regs to core copyout macro
Hexagon: use correct translation for VMALLOC_START
Hexagon: use correct translations for DMA mappings
Hexagon: fix return value for notify_resume case in do_work_pending
Hexagon: fix signal number for user mem faults
Hexagon: remove two Kconfig entries
arch: remove CONFIG_GENERIC_FIND_NEXT_BIT again
Hexagon: update copyright dates
Hexagon: add translation types for __vmnewmap
Hexagon: fix signal.c compile error
Hexagon: break up user fn/arg register setting
Hexagon: use generic sys_fork, sys_vfork, and sys_clone
Hexagon: fix psp/sp macro
Hexagon: fix up int enable/disable at ret_from_fork
Hexagon: add IOMEM and _relaxed IO macros
Hexagon: switch to using the device type for IO mappings
Hexagon: don't print info for offline CPU's
Hexagon: add support for single-stepping (v4+)
Hexagon: use correct work mask when checking for more work
Hexagon: add support for additional exceptions
...
Diffstat (limited to 'arch/hexagon/kernel/process.c')
-rw-r--r-- | arch/hexagon/kernel/process.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/arch/hexagon/kernel/process.c b/arch/hexagon/kernel/process.c index 9b948c619a03..0a0dd5c05b46 100644 --- a/arch/hexagon/kernel/process.c +++ b/arch/hexagon/kernel/process.c @@ -24,6 +24,7 @@ #include <linux/tick.h> #include <linux/uaccess.h> #include <linux/slab.h> +#include <linux/tracehook.h> /* * Program thread launch. Often defined as a macro in processor.h, @@ -95,7 +96,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, if (unlikely(p->flags & PF_KTHREAD)) { memset(childregs, 0, sizeof(struct pt_regs)); /* r24 <- fn, r25 <- arg */ - ss->r2524 = usp | ((u64)arg << 32); + ss->r24 = usp; + ss->r25 = arg; pt_set_kmode(childregs); return 0; } @@ -185,3 +187,41 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) { return 0; } + + +/* + * Called on the exit path of event entry; see vm_entry.S + * + * Interrupts will already be disabled. + * + * Returns 0 if there's no need to re-check for more work. + */ + +int do_work_pending(struct pt_regs *regs, u32 thread_info_flags) +{ + if (!(thread_info_flags & _TIF_WORK_MASK)) { + return 0; + } /* shortcut -- no work to be done */ + + local_irq_enable(); + + if (thread_info_flags & _TIF_NEED_RESCHED) { + schedule(); + return 1; + } + + if (thread_info_flags & _TIF_SIGPENDING) { + do_signal(regs); + return 1; + } + + if (thread_info_flags & _TIF_NOTIFY_RESUME) { + clear_thread_flag(TIF_NOTIFY_RESUME); + tracehook_notify_resume(regs); + return 1; + } + + /* Should not even reach here */ + panic("%s: bad thread_info flags 0x%08x\n", __func__, + thread_info_flags); +} |