summaryrefslogtreecommitdiff
path: root/nuttx/syscall
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/syscall')
-rw-r--r--nuttx/syscall/Makefile3
-rw-r--r--nuttx/syscall/syscall_clock_systimer.c84
-rw-r--r--nuttx/syscall/syscall_funclookup.c13
-rw-r--r--nuttx/syscall/syscall_lookup.h2
4 files changed, 100 insertions, 2 deletions
diff --git a/nuttx/syscall/Makefile b/nuttx/syscall/Makefile
index eb602624e..fe6df054f 100644
--- a/nuttx/syscall/Makefile
+++ b/nuttx/syscall/Makefile
@@ -43,6 +43,7 @@ MKSYSCALL = "$(TOPDIR)$(DELIM)tools$(DELIM)mksyscall$(EXEEXT)"
CSVFILE = "$(TOPDIR)$(DELIM)syscall$(DELIM)syscall.csv"
STUB_SRCS += syscall_funclookup.c syscall_stublookup.c syscall_nparms.c
+STUB_SRCS += syscall_clock_systimer.c
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
@@ -77,7 +78,7 @@ $(BIN1): $(PROXY_OBJS)
$(call ARCHIVE, $@, $(PROXY_OBJS))
$(BIN2): $(STUB_OBJS)
- $(call ARCHIVE, $@, "$(STUB_OBJS)")
+ $(call ARCHIVE, $@, $(STUB_OBJS))
.depend: Makefile $(SRCS)
$(Q) $(MKDEP) $(ROOTDEPPATH) $(PROXYDEPPATH) $(STUBDEPPATH) \
diff --git a/nuttx/syscall/syscall_clock_systimer.c b/nuttx/syscall/syscall_clock_systimer.c
new file mode 100644
index 000000000..e92b615a4
--- /dev/null
+++ b/nuttx/syscall/syscall_clock_systimer.c
@@ -0,0 +1,84 @@
+/****************************************************************************
+ * syscall/syscall_stublookup.c
+ *
+ * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <stdint.h>
+
+#include <nuttx/clock.h>
+
+#ifndef CONFIG_DISABLE_CLOCK
+
+/****************************************************************************
+ * Pre-processor definitions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: syscall_clock_systimer
+ *
+ * Description:
+ * In the kernel build, proxying for clock_systimer() must be handled
+ * specially. In the kernel phase of the build, clock_systimer() is
+ * macro that simply accesses a global variable. In the user phase of
+ * the kernel build, clock_systimer() is a proxy function.
+ *
+ * In order to fill out the table g_funclookup[], this function will stand
+ * in during the kernel phase of the build so that clock_systemer() will
+ * have an address that can be included in the g_funclookup[] table.
+ *
+ ****************************************************************************/
+
+uint32_t syscall_clock_systimer(void)
+{
+ return clock_systimer();
+}
+
+#endif /* !CONFIG_DISABLE_CLOCK */
diff --git a/nuttx/syscall/syscall_funclookup.c b/nuttx/syscall/syscall_funclookup.c
index 553381cd7..b768b2445 100644
--- a/nuttx/syscall/syscall_funclookup.c
+++ b/nuttx/syscall/syscall_funclookup.c
@@ -76,6 +76,19 @@
#include <nuttx/clock.h>
+/* clock_systimer is a special case: In the kernel build, proxying for
+ * clock_systimer() must be handled specially. In the kernel phase of
+ * the build, clock_systimer() is macro that simply accesses a global
+ * variable. In the user phase of the kernel build, clock_systimer()
+ * is a proxy function.
+ *
+ * In order to fill out the table g_funclookup[], this function will stand
+ * in during the kernel phase of the build so that clock_systemer() will
+ * have an address that can be included in the g_funclookup[] table.
+ */
+
+uint32_t syscall_clock_systimer(void);
+
/****************************************************************************
* Pre-processor definitions
****************************************************************************/
diff --git a/nuttx/syscall/syscall_lookup.h b/nuttx/syscall/syscall_lookup.h
index 1a958143c..e134c7179 100644
--- a/nuttx/syscall/syscall_lookup.h
+++ b/nuttx/syscall/syscall_lookup.h
@@ -128,7 +128,7 @@ SYSCALL_LOOKUP(up_assert_code, 3, STUB_up_assert_code)
*/
#ifndef CONFIG_DISABLE_CLOCK
- SYSCALL_LOOKUP(clock_systimer, 0, STUB_clock_systimer)
+ SYSCALL_LOOKUP(syscall_clock_systimer, 0, STUB_clock_systimer)
SYSCALL_LOOKUP(clock_getres, 2, STUB_clock_getres)
SYSCALL_LOOKUP(clock_gettime, 2, STUB_clock_gettime)
SYSCALL_LOOKUP(clock_settime, 2, STUB_clock_settime)