Module: xenomai-head
Branch: master
Commit: 93e49ed0abffa9e2c5fe8c880cd180103202d638
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=93e49ed0abffa9e2c5fe8c880cd180103202d638

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Oct 18 18:06:17 2010 +0200

powerpc: remove RT signal handling from syscall path

---

 include/asm-powerpc/bits/shadow.h |   10 ++-----
 include/asm-powerpc/syscall.h     |   51 +++++++++++-------------------------
 include/asm-powerpc/system.h      |    1 -
 3 files changed, 19 insertions(+), 43 deletions(-)

diff --git a/include/asm-powerpc/bits/shadow.h 
b/include/asm-powerpc/bits/shadow.h
index 319f48d..a274295 100644
--- a/include/asm-powerpc/bits/shadow.h
+++ b/include/asm-powerpc/bits/shadow.h
@@ -74,21 +74,19 @@ static inline void xnarch_setup_mayday_page(void *page)
         *
         * 3c 00 0b 00  lis     r0,mux_code@h
         * 60 00 02 2b  ori     r0,r0,mux_code@l
-        * 39 00 00 00  li      r8,0
         * 44 00 00 02  sc
         * 00 b0 0b 00  .long   0x00b00b00 <illegal insn>
         *
         * We don't mess with CCR here, so no need to save/restore it
         * in handle/fixup code.
         */
-       u32 mux, insn[5];
+       u32 mux, insn[4];
 
        mux = __xn_mux_code(0, __xn_sys_mayday);
        insn[0] = 0x3c000000 | (mux >> 16);
        insn[1] = 0x60000000 | (mux & 0xffff);
-       insn[2] = 0x39000000;
-       insn[3] = 0x44000002;
-       insn[4] = 0x00b00b00;
+       insn[2] = 0x44000002;
+       insn[3] = 0x00b00b00;
        memcpy(page, insn, sizeof(insn));
 
        flush_dcache_range((unsigned long)page,
@@ -106,7 +104,6 @@ static inline void xnarch_handle_mayday(struct xnarchtcb 
*tcb,
 {
        tcb->mayday.nip = regs->nip;
        tcb->mayday.r0 = regs->gpr[0];
-       tcb->mayday.r8 = regs->gpr[8];
        regs->nip = tramp;
 }
 
@@ -115,7 +112,6 @@ static inline void xnarch_fixup_mayday(struct xnarchtcb 
*tcb,
 {
        regs->nip = tcb->mayday.nip;
        regs->gpr[0] = tcb->mayday.r0;
-       regs->gpr[8] = tcb->mayday.r8;
 }
 
 #endif /* XNARCH_HAVE_MAYDAY */
diff --git a/include/asm-powerpc/syscall.h b/include/asm-powerpc/syscall.h
index 2d307e2..d5bb809 100644
--- a/include/asm-powerpc/syscall.h
+++ b/include/asm-powerpc/syscall.h
@@ -43,7 +43,6 @@
 #define __xn_reg_arg3(regs)   ((regs)->gpr[5])
 #define __xn_reg_arg4(regs)   ((regs)->gpr[6])
 #define __xn_reg_arg5(regs)   ((regs)->gpr[7])
-#define __xn_reg_sigp(regs)   ((regs)->gpr[8])
 
 #define __xn_reg_mux_p(regs)        ((__xn_reg_mux(regs) & 0xffff) == 
__xn_sys_mux)
 #define __xn_mux_id(regs)           ((__xn_reg_mux(regs) >> 16) & 0xff)
@@ -89,33 +88,32 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
  * services in kernel space.
  */
 
-#define LOADARGS_0(muxcode, sigp, dummy...)                    \
-       __sc_0 = (unsigned long)(muxcode);                      \
-       __sc_8 = (unsigned long) (sigp)
-#define LOADARGS_1(muxcode, sigp, arg1)                                \
-       LOADARGS_0(muxcode, sigp);                              \
+#define LOADARGS_0(muxcode, dummy...)                  \
+       __sc_0 = (unsigned long)(muxcode)
+#define LOADARGS_1(muxcode, arg1)                      \
+       LOADARGS_0(muxcode);                            \
        __sc_3 = (unsigned long) (arg1)
-#define LOADARGS_2(muxcode, sigp, arg1, arg2)                  \
-       LOADARGS_1(muxcode, sigp, arg1);                        \
+#define LOADARGS_2(muxcode, arg1, arg2)                        \
+       LOADARGS_1(muxcode, arg1);                      \
        __sc_4 = (unsigned long) (arg2)
-#define LOADARGS_3(muxcode, sigp, arg1, arg2, arg3)            \
-       LOADARGS_2(muxcode, sigp, arg1, arg2);                  \
+#define LOADARGS_3(muxcode, arg1, arg2, arg3)          \
+       LOADARGS_2(muxcode, arg1, arg2);                \
        __sc_5 = (unsigned long) (arg3)
-#define LOADARGS_4(muxcode, sigp, arg1, arg2, arg3, arg4)      \
-       LOADARGS_3(muxcode, sigp, arg1, arg2, arg3);            \
+#define LOADARGS_4(muxcode, arg1, arg2, arg3, arg4)    \
+       LOADARGS_3(muxcode, arg1, arg2, arg3);          \
        __sc_6 = (unsigned long) (arg4)
-#define LOADARGS_5(muxcode, sigp, arg1, arg2, arg3, arg4, arg5)        \
-       LOADARGS_4(muxcode, sigp, arg1, arg2, arg3, arg4);      \
+#define LOADARGS_5(muxcode, arg1, arg2, arg3, arg4, arg5) \
+       LOADARGS_4(muxcode, arg1, arg2, arg3, arg4);    \
        __sc_7 = (unsigned long) (arg5)
 
-#define ASM_INPUT_0 "0" (__sc_0), "6" (__sc_8)
+#define ASM_INPUT_0 "0" (__sc_0)
 #define ASM_INPUT_1 ASM_INPUT_0, "1" (__sc_3)
 #define ASM_INPUT_2 ASM_INPUT_1, "2" (__sc_4)
 #define ASM_INPUT_3 ASM_INPUT_2, "3" (__sc_5)
 #define ASM_INPUT_4 ASM_INPUT_3, "4" (__sc_6)
 #define ASM_INPUT_5 ASM_INPUT_4, "5" (__sc_7)
 
-#define XENOMAI_DO_SYSCALL_INNER(nr, shifted_id, op, args...)  \
+#define XENOMAI_DO_SYSCALL(nr, shifted_id, op, args...)                \
   ({                                                           \
        register unsigned long __sc_0  __asm__ ("r0");          \
        register unsigned long __sc_3  __asm__ ("r3");          \
@@ -123,7 +121,6 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
        register unsigned long __sc_5  __asm__ ("r5");          \
        register unsigned long __sc_6  __asm__ ("r6");          \
        register unsigned long __sc_7  __asm__ ("r7");          \
-       register unsigned long __sc_8  __asm__ ("r8");          \
                                                                \
        LOADARGS_##nr(__xn_mux_code(shifted_id,op), args);      \
        __asm__ __volatile__                                    \
@@ -132,27 +129,13 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
                : "=&r" (__sc_0),                               \
                  "=&r" (__sc_3),  "=&r" (__sc_4),              \
                  "=&r" (__sc_5),  "=&r" (__sc_6),              \
-                 "=&r" (__sc_7), "=&r" (__sc_8)                \
+                 "=&r" (__sc_7)                                \
                : ASM_INPUT_##nr                                \
                : "cr0", "ctr", "memory",                       \
-                 "r9", "r10","r11", "r12");                    \
+                 "r8", "r9", "r10","r11", "r12");              \
        (int)((__sc_0 & (1 << 28)) ? -__sc_3 : __sc_3);         \
   })
 
-#define XENOMAI_DO_SYSCALL(nr, shifted_id, op, args...)                        
\
-       ({                                                              \
-               int err, res = -ERESTART;                               \
-               struct xnsig sigs;                                      \
-                                                                       \
-               do {                                                    \
-                       sigs.nsigs = 0;                                 \
-                       err = XENOMAI_DO_SYSCALL_INNER(nr, shifted_id,  \
-                                                      op, &sigs, args); \
-                       res = xnsig_dispatch(&sigs, res, err);          \
-               } while (res == -ERESTART);                             \
-               res;                                                    \
-       })
-
 #define XENOMAI_SYSCALL0(op)                XENOMAI_DO_SYSCALL(0,0,op)
 #define XENOMAI_SYSCALL1(op,a1)             XENOMAI_DO_SYSCALL(1,0,op,a1)
 #define XENOMAI_SYSCALL2(op,a1,a2)          XENOMAI_DO_SYSCALL(2,0,op,a1,a2)
@@ -160,8 +143,6 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
 #define XENOMAI_SYSCALL4(op,a1,a2,a3,a4)    
XENOMAI_DO_SYSCALL(4,0,op,a1,a2,a3,a4)
 #define XENOMAI_SYSCALL5(op,a1,a2,a3,a4,a5) 
XENOMAI_DO_SYSCALL(5,0,op,a1,a2,a3,a4,a5)
 #define XENOMAI_SYSBIND(a1,a2,a3,a4)        
XENOMAI_DO_SYSCALL(4,0,__xn_sys_bind,a1,a2,a3,a4)
-#define XENOMAI_SYSSIGS(sigs)                                          \
-       XENOMAI_DO_SYSCALL_INNER(0, 0, __xn_sys_get_next_sigs, sigs)
 
 #define XENOMAI_SKINCALL0(id,op)                XENOMAI_DO_SYSCALL(0,id,op)
 #define XENOMAI_SKINCALL1(id,op,a1)             XENOMAI_DO_SYSCALL(1,id,op,a1)
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index 5cc4a23..53fd59d 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -55,7 +55,6 @@ typedef struct xnarchtcb {    /* Per-thread arch-dependent 
block */
        struct {
                unsigned long nip;
                unsigned long r0;
-               unsigned long r8;
        } mayday;
 #endif
        /* Kernel mode side */


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to