9
0
Fork 0

Eliminating SDCC compilation errors

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@17 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2007-02-21 02:19:19 +00:00
parent f26db4e230
commit 94e5b72f50
9 changed files with 47 additions and 23 deletions

View File

@ -4019,10 +4019,12 @@ between Nuttx and a MoBY application:
<P>
The following structure defines the action to take for given signal:
<PRE>
struct sigaction {
union {
saHandType *_sa_handler;
saVxHandType *_sa_sigaction;
struct sigaction
{
union
{
void (*_sa_handler)(int);
void (*_sa_sigaction)(int, siginfo_t *, void *);
} sa_u;
sigset_t sa_mask;
int sa_flags;
@ -4031,13 +4033,6 @@ The following structure defines the action to take for given signal:
#define sa_sigaction sa_u._sa_sigaction
</PRE>
<P>
where:
<PRE>
typedef void saHandType( int signo );
typedef void saVxHandType( int signo, siginfo_t *info, void *context );
</PRE>
<H3>3.4.6 struct siginfo/siginfo_t</H3>
<P>

View File

@ -50,11 +50,19 @@
# define weak_function __attribute__ ((weak))
# define weak_const_function __attribute__ ((weak, __const__))
# define noreturn_function __attribute__ ((noreturn))
# define reentrant_function
#elif defined(__SDCC__)
# define weak_alias(name, aliasname)
# define weak_function
# define weak_const_function
# define noreturn_function
# define reentrant_function __reentrant
#else
# define weak_alias(name, aliasname)
# define weak_function
# define weak_const_function
# define noreturn_function
# define reentrant_function
#endif
/************************************************************

View File

@ -118,14 +118,12 @@ typedef struct siginfo
/* The following structure defines the action to take for given signal */
typedef void saHandType(int signo);
typedef void saVxHandType(int signo, siginfo_t *info, void *context);
struct sigaction
{
union
{
saHandType *_sa_handler;
saVxHandType *_sa_sigaction;
void (*_sa_handler)(int);
void (*_sa_sigaction)(int, siginfo_t *, void *);
} sa_u;
sigset_t sa_mask;
int sa_flags;
@ -166,10 +164,10 @@ EXTERN int sigtimedwait(const sigset_t *set,
struct siginfo *value,
const struct timespec *timeout);
#ifdef CONFIG_CAN_PASS_STRUCTS
EXTERN int sigqueue(int tid, int signo,
EXTERN int sigqueue(int pid, int signo,
const union sigval value);
#else
EXTERN int sigqueue(int tid, int signo, void *sival_ptr);
EXTERN int sigqueue(int pid, int signo, void *sival_ptr);
#endif
#undef EXTERN

View File

@ -42,6 +42,7 @@
#include <nuttx/config.h>
#include <arch/types.h>
#include <nuttx/compiler.h>
/************************************************************
* Definitions

View File

@ -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.

View File

@ -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();
}

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */