Modules: Extend the module interface so that we can access symbols exported by the module.

This commit is contained in:
Gregory Nutt
2017-01-22 14:26:22 -06:00
parent d90e66a024
commit 4574a1ca42
13 changed files with 377 additions and 40 deletions
+4 -2
View File
@@ -29,7 +29,7 @@
"getenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char*","FAR const char*"
"getpid","unistd.h","","pid_t"
"getsockopt","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","int","int","FAR void*","FAR socklen_t*"
"insmod","nuttx/module.h","defined(CONFIG_MODULE)","int","FAR const char *","FAR const char *"
"insmod","nuttx/module.h","defined(CONFIG_MODULE)","FAR void *","FAR const char *","FAR const char *"
"ioctl","sys/ioctl.h","!defined(CONFIG_LIBC_IOCTL_VARIADIC) && (CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0)","int","int","int","unsigned long"
"kill","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","pid_t","int"
"listen","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","int"
@@ -37,6 +37,8 @@
"mkdir","sys/stat.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*","mode_t"
"mkfifo2","nuttx/drivers/drivers.h","defined(CONFIG_PIPES) && CONFIG_DEV_FIFO_SIZE > 0","int","FAR const char*","mode_t","size_t"
"mmap","sys/mman.h","CONFIG_NFILE_DESCRIPTORS > 0","FAR void*","FAR void*","size_t","int","int","int","off_t"
"modhandle","nuttx/module.h","defined(CONFIG_MODULE)","FAR void *","FAR const char *"
"modsym","nuttx/module.h","defined(CONFIG_MODULE)","FAR void *","FAR void *","FAR const char *"
"mount","sys/mount.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_READABLE)","int","const char*","const char*","const char*","unsigned long","const void*"
"mq_close","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","mqd_t"
"mq_getattr","mqueue.h","!defined(CONFIG_DISABLE_MQUEUE)","int","mqd_t","struct mq_attr *"
@@ -102,7 +104,7 @@
"rename","stdio.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*","FAR const char*"
"rewinddir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","void","FAR DIR*"
"rmdir","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT)","int","FAR const char*"
"rmmod","nuttx/module.h","defined(CONFIG_MODULE)","int","FAR const char *"
"rmmod","nuttx/module.h","defined(CONFIG_MODULE)","int","FAR void *"
"sched_getparam","sched.h","","int","pid_t","struct sched_param*"
"sched_getscheduler","sched.h","","int","pid_t"
"sched_getstreams","nuttx/sched.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","FAR struct streamlist*"
1 _exit unistd.h void int
29 getenv stdlib.h !defined(CONFIG_DISABLE_ENVIRON) FAR char* FAR const char*
30 getpid unistd.h pid_t
31 getsockopt sys/socket.h CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET) int int
32 insmod nuttx/module.h defined(CONFIG_MODULE) int FAR void * FAR const char *
33 ioctl sys/ioctl.h !defined(CONFIG_LIBC_IOCTL_VARIADIC) && (CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0) int int
34 kill signal.h !defined(CONFIG_DISABLE_SIGNALS) int pid_t
35 listen sys/socket.h CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET) int int
37 mkdir sys/stat.h CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) int FAR const char*
38 mkfifo2 nuttx/drivers/drivers.h defined(CONFIG_PIPES) && CONFIG_DEV_FIFO_SIZE > 0 int FAR const char*
39 mmap sys/mman.h CONFIG_NFILE_DESCRIPTORS > 0 FAR void* FAR void*
40 modhandle nuttx/module.h defined(CONFIG_MODULE) FAR void * FAR const char *
41 modsym nuttx/module.h defined(CONFIG_MODULE) FAR void * FAR void *
42 mount sys/mount.h CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_READABLE) int const char*
43 mq_close mqueue.h !defined(CONFIG_DISABLE_MQUEUE) int mqd_t
44 mq_getattr mqueue.h !defined(CONFIG_DISABLE_MQUEUE) int mqd_t
104 rename stdio.h CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) int FAR const char*
105 rewinddir dirent.h CONFIG_NFILE_DESCRIPTORS > 0 void FAR DIR*
106 rmdir unistd.h CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT) int FAR const char*
107 rmmod nuttx/module.h defined(CONFIG_MODULE) int FAR const char * FAR void *
108 sched_getparam sched.h int pid_t
109 sched_getscheduler sched.h int pid_t
110 sched_getstreams nuttx/sched.h CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0 FAR struct streamlist*
+3 -1
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* syscall/syscall_lookup.h
*
* Copyright (C) 2011, 2013-2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2013-2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -123,6 +123,8 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert)
#ifdef CONFIG_MODULE
SYSCALL_LOOKUP(insmod, 2, STUB_insmod)
SYSCALL_LOOKUP(rmmod, 1, STUB_rmmod)
SYSCALL_LOOKUP(modsym, 2, STUB_modsym)
SYSCALL_LOOKUP(modhandle, 1, STUB_modhandle)
#endif
/* The following can only be defined if we are configured to execute
+2
View File
@@ -122,6 +122,8 @@ uintptr_t STUB_waitid(int nbr, uintptr_t parm1, uintptr_t parm2,
#ifdef CONFIG_MODULE
uintptr_t STUB_insmod(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_rmmod(int nbr, uintptr_t parm1);
uintptr_t STUB_modsym(int nbr, uintptr_t parm1);
uintptr_t STUB_modhandle(int nbr, uintptr_t parm1, uintptr_t parm2);
#endif
/* The following can only be defined if we are configured to execute