summaryrefslogtreecommitdiff
path: root/components/libc/compilers/common/include/sys
diff options
context:
space:
mode:
authorguo <[email protected]>2022-12-03 12:07:44 +0800
committerGitHub <[email protected]>2022-12-03 12:07:44 +0800
commitecf2d8215961ca7c539132b62a72df6072cc3e14 (patch)
tree59005f0f74f2593c0435059264f624c862a89f55 /components/libc/compilers/common/include/sys
parentaaf5462c6d4ae9466a0a8cd2a4bb00cfe1fef2f2 (diff)
sync branch rt-smart. (#6641)
* Synchronize the code of the rt mart branch to the master branch. * TTY device * Add lwP code from rt-smart * Add vnode in DFS, but DFS will be re-write for rt-smart * There are three libcpu for rt-smart: * arm/cortex-a, arm/aarch64 * riscv64 Co-authored-by: Rbb666 <[email protected]> Co-authored-by: zhkag <[email protected]>
Diffstat (limited to 'components/libc/compilers/common/include/sys')
-rw-r--r--components/libc/compilers/common/include/sys/signal.h8
-rw-r--r--components/libc/compilers/common/include/sys/time.h13
2 files changed, 14 insertions, 7 deletions
diff --git a/components/libc/compilers/common/include/sys/signal.h b/components/libc/compilers/common/include/sys/signal.h
index 1a3b9c1beb..f2a21baed7 100644
--- a/components/libc/compilers/common/include/sys/signal.h
+++ b/components/libc/compilers/common/include/sys/signal.h
@@ -24,10 +24,10 @@ extern "C" {
#define SIGEV_NONE 1 /* No asynchronous notification shall be delivered */
/* when the event of interest occurs. */
-#define SIGEV_SIGNAL 2 /* A queued signal, with an application defined */
+#define SIGEV_SIGNAL 0 /* A queued signal, with an application defined */
/* value, shall be delivered when the event of */
/* interest occurs. */
-#define SIGEV_THREAD 3 /* A notification function shall be called to */
+#define SIGEV_THREAD 2 /* A notification function shall be called to */
/* perform notification. */
/* Signal Generation and Delivery, P1003.1b-1993, p. 63
@@ -41,9 +41,9 @@ union sigval
struct sigevent
{
- int sigev_notify; /* Notification type */
+ union sigval sigev_value;
int sigev_signo; /* Signal number */
- union sigval sigev_value; /* Signal value */
+ int sigev_notify; /* Notification type */
void (*sigev_notify_function)( union sigval );
/* Notification function */
void *sigev_notify_attributes; /* Notification Attributes, really pthread_attr_t */
diff --git a/components/libc/compilers/common/include/sys/time.h b/components/libc/compilers/common/include/sys/time.h
index e3bf3ee4ef..8a1ae60909 100644
--- a/components/libc/compilers/common/include/sys/time.h
+++ b/components/libc/compilers/common/include/sys/time.h
@@ -99,8 +99,6 @@ time_t time(time_t* t);
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
#endif /* RT_USING_POSIX_DELAY */
-#if defined(RT_USING_POSIX_CLOCK) || defined (RT_USING_POSIX_TIMER)
-/* POSIX clock and timer */
#define MILLISECOND_PER_SECOND 1000UL
#define MICROSECOND_PER_SECOND 1000000UL
#define NANOSECOND_PER_SECOND 1000000000UL
@@ -109,6 +107,9 @@ int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
#define MICROSECOND_PER_TICK (MICROSECOND_PER_SECOND / RT_TICK_PER_SECOND)
#define NANOSECOND_PER_TICK (NANOSECOND_PER_SECOND / RT_TICK_PER_SECOND)
+#if defined(RT_USING_POSIX_CLOCK) || defined (RT_USING_POSIX_TIMER)
+/* POSIX clock and timer */
+
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 1
#endif /* CLOCK_REALTIME */
@@ -126,6 +127,12 @@ int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
#ifndef CLOCK_MONOTONIC
#define CLOCK_MONOTONIC 4
#endif /* CLOCK_MONOTONIC */
+
+#ifdef CLOCK_TAI
+#define CLOCK_ID_MAX CLOCK_TAI
+#else
+#define CLOCK_ID_MAX CLOCK_MONOTONIC
+#endif
#endif /* defined(RT_USING_POSIX_CLOCK) || defined (RT_USING_POSIX_TIMER) */
#ifdef RT_USING_POSIX_CLOCK
@@ -137,7 +144,7 @@ int rt_timespec_to_tick(const struct timespec *time);
#endif /* RT_USING_POSIX_CLOCK */
#ifdef RT_USING_POSIX_TIMER
-#include "signal.h"
+#include <sys/signal.h>
int timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid);
int timer_delete(timer_t timerid);
int timer_getoverrun(timer_t timerid);