]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/hexagon/kernel/process.c
Merge remote-tracking branch 'hid/for-next'
[karo-tx-linux.git] / arch / hexagon / kernel / process.c
index 06ae9ffcabd5438d5998a0a02ba1e56bd21334e2..a91b290b923a1fe488c06392905270b9e04a0fb8 100644 (file)
@@ -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,
@@ -112,7 +113,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;
        }
@@ -202,3 +204,40 @@ 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);
+       }
+
+       /* Should not even reach here */
+       panic("%s: bad thread_info flags 0x%08x\n", __func__,
+               thread_info_flags);
+}