rtos/nuttx: add Espressif target support and refactoring

Almost written from the beginning in a modern OpenOCD way.
- Endiannes support
- Proper variable types
- Align with the other rtos implementations

Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com>
Change-Id: I0868a22da2ed2ab664c82b17c171dc59ede78d10
Reviewed-on: https://review.openocd.org/c/openocd/+/7444
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Erhan Kurubas
2023-01-22 23:43:03 +01:00
committed by Antonio Borneo
parent 9ce6b0898e
commit ee31f1578a
4 changed files with 339 additions and 288 deletions

View File

@@ -34,5 +34,4 @@ noinst_LTLIBRARIES += %D%/librtos.la
%D%/rtos_mqx_stackings.h \
%D%/rtos_riot_stackings.h \
%D%/rtos_ucos_iii_stackings.h \
%D%/rtos_nuttx_stackings.h \
%D%/nuttx_header.h
%D%/rtos_nuttx_stackings.h

File diff suppressed because it is too large Load Diff

View File

@@ -1,60 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/***************************************************************************
* Copyright 2016,2017 Sony Video & Sound Products Inc. *
* Masatoshi Tateishi - Masatoshi.Tateishi@jp.sony.com *
* Masayuki Ishikawa - Masayuki.Ishikawa@jp.sony.com *
***************************************************************************/
#ifndef OPENOCD_RTOS_NUTTX_HEADER_H
#define OPENOCD_RTOS_NUTTX_HEADER_H
/* gdb script to update the header file
according to kernel version and build option
before executing function awareness
kernel symbol must be loaded : symbol nuttx
define awareness
set logging off
set logging file nuttx_header.h
set logging on
printf "#define PID %p\n",&((struct tcb_s *)(0))->pid
printf "#define XCPREG %p\n",&((struct tcb_s *)(0))->xcp.regs
printf "#define STATE %p\n",&((struct tcb_s *)(0))->task_state
printf "#define NAME %p\n",&((struct tcb_s *)(0))->name
printf "#define NAME_SIZE %d\n",sizeof(((struct tcb_s *)(0))->name)
end
OR ~/.gdbinit
define hookpost-file
if &g_readytorun != 0
eval "monitor nuttx.pid_offset %d", &((struct tcb_s *)(0))->pid
eval "monitor nuttx.xcpreg_offset %d", &((struct tcb_s *)(0))->xcp.regs
eval "monitor nuttx.state_offset %d", &((struct tcb_s *)(0))->task_state
eval "monitor nuttx.name_offset %d", &((struct tcb_s *)(0))->name
eval "monitor nuttx.name_size %d", sizeof(((struct tcb_s *)(0))->name)
end
end
*/
/* default offset */
#define PID 0xc
#define XCPREG 0x70
#define STATE 0x19
#define NAME 0xb8
#define NAME_SIZE 32
/* defconfig of nuttx */
/* #define CONFIG_DISABLE_SIGNALS */
#define CONFIG_DISABLE_MQUEUE
/* #define CONFIG_PAGING */
#endif /* OPENOCD_RTOS_NUTTX_HEADER_H */

View File

@@ -8,5 +8,8 @@
extern const struct rtos_register_stacking nuttx_stacking_cortex_m;
extern const struct rtos_register_stacking nuttx_stacking_cortex_m_fpu;
extern const struct rtos_register_stacking nuttx_riscv_stacking;
extern const struct rtos_register_stacking nuttx_esp32_stacking;
extern const struct rtos_register_stacking nuttx_esp32s2_stacking;
extern const struct rtos_register_stacking nuttx_esp32s3_stacking;
#endif /* INCLUDED_RTOS_NUTTX_STACKINGS_H */