aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include/chsys.h
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-02-16 10:07:00 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-02-16 10:07:00 +0000
commitcf204e72ea5fd6e4be8b3295cb148fde5fdd47d2 (patch)
tree5aae4b9a6c78c8f14c2a6ca8cd6446f42b3b29bd /os/rt/include/chsys.h
parent641f2c372605cf405f0dda8536b45a78e0e5e2e2 (diff)
downloadChibiOS-cf204e72ea5fd6e4be8b3295cb148fde5fdd47d2.tar.gz
ChibiOS-cf204e72ea5fd6e4be8b3295cb148fde5fdd47d2.tar.bz2
ChibiOS-cf204e72ea5fd6e4be8b3295cb148fde5fdd47d2.zip
Tree reorganization.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8900 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/include/chsys.h')
-rw-r--r--os/rt/include/chsys.h34
1 files changed, 29 insertions, 5 deletions
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 */