sched/tcbinfo: add stack info to tcbinfo

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
zhangyuan21 2023-05-15 21:07:36 +08:00 committed by Xiang Xiao
parent 9fd26195d1
commit 9792211b96
10 changed files with 76 additions and 56 deletions

View File

@ -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,
},

View File

@ -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,
},

View File

@ -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,
},

View File

@ -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,
},

View File

@ -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,
},

View File

@ -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,
},

View File

@ -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,
},

View File

@ -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,
},

View File

@ -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 */

View File

@ -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;