[rtems-tools commit] Change to use the task implemenation interface.
Chris Johns
chrisj at rtems.org
Thu Oct 15 10:06:14 UTC 2015
Module: rtems-tools
Branch: master
Commit: f11d18b9b1f438b2dc83b92e39d945d5ac654bbd
Changeset: http://git.rtems.org/rtems-tools/commit/?id=f11d18b9b1f438b2dc83b92e39d945d5ac654bbd
Author: Chris Johns <chrisj at rtems.org>
Date: Thu Oct 15 21:05:29 2015 +1100
Change to use the task implemenation interface.
---
linkers/rtld-trace-buffer.ini | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/linkers/rtld-trace-buffer.ini b/linkers/rtld-trace-buffer.ini
index f018410..af9fc31 100644
--- a/linkers/rtld-trace-buffer.ini
+++ b/linkers/rtld-trace-buffer.ini
@@ -25,6 +25,7 @@ buffer-local = " uint8_t* in;"
[trace-buffer-generator-headers]
header = "#include <stdint.h>"
header = "#include <rtems.h>"
+header = "#include <rtems/rtems/tasksimpl.h>"
[trace-buffer-tracers]
code = <<<CODE
@@ -65,27 +66,31 @@ uint32_t __rtld_tbg_buffer[RTLD_TRACE_BUFFER_WORDS];
volatile uint32_t __rtld_tbg_buffer_in;
volatile bool __rtld_tbg_finished;
volatile bool __rtld_tbg_triggered;
-rtems_interrupt_lock __rtld_tbg_lock = RTEMS_INTERRUPT_LOCK_INITIALIZER("rtld-trace-buffer");
+/*
+ * Lock the access.
+ */
+RTEMS_INTERRUPT_LOCK_DEFINE(static, __rtld_tbg_lock, "rtld-trace-buffer");
static inline uint32_t __rtld_tbg_in_irq(void)
{
- return _ISR_Nest_level ? (1 << 31) : 0;
+ return rtems_interrupt_is_in_progress() ? (1 << 31) : 0;
}
static inline uint32_t __rtld_tbg_executing_id(void)
{
- return _Thread_Executing->Object.id;
+ return _Thread_Get_executing()->Object.id;
}
static inline uint32_t __rtld_tbg_executing_status(void)
{
/* @fixme Add the current CPU for SMP. */
- return (_Thread_Executing->current_priority << 8) | _Thread_Executing->real_priority;
+ struct Thread_Control* tc = _Thread_Get_executing();
+ return (tc->current_priority << 8) | tc->real_priority;
}
static inline uint32_t __rtld_tbg_executing_state(void)
{
- return _Thread_Executing->current_state;
+ return _Thread_Get_executing()->current_state;
}
static inline bool __rtld_tbg_is_enabled(const uint32_t index)
More information about the vc
mailing list