OpenOCD
nuttx.c File Reference
Include dependency graph for nuttx.c:

Go to the source code of this file.

Data Structures

struct  tcb
 

Macros

#define M_QUEUE_NUM   0
 
#define PAGING_QUEUE_NUM   0
 
#define SIG_QUEUE_NUM   1
 
#define TASK_QUEUE_NUM   (6 + SIG_QUEUE_NUM + M_QUEUE_NUM + PAGING_QUEUE_NUM)
 

Functions

static int nuttx_create (struct target *target)
 
static bool nuttx_detect_rtos (struct target *target)
 
static int nuttx_get_symbol_list_to_lookup (struct symbol_table_elem *symbol_list[])
 
static int nuttx_get_thread_reg_list (struct rtos *rtos, int64_t thread_id, struct rtos_reg **reg_list, int *num_regs)
 
static int nuttx_thread_packet (struct connection *connection, char const *packet, int packet_size)
 
static int nuttx_update_threads (struct rtos *rtos)
 
static int rcmd_offset (const char *cmd, const char *name)
 
int rtos_thread_packet (struct connection *connection, const char *packet, int packet_size)
 

Variables

struct {
   uint32_t   addr
 
   uint32_t   prio
 
g_tasklist [TASK_QUEUE_NUM]
 
static int name_offset = NAME
 
static int name_size = NAME_SIZE
 
struct rtos_type nuttx_rtos
 
static const struct stack_register_offset nuttx_stack_offsets_cortex_m []
 
static const struct stack_register_offset nuttx_stack_offsets_cortex_m_fpu []
 
static const struct rtos_register_stacking nuttx_stacking_cortex_m
 
static const struct rtos_register_stacking nuttx_stacking_cortex_m_fpu
 
static char * nuttx_symbol_list []
 
static int pid_offset = PID
 
static int state_offset = STATE
 
static char * task_state_str []
 
static int xcpreg_offset = XCPREG
 

Macro Definition Documentation

◆ M_QUEUE_NUM

#define M_QUEUE_NUM   0

Definition at line 35 of file nuttx.c.

◆ PAGING_QUEUE_NUM

#define PAGING_QUEUE_NUM   0

Definition at line 43 of file nuttx.c.

◆ SIG_QUEUE_NUM

#define SIG_QUEUE_NUM   1

Definition at line 31 of file nuttx.c.

◆ TASK_QUEUE_NUM

#define TASK_QUEUE_NUM   (6 + SIG_QUEUE_NUM + M_QUEUE_NUM + PAGING_QUEUE_NUM)

Definition at line 47 of file nuttx.c.

Function Documentation

◆ nuttx_create()

static int nuttx_create ( struct target target)
static

◆ nuttx_detect_rtos()

static bool nuttx_detect_rtos ( struct target target)
static

Definition at line 221 of file nuttx.c.

References symbol_table_elem::address, target::rtos, and rtos::symbols.

◆ nuttx_get_symbol_list_to_lookup()

static int nuttx_get_symbol_list_to_lookup ( struct symbol_table_elem symbol_list[])
static

Definition at line 370 of file nuttx.c.

References ARRAY_SIZE, nuttx_symbol_list, and symbol_table_elem::symbol_name.

◆ nuttx_get_thread_reg_list()

static int nuttx_get_thread_reg_list ( struct rtos rtos,
int64_t  thread_id,
struct rtos_reg **  reg_list,
int *  num_regs 
)
static

◆ nuttx_thread_packet()

static int nuttx_thread_packet ( struct connection connection,
char const *  packet,
int  packet_size 
)
static

◆ nuttx_update_threads()

◆ rcmd_offset()

static int rcmd_offset ( const char *  cmd,
const char *  name 
)
static

Definition at line 150 of file nuttx.c.

References cmd, and name.

Referenced by nuttx_thread_packet().

◆ rtos_thread_packet()

int rtos_thread_packet ( struct connection connection,
const char *  packet,
int  packet_size 
)

Definition at line 346 of file rtos.c.

Referenced by gdb_thread_packet(), nuttx_thread_packet(), and os_alloc().

Variable Documentation

◆ addr

uint32_t addr

Definition at line 65 of file nuttx.c.

Referenced by aarch64_resume(), adbg_wb_burst_read(), adbg_wb_burst_write(), aice_bulk_read_mem(), aice_bulk_write_mem(), aice_pipe_read_debug_reg(), aice_pipe_read_mem_bulk(), aice_pipe_read_mem_unit(), aice_pipe_write_debug_reg(), aice_pipe_write_mem_bulk(), aice_pipe_write_mem_unit(), aice_read_debug_reg(), aice_read_mem_bulk(), aice_read_mem_unit(), aice_usb_bulk_read_mem(), aice_usb_bulk_write_mem(), aice_usb_read_debug_reg(), aice_usb_read_memory_unit(), aice_usb_write_debug_reg(), aice_usb_write_memory_unit(), aice_write_debug_reg(), aice_write_mem_bulk(), aice_write_mem_unit(), align_address_v2(), ap_addr_2_tile(), arc_jtag_enque_register_rw(), arc_jtag_read_aux_reg(), arc_jtag_read_aux_reg_one(), arc_jtag_read_core_reg(), arc_jtag_read_core_reg_one(), arc_jtag_read_memory(), arc_jtag_read_registers(), arc_jtag_write_aux_reg(), arc_jtag_write_aux_reg_one(), arc_jtag_write_core_reg(), arc_jtag_write_core_reg_one(), arc_jtag_write_memory(), arc_jtag_write_registers(), arc_mem_is_slow_memory(), arc_mem_read_block(), arc_mem_write_block16(), arc_mem_write_block32(), arc_mem_write_block8(), arm11_bpwp_enable(), arm_dpm_report_wfar(), avr32_jtag_mwa_read(), avr32_jtag_mwa_set_address(), avr32_jtag_mwa_write(), avr32_jtag_nexus_read(), avr32_jtag_nexus_set_address(), avr32_jtag_nexus_write(), avr32_jtag_read_memory16(), avr32_jtag_read_memory32(), avr32_jtag_read_memory8(), avr32_jtag_write_memory16(), avr32_jtag_write_memory32(), avr32_jtag_write_memory8(), avr_jtagprg_writeflashpage(), calcaddr_physfromlin(), cfi_target_read_memory(), cfi_target_write_memory(), clear_bit(), COMMAND_HANDLER(), COMMAND_HELPER(), coresight_read(), coresight_write(), cortex_a_bpwp_enable(), dap_lookup_cs_component(), dpm_bpwp_setup(), dpmv8_bpwp_setup(), dsp563xx_once_read_register(), efm32x_erase_page(), efm32x_priv_write(), efm32x_write_word(), ejtag_dma_read(), ejtag_dma_read_b(), ejtag_dma_read_h(), ejtag_dma_write(), ejtag_dma_write_b(), ejtag_dma_write_h(), ep1_memory_write(), esp32s2_set_peri_reg_mask(), fill_addr(), fill_buffer(), flash_erase_address_range(), flash_iterate_address_range(), flash_iterate_address_range_inner(), flash_unlock_address_range(), flash_write_align_end(), flash_write_align_start(), fm4_flash_erase(), fm4_flash_write(), gdb_query_packet(), gdb_read_memory_packet(), gdb_v_packet(), gdb_write_memory_binary_packet(), gdb_write_memory_packet(), get_flash_bank_by_addr(), handle_bp_command_set(), icdi_usb_read_mem(), icdi_usb_read_mem_int(), icdi_usb_state(), icdi_usb_write_mem(), icdi_usb_write_mem_int(), jtagspi_page_write(), jtagspi_read(), jtagspi_sector_erase(), lpc32xx_dump_oob(), mips32_dmaacc_read_mem(), mips32_dmaacc_read_mem16(), mips32_dmaacc_read_mem32(), mips32_dmaacc_read_mem8(), mips32_dmaacc_write_mem(), mips32_dmaacc_write_mem16(), mips32_dmaacc_write_mem32(), mips32_dmaacc_write_mem8(), mips32_pracc_fastdata_xfer(), mips32_pracc_queue_exec(), mips32_pracc_read_mem(), mips32_pracc_read_u32(), mips32_pracc_write_mem(), mips32_pracc_write_mem_generic(), mips64_extend_sign(), mips64_pracc_fastdata_xfer(), mips64_pracc_read_mem(), mips64_pracc_read_mem16(), mips64_pracc_read_mem32(), mips64_pracc_read_mem64(), mips64_pracc_read_mem8(), mips64_pracc_read_u16(), mips64_pracc_read_u32(), mips64_pracc_read_u64(), mips64_pracc_read_u8(), mips64_pracc_write_mem(), mips64_pracc_write_mem16(), mips64_pracc_write_mem32(), mips64_pracc_write_mem64(), mips64_pracc_write_mem8(), mips64_pracc_write_u16(), mips64_pracc_write_u32(), mips64_pracc_write_u64(), mips64_pracc_write_u8(), mips_m4k_isa_filter(), mrvlqspi_set_addr(), mxc_read_page(), mxc_write_page(), nulink_usb_read_mem(), nulink_usb_read_mem32(), nulink_usb_read_mem8(), nulink_usb_state(), nulink_usb_write_mem(), nulink_usb_write_mem32(), nulink_usb_write_mem8(), numicro_fmc_cmd(), nuttx_update_threads(), or1k_add_breakpoint(), or1k_adv_jtag_read_cpu(), or1k_adv_jtag_read_memory(), or1k_adv_jtag_write_cpu(), or1k_adv_jtag_write_memory(), or1k_debug_entry(), or1k_remove_breakpoint(), pracc_add(), psoc4_test_flash_wounding(), psoc6_erase_row(), psoc6_erase_sector(), psoc6_probe(), psoc6_program_row(), read_mem(), read_memory_sba_simple(), read_sfdp_block(), remote_bitbang_init_unix(), riscv013_test_sba_config_reg(), rpc_hf_xfer(), rpchf_target_read_memory(), rpchf_target_write_memory(), rshim_ap_q_read(), rshim_ap_q_write(), rshim_dev_read(), rshim_dev_write(), rtos_qsymbol(), samv_page_read(), samv_page_write(), semihosting_common(), set_bit(), sim3x_erase_page(), stlink_read_dap_register(), stlink_swim_op_read_mem(), stlink_swim_op_write_mem(), stlink_swim_readbytes(), stlink_swim_writebytes(), stlink_usb_buf_rw_segment(), stlink_usb_read_ap_mem(), stlink_usb_read_mem(), stlink_usb_read_mem16(), stlink_usb_read_mem32(), stlink_usb_read_mem32_noaddrinc(), stlink_usb_read_mem8(), stlink_usb_v2_read_debug_reg(), stlink_usb_write_ap_mem(), stlink_usb_write_debug_reg(), stlink_usb_write_mem(), stlink_usb_write_mem16(), stlink_usb_write_mem32(), stlink_usb_write_mem32_noaddrinc(), stlink_usb_write_mem8(), stm32lx_erase_sector(), stm32x_get_device_id(), stm32x_get_flash_size(), stm32x_get_property_addr(), stm8_adapter_read_memory(), stm8_adapter_write_memory(), stm8_read_u8(), stm8_set_hwbreak(), stm8_write_u8(), swim_read_mem(), swim_write_mem(), target_array2mem(), target_jim_read_memory(), target_jim_write_memory(), target_mem2array(), target_rtt_find_control_block(), test_bit(), thumb_alignpc4(), tms470_erase_check(), tms470_write(), ublast2_write_firmware_section(), ulink_write_firmware_section(), vdebug_run_reg_queue(), w600_start(), w600_start_do(), write_mem(), write_memory_sba_simple(), x86_32_common_read_io(), x86_32_common_read_memory(), x86_32_common_write_io(), x86_32_common_write_memory(), xmc1xxx_write(), xmc4xxx_flash_unprotect(), xtensa_addr_in_mem(), xtensa_data_addr_valid(), zephyr_get_arc_state(), zephyr_get_arm_state(), and zephyr_get_thread_reg_list().

◆ 

struct { ... } g_tasklist[TASK_QUEUE_NUM]

Referenced by nuttx_update_threads().

◆ name_offset

int name_offset = NAME
static

Definition at line 146 of file nuttx.c.

Referenced by nuttx_thread_packet(), nuttx_update_threads(), and riot_update_threads().

◆ name_size

int name_size = NAME_SIZE
static

Definition at line 148 of file nuttx.c.

Referenced by nuttx_thread_packet(), and nuttx_update_threads().

◆ nuttx_rtos

struct rtos_type nuttx_rtos
Initial value:
= {
.name = "nuttx",
.detect_rtos = nuttx_detect_rtos,
.create = nuttx_create,
.update_threads = nuttx_update_threads,
.get_thread_reg_list = nuttx_get_thread_reg_list,
.get_symbol_list_to_lookup = nuttx_get_symbol_list_to_lookup,
}
static int nuttx_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_list[])
Definition: nuttx.c:370
static bool nuttx_detect_rtos(struct target *target)
Definition: nuttx.c:221
static int nuttx_create(struct target *target)
Definition: nuttx.c:231
static int nuttx_update_threads(struct rtos *rtos)
Definition: nuttx.c:239
static int nuttx_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, struct rtos_reg **reg_list, int *num_regs)
Definition: nuttx.c:333

Definition at line 370 of file nuttx.c.

◆ nuttx_stack_offsets_cortex_m

const struct stack_register_offset nuttx_stack_offsets_cortex_m[]
static
Initial value:
= {
{ ARMV7M_R0, 0x28, 32 },
{ ARMV7M_R1, 0x2c, 32 },
{ ARMV7M_R2, 0x30, 32 },
{ ARMV7M_R3, 0x34, 32 },
{ ARMV7M_R4, 0x08, 32 },
{ ARMV7M_R5, 0x0c, 32 },
{ ARMV7M_R6, 0x10, 32 },
{ ARMV7M_R7, 0x14, 32 },
{ ARMV7M_R8, 0x18, 32 },
{ ARMV7M_R9, 0x1c, 32 },
{ ARMV7M_R10, 0x20, 32 },
{ ARMV7M_R11, 0x24, 32 },
{ ARMV7M_R12, 0x38, 32 },
{ ARMV7M_R13, 0, 32 },
{ ARMV7M_R14, 0x3c, 32 },
{ ARMV7M_PC, 0x40, 32 },
{ ARMV7M_XPSR, 0x44, 32 },
}
@ ARMV7M_R1
Definition: armv7m.h:108
@ ARMV7M_R6
Definition: armv7m.h:114
@ ARMV7M_R2
Definition: armv7m.h:109
@ ARMV7M_R3
Definition: armv7m.h:110
@ ARMV7M_R14
Definition: armv7m.h:124
@ ARMV7M_R9
Definition: armv7m.h:118
@ ARMV7M_R12
Definition: armv7m.h:122
@ ARMV7M_R0
Definition: armv7m.h:107
@ ARMV7M_R13
Definition: armv7m.h:123
@ ARMV7M_PC
Definition: armv7m.h:125
@ ARMV7M_R7
Definition: armv7m.h:115
@ ARMV7M_R4
Definition: armv7m.h:112
@ ARMV7M_XPSR
Definition: armv7m.h:127
@ ARMV7M_R8
Definition: armv7m.h:117
@ ARMV7M_R11
Definition: armv7m.h:120
@ ARMV7M_R10
Definition: armv7m.h:119
@ ARMV7M_R5
Definition: armv7m.h:113

Definition at line 69 of file nuttx.c.

◆ nuttx_stack_offsets_cortex_m_fpu

const struct stack_register_offset nuttx_stack_offsets_cortex_m_fpu[]
static
Initial value:
= {
{ ARMV7M_R0, 0x6c, 32 },
{ ARMV7M_R1, 0x70, 32 },
{ ARMV7M_R2, 0x74, 32 },
{ ARMV7M_R3, 0x78, 32 },
{ ARMV7M_R4, 0x08, 32 },
{ ARMV7M_R5, 0x0c, 32 },
{ ARMV7M_R6, 0x10, 32 },
{ ARMV7M_R7, 0x14, 32 },
{ ARMV7M_R8, 0x18, 32 },
{ ARMV7M_R9, 0x1c, 32 },
{ ARMV7M_R10, 0x20, 32 },
{ ARMV7M_R11, 0x24, 32 },
{ ARMV7M_R12, 0x7c, 32 },
{ ARMV7M_R13, 0, 32 },
{ ARMV7M_R14, 0x80, 32 },
{ ARMV7M_PC, 0x84, 32 },
{ ARMV7M_XPSR, 0x88, 32 },
}

Definition at line 69 of file nuttx.c.

◆ nuttx_stacking_cortex_m

const struct rtos_register_stacking nuttx_stacking_cortex_m
static
Initial value:
= {
.stack_registers_size = 0x48,
.stack_growth_direction = -1,
.num_output_registers = 17,
.register_offsets = nuttx_stack_offsets_cortex_m
}
static const struct stack_register_offset nuttx_stack_offsets_cortex_m[]
Definition: nuttx.c:89

Definition at line 69 of file nuttx.c.

Referenced by nuttx_get_thread_reg_list().

◆ nuttx_stacking_cortex_m_fpu

const struct rtos_register_stacking nuttx_stacking_cortex_m_fpu
static
Initial value:
= {
.stack_registers_size = 0x8c,
.stack_growth_direction = -1,
.num_output_registers = 17,
}
static const struct stack_register_offset nuttx_stack_offsets_cortex_m_fpu[]
Definition: nuttx.c:117

Definition at line 69 of file nuttx.c.

Referenced by nuttx_get_thread_reg_list().

◆ nuttx_symbol_list

char* nuttx_symbol_list[]
static
Initial value:
= {
"g_readytorun",
"g_tasklisttable",
}
#define NULL
Definition: usb.h:16

Definition at line 51 of file nuttx.c.

Referenced by nuttx_get_symbol_list_to_lookup().

◆ pid_offset

int pid_offset = PID
static

Definition at line 144 of file nuttx.c.

Referenced by nuttx_thread_packet(), and nuttx_update_threads().

◆ prio

uint32_t prio

Definition at line 66 of file nuttx.c.

Referenced by zephyr_fetch_thread().

◆ state_offset

int state_offset = STATE
static

Definition at line 145 of file nuttx.c.

Referenced by nuttx_thread_packet(), and nuttx_update_threads().

◆ task_state_str

char* task_state_str[]
static
Initial value:
= {
"INVALID",
"PENDING",
"READYTORUN",
"RUNNING",
"INACTIVE",
"WAIT_SEM",
"WAIT_SIG",
}

Definition at line 69 of file nuttx.c.

Referenced by nuttx_update_threads().

◆ xcpreg_offset

int xcpreg_offset = XCPREG
static

Definition at line 147 of file nuttx.c.

Referenced by nuttx_get_thread_reg_list(), and nuttx_thread_packet().