summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-12-16 16:28:31 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-12-16 16:28:31 +0000
commitc33cfd52449fc6c1b9211cb45618a77b544876e6 (patch)
tree4c6a9b7e711b34da34e9878e08d63c8c1dd14be5
parentf8a2fb3042d58963a00fe808d18f84eec6a0be71 (diff)
downloadpx4-nuttx-c33cfd52449fc6c1b9211cb45618a77b544876e6.tar.gz
px4-nuttx-c33cfd52449fc6c1b9211cb45618a77b544876e6.tar.bz2
px4-nuttx-c33cfd52449fc6c1b9211cb45618a77b544876e6.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@2358 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/arch/pjrc-8051/include/arch.h32
-rw-r--r--nuttx/arch/pjrc-8051/include/irq.h37
-rw-r--r--nuttx/arch/pjrc-8051/src/up_assert.c47
-rw-r--r--nuttx/arch/pjrc-8051/src/up_blocktask.c38
-rw-r--r--nuttx/arch/pjrc-8051/src/up_debug.c76
-rw-r--r--nuttx/arch/pjrc-8051/src/up_delay.c44
-rw-r--r--nuttx/arch/pjrc-8051/src/up_exit.c34
-rw-r--r--nuttx/arch/pjrc-8051/src/up_idle.c24
-rw-r--r--nuttx/arch/pjrc-8051/src/up_initialize.c43
-rw-r--r--nuttx/arch/pjrc-8051/src/up_initialstate.c44
-rw-r--r--nuttx/arch/pjrc-8051/src/up_internal.h36
-rw-r--r--nuttx/arch/pjrc-8051/src/up_interruptcontext.c36
-rw-r--r--nuttx/arch/pjrc-8051/src/up_irq.c59
-rw-r--r--nuttx/arch/pjrc-8051/src/up_irqtest.c80
-rw-r--r--nuttx/arch/pjrc-8051/src/up_putc.c21
-rw-r--r--nuttx/arch/pjrc-8051/src/up_releasepending.c36
-rw-r--r--nuttx/arch/pjrc-8051/src/up_reprioritizertr.c16
-rw-r--r--nuttx/arch/pjrc-8051/src/up_restorecontext.c7
-rw-r--r--nuttx/arch/pjrc-8051/src/up_savecontext.c26
-rw-r--r--nuttx/arch/pjrc-8051/src/up_timerisr.c43
-rw-r--r--nuttx/arch/pjrc-8051/src/up_unblocktask.c33
21 files changed, 426 insertions, 386 deletions
diff --git a/nuttx/arch/pjrc-8051/include/arch.h b/nuttx/arch/pjrc-8051/include/arch.h
index f7d2b956c..1ca504fb8 100644
--- a/nuttx/arch/pjrc-8051/include/arch.h
+++ b/nuttx/arch/pjrc-8051/include/arch.h
@@ -1,7 +1,7 @@
-/************************************************************
+/************************************************************************
* arch.h
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,7 +31,7 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
/* This file should never be included directed but, rather,
* only indirectly through nuttx/arch.h
@@ -40,25 +40,27 @@
#ifndef __ARCH_ARCH_H
#define __ARCH_ARCH_H
-/************************************************************
+/************************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+#include <stdint.h>
+
+/************************************************************************
* Definitions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Public Types
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Public Variables
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Public Function Prototypes
- ************************************************************/
+ ************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
@@ -72,7 +74,7 @@ extern "C" {
* code to dump the stack pointer at critical locations.
*/
-EXTERN void up_showsp(ubyte ch) __naked;
+EXTERN void up_showsp(uint8_t ch) __naked;
#undef EXTERN
#ifdef __cplusplus
diff --git a/nuttx/arch/pjrc-8051/include/irq.h b/nuttx/arch/pjrc-8051/include/irq.h
index e41ba9687..29b19d280 100644
--- a/nuttx/arch/pjrc-8051/include/irq.h
+++ b/nuttx/arch/pjrc-8051/include/irq.h
@@ -1,7 +1,7 @@
-/************************************************************
+/************************************************************************
* irq.h
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,7 +31,7 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
/* This file should never be included directed but, rather,
* only indirectly through nuttx/irq.h
@@ -40,15 +40,18 @@
#ifndef __ARCH_IRQ_H
#define __ARCH_IRQ_H
-/************************************************************
+/************************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
#include <nuttx/config.h>
+#ifndef __ASSEMBLY__
+# include <stdint.h>
+#endif
-/************************************************************
+/************************************************************************
* Definitions
- ************************************************************/
+ ************************************************************************/
#define EXT_INT0_IRQ 0
#define TIMER0_IRQ 1
@@ -141,9 +144,9 @@
#define XCPT_SIZE (STACK_SIZE+REGS_SIZE+1)
-/************************************************************
+/************************************************************************
* Public Types
- ************************************************************/
+ ************************************************************************/
/* This struct defines the way the registers are stored */
@@ -155,31 +158,31 @@ struct xcptcontext
* the top-of-stack pointer can be derived from this size.
*/
- ubyte nbytes;
+ uint8_t nbytes;
/* This is the saved stack. Space is allocated for the
* entire 256 byte IRAM (minus register and bit usage at
* the beginning).
*/
- ubyte stack[STACK_SIZE];
+ uint8_t stack[STACK_SIZE];
/* These are save 8051/2 registers. These are saved
* separately from the stack to increase the effective
* stack size.
*/
- ubyte regs[REGS_SIZE];
+ uint8_t regs[REGS_SIZE];
};
#endif /* __ASSEMBLY */
-/************************************************************
+/************************************************************************
* Public Variables
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Public Function Prototypes
- ************************************************************/
+ ************************************************************************/
#ifndef __ASSEMBLY__
diff --git a/nuttx/arch/pjrc-8051/src/up_assert.c b/nuttx/arch/pjrc-8051/src/up_assert.c
index a0d04c393..157b18ae5 100644
--- a/nuttx/arch/pjrc-8051/src/up_assert.c
+++ b/nuttx/arch/pjrc-8051/src/up_assert.c
@@ -1,7 +1,7 @@
-/************************************************************
+/************************************************************************
* up_assert.c
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,38 +31,39 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+
#include <stdlib.h>
#include <assert.h>
#include <sched.h>
#include <debug.h>
+
#include <8052.h>
#include "os_internal.h"
#include "up_internal.h"
#include "up_mem.h"
-/************************************************************
+/************************************************************************
* Definitions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Data
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Functions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Name: _up_assert
- ************************************************************/
+ ************************************************************************/
static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */
{
@@ -87,15 +88,15 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */
}
}
-/************************************************************
+/************************************************************************
* Public Functions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Name: up_assert
- ************************************************************/
+ ************************************************************************/
-void up_assert(const ubyte *filename, int lineno)
+void up_assert(const uint8_t *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0
_TCB *rtcb = (_TCB*)g_readytorun.head;
@@ -115,11 +116,11 @@ void up_assert(const ubyte *filename, int lineno)
_up_assert(EXIT_FAILURE);
}
-/************************************************************
+/************************************************************************
* Name: up_assert_code
- ************************************************************/
+ ************************************************************************/
-void up_assert_code(const ubyte *filename, int lineno, int errorcode)
+void up_assert_code(const uint8_t *filename, int lineno, int errorcode)
{
#if CONFIG_TASK_NAME_SIZE > 0
_TCB *rtcb = (_TCB*)g_readytorun.head;
diff --git a/nuttx/arch/pjrc-8051/src/up_blocktask.c b/nuttx/arch/pjrc-8051/src/up_blocktask.c
index 5760e9302..811955efa 100644
--- a/nuttx/arch/pjrc-8051/src/up_blocktask.c
+++ b/nuttx/arch/pjrc-8051/src/up_blocktask.c
@@ -1,7 +1,7 @@
-/************************************************************
+/************************************************************************
* up_blocktask.c
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,37 +31,39 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+
+#include <stdbool.h>
#include <sched.h>
#include <debug.h>
#include <nuttx/arch.h>
+
#include "os_internal.h"
#include "up_internal.h"
-/************************************************************
+/************************************************************************
* Private Definitions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Data
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Funtions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Public Funtions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Name: up_block_task
*
* Description:
@@ -79,7 +81,7 @@
* task_state: Specifies which waiting task list should be
* hold the blocked task TCB.
*
- ************************************************************/
+ ************************************************************************/
void up_block_task(FAR _TCB *tcb, tstate_t task_state)
{
@@ -93,7 +95,7 @@ void up_block_task(FAR _TCB *tcb, tstate_t task_state)
else
{
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
- boolean switch_needed;
+ bool switch_needed;
dbg("Blocking TCB=%p\n", tcb);
diff --git a/nuttx/arch/pjrc-8051/src/up_debug.c b/nuttx/arch/pjrc-8051/src/up_debug.c
index 9b52250e2..9d9bce2a0 100644
--- a/nuttx/arch/pjrc-8051/src/up_debug.c
+++ b/nuttx/arch/pjrc-8051/src/up_debug.c
@@ -1,7 +1,7 @@
-/************************************************************
+/************************************************************************
* up_assert.c
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,32 +31,36 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
#include <nuttx/config.h>
+
#include <sys/types.h>
+#include <stdint.h>
#include <debug.h>
+
#include <8052.h>
#include <nuttx/arch.h>
#include <arch/irq.h>
+
#include "up_internal.h"
#include "up_mem.h"
-/************************************************************
+/************************************************************************
* Definitions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Data
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Functions
- ************************************************************/
+ ************************************************************************/
#if defined(CONFIG_FRAME_DUMP) && defined(CONFIG_ARCH_BRINGUP)
static void up_putspace(void) __naked
@@ -75,7 +79,7 @@ static void _up_putcolon(void) __naked
_endasm;
}
-static void _up_dump16(__code char *ptr, ubyte msb, ubyte lsb)
+static void _up_dump16(__code char *ptr, uint8_t msb, uint8_t lsb)
{
up_puts(ptr);
up_puthex(msb);
@@ -83,7 +87,7 @@ static void _up_dump16(__code char *ptr, ubyte msb, ubyte lsb)
up_putnl();
}
-static void _up_dump8(__code char *ptr, ubyte b)
+static void _up_dump8(__code char *ptr, uint8_t b)
{
up_puts(ptr);
up_puthex(b);
@@ -91,16 +95,16 @@ static void _up_dump8(__code char *ptr, ubyte b)
}
#endif
-/************************************************************
+/************************************************************************
* Public Functions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Name: up_puthex, up_puthex16, up_putnl, up_puts
- ************************************************************/
+ ************************************************************************/
#if defined(CONFIG_ARCH_BRINGUP)
-void up_puthex(ubyte hex) __naked
+void up_puthex(uint8_t hex) __naked
{
hex; /* To avoid unreferenced argument warning */
_asm
@@ -133,26 +137,26 @@ void up_puts(__code char *ptr)
}
#endif
-/************************************************************
+/************************************************************************
* Name: up_dumpstack
- ************************************************************/
+ ************************************************************************/
#if defined(CONFIG_FRAME_DUMP) && defined(CONFIG_ARCH_BRINGUP)
void up_dumpstack(void)
{
- NEAR ubyte *start = (NEAR ubyte *)(STACK_BASE & 0xf0);
- NEAR ubyte *end = (NEAR ubyte *)SP;
- ubyte i;
+ NEAR uint8_t *start = (NEAR uint8_t *)(STACK_BASE & 0xf0);
+ NEAR uint8_t *end = (NEAR uint8_t *)SP;
+ uint8_t i;
while (start < end)
{
- up_puthex((ubyte)start);
+ up_puthex((uint8_t)start);
_up_putcolon();
for (i = 0; i < 8; i++)
{
up_putspace();
- if (start < (NEAR ubyte *)(STACK_BASE) ||
+ if (start < (NEAR uint8_t *)(STACK_BASE) ||
start > end)
{
up_putspace();
@@ -169,16 +173,16 @@ void up_dumpstack(void)
}
#endif
-/************************************************************
+/************************************************************************
* Name: up_dumpframe
- ************************************************************/
+ ************************************************************************/
#if defined(CONFIG_FRAME_DUMP) && defined(CONFIG_ARCH_BRINGUP)
void up_dumpframe(FAR struct xcptcontext *context)
{
#ifdef CONFIG_FRAME_DUMP_SHORT
- FAR ubyte *stack = &context->stack[context->nbytes - FRAME_SIZE];
- FAR ubyte *regs = context->regs;
+ FAR uint8_t *stack = &context->stack[context->nbytes - FRAME_SIZE];
+ FAR uint8_t *regs = context->regs;
_up_dump16(" RET ", stack[FRAME_RETMS], stack[FRAME_RETLS]);
_up_dump8 (" IE ", stack[FRAME_IE]);
@@ -186,9 +190,9 @@ void up_dumpframe(FAR struct xcptcontext *context)
_up_dump8 (" PSW ", regs[REGS_PSW]);
_up_dump8 (" SP ", context->nbytes + (STACK_BASE-1));
#else
- FAR ubyte *stack = &context->stack[context->nbytes - FRAME_SIZE];
- FAR ubyte *regs = context->regs;
- ubyte i, j, k;
+ FAR uint8_t *stack = &context->stack[context->nbytes - FRAME_SIZE];
+ FAR uint8_t *regs = context->regs;
+ uint8_t i, j, k;
_up_dump8 (" NBYTES ", context->nbytes);
@@ -225,9 +229,9 @@ void up_dumpframe(FAR struct xcptcontext *context)
}
#endif
-/************************************************************
+/************************************************************************
* Name: up_dumpframe
- ************************************************************/
+ ************************************************************************/
/* The 805x family has a tiny, 256 stack and can be easily
* overflowed. The following macro can be used to instrument
@@ -235,7 +239,7 @@ void up_dumpframe(FAR struct xcptcontext *context)
*/
#ifdef CONFIG_ARCH_PJRC
-void up_showsp(ubyte ch) __naked
+void up_showsp(uint8_t ch) __naked
{
ch;
_asm
diff --git a/nuttx/arch/pjrc-8051/src/up_delay.c b/nuttx/arch/pjrc-8051/src/up_delay.c
index 111d2c0df..3403c69cc 100644
--- a/nuttx/arch/pjrc-8051/src/up_delay.c
+++ b/nuttx/arch/pjrc-8051/src/up_delay.c
@@ -1,7 +1,7 @@
-/************************************************************
+/************************************************************************
* up_delay.c
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,51 +31,51 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+#include <stdint.h>
#include "up_internal.h"
-/************************************************************
+/************************************************************************
* Definitions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Types
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Function Prototypes
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Variables
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Functions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Public Funtions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Name: up_delay
*
* Description:
* Delay inline for the requested number of milliseconds.
* NOT multi-tasking friendly.
*
- ************************************************************/
+ ************************************************************************/
-void up_delay(ubyte milliseconds) __naked
+void up_delay(uint8_t milliseconds) __naked
{
_asm
mov r0, dpl
diff --git a/nuttx/arch/pjrc-8051/src/up_exit.c b/nuttx/arch/pjrc-8051/src/up_exit.c
index 6b9529050..736fc71d5 100644
--- a/nuttx/arch/pjrc-8051/src/up_exit.c
+++ b/nuttx/arch/pjrc-8051/src/up_exit.c
@@ -1,7 +1,7 @@
-/****************************************************************************
+/****************************************************************************************
* up_exit.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
@@ -31,38 +31,40 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ****************************************************************************/
+ ****************************************************************************************/
-/****************************************************************************
+/****************************************************************************************
* Included Files
- ****************************************************************************/
+ ****************************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+
#include <sched.h>
#include <debug.h>
+
#include <8052.h>
#include <nuttx/arch.h>
+
#include "os_internal.h"
#include "up_internal.h"
-/****************************************************************************
+/****************************************************************************************
* Private Definitions
- ****************************************************************************/
+ ****************************************************************************************/
-/****************************************************************************
+/****************************************************************************************
* Private Data
- ****************************************************************************/
+ ****************************************************************************************/
-/****************************************************************************
+/****************************************************************************************
* Private Functions
- ****************************************************************************/
+ ****************************************************************************************/
-/****************************************************************************
+/****************************************************************************************
* Public Functions
- ****************************************************************************/
+ ****************************************************************************************/
-/****************************************************************************
+/****************************************************************************************
* Name: _exit
*
* Description:
@@ -71,7 +73,7 @@
* be deleted is the currently executing task. It is more complex because
* a context switch must be perform to the next ready to run task.
*
- ****************************************************************************/
+ ****************************************************************************************/
void _exit(int status)
{
diff --git a/nuttx/arch/pjrc-8051/src/up_idle.c b/nuttx/arch/pjrc-8051/src/up_idle.c
index 7c9ebc040..802e684be 100644
--- a/nuttx/arch/pjrc-8051/src/up_idle.c
+++ b/nuttx/arch/pjrc-8051/src/up_idle.c
@@ -1,7 +1,7 @@
/************************************************************
* up_idle.c
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,36 +31,38 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
/************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+
+#include <stdint.h>
#include <nuttx/arch.h>
+
#include "up_internal.h"
/************************************************************
* Private Definitions
- ************************************************************/
+ ************************************************************************/
/************************************************************
* Private Data
- ************************************************************/
+ ************************************************************************/
#if defined(CONFIG_ARCH_LEDS) && defined(CONFIG_ARCH_BRINGUP)
-static ubyte g_ledtoggle = 0;
+static /**************** g_ledtoggle = 0;
#endif
/************************************************************
* Private Functions
- ************************************************************/
+ ************************************************************************/
/************************************************************
* Public Functions
- ************************************************************/
+ ************************************************************************/
/************************************************************
* Name: up_idle
@@ -75,7 +77,7 @@ static ubyte g_ledtoggle = 0;
* this is where power management operations might be
* performed.
*
- ************************************************************/
+ ************************************************************************/
void up_idle(void)
{
diff --git a/nuttx/arch/pjrc-8051/src/up_initialize.c b/nuttx/arch/pjrc-8051/src/up_initialize.c
index 4d988501b..3f0bc4027 100644
--- a/nuttx/arch/pjrc-8051/src/up_initialize.c
+++ b/nuttx/arch/pjrc-8051/src/up_initialize.c
@@ -1,7 +1,7 @@
-/************************************************************
+/************************************************************************
* up_initialize.c
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,25 +31,28 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+
+#include <stdint.h>
+
#include <nuttx/arch.h>
#include <nuttx/fs.h>
+
#include "up_internal.h"
-/************************************************************
+/************************************************************************
* Private Definitions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Data
- ************************************************************/
+ ************************************************************************/
/* This is the top of the stack containing the interrupt
* stack frame. It is set when processing an interrupt. It
@@ -58,7 +61,7 @@
* interrupt.
*/
-ubyte g_irqtos;
+uint8_t g_irqtos;
/* Registers are saved in the following global array during
* interrupt processing. If a context switch is performed
@@ -68,7 +71,7 @@ ubyte g_irqtos;
* directly into (_TCB*)g_readytorun.head->xcp.regs).
*/
-ubyte g_irqregs[REGS_SIZE];
+uint8_t g_irqregs[REGS_SIZE];
/* If during execution of an interrup handler, a context
* switch must be performed, the follwing will be set to
@@ -83,18 +86,18 @@ FAR struct xcptcontext *g_irqcontext;
* to comput them.
*/
-const ubyte g_ntobit[8] =
+const uint8_t g_ntobit[8] =
{ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
-/************************************************************
+/************************************************************************
* Private Functions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Public Functions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Name: up_initialize
*
* Description:
@@ -112,7 +115,7 @@ const ubyte g_ntobit[8] =
* libraries have been initialized. OS services and driver
* services are available.
*
- ************************************************************/
+ ************************************************************************/
void up_initialize(void)
{
diff --git a/nuttx/arch/pjrc-8051/src/up_initialstate.c b/nuttx/arch/pjrc-8051/src/up_initialstate.c
index 7fc0ddc39..c4f634dcf 100644
--- a/nuttx/arch/pjrc-8051/src/up_initialstate.c
+++ b/nuttx/arch/pjrc-8051/src/up_initialstate.c
@@ -1,7 +1,7 @@
-/************************************************************
+/************************************************************************
* up_initialstate.c
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,34 +31,36 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+
+#include <stdint.h>
#include <sched.h>
+
#include "up_internal.h"
-/************************************************************
+/************************************************************************
* Private Definitions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Data
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Functions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Public Functions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Name: up_initial_state
*
* Description:
@@ -70,12 +72,12 @@
* and/or stack so that execution will begin at tcb->start
* on the next context switch.
*
- ************************************************************/
+ ************************************************************************/
void up_initial_state(FAR _TCB *tcb)
{
- FAR ubyte *frame = tcb->xcp.stack;
- FAR ubyte *regs = tcb->xcp.regs;
+ FAR uint8_t *frame = tcb->xcp.stack;
+ FAR uint8_t *regs = tcb->xcp.regs;
/* This is the form of initial stack frame
*
@@ -94,8 +96,8 @@ void up_initial_state(FAR _TCB *tcb)
* (SP) <- (SP) -1
*/
- frame[FRAME_RETLS] = (((uint16)tcb->start) & 0xff);
- frame[FRAME_RETMS] = (((uint16)tcb->start) >> 8);
+ frame[FRAME_RETLS] = (((uint16_t))tcb->start) & 0xff);
+ frame[FRAME_RETMS] = (((uint16_t))tcb->start) >> 8);
/* The context save area for registers a, ie, and dpstr
* follows the return address in the stack frame.
diff --git a/nuttx/arch/pjrc-8051/src/up_internal.h b/nuttx/arch/pjrc-8051/src/up_internal.h
index 8b2e2018a..d49c757a6 100644
--- a/nuttx/arch/pjrc-8051/src/up_internal.h
+++ b/nuttx/arch/pjrc-8051/src/up_internal.h
@@ -1,7 +1,7 @@
/**************************************************************************
* up_internal.h
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -41,6 +41,8 @@
**************************************************************************/
#include <nuttx/config.h>
+#include <stdint.h>
+#include <stdbool.h>
#include <arch/irq.h>
#if defined(CONFIG_ARCH_BOARD_PJRC_87C52)
@@ -70,7 +72,7 @@
* interrupt.
*/
-extern ubyte g_irqtos;
+extern uint8_t g_irqtos;
/* Registers are saved in the following global array during
* interrupt processing. If a context switch is performed
@@ -80,7 +82,7 @@ extern ubyte g_irqtos;
* directly into (_TCB*)g_readytorun.head->xcp.regs).
*/
-extern ubyte g_irqregs[REGS_SIZE];
+extern uint8_t g_irqregs[REGS_SIZE];
/* If during execution of an interrup handler, a context
* switch must be performed, the follwing will be set to
@@ -95,7 +97,7 @@ extern FAR struct xcptcontext *g_irqcontext;
* to comput them.
*/
-extern const ubyte g_ntobit[8];
+extern const uint8_t g_ntobit[8];
#endif /* __ASSEMBLY */
@@ -106,21 +108,21 @@ extern const ubyte g_ntobit[8];
#ifndef __ASSEMBLY__
#if CONFIG_MM_REGIONS > 1
-extern void up_addregion(void);
+extern void up_addregion(void);
#endif
-extern void up_delay(ubyte milliseconds) __naked;
-extern void up_irqinitialize(void);
-extern void up_restorecontext(FAR struct xcptcontext *context) _naked;
-extern void up_restoreregisters(FAR ubyte *regs) _naked;
-extern ubyte up_savecontext(FAR struct xcptcontext *context) __naked;
-extern void up_saveregisters(FAR ubyte *regs) _naked;
-extern void up_saveirqcontext(FAR struct xcptcontext *context);
-extern void up_timerinit(void);
+extern void up_delay(uint8_t milliseconds) __naked;
+extern void up_irqinitialize(void);
+extern void up_restorecontext(FAR struct xcptcontext *context) _naked;
+extern void up_restoreregisters(FAR uint8_t *regs) _naked;
+extern uint8_t up_savecontext(FAR struct xcptcontext *context) __naked;
+extern void up_saveregisters(FAR uint8_t *regs) _naked;
+extern void up_saveirqcontext(FAR struct xcptcontext *context);
+extern void up_timerinit(void);
/* Defined in up_debug.c */
#if defined(CONFIG_ARCH_BRINGUP)
-extern void up_puthex(ubyte hex) __naked;
+extern void up_puthex(uint8_t hex) __naked;
extern void up_puthex16(int hex) __naked;
extern void up_putnl(void) __naked;
extern void up_puts(__code char *ptr);
@@ -138,8 +140,8 @@ extern void up_dumpframe(FAR struct xcptcontext *context);
#ifdef CONFIG_ARCH_LEDS
extern void up_ledinit(void);
-extern void up_ledon(ubyte led);
-extern void up_ledoff(ubyte led);
+extern void up_ledon(uint8_t led);
+extern void up_ledoff(uint8_t led);
#else
# define up_ledinit()
# define up_ledon(led)
diff --git a/nuttx/arch/pjrc-8051/src/up_interruptcontext.c b/nuttx/arch/pjrc-8051/src/up_interruptcontext.c
index 26b5ad2ae..81426a94e 100644
--- a/nuttx/arch/pjrc-8051/src/up_interruptcontext.c
+++ b/nuttx/arch/pjrc-8051/src/up_interruptcontext.c
@@ -1,7 +1,7 @@
-/************************************************************
+/************************************************************************
* up_interruptcontext.c
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,38 +31,40 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+
+#include <stdbool.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h>
+
#include "up_internal.h"
-/************************************************************
+/************************************************************************
* Private Types
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Function Prototypes
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Global Functions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* 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 g_irqtos != 0;
}
diff --git a/nuttx/arch/pjrc-8051/src/up_irq.c b/nuttx/arch/pjrc-8051/src/up_irq.c
index a23e4c17b..f40bdbf31 100644
--- a/nuttx/arch/pjrc-8051/src/up_irq.c
+++ b/nuttx/arch/pjrc-8051/src/up_irq.c
@@ -1,7 +1,7 @@
-/************************************************************
+/************************************************************************
* up_irq.c
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,43 +31,46 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+
#include <nuttx/irq.h>
+#include <debug.h>
+
#include <8052.h>
+
#include "up_internal.h"
-#include <debug.h>
extern int g_nints;
-/************************************************************
+
+/************************************************************************
* Definitions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Public Data
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Data
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Functions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Public Funtions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Name: irq_initialize
- ************************************************************/
+ ************************************************************************/
void up_irqinitialize(void)
{
@@ -88,13 +91,13 @@ void up_irqinitialize(void)
#endif
}
-/************************************************************
+/************************************************************************
* Name: irqsave
*
* Description:
* Disable all IRQs
*
- ************************************************************/
+ ************************************************************************/
irqstate_t irqsave(void)
{
@@ -103,26 +106,26 @@ irqstate_t irqsave(void)
return ret;
}
-/************************************************************
+/************************************************************************
* Name: irqrestore
*
* Description:
* Restore a previous interrupt state
*
- ************************************************************/
+ ************************************************************************/
void irqrestore(irqstate_t flags)
{
IE = flags;
}
-/************************************************************
+/************************************************************************
* Name: up_disable_irq
*
* Description:
* Disable the IRQ specified by 'irq'
*
- ************************************************************/
+ ************************************************************************/
void up_disable_irq(int irq)
{
@@ -132,13 +135,13 @@ void up_disable_irq(int irq)
}
}
-/************************************************************
+/************************************************************************
* Name: up_enable_irq
*
* Description:
* Enable the IRQ specified by 'irq'
*
- ************************************************************/
+ ************************************************************************/
void up_enable_irq(int irq)
{
diff --git a/nuttx/arch/pjrc-8051/src/up_irqtest.c b/nuttx/arch/pjrc-8051/src/up_irqtest.c
index 944e70594..b0bdc8464 100644
--- a/nuttx/arch/pjrc-8051/src/up_irqtest.c
+++ b/nuttx/arch/pjrc-8051/src/up_irqtest.c
@@ -1,5 +1,5 @@
-/************************************************************
- * up_putc.c
+/************************************************************************
+ * up_irqtest.c
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,21 +31,25 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+
+#include <stdint.h>
+#include <stdbool.h>
+
#include <nuttx/arch.h>
#include <8052.h>
+
#include "up_internal.h"
-/************************************************************
+/************************************************************************
* Definitions
- ************************************************************/
+ ************************************************************************/
#define up_extint0 ((vector_t)PM2_VECTOR_EXTINT0)
#define up_timer0 ((vector_t)PM2_VECTOR_TIMER0)
@@ -54,31 +58,31 @@
#define up_uart ((vector_t)PM2_VECTOR_UART)
#define up_timer2 ((vector_t)PM2_VECTOR_TIMER2)
-/************************************************************
+/************************************************************************
* Private Types
- ************************************************************/
+ ************************************************************************/
typedef void (*vector_t)(void);
-/************************************************************
+/************************************************************************
* Public Variables
- ************************************************************/
+ ************************************************************************/
-boolean g_irqtest;
-ubyte g_irqtos;
-ubyte g_irqregs[REGS_SIZE];
-int g_nirqs;
+bool g_irqtest;
+uint8_t g_irqtos;
+uint8_t g_irqregs[REGS_SIZE];
+int g_nirqs;
FAR struct xcptcontext *g_irqcontext;
-/************************************************************
+/************************************************************************
* Private Functions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Name: utility functions
- ************************************************************/
+ ************************************************************************/
-static void _up_putc(ubyte ch) __naked
+static void _up_putc(uint8_t ch) __naked
{
ch; /* To avoid unreferenced argument warning */
_asm
@@ -87,7 +91,7 @@ static void _up_putc(ubyte ch) __naked
_endasm;
}
-void _up_puthex(ubyte hex) __naked
+void _up_puthex(uint8_t hex) __naked
{
hex; /* To avoid unreferenced argument warning */
_asm
@@ -119,7 +123,7 @@ void _up_puts(__code char *ptr)
}
}
-void _up_delay(ubyte milliseconds) __naked
+void _up_delay(uint8_t milliseconds) __naked
{
_asm
mov r0, dpl
@@ -136,17 +140,17 @@ void _up_delay(ubyte milliseconds) __naked
_endasm;
}
-/************************************************************
+/************************************************************************
* Public Functions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Name: os_start
*
* Description:
* "Fake" OS entry point.
*
- ************************************************************/
+ ************************************************************************/
void os_start(void)
{
@@ -158,7 +162,7 @@ void os_start(void)
/* Then verify all of the interrupt */
- g_irqtest = FALSE;
+ g_irqtest = false;
up_extint0();
up_timer0();
@@ -183,7 +187,7 @@ void os_start(void)
/* Start timer interrupts */
- g_irqtest = TRUE;
+ g_irqtest = true;
g_nirqs = 0;
IE = 0x82; /* Enable interrupts */
@@ -207,13 +211,13 @@ void os_start(void)
for(;;);
}
-/************************************************************
+/************************************************************************
* Name: irq_dispatch
*
* Description:
* "Fake" IRQ dispatcher
*
- ***********************************************************/
+ ***********************************************************************/
void irq_dispatch(int irq, FAR void *context)
{
@@ -230,13 +234,13 @@ void irq_dispatch(int irq, FAR void *context)
}
}
-/************************************************************
+/************************************************************************
* Name: up_dumpstack / up_dumpframe
*
* Description:
* "Fake" debug routines if needed.
*
- ************************************************************/
+ ************************************************************************/
void up_dumpstack(void)
{
@@ -246,24 +250,24 @@ void up_dumpframe(FAR struct xcptcontext *context)
{
}
-/************************************************************
+/************************************************************************
* Name: up_ledinit, up_ledon, up_ledoff
*
* Description:
* "Fake" LED routines if needed
*
- ************************************************************/
+ ************************************************************************/
void up_ledinit(void)
{
}
-void up_ledon(ubyte led)
+void up_ledon(uint8_t led)
{
led;
}
-void up_ledoff(ubyte led)
+void up_ledoff(uint8_t led)
{
led;
}
diff --git a/nuttx/arch/pjrc-8051/src/up_putc.c b/nuttx/arch/pjrc-8051/src/up_putc.c
index 48f3ea90e..a4b96e23f 100644
--- a/nuttx/arch/pjrc-8051/src/up_putc.c
+++ b/nuttx/arch/pjrc-8051/src/up_putc.c
@@ -1,7 +1,7 @@
-/************************************************************
+/************************************************************************
* up_putc.c
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,20 +31,19 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
#include <nuttx/arch.h>
#include "up_internal.h"
-/************************************************************
+/************************************************************************
* Private Functions
- ************************************************************/
+ ************************************************************************/
static void _up_putc(int ch) __naked
{
@@ -66,9 +65,9 @@ cout: jnb ti, cout
#endif
}
-/************************************************************
+/************************************************************************
* Public Functions
- ************************************************************/
+ ************************************************************************/
int up_putc(int ch)
{
diff --git a/nuttx/arch/pjrc-8051/src/up_releasepending.c b/nuttx/arch/pjrc-8051/src/up_releasepending.c
index 8a58da9e6..c35199bd5 100644
--- a/nuttx/arch/pjrc-8051/src/up_releasepending.c
+++ b/nuttx/arch/pjrc-8051/src/up_releasepending.c
@@ -1,7 +1,7 @@
-/************************************************************
+/************************************************************************
* up_releasepending.c
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,37 +31,39 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
#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"
-/************************************************************
+/************************************************************************
* Private Definitions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Data
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Funtions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Public Funtions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Name: up_release_pending
*
* Description:
@@ -70,7 +72,7 @@
* context switch if a new task is placed at the head of
* the ready to run list.
*
- ************************************************************/
+ ************************************************************************/
void up_release_pending(void)
{
diff --git a/nuttx/arch/pjrc-8051/src/up_reprioritizertr.c b/nuttx/arch/pjrc-8051/src/up_reprioritizertr.c
index 7e9ddd9fd..8810a8fe1 100644
--- a/nuttx/arch/pjrc-8051/src/up_reprioritizertr.c
+++ b/nuttx/arch/pjrc-8051/src/up_reprioritizertr.c
@@ -38,10 +38,14 @@
****************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+
+#include <stdint.h>
+#include <stdbool.h>
#include <sched.h>
#include <debug.h>
+
#include <nuttx/arch.h>
+
#include "os_internal.h"
#include "up_internal.h"
@@ -81,7 +85,7 @@
*
****************************************************************************/
-void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority)
+void up_reprioritize_rtr(FAR _TCB *tcb, uint8_t priority)
{
/* Verify that the caller is sane */
@@ -95,12 +99,12 @@ void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority)
else
{
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
- boolean switch_needed;
+ bool switch_needed;
dbg("TCB=%p PRI=%d\n", tcb, priority);
/* Remove the tcb task from the ready-to-run list.
- * sched_removereadytorun will return TRUE if we just
+ * sched_removereadytorun will return true if we just
* remove the head of the ready to run list.
*/
@@ -108,10 +112,10 @@ void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority)
/* Setup up the new task priority */
- tcb->sched_priority = (ubyte)priority;
+ tcb->sched_priority = (uint8_t)priority;
/* Return the task to the specified blocked task list.
- * sched_addreadytorun will return TRUE if the task was
+ * sched_addreadytorun will return true if the task was
* added to the new list. We will need to perform a context
* switch only if the EXCLUSIVE or of the two calls is non-zero
* (i.e., one and only one the calls changes the head of the
diff --git a/nuttx/arch/pjrc-8051/src/up_restorecontext.c b/nuttx/arch/pjrc-8051/src/up_restorecontext.c
index fa7c8c2d0..cf7fc1039 100644
--- a/nuttx/arch/pjrc-8051/src/up_restorecontext.c
+++ b/nuttx/arch/pjrc-8051/src/up_restorecontext.c
@@ -1,7 +1,7 @@
/**************************************************************************
* up_restorecontext.c
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -38,6 +38,7 @@
**************************************************************************/
#include <nuttx/config.h>
+#include <stdint.h>
#include <nuttx/irq.h>
#include "up_internal.h"
@@ -90,7 +91,7 @@
*
**************************************************************************/
-void up_restoreregisters(FAR ubyte *regs) _naked
+void up_restoreregisters(FAR uint8_t *regs) _naked
{
_asm
movx a, @dptr
diff --git a/nuttx/arch/pjrc-8051/src/up_savecontext.c b/nuttx/arch/pjrc-8051/src/up_savecontext.c
index 1c4b26898..9a86faa94 100644
--- a/nuttx/arch/pjrc-8051/src/up_savecontext.c
+++ b/nuttx/arch/pjrc-8051/src/up_savecontext.c
@@ -1,7 +1,7 @@
/**************************************************************************
* up_savecontext.c
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -38,7 +38,7 @@
**************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+#include <stdint.h>
#include <nuttx/irq.h>
#include "up_internal.h"
@@ -84,13 +84,13 @@
*
**************************************************************************/
-static void up_savestack(FAR struct xcptcontext *context, ubyte tos)
+static void up_savestack(FAR struct xcptcontext *context, uint8_t tos)
{
/* Copy the current stack frame from internal RAM to XRAM. */
- ubyte nbytes = tos - (STACK_BASE-1);
- NEAR ubyte *src = (NEAR ubyte*)STACK_BASE;
- FAR ubyte *dest = context->stack;
+ uint8_t nbytes = tos - (STACK_BASE-1);
+ NEAR uint8_t *src = (NEAR uint8_t*)STACK_BASE;
+ FAR uint8_t *dest = context->stack;
context->nbytes = nbytes;
while (nbytes--)
@@ -116,13 +116,13 @@ static void up_savestack(FAR struct xcptcontext *context, ubyte tos)
*
**************************************************************************/
-static void up_saveregs(FAR struct xcptcontext *context, ubyte tos)
+static void up_saveregs(FAR struct xcptcontext *context, uint8_t tos)
{
/* Copy the irq register save area into the TCB */
- FAR ubyte *src = g_irqregs;
- FAR ubyte *dest = context->regs;
- ubyte nbytes = REGS_SIZE;
+ FAR uint8_t *src = g_irqregs;
+ FAR uint8_t *dest = context->regs;
+ uint8_t nbytes = REGS_SIZE;
while (nbytes--)
{
@@ -154,7 +154,7 @@ static void up_saveregs(FAR struct xcptcontext *context, ubyte tos)
*
**************************************************************************/
-void up_saveregisters(FAR ubyte *regs) _naked
+void up_saveregisters(FAR uint8_t *regs) _naked
{
_asm
mov a, b
@@ -210,7 +210,7 @@ void up_saveregisters(FAR ubyte *regs) _naked
*
**************************************************************************/
-ubyte up_savecontext(FAR struct xcptcontext *context) _naked
+uint8_t up_savecontext(FAR struct xcptcontext *context) _naked
{
_asm
/* Create the stack frame that we want when it is time to restore
diff --git a/nuttx/arch/pjrc-8051/src/up_timerisr.c b/nuttx/arch/pjrc-8051/src/up_timerisr.c
index c4575273b..3ca2faad6 100644
--- a/nuttx/arch/pjrc-8051/src/up_timerisr.c
+++ b/nuttx/arch/pjrc-8051/src/up_timerisr.c
@@ -1,7 +1,7 @@
-/************************************************************
+/************************************************************************
* up_timerisr.c
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,46 +31,49 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
+
+#include <stdint.h>
#include <debug.h>
+
#include <nuttx/arch.h>
#include <8052.h>
+
#include "clock_internal.h"
#include "up_internal.h"
-/************************************************************
+/************************************************************************
* Definitions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Types
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Function Prototypes
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Global Functions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Function: up_timerisr
*
* Description:
* The timer ISR will perform a variety of services for
* various portions of the systems.
*
- ************************************************************/
+ ************************************************************************/
-int up_timerisr(int irq, FAR ubyte *frame)
+int up_timerisr(int irq, FAR uint8_t *frame)
{
/* Process timer interrupt */
@@ -78,14 +81,14 @@ int up_timerisr(int irq, FAR ubyte *frame)
return 0;
}
-/************************************************************
+/************************************************************************
* Function: up_timerinit
*
* Description:
* This function is called during start-up to initialize
* the timer interrupt.
*
- ************************************************************/
+ ************************************************************************/
void up_timerinit(void)
{
diff --git a/nuttx/arch/pjrc-8051/src/up_unblocktask.c b/nuttx/arch/pjrc-8051/src/up_unblocktask.c
index 303283c28..9152eae0a 100644
--- a/nuttx/arch/pjrc-8051/src/up_unblocktask.c
+++ b/nuttx/arch/pjrc-8051/src/up_unblocktask.c
@@ -1,7 +1,7 @@
-/************************************************************
+/************************************************************************
* up_unblocktask.c
*
- * Copyright (C) 2007 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
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,15 +31,14 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Included Files
- ************************************************************/
+ ************************************************************************/
#include <nuttx/config.h>
-#include <sys/types.h>
#include <sched.h>
#include <debug.h>
@@ -49,23 +48,23 @@
#include "os_internal.h"
#include "up_internal.h"
-/************************************************************
+/************************************************************************
* Private Definitions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Data
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Private Funtions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Public Funtions
- ************************************************************/
+ ************************************************************************/
-/************************************************************
+/************************************************************************
* Name: up_unblock_task
*
* Description:
@@ -79,7 +78,7 @@
* the ready-to-run list and, if it is the highest priority
* ready to run taks, executed.
*
- ************************************************************/
+ ************************************************************************/
void up_unblock_task(FAR _TCB *tcb)
{