superxyxiao commented on issue #7598:
URL: 
https://github.com/apache/incubator-nuttx/issues/7598#issuecomment-1316362182

   Is there any document about adding new system calls under the protection of 
mpu? I add a new system call in the following file, but when debugging, I found 
that the address of the new system call in the g_stublookup array is 0.
   
   path/syscall/syscall_lookup.h:SYSCALL_LOOKUP(mycall,                      0, 
STUB_mycall)               
   path/syscall/syscall_stublookup.c:uintptr_t STUB_mycall(int nbr);
   path/syscall/syscall.csv:"mycall","nuttx/mycall.h","","int"
   
   cat path/include/nuttx/mycall.h 
   
   #ifndef __ASSEMBLY__
   #undef EXTERN
   #if defined(__cplusplus)
   #define EXTERN extern "C"
   extern "C"
   {
   #else
   #define EXTERN extern
   #endif
   
   int mycall(void);
   
   #undef EXTERN
   #ifdef __cplusplus
   }
   #endif
   
   path/include/sys/syscall.h
   #define SYS_mycall                    (SYS_prctl + 1)
   #define SYS_maxsyscall                (SYS_prctl + 2)
   
   cat path/sched/mycall/mycall.c 
   
   #include <nuttx/compiler.h>
   #include <nuttx/mycall.h>
   int mycall(void)
   {
     int num=0;
     num=num+2;
     return num;
   }
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to