mirror of
https://github.com/apache/nuttx.git
synced 2026-09-24 08:45:04 +08:00
Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t
Squashed commit of the following:
sched: Rename all use of system_t to clock_t.
syscall: Rename all use of system_t to clock_t.
net: Rename all use of system_t to clock_t.
libs: Rename all use of system_t to clock_t.
fs: Rename all use of system_t to clock_t.
drivers: Rename all use of system_t to clock_t.
arch: Rename all use of system_t to clock_t.
include: Remove definition of systime_t; rename all use of system_t to clock_t.
This commit is contained in:
+11
-13
@@ -43,8 +43,10 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
/****************************************************************************
|
||||
@@ -215,6 +217,7 @@
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/* This structure is used to report CPU usage for a particular thread */
|
||||
|
||||
#ifdef CONFIG_SCHED_CPULOAD
|
||||
@@ -225,20 +228,15 @@ struct cpuload_s
|
||||
};
|
||||
#endif
|
||||
|
||||
/* This type is the natural with of the system timer */
|
||||
/* This non-standard type used to hold relative clock ticks that may take
|
||||
* negative values. Because of its non-portable nature the type sclock_t
|
||||
* should be used only within the OS proper and not by portable applications.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SYSTEM_TIME64
|
||||
typedef uint64_t systime_t;
|
||||
typedef int64_t sclock_t;
|
||||
#else
|
||||
typedef uint32_t systime_t;
|
||||
#endif
|
||||
|
||||
/* This type used to hold relative ticks that may have negative value */
|
||||
|
||||
#ifdef CONFIG_SYSTEM_TIME64
|
||||
typedef int64_t ssystime_t;
|
||||
#else
|
||||
typedef int32_t ssystime_t;
|
||||
typedef int32_t sclock_t;
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -261,7 +259,7 @@ extern "C"
|
||||
*/
|
||||
|
||||
#ifdef __HAVE_KERNEL_GLOBALS
|
||||
EXTERN volatile systime_t g_system_timer;
|
||||
EXTERN volatile clock_t g_system_timer;
|
||||
|
||||
#ifndef CONFIG_SYSTEM_TIME64
|
||||
# define clock_systimer() g_system_timer
|
||||
@@ -361,7 +359,7 @@ void clock_resynchronize(FAR struct timespec *rtc_diff);
|
||||
****************************************************************************/
|
||||
|
||||
#if !defined(__HAVE_KERNEL_GLOBALS) || defined(CONFIG_SYSTEM_TIME64)
|
||||
systime_t clock_systimer(void);
|
||||
clock_t clock_systimer(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -439,7 +439,7 @@ struct sixlowpan_reassbuf_s
|
||||
* be cancelled.
|
||||
*/
|
||||
|
||||
systime_t rb_time;
|
||||
clock_t rb_time;
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -326,7 +326,7 @@ struct sporadic_s
|
||||
uint8_t nrepls; /* Number of active replenishments */
|
||||
uint32_t repl_period; /* Sporadic replenishment period */
|
||||
uint32_t budget; /* Sporadic execution budget period */
|
||||
systime_t eventtime; /* Time thread suspended or [re-]started */
|
||||
clock_t eventtime; /* Time thread suspended or [re-]started */
|
||||
|
||||
/* This is the last interval timer activated */
|
||||
|
||||
|
||||
@@ -321,7 +321,7 @@ int nxsem_timedwait(FAR sem_t *sem, FAR const struct timespec *abstime);
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int nxsem_tickwait(FAR sem_t *sem, systime_t start, uint32_t delay);
|
||||
int nxsem_tickwait(FAR sem_t *sem, clock_t start, uint32_t delay);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: nxsem_post
|
||||
|
||||
@@ -292,8 +292,8 @@ struct work_s
|
||||
struct dq_entry_s dq; /* Implements a doubly linked list */
|
||||
worker_t worker; /* Work callback */
|
||||
FAR void *arg; /* Callback argument */
|
||||
systime_t qtime; /* Time work queued */
|
||||
systime_t delay; /* Delay until work performed */
|
||||
clock_t qtime; /* Time work queued */
|
||||
clock_t delay; /* Delay until work performed */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@@ -361,7 +361,7 @@ int work_usrstart(void);
|
||||
****************************************************************************/
|
||||
|
||||
int work_queue(int qid, FAR struct work_s *work, worker_t worker,
|
||||
FAR void *arg, systime_t delay);
|
||||
FAR void *arg, clock_t delay);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: work_cancel
|
||||
|
||||
+6
-1
@@ -231,7 +231,12 @@ typedef int16_t blksize_t;
|
||||
typedef unsigned int socklen_t;
|
||||
typedef uint16_t sa_family_t;
|
||||
|
||||
/* Used for system times in clock ticks (equivalent to systime_t) */
|
||||
/* Used for system times in clock ticks. This type is the natural width of
|
||||
* the system timer.
|
||||
*
|
||||
* NOTE: The signed-ness of clock_t is not specified at OpenGroup.org. An
|
||||
* unsigned type is used to support the full range of the internal clock.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SYSTEM_TIME64
|
||||
typedef uint64_t clock_t;
|
||||
|
||||
Reference in New Issue
Block a user