mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
Remove clock_systimer32 and clock_systimer64. There is now only clock_systimer
This commit is contained in:
@@ -11338,4 +11338,6 @@
|
|||||||
systime_t to represent the 32- or 64-bit system timer (2016-01-21).
|
systime_t to represent the 32- or 64-bit system timer (2016-01-21).
|
||||||
* sched/clock/clock_systimespec.c: Fix an error in a time
|
* sched/clock/clock_systimespec.c: Fix an error in a time
|
||||||
conversion (2016-01-21).
|
conversion (2016-01-21).
|
||||||
|
* include/nuttx/clock.h: Get rid of clock_systimer32() and
|
||||||
|
clock_systime64(). There is now only clock_systimer() (2016-01-21).
|
||||||
|
|
||||||
|
|||||||
+8
-53
@@ -165,14 +165,6 @@
|
|||||||
#define TICK2DSEC(tick) (((tick)+(TICK_PER_DSEC/2))/TICK_PER_DSEC) /* Rounds */
|
#define TICK2DSEC(tick) (((tick)+(TICK_PER_DSEC/2))/TICK_PER_DSEC) /* Rounds */
|
||||||
#define TICK2SEC(tick) (((tick)+(TICK_PER_SEC/2))/TICK_PER_SEC) /* Rounds */
|
#define TICK2SEC(tick) (((tick)+(TICK_PER_SEC/2))/TICK_PER_SEC) /* Rounds */
|
||||||
|
|
||||||
/* Select the access to the system timer using its natural with */
|
|
||||||
|
|
||||||
#ifdef CONFIG_SYSTEM_TIME64
|
|
||||||
# define clock_systimer() clock_systimer64()
|
|
||||||
#else
|
|
||||||
# define clock_systimer() clock_systimer32()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -214,18 +206,8 @@ extern "C"
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __HAVE_KERNEL_GLOBALS
|
#ifdef __HAVE_KERNEL_GLOBALS
|
||||||
# ifdef CONFIG_SYSTEM_TIME64
|
EXTERN volatile systime_t g_system_timer;
|
||||||
|
# define clock_systimer() g_system_timer
|
||||||
EXTERN volatile uint64_t g_system_timer;
|
|
||||||
#define clock_systimer32() (uint32_t)(g_system_timer & 0x00000000ffffffff)
|
|
||||||
#define clock_systimer64() g_system_timer
|
|
||||||
|
|
||||||
# else
|
|
||||||
|
|
||||||
EXTERN volatile uint32_t g_system_timer;
|
|
||||||
#define clock_systimer32() g_system_timer
|
|
||||||
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -265,13 +247,13 @@ void clock_synchronize(void);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Function: clock_systimer32
|
* Function: clock_systimer
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Return the current value of the 32-bit system timer counter. Indirect
|
* Return the current value of the 32/64-bit system timer counter.
|
||||||
* access to the system timer counter is required through this function if
|
* Indirect access to the system timer counter is required through this
|
||||||
* the execution environment does not have direct access to kernel global
|
* function if the execution environment does not have direct access to
|
||||||
* data
|
* kernel globaldata
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* None
|
* None
|
||||||
@@ -284,34 +266,7 @@ void clock_synchronize(void);
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef __HAVE_KERNEL_GLOBALS
|
#ifndef __HAVE_KERNEL_GLOBALS
|
||||||
# ifdef CONFIG_SYSTEM_TIME64
|
systime_t clock_systimer(void);
|
||||||
# define clock_systimer32() (uint32_t)(clock_systimer64() & 0x00000000ffffffff)
|
|
||||||
# else
|
|
||||||
uint32_t clock_systimer32(void);
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Function: clock_systimer64
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Return the current value of the 64-bit system timer counter. Indirect
|
|
||||||
* access to the system timer counter is required through this function if
|
|
||||||
* the execution environment does not have direct access to kernel global
|
|
||||||
* data
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Return Value:
|
|
||||||
* The current value of the system timer counter
|
|
||||||
*
|
|
||||||
* Assumptions:
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(__HAVE_KERNEL_GLOBALS) && defined(CONFIG_SYSTEM_TIME64)
|
|
||||||
uint64_t clock_systimer64(void);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -211,11 +211,7 @@
|
|||||||
* NuttX configuration.
|
* NuttX configuration.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_SYSTEM_TIME64
|
#define SYS_clock_systimer (__SYS_clock+0)
|
||||||
# define SYS_clock_systimer64 (__SYS_clock+0)
|
|
||||||
#else
|
|
||||||
# define SYS_clock_systimer32 (__SYS_clock+0)
|
|
||||||
#endif
|
|
||||||
#define SYS_clock_getres (__SYS_clock+1)
|
#define SYS_clock_getres (__SYS_clock+1)
|
||||||
#define SYS_clock_gettime (__SYS_clock+2)
|
#define SYS_clock_gettime (__SYS_clock+2)
|
||||||
#define SYS_clock_settime (__SYS_clock+3)
|
#define SYS_clock_settime (__SYS_clock+3)
|
||||||
|
|||||||
@@ -51,8 +51,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
/* See nuttx/clock.h */
|
/* See nuttx/clock.h */
|
||||||
|
|
||||||
#undef clock_systimer32
|
#undef clock_systimer
|
||||||
#undef clock_systimer64
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Data
|
* Private Data
|
||||||
@@ -63,10 +62,10 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: clock_systimer32
|
* Name: clock_systimer
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Return the current value of the 32-bit system timer counter
|
* Return the current value of the 32/64-bit system timer counter
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* None
|
* None
|
||||||
@@ -78,57 +77,10 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
uint32_t clock_systimer32(void)
|
systime_t clock_systimer(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SCHED_TICKLESS
|
#ifdef CONFIG_SCHED_TICKLESS
|
||||||
struct timespec ts;
|
|
||||||
uint64_t tmp;
|
|
||||||
|
|
||||||
/* Get the time from the platform specific hardware */
|
|
||||||
|
|
||||||
(void)up_timer_gettime(&ts);
|
|
||||||
|
|
||||||
/* Convert to a 64- then 32-bit value */
|
|
||||||
|
|
||||||
tmp = MSEC2TICK(1000 * (uint64_t)ts.tv_sec + (uint64_t)ts.tv_nsec / 1000000);
|
|
||||||
return (uint32_t)(tmp & 0x00000000ffffffff);
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#ifdef CONFIG_SYSTEM_TIME64
|
#ifdef CONFIG_SYSTEM_TIME64
|
||||||
/* Return the current system time truncated to 32-bits */
|
|
||||||
|
|
||||||
return (uint32_t)(g_system_timer & 0x00000000ffffffff);
|
|
||||||
|
|
||||||
#else
|
|
||||||
/* Return the current system time */
|
|
||||||
|
|
||||||
return g_system_timer;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: clock_systimer64
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Return the current value of the 64-bit system timer counter
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* None
|
|
||||||
*
|
|
||||||
* Return Value:
|
|
||||||
* The current value of the system timer counter
|
|
||||||
*
|
|
||||||
* Assumptions:
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifdef CONFIG_SYSTEM_TIME64
|
|
||||||
uint64_t clock_systimer64(void)
|
|
||||||
{
|
|
||||||
#ifdef CONFIG_SCHED_TICKLESS
|
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
/* Get the time from the platform specific hardware */
|
/* Get the time from the platform specific hardware */
|
||||||
@@ -139,10 +91,23 @@ uint64_t clock_systimer64(void)
|
|||||||
|
|
||||||
return USEC2TICK(1000000 * (uint64_t)ts.tv_sec + (uint64_t)ts.tv_nsec / 1000);
|
return USEC2TICK(1000000 * (uint64_t)ts.tv_sec + (uint64_t)ts.tv_nsec / 1000);
|
||||||
#else
|
#else
|
||||||
|
struct timespec ts;
|
||||||
|
uint64_t tmp;
|
||||||
|
|
||||||
|
/* Get the time from the platform specific hardware */
|
||||||
|
|
||||||
|
(void)up_timer_gettime(&ts);
|
||||||
|
|
||||||
|
/* Convert to a 64- then 32-bit value */
|
||||||
|
|
||||||
|
tmp = MSEC2TICK(1000 * (uint64_t)ts.tv_sec + (uint64_t)ts.tv_nsec / 1000000);
|
||||||
|
return (systime_t)(tmp & 0x00000000ffffffff);
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
|
||||||
/* Return the current system time */
|
/* Return the current system time */
|
||||||
|
|
||||||
return g_system_timer;
|
return g_system_timer;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
+1
-2
@@ -11,8 +11,7 @@
|
|||||||
"clock_getres","time.h","","int","clockid_t","struct timespec*"
|
"clock_getres","time.h","","int","clockid_t","struct timespec*"
|
||||||
"clock_gettime","time.h","","int","clockid_t","struct timespec*"
|
"clock_gettime","time.h","","int","clockid_t","struct timespec*"
|
||||||
"clock_settime","time.h","","int","clockid_t","const struct timespec*"
|
"clock_settime","time.h","","int","clockid_t","const struct timespec*"
|
||||||
"clock_systimer32","nuttx/clock.h","!defined(__HAVE_KERNEL_GLOBALS) && !defined(CONFIG_SYSTEM_TIME64)","uint32_t"
|
"clock_systimer","nuttx/clock.h","!defined(__HAVE_KERNEL_GLOBALS)","systime_t"
|
||||||
"clock_systimer64","nuttx/clock.h","!defined(__HAVE_KERNEL_GLOBALS) && defined(CONFIG_SYSTEM_TIME64)","uint64_t"
|
|
||||||
"close","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","int","int"
|
"close","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","int","int"
|
||||||
"closedir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","int","FAR DIR*"
|
"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"
|
"connect","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","FAR const struct sockaddr*","socklen_t"
|
||||||
|
|||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* syscall/syscall_clock_systimer.c
|
* syscall/syscall_clock_systimer.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2012, 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2012, 2014, 2016 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: syscall_clock_systimer32/64
|
* Name: syscall_clock_systimer
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* In the kernel build, proxying for clock_systimer() must be handled
|
* In the kernel build, proxying for clock_systimer() must be handled
|
||||||
@@ -74,14 +74,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_SYSTEM_TIME64
|
systime_t syscall_clock_systimer(void)
|
||||||
uint64_t syscall_clock_systimer64(void)
|
|
||||||
{
|
{
|
||||||
return clock_systimer64();
|
return clock_systime();
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
uint32_t syscall_clock_systimer32(void)
|
|
||||||
{
|
|
||||||
return clock_systimer32();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -99,11 +99,7 @@
|
|||||||
* have an address that can be included in the g_funclookup[] table.
|
* have an address that can be included in the g_funclookup[] table.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_SYSTEM_TIME64
|
systime_t syscall_clock_systimer(void);
|
||||||
uint64_t syscall_clock_systimer64(void);
|
|
||||||
#else
|
|
||||||
uint32_t syscall_clock_systimer32(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
|
|||||||
@@ -148,11 +148,7 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert)
|
|||||||
* NuttX configuration.
|
* NuttX configuration.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_SYSTEM_TIME64
|
SYSCALL_LOOKUP(syscall_clock_systimer, 0, STUB_clock_systimer)
|
||||||
SYSCALL_LOOKUP(syscall_clock_systimer64, 0, STUB_clock_systimer64)
|
|
||||||
#else
|
|
||||||
SYSCALL_LOOKUP(syscall_clock_systimer32, 0, STUB_clock_systimer32)
|
|
||||||
#endif
|
|
||||||
SYSCALL_LOOKUP(clock_getres, 2, STUB_clock_getres)
|
SYSCALL_LOOKUP(clock_getres, 2, STUB_clock_getres)
|
||||||
SYSCALL_LOOKUP(clock_gettime, 2, STUB_clock_gettime)
|
SYSCALL_LOOKUP(clock_gettime, 2, STUB_clock_gettime)
|
||||||
SYSCALL_LOOKUP(clock_settime, 2, STUB_clock_settime)
|
SYSCALL_LOOKUP(clock_settime, 2, STUB_clock_settime)
|
||||||
|
|||||||
@@ -150,11 +150,7 @@ uintptr_t STUB_nanosleep(int nbr, uintptr_t parm1, uintptr_t parm2);
|
|||||||
* NuttX configuration.
|
* NuttX configuration.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_SYSTEM_TIME64
|
uintptr_t STUB_clock_systimer(int nbr);
|
||||||
uintptr_t STUB_clock_systimer64(int nbr);
|
|
||||||
#else
|
|
||||||
uintptr_t STUB_clock_systimer32(int nbr);
|
|
||||||
#endif
|
|
||||||
uintptr_t STUB_clock_getres(int nbr, uintptr_t parm1, uintptr_t parm2);
|
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_gettime(int nbr, uintptr_t parm1, uintptr_t parm2);
|
||||||
uintptr_t STUB_clock_settime(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