summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/arch/c5471/defconfig3
-rw-r--r--nuttx/arch/sim/defconfig3
-rw-r--r--nuttx/sched/Makefile2
-rw-r--r--nuttx/sched/mq_internal.h4
-rw-r--r--nuttx/sched/os_start.c24
-rw-r--r--nuttx/sched/sched_free.c4
-rw-r--r--nuttx/sched/sig_internal.h9
7 files changed, 41 insertions, 8 deletions
diff --git a/nuttx/arch/c5471/defconfig b/nuttx/arch/c5471/defconfig
index 6f8f152c2..3871d7e14 100644
--- a/nuttx/arch/c5471/defconfig
+++ b/nuttx/arch/c5471/defconfig
@@ -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
diff --git a/nuttx/arch/sim/defconfig b/nuttx/arch/sim/defconfig
index 18b15d7e0..80de3cbdc 100644
--- a/nuttx/arch/sim/defconfig
+++ b/nuttx/arch/sim/defconfig
@@ -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
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);