mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 07:28:38 +08:00
tools/jlink-nuttx: update tcbinfo follow nuttx arch tcbinfo_s
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
This commit is contained in:
parent
f903a55102
commit
8f1c6ee7bc
1 changed files with 24 additions and 2 deletions
|
@ -79,6 +79,11 @@ struct tcbinfo_s
|
|||
uint16_t pri_off;
|
||||
uint16_t name_off;
|
||||
uint16_t reg_num;
|
||||
union
|
||||
{
|
||||
uint8_t u[8];
|
||||
uint16_t *p;
|
||||
} reg_off;
|
||||
uint16_t reg_offs[0];
|
||||
};
|
||||
|
||||
|
@ -249,6 +254,7 @@ static int update_tcbinfo(struct plugin_priv_s *priv)
|
|||
{
|
||||
uint16_t reg_num;
|
||||
int ret;
|
||||
uint32_t reg_off;
|
||||
|
||||
ret = READU16(g_symbols[TCBINFO].address +
|
||||
offsetof(struct tcbinfo_s, reg_num), ®_num);
|
||||
|
@ -258,6 +264,14 @@ static int update_tcbinfo(struct plugin_priv_s *priv)
|
|||
return ret;
|
||||
}
|
||||
|
||||
ret = READU32(g_symbols[TCBINFO].address +
|
||||
offsetof(struct tcbinfo_s, reg_off), ®_off);
|
||||
if (ret != 0 || !reg_off)
|
||||
{
|
||||
PERROR("error in read regoffs address ret %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
priv->tcbinfo = ALLOC(sizeof(struct tcbinfo_s) +
|
||||
reg_num * sizeof(uint16_t));
|
||||
|
||||
|
@ -268,13 +282,21 @@ static int update_tcbinfo(struct plugin_priv_s *priv)
|
|||
}
|
||||
|
||||
ret = READMEM(g_symbols[TCBINFO].address, (char *)priv->tcbinfo,
|
||||
sizeof(struct tcbinfo_s) + reg_num * sizeof(uint16_t));
|
||||
if (ret != sizeof(struct tcbinfo_s) + reg_num * sizeof(uint16_t))
|
||||
sizeof(struct tcbinfo_s));
|
||||
if (ret != sizeof(struct tcbinfo_s))
|
||||
{
|
||||
PERROR("error in read tcbinfo_s ret %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = READMEM(reg_off, (char *)&priv->tcbinfo->reg_offs[0],
|
||||
reg_num * sizeof(uint16_t));
|
||||
if (ret != reg_num * sizeof(uint16_t))
|
||||
{
|
||||
PERROR("error in read tcbinfo_s reg_offs ret %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
PLOG("setup success! regs %d\n", priv->tcbinfo->reg_num);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue