diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-02-20 23:51:56 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-02-20 23:51:56 +0000 |
commit | f26db4e2308c961f1cb52fcb656c85a144f8fd16 (patch) | |
tree | 94f39b537ed7d08643849037dde567662056882a /nuttx/sched | |
parent | 5e160e6e0cdfae48ea120909e7febc62b6b56eb2 (diff) | |
download | px4-nuttx-f26db4e2308c961f1cb52fcb656c85a144f8fd16.tar.gz px4-nuttx-f26db4e2308c961f1cb52fcb656c85a144f8fd16.tar.bz2 px4-nuttx-f26db4e2308c961f1cb52fcb656c85a144f8fd16.zip |
Fixes for STDCC compiler (more needed)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@16 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched')
-rw-r--r-- | nuttx/sched/Makefile | 2 | ||||
-rw-r--r-- | nuttx/sched/mq_internal.h | 4 | ||||
-rw-r--r-- | nuttx/sched/os_start.c | 24 | ||||
-rw-r--r-- | nuttx/sched/sched_free.c | 4 | ||||
-rw-r--r-- | nuttx/sched/sig_internal.h | 9 |
5 files changed, 35 insertions, 8 deletions
diff --git a/nuttx/sched/Makefile b/nuttx/sched/Makefile index 9872c7f02..bc144b797 100644 --- a/nuttx/sched/Makefile +++ b/nuttx/sched/Makefile @@ -121,7 +121,7 @@ $(BIN): $(OBJS) depend: .depend clean: - rm -f $(BIN) *.o *~ + rm -f $(BIN) *.o *.asm *.lst *.sym *~ distclean: clean rm -f Make.dep .depend diff --git a/nuttx/sched/mq_internal.h b/nuttx/sched/mq_internal.h index 226835d21..ba2368e43 100644 --- a/nuttx/sched/mq_internal.h +++ b/nuttx/sched/mq_internal.h @@ -43,6 +43,7 @@ #include <sys/types.h> #include <mqueue.h> #include <sched.h> +#include <signal.h> #include <nuttx/compiler.h> /************************************************************ @@ -106,6 +107,8 @@ typedef struct mqmsg mqmsg_t; /* This structure defines a message queue */ +struct mq_des; /* forward reference */ + struct msgq_s { struct msgq_s *flink; /* Forward link to next message queue */ @@ -123,7 +126,6 @@ struct msgq_s union sigval ntvalue; /* Notification: Signal value */ char name[1]; /* Start of the queue name */ }; -typedef struct msgq_s msgq_t; #define SIZEOF_MQ_HEADER ((int)(((msgq_t*)NULL)->name)) diff --git a/nuttx/sched/os_start.c b/nuttx/sched/os_start.c index b96a650cb..638180082 100644 --- a/nuttx/sched/os_start.c +++ b/nuttx/sched/os_start.c @@ -260,7 +260,9 @@ void os_start(void) /* Initialize the interrupt handling subsystem (if included) */ +#ifdef CONFIG_HAVE_WEAKFUNCTIONS if (irq_initialize != NULL) +#endif { irq_initialize(); } @@ -270,56 +272,72 @@ void os_start(void) * is called only if it is provided in the link. */ +#ifdef CONFIG_HAVE_WEAKFUNCTIONS if (user_initialize != NULL) +#endif { user_initialize(); } /* Initialize the POSIX timer facility (if included in the link) */ +#ifdef CONFIG_HAVE_WEAKFUNCTIONS if (clock_initialize != NULL) +#endif { clock_initialize(); } /* Initialize the watchdog facility (if included in the link) */ +#ifdef CONFIG_HAVE_WEAKFUNCTIONS if (wd_initialize != NULL) +#endif { wd_initialize(); } /* Initialize the signal facility (if in link) */ +#ifdef CONFIG_HAVE_WEAKFUNCTIONS if (sig_initialize != NULL) +#endif { sig_initialize(); } /* Initialize the semaphore facility. (if in link) */ +#ifdef CONFIG_HAVE_WEAKFUNCTIONS if (sem_initialize != NULL) +#endif { sem_initialize(); } /* Initialize the named message queue facility (if in link) */ +#ifdef CONFIG_HAVE_WEAKFUNCTIONS if (mq_initialize != NULL) +#endif { mq_initialize(); } /* Initialize the thread-specific data facility (if in link) */ +#ifdef CONFIG_HAVE_WEAKFUNCTIONS if (pthread_initialize != NULL) +#endif { pthread_initialize(); } /* Initialize the file system (needed to support device drivers) */ +#ifdef CONFIG_HAVE_WEAKFUNCTIONS if (fs_initialize != NULL) +#endif { fs_initialize(); } @@ -336,7 +354,9 @@ void os_start(void) * is done last because the libraries may depend on the above. */ +#ifdef CONFIG_HAVE_WEAKFUNCTIONS if (lib_initialize != NULL) +#endif { lib_initialize(); } @@ -366,9 +386,9 @@ void os_start(void) { /* Remove the first delayed deallocation. */ - uint32 savedState = irqsave(); + uint32 saved_state = irqsave(); void *address = (void*)sq_remfirst(&g_delayeddeallocations); - irqrestore(savedState); + irqrestore(saved_state); /* Then deallocate it */ diff --git a/nuttx/sched/sched_free.c b/nuttx/sched/sched_free.c index 205da0a46..9fc2a261d 100644 --- a/nuttx/sched/sched_free.c +++ b/nuttx/sched/sched_free.c @@ -90,9 +90,9 @@ void sched_free(void *address) { /* Yes.. Delay the deallocation until a more appropriate time. */ - uint32 savedState = irqsave(); + uint32 saved_state = irqsave(); sq_addlast((sq_entry_t*)address, &g_delayeddeallocations); - irqrestore(savedState); + irqrestore(saved_state); } else { diff --git a/nuttx/sched/sig_internal.h b/nuttx/sched/sig_internal.h index fd8390cfe..dcc4d3d25 100644 --- a/nuttx/sched/sig_internal.h +++ b/nuttx/sched/sig_internal.h @@ -175,8 +175,13 @@ extern void sig_cleanup(_TCB *stcb); extern void sig_deliver(_TCB *stcb); extern sigactq_t *sig_findaction(_TCB *stcb, int signo); extern int sig_lowest(sigset_t *set); -extern int sig_mqnotempty (int tid, int signo, - const union sigval value); +#ifdef CONFIG_CAN_PASS_STRUCTS +extern int sig_mqnotempty(int tid, int signo, + const union sigval value); +#else +extern int sig_mqnotempty(int tid, int signo, + void *sival_ptr); +#endif extern int sig_received(_TCB *stcb, siginfo_t *info); extern void sig_releasependingsigaction(sigq_t *sigq); extern void sig_releasependingsignal(sigpendq_t *sigpend); |