From cf204e72ea5fd6e4be8b3295cb148fde5fdd47d2 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 16 Feb 2016 10:07:00 +0000 Subject: Tree reorganization. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8900 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/chsys.h | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'os/rt/include/chsys.h') diff --git a/os/rt/include/chsys.h b/os/rt/include/chsys.h index 6742259e3..6bc3b507f 100644 --- a/os/rt/include/chsys.h +++ b/os/rt/include/chsys.h @@ -52,6 +52,26 @@ /* Derived constants and error checks. */ /*===========================================================================*/ +#if !defined(CH_CFG_IRQ_PROLOGUE_HOOK) +#error "CH_CFG_IRQ_PROLOGUE_HOOK not defined in chconf.h" +#endif + +#if !defined(CH_CFG_IRQ_EPILOGUE_HOOK) +#error "CH_CFG_IRQ_EPILOGUE_HOOK not defined in chconf.h" +#endif + +#if !defined(CH_CFG_CONTEXT_SWITCH_HOOK) +#error "CH_CFG_CONTEXT_SWITCH_HOOK not defined in chconf.h" +#endif + +#if !defined(CH_CFG_SYSTEM_TICK_HOOK) +#error "CH_CFG_SYSTEM_TICK_HOOK not defined in chconf.h" +#endif + +#if !defined(CH_CFG_SYSTEM_HALT_HOOK) +#error "CH_CFG_SYSTEM_HALT_HOOK not defined in chconf.h" +#endif + /*===========================================================================*/ /* Module data structures and types. */ /*===========================================================================*/ @@ -108,7 +128,9 @@ */ #define CH_IRQ_PROLOGUE() \ PORT_IRQ_PROLOGUE(); \ + CH_CFG_IRQ_PROLOGUE_HOOK(); \ _stats_increase_irq(); \ + _dbg_trace_isr_enter(__func__); \ _dbg_check_enter_isr() /** @@ -121,6 +143,8 @@ */ #define CH_IRQ_EPILOGUE() \ _dbg_check_leave_isr(); \ + _dbg_trace_isr_leave(__func__); \ + CH_CFG_IRQ_EPILOGUE_HOOK(); \ PORT_IRQ_EPILOGUE() /** @@ -261,7 +285,7 @@ */ #define chSysSwitch(ntp, otp) { \ \ - _dbg_trace(otp); \ + _dbg_trace_switch(otp); \ _stats_ctxswc(ntp, otp); \ CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp); \ port_switch(ntp, otp); \ @@ -280,7 +304,7 @@ extern "C" { void chSysTimerHandlerI(void); syssts_t chSysGetStatusAndLockX(void); void chSysRestoreStatusX(syssts_t sts); -#if PORT_SUPPORTS_RT +#if PORT_SUPPORTS_RT == TRUE bool chSysIsCounterWithinX(rtcnt_t cnt, rtcnt_t start, rtcnt_t end); void chSysPolledDelayX(rtcnt_t cycles); #endif @@ -364,8 +388,8 @@ static inline void chSysUnlock(void) { in a critical section not followed by a chSchResceduleS(), this means that the current thread has a lower priority than the next thread in the ready list.*/ - chDbgAssert((ch.rlist.r_queue.p_next == (thread_t *)&ch.rlist.r_queue) || - (ch.rlist.r_current->p_prio >= ch.rlist.r_queue.p_next->p_prio), + chDbgAssert((ch.rlist.queue.next == (thread_t *)&ch.rlist.queue) || + (ch.rlist.current->prio >= ch.rlist.queue.next->prio), "priority order violation"); port_unlock(); @@ -453,7 +477,7 @@ static inline void chSysUnconditionalUnlock(void) { */ static inline thread_t *chSysGetIdleThreadX(void) { - return ch.rlist.r_queue.p_prev; + return ch.rlist.queue.prev; } #endif /* CH_CFG_NO_IDLE_THREAD == FALSE */ -- cgit v1.2.3