arch:tcbinfo: update tcbinfo as xcpcontext update

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
This commit is contained in:
zhuyanlin 2022-03-29 17:35:31 +08:00 committed by Abdelatif Guettouche
parent ae6bfdc9b9
commit 6a761ff087
9 changed files with 75 additions and 56 deletions

View File

@ -60,11 +60,13 @@ static const uint16_t g_reg_offs[] =
const struct tcbinfo_s g_tcbinfo =
{
TCB_PID_OFF,
TCB_STATE_OFF,
TCB_PRI_OFF,
TCB_NAME_OFF,
XCPTCONTEXT_REGS,
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = 17,
.total_num = XCPTCONTEXT_REGS,
{
.p = g_reg_offs,
},

View File

@ -53,12 +53,12 @@ static const uint16_t g_reg_offs[] =
TCB_REG_OFF(REG_R15),
TCB_REG_OFF(REG_XPSR),
0, /* msp */
UINT16_MAX, /* msp */
TCB_REG_OFF(REG_R13),
TCB_REG_OFF(REG_PRIMASK),
0, /* basepri */
0, /* faultmask */
0, /* control */
UINT16_MAX, /* basepri */
UINT16_MAX, /* faultmask */
UINT16_MAX, /* control */
};
/****************************************************************************
@ -67,11 +67,13 @@ static const uint16_t g_reg_offs[] =
const struct tcbinfo_s g_tcbinfo =
{
TCB_PID_OFF,
TCB_STATE_OFF,
TCB_PRI_OFF,
TCB_NAME_OFF,
XCPTCONTEXT_REGS,
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = 17,
.total_num = XCPTCONTEXT_REGS,
{
.p = g_reg_offs,
},

View File

@ -102,11 +102,13 @@ static const uint16_t g_reg_offs[] =
const struct tcbinfo_s g_tcbinfo =
{
TCB_PID_OFF,
TCB_STATE_OFF,
TCB_PRI_OFF,
TCB_NAME_OFF,
XCPTCONTEXT_REGS,
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = 17,
.total_num = XCPTCONTEXT_REGS,
{
.p = g_reg_offs,
},

View File

@ -53,17 +53,17 @@ static const uint16_t g_reg_offs[] =
TCB_REG_OFF(REG_R15),
TCB_REG_OFF(REG_XPSR),
0, /* msp */
UINT16_MAX, /* msp */
TCB_REG_OFF(REG_R13),
#ifdef CONFIG_ARMV7M_USEBASEPRI
0, /* primask */
UINT16_MAX, /* primask */
TCB_REG_OFF(REG_BASEPRI),
#else
TCB_REG_OFF(REG_PRIMASK),
0, /* basepri */
UINT16_MAX, /* basepri */
#endif
0, /* faultmask */
0, /* control */
UINT16_MAX, /* faultmask */
UINT16_MAX, /* control */
#ifdef CONFIG_ARCH_FPU
TCB_REG_OFF(REG_S0),
@ -108,11 +108,13 @@ static const uint16_t g_reg_offs[] =
const struct tcbinfo_s g_tcbinfo =
{
TCB_PID_OFF,
TCB_STATE_OFF,
TCB_PRI_OFF,
TCB_NAME_OFF,
XCPTCONTEXT_REGS,
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = 17,
.total_num = XCPTCONTEXT_REGS,
{
.p = g_reg_offs,
},

View File

@ -102,11 +102,13 @@ static const uint16_t g_reg_offs[] =
const struct tcbinfo_s g_tcbinfo =
{
TCB_PID_OFF,
TCB_STATE_OFF,
TCB_PRI_OFF,
TCB_NAME_OFF,
XCPTCONTEXT_REGS,
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = 17,
.total_num = XCPTCONTEXT_REGS,
{
.p = g_reg_offs,
},

View File

@ -53,17 +53,17 @@ static const uint16_t g_reg_offs[] =
TCB_REG_OFF(REG_R15),
TCB_REG_OFF(REG_XPSR),
0, /* msp */
UINT16_MAX, /* msp */
TCB_REG_OFF(REG_R13),
#ifdef CONFIG_ARMV8M_USEBASEPRI
0, /* primask */
UINT16_MAX, /* primask */
TCB_REG_OFF(REG_BASEPRI),
#else
TCB_REG_OFF(REG_PRIMASK),
0, /* basepri */
UINT16_MAX, /* basepri */
#endif
0, /* faultmask */
0, /* control */
UINT16_MAX, /* faultmask */
UINT16_MAX, /* control */
#ifdef CONFIG_ARCH_FPU
TCB_REG_OFF(REG_S0),
@ -108,11 +108,13 @@ static const uint16_t g_reg_offs[] =
const struct tcbinfo_s g_tcbinfo =
{
TCB_PID_OFF,
TCB_STATE_OFF,
TCB_PRI_OFF,
TCB_NAME_OFF,
XCPTCONTEXT_REGS,
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = 17,
.total_num = XCPTCONTEXT_REGS,
{
.p = g_reg_offs,
},

View File

@ -35,7 +35,7 @@
static const uint16_t g_reg_offs[] =
{
0, /* x0 */
UINT16_MAX, /* x0 */
TCB_REG_OFF(REG_X1_NDX),
TCB_REG_OFF(REG_X2_NDX),
TCB_REG_OFF(REG_X3_NDX),
@ -102,8 +102,8 @@ static const uint16_t g_reg_offs[] =
TCB_REG_OFF(REG_F29_NDX),
TCB_REG_OFF(REG_F30_NDX),
TCB_REG_OFF(REG_F31_NDX),
0, /* fflags */
0, /* frm */
UINT16_MAX, /* fflags */
UINT16_MAX, /* frm */
TCB_REG_OFF(REG_FCSR_NDX),
#endif
};
@ -114,11 +114,13 @@ static const uint16_t g_reg_offs[] =
const struct tcbinfo_s g_tcbinfo =
{
TCB_PID_OFF,
TCB_STATE_OFF,
TCB_PRI_OFF,
TCB_NAME_OFF,
XCPTCONTEXT_REGS,
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = 33,
.total_num = XCPTCONTEXT_REGS,
{
.p = g_reg_offs,
},

View File

@ -63,7 +63,9 @@ const struct tcbinfo_s g_tcbinfo =
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.reg_num = XCPTCONTEXT_REGS,
.regs_off = TCB_REGS_OFF,
.basic_num = XCPTCONTEXT_REGS,
.total_num = XCPTCONTEXT_REGS,
{
.p = g_reg_offs,
},

View File

@ -193,7 +193,8 @@
#else
# define TCB_NAME_OFF 0
#endif
# define TCB_REG_OFF(reg) offsetof(struct tcb_s, xcp.regs[reg])
# define TCB_REGS_OFF offsetof(struct tcb_s, xcp.regs)
# define TCB_REG_OFF(reg) (reg * sizeof(uint32_t))
#endif
/****************************************************************************
@ -771,14 +772,16 @@ begin_packed_struct struct tcbinfo_s
uint16_t state_off; /* Offset of tcb.task_state */
uint16_t pri_off; /* Offset of tcb.sched_priority */
uint16_t name_off; /* Offset of tcb.name */
uint16_t reg_num; /* Num of regs in tcbinfo.reg_offs */
uint16_t regs_off; /* Offset of tcb.regs */
uint16_t basic_num; /* Num of genernal regs */
uint16_t total_num; /* Num of regs in tcbinfo.reg_offs */
/* Offset pointer of xcp.regs, order in GDB org.gnu.gdb.xxx feature.
* Please refer:
* https://sourceware.org/gdb/current/onlinedocs/gdb/ARM-Features.html
* https://sourceware.org/gdb/current/onlinedocs/gdb/RISC_002dV-Features
* -.html
* value 0: This regsiter was not priovided by NuttX
* value UINT16_MAX: This regsiter was not priovided by NuttX
*/
begin_packed_struct