Skip to content

Commit

Permalink
sched/tcbinfo: add stack info to tcbinfo
Browse files Browse the repository at this point in the history
Signed-off-by: zhangyuan21 <[email protected]>
  • Loading branch information
zhangyuan21 authored and xiaoxiang781216 committed Jul 24, 2023
1 parent 9fd2619 commit 9792211
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 56 deletions.
16 changes: 9 additions & 7 deletions arch/arm/src/arm/arm_tcbinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ static const uint16_t g_reg_offs[] =

const struct tcbinfo_s g_tcbinfo =
{
.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 = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.stack_off = TCB_STACK_OFF,
.stack_size_off = TCB_STACK_SIZE_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = 17,
.total_num = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
{
.p = g_reg_offs,
},
Expand Down
16 changes: 9 additions & 7 deletions arch/arm/src/armv6-m/arm_tcbinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ static const uint16_t g_reg_offs[] =

const struct tcbinfo_s g_tcbinfo =
{
.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 = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.stack_off = TCB_STACK_OFF,
.stack_size_off = TCB_STACK_SIZE_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = 17,
.total_num = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
{
.p = g_reg_offs,
},
Expand Down
16 changes: 9 additions & 7 deletions arch/arm/src/armv7-a/arm_tcbinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ static const uint16_t g_reg_offs[] =

const struct tcbinfo_s g_tcbinfo =
{
.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 = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.stack_off = TCB_STACK_OFF,
.stack_size_off = TCB_STACK_SIZE_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = 17,
.total_num = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
{
.p = g_reg_offs,
},
Expand Down
16 changes: 9 additions & 7 deletions arch/arm/src/armv7-m/arm_tcbinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,15 @@ static const uint16_t g_reg_offs[] =

const struct tcbinfo_s g_tcbinfo =
{
.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 = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.stack_off = TCB_STACK_OFF,
.stack_size_off = TCB_STACK_SIZE_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = 17,
.total_num = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
{
.p = g_reg_offs,
},
Expand Down
16 changes: 9 additions & 7 deletions arch/arm/src/armv7-r/arm_tcbinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ static const uint16_t g_reg_offs[] =

const struct tcbinfo_s g_tcbinfo =
{
.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 = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.stack_off = TCB_STACK_OFF,
.stack_size_off = TCB_STACK_SIZE_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = 17,
.total_num = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
{
.p = g_reg_offs,
},
Expand Down
16 changes: 9 additions & 7 deletions arch/arm/src/armv8-m/arm_tcbinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,15 @@ static const uint16_t g_reg_offs[] =

const struct tcbinfo_s g_tcbinfo =
{
.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 = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.stack_off = TCB_STACK_OFF,
.stack_size_off = TCB_STACK_SIZE_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = 17,
.total_num = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
{
.p = g_reg_offs,
},
Expand Down
16 changes: 9 additions & 7 deletions arch/risc-v/src/common/riscv_tcbinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,15 @@ static const uint16_t g_reg_offs[] =

const struct tcbinfo_s g_tcbinfo =
{
.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 = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.stack_off = TCB_STACK_OFF,
.stack_size_off = TCB_STACK_SIZE_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = 33,
.total_num = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
{
.p = g_reg_offs,
},
Expand Down
16 changes: 9 additions & 7 deletions arch/xtensa/src/common/xtensa_tcbinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ static const uint16_t g_reg_offs[] =

const struct tcbinfo_s g_tcbinfo =
{
.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 = COMMON_CTX_REGS,
.total_num = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
.pid_off = TCB_PID_OFF,
.state_off = TCB_STATE_OFF,
.pri_off = TCB_PRI_OFF,
.name_off = TCB_NAME_OFF,
.stack_off = TCB_STACK_OFF,
.stack_size_off = TCB_STACK_SIZE_OFF,
.regs_off = TCB_REGS_OFF,
.basic_num = COMMON_CTX_REGS,
.total_num = sizeof(g_reg_offs) / sizeof(g_reg_offs[0]),
{
.p = g_reg_offs,
},
Expand Down
2 changes: 2 additions & 0 deletions include/nuttx/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,8 @@ 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 stack_off; /* Offset of tcb.stack_alloc_ptr */
uint16_t stack_size_off; /* Offset of tcb.adj_stack_size */
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 */
Expand Down
2 changes: 2 additions & 0 deletions tools/jlink-nuttx.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ begin_packed_struct struct tcbinfo_s
uint16_t state_off;
uint16_t pri_off;
uint16_t name_off;
uint16_t stack_off;
uint16_t stack_size_off;
uint16_t regs_off;
uint16_t basic_num;
uint16_t total_num;
Expand Down

0 comments on commit 9792211

Please sign in to comment.