Module: xenomai-3
Branch: next
Commit: 7d1f72341af275ca6853150fb7489d7ae828db0d
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=7d1f72341af275ca6853150fb7489d7ae828db0d

Author: Don Mahurin <d...@mperpetuo.com>
Date:   Mon Sep 14 12:52:27 2015 -0700

cobalt/arm64: Use empty mayday implementation for arm64.

The arm mayday implementation was not correct for arm64. Replace with empty 
implementation.
Handle mayday in the linux domain, using xnthread_relax. This change is 
essentially the same as the general change proposed in the 'Mayday issues 
again' discussion (Jan Kiszka, Jun 21), though only applied to arch/arm64.

---

 kernel/cobalt/arch/arm64/mayday.c |   86 +------------------------------------
 1 file changed, 1 insertion(+), 85 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/mayday.c 
b/kernel/cobalt/arch/arm64/mayday.c
index bc51ad6..ca1151c 100644
--- a/kernel/cobalt/arch/arm64/mayday.c
+++ b/kernel/cobalt/arch/arm64/mayday.c
@@ -28,72 +28,6 @@ static void *mayday;
 
 static inline void setup_mayday(void *page)
 {
-       /*
-        * We want this code to appear at the top of the MAYDAY page:
-        *
-        * ifdef ARM_EABI
-        *
-        * e59f000c     ldr     r0, [pc, #12]
-        * e59f700c     ldr     r7, [pc, #12]
-        * ef000000     svc     0x00000000
-        * e3a00000     mov     r0, #0
-        * e5800000     str     r0, [r0]        ; <bug>
-        * 1000005e     .word   0x1000005e      ; sc_cobalt_mayday | 
__COBALT_SYSCALL_BIT
-        * 000f0042     .word   0x000f0042
-        *
-        * elif ARM_OABI
-        *
-        * e59f0008     ldr     r0, [pc, #8]
-        * ef9f0042     swi     0x009f0042
-        * e3a00000     mov     r0, #0
-        * e5800000     str     r0, [r0]        ; <bug>
-        * 1000005e     .word   0x1000005e      ; sc_cobalt_mayday | 
__COBALT_SYSCALL_BIT
-        *
-        * endif
-        *
-        * 32bit instruction words will be laid out by the compiler as
-        * the target endianness requires.
-        *
-        * We don't mess with CPSR here, so no need to save/restore it
-        * in handle/fixup code.
-        */
-#ifdef __ARM_EABI__
-       static const struct {
-               u32 ldr_r0;
-               u32 ldr_r7;
-               u32 swi_0;
-               u32 mov_r0;
-               u32 str_r0;
-               u32 cst_r0;
-               u32 cst_r7;
-       } code = {
-               .ldr_r0 = 0xe59f000c,
-               .ldr_r7 = 0xe59f700c,
-               .swi_0 = 0xef000000,
-               .mov_r0 = 0xe3a00000,
-               .str_r0 = 0xe5800000,
-               .cst_r0 =  __xn_syscode(sc_cobalt_mayday),
-               .cst_r7 = 0x000f0042,
-       };
-#else /* OABI */
-       static const struct {
-               u32 ldr_r0;
-               u32 swi_syscall;
-               u32 mov_r0;
-               u32 str_r0;
-               u32 cst_r0;
-       } code = {
-               .ldr_r0 = 0xe59f0008,
-               .swi_syscall = 0xef9f0042,
-               .mov_r0 = 0xe3a00000,
-               .str_r0 = 0xe5800000,
-               .cst_r0 =  __xn_syscode(sc_cobalt_mayday),
-       };
-#endif /* OABI */
-
-       memcpy(page, &code, sizeof(code));
-
-       flush_dcache_page(vmalloc_to_page(page));
 }
 
 int xnarch_init_mayday(void)
@@ -120,27 +54,9 @@ void *xnarch_get_mayday_page(void)
 void xnarch_handle_mayday(struct xnarchtcb *tcb, struct pt_regs *regs,
                          unsigned long tramp)
 {
-       tcb->mayday.pc = regs->pc;
-       tcb->mayday.r0 = regs->regs[0];
-#ifdef __ARM_EABI__
-       tcb->mayday.r7 = regs->regs[7];
-#endif
-#ifdef CONFIG_ARM_THUMB
-       /* The code on the mayday page must be run in ARM mode */
-       tcb->mayday.psr = regs->cpsr;
-       regs->cpsr &= ~PSR_T_BIT;
-#endif
-       regs->pc = tramp;
+       xnthread_relax(0, 0);
 }
 
 void xnarch_fixup_mayday(struct xnarchtcb *tcb, struct pt_regs *regs)
 {
-       regs->pc = tcb->mayday.pc;
-       regs->regs[0] = tcb->mayday.r0;
-#ifdef __ARM_EABI__
-       regs->regs[7] = tcb->mayday.r7;
-#endif
-#ifdef CONFIG_ARM_THUMB
-       regs->cpsr = tcb->mayday.psr;
-#endif
 }


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

Reply via email to