summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/common
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-12-16 20:05:51 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-12-16 20:05:51 +0000
commit891f61e86fcc0a4c42f25432016762b6aafb287e (patch)
treef0447a687a6bc51494a5c24c81170ca3811b0c7f /nuttx/arch/arm/src/common
parentc33cfd52449fc6c1b9211cb45618a77b544876e6 (diff)
downloadpx4-nuttx-891f61e86fcc0a4c42f25432016762b6aafb287e.tar.gz
px4-nuttx-891f61e86fcc0a4c42f25432016762b6aafb287e.tar.bz2
px4-nuttx-891f61e86fcc0a4c42f25432016762b6aafb287e.zip
Changing NuttX fixed size type names to C99 standard names -- things will be broken for awhile
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2359 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/common')
-rw-r--r--nuttx/arch/arm/src/common/up_arch.h28
-rw-r--r--nuttx/arch/arm/src/common/up_createstack.c9
-rw-r--r--nuttx/arch/arm/src/common/up_exit.c4
-rw-r--r--nuttx/arch/arm/src/common/up_idle.c6
-rw-r--r--nuttx/arch/arm/src/common/up_initialize.c3
-rw-r--r--nuttx/arch/arm/src/common/up_internal.h58
-rw-r--r--nuttx/arch/arm/src/common/up_interruptcontext.c10
-rw-r--r--nuttx/arch/arm/src/common/up_lowputs.c5
-rw-r--r--nuttx/arch/arm/src/common/up_modifyreg16.c8
-rw-r--r--nuttx/arch/arm/src/common/up_modifyreg32.c8
-rw-r--r--nuttx/arch/arm/src/common/up_modifyreg8.c8
-rw-r--r--nuttx/arch/arm/src/common/up_puts.c5
-rw-r--r--nuttx/arch/arm/src/common/up_releasestack.c5
-rw-r--r--nuttx/arch/arm/src/common/up_usestack.c10
14 files changed, 88 insertions, 79 deletions
diff --git a/nuttx/arch/arm/src/common/up_arch.h b/nuttx/arch/arm/src/common/up_arch.h
index 6c8a2a6e3..3b001542b 100644
--- a/nuttx/arch/arm/src/common/up_arch.h
+++ b/nuttx/arch/arm/src/common/up_arch.h
@@ -42,14 +42,14 @@
#include <nuttx/config.h>
#ifndef __ASSEMBLY__
-# include <sys/types.h>
+# include <stdint.h>
#endif
#include <arch/board/board.h>
#include "chip.h"
/****************************************************************************
- * Definitions
+ * Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -58,25 +58,25 @@
#ifndef __ASSEMBLY__
-# define getreg8(a) (*(volatile ubyte *)(a))
-# define putreg8(v,a) (*(volatile ubyte *)(a) = (v))
-# define getreg32(a) (*(volatile uint32 *)(a))
-# define putreg32(v,a) (*(volatile uint32 *)(a) = (v))
+# define getreg8(a) (*(volatile uint8_t *)(a))
+# define putreg8(v,a) (*(volatile uint8_t *)(a) = (v))
+# define getreg32(a) (*(volatile uint32_t *)(a))
+# define putreg32(v,a) (*(volatile uint32_t *)(a) = (v))
/* Some compiler options will convert short loads and stores into byte loads
* and stores. We don't want this to happen for IO reads and writes!
*/
-/* # define getreg16(a) (*(volatile uint16 *)(a)) */
-static inline uint16 getreg16(unsigned int addr)
+/* # define getreg16(a) (*(volatile uint16_t *)(a)) */
+static inline uint16_t getreg16(unsigned int addr)
{
- uint16 retval;
+ uint16_t retval;
__asm__ __volatile__("\tldrh %0, [%1]\n\t" : "=r"(retval) : "r"(addr));
return retval;
}
-/* define putreg16(v,a) (*(volatile uint16 *)(a) = (v)) */
-static inline void putreg16(uint16 val, unsigned int addr)
+/* define putreg16(v,a) (*(volatile uint16_t *)(a) = (v)) */
+static inline void putreg16(uint16_t val, unsigned int addr)
{
__asm__ __volatile__("\tstrh %0, [%1]\n\t": : "r"(val), "r"(addr));
}
@@ -95,9 +95,9 @@ extern "C" {
/* Atomic modification of registers */
-EXTERN void modifyreg8(unsigned int addr, ubyte clearbits, ubyte setbits);
-EXTERN void modifyreg16(unsigned int addr, uint16 clearbits, uint16 setbits);
-EXTERN void modifyreg32(unsigned int addr, uint32 clearbits, uint32 setbits);
+EXTERN void modifyreg8(unsigned int addr, uint8_t clearbits, uint8_t setbits);
+EXTERN void modifyreg16(unsigned int addr, uint16_t clearbits, uint16_t setbits);
+EXTERN void modifyreg32(unsigned int addr, uint32_t clearbits, uint32_t setbits);
#undef EXTERN
#if defined(__cplusplus)
diff --git a/nuttx/arch/arm/src/common/up_createstack.c b/nuttx/arch/arm/src/common/up_createstack.c
index e76e05696..9f4989da3 100644
--- a/nuttx/arch/arm/src/common/up_createstack.c
+++ b/nuttx/arch/arm/src/common/up_createstack.c
@@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
+#include <stdint.h>
#include <sched.h>
#include <debug.h>
@@ -93,7 +94,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
if (!tcb->stack_alloc_ptr)
{
- tcb->stack_alloc_ptr = (uint32 *)kzmalloc(stack_size);
+ tcb->stack_alloc_ptr = (uint32_t*)kzmalloc(stack_size);
}
if (tcb->stack_alloc_ptr)
@@ -108,7 +109,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
* referenced as positive word offsets from sp.
*/
- top_of_stack = (uint32)tcb->stack_alloc_ptr + stack_size - 4;
+ top_of_stack = (uint32_t)tcb->stack_alloc_ptr + stack_size - 4;
/* The ARM stack must be aligned at word (4 byte)
* boundaries. If necessary top_of_stack must be rounded
@@ -116,11 +117,11 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
*/
top_of_stack &= ~3;
- size_of_stack = top_of_stack - (uint32)tcb->stack_alloc_ptr + 4;
+ size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4;
/* Save the adjusted stack values in the _TCB */
- tcb->adj_stack_ptr = (uint32*)top_of_stack;
+ tcb->adj_stack_ptr = (uint32_t*)top_of_stack;
tcb->adj_stack_size = size_of_stack;
up_ledon(LED_STACKCREATED);
diff --git a/nuttx/arch/arm/src/common/up_exit.c b/nuttx/arch/arm/src/common/up_exit.c
index 8416a99a3..17de3ade3 100644
--- a/nuttx/arch/arm/src/common/up_exit.c
+++ b/nuttx/arch/arm/src/common/up_exit.c
@@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+
#include <sched.h>
#include <debug.h>
#include <nuttx/arch.h>
@@ -51,7 +51,7 @@
#endif
/****************************************************************************
- * Private Definitions
+ * Pre-processor Definitions
****************************************************************************/
/****************************************************************************
diff --git a/nuttx/arch/arm/src/common/up_idle.c b/nuttx/arch/arm/src/common/up_idle.c
index 08f7f1080..4927ce0e8 100644
--- a/nuttx/arch/arm/src/common/up_idle.c
+++ b/nuttx/arch/arm/src/common/up_idle.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/common/up_idle.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -38,12 +38,12 @@
****************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+
#include <nuttx/arch.h>
#include "up_internal.h"
/****************************************************************************
- * Private Definitions
+ * Pre-processor Definitions
****************************************************************************/
/****************************************************************************
diff --git a/nuttx/arch/arm/src/common/up_initialize.c b/nuttx/arch/arm/src/common/up_initialize.c
index d12a23de1..446009040 100644
--- a/nuttx/arch/arm/src/common/up_initialize.c
+++ b/nuttx/arch/arm/src/common/up_initialize.c
@@ -39,7 +39,6 @@
#include <nuttx/config.h>
-#include <sys/types.h>
#include <debug.h>
#include <nuttx/arch.h>
@@ -49,7 +48,7 @@
#include "up_internal.h"
/****************************************************************************
- * Definitions
+ * Pre-processor Definitions
****************************************************************************/
/****************************************************************************
diff --git a/nuttx/arch/arm/src/common/up_internal.h b/nuttx/arch/arm/src/common/up_internal.h
index 9abf4a0b6..e95d5a772 100644
--- a/nuttx/arch/arm/src/common/up_internal.h
+++ b/nuttx/arch/arm/src/common/up_internal.h
@@ -40,8 +40,12 @@
* Included Files
****************************************************************************/
+#ifndef __ASSEMBLY__
+# include <stdint.h>
+#endif
+
/****************************************************************************
- * Definitions
+ * Pre-processor Definitions
****************************************************************************/
/* Bring-up debug configurations. These are here (vs defconfig)
@@ -103,7 +107,7 @@ typedef void (*up_vector_t)(void);
* interrupt processing.
*/
-extern uint32 *current_regs;
+extern uint32_t *current_regs;
/* This is the beginning of heap as provided from up_head.S.
* This is the first address in DRAM after the loaded
@@ -111,33 +115,33 @@ extern uint32 *current_regs;
* CONFIG_DRAM_END
*/
-extern uint32 g_heapbase;
+extern uint32_t g_heapbase;
/* Address of the saved user stack pointer */
#if CONFIG_ARCH_INTERRUPTSTACK > 3
-extern uint32 g_userstack;
+extern uint32_t g_userstack;
#endif
/* These 'addresses' of these values are setup by the linker script. They are
- * not actual uint32 storage locations! They are only used meaningfully in the
+ * not actual uint32_t storage locations! They are only used meaningfully in the
* following way:
*
* - The linker script defines, for example, the symbol_sdata.
- * - The declareion extern uint32 _sdata; makes C happy. C will believe
- * that the value _sdata is the address of a uint32 variable _data (it is
+ * - The declareion extern uint32_t _sdata; makes C happy. C will believe
+ * that the value _sdata is the address of a uint32_t variable _data (it is
* not!).
* - We can recoved the linker value then by simply taking the address of
- * of _data. like: uint32 *pdata = &_sdata;
+ * of _data. like: uint32_t *pdata = &_sdata;
*/
-extern uint32 _stext; /* Start of .text */
-extern uint32 _etext; /* End_1 of .text + .rodata */
-extern const uint32 _eronly; /* End+1 of read only section (.text + .rodata) */
-extern uint32 _sdata; /* Start of .data */
-extern uint32 _edata; /* End+1 of .data */
-extern uint32 _sbss; /* Start of .bss */
-extern uint32 _ebss; /* End+1 of .bss */
+extern uint32_t _stext; /* Start of .text */
+extern uint32_t _etext; /* End_1 of .text + .rodata */
+extern const uint32_t _eronly; /* End+1 of read only section (.text + .rodata) */
+extern uint32_t _sdata; /* Start of .data */
+extern uint32_t _edata; /* End+1 of .data */
+extern uint32_t _sbss; /* Start of .bss */
+extern uint32_t _ebss; /* End+1 of .bss */
#endif
/****************************************************************************
@@ -153,31 +157,31 @@ extern uint32 _ebss; /* End+1 of .bss */
/* Defined in files with the same name as the function */
extern void up_boot(void);
-extern void up_copystate(uint32 *dest, uint32 *src);
-extern void up_decodeirq(uint32 *regs);
+extern void up_copystate(uint32_t *dest, uint32_t *src);
+extern void up_decodeirq(uint32_t *regs);
extern void up_irqinitialize(void);
#ifdef CONFIG_ARCH_DMA
extern void weak_function up_dmainitialize(void);
#endif
-extern int up_saveusercontext(uint32 *saveregs);
-extern void up_fullcontextrestore(uint32 *restoreregs) __attribute__ ((noreturn));
-extern void up_switchcontext(uint32 *saveregs, uint32 *restoreregs);
+extern int up_saveusercontext(uint32_t *saveregs);
+extern void up_fullcontextrestore(uint32_t *restoreregs) __attribute__ ((noreturn));
+extern void up_switchcontext(uint32_t *saveregs, uint32_t *restoreregs);
extern void up_sigdeliver(void);
-extern int up_timerisr(int irq, uint32 *regs);
+extern int up_timerisr(int irq, uint32_t *regs);
extern void up_lowputc(char ch);
extern void up_puts(const char *str);
extern void up_lowputs(const char *str);
#ifdef CONFIG_ARCH_CORTEXM3
-extern uint32 *up_doirq(int irq, uint32 *regs);
+extern uint32_t *up_doirq(int irq, uint32_t *regs);
extern int up_svcall(int irq, FAR void *context);
extern int up_hardfault(int irq, FAR void *context);
#else
-extern void up_doirq(int irq, uint32 *regs);
-extern void up_dataabort(uint32 *regs);
-extern void up_prefetchabort(uint32 *regs);
-extern void up_syscall(uint32 *regs);
-extern void up_undefinedinsn(uint32 *regs);
+extern void up_doirq(int irq, uint32_t *regs);
+extern void up_dataabort(uint32_t *regs);
+extern void up_prefetchabort(uint32_t *regs);
+extern void up_syscall(uint32_t *regs);
+extern void up_undefinedinsn(uint32_t *regs);
#endif
/* Defined in up_vectors.S */
diff --git a/nuttx/arch/arm/src/common/up_interruptcontext.c b/nuttx/arch/arm/src/common/up_interruptcontext.c
index 3c435ac78..b67ad523a 100644
--- a/nuttx/arch/arm/src/common/up_interruptcontext.c
+++ b/nuttx/arch/arm/src/common/up_interruptcontext.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/common/up_interruptcontext.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -38,9 +38,11 @@
****************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+
+#include <stdbool.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h>
+
#include "up_internal.h"
/****************************************************************************
@@ -58,11 +60,11 @@
/****************************************************************************
* Name: up_interrupt_context
*
- * Description: Return TRUE is we are currently executing in
+ * Description: Return true is we are currently executing in
* the interrupt handler context.
****************************************************************************/
-boolean up_interrupt_context(void)
+bool up_interrupt_context(void)
{
return current_regs != NULL;
}
diff --git a/nuttx/arch/arm/src/common/up_lowputs.c b/nuttx/arch/arm/src/common/up_lowputs.c
index 697b11e9a..8b2919a05 100644
--- a/nuttx/arch/arm/src/common/up_lowputs.c
+++ b/nuttx/arch/arm/src/common/up_lowputs.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/common/up_lowputs.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -38,12 +38,11 @@
****************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
#include "up_internal.h"
/****************************************************************************
- * Definitions
+ * Pre-processor Definitions
****************************************************************************/
/****************************************************************************
diff --git a/nuttx/arch/arm/src/common/up_modifyreg16.c b/nuttx/arch/arm/src/common/up_modifyreg16.c
index 2c235ebfe..e488a6eee 100644
--- a/nuttx/arch/arm/src/common/up_modifyreg16.c
+++ b/nuttx/arch/arm/src/common/up_modifyreg16.c
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
-#include <sys/types.h>
+#include <stdint.h>
#include <debug.h>
#include <arch/irq.h>
@@ -48,7 +48,7 @@
#include "up_arch.h"
/****************************************************************************
- * Private Definitions
+ * Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -71,10 +71,10 @@
*
****************************************************************************/
-void modifyreg16(unsigned int addr, uint16 clearbits, uint16 setbits)
+void modifyreg16(unsigned int addr, uint16_t clearbits, uint16_t setbits)
{
irqstate_t flags;
- uint16 regval;
+ uint16_t regval;
flags = irqsave();
regval = getreg16(addr);
diff --git a/nuttx/arch/arm/src/common/up_modifyreg32.c b/nuttx/arch/arm/src/common/up_modifyreg32.c
index 33b40ae3a..8b93f6b84 100644
--- a/nuttx/arch/arm/src/common/up_modifyreg32.c
+++ b/nuttx/arch/arm/src/common/up_modifyreg32.c
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
-#include <sys/types.h>
+#include <stdint.h>
#include <debug.h>
#include <arch/irq.h>
@@ -48,7 +48,7 @@
#include "up_arch.h"
/****************************************************************************
- * Private Definitions
+ * Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -71,10 +71,10 @@
*
****************************************************************************/
-void modifyreg32(unsigned int addr, uint32 clearbits, uint32 setbits)
+void modifyreg32(unsigned int addr, uint32_t clearbits, uint32_t setbits)
{
irqstate_t flags;
- uint32 regval;
+ uint32_t regval;
flags = irqsave();
regval = getreg32(addr);
diff --git a/nuttx/arch/arm/src/common/up_modifyreg8.c b/nuttx/arch/arm/src/common/up_modifyreg8.c
index eefce6db0..2c9dbac25 100644
--- a/nuttx/arch/arm/src/common/up_modifyreg8.c
+++ b/nuttx/arch/arm/src/common/up_modifyreg8.c
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
-#include <sys/types.h>
+#include <stdint.h>
#include <debug.h>
#include <arch/irq.h>
@@ -48,7 +48,7 @@
#include "up_arch.h"
/****************************************************************************
- * Private Definitions
+ * Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -71,10 +71,10 @@
*
****************************************************************************/
-void modifyreg8(unsigned int addr, ubyte clearbits, ubyte setbits)
+void modifyreg8(unsigned int addr, uint8_t clearbits, uint8_t setbits)
{
irqstate_t flags;
- ubyte regval;
+ uint8_t regval;
flags = irqsave();
regval = getreg8(addr);
diff --git a/nuttx/arch/arm/src/common/up_puts.c b/nuttx/arch/arm/src/common/up_puts.c
index dc8c920f5..4e74f0cdc 100644
--- a/nuttx/arch/arm/src/common/up_puts.c
+++ b/nuttx/arch/arm/src/common/up_puts.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/common/up_puts.c
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -38,13 +38,12 @@
****************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
#include <nuttx/arch.h>
#include "up_internal.h"
/****************************************************************************
- * Definitions
+ * Pre-processor Definitions
****************************************************************************/
/****************************************************************************
diff --git a/nuttx/arch/arm/src/common/up_releasestack.c b/nuttx/arch/arm/src/common/up_releasestack.c
index c65953bd2..407bd1b54 100644
--- a/nuttx/arch/arm/src/common/up_releasestack.c
+++ b/nuttx/arch/arm/src/common/up_releasestack.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/common/up_releasestack.c
*
- * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -38,10 +38,11 @@
****************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+
#include <sched.h>
#include <debug.h>
#include <nuttx/arch.h>
+
#include "os_internal.h"
#include "up_internal.h"
diff --git a/nuttx/arch/arm/src/common/up_usestack.c b/nuttx/arch/arm/src/common/up_usestack.c
index bd7411f0c..822f05168 100644
--- a/nuttx/arch/arm/src/common/up_usestack.c
+++ b/nuttx/arch/arm/src/common/up_usestack.c
@@ -38,11 +38,15 @@
****************************************************************************/
#include <nuttx/config.h>
+
#include <sys/types.h>
+#include <stdint.h>
#include <sched.h>
#include <debug.h>
+
#include <nuttx/kmalloc.h>
#include <nuttx/arch.h>
+
#include "up_internal.h"
/****************************************************************************
@@ -99,7 +103,7 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
* referenced as positive word offsets from sp.
*/
- top_of_stack = (uint32)tcb->stack_alloc_ptr + stack_size - 4;
+ top_of_stack = (uint32_t)tcb->stack_alloc_ptr + stack_size - 4;
/* The ARM stack must be aligned at word (4 byte)
* boundaries. If necessary top_of_stack must be rounded
@@ -107,11 +111,11 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
*/
top_of_stack &= ~3;
- size_of_stack = top_of_stack - (uint32)tcb->stack_alloc_ptr + 4;
+ size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4;
/* Save the adjusted stack values in the _TCB */
- tcb->adj_stack_ptr = (uint32*)top_of_stack;
+ tcb->adj_stack_ptr = (uint32_t*)top_of_stack;
tcb->adj_stack_size = size_of_stack;
return OK;