adds the generation of the offsetof defines to CMakeLists.txt
As the offsets into the TX_THREAD are needed to access certain fields and the members for smp are quite difficult to obtain this was the safest option
This commit is contained in:
14
port/threadx_smp/src/tx_asm_offsets.c
Normal file
14
port/threadx_smp/src/tx_asm_offsets.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include "tx_api.h"
|
||||
|
||||
|
||||
#define TX_ASM_OFFSET(symbol, value) __asm__ volatile("\n.ascii \"->" #symbol " %c0\\n\"" : : "i" (value))
|
||||
|
||||
|
||||
void tx_asm_offsets_generate(void)
|
||||
{
|
||||
TX_ASM_OFFSET(TX_THREAD_STACK_END_OFFSET, offsetof(TX_THREAD, tx_thread_stack_end));
|
||||
TX_ASM_OFFSET(TX_THREAD_TIME_SLICE_OFFSET, offsetof(TX_THREAD, tx_thread_time_slice));
|
||||
TX_ASM_OFFSET(TX_THREAD_SMP_LOCK_READY_BIT_OFFSET, offsetof(TX_THREAD, tx_thread_smp_lock_ready_bit));
|
||||
}
|
||||
Reference in New Issue
Block a user