summaryrefslogtreecommitdiff
path: root/nuttx/sched
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/sched')
-rw-r--r--nuttx/sched/clock_settime.c3
-rw-r--r--nuttx/sched/sched_processtimer.c4
-rw-r--r--nuttx/sched/sig_action.c9
-rw-r--r--nuttx/sched/sig_internal.h2
-rw-r--r--nuttx/sched/sig_queue.c16
5 files changed, 28 insertions, 6 deletions
diff --git a/nuttx/sched/clock_settime.c b/nuttx/sched/clock_settime.c
index 5f565ea36..afd4005c5 100644
--- a/nuttx/sched/clock_settime.c
+++ b/nuttx/sched/clock_settime.c
@@ -101,7 +101,8 @@ int clock_settime(clockid_t clock_id, const struct timespec *tp)
{
/* Save the new base time. */
- g_basetime = *tp;
+ g_basetime.tv_sec = tp->tv_sec;
+ g_basetime.tv_nsec = tp->tv_nsec;
/* Get the elapsed time since power up (in milliseconds) biased
* as appropriate.
diff --git a/nuttx/sched/sched_processtimer.c b/nuttx/sched/sched_processtimer.c
index de066eb46..bb56dbacb 100644
--- a/nuttx/sched/sched_processtimer.c
+++ b/nuttx/sched/sched_processtimer.c
@@ -161,14 +161,18 @@ void sched_process_timer(void)
{
/* Increment the system time (if in the link) */
+#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (clock_timer != NULL)
+#endif
{
clock_timer();
}
/* Process watchdogs (if in the link) */
+#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (wd_timer != NULL)
+#endif
{
wd_timer();
}
diff --git a/nuttx/sched/sig_action.c b/nuttx/sched/sig_action.c
index 14388c3d5..7f9a1c343 100644
--- a/nuttx/sched/sig_action.c
+++ b/nuttx/sched/sig_action.c
@@ -48,6 +48,11 @@
* Definitions
************************************************************/
+#define COPY_SIGACTION(t,f) \
+ { (t)->sa_sigaction = (f)->sa_sigaction; \
+ (t)->sa_mask = (f)->sa_mask; \
+ (t)->sa_flags = (f)->sa_flags; }
+
/************************************************************
* Private Type Declarations
************************************************************/
@@ -190,7 +195,7 @@ int sigaction(int signo, const struct sigaction *act,
{
if (sigact)
{
- *oact = sigact->act;
+ COPY_SIGACTION(oact, &sigact->act);
}
else
{
@@ -236,7 +241,7 @@ int sigaction(int signo, const struct sigaction *act,
if (act->sa_u._sa_handler)
{
- sigact->act = *act;
+ COPY_SIGACTION(&sigact->act, act);
}
/* No.. It is a request to remove the old handler */
diff --git a/nuttx/sched/sig_internal.h b/nuttx/sched/sig_internal.h
index dcc4d3d25..b03b2ec0e 100644
--- a/nuttx/sched/sig_internal.h
+++ b/nuttx/sched/sig_internal.h
@@ -104,7 +104,7 @@ struct sigq_s
struct sigq_s *flink; /* Forward link */
union
{
- saVxHandType *sighandler;
+ void (*sighandler)(int signo, siginfo_t *info, void *context);
} action; /* Signal action */
sigset_t mask; /* Additional signals to mask while the
* the signal-catching functin executes */
diff --git a/nuttx/sched/sig_queue.c b/nuttx/sched/sig_queue.c
index b9abf7f39..b9d71efcc 100644
--- a/nuttx/sched/sig_queue.c
+++ b/nuttx/sched/sig_queue.c
@@ -37,6 +37,7 @@
* Included Files
************************************************************/
+#include <nuttx/config.h>
#include <sys/types.h>
#include <signal.h>
#include <debug.h>
@@ -96,7 +97,11 @@
*
************************************************************/
+#ifdef CONFIG_CAN_PASS_STRUCTS
int sigqueue (int pid, int signo, const union sigval value)
+#else
+int sigqueue(int pid, int signo, void *sival_ptr)
+#endif
{
_TCB *stcb;
siginfo_t info;
@@ -107,14 +112,21 @@ int sigqueue (int pid, int signo, const union sigval value)
/* Get the TCB of the receiving task */
stcb = sched_gettcb(pid);
- dbg("sigqueue: TCB=0x%08x signo=%d value=%d\n",
- stcb, signo, value.sival_int);
+#ifdef CONFIG_CAN_PASS_STRUCTS
+ dbg("TCB=0x%08x signo=%d value=%d\n", stcb, signo, value.sival_int);
+#else
+ dbg("TCB=0x%08x signo=%d value=%p\n", stcb, signo, sival_ptr);
+#endif
/* Create the siginfo structure */
info.si_signo = signo;
info.si_code = SI_QUEUE;
+#ifdef CONFIG_CAN_PASS_STRUCTS
info.si_value = value;
+#else
+ info.si_value.sival_ptr = sival_ptr;
+#endif
/* Verify that we can perform the signalling operation */