summaryrefslogtreecommitdiff
path: root/nuttx/arch/c5471
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/c5471')
-rw-r--r--nuttx/arch/c5471/Make.defs3
-rw-r--r--nuttx/arch/c5471/defconfig14
-rw-r--r--nuttx/arch/c5471/include/irq.h12
-rw-r--r--nuttx/arch/c5471/include/types.h12
-rw-r--r--nuttx/arch/c5471/src/Makefile11
-rw-r--r--nuttx/arch/c5471/src/up_assert.c4
-rw-r--r--nuttx/arch/c5471/src/up_createstack.c6
-rw-r--r--nuttx/arch/c5471/src/up_schedulesigaction.c2
-rw-r--r--nuttx/arch/c5471/src/up_serial.c8
-rw-r--r--nuttx/arch/c5471/src/up_usestack.c6
10 files changed, 52 insertions, 26 deletions
diff --git a/nuttx/arch/c5471/Make.defs b/nuttx/arch/c5471/Make.defs
index 7e68d8e56..8f0013670 100644
--- a/nuttx/arch/c5471/Make.defs
+++ b/nuttx/arch/c5471/Make.defs
@@ -52,7 +52,7 @@ ARCHSCRIPT = -T$(TOPDIR)/arch/$(CONFIG_ARCH)/ld.script
CROSSDEV = arm-elf-
CC = $(CROSSDEV)gcc
LD = $(CROSSDEV)ld
-AR = $(CROSSDEV)ar
+AR = $(CROSSDEV)ar rcs
NM = $(CROSSDEV)nm
OBJCOPY = $(CROSSDEV)objcopy
OBJDUMP = $(CROSSDEV)objdump
@@ -62,6 +62,7 @@ CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
LDFLAGS = $(ARCHSCRIPT)
EXTRA_LIBS =
+LIBEXT = .a
ifeq ("${CONFIG_DEBUG}","y")
LDFLAGS += -g
diff --git a/nuttx/arch/c5471/defconfig b/nuttx/arch/c5471/defconfig
index 3871d7e14..2dd38f014 100644
--- a/nuttx/arch/c5471/defconfig
+++ b/nuttx/arch/c5471/defconfig
@@ -132,6 +132,8 @@ CONFIG_ARCH_KFREE=n
#
# General Compile environment setup
#
+# CONFIG_SMALL_MEMORY - enable if your processor supports
+# 16-bit addressing; disable if it supports 32-bit.
# CONFIG_HAVE_INLINE - enable if your compiler supports
# inline functions
# CONFIG_HAVE_DOUBLE - enable if your compiler supports type
@@ -139,21 +141,26 @@ CONFIG_ARCH_KFREE=n
# CONFIG_HAVE_LONG_LONG - enable if your architecture supports
# 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
+# passing and assiging structures and unions as values
+# CONFIG_CAN_CAST_POINTERS - enable if you can cast between
+# integers and pointer.
# CONFIG_HAVE_WEAKFUNCTIONS - enable if you compiler supports
# weak functions (see include/nuttx/comp
#
+CONFIG_SMALL_MEMORY=n
CONFIG_HAVE_INLINE=y
CONFIG_HAVE_DOUBLE=y
CONFIG_HAVE_LONG_LONG=n
CONFIG_CAN_PASS_STRUCTS=y
+CONFIG_CAN_CAST_POINTERS=y
CONFIG_HAVE_WEAKFUNCTIONS=y
#
# General build options
#
-# CONFIG_RRLOAD_BINY - make the rrload binary format used with
+# CONFIG_RRLOAD_BINARY - make the rrload binary format used with
# BSPs from www.ridgerun.com
+#
CONFIG_RRLOAD_BINARY=y
#
@@ -175,6 +182,8 @@ CONFIG_RRLOAD_BINARY=y
# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with
# a fixed payload size given by this settin (does not include
# other message structure overhead.
+# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that
+# can be passed to a watchdog handler
# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog
# structures. The system manages a pool of preallocated
# watchdog structures to minimize dynamic allocations
@@ -186,6 +195,7 @@ CONFIG_STDIO_BUFFER_SIZE=1024
CONFIG_NUNGET_CHARS=2
CONFIG_PREALLOC_MQ_MSGS=32
CONFIG_MQ_MAXMSGSIZE=32
+CONFIG_MAX_WDOGPARMS=4
CONFIG_PREALLOC_WDOGS=32
#
diff --git a/nuttx/arch/c5471/include/irq.h b/nuttx/arch/c5471/include/irq.h
index 0745ba6aa..c6a89e951 100644
--- a/nuttx/arch/c5471/include/irq.h
+++ b/nuttx/arch/c5471/include/irq.h
@@ -177,10 +177,10 @@ struct xcptcontext
/* Save the current interrupt enable state & disable IRQs */
-static inline uint32 irqsave(void)
+static inline irqstate_t irqsave(void)
{
- unsigned long flags;
- unsigned long temp;
+ unsigned int flags;
+ unsigned int temp;
__asm__ __volatile__
(
"\tmrs %0, cpsr\n"
@@ -194,7 +194,7 @@ static inline uint32 irqsave(void)
/* Restore saved IRQ & FIQ state */
-static inline void irqrestore(uint32 flags)
+static inline void irqrestore(irqstate_t flags)
{
__asm__ __volatile__
(
@@ -204,8 +204,8 @@ static inline void irqrestore(uint32 flags)
: "memory");
}
-static inline void system_call(swint_t func, uint32 parm1,
- uint32 parm2, uint32 parm3)
+static inline void system_call(swint_t func, int parm1,
+ int parm2, int parm3)
{
__asm__ __volatile__
(
diff --git a/nuttx/arch/c5471/include/types.h b/nuttx/arch/c5471/include/types.h
index 7b39302f0..5ec6e81e1 100644
--- a/nuttx/arch/c5471/include/types.h
+++ b/nuttx/arch/c5471/include/types.h
@@ -52,6 +52,10 @@
* Type Declarations
************************************************************/
+#ifndef __ASSEMBLY__
+
+/* These are the sizes of the standard GNU types */
+
typedef char sbyte;
typedef unsigned char ubyte;
typedef unsigned char uint8;
@@ -63,6 +67,14 @@ typedef unsigned int uint32;
typedef long long sint64;
typedef unsigned long long uint64;
+/* This is the size of the interrupt state save returned by
+ * irqsave()
+ */
+
+typedef unsigned int irqstate_t;
+
+#endif /* __ASSEMBLY__ */
+
/************************************************************
* Global Function Prototypes
************************************************************/
diff --git a/nuttx/arch/c5471/src/Makefile b/nuttx/arch/c5471/src/Makefile
index a4f953c6f..57d741aaa 100644
--- a/nuttx/arch/c5471/src/Makefile
+++ b/nuttx/arch/c5471/src/Makefile
@@ -56,7 +56,7 @@ COBJS = $(CSRCS:.c=.o)
SRCS = $(ASRCS) $(CSRCS)
OBJS = $(AOBJS) $(COBJS)
-all: up_head.o libarch.a
+all: up_head.o libarch$(LIBEXT)
$(AOBJS) up_head.o: %.o: %.S
$(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@
@@ -64,8 +64,11 @@ $(AOBJS) up_head.o: %.o: %.S
$(COBJS): %.o: %.c
$(CC) -c $(CFLAGS) $< -o $@
-libarch.a: $(OBJS)
- $(AR) rcs $@ $(OBJS)
+libarch$(LIBEXT): $(OBJS)
+ ( for obj in $(OBJS) ; do \
+ $(AR) $@ $${obj} || \
+ { echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \
+ done ; )
.depend: Makefile $(SRCS)
$(MKDEP) $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep
@@ -74,7 +77,7 @@ libarch.a: $(OBJS)
depend: .depend
clean:
- rm -f libarch.a *.o *~
+ rm -f libarch$(LIBEXT) *.o *~
distclean: clean
rm -f Make.dep .depend
diff --git a/nuttx/arch/c5471/src/up_assert.c b/nuttx/arch/c5471/src/up_assert.c
index eaddc7c8e..8b70349f4 100644
--- a/nuttx/arch/c5471/src/up_assert.c
+++ b/nuttx/arch/c5471/src/up_assert.c
@@ -63,7 +63,7 @@
* Name: up_assert
************************************************************/
-void up_assert(const ubyte *filename, uint32 lineno)
+void up_assert(const ubyte *filename, int lineno)
{
dbg("Assertion failed at file:%s line: %d\n",
filename, lineno);
@@ -74,7 +74,7 @@ void up_assert(const ubyte *filename, uint32 lineno)
* Name: up_assert_code
************************************************************/
-void up_assert_code(const ubyte *filename, uint32 lineno, uint16 errorcode)
+void up_assert_code(const ubyte *filename, int lineno, int errorcode)
{
dbg("Assertion failed at file:%s line: %d error code: %d\n",
filename, lineno, errorcode);
diff --git a/nuttx/arch/c5471/src/up_createstack.c b/nuttx/arch/c5471/src/up_createstack.c
index 90919e265..0e1f0690a 100644
--- a/nuttx/arch/c5471/src/up_createstack.c
+++ b/nuttx/arch/c5471/src/up_createstack.c
@@ -78,7 +78,7 @@
* must be allocated.
************************************************************/
-STATUS up_create_stack(_TCB *tcb, uint32 stack_size)
+STATUS up_create_stack(_TCB *tcb, size_t stack_size)
{
if (tcb->stack_alloc_ptr &&
tcb->adj_stack_size != stack_size)
@@ -94,8 +94,8 @@ STATUS up_create_stack(_TCB *tcb, uint32 stack_size)
if (tcb->stack_alloc_ptr)
{
- uint32 top_of_stack;
- uint32 size_of_stack;
+ size_t top_of_stack;
+ size_t size_of_stack;
/* The Arm7Tdmi uses a push-down stack: the stack grows
* toward loweraddresses in memory. The stack pointer
diff --git a/nuttx/arch/c5471/src/up_schedulesigaction.c b/nuttx/arch/c5471/src/up_schedulesigaction.c
index 4ea39bec2..3f4e32ec9 100644
--- a/nuttx/arch/c5471/src/up_schedulesigaction.c
+++ b/nuttx/arch/c5471/src/up_schedulesigaction.c
@@ -101,7 +101,7 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver)
if (!tcb->xcp.sigdeliver)
{
- uint32 flags;
+ irqstate_t flags;
/* Make sure that interrupts are disabled */
diff --git a/nuttx/arch/c5471/src/up_serial.c b/nuttx/arch/c5471/src/up_serial.c
index df4927660..b11bfc070 100644
--- a/nuttx/arch/c5471/src/up_serial.c
+++ b/nuttx/arch/c5471/src/up_serial.c
@@ -721,7 +721,7 @@ static void up_uartsetup(up_dev_t *dev)
static void shutdown(up_dev_t * dev)
{
- uint32 flags;
+ irqstate_t flags;
uint16 msr;
/* Free the IRQ */
@@ -878,7 +878,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
{
- uint32 flags = irqsave();
+ irqstate_t flags = irqsave();
up_enablebreaks(dev);
irqrestore(flags);
}
@@ -886,7 +886,7 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
case TIOCCBRK: /* BSD compatibility: Turn break off, unconditionally */
{
- uint32 flags;
+ irqstate_t flags;
flags = irqsave();
up_disablebreaks(dev);
irqrestore(flags);
@@ -973,7 +973,7 @@ static int up_open(struct file *filep)
if (++dev->open_count == 1)
{
- int flags = irqsave();
+ irqstate_t flags = irqsave();
/* If this is the console, then the UART has already
* been initialized.
diff --git a/nuttx/arch/c5471/src/up_usestack.c b/nuttx/arch/c5471/src/up_usestack.c
index 4cab9209f..315314569 100644
--- a/nuttx/arch/c5471/src/up_usestack.c
+++ b/nuttx/arch/c5471/src/up_usestack.c
@@ -78,10 +78,10 @@
*
************************************************************/
-STATUS up_use_stack(_TCB *tcb, uint32 *stack, uint32 stack_size)
+STATUS up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
{
- uint32 top_of_stack;
- uint32 size_of_stack;
+ size_t top_of_stack;
+ size_t size_of_stack;
if (tcb->stack_alloc_ptr)
{