mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 07:28:38 +08:00
tools/mksyscall: Fix build break of syscall instrumentation wrapper
This commit is contained in:
parent
ab7ceb26e0
commit
72d2fc547e
1 changed files with 28 additions and 8 deletions
|
@ -612,8 +612,16 @@ static void generate_wrapper(int nfixed, int nparms)
|
|||
* prototype
|
||||
*/
|
||||
|
||||
fprintf(stream, "%s UP_WRAPSYM(%s)(", g_parm[RETTYPE_INDEX],
|
||||
g_parm[NAME_INDEX]);
|
||||
if (strcmp(g_parm[RETTYPE_INDEX], "noreturn") == 0)
|
||||
{
|
||||
fprintf(stream, "void ");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stream, "%s ", g_parm[RETTYPE_INDEX]);
|
||||
}
|
||||
|
||||
fprintf(stream, "UP_WRAPSYM(%s)(", g_parm[NAME_INDEX]);
|
||||
|
||||
/* Generate the formal parameter list */
|
||||
|
||||
|
@ -655,15 +663,24 @@ static void generate_wrapper(int nfixed, int nparms)
|
|||
|
||||
/* Generate the result variable definition for non-void function */
|
||||
|
||||
if (strcmp(g_parm[RETTYPE_INDEX], "void") != 0)
|
||||
if (strcmp(g_parm[RETTYPE_INDEX], "void") != 0 &&
|
||||
strcmp(g_parm[RETTYPE_INDEX], "noreturn") != 0)
|
||||
{
|
||||
fprintf(stream, " %s result;\n", g_parm[RETTYPE_INDEX]);
|
||||
}
|
||||
|
||||
/* Generate the wrapped (real) function prototype definition */
|
||||
|
||||
fprintf(stream, " %s UP_REALSYM(%s)(", g_parm[RETTYPE_INDEX],
|
||||
g_parm[NAME_INDEX]);
|
||||
if (strcmp(g_parm[RETTYPE_INDEX], "noreturn") == 0)
|
||||
{
|
||||
fprintf(stream, " void ");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stream, " %s ", g_parm[RETTYPE_INDEX]);
|
||||
}
|
||||
|
||||
fprintf(stream, "UP_REALSYM(%s)(", g_parm[NAME_INDEX]);
|
||||
|
||||
/* Generate the formal parameter list */
|
||||
|
||||
|
@ -767,7 +784,8 @@ static void generate_wrapper(int nfixed, int nparms)
|
|||
* value are a special case.
|
||||
*/
|
||||
|
||||
if (strcmp(g_parm[RETTYPE_INDEX], "void") == 0)
|
||||
if (strcmp(g_parm[RETTYPE_INDEX], "void") == 0 ||
|
||||
strcmp(g_parm[RETTYPE_INDEX], "noreturn") == 0)
|
||||
{
|
||||
fprintf(stream, " UP_REALSYM(%s)(", g_parm[NAME_INDEX]);
|
||||
}
|
||||
|
@ -798,7 +816,8 @@ static void generate_wrapper(int nfixed, int nparms)
|
|||
|
||||
fprintf(stream, " sched_note_syscall_leave(SYS_%s, ", g_parm[NAME_INDEX]);
|
||||
|
||||
if (strcmp(g_parm[RETTYPE_INDEX], "void") == 0)
|
||||
if (strcmp(g_parm[RETTYPE_INDEX], "void") == 0 ||
|
||||
strcmp(g_parm[RETTYPE_INDEX], "noreturn") == 0)
|
||||
{
|
||||
fprintf(stream, "0");
|
||||
}
|
||||
|
@ -813,7 +832,8 @@ static void generate_wrapper(int nfixed, int nparms)
|
|||
* value, do nothing.
|
||||
*/
|
||||
|
||||
if (strcmp(g_parm[RETTYPE_INDEX], "void") == 0)
|
||||
if (strcmp(g_parm[RETTYPE_INDEX], "void") == 0 ||
|
||||
strcmp(g_parm[RETTYPE_INDEX], "noreturn") == 0)
|
||||
{
|
||||
fprintf(stream, "}\n");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue