From 7c2ea5a1a560284b6d22a60d62ac943ec6144096 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 6 Mar 2013 19:56:32 +0000 Subject: Fix some bad syscall dispatching log. This change is not testable until these is a tested NuttX kernel build. git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5713 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/tools/mksyscall.c | 48 ++++++++++++++++-------------------------------- 1 file changed, 16 insertions(+), 32 deletions(-) (limited to 'nuttx/tools') diff --git a/nuttx/tools/mksyscall.c b/nuttx/tools/mksyscall.c index 1d172a2a1..c5e15a87b 100644 --- a/nuttx/tools/mksyscall.c +++ b/nuttx/tools/mksyscall.c @@ -1,7 +1,7 @@ /**************************************************************************** * tools/mksyscall.c * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -433,46 +433,30 @@ static void generate_stub(int nparms) { fprintf(stream, "static inline "); } - fprintf(stream, "uintptr_t STUB_%s(", g_parm[NAME_INDEX]); + + fprintf(stream, "uintptr_t STUB_%s(int nbr", g_parm[NAME_INDEX]); - /* Generate the formal parameter list. A function received no parameters is a special case. */ + /* Generate the formal parameter list */ - if (nparms <= 0) - { - fprintf(stream, "void"); - } - else + for (i = 0; i < nparms; i++) { - for (i = 0; i < nparms; i++) - { - /* Treat the first argument in the list differently from the others.. - * It does not need a comma before it. - */ - - if (i > 0) - { - /* Check for a variable number of arguments */ + /* Check for a variable number of arguments */ - if (is_vararg(g_parm[PARM1_INDEX+i], i, nparms)) - { - /* Always receive six arguments in this case */ + if (is_vararg(g_parm[PARM1_INDEX+i], i, nparms)) + { + /* Always receive six arguments in this case */ - for (j = i+1; j <= 6; j++) - { - fprintf(stream, ", uintptr_t parm%d", j); - } - } - else - { - fprintf(stream, ", uintptr_t parm%d", i+1); - } - } - else + for (j = i+1; j <= 6; j++) { - fprintf(stream, "uintptr_t parm%d", i+1); + fprintf(stream, ", uintptr_t parm%d", j); } } + else + { + fprintf(stream, ", uintptr_t parm%d", i+1); + } } + fprintf(stream, ")\n{\n"); /* Then call the proxied function. Functions that have no return value are -- cgit v1.2.3