Fixes for STDCC compiler (more needed)

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@16 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2007-02-20 23:51:56 +00:00
parent 4881fed8bf
commit 59bd1d6954
7 changed files with 41 additions and 8 deletions
+3
View File
@@ -140,11 +140,14 @@ CONFIG_ARCH_KFREE=n
# long long types and if you plan to use them # long long types and if you plan to use them
# CONFIG_CAN_PASS_STRUCTS - enable if your compiler supports # CONFIG_CAN_PASS_STRUCTS - enable if your compiler supports
# passing structures and unions as values # passing structures and unions as values
# CONFIG_HAVE_WEAKFUNCTIONS - enable if you compiler supports
# weak functions (see include/nuttx/comp
# #
CONFIG_HAVE_INLINE=y CONFIG_HAVE_INLINE=y
CONFIG_HAVE_DOUBLE=y CONFIG_HAVE_DOUBLE=y
CONFIG_HAVE_LONG_LONG=n CONFIG_HAVE_LONG_LONG=n
CONFIG_CAN_PASS_STRUCTS=y CONFIG_CAN_PASS_STRUCTS=y
CONFIG_HAVE_WEAKFUNCTIONS=y
# #
# General build options # General build options
+3
View File
@@ -107,11 +107,14 @@ CONFIG_ARCH_KFREE=n
# long long types and if you plan to use them # long long types and if you plan to use them
# CONFIG_CAN_PASS_STRUCTS - enable if your compiler supports # CONFIG_CAN_PASS_STRUCTS - enable if your compiler supports
# passing structures and unions as values # passing structures and unions as values
# CONFIG_HAVE_WEAKFUNCTIONS - enable if you compiler supports
# weak functions (see include/nuttx/comp
# #
CONFIG_HAVE_INLINE=y CONFIG_HAVE_INLINE=y
CONFIG_HAVE_DOUBLE=y CONFIG_HAVE_DOUBLE=y
CONFIG_HAVE_LONG_LONG=n CONFIG_HAVE_LONG_LONG=n
CONFIG_CAN_PASS_STRUCTS=y CONFIG_CAN_PASS_STRUCTS=y
CONFIG_HAVE_WEAKFUNCTIONS=y
# #
# General build options # General build options
+1 -1
View File
@@ -121,7 +121,7 @@ $(BIN): $(OBJS)
depend: .depend depend: .depend
clean: clean:
rm -f $(BIN) *.o *~ rm -f $(BIN) *.o *.asm *.lst *.sym *~
distclean: clean distclean: clean
rm -f Make.dep .depend rm -f Make.dep .depend
+3 -1
View File
@@ -43,6 +43,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <mqueue.h> #include <mqueue.h>
#include <sched.h> #include <sched.h>
#include <signal.h>
#include <nuttx/compiler.h> #include <nuttx/compiler.h>
/************************************************************ /************************************************************
@@ -106,6 +107,8 @@ typedef struct mqmsg mqmsg_t;
/* This structure defines a message queue */ /* This structure defines a message queue */
struct mq_des; /* forward reference */
struct msgq_s struct msgq_s
{ {
struct msgq_s *flink; /* Forward link to next message queue */ struct msgq_s *flink; /* Forward link to next message queue */
@@ -123,7 +126,6 @@ struct msgq_s
union sigval ntvalue; /* Notification: Signal value */ union sigval ntvalue; /* Notification: Signal value */
char name[1]; /* Start of the queue name */ char name[1]; /* Start of the queue name */
}; };
typedef struct msgq_s msgq_t;
#define SIZEOF_MQ_HEADER ((int)(((msgq_t*)NULL)->name)) #define SIZEOF_MQ_HEADER ((int)(((msgq_t*)NULL)->name))
+22 -2
View File
@@ -260,7 +260,9 @@ void os_start(void)
/* Initialize the interrupt handling subsystem (if included) */ /* Initialize the interrupt handling subsystem (if included) */
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (irq_initialize != NULL) if (irq_initialize != NULL)
#endif
{ {
irq_initialize(); irq_initialize();
} }
@@ -270,56 +272,72 @@ void os_start(void)
* is called only if it is provided in the link. * is called only if it is provided in the link.
*/ */
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (user_initialize != NULL) if (user_initialize != NULL)
#endif
{ {
user_initialize(); user_initialize();
} }
/* Initialize the POSIX timer facility (if included in the link) */ /* Initialize the POSIX timer facility (if included in the link) */
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (clock_initialize != NULL) if (clock_initialize != NULL)
#endif
{ {
clock_initialize(); clock_initialize();
} }
/* Initialize the watchdog facility (if included in the link) */ /* Initialize the watchdog facility (if included in the link) */
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (wd_initialize != NULL) if (wd_initialize != NULL)
#endif
{ {
wd_initialize(); wd_initialize();
} }
/* Initialize the signal facility (if in link) */ /* Initialize the signal facility (if in link) */
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (sig_initialize != NULL) if (sig_initialize != NULL)
#endif
{ {
sig_initialize(); sig_initialize();
} }
/* Initialize the semaphore facility. (if in link) */ /* Initialize the semaphore facility. (if in link) */
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (sem_initialize != NULL) if (sem_initialize != NULL)
#endif
{ {
sem_initialize(); sem_initialize();
} }
/* Initialize the named message queue facility (if in link) */ /* Initialize the named message queue facility (if in link) */
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (mq_initialize != NULL) if (mq_initialize != NULL)
#endif
{ {
mq_initialize(); mq_initialize();
} }
/* Initialize the thread-specific data facility (if in link) */ /* Initialize the thread-specific data facility (if in link) */
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (pthread_initialize != NULL) if (pthread_initialize != NULL)
#endif
{ {
pthread_initialize(); pthread_initialize();
} }
/* Initialize the file system (needed to support device drivers) */ /* Initialize the file system (needed to support device drivers) */
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (fs_initialize != NULL) if (fs_initialize != NULL)
#endif
{ {
fs_initialize(); fs_initialize();
} }
@@ -336,7 +354,9 @@ void os_start(void)
* is done last because the libraries may depend on the above. * is done last because the libraries may depend on the above.
*/ */
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
if (lib_initialize != NULL) if (lib_initialize != NULL)
#endif
{ {
lib_initialize(); lib_initialize();
} }
@@ -366,9 +386,9 @@ void os_start(void)
{ {
/* Remove the first delayed deallocation. */ /* Remove the first delayed deallocation. */
uint32 savedState = irqsave(); uint32 saved_state = irqsave();
void *address = (void*)sq_remfirst(&g_delayeddeallocations); void *address = (void*)sq_remfirst(&g_delayeddeallocations);
irqrestore(savedState); irqrestore(saved_state);
/* Then deallocate it */ /* Then deallocate it */
+2 -2
View File
@@ -90,9 +90,9 @@ void sched_free(void *address)
{ {
/* Yes.. Delay the deallocation until a more appropriate time. */ /* Yes.. Delay the deallocation until a more appropriate time. */
uint32 savedState = irqsave(); uint32 saved_state = irqsave();
sq_addlast((sq_entry_t*)address, &g_delayeddeallocations); sq_addlast((sq_entry_t*)address, &g_delayeddeallocations);
irqrestore(savedState); irqrestore(saved_state);
} }
else else
{ {
+7 -2
View File
@@ -175,8 +175,13 @@ extern void sig_cleanup(_TCB *stcb);
extern void sig_deliver(_TCB *stcb); extern void sig_deliver(_TCB *stcb);
extern sigactq_t *sig_findaction(_TCB *stcb, int signo); extern sigactq_t *sig_findaction(_TCB *stcb, int signo);
extern int sig_lowest(sigset_t *set); extern int sig_lowest(sigset_t *set);
extern int sig_mqnotempty (int tid, int signo, #ifdef CONFIG_CAN_PASS_STRUCTS
const union sigval value); 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 int sig_received(_TCB *stcb, siginfo_t *info);
extern void sig_releasependingsigaction(sigq_t *sigq); extern void sig_releasependingsigaction(sigq_t *sigq);
extern void sig_releasependingsignal(sigpendq_t *sigpend); extern void sig_releasependingsignal(sigpendq_t *sigpend);