summaryrefslogtreecommitdiff
path: root/nuttx/syscall
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-31 04:23:17 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-31 04:23:17 +0000
commit844c7f1ae7c401414056a2457471a4282ffe8f98 (patch)
treededeb51514f8e30d1f5e51e17ea35095604e19a9 /nuttx/syscall
parentfd57b2a0da0473e878eb1c2abef05de3be7c2e2d (diff)
downloadpx4-nuttx-844c7f1ae7c401414056a2457471a4282ffe8f98.tar.gz
px4-nuttx-844c7f1ae7c401414056a2457471a4282ffe8f98.tar.bz2
px4-nuttx-844c7f1ae7c401414056a2457471a4282ffe8f98.zip
Add mksyscall tool
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3446 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/syscall')
-rw-r--r--nuttx/syscall/README.txt31
-rw-r--r--nuttx/syscall/proxies/Make.defs36
-rw-r--r--nuttx/syscall/stubs/Make.defs36
-rw-r--r--nuttx/syscall/syscall.csv1
4 files changed, 98 insertions, 6 deletions
diff --git a/nuttx/syscall/README.txt b/nuttx/syscall/README.txt
index bfaabcc65..d4d0323ac 100644
--- a/nuttx/syscall/README.txt
+++ b/nuttx/syscall/README.txt
@@ -97,11 +97,30 @@ Auto-Generated Files
Stubs and proxies for the sycalls are automatically generated from this CSV
database. Here the following definition is used:
- STUB - A tiny bit of code that executes with within the NuttX kernel that
- is used to map a software interrupt received by the kernel to a
- kernel function call.
-
- Proxy - Another tiny bit of code that executes in the user space. A proxy
+ Proxy - A tiny bit of code that executes in the user space. A proxy
has exactly the same function prototype as does the "real" function
for which it proxies. However, it only serves to map the function
- call into a syscall, marshalling all of the parameters as necessary.
+ call into a syscall, marshalling all of the system call parameters
+ as necessary.
+
+ STUB - Another tiny bit of code that executes within the NuttX kernel
+ that is used to map a software interrupt received by the kernel to
+ a kernel function call. The stubs receive the marshalled system
+ call data, and perform the actually kernel function call (in
+ kernel-mode) on behalf of the proxy function.
+
+Sub-Directories
+===============
+
+ stubs - Autogenerated stub files are placed in this directory.
+ proxies - Autogenerated proxy files are placed in this directory.
+
+mksyscall
+=========
+
+ mksyscall is C program that is used used during the initial NuttX build
+ by the logic in the top-level syscall/ directory. Information about the
+ stubs and proxies is maintained in a comma separated value (CSV) file
+ in the syscall/ directory. The mksyscall program will accept this CVS
+ file as input and generate all of the required proxy or stub files as
+ output. See tools/README.txt for additonal information.
diff --git a/nuttx/syscall/proxies/Make.defs b/nuttx/syscall/proxies/Make.defs
new file mode 100644
index 000000000..3f1c01b2c
--- /dev/null
+++ b/nuttx/syscall/proxies/Make.defs
@@ -0,0 +1,36 @@
+############################################################################
+# syscall/proxies/Make.defs
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+PROXY_SRCS := ${shell ls *.c}
diff --git a/nuttx/syscall/stubs/Make.defs b/nuttx/syscall/stubs/Make.defs
new file mode 100644
index 000000000..7237ddded
--- /dev/null
+++ b/nuttx/syscall/stubs/Make.defs
@@ -0,0 +1,36 @@
+############################################################################
+# syscall/stubs/Make.defs
+#
+# Copyright (C) 2011 Gregory Nutt. All rights reserved.
+# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name NuttX nor the names of its contributors may be
+# used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+############################################################################
+
+STUB_SRCS := ${shell ls *.c}
diff --git a/nuttx/syscall/syscall.csv b/nuttx/syscall/syscall.csv
index 7cb60003a..3dffa4ad4 100644
--- a/nuttx/syscall/syscall.csv
+++ b/nuttx/syscall/syscall.csv
@@ -104,6 +104,7 @@
"seekdir","dirent.h","void","FAR DIR*","off_t"
"select","sys/select.h","int","int","FAR fd_set*","FAR fd_set*","FAR fd_set*","FAR struct timeval*"
"sem_close","semaphore.h","int","FAR sem_t*"
+"sem_destroy","semaphore.h","int","FAR sem_t*"
"sem_open","semaphore.h","FAR sem_t*","FAR const char*","int","..."
"sem_post","semaphore.h","int","FAR sem_t*"
"sem_trywait","semaphore.h","int","FAR sem_t*"