Change to use the task implemenation interface.

This commit is contained in:
Chris Johns
2015-10-15 21:05:29 +11:00
parent e3df129557
commit f11d18b9b1

View File

@@ -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)