diff --git a/arch/sh/include/m16c/irq.h b/arch/sh/include/m16c/irq.h index dc7a4369315e4831085350fe41e3def0fbb8cb63..ad7e43ad93cd09940a502732bcc5ebba685fd938 100644 --- a/arch/sh/include/m16c/irq.h +++ b/arch/sh/include/m16c/irq.h @@ -45,7 +45,7 @@ ************************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> /************************************************************************************ * Definitions @@ -249,13 +249,13 @@ struct xcptcontext /* These are saved copies of LR and SR used during signal processing. */ - ubyte saved_pc[2]; - ubyte saved_flg; + uint8_t saved_pc[2]; + uint8_t saved_flg; #endif /* Register save area */ - ubyte regs[XCPTCONTEXT_SIZE]; + uint8_t regs[XCPTCONTEXT_SIZE]; }; #endif diff --git a/arch/sh/include/sh1/irq.h b/arch/sh/include/sh1/irq.h index 26155864a937ca2c66842ea5fe58ffbe06435c93..5e21ecc6bf9b749f5def6b214797b889fb490235 100644 --- a/arch/sh/include/sh1/irq.h +++ b/arch/sh/include/sh1/irq.h @@ -1,7 +1,7 @@ /************************************************************************************ * arch/sh/include/sh1/irq.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 @@ -45,7 +45,7 @@ ************************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> /************************************************************************************ * Definitions @@ -264,7 +264,7 @@ * of the corresponding vector in the vector table. * * These offsets are specified as a vector number (suitably for indexing an array - * of uint32) but would have to by multiplied by 4 to get an addressable, byte + * of uint32_t) but would have to by multiplied by 4 to get an addressable, byte * offset. */ @@ -468,13 +468,13 @@ struct xcptcontext /* These are saved copies of LR and SR used during signal processing. */ - uint32 saved_pc; - uint32 saved_sr; + uint32_t saved_pc; + uint32_t saved_sr; #endif /* Register save area */ - uint32 regs[XCPTCONTEXT_REGS]; + uint32_t regs[XCPTCONTEXT_REGS]; }; #endif @@ -526,14 +526,14 @@ static inline irqstate_t irqsave(void) static inline void irqdisable(void) { - uint32 flags = __getsr(); + uint32_t flags = __getsr(); __setsr(flags | 0x000000f0); } /* Enable IRQs */ static inline void irqenable(void) { - uint32 flags = __getsr(); + uint32_t flags = __getsr(); __setsr(flags & ~0x000000f0); } diff --git a/arch/sh/src/common/up_arch.h b/arch/sh/src/common/up_arch.h index ae94c03f8363d46c4223fecfa328181d20058449..ddc66fb7601f85aa2d0be05c2275e8cd3e59bbcc 100644 --- a/arch/sh/src/common/up_arch.h +++ b/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/arch/sh/src/common/up_assert.c b/arch/sh/src/common/up_assert.c index 3cac6606ff9eaf775e93fe7f81178e6304e970bc..95b87af6fe3951f25f3e9c8ed5a58bccb11b75ef 100644 --- a/arch/sh/src/common/up_assert.c +++ b/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/arch/sh/src/common/up_blocktask.c b/arch/sh/src/common/up_blocktask.c index 547fd368fb8219bae479b4a1a6c7884dfb7c7833..dc8c1a1fa74cb06559132d031ed551b4fde4b86f 100644 --- a/arch/sh/src/common/up_blocktask.c +++ b/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/arch/sh/src/common/up_createstack.c b/arch/sh/src/common/up_createstack.c index 853601726f173fa47397d41e6858838420f56c54..35651fe863ea895071a87a192ec6b15d3b50c2f9 100644 --- a/arch/sh/src/common/up_createstack.c +++ b/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/arch/sh/src/common/up_doirq.c b/arch/sh/src/common/up_doirq.c index aa938be18b3acd24543efb645e2e986a07557528..33d33a05267bd13a82ea64af9cfcd945a44151fd 100644 --- a/arch/sh/src/common/up_doirq.c +++ b/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/arch/sh/src/common/up_exit.c b/arch/sh/src/common/up_exit.c index ede0483705cdcfc7e457f61485eb51f0aabd91d5..29213ce9d51b841db45a2b5b6523a16627822aa5 100644 --- a/arch/sh/src/common/up_exit.c +++ b/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/arch/sh/src/common/up_idle.c b/arch/sh/src/common/up_idle.c index a1a63dd4370e4c6028d9b7ff520d6fc4ee52254f..f95f019aec35bc3bdeb8652e7e13bb404034317c 100644 --- a/arch/sh/src/common/up_idle.c +++ b/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/arch/sh/src/common/up_initialize.c b/arch/sh/src/common/up_initialize.c index 114c8df98f5310991be8abc8ea895e9430f7aedb..1b4ceb8be0e905576aa94e92c4fc99a6e49ca0e7 100644 --- a/arch/sh/src/common/up_initialize.c +++ b/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/arch/sh/src/common/up_internal.h b/arch/sh/src/common/up_internal.h index 27205c239f9c17ff4304dcea5679d1c373be741e..7840caf66844d8a05a967c85fd8ca9db0b2e7430 100644 --- a/arch/sh/src/common/up_internal.h +++ b/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/arch/sh/src/common/up_interruptcontext.c b/arch/sh/src/common/up_interruptcontext.c index aa2720aa80d240a49e944b1f0edeceded92fcdab..16b443619e37fb1057ca14222ba33e15bedef97a 100644 --- a/arch/sh/src/common/up_interruptcontext.c +++ b/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/arch/sh/src/common/up_lowputs.c b/arch/sh/src/common/up_lowputs.c index 78ed1fef6f1ec578d1798c8aeda9e4c050b31e70..54438835d0ac719e8f42ff21a1b1a5d44e5b104b 100644 --- a/arch/sh/src/common/up_lowputs.c +++ b/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/arch/sh/src/common/up_puts.c b/arch/sh/src/common/up_puts.c index 2e6e22e481f038b3ab5c4bce62116d72d490fc34..d22b22e71474f9697740b7826fae7c4641d80be3 100644 --- a/arch/sh/src/common/up_puts.c +++ b/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/arch/sh/src/common/up_releasepending.c b/arch/sh/src/common/up_releasepending.c index ff5f17ccfef88b20af5d134072f600822efa4170..2f54e0249f44a533fbdc0257981942c2516f9b85 100644 --- a/arch/sh/src/common/up_releasepending.c +++ b/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/arch/sh/src/common/up_releasestack.c b/arch/sh/src/common/up_releasestack.c index 729d7791accee19514313ac509363ebfd99cad5e..b8c9fb8bbfd7f8ba6d864ccb72ddd7a9e5ba531c 100644 --- a/arch/sh/src/common/up_releasestack.c +++ b/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/arch/sh/src/common/up_reprioritizertr.c b/arch/sh/src/common/up_reprioritizertr.c index be465fd0a7a331f56d78769588ed295c6107763d..cc9d0ff474860baa491aa205af5f28c17705954d 100644 --- a/arch/sh/src/common/up_reprioritizertr.c +++ b/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/arch/sh/src/common/up_unblocktask.c b/arch/sh/src/common/up_unblocktask.c index c70549953a4cd6c66e290277fa67f35963e24452..6421c5619454bebd817542a9e02d7f5b8ab4d1b2 100644 --- a/arch/sh/src/common/up_unblocktask.c +++ b/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/arch/sh/src/common/up_usestack.c b/arch/sh/src/common/up_usestack.c index 226d5f52f773d546af326cf409df047b65212d20..6b472b8a2957ca1ef3651850da8ec73a08c3933b 100644 --- a/arch/sh/src/common/up_usestack.c +++ b/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 */ diff --git a/arch/sh/src/m16c/chip.h b/arch/sh/src/m16c/chip.h index 095bb688c58d473fc50ec4457354432a7cd6b86b..32d04b26e572c42c15f43ee0f06bd0fcb687e4c6 100644 --- a/arch/sh/src/m16c/chip.h +++ b/arch/sh/src/m16c/chip.h @@ -41,7 +41,9 @@ ************************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> +#ifndef __ASSEMBLY__ +# include <stdint.h> +#endif /************************************************************************************ * Definitions @@ -251,26 +253,26 @@ #ifndef __ASSEMBLY__ -extern uint16 g_snbss; /* Start of near .bss */ -extern uint16 g_enbss; /* End+1 of near .bss */ -extern uint16 g_sndata; /* Start of near .data */ -extern uint16 g_endata; /* End+1 of near .data */ -extern uint32 g_enronly; /* Start of relocated read-only data in FLASH */ +extern uint16_t g_snbss; /* Start of near .bss */ +extern uint16_t g_enbss; /* End+1 of near .bss */ +extern uint16_t g_sndata; /* Start of near .data */ +extern uint16_t g_endata; /* End+1 of near .data */ +extern uint32_t g_enronly; /* Start of relocated read-only data in FLASH */ #ifdef CONFIG_M16C_HAVEFARRAM - extern uint32 g_sfbss; /* Start of far .bss */ - extern uint32 g_efbss; /* End+1 of far .bss */ - extern uint32 g_sfdata; /* Start of far .data */ - extern uint32 g_efdata; /* End_1 of far .data */ - xtern uint32 g_efronly; /* Start of relocated read-only data in FLASH */ + extern uint32_t g_sfbss; /* Start of far .bss */ + extern uint32_t g_efbss; /* End+1 of far .bss */ + extern uint32_t g_sfdata; /* Start of far .data */ + extern uint32_t g_efdata; /* End_1 of far .data */ + extern uint32_t g_efronly; /* Start of relocated read-only data in FLASH */ #endif -extern uint32 g_svarvect; /* Start of variable vectors */ -extern uint32 g_heapbase; /* Start of the heap */ +extern uint32_t g_svarvect; /* Start of variable vectors */ +extern uint32_t g_heapbase; /* Start of the heap */ /* Address of the saved user stack pointer */ #ifndef __ASSEMBLY__ # if CONFIG_ARCH_INTERRUPTSTACK > 3 - extern uint16 g_userstack; + extern uint16_t g_userstack; # endif #endif diff --git a/arch/sh/src/m16c/m16c_copystate.c b/arch/sh/src/m16c/m16c_copystate.c index c74b576752cea116fc727abefdfaabf86b17c0ba..3c1748549b861edc4f335f9a7452fda89ae67f35 100644 --- a/arch/sh/src/m16c/m16c_copystate.c +++ b/arch/sh/src/m16c/m16c_copystate.c @@ -39,7 +39,7 @@ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> #include <string.h> #include "os_internal.h" @@ -67,7 +67,7 @@ /* A little faster than most memcpy's */ -void up_copystate(uint32 *dest, uint32 *src) +void up_copystate(uint32_t *dest, uint32_t *src) { memcpy(dest, src, XCPTCONTEXT_SIZE); } diff --git a/arch/sh/src/m16c/m16c_dumpstate.c b/arch/sh/src/m16c/m16c_dumpstate.c index 11bd990cd11d3cad847ecaa5ef90aa9e0ec085db..ff451e9b4dc3538de8cd3613968d2d5d062cda00 100755 --- a/arch/sh/src/m16c/m16c_dumpstate.c +++ b/arch/sh/src/m16c/m16c_dumpstate.c @@ -39,7 +39,7 @@ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> #include <debug.h> #include <nuttx/irq.h> @@ -77,9 +77,9 @@ * Name: m16c_getsp ****************************************************************************/ -static inline uint16 m16c_getsp(void) +static inline uint16_t) m16c_getsp(void) { - uint16 sp; + uint16_t) sp; __asm__ __volatile__ ( @@ -96,10 +96,10 @@ static inline uint16 m16c_getsp(void) ****************************************************************************/ #if CONFIG_ARCH_INTERRUPTSTACK > 3 -static inline uint16 m16c_getusersp(void) +static inline uint16_t) m16c_getusersp(void) { - ubyte *ptr = (ubyte*) current_regs; - return (uint16)ptr[REG_SP] << 8 | ptr[REG_SP+1]; + uint8_t *ptr = (uint8_t*) current_regs; + return (uint16_t))ptr[REG_SP] << 8 | ptr[REG_SP+1]; } #endif @@ -107,13 +107,13 @@ static inline uint16 m16c_getusersp(void) * Name: m16c_stackdump ****************************************************************************/ -static void m16c_stackdump(uint16 sp, uint16 stack_base) +static void m16c_stackdump(uint16_t) sp, uint16_t) stack_base) { - uint16 stack; + uint16_t) stack; for (stack = sp & ~7; stack < stack_base; stack += 8) { - ubyte *ptr = (ubyte*)stack; + uint8_t *ptr = (uint8_t*)stack; lldbg("%04x: %02x %02x %02x %02x %02x %02x %02x %02x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); } @@ -125,7 +125,7 @@ static void m16c_stackdump(uint16 sp, uint16 stack_base) static inline void m16c_registerdump(void) { - ubyte *ptr = (ubyte*) current_regs; + uint8_t *ptr = (uint8_t*) current_regs; /* Are user registers available from interrupt processing? */ @@ -159,12 +159,12 @@ static inline void m16c_registerdump(void) void up_dumpstate(void) { _TCB *rtcb = (_TCB*)g_readytorun.head; - uint16 sp = m16c_getsp(); - uint16 ustackbase; - uint16 ustacksize; + uint16_t) sp = m16c_getsp(); + uint16_t) ustackbase; + uint16_t) ustacksize; #if CONFIG_ARCH_INTERRUPTSTACK > 3 - uint16 istackbase; - uint16 istacksize; + uint16_t) istackbase; + uint16_t) istacksize; #endif /* Get the limits on the user stack memory */ @@ -176,8 +176,8 @@ void up_dumpstate(void) } else { - ustackbase = (uint16)rtcb->adj_stack_ptr; - ustacksize = (uint16)rtcb->adj_stack_size; + ustackbase = (uint16_t))rtcb->adj_stack_ptr; + ustacksize = (uint16_t))rtcb->adj_stack_size; } /* Get the limits on the interrupt stack memory. The near RAM memory map is as follows: diff --git a/arch/sh/src/m16c/m16c_initialstate.c b/arch/sh/src/m16c/m16c_initialstate.c index 1893672790a4164a82f8e066c4c949eb8b219be4..deb6dd304fed14b28afc58b486c4073168d26b6b 100644 --- a/arch/sh/src/m16c/m16c_initialstate.c +++ b/arch/sh/src/m16c/m16c_initialstate.c @@ -38,7 +38,8 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + +#include <stdint.h> #include <string.h> #include <nuttx/arch.h> @@ -79,7 +80,7 @@ void up_initial_state(FAR _TCB *tcb) { FAR struct xcptcontext *xcp = &tcb->xcp; - FAR ubyte *regs = xcp->regs; + FAR uint8_t *regs = xcp->regs; /* Initialize the initial exception register context structure */ @@ -87,7 +88,7 @@ void up_initial_state(FAR _TCB *tcb) /* Offset 0: FLG (bits 12-14) PC (bits 16-19) as would be present by an interrupt */ - *regs++ = ((M16C_DEFAULT_IPL << 4) | ((uint32)tcb->start >> 16)); + *regs++ = ((M16C_DEFAULT_IPL << 4) | ((uint32_t)tcb->start >> 16)); /* Offset 1: FLG (bits 0-7) */ @@ -99,12 +100,12 @@ void up_initial_state(FAR _TCB *tcb) /* Offset 2-3: 16-bit PC [0]:bits8-15 [1]:bits 0-7 */ - *regs++ = (uint32)tcb->start >> 8; /* Bits 8-15 of PC */ - *regs++ = (uint32)tcb->start; /* Bits 0-7 of PC */ + *regs++ = (uint32_t)tcb->start >> 8; /* Bits 8-15 of PC */ + *regs++ = (uint32_t)tcb->start; /* Bits 0-7 of PC */ /* Offset 18-20: User stack pointer */ regs = &xcp->regs[REG_SP]; - *regs++ = (uint32)tcb->adj_stack_ptr >> 8; /* Bits 8-15 of SP */ - *regs = (uint32)tcb->adj_stack_ptr; /* Bits 0-7 of SP */ + *regs++ = (uint32_t)tcb->adj_stack_ptr >> 8; /* Bits 8-15 of SP */ + *regs = (uint32_t)tcb->adj_stack_ptr; /* Bits 0-7 of SP */ } diff --git a/arch/sh/src/m16c/m16c_irq.c b/arch/sh/src/m16c/m16c_irq.c index beac525d4a54da92fe1da6efd10b550d3cb2d853..10e12941275ed0a764f99d08148d8c3b5e7c4640 100644 --- a/arch/sh/src/m16c/m16c_irq.c +++ b/arch/sh/src/m16c/m16c_irq.c @@ -39,7 +39,7 @@ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> #include <nuttx/arch.h> #include <nuttx/irq.h> @@ -57,7 +57,7 @@ * structure. If is non-NULL only during interrupt processing. */ -uint32 *current_regs; /* Actually a pointer to the beginning or a ubyte array */ +uint32_t *current_regs; /* Actually a pointer to the beginning of a uint8_t array */ /**************************************************************************** * Private Data diff --git a/arch/sh/src/m16c/m16c_lowputc.c b/arch/sh/src/m16c/m16c_lowputc.c index 43f9b1946ed49c63d488e44a2eeec87992ac28ce..b5d32d9151ae3f74850298dd2bd704e57aa46462 100644 --- a/arch/sh/src/m16c/m16c_lowputc.c +++ b/arch/sh/src/m16c/m16c_lowputc.c @@ -38,8 +38,8 @@ **************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> #include <nuttx/arch.h> #include "up_internal.h" @@ -221,7 +221,7 @@ static inline int up_txready(void) #if defined(HAVE_SERIALCONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) static inline void up_lowserialsetup(void) { - ubyte regval; + uint8_t regval; /* Set the baud rate generator */ @@ -282,7 +282,7 @@ static inline void up_lowserialsetup(void) /* Read any data left in the RX fifo */ - regval = (ubyte)getreg16(M16C_UART_BASE + M16C_UART_RB); + regval = (uint8_t)getreg16(M16C_UART_BASE + M16C_UART_RB); } #endif /* HAVE_SERIALCONFIG && !CONFIG_SUPPRESS_UART_CONFIG */ @@ -308,7 +308,7 @@ void up_lowputc(char ch) /* Write the data to the transmit buffer */ - putreg16((uint16)ch, M16C_UART_BASE + M16C_UART_TB); + putreg16((uint16_t))ch, M16C_UART_BASE + M16C_UART_TB); #endif } #endif diff --git a/arch/sh/src/m16c/m16c_schedulesigaction.c b/arch/sh/src/m16c/m16c_schedulesigaction.c index c62399b6f161a15f583381035d040ec0eef1c144..ae53e4ff5e38f7b8756287ebe5273684c00fd2e9 100644 --- a/arch/sh/src/m16c/m16c_schedulesigaction.c +++ b/arch/sh/src/m16c/m16c_schedulesigaction.c @@ -39,7 +39,7 @@ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> #include <sched.h> #include <debug.h> @@ -155,8 +155,8 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver) * disabled */ - current_regs[REG_PC] = (uint32)up_sigdeliver >> 8; - current_regs[REG_PC+1] = (uint32)up_sigdeliver; + current_regs[REG_PC] = (uint32_t)up_sigdeliver >> 8; + current_regs[REG_PC+1] = (uint32_t)up_sigdeliver; current_regs[REG_FLG] &= ~M16C_FLG_I; /* And make sure that the saved context in the TCB @@ -189,8 +189,8 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver) * disabled */ - tcb->xcp.regs[REG_PC] = (uint32)up_sigdeliver >> 8; - tcb->xcp.regs[REG_PC+1] = (uint32)up_sigdeliver; + tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver >> 8; + tcb->xcp.regs[REG_PC+1] = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_FLG] &= ~M16C_FLG_I; } diff --git a/arch/sh/src/m16c/m16c_serial.c b/arch/sh/src/m16c/m16c_serial.c index cefbbbf9bd5acec7ea3d62217a041692d230aa83..9f569ec166f0c2e03d8b79f1564d0e8d597950c1 100644 --- a/arch/sh/src/m16c/m16c_serial.c +++ b/arch/sh/src/m16c/m16c_serial.c @@ -38,12 +38,16 @@ ****************************************************************************/ #include <nuttx/config.h> + #include <sys/types.h> +#include <stdint.h> +#include <stdbool.h> #include <unistd.h> #include <semaphore.h> #include <string.h> #include <errno.h> #include <debug.h> + #include <nuttx/irq.h> #include <nuttx/arch.h> #include <nuttx/serial.h> @@ -243,37 +247,37 @@ elif !defined(CONFIG_UART1_DISABLE) struct up_dev_s { - uint32 baud; /* Configured baud */ - uint16 uartbase; /* Base address of UART registers */ - ubyte uartno; /* UART number */ - volatile ubyte ucon; /* Saved SCR value */ - volatile ubyte ssr; /* Saved SR value (only used during interrupt processing) */ - ubyte rcvirq; /* UART receive data available IRQ */ - ubyte xmtirq; /* UART transmit complete IRQ */ - ubyte enables; /* Bit 0: 1=RX enabled, Bit 1: 1=TX enabled */ - ubyte parity; /* 0=none, 1=odd, 2=even */ - ubyte bits; /* Number of bits (7 or 8) */ - boolean stopbits2; /* TRUE: Configure with 2 stop bits instead of 1 */ + uint32_t baud; /* Configured baud */ + uint16_t uartbase; /* Base address of UART registers */ + uint8_t uartno; /* UART number */ + volatile uint8_t ucon; /* Saved SCR value */ + volatile uint8_t ssr; /* Saved SR value (only used during interrupt processing) */ + uint8_t rcvirq; /* UART receive data available IRQ */ + uint8_t xmtirq; /* UART transmit complete IRQ */ + uint8_t enables; /* Bit 0: 1=RX enabled, Bit 1: 1=TX enabled */ + uint8_t parity; /* 0=none, 1=odd, 2=even */ + uint8_t bits; /* Number of bits (7 or 8) */ + bool stopbits2; /* true: Configure with 2 stop bits instead of 1 */ }; /**************************************************************************** * Private Function Prototypes ****************************************************************************/ -static int up_setup(struct uart_dev_s *dev); -static void up_shutdown(struct uart_dev_s *dev); -static int up_attach(struct uart_dev_s *dev); -static void up_detach(struct uart_dev_s *dev); -static int up_rcvinterrupt(int irq, void *context); -static int up_receive(struct uart_dev_s *dev, unsigned int *status); -static void m16c_rxint(struct up_dev_s *dev, boolean enable); -static void up_rxint(struct uart_dev_s *dev, boolean enable); -static boolean up_rxavailable(struct uart_dev_s *dev); -static int up_xmtinterrupt(int irq, void *context); -static void up_send(struct uart_dev_s *dev, int ch); -static void m16c_txint(struct up_dev_s *dev, boolean enable); -static void up_txint(struct uart_dev_s *dev, boolean enable); -static boolean up_txready(struct uart_dev_s *dev); +static int up_setup(struct uart_dev_s *dev); +static void up_shutdown(struct uart_dev_s *dev); +static int up_attach(struct uart_dev_s *dev); +static void up_detach(struct uart_dev_s *dev); +static int up_rcvinterrupt(int irq, void *context); +static int up_receive(struct uart_dev_s *dev, unsigned int *status); +static void m16c_rxint(struct up_dev_s *dev, bool enable); +static void up_rxint(struct uart_dev_s *dev, bool enable); +static bool up_rxavailable(struct uart_dev_s *dev); +static int up_xmtinterrupt(int irq, void *context); +static void up_send(struct uart_dev_s *dev, int ch); +static void m16c_txint(struct up_dev_s *dev, bool enable); +static void up_txint(struct uart_dev_s *dev, bool enable); +static bool up_txready(struct uart_dev_s *dev); /**************************************************************************** * Private Variables @@ -413,7 +417,7 @@ static uart_dev_t g_uart2port = * Name: up_serialin ****************************************************************************/ -static inline ubyte up_serialin(struct up_dev_s *priv, int offset) +static inline uint8_t up_serialin(struct up_dev_s *priv, int offset) { return getreg8(priv->uartbase + offset); } @@ -422,7 +426,7 @@ static inline ubyte up_serialin(struct up_dev_s *priv, int offset) * Name: up_serialin16 ****************************************************************************/ -static inline uint16 up_serialin16(struct up_dev_s *priv, int offset) +static inline uint16_t up_serialin16(struct up_dev_s *priv, int offset) { return getreg16(priv->uartbase + offset); } @@ -431,7 +435,7 @@ static inline uint16 up_serialin16(struct up_dev_s *priv, int offset) * Name: up_serialout ****************************************************************************/ -static inline void up_serialout(struct up_dev_s *priv, int offset, ubyte value) +static inline void up_serialout(struct up_dev_s *priv, int offset, uint8_t value) { putreg8(value, priv->uartbase + offset); } @@ -440,7 +444,7 @@ static inline void up_serialout(struct up_dev_s *priv, int offset, ubyte value) * Name: up_serialout16 ****************************************************************************/ -static inline void up_serialout16(struct up_dev_s *priv, int offset, uint16 value) +static inline void up_serialout16(struct up_dev_s *priv, int offset, uint16_t value) { putreg16(value, priv->uartbase + offset); } @@ -449,11 +453,11 @@ static inline void up_serialout16(struct up_dev_s *priv, int offset, uint16 valu * Name: up_disableuartint ****************************************************************************/ -static inline void up_disableuartint(struct up_dev_s *priv, ubyte *penables) +static inline void up_disableuartint(struct up_dev_s *priv, uint8_t *penables) { - ubyte enables = priv->enables; - m16c_txint(priv, FALSE); - m16c_rxint(priv, FALSE); + uint8_t enables = priv->enables; + m16c_txint(priv, false); + m16c_rxint(priv, false); if (enables) { @@ -465,7 +469,7 @@ static inline void up_disableuartint(struct up_dev_s *priv, ubyte *penables) * Name: up_restoreuartint ****************************************************************************/ -static inline void up_restoreuartint(struct up_dev_s *priv, ubyte enables) +static inline void up_restoreuartint(struct up_dev_s *priv, uint8_t enables) { m16c_rxint(priv, (enables & M16C_RXENABLED) != 0); m16c_txint(priv, (enables & M16C_TXENABLED) != 0); @@ -506,7 +510,7 @@ static inline void up_waittxready(struct up_dev_s *priv) static inline void ub_setbrg(struct up_dev_s *priv, unsigned int baud) { - uint16 brg; + uint16_t brg; /* The Bit Rate Generator (BRG) value can be calculated by: * @@ -519,7 +523,7 @@ static inline void ub_setbrg(struct up_dev_s *priv, unsigned int baud) * BRG = 20,000,000/1/16/19200 - 1 = 64 */ - brg = (M16C_XIN_FREQ / (16L * M16C_XIN_PRESCALER * (uint32)baud)) - 1; + brg = (M16C_XIN_FREQ / (16L * M16C_XIN_PRESCALER * (uint32_t)baud)) - 1; up_serialout(priv, M16C_UART_BRG, brg); } @@ -537,7 +541,7 @@ static int up_setup(struct uart_dev_s *dev) { #ifndef CONFIG_SUPPRESS_UART_CONFIG struct up_dev_s *priv = (struct up_dev_s*)dev->priv; - ubyte regval; + uint8_t regval; /* Set the baud rate generator */ @@ -549,8 +553,8 @@ static int up_setup(struct uart_dev_s *dev) /* Disable RX/TX interrupts */ - m16c_rxint(priv, FALSE); - m16c_txint(priv, FALSE); + m16c_rxint(priv, false); + m16c_txint(priv, false); /* Set interrupt cause=TX complete and continuous receive mode */ @@ -664,7 +668,7 @@ static int up_setup(struct uart_dev_s *dev) /* Read any data left in the RX fifo */ - regval = (ubyte)up_serialin16(priv, M16C_UART_RB); + regval = (uint8_t)up_serialin16(priv, M16C_UART_RB); #endif return OK; } @@ -806,7 +810,7 @@ static int up_rcvinterrupt(int irq, void *context) static int up_receive(struct uart_dev_s *dev, unsigned int *status) { struct up_dev_s *priv = (struct up_dev_s*)dev->priv; - uint16 rb; + uint16_t rb; /* Read the character from the readbuffer */ @@ -829,11 +833,11 @@ static int up_receive(struct uart_dev_s *dev, unsigned int *status) * ****************************************************************************/ -static void m16c_rxint(struct up_dev_s *dev, boolean enable) +static void m16c_rxint(struct up_dev_s *dev, bool enable) { irqstate_t flags; - uint16 regaddr; - ubyte regvalue; + uint16_t)_t regaddr; + uint8_t regvalue; /* Disable interrupts to prevent asynchronous accesses */ @@ -889,7 +893,7 @@ static void m16c_rxint(struct up_dev_s *dev, boolean enable) irqrestore(flags); } -static void up_rxint(struct uart_dev_s *dev, boolean enable) +static void up_rxint(struct uart_dev_s *dev, bool enable) { m16c_rxint((struct up_dev_s*)dev->priv, enable); } @@ -898,11 +902,11 @@ static void up_rxint(struct uart_dev_s *dev, boolean enable) * Name: up_rxavailable * * Description: - * Return TRUE if the RDR is not empty + * Return true if the RDR is not empty * ****************************************************************************/ -static boolean up_rxavailable(struct uart_dev_s *dev) +static bool up_rxavailable(struct uart_dev_s *dev) { struct up_dev_s *priv = (struct up_dev_s*)dev->priv; @@ -973,7 +977,7 @@ static void up_send(struct uart_dev_s *dev, int ch) /* Write the data to the transmit buffer */ - up_serialout16(priv, M16C_UART_TB, (uint16)ch); + up_serialout16(priv, M16C_UART_TB, (uint16_t)ch); } /**************************************************************************** @@ -984,11 +988,11 @@ static void up_send(struct uart_dev_s *dev, int ch) * ****************************************************************************/ -static void m16c_txint(struct up_dev_s *dev, boolean enable) +static void m16c_txint(struct up_dev_s *dev, bool enable) { irqstate_t flags; - uint16 regaddr; - ubyte regvalue; + uint16_t)_t regaddr; + uint8_t regvalue; /* Disable interrupts to prevent asynchronous accesses */ @@ -1044,7 +1048,7 @@ static void m16c_txint(struct up_dev_s *dev, boolean enable) irqrestore(flags); } -static void up_txint(struct uart_dev_s *dev, boolean enable) +static void up_txint(struct uart_dev_s *dev, bool enable) { m16c_txint((struct up_dev_s*)dev->priv, enable); } @@ -1053,11 +1057,11 @@ static void up_txint(struct uart_dev_s *dev, boolean enable) * Name: up_txready * * Description: - * Return TRUE if the TDR is empty + * Return true if the TDR is empty * ****************************************************************************/ -static boolean up_txready(struct uart_dev_s *dev) +static bool up_txready(struct uart_dev_s *dev) { struct up_dev_s *priv = (struct up_dev_s*)dev->priv; return ((up_serialin(priv, M16C_UART_C1) & UART_C1_TI) != 0); @@ -1098,7 +1102,7 @@ void up_earlyconsoleinit(void) /* Configuration whichever one is the console */ #ifdef HAVE_SERIALCONSOLE - CONSOLE_DEV.isconsole = TRUE; + CONSOLE_DEV.isconsole = true; up_setup(&CONSOLE_DEV); #endif } @@ -1145,7 +1149,7 @@ int up_putc(int ch) { #ifdef HAVE_SERIALCONSOLE struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; - ubyte ucon; + uint8_t ucon; up_disableuartint(priv, &ucon); @@ -1156,11 +1160,11 @@ int up_putc(int ch) /* Add CR */ up_waittxready(priv); - up_serialout16(priv, M16C_UART_TB, (uint16)'\r'); + up_serialout16(priv, M16C_UART_TB, (uint16_t)'\r'); } up_waittxready(priv); - up_serialout16(priv, M16C_UART_TB, (uint16)ch); + up_serialout16(priv, M16C_UART_TB, (uint16_t)ch); up_waittxready(priv); up_restoreuartint(priv, ucon); diff --git a/arch/sh/src/m16c/m16c_sigdeliver.c b/arch/sh/src/m16c/m16c_sigdeliver.c index 5505e2e485af652476ac24874bd325a9210fad12..4493c28b48f505fb291f6c1f4c304c85f8c95652 100644 --- a/arch/sh/src/m16c/m16c_sigdeliver.c +++ b/arch/sh/src/m16c/m16c_sigdeliver.c @@ -39,7 +39,7 @@ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> #include <sched.h> #include <debug.h> @@ -83,7 +83,7 @@ void up_sigdeliver(void) { #ifndef CONFIG_DISABLE_SIGNALS _TCB *rtcb = (_TCB*)g_readytorun.head; - ubyte regs[XCPTCONTEXT_SIZE]; + uint8_t regs[XCPTCONTEXT_SIZE]; sig_deliver_t sigdeliver; /* Save the errno. This must be preserved throughout the diff --git a/arch/sh/src/m16c/m16c_timer.h b/arch/sh/src/m16c/m16c_timer.h index ce8509e6610877272124225e37c9fa27564a6528..22cc31682808de8a5f7945980c5b28e54109a6c4 100644 --- a/arch/sh/src/m16c/m16c_timer.h +++ b/arch/sh/src/m16c/m16c_timer.h @@ -41,7 +41,6 @@ ************************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> /************************************************************************************ * Definitions diff --git a/arch/sh/src/m16c/m16c_timerisr.c b/arch/sh/src/m16c/m16c_timerisr.c index 3cc63271902ccda2b9a9227d0f0089ef0b318941..4a7493cd6d123bb81da50578d8133aea2c57e8e3 100644 --- a/arch/sh/src/m16c/m16c_timerisr.c +++ b/arch/sh/src/m16c/m16c_timerisr.c @@ -38,7 +38,8 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + +#include <stdint.h> #include <time.h> #include <debug.h> @@ -126,7 +127,7 @@ * ****************************************************************************/ -int up_timerisr(int irq, uint32 *regs) +int up_timerisr(int irq, uint32_t *regs) { /* Process timer interrupt */ diff --git a/arch/sh/src/m16c/m16c_uart.h b/arch/sh/src/m16c/m16c_uart.h index 8f9b1a005509ba8c422d225db6e14bda596c1284..38f41ac28a8130df32ce301602feb1a0118718a4 100644 --- a/arch/sh/src/m16c/m16c_uart.h +++ b/arch/sh/src/m16c/m16c_uart.h @@ -41,7 +41,6 @@ ************************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> /************************************************************************************ * Definitions diff --git a/arch/sh/src/m16c/m16c_vectors.S b/arch/sh/src/m16c/m16c_vectors.S index 17f47f560392e187e99702a9690544f3f8177b1e..a07b2ab015a2ad9e013a342c590c5f0520dab6da 100644 --- a/arch/sh/src/m16c/m16c_vectors.S +++ b/arch/sh/src/m16c/m16c_vectors.S @@ -389,7 +389,7 @@ _m16c_commonvector: reit /* Return from interrupt */ /************************************************************************************ - * Name: int up_saveusercontext(uint32 *regs) + * Name: int up_saveusercontext(uint32_t *regs) * * Description: * Save the context of the calling function at the point of the return from the @@ -456,7 +456,7 @@ _m16c_contextsave: .size _up_saveusercontext, .-_up_saveusercontext /************************************************************************************ - * Name: void up_fullcontextrestore(uint32 *regs) + * Name: void up_fullcontextrestore(uint32_t *regs) * * Description: * Restore the context of the using the provided register save array. diff --git a/arch/sh/src/sh1/chip.h b/arch/sh/src/sh1/chip.h index c10322a13a449eb6db95c89227be5821fc13c9fe..21204155f2c9f2268cead974008ee10edc57e0e6 100644 --- a/arch/sh/src/sh1/chip.h +++ b/arch/sh/src/sh1/chip.h @@ -1,7 +1,7 @@ /************************************************************************************ * arch/sh/src/sh1/chip.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 @@ -41,7 +41,7 @@ ************************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> #ifdef CONFIG_ARCH_SH7032 # include "sh1_703x.h" @@ -63,7 +63,7 @@ #ifndef __ASSEMBLY__ # if CONFIG_ARCH_INTERRUPTSTACK > 3 - extern uint32 g_userstack; + extern uint32_t g_userstack; # endif #endif diff --git a/arch/sh/src/sh1/sh1_703x.h b/arch/sh/src/sh1/sh1_703x.h index 160afac966a8601c2d23b36c3bdc0128131af99c..b79bbb0395e3d7a52c713cf3d538bf8b479e81ad 100644 --- a/arch/sh/src/sh1/sh1_703x.h +++ b/arch/sh/src/sh1/sh1_703x.h @@ -1,7 +1,7 @@ /************************************************************************************ * arch/sh/src/sh1/sh1_703x.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 @@ -41,7 +41,6 @@ ************************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> /************************************************************************************ * Definitions diff --git a/arch/sh/src/sh1/sh1_copystate.c b/arch/sh/src/sh1/sh1_copystate.c index 4449c04256ab9e339e6241e000d021181d1d40d5..3b0863eb7e704912403d6099060b01e74297ad74 100644 --- a/arch/sh/src/sh1/sh1_copystate.c +++ b/arch/sh/src/sh1/sh1_copystate.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/sh1/up_copystate.c * - * 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 @@ -39,7 +39,7 @@ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> #include "os_internal.h" #include "up_internal.h" @@ -66,7 +66,7 @@ /* A little faster than most memcpy's */ -void up_copystate(uint32 *dest, uint32 *src) +void up_copystate(uint32_t *dest, uint32_t *src) { int i; for (i = 0; i < XCPTCONTEXT_REGS; i++) diff --git a/arch/sh/src/sh1/sh1_dumpstate.c b/arch/sh/src/sh1/sh1_dumpstate.c index 55f998ccacd2f730178e620a2f749ecb4e4dbac9..cf6a16cbe255e7679b065c59ea1e0e5b649b50b5 100755 --- a/arch/sh/src/sh1/sh1_dumpstate.c +++ b/arch/sh/src/sh1/sh1_dumpstate.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/sh1/sh1_assert.c * - * 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 @@ -39,7 +39,7 @@ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> #include <debug.h> #include <nuttx/irq.h> @@ -76,9 +76,9 @@ * Name: sh1_getsp ****************************************************************************/ -static inline uint32 sh1_getsp(void) +static inline uint32_t sh1_getsp(void) { - uint32 sp; + uint32_t sp; __asm__ __volatile__ ( @@ -94,13 +94,13 @@ static inline uint32 sh1_getsp(void) * Name: sh1_stackdump ****************************************************************************/ -static void sh1_stackdump(uint32 sp, uint32 stack_base) +static void sh1_stackdump(uint32_t sp, uint32_t stack_base) { - uint32 stack ; + uint32_t stack ; for (stack = sp & ~0x1f; stack < stack_base; stack += 32) { - uint32 *ptr = (uint32*)stack; + uint32_t *ptr = (uint32_t*)stack; lldbg("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n", stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7]); @@ -113,7 +113,7 @@ static void sh1_stackdump(uint32 sp, uint32 stack_base) static inline void sh1_registerdump(void) { - uint32 *ptr = current_regs; + uint32_t *ptr = current_regs; /* Are user registers available from interrupt processing? */ @@ -147,13 +147,13 @@ static inline void sh1_registerdump(void) void up_dumpstate(void) { - _TCB *rtcb = (_TCB*)g_readytorun.head; - uint32 sp = sh1_getsp(); - uint32 ustackbase; - uint32 ustacksize; + _TCB *rtcb = (_TCB*)g_readytorun.head; + uint32_t sp = sh1_getsp(); + uint32_t ustackbase; + uint32_t ustacksize; #if CONFIG_ARCH_INTERRUPTSTACK > 3 - uint32 istackbase; - uint32 istacksize; + uint32_t istackbase; + uint32_t istacksize; #endif /* Get the limits on the user stack memory */ @@ -165,14 +165,14 @@ void up_dumpstate(void) } else { - ustackbase = (uint32)rtcb->adj_stack_ptr; - ustacksize = (uint32)rtcb->adj_stack_size; + ustackbase = (uint32_t)rtcb->adj_stack_ptr; + ustacksize = (uint32_t)rtcb->adj_stack_size; } /* Get the limits on the interrupt stack memory */ #if CONFIG_ARCH_INTERRUPTSTACK > 3 - istackbase = (uint32)&g_userstack; + istackbase = (uint32_t)&g_userstack; istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3) - 4; /* Show interrupt stack info */ diff --git a/arch/sh/src/sh1/sh1_initialstate.c b/arch/sh/src/sh1/sh1_initialstate.c index 8ad4290e148a198edec33eba37df99d3c7f4cd5e..692561e86bf57ec8b38b6feffcda7357fe58b953 100644 --- a/arch/sh/src/sh1/sh1_initialstate.c +++ b/arch/sh/src/sh1/sh1_initialstate.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/sh1/sh1_initialstate.c * - * 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 @@ -38,7 +38,7 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> #include <string.h> #include <nuttx/arch.h> #include "up_internal.h" @@ -99,8 +99,8 @@ void up_initial_state(_TCB *tcb) /* Initialize the initial exception register context structure */ memset(xcp, 0, sizeof(struct xcptcontext)); - xcp->regs[REG_SP] = (uint32)tcb->adj_stack_ptr; - xcp->regs[REG_PC] = (uint32)tcb->start; + xcp->regs[REG_SP] = (uint32_t)tcb->adj_stack_ptr; + xcp->regs[REG_PC] = (uint32_t)tcb->start; #ifdef CONFIG_SUPPRESS_INTERRUPTS xcp->regs[REG_SR] = up_getsr() | 0x000000f0; #else diff --git a/arch/sh/src/sh1/sh1_irq.c b/arch/sh/src/sh1/sh1_irq.c index 76c157f4f377f584801ffdffd8d77c43525acec2..c5b33cc3e7b8036b92e605dc8f9844ad9897e2e0 100644 --- a/arch/sh/src/sh1/sh1_irq.c +++ b/arch/sh/src/sh1/sh1_irq.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/sh1/sh1_irq.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 <errno.h> #include <debug.h> @@ -57,7 +57,7 @@ * Public Data ****************************************************************************/ -uint32 *current_regs; +uint32_t *current_regs; /**************************************************************************** * Private Data @@ -98,10 +98,10 @@ void up_irqinitialize(void) void up_prioritize_irq(int irq, int priority) { - uint16 mask; - uint16 reg16; - uint32 reg; - int shift; + uint16_t mask; + uint16_t reg16; + uint32_t reg; + int shift; #ifdef CONFIG_DEBUG if ((unsigned) irq > NR_IRQS || (unsigned)priority > 15) diff --git a/arch/sh/src/sh1/sh1_lowputc.c b/arch/sh/src/sh1/sh1_lowputc.c index 092093670c4dd2f87aeaf4a451032c3d61ecb12c..dd66c727b8f7ede4889057af6f7c33c9d92c3b07 100644 --- a/arch/sh/src/sh1/sh1_lowputc.c +++ b/arch/sh/src/sh1/sh1_lowputc.c @@ -1,7 +1,7 @@ /************************************************************************** * arch/sh/src/sh1/sh1_lowputc.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 <stdint.h> #include <nuttx/arch.h> #include "up_internal.h" @@ -197,7 +197,7 @@ static inline int up_txready(void) void up_lowputc(char ch) { #ifdef HAVE_CONSOLE - ubyte ssr; + uint8_t ssr; /* Wait until the TDR is avaible */ @@ -228,7 +228,7 @@ void up_lowputc(char ch) void up_lowsetup(void) { #if defined(HAVE_CONSOLE) && !defined(CONFIG_SUPPRESS_SCI_CONFIG) - ubyte scr; + uint8_t scr; /* Disable the transmitter and receiver */ diff --git a/arch/sh/src/sh1/sh1_schedulesigaction.c b/arch/sh/src/sh1/sh1_schedulesigaction.c index 3af182f37552e6fc0ed04e742679b739207cf0e6..6e7ba34e858d91b15447d1c483e884613aff974f 100644 --- a/arch/sh/src/sh1/sh1_schedulesigaction.c +++ b/arch/sh/src/sh1/sh1_schedulesigaction.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/sh1/sh1_schedulesigaction.c * - * 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 @@ -39,7 +39,7 @@ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> #include <sched.h> #include <debug.h> @@ -154,7 +154,7 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver) * disabled */ - current_regs[REG_PC] = (uint32)up_sigdeliver; + current_regs[REG_PC] = (uint32_t)up_sigdeliver; current_regs[REG_SR] |= 0x000000f0; /* And make sure that the saved context in the TCB @@ -186,7 +186,7 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver) * disabled */ - tcb->xcp.regs[REG_PC] = (uint32)up_sigdeliver; + tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver; tcb->xcp.regs[REG_SR] |= 0x000000f0 ; } diff --git a/arch/sh/src/sh1/sh1_serial.c b/arch/sh/src/sh1/sh1_serial.c index 0be2bc280f39afc93dfe73a10fcf266c7e547c28..69fda986a0b4b2a287b15433216c430664953a8a 100644 --- a/arch/sh/src/sh1/sh1_serial.c +++ b/arch/sh/src/sh1/sh1_serial.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/sh1/sh1_serial.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -38,12 +38,16 @@ ****************************************************************************/ #include <nuttx/config.h> + #include <sys/types.h> +#include <stdint.h> +#include <stdbool.h> #include <unistd.h> #include <semaphore.h> #include <string.h> #include <errno.h> #include <debug.h> + #include <nuttx/irq.h> #include <nuttx/arch.h> #include <nuttx/serial.h> @@ -137,31 +141,31 @@ struct up_dev_s { - uint32 scibase; /* Base address of SCI registers */ - uint32 baud; /* Configured baud */ - volatile ubyte scr; /* Saved SCR value */ - volatile ubyte ssr; /* Saved SR value (only used during interrupt processing) */ - ubyte irq; /* Base IRQ associated with this SCI */ - ubyte parity; /* 0=none, 1=odd, 2=even */ - ubyte bits; /* Number of bits (7 or 8) */ - boolean stopbits2; /* TRUE: Configure with 2 stop bits instead of 1 */ + uint32_t scibase; /* Base address of SCI registers */ + uint32_t baud; /* Configured baud */ + volatile uint8_t scr; /* Saved SCR value */ + volatile uint8_t ssr; /* Saved SR value (only used during interrupt processing) */ + uint8_t irq; /* Base IRQ associated with this SCI */ + uint8_t parity; /* 0=none, 1=odd, 2=even */ + uint8_t bits; /* Number of bits (7 or 8) */ + bool stopbits2; /* true: Configure with 2 stop bits instead of 1 */ }; /**************************************************************************** * Private Function Prototypes ****************************************************************************/ -static int up_setup(struct uart_dev_s *dev); -static void up_shutdown(struct uart_dev_s *dev); -static int up_attach(struct uart_dev_s *dev); -static void up_detach(struct uart_dev_s *dev); -static int up_interrupt(int irq, void *context); -static int up_receive(struct uart_dev_s *dev, uint32 *status); -static void up_rxint(struct uart_dev_s *dev, boolean enable); -static boolean up_rxavailable(struct uart_dev_s *dev); -static void up_send(struct uart_dev_s *dev, int ch); -static void up_txint(struct uart_dev_s *dev, boolean enable); -static boolean up_txready(struct uart_dev_s *dev); +static int up_setup(struct uart_dev_s *dev); +static void up_shutdown(struct uart_dev_s *dev); +static int up_attach(struct uart_dev_s *dev); +static void up_detach(struct uart_dev_s *dev); +static int up_interrupt(int irq, void *context); +static int up_receive(struct uart_dev_s *dev, uint32_t *status); +static void up_rxint(struct uart_dev_s *dev, bool enable); +static bool up_rxavailable(struct uart_dev_s *dev); +static void up_send(struct uart_dev_s *dev, int ch); +static void up_txint(struct uart_dev_s *dev, bool enable); +static bool up_txready(struct uart_dev_s *dev); /**************************************************************************** * Private Variables @@ -261,7 +265,7 @@ static uart_dev_t g_sci1port = * Name: up_serialin ****************************************************************************/ -static inline ubyte up_serialin(struct up_dev_s *priv, int offset) +static inline uint8_t up_serialin(struct up_dev_s *priv, int offset) { return getreg8(priv->scibase + offset); } @@ -270,7 +274,7 @@ static inline ubyte up_serialin(struct up_dev_s *priv, int offset) * Name: up_serialout ****************************************************************************/ -static inline void up_serialout(struct up_dev_s *priv, int offset, ubyte value) +static inline void up_serialout(struct up_dev_s *priv, int offset, uint8_t value) { putreg8(value, priv->scibase + offset); } @@ -279,7 +283,7 @@ static inline void up_serialout(struct up_dev_s *priv, int offset, ubyte value) * Name: up_disablesciint ****************************************************************************/ -static inline void up_disablesciint(struct up_dev_s *priv, ubyte *scr) +static inline void up_disablesciint(struct up_dev_s *priv, uint8_t *scr) { /* Return a copy of the current scr settings */ @@ -298,7 +302,7 @@ static inline void up_disablesciint(struct up_dev_s *priv, ubyte *scr) * Name: up_restoresciint ****************************************************************************/ -static inline void up_restoresciint(struct up_dev_s *priv, ubyte scr) +static inline void up_restoresciint(struct up_dev_s *priv, uint8_t scr) { /* Set the interrupt bits in the scr value */ @@ -368,8 +372,8 @@ static inline void up_setbrr(struct up_dev_s *priv, unsigned int baud) * = 32 */ - uint32 brr = ((((SH1_CLOCK + 16) / 32) + (baud >> 1)) / baud) - 1; - up_serialout(priv, SH1_SCI_BRR_OFFSET, (uint16)brr); + uint32_t brr = ((((SH1_CLOCK + 16) / 32) + (baud >> 1)) / baud) - 1; + up_serialout(priv, SH1_SCI_BRR_OFFSET, (uint16_t))brr); } /**************************************************************************** @@ -386,7 +390,7 @@ static int up_setup(struct uart_dev_s *dev) { #ifndef CONFIG_SUPPRESS_SCI_CONFIG struct up_dev_s *priv = (struct up_dev_s*)dev->priv; - ubyte smr; + uint8_t smr; /* Disable the transmitter and receiver */ @@ -651,8 +655,8 @@ static int up_interrupt(int irq, void *context) static int up_receive(struct uart_dev_s *dev, unsigned int *status) { struct up_dev_s *priv = (struct up_dev_s*)dev->priv; - ubyte rdr; - ubyte ssr; + uint8_t rdr; + uint8_t ssr; /* Read the character from the RDR port */ @@ -668,7 +672,7 @@ static int up_receive(struct uart_dev_s *dev, unsigned int *status) /* For status, return the SSR at the time that the interrupt was received */ - *status = (uint32)priv->ssr << 8 | rdr; + *status = (uint32_t)priv->ssr << 8 | rdr; /* Return the received character */ @@ -683,7 +687,7 @@ static int up_receive(struct uart_dev_s *dev, unsigned int *status) * ****************************************************************************/ -static void up_rxint(struct uart_dev_s *dev, boolean enable) +static void up_rxint(struct uart_dev_s *dev, bool enable) { struct up_dev_s *priv = (struct up_dev_s*)dev->priv; irqstate_t flags; @@ -719,11 +723,11 @@ static void up_rxint(struct uart_dev_s *dev, boolean enable) * Name: up_rxavailable * * Description: - * Return TRUE if the RDR is not empty + * Return true if the RDR is not empty * ****************************************************************************/ -static boolean up_rxavailable(struct uart_dev_s *dev) +static bool up_rxavailable(struct uart_dev_s *dev) { /* Return true if the RDR full bit is set in the SSR */ @@ -742,11 +746,11 @@ static boolean up_rxavailable(struct uart_dev_s *dev) static void up_send(struct uart_dev_s *dev, int ch) { struct up_dev_s *priv = (struct up_dev_s*)dev->priv; - ubyte ssr; + uint8_t ssr; /* Write the data to the TDR */ - up_serialout(priv, SH1_SCI_TDR_OFFSET, (ubyte)ch); + up_serialout(priv, SH1_SCI_TDR_OFFSET, (uint8_t)ch); /* Clear the TDRE bit in the SSR */ @@ -763,7 +767,7 @@ static void up_send(struct uart_dev_s *dev, int ch) * ****************************************************************************/ -static void up_txint(struct uart_dev_s *dev, boolean enable) +static void up_txint(struct uart_dev_s *dev, bool enable) { struct up_dev_s *priv = (struct up_dev_s*)dev->priv; irqstate_t flags; @@ -814,11 +818,11 @@ static void up_txint(struct uart_dev_s *dev, boolean enable) * Name: up_txready * * Description: - * Return TRUE if the TDR is empty + * Return true if the TDR is empty * ****************************************************************************/ -static boolean up_txready(struct uart_dev_s *dev) +static bool up_txready(struct uart_dev_s *dev) { struct up_dev_s *priv = (struct up_dev_s*)dev->priv; return (up_serialin(priv, SH1_SCI_SSR_OFFSET) & SH1_SCISSR_TDRE) != 0; @@ -856,7 +860,7 @@ void up_earlyconsoleinit(void) /* Configuration whichever one is the console */ #ifdef HAVE_CONSOLE - CONSOLE_DEV.isconsole = TRUE; + CONSOLE_DEV.isconsole = true; up_setup(&CONSOLE_DEV); #endif } @@ -900,7 +904,7 @@ int up_putc(int ch) { #ifdef HAVE_CONSOLE struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; - ubyte scr; + uint8_t scr; up_disablesciint(priv, &scr); @@ -915,7 +919,7 @@ int up_putc(int ch) } up_waittxready(priv); - up_serialout(priv, SH1_SCI_TDR_OFFSET, (ubyte)ch); + up_serialout(priv, SH1_SCI_TDR_OFFSET, (uint8_t)ch); up_waittxready(priv); up_restoresciint(priv, scr); diff --git a/arch/sh/src/sh1/sh1_sigdeliver.c b/arch/sh/src/sh1/sh1_sigdeliver.c index 91e9163fff82220ee0b749258ece8d68a13f43d4..cddec60415cface0149a68221be36ac0058b016e 100644 --- a/arch/sh/src/sh1/sh1_sigdeliver.c +++ b/arch/sh/src/sh1/sh1_sigdeliver.c @@ -1,7 +1,7 @@ /**************************************************************************** * common/up_sigdeliver.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 <sched.h> #include <debug.h> @@ -83,7 +83,7 @@ void up_sigdeliver(void) { #ifndef CONFIG_DISABLE_SIGNALS _TCB *rtcb = (_TCB*)g_readytorun.head; - uint32 regs[XCPTCONTEXT_REGS]; + uint32_t regs[XCPTCONTEXT_REGS]; sig_deliver_t sigdeliver; /* Save the errno. This must be preserved throughout the diff --git a/arch/sh/src/sh1/sh1_timerisr.c b/arch/sh/src/sh1/sh1_timerisr.c index f29c141eba6297e9fac05521d6a3ae9fa0284dd8..7072c4c643f51b7929bddee4a77e46996d895c96 100644 --- a/arch/sh/src/sh1/sh1_timerisr.c +++ b/arch/sh/src/sh1/sh1_timerisr.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/sh1/sh1_timerisr.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 <stdint.h> #include <time.h> #include <debug.h> + #include <nuttx/arch.h> #include <arch/board/board.h> @@ -131,9 +133,9 @@ * ****************************************************************************/ -int up_timerisr(int irq, uint32 *regs) +int up_timerisr(int irq, uint32_t *regs) { - ubyte reg8; + uint8_t reg8; /* Process timer interrupt */ @@ -159,7 +161,7 @@ int up_timerisr(int irq, uint32 *regs) void up_timerinit(void) { - ubyte reg8; + uint8_t reg8; /* Clear timer counter 0 */