mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
syscall: clock_systimer() is no longer a system call. It has been replaced with the equivalent, standard interface clock() as the system call.
sched/clock: Move the implementation of clock() from libs/libc/time to sched/clock. This is necessary because it calls the (now) internal OS function clock_systimer. clock() is now accessed only via a system call in certain configuratins. libs/libc/wqueue: Replace calls to clock_systimer() with calls to the equivalent clock().
This commit is contained in:
@@ -43,7 +43,6 @@ MKSYSCALL = "$(TOPDIR)$(DELIM)tools$(DELIM)mksyscall$(HOSTEXEEXT)"
|
||||
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))
|
||||
|
||||
+1
-1
@@ -9,11 +9,11 @@
|
||||
"bind","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","FAR const struct sockaddr*","socklen_t"
|
||||
"boardctl","sys/boardctl.h","defined(CONFIG_LIB_BOARDCTL)","int","unsigned int","uintptr_t"
|
||||
"clearenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int"
|
||||
"clock","time.h","","clock_t"
|
||||
"clock_getres","time.h","","int","clockid_t","struct timespec*"
|
||||
"clock_gettime","time.h","","int","clockid_t","struct timespec*"
|
||||
"clock_nanosleep","time.h","!defined(CONFIG_DISABLE_SIGNALS)","int","clockid_t","int","FAR const struct timespec *", "FAR struct timespec*"
|
||||
"clock_settime","time.h","","int","clockid_t","const struct timespec*"
|
||||
"clock_systimer","nuttx/clock.h","!defined(__HAVE_KERNEL_GLOBALS)","clock_t"
|
||||
"close","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","int","int"
|
||||
"closedir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","int","FAR DIR*"
|
||||
"connect","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","FAR const struct sockaddr*","socklen_t"
|
||||
|
||||
|
@@ -1,80 +0,0 @@
|
||||
/****************************************************************************
|
||||
* syscall/syscall_clock_systimer.c
|
||||
*
|
||||
* Copyright (C) 2011-2012, 2014, 2016 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>
|
||||
|
||||
/****************************************************************************
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
clock_t syscall_clock_systimer(void)
|
||||
{
|
||||
return clock_systimer();
|
||||
}
|
||||
@@ -89,19 +89,6 @@
|
||||
#include <nuttx/errno.h>
|
||||
#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.
|
||||
*/
|
||||
|
||||
clock_t syscall_clock_systimer(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
@@ -164,7 +164,7 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert)
|
||||
* NuttX configuration.
|
||||
*/
|
||||
|
||||
SYSCALL_LOOKUP(syscall_clock_systimer, 0, STUB_clock_systimer)
|
||||
SYSCALL_LOOKUP(syscall_clock, 0, STUB_clock)
|
||||
SYSCALL_LOOKUP(clock_getres, 2, STUB_clock_getres)
|
||||
SYSCALL_LOOKUP(clock_gettime, 2, STUB_clock_gettime)
|
||||
SYSCALL_LOOKUP(clock_settime, 2, STUB_clock_settime)
|
||||
|
||||
@@ -160,7 +160,7 @@ uintptr_t STUB_clock_nanosleep(int nbr, uintptr_t parm1, uintptr_t parm2,
|
||||
* NuttX configuration.
|
||||
*/
|
||||
|
||||
uintptr_t STUB_clock_systimer(int nbr);
|
||||
uintptr_t STUB_clock(int nbr);
|
||||
uintptr_t STUB_clock_getres(int nbr, uintptr_t parm1, uintptr_t parm2);
|
||||
uintptr_t STUB_clock_gettime(int nbr, uintptr_t parm1, uintptr_t parm2);
|
||||
uintptr_t STUB_clock_settime(int nbr, uintptr_t parm1, uintptr_t parm2);
|
||||
|
||||
Reference in New Issue
Block a user