summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-04 12:43:35 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-04 12:43:35 +0000
commit07bac0e795ae446d6a2f1e9ab3da5d9f7cdfef0a (patch)
treed15f98eec6bdafdd7ee216b0a675bbc543807745 /nuttx/include
parent75036e3985096a20f831ca183327758a2647bd76 (diff)
downloadpx4-nuttx-07bac0e795ae446d6a2f1e9ab3da5d9f7cdfef0a.tar.gz
px4-nuttx-07bac0e795ae446d6a2f1e9ab3da5d9f7cdfef0a.tar.bz2
px4-nuttx-07bac0e795ae446d6a2f1e9ab3da5d9f7cdfef0a.zip
Add stub lookup logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3462 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/sys/syscall.h42
1 files changed, 38 insertions, 4 deletions
diff --git a/nuttx/include/sys/syscall.h b/nuttx/include/sys/syscall.h
index 67471e897..c4527c9fa 100644
--- a/nuttx/include/sys/syscall.h
+++ b/nuttx/include/sys/syscall.h
@@ -42,15 +42,18 @@
****************************************************************************/
#include <nuttx/config.h>
+#include <stdint.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
-/* Reserve the first system calls for platform-specific usage */
+/* Reserve the first system calls for platform-specific usage if so
+ * configured.
+ */
#ifndef CONFIG_CONFIG_SYS_RESERVED
-# define CONFIG_SYS_RESERVED (32)
+# define CONFIG_SYS_RESERVED (0)
#endif
/* System call numbers
@@ -89,7 +92,7 @@
/* The following can be individually enabled */
-#ifdef CONFIG_SCHED_ATEXT
+#ifdef CONFIG_SCHED_ATEXIT
# define SYS_atexit __SYS_atexit
# define __SYS_waitpaid (__SYS_atexit+1)
#else
@@ -302,8 +305,27 @@
* Public Type Definitions
****************************************************************************/
+/* This is the union of all possible stub function types */
+
+union syscall_stubfunc_u
+{
+ uintptr_t (*stub0)(unsigned int nbr);
+ uintptr_t (*stub1)(unsigned int nbr, uintptr_t parm1);
+ uintptr_t (*stub2)(unsigned int nbr, uintptr_t parm1, uintptr_t parm2);
+ uintptr_t (*stub3)(unsigned int nbr, uintptr_t parm1, uintptr_t parm2,
+ uintptr_t parm3);
+ uintptr_t (*stub4)(unsigned int nbr, uintptr_t parm1, uintptr_t parm2,
+ uintptr_t parm3, uintptr_t parm4);
+ uintptr_t (*stub5)(unsigned int nbr, uintptr_t parm1, uintptr_t parm2,
+ uintptr_t parm3, uintptr_t parm4,
+ uintptr_t parm5);
+ uintptr_t (*stub6)(unsigned int nbr, uintptr_t parm1, uintptr_t parm2,
+ uintptr_t parm3, uintptr_t parm4,
+ uintptr_t parm5, uintptr_t parm6);
+};
+
/****************************************************************************
- * Public Functions
+ * Public Data
****************************************************************************/
#ifdef __cplusplus
@@ -313,6 +335,18 @@ extern "C" {
#define EXTERN extern
#endif
+/* Stub lookup tables. Each table is indexed by the system call numbers
+ * defined above. Given the system call number, the corresponding entry in
+ * these tables describes how to call the stub dispatch function.
+ */
+
+EXTERN const union syscall_stubfunc_u *g_stublookup[SYS_nsyscalls];
+EXTERN const uint8_t g_stubnparms[SYS_nsyscalls];
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
#undef EXTERN
#ifdef __cplusplus
}