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:
parent
4881fed8bf
commit
59bd1d6954
@ -140,11 +140,14 @@ CONFIG_ARCH_KFREE=n
|
||||
# long long types and if you plan to use them
|
||||
# CONFIG_CAN_PASS_STRUCTS - enable if your compiler supports
|
||||
# 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_DOUBLE=y
|
||||
CONFIG_HAVE_LONG_LONG=n
|
||||
CONFIG_CAN_PASS_STRUCTS=y
|
||||
CONFIG_HAVE_WEAKFUNCTIONS=y
|
||||
|
||||
#
|
||||
# General build options
|
||||
|
@ -107,11 +107,14 @@ CONFIG_ARCH_KFREE=n
|
||||
# long long types and if you plan to use them
|
||||
# CONFIG_CAN_PASS_STRUCTS - enable if your compiler supports
|
||||
# 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_DOUBLE=y
|
||||
CONFIG_HAVE_LONG_LONG=n
|
||||
CONFIG_CAN_PASS_STRUCTS=y
|
||||
CONFIG_HAVE_WEAKFUNCTIONS=y
|
||||
|
||||
#
|
||||
# General build options
|
||||
|
@ -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
|
||||
|
@ -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))
|
||||
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user