mirror of
https://git.rtems.org/rtems-tools/
synced 2025-10-18 02:07:12 +08:00
Change to use the task implemenation interface.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user