From 59ca96e726c8cd3a0b30af34a416ccd96af21729 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 16 Dec 2009 16:28:31 +0000 Subject: [PATCH] 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 --- arch/pjrc-8051/include/arch.h | 32 +++++----- arch/pjrc-8051/include/irq.h | 37 ++++++----- arch/pjrc-8051/src/up_assert.c | 47 +++++++------- arch/pjrc-8051/src/up_blocktask.c | 38 +++++------ arch/pjrc-8051/src/up_debug.c | 76 +++++++++++----------- arch/pjrc-8051/src/up_delay.c | 44 ++++++------- arch/pjrc-8051/src/up_exit.c | 34 +++++----- arch/pjrc-8051/src/up_idle.c | 24 +++---- arch/pjrc-8051/src/up_initialize.c | 43 +++++++------ arch/pjrc-8051/src/up_initialstate.c | 44 ++++++------- arch/pjrc-8051/src/up_internal.h | 36 ++++++----- arch/pjrc-8051/src/up_interruptcontext.c | 36 ++++++----- arch/pjrc-8051/src/up_irq.c | 59 ++++++++--------- arch/pjrc-8051/src/up_irqtest.c | 80 +++++++++++++----------- arch/pjrc-8051/src/up_putc.c | 21 +++---- arch/pjrc-8051/src/up_releasepending.c | 36 ++++++----- arch/pjrc-8051/src/up_reprioritizertr.c | 16 +++-- arch/pjrc-8051/src/up_restorecontext.c | 7 ++- arch/pjrc-8051/src/up_savecontext.c | 26 ++++---- arch/pjrc-8051/src/up_timerisr.c | 43 +++++++------ arch/pjrc-8051/src/up_unblocktask.c | 33 +++++----- 21 files changed, 426 insertions(+), 386 deletions(-) diff --git a/arch/pjrc-8051/include/arch.h b/arch/pjrc-8051/include/arch.h index f7d2b956c9..1ca504fb81 100644 --- a/arch/pjrc-8051/include/arch.h +++ b/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 * * 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 + +/************************************************************************ * 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/arch/pjrc-8051/include/irq.h b/arch/pjrc-8051/include/irq.h index e41ba96871..29b19d2807 100644 --- a/arch/pjrc-8051/include/irq.h +++ b/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 * * 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 +#ifndef __ASSEMBLY__ +# include +#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/arch/pjrc-8051/src/up_assert.c b/arch/pjrc-8051/src/up_assert.c index a0d04c3937..157b18ae51 100644 --- a/arch/pjrc-8051/src/up_assert.c +++ b/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 * * 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 -#include + #include #include #include #include + #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/arch/pjrc-8051/src/up_blocktask.c b/arch/pjrc-8051/src/up_blocktask.c index 5760e9302b..811955efa9 100644 --- a/arch/pjrc-8051/src/up_blocktask.c +++ b/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 * * 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 -#include + +#include #include #include #include + #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/arch/pjrc-8051/src/up_debug.c b/arch/pjrc-8051/src/up_debug.c index 9b52250e2d..9d9bce2a00 100644 --- a/arch/pjrc-8051/src/up_debug.c +++ b/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 * * 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 + #include +#include #include + #include <8052.h> #include #include + #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/arch/pjrc-8051/src/up_delay.c b/arch/pjrc-8051/src/up_delay.c index 111d2c0dfe..3403c69cc2 100644 --- a/arch/pjrc-8051/src/up_delay.c +++ b/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 * * 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 -#include +#include #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/arch/pjrc-8051/src/up_exit.c b/arch/pjrc-8051/src/up_exit.c index 6b9529050c..736fc71d54 100644 --- a/arch/pjrc-8051/src/up_exit.c +++ b/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 * * 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 -#include + #include #include + #include <8052.h> #include + #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/arch/pjrc-8051/src/up_idle.c b/arch/pjrc-8051/src/up_idle.c index 7c9ebc040c..802e684bec 100644 --- a/arch/pjrc-8051/src/up_idle.c +++ b/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 * * 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 -#include + +#include #include + #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/arch/pjrc-8051/src/up_initialize.c b/arch/pjrc-8051/src/up_initialize.c index 4d988501b6..3f0bc40277 100644 --- a/arch/pjrc-8051/src/up_initialize.c +++ b/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 * * 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 -#include + +#include + #include #include + #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/arch/pjrc-8051/src/up_initialstate.c b/arch/pjrc-8051/src/up_initialstate.c index 7fc0ddc390..c4f634dcfc 100644 --- a/arch/pjrc-8051/src/up_initialstate.c +++ b/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 * * 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 -#include + +#include #include + #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/arch/pjrc-8051/src/up_internal.h b/arch/pjrc-8051/src/up_internal.h index 8b2e2018a0..d49c757a61 100644 --- a/arch/pjrc-8051/src/up_internal.h +++ b/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 * * 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 +#include +#include #include #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/arch/pjrc-8051/src/up_interruptcontext.c b/arch/pjrc-8051/src/up_interruptcontext.c index 26b5ad2ae2..81426a94e4 100644 --- a/arch/pjrc-8051/src/up_interruptcontext.c +++ b/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 * * 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 -#include + +#include #include #include + #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/arch/pjrc-8051/src/up_irq.c b/arch/pjrc-8051/src/up_irq.c index a23e4c17b4..f40bdbf31b 100644 --- a/arch/pjrc-8051/src/up_irq.c +++ b/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 * * 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 -#include + #include +#include + #include <8052.h> + #include "up_internal.h" -#include 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/arch/pjrc-8051/src/up_irqtest.c b/arch/pjrc-8051/src/up_irqtest.c index 944e705940..b0bdc84644 100644 --- a/arch/pjrc-8051/src/up_irqtest.c +++ b/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 @@ -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 -#include + +#include +#include + #include #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/arch/pjrc-8051/src/up_putc.c b/arch/pjrc-8051/src/up_putc.c index 48f3ea90ee..a4b96e23f4 100644 --- a/arch/pjrc-8051/src/up_putc.c +++ b/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 * * 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 -#include #include #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/arch/pjrc-8051/src/up_releasepending.c b/arch/pjrc-8051/src/up_releasepending.c index 8a58da9e65..c35199bd58 100644 --- a/arch/pjrc-8051/src/up_releasepending.c +++ b/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 * * 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 -#include + #include #include + #include + #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/arch/pjrc-8051/src/up_reprioritizertr.c b/arch/pjrc-8051/src/up_reprioritizertr.c index 7e9ddd9fd8..8810a8fe16 100644 --- a/arch/pjrc-8051/src/up_reprioritizertr.c +++ b/arch/pjrc-8051/src/up_reprioritizertr.c @@ -38,10 +38,14 @@ ****************************************************************************/ #include -#include + +#include +#include #include #include + #include + #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/arch/pjrc-8051/src/up_restorecontext.c b/arch/pjrc-8051/src/up_restorecontext.c index fa7c8c2d03..cf7fc10395 100644 --- a/arch/pjrc-8051/src/up_restorecontext.c +++ b/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 * * 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 +#include #include #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/arch/pjrc-8051/src/up_savecontext.c b/arch/pjrc-8051/src/up_savecontext.c index 1c4b268980..9a86faa947 100644 --- a/arch/pjrc-8051/src/up_savecontext.c +++ b/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 * * 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 -#include +#include #include #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/arch/pjrc-8051/src/up_timerisr.c b/arch/pjrc-8051/src/up_timerisr.c index c4575273b8..3ca2faad67 100644 --- a/arch/pjrc-8051/src/up_timerisr.c +++ b/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 * * 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 -#include + +#include #include + #include #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/arch/pjrc-8051/src/up_unblocktask.c b/arch/pjrc-8051/src/up_unblocktask.c index 303283c28b..9152eae0a1 100644 --- a/arch/pjrc-8051/src/up_unblocktask.c +++ b/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 * * 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 -#include #include #include @@ -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) {