Module: xenomai-2.6
Branch: master
Commit: 585ea45933c4620dce3bccd98fdd657c0d7a3e2d
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=585ea45933c4620dce3bccd98fdd657c0d7a3e2d

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Dec 27 16:39:44 2011 +0100

hal: detect and enable upcoming pipeline core

---

 include/asm-arm/bits/init.h      |    3 ++-
 include/asm-blackfin/bits/init.h |    3 ++-
 include/asm-generic/hal.h        |    8 ++++++--
 include/asm-nios2/bits/init.h    |    3 ++-
 include/asm-powerpc/bits/init.h  |    5 +++--
 include/asm-sh/bits/init.h       |    3 ++-
 include/asm-x86/bits/init_32.h   |    3 ++-
 include/asm-x86/bits/init_64.h   |    5 +++--
 ksrc/arch/arm/hal.c              |    8 +++++---
 ksrc/arch/blackfin/hal.c         |    8 +++++---
 ksrc/arch/nios2/hal.c            |    8 +++++---
 ksrc/arch/powerpc/hal.c          |    8 +++++---
 ksrc/arch/sh/hal.c               |    8 +++++---
 ksrc/arch/x86/hal-common.c       |    8 +++++---
 ksrc/nucleus/Kconfig             |    1 +
 ksrc/nucleus/shadow.c            |   12 ++++++++----
 16 files changed, 61 insertions(+), 33 deletions(-)

diff --git a/include/asm-arm/bits/init.h b/include/asm-arm/bits/init.h
index 133f9e8..e20339b 100644
--- a/include/asm-arm/bits/init.h
+++ b/include/asm-arm/bits/init.h
@@ -39,7 +39,8 @@ void xnpod_schedule_handler(void);
 
 static rthal_trap_handler_t xnarch_old_trap_handler;
 
-static int xnarch_trap_fault(unsigned event, unsigned domid, void *data)
+static int xnarch_trap_fault(unsigned event,
+                            rthal_pipeline_stage_t *stage, void *data)
 {
        xnarch_fltinfo_t fltinfo;
        fltinfo.exception = event;
diff --git a/include/asm-blackfin/bits/init.h b/include/asm-blackfin/bits/init.h
index e655ad9..2acc636 100644
--- a/include/asm-blackfin/bits/init.h
+++ b/include/asm-blackfin/bits/init.h
@@ -38,7 +38,8 @@ void xnpod_schedule_deferred(void);
 
 static rthal_trap_handler_t xnarch_old_trap_handler;
 
-static int xnarch_trap_fault(unsigned event, unsigned domid, void *data)
+static int xnarch_trap_fault(unsigned event, rthal_pipeline_stage_t *stage,
+                            void *data)
 {
        xnarch_fltinfo_t fltinfo;
        fltinfo.exception = event;
diff --git a/include/asm-generic/hal.h b/include/asm-generic/hal.h
index 940320d..24b78f8 100644
--- a/include/asm-generic/hal.h
+++ b/include/asm-generic/hal.h
@@ -246,7 +246,7 @@ static inline unsigned long rthal_get_clockfreq(void)
 #define RTHAL_DECLARE_EVENT(hdlr)                                     \
 static int hdlr (unsigned event, struct ipipe_domain *ipd, void *data) \
 {                                                                     \
-       return do_##hdlr(event,ipd->domid,data);                       \
+       return do_##hdlr(event,ipd,data);                              \
 }
 
 #define RTHAL_DECLARE_SCHEDULE_EVENT(hdlr)                            \
@@ -440,7 +440,7 @@ struct rthal_apc_desc {
 };
 
 typedef int (*rthal_trap_handler_t)(unsigned trapno,
-                                   unsigned domid,
+                                   rthal_pipeline_stage_t *stage,
                                    void *data);
 
 extern unsigned long rthal_cpufreq_arg;
@@ -544,6 +544,10 @@ rthal_trap_handler_t rthal_trap_catch(rthal_trap_handler_t 
handler);
 unsigned long rthal_timer_calibrate(void);
 
 #ifdef CONFIG_GENERIC_CLOCKEVENTS
+
+enum clock_event_mode;
+struct clock_event_device;
+
 int rthal_timer_request(void (*tick_handler)(void),
                        void (*mode_emul)(enum clock_event_mode mode, struct 
clock_event_device *cdev),
                        int (*tick_emul) (unsigned long delay, struct 
clock_event_device *cdev),
diff --git a/include/asm-nios2/bits/init.h b/include/asm-nios2/bits/init.h
index 90902bd..e776ed4 100644
--- a/include/asm-nios2/bits/init.h
+++ b/include/asm-nios2/bits/init.h
@@ -36,7 +36,8 @@ void xnpod_schedule_handler(void);
 
 static rthal_trap_handler_t xnarch_old_trap_handler;
 
-static int xnarch_trap_fault(unsigned event, unsigned domid, void *data)
+static int xnarch_trap_fault(unsigned event, rthal_pipeline_stage_t *stage,
+                            void *data)
 {
        xnarch_fltinfo_t fltinfo;
        fltinfo.exception = event;
diff --git a/include/asm-powerpc/bits/init.h b/include/asm-powerpc/bits/init.h
index 29529b9..d682169 100644
--- a/include/asm-powerpc/bits/init.h
+++ b/include/asm-powerpc/bits/init.h
@@ -39,11 +39,12 @@ void xnpod_schedule_handler(void);
 
 static rthal_trap_handler_t xnarch_old_trap_handler;
 
-static int xnarch_trap_fault(unsigned event, unsigned domid, void *data)
+static int xnarch_trap_fault(unsigned event, rthal_pipeline_stage_t *stage,
+                            void *data)
 {
        xnarch_fltinfo_t fltinfo;
        fltinfo.exception = event;
-       fltinfo.regs = (struct pt_regs *)data;
+       fltinfo.regs = data;
        return xnpod_trap_fault(&fltinfo);
 }
 
diff --git a/include/asm-sh/bits/init.h b/include/asm-sh/bits/init.h
index 9ac85d4..110ea22 100644
--- a/include/asm-sh/bits/init.h
+++ b/include/asm-sh/bits/init.h
@@ -36,7 +36,8 @@ void xnpod_schedule_handler(void);
 
 static rthal_trap_handler_t xnarch_old_trap_handler;
 
-static int xnarch_trap_fault(unsigned event, unsigned domid, void *data)
+static int xnarch_trap_fault(unsigned event, rthal_pipeline_stage_t *stage,
+                            void *data)
 {
        xnarch_fltinfo_t fltinfo;
        fltinfo.exception = event;
diff --git a/include/asm-x86/bits/init_32.h b/include/asm-x86/bits/init_32.h
index 5df0c5f..ac6ca01 100644
--- a/include/asm-x86/bits/init_32.h
+++ b/include/asm-x86/bits/init_32.h
@@ -37,7 +37,8 @@ void xnpod_schedule_handler(void);
 
 static rthal_trap_handler_t xnarch_old_trap_handler;
 
-static int xnarch_trap_fault(unsigned event, unsigned domid, void *data)
+static int xnarch_trap_fault(unsigned event, rthal_pipeline_stage_t *stage,
+                            void *data)
 {
        struct pt_regs *regs = (struct pt_regs *)data;
        xnarch_fltinfo_t fltinfo;
diff --git a/include/asm-x86/bits/init_64.h b/include/asm-x86/bits/init_64.h
index 075151b..9138ba4 100644
--- a/include/asm-x86/bits/init_64.h
+++ b/include/asm-x86/bits/init_64.h
@@ -37,9 +37,10 @@ void xnpod_schedule_handler(void);
 
 static rthal_trap_handler_t xnarch_old_trap_handler;
 
-static int xnarch_trap_fault(unsigned event, unsigned domid, void *data)
+static int xnarch_trap_fault(unsigned event, rthal_pipeline_stage_t *stage,
+                            void *data)
 {
-       struct pt_regs *regs = (struct pt_regs *)data;
+       struct pt_regs *regs = data;
        xnarch_fltinfo_t fltinfo;
 
        fltinfo.vector = event;
diff --git a/ksrc/arch/arm/hal.c b/ksrc/arch/arm/hal.c
index 6b2c30a..1ba9457 100644
--- a/ksrc/arch/arm/hal.c
+++ b/ksrc/arch/arm/hal.c
@@ -438,13 +438,15 @@ void __rthal_arm_fault_range(struct vm_area_struct *vma)
                                        vma->vm_flags & VM_MAYWRITE);
 }
 
-static inline int do_exception_event(unsigned event, unsigned domid, void 
*data)
+static inline
+int do_exception_event(unsigned event, rthal_pipeline_stage_t *stage,
+                      void *data)
 {
-       if (domid == RTHAL_DOMAIN_ID) {
+       if (stage == &rthal_domain) {
                rthal_realtime_faults[rthal_processor_id()][event]++;
 
                if (rthal_trap_handler != NULL &&
-                   rthal_trap_handler(event, domid, data) != 0)
+                   rthal_trap_handler(event, stage, data) != 0)
                        return RTHAL_EVENT_STOP;
        }
 
diff --git a/ksrc/arch/blackfin/hal.c b/ksrc/arch/blackfin/hal.c
index 871aae8..555c304 100644
--- a/ksrc/arch/blackfin/hal.c
+++ b/ksrc/arch/blackfin/hal.c
@@ -339,13 +339,15 @@ int rthal_irq_host_release(unsigned irq, void *dev_id)
        return 0;
 }
 
-static inline int do_exception_event(unsigned event, unsigned domid, void 
*data)
+static inline
+int do_exception_event(unsigned event, rthal_pipeline_stage_t *stage,
+                      void *data)
 {
-       if (domid == RTHAL_DOMAIN_ID) {
+       if (stage == &rthal_domain) {
                rthal_realtime_faults[rthal_processor_id()][event]++;
 
                if (rthal_trap_handler != NULL &&
-                   rthal_trap_handler(event, domid, data) != 0)
+                   rthal_trap_handler(event, stage, data) != 0)
                        return RTHAL_EVENT_STOP;
        }
 
diff --git a/ksrc/arch/nios2/hal.c b/ksrc/arch/nios2/hal.c
index 96bd23d..824effd 100644
--- a/ksrc/arch/nios2/hal.c
+++ b/ksrc/arch/nios2/hal.c
@@ -166,13 +166,15 @@ int rthal_irq_host_release(unsigned irq, void *dev_id)
        return 0;
 }
 
-static inline int do_exception_event(unsigned event, unsigned domid, void 
*data)
+static inline
+int do_exception_event(unsigned event, rthal_pipeline_stage_t *stage,
+                      void *data)
 {
-       if (domid == RTHAL_DOMAIN_ID) {
+       if (stage == &rthal_domain) {
                rthal_realtime_faults[rthal_processor_id()][event]++;
 
                if (rthal_trap_handler != NULL &&
-                   rthal_trap_handler(event, domid, data) != 0)
+                   rthal_trap_handler(event, stage, data) != 0)
                        return RTHAL_EVENT_STOP;
        }
 
diff --git a/ksrc/arch/powerpc/hal.c b/ksrc/arch/powerpc/hal.c
index d933d96..c5aede8 100644
--- a/ksrc/arch/powerpc/hal.c
+++ b/ksrc/arch/powerpc/hal.c
@@ -396,13 +396,15 @@ int rthal_irq_end(unsigned irq)
        return rthal_irq_chip_end(irq);
 }
 
-static inline int do_exception_event(unsigned event, unsigned domid, void 
*data)
+static inline
+int do_exception_event(unsigned event, rthal_pipeline_stage_t *stage,
+                      void *data)
 {
-       if (domid == RTHAL_DOMAIN_ID) {
+       if (stage == &rthal_domain) {
                rthal_realtime_faults[rthal_processor_id()][event]++;
 
                if (rthal_trap_handler != NULL &&
-                   rthal_trap_handler(event, domid, data) != 0)
+                   rthal_trap_handler(event, stage, data) != 0)
                        return RTHAL_EVENT_STOP;
        }
 
diff --git a/ksrc/arch/sh/hal.c b/ksrc/arch/sh/hal.c
index 85db35a..087122a 100644
--- a/ksrc/arch/sh/hal.c
+++ b/ksrc/arch/sh/hal.c
@@ -204,13 +204,15 @@ int rthal_irq_host_release(unsigned irq, void *dev_id)
        return 0;
 }
 
-static inline int do_exception_event(unsigned event, unsigned domid, void 
*data)
+static inline
+int do_exception_event(unsigned event, rthal_pipeline_stage_t *stage,
+                      void *data)
 {
-       if (domid == RTHAL_DOMAIN_ID) {
+       if (stage == &rthal_domain) {
                rthal_realtime_faults[rthal_processor_id()][event]++;
 
                if (rthal_trap_handler != NULL &&
-                   rthal_trap_handler(event, domid, data) != 0)
+                   rthal_trap_handler(event, stage, data) != 0)
                        return RTHAL_EVENT_STOP;
        }
 
diff --git a/ksrc/arch/x86/hal-common.c b/ksrc/arch/x86/hal-common.c
index 63dac98..7bc73c3 100644
--- a/ksrc/arch/x86/hal-common.c
+++ b/ksrc/arch/x86/hal-common.c
@@ -372,7 +372,9 @@ int rthal_irq_end(unsigned irq)
        return rthal_irq_chip_end(irq);
 }
 
-static inline int do_exception_event(unsigned event, unsigned domid, void 
*data)
+static inline
+int do_exception_event(unsigned event, rthal_pipeline_stage_t *stage,
+                      void *data)
 {
        /* Notes:
 
@@ -396,11 +398,11 @@ static inline int do_exception_event(unsigned event, 
unsigned domid, void *data)
           to refer to an LDT-indexed descriptor above this value would cause
           a GPF.  2) NMI is not pipelined. */
 
-       if (domid == RTHAL_DOMAIN_ID) {
+       if (stage == &rthal_domain) {
                rthal_realtime_faults[rthal_processor_id()][event]++;
 
                if (rthal_trap_handler != NULL &&
-                   rthal_trap_handler(event, domid, data) != 0)
+                   rthal_trap_handler(event, stage, data) != 0)
                        return RTHAL_EVENT_STOP;
        }
 
diff --git a/ksrc/nucleus/Kconfig b/ksrc/nucleus/Kconfig
index 8dad034..afe930f 100644
--- a/ksrc/nucleus/Kconfig
+++ b/ksrc/nucleus/Kconfig
@@ -2,6 +2,7 @@ config XENO_OPT_NUCLEUS
        depends on XENOMAI
        tristate "Nucleus"
        default y
+       select IPIPE_LEGACY if IPIPE_CORE
 
 if XENO_OPT_NUCLEUS != n
 
diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c
index 6268e1a..1a16d79 100644
--- a/ksrc/nucleus/shadow.c
+++ b/ksrc/nucleus/shadow.c
@@ -2228,7 +2228,9 @@ void xnshadow_send_sig(xnthread_t *thread, int sig, int 
arg, int specific)
 }
 EXPORT_SYMBOL_GPL(xnshadow_send_sig);
 
-static inline int do_hisyscall_event(unsigned event, unsigned domid, void 
*data)
+static inline
+int do_hisyscall_event(unsigned event, rthal_pipeline_stage_t *stage,
+                      void *data)
 {
        struct pt_regs *regs = (struct pt_regs *)data;
        int muxid, muxop, switched, err, sigs;
@@ -2307,7 +2309,7 @@ static inline int do_hisyscall_event(unsigned event, 
unsigned domid, void *data)
        if ((sysflags & __xn_exec_lostage) != 0) {
                /* Syscall must run into the Linux domain. */
 
-               if (domid == RTHAL_DOMAIN_ID) {
+               if (stage == &rthal_domain) {
                        /* Request originates from the Xenomai domain: just 
relax the
                           caller and execute the syscall immediately after. */
                        xnshadow_relax(1, SIGDEBUG_MIGRATE_SYSCALL);
@@ -2321,7 +2323,7 @@ static inline int do_hisyscall_event(unsigned event, 
unsigned domid, void *data)
                /* Syscall must be processed either by Xenomai, or by the
                   calling domain. */
 
-               if (domid != RTHAL_DOMAIN_ID)
+               if (stage != &rthal_domain)
                        /* Request originates from the Linux domain: propagate 
the
                           event to our Linux-based handler, so that the caller 
is
                           hardened and the syscall is eventually executed from
@@ -2446,7 +2448,9 @@ static inline int do_hisyscall_event(unsigned event, 
unsigned domid, void *data)
 
 RTHAL_DECLARE_EVENT(hisyscall_event);
 
-static inline int do_losyscall_event(unsigned event, unsigned domid, void 
*data)
+static inline
+int do_losyscall_event(unsigned event, rthal_pipeline_stage_t *stage,
+                      void *data)
 {
        int muxid, muxop, sysflags, switched, err, sigs;
        struct pt_regs *regs = (struct pt_regs *)data;


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

Reply via email to