diff options
Diffstat (limited to 'nuttx/arch/sh/src/common')
-rw-r--r-- | nuttx/arch/sh/src/common/up_arch.h | 16 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_assert.c | 8 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_blocktask.c | 8 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_createstack.c | 9 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_doirq.c | 11 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_exit.c | 6 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_idle.c | 4 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_initialize.c | 3 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_internal.h | 30 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_interruptcontext.c | 10 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_lowputs.c | 3 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_puts.c | 3 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_releasepending.c | 5 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_releasestack.c | 5 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_reprioritizertr.c | 15 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_unblocktask.c | 5 | ||||
-rw-r--r-- | nuttx/arch/sh/src/common/up_usestack.c | 8 |
17 files changed, 85 insertions, 64 deletions
diff --git a/nuttx/arch/sh/src/common/up_arch.h b/nuttx/arch/sh/src/common/up_arch.h index ae94c03f8..ddc66fb76 100644 --- a/nuttx/arch/sh/src/common/up_arch.h +++ b/nuttx/arch/sh/src/common/up_arch.h @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/common/up_arch.h * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,7 @@ #include <nuttx/config.h> #ifndef __ASSEMBLY__ -# include <sys/types.h> +# include <stdint.h> #endif #include <arch/board/board.h> @@ -58,12 +58,12 @@ #ifndef __ASSEMBLY__ -# define getreg8(a) (*(volatile ubyte *)(a)) -# define putreg8(v,a) (*(volatile ubyte *)(a) = (v)) -# define getreg16(a) (*(volatile uint16 *)(a)) -# define putreg16(v,a) (*(volatile uint16 *)(a) = (v)) -# define getreg32(a) (*(volatile uint32 *)(a)) -# define putreg32(v,a) (*(volatile uint32 *)(a) = (v)) +# define getreg8(a) (*(volatile uint8_t *)(a)) +# define putreg8(v,a) (*(volatile uint8_t *)(a) = (v)) +# define getreg16(a) (*(volatile uint16_t *)(a)) +# define putreg16(v,a) (*(volatile uint16_t *)(a) = (v)) +# define getreg32(a) (*(volatile uint32_t *)(a)) +# define putreg32(v,a) (*(volatile uint32_t *)(a) = (v)) #endif diff --git a/nuttx/arch/sh/src/common/up_assert.c b/nuttx/arch/sh/src/common/up_assert.c index 3cac6606f..95b87af6f 100644 --- a/nuttx/arch/sh/src/common/up_assert.c +++ b/nuttx/arch/sh/src/common/up_assert.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/common/up_assert.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -39,7 +39,7 @@ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> #include <stdlib.h> #include <assert.h> #include <debug.h> @@ -107,7 +107,7 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */ * 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 && defined(CONFIG_DEBUG) _TCB *rtcb = (_TCB*)g_readytorun.head; @@ -129,7 +129,7 @@ void up_assert(const ubyte *filename, int lineno) * 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 && defined(CONFIG_DEBUG) _TCB *rtcb = (_TCB*)g_readytorun.head; diff --git a/nuttx/arch/sh/src/common/up_blocktask.c b/nuttx/arch/sh/src/common/up_blocktask.c index 547fd368f..dc8c1a1fa 100644 --- a/nuttx/arch/sh/src/common/up_blocktask.c +++ b/nuttx/arch/sh/src/common/up_blocktask.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/common/up_blocktask.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -38,10 +38,12 @@ ****************************************************************************/ #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" @@ -93,7 +95,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state) else { _TCB *rtcb = (_TCB*)g_readytorun.head; - boolean switch_needed; + bool switch_needed; /* Remove the tcb task from the ready-to-run list. If we * are blocking the task at the head of the task list (the diff --git a/nuttx/arch/sh/src/common/up_createstack.c b/nuttx/arch/sh/src/common/up_createstack.c index 853601726..35651fe86 100644 --- a/nuttx/arch/sh/src/common/up_createstack.c +++ b/nuttx/arch/sh/src/common/up_createstack.c @@ -40,6 +40,7 @@ #include <nuttx/config.h> #include <sys/types.h> +#include <stdint.h> #include <sched.h> #include <debug.h> @@ -93,7 +94,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size) if (!tcb->stack_alloc_ptr) { - tcb->stack_alloc_ptr = (uint32 *)kzmalloc(stack_size); + tcb->stack_alloc_ptr = (uint32_t*)kzmalloc(stack_size); } if (tcb->stack_alloc_ptr) @@ -108,7 +109,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size) * referenced as positive word offsets from sp. */ - top_of_stack = (uint32)tcb->stack_alloc_ptr + stack_size - 4; + top_of_stack = (uint32_t)tcb->stack_alloc_ptr + stack_size - 4; /* The Arm7Tdmi stack must be aligned at word (4 byte) * boundaries. If necessary top_of_stack must be rounded @@ -116,11 +117,11 @@ int up_create_stack(_TCB *tcb, size_t stack_size) */ top_of_stack &= ~3; - size_of_stack = top_of_stack - (uint32)tcb->stack_alloc_ptr + 4; + size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4; /* Save the adjusted stack values in the _TCB */ - tcb->adj_stack_ptr = (uint32*)top_of_stack; + tcb->adj_stack_ptr = (uint32_t*)top_of_stack; tcb->adj_stack_size = size_of_stack; up_ledon(LED_STACKCREATED); diff --git a/nuttx/arch/sh/src/common/up_doirq.c b/nuttx/arch/sh/src/common/up_doirq.c index aa938be18..33d33a052 100644 --- a/nuttx/arch/sh/src/common/up_doirq.c +++ b/nuttx/arch/sh/src/common/up_doirq.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/common/up_doirq.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -38,10 +38,13 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + +#include <stdin.h> +#include <assert.h> + #include <nuttx/irq.h> #include <nuttx/arch.h> -#include <assert.h> + #include "up_arch.h" #include "os_internal.h" #include "up_internal.h" @@ -66,7 +69,7 @@ * Public Functions ****************************************************************************/ -uint32 *up_doirq(int irq, uint32* regs) +uint32_t *up_doirq(int irq, uint32_t* regs) { up_ledon(LED_INIRQ); #ifdef CONFIG_SUPPRESS_INTERRUPTS diff --git a/nuttx/arch/sh/src/common/up_exit.c b/nuttx/arch/sh/src/common/up_exit.c index ede048370..29213ce9d 100644 --- a/nuttx/arch/sh/src/common/up_exit.c +++ b/nuttx/arch/sh/src/common/up_exit.c @@ -1,7 +1,7 @@ /**************************************************************************** * common/up_exit.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -38,10 +38,12 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + #include <sched.h> #include <debug.h> + #include <nuttx/arch.h> + #include "os_internal.h" #include "up_internal.h" diff --git a/nuttx/arch/sh/src/common/up_idle.c b/nuttx/arch/sh/src/common/up_idle.c index a1a63dd43..f95f019ae 100644 --- a/nuttx/arch/sh/src/common/up_idle.c +++ b/nuttx/arch/sh/src/common/up_idle.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/common/up_idle.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -38,8 +38,8 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> #include <nuttx/arch.h> + #include "up_internal.h" /**************************************************************************** diff --git a/nuttx/arch/sh/src/common/up_initialize.c b/nuttx/arch/sh/src/common/up_initialize.c index 114c8df98..1b4ceb8be 100644 --- a/nuttx/arch/sh/src/common/up_initialize.c +++ b/nuttx/arch/sh/src/common/up_initialize.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/common/up_initialize.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -39,7 +39,6 @@ #include <nuttx/config.h> -#include <sys/types.h> #include <debug.h> #include <nuttx/arch.h> diff --git a/nuttx/arch/sh/src/common/up_internal.h b/nuttx/arch/sh/src/common/up_internal.h index 27205c239..7840caf66 100644 --- a/nuttx/arch/sh/src/common/up_internal.h +++ b/nuttx/arch/sh/src/common/up_internal.h @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/common/up_internal.h * - * Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -40,6 +40,10 @@ * Included Files ****************************************************************************/ +#ifndef __ASSEMBLY__ +# include <stdint.h> +#endif + /**************************************************************************** * Definitions ****************************************************************************/ @@ -94,7 +98,7 @@ typedef void (*up_vector_t)(void); * interrupt processing. */ -extern uint32 *current_regs; +extern uint32_t *current_regs; /* This is the beginning of heap as provided from up_head.S. * This is the first address in DRAM after the loaded @@ -102,7 +106,7 @@ extern uint32 *current_regs; * CONFIG_DRAM_END */ -extern uint32 g_heapbase; +extern uint32_t g_heapbase; #endif /**************************************************************************** @@ -118,18 +122,18 @@ extern uint32 g_heapbase; /* Defined in files with the same name as the function */ extern void up_boot(void); -extern void up_copystate(uint32 *dest, uint32 *src); -extern void up_dataabort(uint32 *regs); -extern void up_decodeirq(uint32 *regs); -extern uint32 *up_doirq(int irq, uint32 *regs); -extern void up_fullcontextrestore(uint32 *regs) __attribute__ ((noreturn)); +extern void up_copystate(uint32_t *dest, uint32_t *src); +extern void up_dataabort(uint32_t *regs); +extern void up_decodeirq(uint32_t *regs); +extern uint32_t *up_doirq(int irq, uint32_t *regs); +extern void up_fullcontextrestore(uint32_t *regs) __attribute__ ((noreturn)); extern void up_irqinitialize(void); -extern void up_prefetchabort(uint32 *regs); -extern int up_saveusercontext(uint32 *regs); +extern void up_prefetchabort(uint32_t *regs); +extern int up_saveusercontext(uint32_t *regs); extern void up_sigdeliver(void); -extern void up_syscall(uint32 *regs); -extern int up_timerisr(int irq, uint32 *regs); -extern void up_undefinedinsn(uint32 *regs); +extern void up_syscall(uint32_t *regs); +extern int up_timerisr(int irq, uint32_t *regs); +extern void up_undefinedinsn(uint32_t *regs); extern void up_lowputc(char ch); extern void up_puts(const char *str); extern void up_lowputs(const char *str); diff --git a/nuttx/arch/sh/src/common/up_interruptcontext.c b/nuttx/arch/sh/src/common/up_interruptcontext.c index aa2720aa8..16b443619 100644 --- a/nuttx/arch/sh/src/common/up_interruptcontext.c +++ b/nuttx/arch/sh/src/common/up_interruptcontext.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/common/up_interruptcontext.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -38,9 +38,11 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + +#include <stdbool.h> #include <nuttx/arch.h> #include <nuttx/irq.h> + #include "up_internal.h" /**************************************************************************** @@ -58,11 +60,11 @@ /**************************************************************************** * Name: up_interrupt_context * - * Description: Return TRUE is we are currently executing in + * Description: Return true is we are currently executing in * the interrupt handler context. ****************************************************************************/ -boolean up_interrupt_context(void) +bool up_interrupt_context(void) { return current_regs != NULL; } diff --git a/nuttx/arch/sh/src/common/up_lowputs.c b/nuttx/arch/sh/src/common/up_lowputs.c index 78ed1fef6..54438835d 100644 --- a/nuttx/arch/sh/src/common/up_lowputs.c +++ b/nuttx/arch/sh/src/common/up_lowputs.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/common/up_lowputs.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,6 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> #include "up_internal.h" diff --git a/nuttx/arch/sh/src/common/up_puts.c b/nuttx/arch/sh/src/common/up_puts.c index 2e6e22e48..d22b22e71 100644 --- a/nuttx/arch/sh/src/common/up_puts.c +++ b/nuttx/arch/sh/src/common/up_puts.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/common/up_puts.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -38,7 +38,6 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> #include <nuttx/arch.h> #include "up_internal.h" diff --git a/nuttx/arch/sh/src/common/up_releasepending.c b/nuttx/arch/sh/src/common/up_releasepending.c index ff5f17ccf..2f54e0249 100644 --- a/nuttx/arch/sh/src/common/up_releasepending.c +++ b/nuttx/arch/sh/src/common/up_releasepending.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/common/up_releasepending.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -38,10 +38,11 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + #include <sched.h> #include <debug.h> #include <nuttx/arch.h> + #include "os_internal.h" #include "up_internal.h" diff --git a/nuttx/arch/sh/src/common/up_releasestack.c b/nuttx/arch/sh/src/common/up_releasestack.c index 729d7791a..b8c9fb8bb 100644 --- a/nuttx/arch/sh/src/common/up_releasestack.c +++ b/nuttx/arch/sh/src/common/up_releasestack.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/common/up_releasestack.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -38,10 +38,11 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + #include <sched.h> #include <debug.h> #include <nuttx/arch.h> + #include "os_internal.h" #include "up_internal.h" diff --git a/nuttx/arch/sh/src/common/up_reprioritizertr.c b/nuttx/arch/sh/src/common/up_reprioritizertr.c index be465fd0a..cc9d0ff47 100644 --- a/nuttx/arch/sh/src/common/up_reprioritizertr.c +++ b/nuttx/arch/sh/src/common/up_reprioritizertr.c @@ -38,10 +38,13 @@ ****************************************************************************/ #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 +84,7 @@ * ****************************************************************************/ -void up_reprioritize_rtr(_TCB *tcb, ubyte priority) +void up_reprioritize_rtr(_TCB *tcb, uint8_t priority) { /* Verify that the caller is sane */ @@ -95,12 +98,12 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority) else { _TCB *rtcb = (_TCB*)g_readytorun.head; - boolean switch_needed; + bool switch_needed; slldbg("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 +111,10 @@ void up_reprioritize_rtr(_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/sh/src/common/up_unblocktask.c b/nuttx/arch/sh/src/common/up_unblocktask.c index c70549953..6421c5619 100644 --- a/nuttx/arch/sh/src/common/up_unblocktask.c +++ b/nuttx/arch/sh/src/common/up_unblocktask.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/common/up_unblocktask.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -38,10 +38,11 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + #include <sched.h> #include <debug.h> #include <nuttx/arch.h> + #include "os_internal.h" #include "clock_internal.h" #include "up_internal.h" diff --git a/nuttx/arch/sh/src/common/up_usestack.c b/nuttx/arch/sh/src/common/up_usestack.c index 226d5f52f..6b472b8a2 100644 --- a/nuttx/arch/sh/src/common/up_usestack.c +++ b/nuttx/arch/sh/src/common/up_usestack.c @@ -38,11 +38,15 @@ ****************************************************************************/ #include <nuttx/config.h> + #include <sys/types.h> +#include <stdint.h> #include <sched.h> #include <debug.h> + #include <nuttx/kmalloc.h> #include <nuttx/arch.h> + #include "up_internal.h" /**************************************************************************** @@ -99,7 +103,7 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size) * referenced as positive word offsets from sp. */ - top_of_stack = (uint32)tcb->stack_alloc_ptr + stack_size - 4; + top_of_stack = (uint32_t)tcb->stack_alloc_ptr + stack_size - 4; /* The Arm7Tdmi stack must be aligned at word (4 byte) * boundaries. If necessary top_of_stack must be rounded @@ -107,7 +111,7 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size) */ top_of_stack &= ~3; - size_of_stack = top_of_stack - (uint32)tcb->stack_alloc_ptr + 4; + size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4; /* Save the adjusted stack values in the _TCB */ |