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@2354 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2009-12-16 14:15:34 +00:00
parent 3ff1175885
commit 8561ce102a
65 changed files with 2048 additions and 2011 deletions

View File

@ -2,7 +2,7 @@
* arch/z80/include/ez80/io.h * arch/z80/include/ez80/io.h
* arch/chip/io.h * arch/chip/io.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -45,7 +45,7 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <sys/types.h> #include <stdint.h>
/**************************************************************************** /****************************************************************************
* Definitions * Definitions
@ -75,8 +75,8 @@ extern "C" {
#define EXTERN extern #define EXTERN extern
#endif #endif
EXTERN void outp(uint16 p, ubyte c); EXTERN void outp(uint16_t p, uint8_t c);
EXTERN ubyte inp(uint16 p); EXTERN uint8_t inp(uint16_t p);
#undef EXTERN #undef EXTERN
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -2,7 +2,7 @@
* arch/ez80/include/ez80/irq.h * arch/ez80/include/ez80/irq.h
* arch/chip/irq.h * arch/chip/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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -49,6 +49,10 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/**************************************************************************** /****************************************************************************
* Definitions * Definitions
****************************************************************************/ ****************************************************************************/

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/serial.h * arch/serial.h
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View File

@ -2,7 +2,7 @@
* arch/z8/include/z8/irq.h * arch/z8/include/z8/irq.h
* arch/chip/irq.h * arch/chip/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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -45,6 +45,10 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/**************************************************************************** /****************************************************************************
* Definitions * Definitions
****************************************************************************/ ****************************************************************************/
@ -321,12 +325,12 @@ struct xcptcontext
*/ */
#ifndef CONFIG_DISABLE_SIGNALS #ifndef CONFIG_DISABLE_SIGNALS
CODE void *sigdeliver; /* Actual type is sig_deliver_t */ CODE void *sigdeliver; /* Actual type is sig_deliver_t */
/* The following retains that state during signal execution */ /* The following retains that state during signal execution */
uint16 saved_pc; /* Saved return address */ uint16_t saved_pc; /* Saved return address */
uint16 saved_irqctl; /* Saved interrupt state */ uint16_t saved_irqctl; /* Saved interrupt state */
#endif #endif
}; };
#endif #endif

View File

@ -2,7 +2,7 @@
* arch/z80/include/z80/io.h * arch/z80/include/z80/io.h
* arch/chip/io.h * arch/chip/io.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View File

@ -2,7 +2,7 @@
* arch/z80/include/z80/irq.h * arch/z80/include/z80/irq.h
* arch/chip/irq.h * arch/chip/irq.h
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -45,6 +45,10 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/**************************************************************************** /****************************************************************************
* Definitions * Definitions
****************************************************************************/ ****************************************************************************/
@ -109,8 +113,8 @@ struct xcptcontext
/* The following retains that state during signal execution */ /* The following retains that state during signal execution */
uint16 saved_pc; /* Saved return address */ uint16_t saved_pc; /* Saved return address */
uint16 saved_i; /* Saved interrupt state */ uint16_t saved_i; /* Saved interrupt state */
#endif #endif
}; };
#endif #endif

View File

@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* common/up_arch.h * common/up_arch.h
* *
* Copyright (C) 2007 Gregory Nutt. All rights reserved. * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * 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 * notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the * the documentation and/or other materials provided with the
* distribution. * 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 * used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
@ -41,9 +41,6 @@
************************************************************************************/ ************************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#ifndef __ASSEMBLY__
# include <sys/types.h>
#endif
#include <arch/board/board.h> #include <arch/board/board.h>
#include "chip/chip.h" #include "chip/chip.h"

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* common/up_assert.c * common/up_assert.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
#include <debug.h> #include <debug.h>
@ -109,7 +109,7 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_HAVE_FILENAME #ifdef CONFIG_HAVE_FILENAME
void up_assert(const ubyte *filename, int lineno) void up_assert(const uint8_t *filename, int lineno)
#else #else
void up_assert(void) void up_assert(void)
#endif #endif
@ -146,7 +146,7 @@ void up_assert(void)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_HAVE_FILENAME #ifdef CONFIG_HAVE_FILENAME
void up_assert_code(const ubyte *filename, int lineno, int errorcode) void up_assert_code(const uint8_t *filename, int lineno, int errorcode)
#else #else
void up_assert_code(int errorcode) void up_assert_code(int errorcode)
#endif #endif

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/common/up_blocktask.c * arch/z80/src/common/up_blocktask.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdbool.h>
#include <sched.h> #include <sched.h>
#include <debug.h> #include <debug.h>
@ -97,7 +97,7 @@ void up_block_task(FAR _TCB *tcb, tstate_t task_state)
else else
{ {
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head; FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
boolean switch_needed; bool switch_needed;
/* dbg("Blocking TCB=%p\n", tcb); */ /* dbg("Blocking TCB=%p\n", tcb); */

View File

@ -38,11 +38,14 @@
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <sys/types.h>
#include <stdint.h>
#include <sched.h> #include <sched.h>
#include <debug.h> #include <debug.h>
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include "up_arch.h" #include "up_arch.h"
#include "up_internal.h" #include "up_internal.h"
@ -90,7 +93,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
if (!tcb->stack_alloc_ptr) 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) if (tcb->stack_alloc_ptr)
@ -105,7 +108,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
* referenced as positive word offsets from sp. * 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) /* The Arm7Tdmi stack must be aligned at word (4 byte)
* boundaries. If necessary top_of_stack must be rounded * boundaries. If necessary top_of_stack must be rounded
@ -113,11 +116,11 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
*/ */
top_of_stack &= ~3; 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 */ /* 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; tcb->adj_stack_size = size_of_stack;
up_ledon(LED_STACKCREATED); up_ledon(LED_STACKCREATED);

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/common/up_doirq.c * arch/z80/src/common/up_doirq.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <assert.h> #include <assert.h>
#include "up_arch.h" #include "up_arch.h"
@ -70,7 +70,7 @@
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/
FAR chipreg_t *up_doirq(ubyte irq, FAR chipreg_t *regs) FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs)
{ {
up_ledon(LED_INIRQ); up_ledon(LED_INIRQ);

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* common/up_exit.c * common/up_exit.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <sched.h> #include <sched.h>
#include <debug.h> #include <debug.h>

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* common/up_idle.c * common/up_idle.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <arch/board/board.h> #include <arch/board/board.h>
@ -55,7 +55,7 @@
****************************************************************************/ ****************************************************************************/
#if defined(CONFIG_ARCH_LEDS) && defined(CONFIG_ARCH_BRINGUP) #if defined(CONFIG_ARCH_LEDS) && defined(CONFIG_ARCH_BRINGUP)
static ubyte g_ledtoggle = 0; static uint8_t g_ledtoggle = 0;
#endif #endif
/**************************************************************************** /****************************************************************************

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/common/up_initialize.c * arch/z80/src/common/up_initialize.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <debug.h> #include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/common/up_internal.h * arch/z80/src/common/up_internal.h
* *
* Copyright (C) 2007, 2008, 2009 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -55,6 +55,9 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <stdint.h>
#include <stdbool.h>
#include <arch/irq.h> #include <arch/irq.h>
#include "chip/chip.h" #include "chip/chip.h"
#include "chip/switch.h" #include "chip/switch.h"
@ -108,7 +111,7 @@ EXTERN void up_lowuartinit(void);
/* Defined in up_doirq.c */ /* Defined in up_doirq.c */
EXTERN FAR chipreg_t *up_doirq(ubyte irq, FAR chipreg_t *regs); EXTERN FAR chipreg_t *up_doirq(uint8_t irq, FAR chipreg_t *regs);
/* Define in up_sigdeliver */ /* Define in up_sigdeliver */
@ -168,7 +171,7 @@ EXTERN void up_timerhook(void);
EXTERN int up_netinitialize(void); EXTERN int up_netinitialize(void);
EXTERN void up_netuninitialize(void); EXTERN void up_netuninitialize(void);
# ifdef CONFIG_ARCH_MCFILTER # ifdef CONFIG_ARCH_MCFILTER
EXTERN int up_multicastfilter(FAR struct uip_driver_s *dev, FAR ubyte *mac, boolean enable); EXTERN int up_multicastfilter(FAR struct uip_driver_s *dev, FAR uint8_t *mac, bool enable);
# else # else
# define up_multicastfilter(dev, mac, enable) # define up_multicastfilter(dev, mac, enable)
# endif # endif
@ -180,7 +183,7 @@ EXTERN int up_multicastfilter(FAR struct uip_driver_s *dev, FAR ubyte *mac, bool
/* Return the current value of the stack pointer (used in stack dump logic) */ /* Return the current value of the stack pointer (used in stack dump logic) */
EXTERN uint16 up_getsp(void); EXTERN uint16_t up_getsp(void);
/* Dump stack and registers */ /* Dump stack and registers */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/common/up_interruptcontext.c * arch/z80/src/common/up_interruptcontext.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdbool.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/irq.h> #include <nuttx/irq.h>
@ -62,11 +62,11 @@
/**************************************************************************** /****************************************************************************
* Name: up_interrupt_context * 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. * the interrupt handler context.
****************************************************************************/ ****************************************************************************/
boolean up_interrupt_context(void) bool up_interrupt_context(void)
{ {
return IN_INTERRUPT(); return IN_INTERRUPT();
} }

View File

@ -38,7 +38,6 @@
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include "up_internal.h" #include "up_internal.h"

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/common/up_releasepending.c * arch/z80/src/common/up_releasepending.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <sched.h> #include <sched.h>
#include <debug.h> #include <debug.h>

View File

@ -1,7 +1,7 @@
/************************************************************ /************************************************************
* common/up_releasestack.c * common/up_releasestack.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -38,10 +38,11 @@
************************************************************/ ************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <sched.h> #include <sched.h>
#include <debug.h> #include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include "os_internal.h" #include "os_internal.h"
#include "up_internal.h" #include "up_internal.h"

View File

@ -39,7 +39,8 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <stdbool.h>
#include <sched.h> #include <sched.h>
#include <debug.h> #include <debug.h>
@ -86,7 +87,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 */ /* Verify that the caller is sane */
@ -100,12 +101,12 @@ void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority)
else else
{ {
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head; FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
boolean switch_needed; bool switch_needed;
slldbg("TCB=%p PRI=%d\n", tcb, priority); slldbg("TCB=%p PRI=%d\n", tcb, priority);
/* Remove the tcb task from the ready-to-run list. /* 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. * remove the head of the ready to run list.
*/ */
@ -113,10 +114,10 @@ void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority)
/* Setup up the new task 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. /* 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 * 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 * 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 * (i.e., one and only one the calls changes the head of the

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* common/up_stackdump.c * common/up_stackdump.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <debug.h> #include <debug.h>
#include "up_arch.h" #include "up_arch.h"
@ -80,9 +80,9 @@
static void up_stackdump(void) static void up_stackdump(void)
{ {
_TCB *rtcb = (_TCB*)g_readytorun.head; _TCB *rtcb = (_TCB*)g_readytorun.head;
uint16 sp = up_getsp(); uint16_t) sp = up_getsp();
uint16 stack_base = (uint16)rtcb->adj_stack_ptr; uint16_t) stack_base = (uint16_t))rtcb->adj_stack_ptr;
uint16 stack_size = (uint16)rtcb->adj_stack_size; uint16_t) stack_size = (uint16_t))rtcb->adj_stack_size;
lldbg("stack_base: %04x\n", stack_base); lldbg("stack_base: %04x\n", stack_base);
lldbg("stack_size: %04x\n", stack_size); lldbg("stack_size: %04x\n", stack_size);
@ -95,11 +95,11 @@ static void up_stackdump(void)
} }
else else
{ {
uint16 stack = sp & ~0x0f; uint16_t) stack = sp & ~0x0f;
for (stack = sp & ~0x0f; stack < stack_base; stack += 8*sizeof(uint16)) for (stack = sp & ~0x0f; stack < stack_base; stack += 8*sizeof(uint16_t)))
{ {
uint16 *ptr = (uint16*)stack; uint16_t) *ptr = (uint16_t)*)stack;
lldbg("%04x: %04x %04x %04x %04x %04x %04x %04x %04x\n", lldbg("%04x: %04x %04x %04x %04x %04x %04x %04x %04x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3], stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]); ptr[4], ptr[5], ptr[6], ptr[7]);

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/common/up_unblocktask.c * arch/z80/src/common/up_unblocktask.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <sched.h> #include <sched.h>
#include <debug.h> #include <debug.h>

View File

@ -38,11 +38,14 @@
************************************************************/ ************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <sys/types.h>
#include <stdint.h>
#include <sched.h> #include <sched.h>
#include <debug.h> #include <debug.h>
#include <nuttx/kmalloc.h> #include <nuttx/kmalloc.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include "up_internal.h" #include "up_internal.h"
/************************************************************ /************************************************************
@ -99,7 +102,7 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
* referenced as positive word offsets from sp. * 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) /* The Arm7Tdmi stack must be aligned at word (4 byte)
* boundaries. If necessary top_of_stack must be rounded * boundaries. If necessary top_of_stack must be rounded
@ -107,7 +110,7 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
*/ */
top_of_stack &= ~3; 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 */ /* Save the adjusted stack values in the _TCB */

View File

@ -2,7 +2,7 @@
* arch/z80/src/ez80/chip.h * arch/z80/src/ez80/chip.h
* arch/z80/src/chip/chip.h * arch/z80/src/chip/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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,6 +41,10 @@
* Included Files * Included Files
************************************************************************************/ ************************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/************************************************************************************ /************************************************************************************
* Definitions * Definitions
************************************************************************************/ ************************************************************************************/
@ -78,7 +82,7 @@ extern "C" {
#define EXTERN extern #define EXTERN extern
#endif #endif
EXTERN uint32 ez80_systemclock; EXTERN uint32_t ez80_systemclock;
/************************************************************************************ /************************************************************************************
* Public Function Prototypes * Public Function Prototypes

View File

@ -38,7 +38,7 @@
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include "arch/board/board.h" #include "arch/board/board.h"
@ -54,7 +54,7 @@
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
uint32 ez80_systemclock = EZ80_SYS_CLK_FREQ; uint32_t ez80_systemclock = EZ80_SYS_CLK_FREQ;
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/ez80/ez80_copystate.c * arch/z80/src/ez80/ez80_copystate.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <arch/irq.h> #include <arch/irq.h>
#include "chip/switch.h" #include "chip/switch.h"

View File

@ -43,6 +43,8 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#if defined(CONFIG_NET) && defined(CONFIG_EZ80_EMAC) #if defined(CONFIG_NET) && defined(CONFIG_EZ80_EMAC)
#include <stdint.h>
#include <stdbool.h>
#include <time.h> #include <time.h>
#include <string.h> #include <string.h>
#include <debug.h> #include <debug.h>
@ -242,21 +244,21 @@
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_NET) #if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_NET)
struct ez80mac_statistics_s struct ez80mac_statistics_s
{ {
uint32 rx_int; /* Number of Rx interrupts received */ uint32_t rx_int; /* Number of Rx interrupts received */
uint32 rx_packets; /* Number of packets received (sum of the following): */ uint32_t rx_packets; /* Number of packets received (sum of the following): */
uint32 rx_ip; /* Number of Rx IP packets received */ uint32_t rx_ip; /* Number of Rx IP packets received */
uint32 rx_arp; /* Number of Rx ARP packets received */ uint32_t rx_arp; /* Number of Rx ARP packets received */
uint32 rx_dropped; /* Number of dropped, unsupported Rx packets */ uint32_t rx_dropped; /* Number of dropped, unsupported Rx packets */
uint32 rx_nok; /* Number of Rx packets received without OK bit */ uint32_t rx_nok; /* Number of Rx packets received without OK bit */
uint32 rx_errors; /* Number of Rx errors (rx_overerrors + rx_nok) */ uint32_t rx_errors; /* Number of Rx errors (rx_overerrors + rx_nok) */
uint32 rx_ovrerrors; /* Number of FIFO overrun errors */ uint32_t rx_ovrerrors; /* Number of FIFO overrun errors */
uint32 tx_int; /* Number of Tx interrupts received */ uint32_t tx_int; /* Number of Tx interrupts received */
uint32 tx_packets; /* Number of Tx descriptors queued */ uint32_t tx_packets; /* Number of Tx descriptors queued */
uint32 tx_errors; /* Number of Tx errors (sum of the following) */ uint32_t tx_errors; /* Number of Tx errors (sum of the following) */
uint32 tx_abterrors; /* Number of aborted Tx descriptors */ uint32_t tx_abterrors; /* Number of aborted Tx descriptors */
uint32 tx_fsmerrors; /* Number of Tx state machine errors */ uint32_t tx_fsmerrors; /* Number of Tx state machine errors */
uint32 tx_timeouts; /* Number of Tx timeout errors */ uint32_t tx_timeouts; /* Number of Tx timeout errors */
uint32 sys_int; /* Number of system interrupts received */ uint32_t sys_int; /* Number of system interrupts received */
}; };
# define _MKFIELD(a,b,c) a->b##c # define _MKFIELD(a,b,c) a->b##c
# define EMAC_STAT(priv,name) _MKFIELD(priv,stat.,name)++ # define EMAC_STAT(priv,name) _MKFIELD(priv,stat.,name)++
@ -303,10 +305,10 @@ struct ez80emac_driver_s
FAR struct ez80emac_desc_s *rxnext; FAR struct ez80emac_desc_s *rxnext;
FAR struct ez80emac_desc_s *rxendp1; FAR struct ez80emac_desc_s *rxendp1;
boolean bifup; /* TRUE:ifup FALSE:ifdown */ bool bifup; /* true:ifup false:ifdown */
boolean blinkok; /* TRUE:successful MII autonegotiation */ bool blinkok; /* true:successful MII autonegotiation */
boolean bfullduplex; /* TRUE:full duplex */ bool bfullduplex; /* true:full duplex */
boolean b100mbs; /* TRUE:100Mbp */ bool b100mbs; /* true:100Mbp */
WDOG_ID txpoll; /* TX poll timer */ WDOG_ID txpoll; /* TX poll timer */
WDOG_ID txtimeout; /* TX timeout timer */ WDOG_ID txtimeout; /* TX timeout timer */
@ -336,49 +338,49 @@ static struct ez80emac_driver_s g_emac;
/* MII logic */ /* MII logic */
static void ez80emac_waitmiibusy(void); static void ez80emac_waitmiibusy(void);
static void ez80emac_miiwrite(FAR struct ez80emac_driver_s *priv, ubyte offset, static void ez80emac_miiwrite(FAR struct ez80emac_driver_s *priv, uint8_t offset,
uint16 value); uint16_t value);
static uint16 ez80emac_miiread(FAR struct ez80emac_driver_s *priv, uint32 offset); static uint16_t ez80emac_miiread(FAR struct ez80emac_driver_s *priv, uint32_t offset);
static boolean ez80emac_miipoll(FAR struct ez80emac_driver_s *priv, uint32 offset, static bool ez80emac_miipoll(FAR struct ez80emac_driver_s *priv, uint32_t offset,
uint16 bits, boolean bclear); uint16_t bits, bool bclear);
static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv); static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv);
/* Multi-cast filtering */ /* Multi-cast filtering */
#ifdef CONFIG_EZ80_MCFILTER #ifdef CONFIG_EZ80_MCFILTER
static void ez80emac_machash(FAR ubyte *mac, int *ndx, int *bitno) static void ez80emac_machash(FAR uint8_t *mac, int *ndx, int *bitno)
#endif #endif
/* TX/RX logic */ /* TX/RX logic */
static int ez80emac_transmit(struct ez80emac_driver_s *priv); static int ez80emac_transmit(struct ez80emac_driver_s *priv);
static int ez80emac_uiptxpoll(struct uip_driver_s *dev); static int ez80emac_uiptxpoll(struct uip_driver_s *dev);
static inline FAR struct ez80emac_desc_s *ez80emac_rwp(void); static inline FAR struct ez80emac_desc_s *ez80emac_rwp(void);
static inline FAR struct ez80emac_desc_s *ez80emac_rrp(void); static inline FAR struct ez80emac_desc_s *ez80emac_rrp(void);
static int ez80emac_receive(struct ez80emac_driver_s *priv); static int ez80emac_receive(struct ez80emac_driver_s *priv);
/* Interrupt handling */ /* Interrupt handling */
static int ez80emac_txinterrupt(int irq, FAR void *context); static int ez80emac_txinterrupt(int irq, FAR void *context);
static int ez80emac_rxinterrupt(int irq, FAR void *context); static int ez80emac_rxinterrupt(int irq, FAR void *context);
static int ez80emac_sysinterrupt(int irq, FAR void *context); static int ez80emac_sysinterrupt(int irq, FAR void *context);
/* Watchdog timer expirations */ /* Watchdog timer expirations */
static void ez80emac_polltimer(int argc, uint32 arg, ...); static void ez80emac_polltimer(int argc, uint32_t arg, ...);
static void ez80emac_txtimeout(int argc, uint32 arg, ...); static void ez80emac_txtimeout(int argc, uint32_t arg, ...);
/* NuttX callback functions */ /* NuttX callback functions */
static int ez80emac_ifup(struct uip_driver_s *dev); static int ez80emac_ifup(struct uip_driver_s *dev);
static int ez80emac_ifdown(struct uip_driver_s *dev); static int ez80emac_ifdown(struct uip_driver_s *dev);
static int ez80emac_txavail(struct uip_driver_s *dev); static int ez80emac_txavail(struct uip_driver_s *dev);
/* Initialization */ /* Initialization */
static int ez80_emacinitialize(void); static int ez80_emacinitialize(void);
/**************************************************************************** /****************************************************************************
* Private Functions * Private Functions
@ -421,9 +423,9 @@ static void ez80emac_waitmiibusy(void)
* *
****************************************************************************/ ****************************************************************************/
static void ez80emac_miiwrite(FAR struct ez80emac_driver_s *priv, ubyte offset, uint16 value) static void ez80emac_miiwrite(FAR struct ez80emac_driver_s *priv, uint8_t offset, uint16_t value)
{ {
ubyte regval; uint8_t regval;
/* Wait for any preceding MII management operation to complete */ /* Wait for any preceding MII management operation to complete */
@ -461,9 +463,9 @@ static void ez80emac_miiwrite(FAR struct ez80emac_driver_s *priv, ubyte offset,
* *
****************************************************************************/ ****************************************************************************/
static uint16 ez80emac_miiread(FAR struct ez80emac_driver_s *priv, uint32 offset) static uint16_t ez80emac_miiread(FAR struct ez80emac_driver_s *priv, uint32_t offset)
{ {
ubyte regval; uint8_t regval;
/* Wait for any preceding MII management operation to complete */ /* Wait for any preceding MII management operation to complete */
@ -483,7 +485,7 @@ static uint16 ez80emac_miiread(FAR struct ez80emac_driver_s *priv, uint32 offset
/* Wait for MII management operation to complete */ /* Wait for MII management operation to complete */
ez80emac_waitmiibusy(); ez80emac_waitmiibusy();
return ((uint16)inp(EZ80_EMAC_PRSD_H) << 8 | inp(EZ80_EMAC_PRSD_L)); return ((uint16_t)inp(EZ80_EMAC_PRSD_H) << 8 | inp(EZ80_EMAC_PRSD_L));
} }
/**************************************************************************** /****************************************************************************
@ -497,18 +499,18 @@ static uint16 ez80emac_miiread(FAR struct ez80emac_driver_s *priv, uint32 offset
* priv - Reference to the driver state structure * priv - Reference to the driver state structure
* offset - Register offset in PMD * offset - Register offset in PMD
* bits - Selects set of bits to wait for * bits - Selects set of bits to wait for
* bclear - TRUE:Return true when all bits in 'bits' are 0 * bclear - true:Return true when all bits in 'bits' are 0
* FALSE:Return true when one or more bits in 'bits' are 1 * false:Return true when one or more bits in 'bits' are 1
* *
* Returned Value: * Returned Value:
* TRUE:Bit has requested polarity; FALSE: EMAC_MXPOLLLOOPS exceeded * true:Bit has requested polarity; false: EMAC_MXPOLLLOOPS exceeded
* *
****************************************************************************/ ****************************************************************************/
static boolean ez80emac_miipoll(FAR struct ez80emac_driver_s *priv, uint32 offset, static bool ez80emac_miipoll(FAR struct ez80emac_driver_s *priv, uint32_t offset,
uint16 bits, boolean bclear) uint16_t bits, bool bclear)
{ {
uint16 value; uint16_t value;
int i; int i;
for (i = 0; i < EMAC_MXPOLLLOOPS; i++) for (i = 0; i < EMAC_MXPOLLLOOPS; i++)
@ -518,18 +520,18 @@ static boolean ez80emac_miipoll(FAR struct ez80emac_driver_s *priv, uint32 offse
{ {
if ((value & bits) == 0) if ((value & bits) == 0)
{ {
return TRUE; return true;
} }
} }
else else
{ {
if ((value & bits) != 0) if ((value & bits) != 0)
{ {
return TRUE; return true;
} }
} }
} }
return FALSE; return false;
} }
/**************************************************************************** /****************************************************************************
@ -542,19 +544,19 @@ static boolean ez80emac_miipoll(FAR struct ez80emac_driver_s *priv, uint32 offse
* priv - Reference to the driver state structure * priv - Reference to the driver state structure
* offset - Register offset in PMD * offset - Register offset in PMD
* bits - Selects set of bits to wait for * bits - Selects set of bits to wait for
* bclear - TRUE:Return true when all bits in 'bits' are 0 * bclear - true:Return true when all bits in 'bits' are 0
* FALSE:Return true when one or more bits in 'bits' are 1 * false:Return true when one or more bits in 'bits' are 1
* *
* Returned Value: * Returned Value:
* TRUE:Bit has requested polarity; FALSE: EMAC_MXPOLLLOOPS exceeded * true:Bit has requested polarity; false: EMAC_MXPOLLLOOPS exceeded
* *
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_EZ80_PHYAM79C874 #ifdef CONFIG_EZ80_PHYAM79C874
static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv)
{ {
uint16 phyval; uint16_t phyval;
boolean bauto; bool bauto;
int ret = OK; int ret = OK;
int i; int i;
@ -584,12 +586,12 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv)
if (phyval & MII_MSR_ANEGABLE) if (phyval & MII_MSR_ANEGABLE)
{ {
phyval = MII_MCR_ANRESTART | MII_MCR_ANENABLE; phyval = MII_MCR_ANRESTART | MII_MCR_ANENABLE;
bauto = TRUE; bauto = true;
} }
else else
{ {
phyval = 0; phyval = 0;
bauto = FALSE; bauto = false;
/* PADEN - EMAC pads all short frames by adding zeroes to the end of /* PADEN - EMAC pads all short frames by adding zeroes to the end of
* the data field. This bit is used in conjunction with ADPADN * the data field. This bit is used in conjunction with ADPADN
@ -701,10 +703,10 @@ dumpregs:
#else #else
static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv) static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv)
{ {
uint16 advertise; uint16_t advertise;
uint16 lpa; uint16_t lpa;
uint16 mcr; uint16_t mcr;
ubyte regval; uint8_t regval;
/* Start auto-negotiation */ /* Start auto-negotiation */
@ -715,28 +717,28 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv)
/* Wait for auto-negotiation to start */ /* Wait for auto-negotiation to start */
if (!ez80emac_miipoll(priv, MII_MCR, MII_MCR_ANRESTART, FALSE)) if (!ez80emac_miipoll(priv, MII_MCR, MII_MCR_ANRESTART, false))
{ {
ndbg("Autonegotiation didn't start.\n"); ndbg("Autonegotiation didn't start.\n");
} }
/* Wait for auto-negotiation to complete */ /* Wait for auto-negotiation to complete */
if (!ez80emac_miipoll(priv, MII_MSR, MII_MSR_ANEGCOMPLETE, TRUE)) if (!ez80emac_miipoll(priv, MII_MSR, MII_MSR_ANEGCOMPLETE, true))
{ {
ndbg("Autonegotiation didn't complete.\n"); ndbg("Autonegotiation didn't complete.\n");
} }
/* Wait link */ /* Wait link */
if (!ez80emac_miipoll(priv, MII_MSR, MII_MSR_LINKSTATUS, TRUE)) if (!ez80emac_miipoll(priv, MII_MSR, MII_MSR_LINKSTATUS, true))
{ {
ndbg("Link is down!\n"); ndbg("Link is down!\n");
priv->blinkok = FALSE; priv->blinkok = false;
} }
else else
{ {
priv->blinkok = TRUE; priv->blinkok = true;
} }
/* Read capable media type */ /* Read capable media type */
@ -753,8 +755,8 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv)
regval = inp(EZ80_EMAC_CFG1); regval = inp(EZ80_EMAC_CFG1);
regval |= EMAC_CFG1_FULLHD; /* Enable full duplex mode */ regval |= EMAC_CFG1_FULLHD; /* Enable full duplex mode */
outp(EZ80_EMAC_CFG1, regval); outp(EZ80_EMAC_CFG1, regval);
priv->b100mbs = TRUE; priv->b100mbs = true;
priv->bfullduplex = TRUE; priv->bfullduplex = true;
} }
/* Check for 100BASETX half duplex */ /* Check for 100BASETX half duplex */
@ -765,8 +767,8 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv)
regval = inp(EZ80_EMAC_CFG1); regval = inp(EZ80_EMAC_CFG1);
regval &= ~EMAC_CFG1_FULLHD; /* Disable full duplex mode */ regval &= ~EMAC_CFG1_FULLHD; /* Disable full duplex mode */
outp(EZ80_EMAC_CFG1, regval); outp(EZ80_EMAC_CFG1, regval);
priv->b100mbs = TRUE; priv->b100mbs = true;
priv->bfullduplex = FALSE; priv->bfullduplex = false;
} }
/* Check for 10BASETX full duplex */ /* Check for 10BASETX full duplex */
@ -777,8 +779,8 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv)
regval = inp(EZ80_EMAC_CFG1); regval = inp(EZ80_EMAC_CFG1);
regval |= EMAC_CFG1_FULLHD; /* Enable full duplex mode */ regval |= EMAC_CFG1_FULLHD; /* Enable full duplex mode */
outp(EZ80_EMAC_CFG1, regval); outp(EZ80_EMAC_CFG1, regval);
priv->b100mbs = FALSE; priv->b100mbs = false;
priv->bfullduplex = TRUE; priv->bfullduplex = true;
} }
/* Check for 10BASETX half duplex */ /* Check for 10BASETX half duplex */
@ -789,8 +791,8 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv)
regval = inp(EZ80_EMAC_CFG1); regval = inp(EZ80_EMAC_CFG1);
regval &= ~EMAC_CFG1_FULLHD; /* Disable full duplex mode */ regval &= ~EMAC_CFG1_FULLHD; /* Disable full duplex mode */
outp(EZ80_EMAC_CFG1, regval); outp(EZ80_EMAC_CFG1, regval);
priv->b100mbs = FALSE; priv->b100mbs = false;
priv->bfullduplex = FALSE; priv->bfullduplex = false;
} }
else else
{ {
@ -798,8 +800,8 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv)
regval = inp(EZ80_EMAC_CFG1); regval = inp(EZ80_EMAC_CFG1);
regval &= ~EMAC_CFG1_FULLHD; /* Disable full duplex mode */ regval &= ~EMAC_CFG1_FULLHD; /* Disable full duplex mode */
outp(EZ80_EMAC_CFG1, regval); outp(EZ80_EMAC_CFG1, regval);
priv->b100mbs = FALSE; priv->b100mbs = false;
priv->bfullduplex = FALSE; priv->bfullduplex = false;
} }
/* Set MII control */ /* Set MII control */
@ -847,7 +849,7 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv)
* Parameters: * Parameters:
* priv - Reference to the driver state structure * priv - Reference to the driver state structure
* mac - The MAC address to add * mac - The MAC address to add
* enable - TRUE: Enable filtering on this address; FALSE: disable * enable - true: Enable filtering on this address; false: disable
* *
* Returned Value: * Returned Value:
* None * None
@ -855,10 +857,10 @@ static int ez80emac_miiconfigure(FAR struct ez80emac_driver_s *priv)
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_EZ80_MCFILTER #ifdef CONFIG_EZ80_MCFILTER
static void ez80emac_machash(FAR ubyte *mac, int *ndx, int *bitno) static void ez80emac_machash(FAR uint8_t *mac, int *ndx, int *bitno)
{ {
uint32 hash; uint32_t hash;
uint32 crc32; uint32_t crc32;
int i; int i;
int j; int j;
@ -867,7 +869,7 @@ static void ez80emac_machash(FAR ubyte *mac, int *ndx, int *bitno)
crc32 = 0xffffffff; crc32 = 0xffffffff;
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
{ {
crc32 ^= (uint32)mac[i] & 0x0f; crc32 ^= (uint32_t)mac[i] & 0x0f;
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
{ {
if (crc32 & 1) if (crc32 & 1)
@ -880,7 +882,7 @@ static void ez80emac_machash(FAR ubyte *mac, int *ndx, int *bitno)
} }
} }
crc32 ^= (uint32)mac[i] >> 4; crc32 ^= (uint32_t)mac[i] >> 4;
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
{ {
if (crc32 & 1) if (crc32 & 1)
@ -936,11 +938,11 @@ static int ez80emac_transmit(struct ez80emac_driver_s *priv)
{ {
FAR struct ez80emac_desc_s *txdesc; FAR struct ez80emac_desc_s *txdesc;
FAR struct ez80emac_desc_s *txnext; FAR struct ez80emac_desc_s *txnext;
ubyte *psrc; uint8_t *psrc;
ubyte *pdest; uint8_t *pdest;
uint24 len; uint24_t len;
irqstate_t flags; irqstate_t flags;
ubyte regval; uint8_t regval;
/* Careful: This function can be called from outside of the interrupt /* Careful: This function can be called from outside of the interrupt
* handler and, therefore, may be suspended when debug output is generated! * handler and, therefore, may be suspended when debug output is generated!
@ -969,14 +971,14 @@ static int ez80emac_transmit(struct ez80emac_driver_s *priv)
txdesc = priv->txnext; txdesc = priv->txnext;
len = EMAC_PKTBUF_ALIGN(priv->dev.d_len + SIZEOF_EMACSDESC); len = EMAC_PKTBUF_ALIGN(priv->dev.d_len + SIZEOF_EMACSDESC);
txnext = (FAR struct ez80emac_desc_s *)((ubyte*)txdesc + len); txnext = (FAR struct ez80emac_desc_s *)((uint8_t*)txdesc + len);
/* Handle wraparound to the beginning of the TX region */ /* Handle wraparound to the beginning of the TX region */
if ((ubyte*)txnext + SIZEOF_EMACSDESC >= (ubyte*)priv->rxstart) if ((uint8_t*)txnext + SIZEOF_EMACSDESC >= (uint8_t*)priv->rxstart)
{ {
txnext = (FAR struct ez80emac_desc_s *) txnext = (FAR struct ez80emac_desc_s *)
((ubyte*)priv->txstart + ((ubyte*)txnext - (ubyte*)priv->rxstart)); ((uint8_t*)priv->txstart + ((uint8_t*)txnext - (uint8_t*)priv->rxstart));
} }
priv->txnext = txnext; priv->txnext = txnext;
@ -987,8 +989,8 @@ static int ez80emac_transmit(struct ez80emac_driver_s *priv)
/* Copy the data to the next packet in the Tx buffer (handling wraparound) */ /* Copy the data to the next packet in the Tx buffer (handling wraparound) */
psrc = priv->dev.d_buf; psrc = priv->dev.d_buf;
pdest = (ubyte*)txdesc + SIZEOF_EMACSDESC; pdest = (uint8_t*)txdesc + SIZEOF_EMACSDESC;
len = (ubyte*)priv->rxstart - pdest; len = (uint8_t*)priv->rxstart - pdest;
if (len >= priv->dev.d_len) if (len >= priv->dev.d_len)
{ {
/* The entire packet will fit into the EMAC SRAM without wrapping */ /* The entire packet will fit into the EMAC SRAM without wrapping */
@ -1014,7 +1016,7 @@ static int ez80emac_transmit(struct ez80emac_driver_s *priv)
* perform the transmission on its next polling cycle. * perform the transmission on its next polling cycle.
*/ */
txdesc->np = (uint24)priv->txnext; txdesc->np = (uint24_t)priv->txnext;
txdesc->pktsize = priv->dev.d_len; txdesc->pktsize = priv->dev.d_len;
txdesc->stat = EMAC_TXDESC_OWNER; txdesc->stat = EMAC_TXDESC_OWNER;
@ -1033,7 +1035,7 @@ static int ez80emac_transmit(struct ez80emac_driver_s *priv)
/* Setup the TX timeout watchdog (perhaps restarting the timer) */ /* Setup the TX timeout watchdog (perhaps restarting the timer) */
(void)wd_start(priv->txtimeout, EMAC_TXTIMEOUT, ez80emac_txtimeout, 1, (uint32)priv); (void)wd_start(priv->txtimeout, EMAC_TXTIMEOUT, ez80emac_txtimeout, 1, (uint32_t)priv);
return OK; return OK;
} }
@ -1102,7 +1104,7 @@ static int ez80emac_uiptxpoll(struct uip_driver_s *dev)
static inline FAR struct ez80emac_desc_s *ez80emac_rwp(void) static inline FAR struct ez80emac_desc_s *ez80emac_rwp(void)
{ {
return (FAR struct ez80emac_desc_s *) return (FAR struct ez80emac_desc_s *)
(CONFIG_EZ80_RAMADDR + ((uint24)inp(EZ80_EMAC_RWP_H) << 8) + (uint24)inp(EZ80_EMAC_RWP_L)); (CONFIG_EZ80_RAMADDR + ((uint24_t)inp(EZ80_EMAC_RWP_H) << 8) + (uint24_t)inp(EZ80_EMAC_RWP_L));
} }
/**************************************************************************** /****************************************************************************
@ -1122,7 +1124,7 @@ static inline FAR struct ez80emac_desc_s *ez80emac_rwp(void)
static inline FAR struct ez80emac_desc_s *ez80emac_rrp(void) static inline FAR struct ez80emac_desc_s *ez80emac_rrp(void)
{ {
return (FAR struct ez80emac_desc_s *) return (FAR struct ez80emac_desc_s *)
(CONFIG_EZ80_RAMADDR + ((uint24)inp(EZ80_EMAC_RRP_H) << 8) + (uint24)inp(EZ80_EMAC_RRP_L)); (CONFIG_EZ80_RAMADDR + ((uint24_t)inp(EZ80_EMAC_RRP_H) << 8) + (uint24_t)inp(EZ80_EMAC_RRP_L));
} }
/**************************************************************************** /****************************************************************************
@ -1148,8 +1150,8 @@ static int ez80emac_receive(struct ez80emac_driver_s *priv)
{ {
FAR struct ez80emac_desc_s *rxdesc = priv->rxnext; FAR struct ez80emac_desc_s *rxdesc = priv->rxnext;
FAR struct ez80emac_desc_s *rwp; FAR struct ez80emac_desc_s *rwp;
ubyte *psrc; uint8_t *psrc;
ubyte *pdest; uint8_t *pdest;
int pktlen; int pktlen;
int npackets; int npackets;
@ -1208,14 +1210,14 @@ static int ez80emac_receive(struct ez80emac_driver_s *priv)
/* Copy the data data from the hardware to priv->dev.d_buf */ /* Copy the data data from the hardware to priv->dev.d_buf */
psrc = (FAR ubyte*)priv->rxnext + SIZEOF_EMACSDESC; psrc = (FAR uint8_t*)priv->rxnext + SIZEOF_EMACSDESC;
pdest = priv->dev.d_buf; pdest = priv->dev.d_buf;
/* Check for wraparound */ /* Check for wraparound */
if ((FAR ubyte*)(psrc + pktlen) > (FAR ubyte*)priv->rxendp1) if ((FAR uint8_t*)(psrc + pktlen) > (FAR uint8_t*)priv->rxendp1)
{ {
int nbytes = (int)((FAR ubyte*)priv->rxendp1 - (FAR ubyte*)psrc); int nbytes = (int)((FAR uint8_t*)priv->rxendp1 - (FAR uint8_t*)psrc);
nvdbg("RX wraps after %d bytes\n", nbytes + SIZEOF_EMACSDESC); nvdbg("RX wraps after %d bytes\n", nbytes + SIZEOF_EMACSDESC);
memcpy(pdest, psrc, nbytes); memcpy(pdest, psrc, nbytes);
@ -1249,8 +1251,8 @@ static int ez80emac_receive(struct ez80emac_driver_s *priv)
* and the RRP to determine how many packets remain in the Rx buffer. * and the RRP to determine how many packets remain in the Rx buffer.
*/ */
outp(EZ80_EMAC_RRP_L, (ubyte)((uint24)rxdesc & 0xff)); outp(EZ80_EMAC_RRP_L, (uint8_t)((uint24_t)rxdesc & 0xff));
outp(EZ80_EMAC_RRP_H, (ubyte)(((uint24)rxdesc >> 8) & 0xff)); outp(EZ80_EMAC_RRP_H, (uint8_t)(((uint24_t)rxdesc >> 8) & 0xff));
nvdbg("rxnext=%p {%06x, %u, %04x} rrp=%06x rwp=%06x blkslft=%02x\n", nvdbg("rxnext=%p {%06x, %u, %04x} rrp=%06x rwp=%06x blkslft=%02x\n",
rxdesc, rxdesc->np, rxdesc->pktsize, rxdesc->stat, rxdesc, rxdesc->np, rxdesc->pktsize, rxdesc->stat,
@ -1328,8 +1330,8 @@ static int ez80emac_txinterrupt(int irq, FAR void *context)
{ {
FAR struct ez80emac_driver_s *priv = &g_emac; FAR struct ez80emac_driver_s *priv = &g_emac;
FAR struct ez80emac_desc_s *txhead = priv->txhead; FAR struct ez80emac_desc_s *txhead = priv->txhead;
ubyte regval; uint8_t regval;
ubyte istat; uint8_t istat;
/* EMAC Tx interrupts: /* EMAC Tx interrupts:
* *
@ -1432,7 +1434,7 @@ static int ez80emac_txinterrupt(int irq, FAR void *context)
static int ez80emac_rxinterrupt(int irq, FAR void *context) static int ez80emac_rxinterrupt(int irq, FAR void *context)
{ {
FAR struct ez80emac_driver_s *priv = &g_emac; FAR struct ez80emac_driver_s *priv = &g_emac;
ubyte istat; uint8_t istat;
/* EMAC Rx interrupts: /* EMAC Rx interrupts:
* *
@ -1477,8 +1479,8 @@ static int ez80emac_rxinterrupt(int irq, FAR void *context)
static int ez80emac_sysinterrupt(int irq, FAR void *context) static int ez80emac_sysinterrupt(int irq, FAR void *context)
{ {
FAR struct ez80emac_driver_s *priv = &g_emac; FAR struct ez80emac_driver_s *priv = &g_emac;
ubyte events; uint8_t events;
ubyte istat; uint8_t istat;
/* EMAC system interrupts : /* EMAC system interrupts :
* *
@ -1553,7 +1555,7 @@ static int ez80emac_sysinterrupt(int irq, FAR void *context)
* *
****************************************************************************/ ****************************************************************************/
static void ez80emac_txtimeout(int argc, uint32 arg, ...) static void ez80emac_txtimeout(int argc, uint32_t arg, ...)
{ {
FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)arg; FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)arg;
irqstate_t flags; irqstate_t flags;
@ -1592,7 +1594,7 @@ static void ez80emac_txtimeout(int argc, uint32 arg, ...)
* *
****************************************************************************/ ****************************************************************************/
static void ez80emac_polltimer(int argc, uint32 arg, ...) static void ez80emac_polltimer(int argc, uint32_t arg, ...)
{ {
struct ez80emac_driver_s *priv = (struct ez80emac_driver_s *)arg; struct ez80emac_driver_s *priv = (struct ez80emac_driver_s *)arg;
@ -1625,7 +1627,7 @@ static void ez80emac_polltimer(int argc, uint32 arg, ...)
static int ez80emac_ifup(FAR struct uip_driver_s *dev) static int ez80emac_ifup(FAR struct uip_driver_s *dev)
{ {
FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)dev->d_private; FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)dev->d_private;
ubyte regval; uint8_t regval;
int ret; int ret;
ndbg("Bringing up: MAC %02x:%02x:%02x:%02x:%02x:%02x\n", ndbg("Bringing up: MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
@ -1688,11 +1690,11 @@ static int ez80emac_ifup(FAR struct uip_driver_s *dev)
/* Set and activate a timer process */ /* Set and activate a timer process */
(void)wd_start(priv->txpoll, EMAC_WDDELAY, ez80emac_polltimer, 1, (uint32)priv); (void)wd_start(priv->txpoll, EMAC_WDDELAY, ez80emac_polltimer, 1, (uint32_t)priv);
/* Enable the Ethernet interrupts */ /* Enable the Ethernet interrupts */
priv->bifup = TRUE; priv->bifup = true;
up_enable_irq(EZ80_EMACRX_IRQ); up_enable_irq(EZ80_EMACRX_IRQ);
up_enable_irq(EZ80_EMACTX_IRQ); up_enable_irq(EZ80_EMACTX_IRQ);
up_enable_irq(EZ80_EMACSYS_IRQ); up_enable_irq(EZ80_EMACSYS_IRQ);
@ -1721,7 +1723,7 @@ static int ez80emac_ifdown(struct uip_driver_s *dev)
{ {
struct ez80emac_driver_s *priv = (struct ez80emac_driver_s *)dev->d_private; struct ez80emac_driver_s *priv = (struct ez80emac_driver_s *)dev->d_private;
irqstate_t flags; irqstate_t flags;
ubyte regval; uint8_t regval;
/* Disable the Ethernet interrupt */ /* Disable the Ethernet interrupt */
@ -1745,7 +1747,7 @@ static int ez80emac_ifdown(struct uip_driver_s *dev)
outp(EZ80_EMAC_PTMR, 0); outp(EZ80_EMAC_PTMR, 0);
priv->bifup = FALSE; priv->bifup = false;
irqrestore(flags); irqrestore(flags);
return OK; return OK;
} }
@ -1809,8 +1811,8 @@ static int ez80emac_txavail(struct uip_driver_s *dev)
static int ez80_emacinitialize(void) static int ez80_emacinitialize(void)
{ {
struct ez80emac_driver_s *priv = &g_emac; struct ez80emac_driver_s *priv = &g_emac;
uint24 addr; uint24_t addr;
ubyte regval; uint8_t regval;
int ret; int ret;
/* Reset the EMAC hardware */ /* Reset the EMAC hardware */
@ -1838,8 +1840,8 @@ static int ez80_emacinitialize(void)
*/ */
addr = CONFIG_EZ80_RAMADDR; addr = CONFIG_EZ80_RAMADDR;
outp(EZ80_EMAC_TLBP_L, (ubyte)(addr & 0xff)); outp(EZ80_EMAC_TLBP_L, (uint8_t)(addr & 0xff));
outp(EZ80_EMAC_TLBP_H, (ubyte)((addr >> 8) & 0xff)); outp(EZ80_EMAC_TLBP_H, (uint8_t)((addr >> 8) & 0xff));
priv->txstart = (FAR struct ez80emac_desc_s *)(addr); priv->txstart = (FAR struct ez80emac_desc_s *)(addr);
priv->txnext = priv->txstart; priv->txnext = priv->txstart;
@ -1860,8 +1862,8 @@ static int ez80_emacinitialize(void)
*/ */
addr += EMAC_TXBUFSIZE; addr += EMAC_TXBUFSIZE;
outp(EZ80_EMAC_BP_L, (ubyte)(addr & 0xff)); outp(EZ80_EMAC_BP_L, (uint8_t)(addr & 0xff));
outp(EZ80_EMAC_BP_H, (ubyte)((addr >> 8) & 0xff)); outp(EZ80_EMAC_BP_H, (uint8_t)((addr >> 8) & 0xff));
priv->rxstart = (FAR struct ez80emac_desc_s *)(addr); priv->rxstart = (FAR struct ez80emac_desc_s *)(addr);
priv->rxnext = priv->rxstart; priv->rxnext = priv->rxstart;
@ -1887,8 +1889,8 @@ static int ez80_emacinitialize(void)
* is limited to a minimum of 32 bytes, the last five bits are always zero. * is limited to a minimum of 32 bytes, the last five bits are always zero.
*/ */
outp(EZ80_EMAC_RRP_L, (ubyte)(addr & 0xff)); outp(EZ80_EMAC_RRP_L, (uint8_t)(addr & 0xff));
outp(EZ80_EMAC_RRP_H, (ubyte)((addr >> 8) & 0xff)); outp(EZ80_EMAC_RRP_H, (uint8_t)((addr >> 8) & 0xff));
nvdbg("rrp=%02x%02x rwp=%02x%02x\n", nvdbg("rrp=%02x%02x rwp=%02x%02x\n",
inp(EZ80_EMAC_RRP_H), inp(EZ80_EMAC_RRP_L), inp(EZ80_EMAC_RRP_H), inp(EZ80_EMAC_RRP_L),
@ -1899,8 +1901,8 @@ static int ez80_emacinitialize(void)
*/ */
addr += EMAC_RXBUFSIZE; addr += EMAC_RXBUFSIZE;
outp(EZ80_EMAC_RHBP_L, (ubyte)(addr & 0xff)); outp(EZ80_EMAC_RHBP_L, (uint8_t)(addr & 0xff));
outp(EZ80_EMAC_RHBP_H, (ubyte)((addr >> 8) & 0xff)); outp(EZ80_EMAC_RHBP_H, (uint8_t)((addr >> 8) & 0xff));
priv->rxendp1 = (FAR struct ez80emac_desc_s *)addr; priv->rxendp1 = (FAR struct ez80emac_desc_s *)addr;
nvdbg("rxendp1=%p rhbp=%02x%02x\n", nvdbg("rxendp1=%p rhbp=%02x%02x\n",
@ -1932,7 +1934,7 @@ static int ez80_emacinitialize(void)
up_udelay(500); up_udelay(500);
ez80emac_miiwrite(priv, MII_MCR, MII_MCR_RESET); ez80emac_miiwrite(priv, MII_MCR, MII_MCR_RESET);
if (!ez80emac_miipoll(priv, MII_MCR, MII_MCR_RESET, FALSE)) if (!ez80emac_miipoll(priv, MII_MCR, MII_MCR_RESET, false))
{ {
ndbg("PHY reset error.\n"); ndbg("PHY reset error.\n");
} }
@ -1987,7 +1989,7 @@ static int ez80_emacinitialize(void)
/* PHY reset */ /* PHY reset */
ez80emac_miiwrite(priv, MII_MCR, MII_MCR_RESET); ez80emac_miiwrite(priv, MII_MCR, MII_MCR_RESET);
if (!ez80emac_miipoll(priv, MII_MCR, MII_MCR_RESET, FALSE)) if (!ez80emac_miipoll(priv, MII_MCR, MII_MCR_RESET, false))
{ {
ndbg("PHY reset error.\n"); ndbg("PHY reset error.\n");
ret = -EIO; ret = -EIO;
@ -2095,7 +2097,7 @@ errout:
* Parameters: * Parameters:
* dev - Reference to the uIP driver state structure * dev - Reference to the uIP driver state structure
* mac - The MAC address to add * mac - The MAC address to add
* enable - TRUE: Enable filtering on this address; FALSE: disable * enable - true: Enable filtering on this address; false: disable
* *
* Returned Value: * Returned Value:
* OK on success; Negated errno on failure. * OK on success; Negated errno on failure.
@ -2103,10 +2105,10 @@ errout:
****************************************************************************/ ****************************************************************************/
#ifdef CONFIG_ARCH_MCFILTER #ifdef CONFIG_ARCH_MCFILTER
int up_multicastfilter(FAR struct uip_driver_s *dev, FAR ubyte *mac, boolean enable) int up_multicastfilter(FAR struct uip_driver_s *dev, FAR uint8_t *mac, bool enable)
{ {
FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)dev->priv; FAR struct ez80emac_driver_s *priv = (FAR struct ez80emac_driver_s *)dev->priv;
ubyte regval; uint8_t regval;
int ndx; int ndx;
int bit; int bit;
int i; int i;

View File

@ -39,7 +39,8 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
#include <semaphore.h> #include <semaphore.h>
#include <errno.h> #include <errno.h>
@ -64,9 +65,9 @@
struct ez80_i2cdev_s struct ez80_i2cdev_s
{ {
const struct i2c_ops_s *ops; /* I2C vtable */ const struct i2c_ops_s *ops; /* I2C vtable */
uint16 ccr; /* Clock control register value */ uint16_t ccr; /* Clock control register value */
uint16 addr; /* 7- or 10-bit address */ uint16_t addr; /* 7- or 10-bit address */
ubyte addr10 : 1; /* 1=Address is 10-bit */ uint8_t addr10 : 1; /* 1=Address is 10-bit */
}; };
/**************************************************************************** /****************************************************************************
@ -75,20 +76,20 @@ struct ez80_i2cdev_s
/* Misc. Helpers */ /* Misc. Helpers */
static void i2c_setccr(uint16 ccr); static void i2c_setccr(uint16_t ccr);
static uint16 i2c_getccr(uint32 frequency); static uint16_t i2c_getccr(uint32_t frequency);
static ubyte i2c_waitiflg(void); static uint8_t i2c_waitiflg(void);
static void i2c_clriflg(void); static void i2c_clriflg(void);
static void i2c_start(void); static void i2c_start(void);
static void i2c_stop(void); static void i2c_stop(void);
static int i2c_sendaddr(struct ez80_i2cdev_s *priv, ubyte readbit); static int i2c_sendaddr(struct ez80_i2cdev_s *priv, uint8_t readbit);
/* I2C methods */ /* I2C methods */
static uint32 i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32 frequency); static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency);
static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits); static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits);
static int i2c_write(FAR struct i2c_dev_s *dev, const ubyte *buffer, int buflen); static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen);
static int i2c_read(FAR struct i2c_dev_s *dev, ubyte *buffer, int buflen); static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen);
/**************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
@ -96,14 +97,14 @@ static int i2c_read(FAR struct i2c_dev_s *dev, ubyte *buffer, int buflen);
/* This function is normally prototyped int the ZiLOG header file sio.h */ /* This function is normally prototyped int the ZiLOG header file sio.h */
extern uint32 get_freq(void); extern uint32_t get_freq(void);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
static ubyte g_currccr; /* Current setting of I2C CCR register */ static uint8_t g_currccr; /* Current setting of I2C CCR register */
static boolean g_initialized; /* TRUE:I2C has been initialized */ static bool g_initialized; /* true:I2C has been initialized */
static sem_t g_i2csem; /* Serialize I2C transfers */ static sem_t g_i2csem; /* Serialize I2C transfers */
const struct i2c_ops_s g_ops = const struct i2c_ops_s g_ops =
@ -161,7 +162,7 @@ static void i2c_semtake(void)
* *
****************************************************************************/ ****************************************************************************/
static void i2c_setccr(uint16 ccr) static void i2c_setccr(uint16_t ccr)
{ {
if (g_currccr != ccr) if (g_currccr != ccr)
{ {
@ -184,12 +185,12 @@ static void i2c_setccr(uint16 ccr)
* *
****************************************************************************/ ****************************************************************************/
static uint16 i2c_getccr(uint32 fscl) static uint16_t i2c_getccr(uint32_t fscl)
{ {
uint32 fsamp; uint32_t fsamp;
uint32 ftmp; uint32_t ftmp;
ubyte n; uint8_t n;
ubyte m; uint8_t m;
/* The sampling frequency is given by: /* The sampling frequency is given by:
* *
@ -296,7 +297,7 @@ static uint16 i2c_getccr(uint32 fscl)
* *
****************************************************************************/ ****************************************************************************/
static ubyte i2c_waitiflg(void) static uint8_t i2c_waitiflg(void)
{ {
while ((inp(EZ80_I2C_CTL) & I2C_CTL_IFLG) != 0); while ((inp(EZ80_I2C_CTL) & I2C_CTL_IFLG) != 0);
return inp(EZ80_I2C_SR); return inp(EZ80_I2C_SR);
@ -319,7 +320,7 @@ static ubyte i2c_waitiflg(void)
static void i2c_clriflg(void) static void i2c_clriflg(void)
{ {
ubyte regval = inp(EZ80_I2C_CTL); uint8_t regval = inp(EZ80_I2C_CTL);
regval &= ~I2C_CTL_IFLG; regval &= ~I2C_CTL_IFLG;
outp(EZ80_I2C_CTL, regval); outp(EZ80_I2C_CTL, regval);
} }
@ -341,7 +342,7 @@ static void i2c_clriflg(void)
static void i2c_start(void) static void i2c_start(void)
{ {
ubyte regval = inp(EZ80_I2C_CTL); uint8_t regval = inp(EZ80_I2C_CTL);
regval |= I2C_CTL_STA; regval |= I2C_CTL_STA;
outp(EZ80_I2C_CTL, regval); outp(EZ80_I2C_CTL, regval);
} }
@ -363,7 +364,7 @@ static void i2c_start(void)
static void i2c_stop(void) static void i2c_stop(void)
{ {
ubyte regval = inp(EZ80_I2C_CTL); uint8_t regval = inp(EZ80_I2C_CTL);
regval |= I2C_CTL_STP; regval |= I2C_CTL_STP;
outp(EZ80_I2C_CTL, regval); outp(EZ80_I2C_CTL, regval);
} }
@ -388,9 +389,9 @@ static void i2c_stop(void)
* *
****************************************************************************/ ****************************************************************************/
static int i2c_sendaddr(struct ez80_i2cdev_s *priv, ubyte readbit) static int i2c_sendaddr(struct ez80_i2cdev_s *priv, uint8_t readbit)
{ {
ubyte sr; uint8_t sr;
int ret = OK; int ret = OK;
/* Wait for the IFLG bit to transition to 1. At this point, we should /* Wait for the IFLG bit to transition to 1. At this point, we should
@ -417,7 +418,7 @@ static int i2c_sendaddr(struct ez80_i2cdev_s *priv, ubyte readbit)
* IFLG. Clearing the IFLAG will cause the address to be transferred. * IFLG. Clearing the IFLAG will cause the address to be transferred.
*/ */
outp(EZ80_I2C_DR, (ubyte)I2C_ADDR8(priv->addr) | readbit); outp(EZ80_I2C_DR, (uint8_t)I2C_ADDR8(priv->addr) | readbit);
i2c_clriflg(); i2c_clriflg();
/* And wait for the address transfer to complete */ /* And wait for the address transfer to complete */
@ -436,7 +437,7 @@ static int i2c_sendaddr(struct ez80_i2cdev_s *priv, ubyte readbit)
* be transferred. * be transferred.
*/ */
outp(EZ80_I2C_DR, (ubyte)I2C_ADDR10H(priv->addr) | readbit); outp(EZ80_I2C_DR, (uint8_t)I2C_ADDR10H(priv->addr) | readbit);
i2c_clriflg(); i2c_clriflg();
/* And wait for the address transfer to complete */ /* And wait for the address transfer to complete */
@ -450,7 +451,7 @@ static int i2c_sendaddr(struct ez80_i2cdev_s *priv, ubyte readbit)
/* Now send the lower 8 bits of the 10-bit address */ /* Now send the lower 8 bits of the 10-bit address */
outp(EZ80_I2C_DR, (ubyte)I2C_ADDR10L(priv->addr)); outp(EZ80_I2C_DR, (uint8_t)I2C_ADDR10L(priv->addr));
i2c_clriflg(); i2c_clriflg();
/* And wait for the address transfer to complete */ /* And wait for the address transfer to complete */
@ -506,7 +507,7 @@ failure:
* *
****************************************************************************/ ****************************************************************************/
static uint32 i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32 frequency) static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
{ {
FAR struct ez80_i2cdev_s *priv = (FAR struct ez80_i2cdev_s *)dev; FAR struct ez80_i2cdev_s *priv = (FAR struct ez80_i2cdev_s *)dev;
@ -583,11 +584,11 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
* *
****************************************************************************/ ****************************************************************************/
static int i2c_write(FAR struct i2c_dev_s *dev, const ubyte *buffer, int buflen) static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen)
{ {
FAR struct ez80_i2cdev_s *priv = (FAR struct ez80_i2cdev_s *)dev; FAR struct ez80_i2cdev_s *priv = (FAR struct ez80_i2cdev_s *)dev;
const ubyte *ptr; const uint8_t *ptr;
ubyte sr; uint8_t sr;
int retry; int retry;
int count; int count;
int ret; int ret;
@ -717,11 +718,11 @@ failure:
* *
****************************************************************************/ ****************************************************************************/
static int i2c_read(FAR struct i2c_dev_s *dev, ubyte *buffer, int buflen) static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen)
{ {
FAR struct ez80_i2cdev_s *priv = (FAR struct ez80_i2cdev_s *)dev; FAR struct ez80_i2cdev_s *priv = (FAR struct ez80_i2cdev_s *)dev;
ubyte *ptr; uint8_t *ptr;
ubyte regval; uint8_t regval;
int retry; int retry;
int count; int count;
int ret; int ret;
@ -894,8 +895,8 @@ failure:
FAR struct i2c_dev_s *up_i2cinitialize(int port) FAR struct i2c_dev_s *up_i2cinitialize(int port)
{ {
FAR struct ez80_i2cdev_s *i2c; FAR struct ez80_i2cdev_s *i2c;
uint16 ccr; uint16_t ccr;
ubyte regval; uint8_t regval;
if (!g_initialized) if (!g_initialized)
{ {

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/ez80/ez80_initialstate.c * arch/z80/src/ez80/ez80_initialstate.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
@ -85,7 +85,7 @@ void up_initial_state(_TCB *tcb)
memset(xcp, 0, sizeof(struct xcptcontext)); memset(xcp, 0, sizeof(struct xcptcontext));
#ifndef CONFIG_SUPPRESS_INTERRUPTS #ifndef CONFIG_SUPPRESS_INTERRUPTS
((ubyte*)xcp->regs)[XCPT_IF_OFFSET] = EZ80_PV_FLAG; /* Parity/Overflow flag will enable interrupts */ ((uint8_t*)xcp->regs)[XCPT_IF_OFFSET] = EZ80_PV_FLAG; /* Parity/Overflow flag will enable interrupts */
#endif #endif
xcp->regs[XCPT_SP] = (chipreg_t)tcb->adj_stack_ptr; xcp->regs[XCPT_SP] = (chipreg_t)tcb->adj_stack_ptr;
xcp->regs[XCPT_PC] = (chipreg_t)tcb->start; xcp->regs[XCPT_PC] = (chipreg_t)tcb->start;

View File

@ -1,7 +1,7 @@
;************************************************************************** ;**************************************************************************
; arch/z80/src/ze80/ez80_io.c ; arch/z80/src/ze80/ez80_io.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> ; Author: Gregory Nutt <spudmonkey@racsa.co.cr>
; ;
; Redistribution and use in source and binary forms, with or without ; Redistribution and use in source and binary forms, with or without
@ -58,7 +58,7 @@
.assume ADL=1 .assume ADL=1
;************************************************************************** ;**************************************************************************
; Name: void outp(uint16 p, ubyte c) ; Name: void outp(uint16_t p, uint8_t c)
; ;
; Description: ; Description:
; Output byte c on port p ; Output byte c on port p
@ -108,7 +108,7 @@ _outp:
ret ret
;************************************************************************** ;**************************************************************************
; Name: ubyte inp(uint16 p) ; Name: uint8_t inp(uint16_t p)
; ;
; Description: ; Description:
; Input byte from port p ; Input byte from port p

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/ez80/ez80_irq.c * arch/z80/src/ez80/ez80_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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/irq.h> #include <nuttx/irq.h>

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/ez80/ez80_loweruart.c * arch/z80/src/ez80/ez80_loweruart.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <arch/io.h> #include <arch/io.h>
@ -140,8 +140,8 @@
#if defined(HAVE_SERIALCONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG) #if defined(HAVE_SERIALCONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG)
static void ez80_setbaud(void) static void ez80_setbaud(void)
{ {
uint32 brg_divisor; uint32_t brg_divisor;
ubyte lctl; uint8_t lctl;
/* The resulting BAUD and depends on the system clock frequency and the /* The resulting BAUD and depends on the system clock frequency and the
* BRG divisor as follows: * BRG divisor as follows:
@ -163,8 +163,8 @@ static void ez80_setbaud(void)
lctl |= EZ80_UARTLCTL_DLAB; lctl |= EZ80_UARTLCTL_DLAB;
ez80_outp(EZ80_UART_LCTL, lctl); ez80_outp(EZ80_UART_LCTL, lctl);
ez80_outp(EZ80_UART_BRGL, (ubyte)(brg_divisor & 0xff)); ez80_outp(EZ80_UART_BRGL, (uint8_t)(brg_divisor & 0xff));
ez80_outp(EZ80_UART_BRGH, (ubyte)(brg_divisor >> 8)); ez80_outp(EZ80_UART_BRGH, (uint8_t)(brg_divisor >> 8));
lctl &= ~EZ80_UARTLCTL_DLAB; lctl &= ~EZ80_UARTLCTL_DLAB;
ez80_outp(EZ80_UART_LCTL, lctl); ez80_outp(EZ80_UART_LCTL, lctl);
@ -182,7 +182,7 @@ static void ez80_setbaud(void)
void up_lowuartinit(void) void up_lowuartinit(void)
{ {
#ifdef HAVE_SERIAL #ifdef HAVE_SERIAL
ubyte regval; uint8_t regval;
/* Configure pins for usage of UARTs (whether or not we have a console) */ /* Configure pins for usage of UARTs (whether or not we have a console) */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/ez80/ez80_registerdump.c * arch/z80/src/ez80/ez80_registerdump.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <debug.h> #include <debug.h>
#include <nuttx/irq.h> #include <nuttx/irq.h>

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/ez80/ez80_schedulesigaction.c * arch/z80/src/ez80/ez80_schedulesigaction.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <sched.h> #include <sched.h>
#include <debug.h> #include <debug.h>
@ -123,7 +123,7 @@ static void ez80_sigsetup(FAR _TCB *tcb, sig_deliver_t sigdeliver, FAR chipreg_t
void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver) void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver)
{ {
sdbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16)sigdeliver); sdbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t))sigdeliver);
/* Refuse to handle nested signal actions */ /* Refuse to handle nested signal actions */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/ez08/ez80_serial.c * arch/z80/src/ez08/ez80_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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -40,6 +40,8 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h> #include <unistd.h>
#include <semaphore.h> #include <semaphore.h>
#include <string.h> #include <string.h>
@ -68,31 +70,31 @@
struct ez80_dev_s struct ez80_dev_s
{ {
uint16 uartbase; /* Base address of UART registers */ uint16_t uartbase; /* Base address of UART registers */
unsigned int baud; /* Configured baud */ unsigned int baud; /* Configured baud */
ubyte irq; /* IRQ associated with this UART */ uint8_t irq; /* IRQ associated with this UART */
ubyte parity; /* 0=none, 1=odd, 2=even */ uint8_t parity; /* 0=none, 1=odd, 2=even */
ubyte bits; /* Number of bits (7 or 8) */ uint8_t bits; /* Number of bits (7 or 8) */
boolean stopbits2; /* TRUE: Configure with 2 (vs 1) */ bool stopbits2; /* true: Configure with 2 (vs 1) */
}; };
/**************************************************************************** /****************************************************************************
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static int ez80_setup(struct uart_dev_s *dev); static int ez80_setup(struct uart_dev_s *dev);
static void ez80_shutdown(struct uart_dev_s *dev); static void ez80_shutdown(struct uart_dev_s *dev);
static int ez80_attach(struct uart_dev_s *dev); static int ez80_attach(struct uart_dev_s *dev);
static void ez80_detach(struct uart_dev_s *dev); static void ez80_detach(struct uart_dev_s *dev);
static int ez80_interrrupt(int irq, void *context); static int ez80_interrrupt(int irq, void *context);
static int ez80_ioctl(struct file *filep, int cmd, unsigned long arg); static int ez80_ioctl(struct file *filep, int cmd, unsigned long arg);
static int ez80_receive(struct uart_dev_s *dev, unsigned int *status); static int ez80_receive(struct uart_dev_s *dev, unsigned int *status);
static void ez80_rxint(struct uart_dev_s *dev, boolean enable); static void ez80_rxint(struct uart_dev_s *dev, bool enable);
static boolean ez80_rxavailable(struct uart_dev_s *dev); static bool ez80_rxavailable(struct uart_dev_s *dev);
static void ez80_send(struct uart_dev_s *dev, int ch); static void ez80_send(struct uart_dev_s *dev, int ch);
static void ez80_txint(struct uart_dev_s *dev, boolean enable); static void ez80_txint(struct uart_dev_s *dev, bool enable);
static boolean ez80_txready(struct uart_dev_s *dev); static bool ez80_txready(struct uart_dev_s *dev);
static boolean ez80_txempty(struct uart_dev_s *dev); static bool ez80_txempty(struct uart_dev_s *dev);
/**************************************************************************** /****************************************************************************
* Private Variables * Private Variables
@ -141,12 +143,12 @@ static struct ez80_dev_s g_uart0priv =
static uart_dev_t g_uart0port = static uart_dev_t g_uart0port =
{ {
0, /* open_count */ 0, /* open_count */
FALSE, /* xmitwaiting */ false, /* xmitwaiting */
FALSE, /* recvwaiting */ false, /* recvwaiting */
#ifdef CONFIG_UART0_SERIAL_CONSOLE #ifdef CONFIG_UART0_SERIAL_CONSOLE
TRUE, /* isconsole */ true, /* isconsole */
#else #else
FALSE, /* isconsole */ false, /* isconsole */
#endif #endif
{ 0 }, /* closesem */ { 0 }, /* closesem */
{ 0 }, /* xmitsem */ { 0 }, /* xmitsem */
@ -186,12 +188,12 @@ static struct ez80_dev_s g_uart1priv =
static uart_dev_t g_uart1port = static uart_dev_t g_uart1port =
{ {
0, /* open_count */ 0, /* open_count */
FALSE, /* xmitwaiting */ false, /* xmitwaiting */
FALSE, /* recvwaiting */ false, /* recvwaiting */
#ifdef CONFIG_UART1_SERIAL_CONSOLE #ifdef CONFIG_UART1_SERIAL_CONSOLE
TRUE, /* isconsole */ true, /* isconsole */
#else #else
FALSE, /* isconsole */ false, /* isconsole */
#endif #endif
{ 0 }, /* closesem */ { 0 }, /* closesem */
{ 0 }, /* xmitsem */ { 0 }, /* xmitsem */
@ -246,7 +248,7 @@ static uart_dev_t g_uart1port =
* Name: ez80_serialin * Name: ez80_serialin
****************************************************************************/ ****************************************************************************/
static inline ubyte ez80_serialin(struct ez80_dev_s *priv, ubyte offset) static inline uint8_t ez80_serialin(struct ez80_dev_s *priv, uint8_t offset)
{ {
return inp(priv->uartbase + offset); return inp(priv->uartbase + offset);
} }
@ -255,7 +257,8 @@ static inline ubyte ez80_serialin(struct ez80_dev_s *priv, ubyte offset)
* Name: ez80_serialout * Name: ez80_serialout
****************************************************************************/ ****************************************************************************/
static inline void ez80_serialout(struct ez80_dev_s *priv, ubyte offset, ubyte value) static inline void ez80_serialout(struct ez80_dev_s *priv, uint8_t offset,
uint8_t value)
{ {
outp(priv->uartbase + offset, value); outp(priv->uartbase + offset, value);
} }
@ -266,7 +269,7 @@ static inline void ez80_serialout(struct ez80_dev_s *priv, ubyte offset, ubyte v
static inline void ez80_disableuartint(struct ez80_dev_s *priv) static inline void ez80_disableuartint(struct ez80_dev_s *priv)
{ {
ubyte ier = ez80_serialin(priv, EZ80_UART_IER); uint8_t ier = ez80_serialin(priv, EZ80_UART_IER);
ier &= ~EZ80_UARTEIR_INTMASK; ier &= ~EZ80_UARTEIR_INTMASK;
ez80_serialout(priv, EZ80_UART_IER, ier); ez80_serialout(priv, EZ80_UART_IER, ier);
} }
@ -275,9 +278,9 @@ static inline void ez80_disableuartint(struct ez80_dev_s *priv)
* Name: ez80_restoreuartint * Name: ez80_restoreuartint
****************************************************************************/ ****************************************************************************/
static inline void ez80_restoreuartint(struct ez80_dev_s *priv, ubyte bits) static inline void ez80_restoreuartint(struct ez80_dev_s *priv, uint8_t bits)
{ {
ubyte ier = ez80_serialin(priv, EZ80_UART_IER); uint8_t ier = ez80_serialin(priv, EZ80_UART_IER);
ier |= bits & (EZ80_UARTEIR_TIE|EZ80_UARTEIR_RIE); ier |= bits & (EZ80_UARTEIR_TIE|EZ80_UARTEIR_RIE);
ez80_serialout(priv, EZ80_UART_IER, ier); ez80_serialout(priv, EZ80_UART_IER, ier);
} }
@ -303,10 +306,10 @@ static inline void ez80_waittxready(struct ez80_dev_s *priv)
* Name: ez80_setbaud * Name: ez80_setbaud
****************************************************************************/ ****************************************************************************/
static inline void ez80_setbaud(struct ez80_dev_s *priv, uint24 baud) static inline void ez80_setbaud(struct ez80_dev_s *priv, uint24_t baud)
{ {
uint32 brg_divisor; uint32_t brg_divisor;
ubyte lctl; uint8_t lctl;
/* The resulting BAUD and depends on the system clock frequency and the /* The resulting BAUD and depends on the system clock frequency and the
* BRG divisor as follows: * BRG divisor as follows:
@ -326,8 +329,8 @@ static inline void ez80_setbaud(struct ez80_dev_s *priv, uint24 baud)
lctl |= EZ80_UARTLCTL_DLAB; lctl |= EZ80_UARTLCTL_DLAB;
ez80_serialout(priv, EZ80_UART_LCTL, lctl); ez80_serialout(priv, EZ80_UART_LCTL, lctl);
ez80_serialout(priv, EZ80_UART_BRGL, (ubyte)(brg_divisor & 0xff)); ez80_serialout(priv, EZ80_UART_BRGL, (uint8_t)(brg_divisor & 0xff));
ez80_serialout(priv, EZ80_UART_BRGH, (ubyte)(brg_divisor >> 8)); ez80_serialout(priv, EZ80_UART_BRGH, (uint8_t)(brg_divisor >> 8));
lctl &= ~EZ80_UARTLCTL_DLAB; lctl &= ~EZ80_UARTLCTL_DLAB;
ez80_serialout(priv, EZ80_UART_LCTL, lctl); ez80_serialout(priv, EZ80_UART_LCTL, lctl);
@ -346,8 +349,8 @@ static int ez80_setup(struct uart_dev_s *dev)
{ {
#ifndef CONFIG_SUPPRESS_UART_CONFIG #ifndef CONFIG_SUPPRESS_UART_CONFIG
struct ez80_dev_s *priv = dev->priv; struct ez80_dev_s *priv = dev->priv;
ubyte reg; uint8_t reg;
ubyte cval; uint8_t cval;
if (priv->bits == 7) if (priv->bits == 7)
{ {
@ -441,8 +444,8 @@ static int ez80_attach(struct uart_dev_s *dev)
* *
* Description: * Description:
* Detach UART interrupts. This method is called when the serial port is * Detach UART interrupts. This method is called when the serial port is
* closed normally just before the shutdown method is called. The exception is * closed normally just before the shutdown method is called. The exception
* the serial console which is never shutdown. * is the serial console which is never shutdown.
* *
****************************************************************************/ ****************************************************************************/
@ -470,7 +473,7 @@ static int ez80_interrrupt(int irq, void *context)
{ {
struct uart_dev_s *dev = NULL; struct uart_dev_s *dev = NULL;
struct ez80_dev_s *priv; struct ez80_dev_s *priv;
volatile uint32 cause; volatile uint32_t cause;
#ifndef CONFIG_UART0_DISABLE #ifndef CONFIG_UART0_DISABLE
if (g_uart0priv.irq == irq) if (g_uart0priv.irq == irq)
@ -539,8 +542,8 @@ static int ez80_ioctl(struct file *filep, int cmd, unsigned long arg)
static int ez80_receive(struct uart_dev_s *dev, unsigned int *status) static int ez80_receive(struct uart_dev_s *dev, unsigned int *status)
{ {
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv; struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
ubyte rbr = ez80_serialin(priv, EZ80_UART_RBR); uint8_t rbr = ez80_serialin(priv, EZ80_UART_RBR);
ubyte lsr = ez80_serialin(priv, EZ80_UART_LSR); uint8_t lsr = ez80_serialin(priv, EZ80_UART_LSR);
*status = (unsigned int)lsr; *status = (unsigned int)lsr;
return rbr; return rbr;
@ -554,10 +557,10 @@ static int ez80_receive(struct uart_dev_s *dev, unsigned int *status)
* *
****************************************************************************/ ****************************************************************************/
static void ez80_rxint(struct uart_dev_s *dev, boolean enable) static void ez80_rxint(struct uart_dev_s *dev, bool enable)
{ {
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv; struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
ubyte ier = ez80_serialin(priv, EZ80_UART_IER); uint8_t ier = ez80_serialin(priv, EZ80_UART_IER);
if (enable) if (enable)
{ {
@ -577,11 +580,11 @@ static void ez80_rxint(struct uart_dev_s *dev, boolean enable)
* Name: ez80_rxavailable * Name: ez80_rxavailable
* *
* Description: * Description:
* Return TRUE if the receive fifo is not empty * Return true if the receive fifo is not empty
* *
****************************************************************************/ ****************************************************************************/
static boolean ez80_rxavailable(struct uart_dev_s *dev) static bool ez80_rxavailable(struct uart_dev_s *dev)
{ {
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv; struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
return (ez80_serialin(priv, EZ80_UART_LSR) & EZ80_UARTLSR_DR) != 0; return (ez80_serialin(priv, EZ80_UART_LSR) & EZ80_UARTLSR_DR) != 0;
@ -598,7 +601,7 @@ static boolean ez80_rxavailable(struct uart_dev_s *dev)
static void ez80_send(struct uart_dev_s *dev, int ch) static void ez80_send(struct uart_dev_s *dev, int ch)
{ {
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv; struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
ez80_serialout(priv, EZ80_UART_THR, (ubyte)ch); ez80_serialout(priv, EZ80_UART_THR, (uint8_t)ch);
} }
/**************************************************************************** /****************************************************************************
@ -609,10 +612,10 @@ static void ez80_send(struct uart_dev_s *dev, int ch)
* *
****************************************************************************/ ****************************************************************************/
static void ez80_txint(struct uart_dev_s *dev, boolean enable) static void ez80_txint(struct uart_dev_s *dev, bool enable)
{ {
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv; struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
ubyte ier = ez80_serialin(priv, EZ80_UART_IER); uint8_t ier = ez80_serialin(priv, EZ80_UART_IER);
if (enable) if (enable)
{ {
@ -632,11 +635,11 @@ static void ez80_txint(struct uart_dev_s *dev, boolean enable)
* Name: ez80_txready * Name: ez80_txready
* *
* Description: * Description:
* Return TRUE if the tranmsit fifo is not full * Return true if the tranmsit fifo is not full
* *
****************************************************************************/ ****************************************************************************/
static boolean ez80_txready(struct uart_dev_s *dev) static bool ez80_txready(struct uart_dev_s *dev)
{ {
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv; struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
return (ez80_serialin(priv, EZ80_UART_LSR) & EZ80_UARTLSR_THRE) != 0; return (ez80_serialin(priv, EZ80_UART_LSR) & EZ80_UARTLSR_THRE) != 0;
@ -646,11 +649,11 @@ static boolean ez80_txready(struct uart_dev_s *dev)
* Name: ez80_txempty * Name: ez80_txempty
* *
* Description: * Description:
* Return TRUE if the transmit fifo is empty * Return true if the transmit fifo is empty
* *
****************************************************************************/ ****************************************************************************/
static boolean ez80_txempty(struct uart_dev_s *dev) static bool ez80_txempty(struct uart_dev_s *dev)
{ {
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv; struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
return (ez80_serialin(priv, EZ80_UART_LSR) & EZ80_UARTLSR_TEMT) != 0; return (ez80_serialin(priv, EZ80_UART_LSR) & EZ80_UARTLSR_TEMT) != 0;
@ -670,7 +673,7 @@ static boolean ez80_txempty(struct uart_dev_s *dev)
void up_serialinit(void) void up_serialinit(void)
{ {
ubyte regval; uint8_t regval;
/* Make sure that all UART interrupts are disabled */ /* Make sure that all UART interrupts are disabled */
@ -716,7 +719,7 @@ void up_serialinit(void)
/* If there is a console, then configure the console now */ /* If there is a console, then configure the console now */
#ifdef CONSOLE_DEV #ifdef CONSOLE_DEV
CONSOLE_DEV.isconsole = TRUE; CONSOLE_DEV.isconsole = true;
ez80_setup(&CONSOLE_DEV); ez80_setup(&CONSOLE_DEV);
#endif #endif
@ -744,7 +747,7 @@ int up_putc(int ch)
{ {
#ifdef CONSOLE_DEV #ifdef CONSOLE_DEV
struct ez80_dev_s *priv = (struct ez80_dev_s*)CONSOLE_DEV.priv; struct ez80_dev_s *priv = (struct ez80_dev_s*)CONSOLE_DEV.priv;
ubyte ier = ez80_serialin(priv, EZ80_UART_IER); uint8_t ier = ez80_serialin(priv, EZ80_UART_IER);
ez80_disableuartint(priv); ez80_disableuartint(priv);
@ -761,7 +764,7 @@ int up_putc(int ch)
/* Output the character */ /* Output the character */
ez80_waittxready(priv); ez80_waittxready(priv);
ez80_serialout(priv, EZ80_UART_THR, (ubyte)ch); ez80_serialout(priv, EZ80_UART_THR, (uint8_t)ch);
/* Wait for the character to be sent before re-enabling interrupts */ /* Wait for the character to be sent before re-enabling interrupts */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/ez80/ez80_sigdeliver.c * arch/z80/src/ez80/ez80_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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <sched.h> #include <sched.h>
#include <debug.h> #include <debug.h>

View File

@ -38,7 +38,9 @@
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <nuttx/spi.h>
#include <sys/types.h>
#include <stdint.h>
#include <arch/board/board.h> #include <arch/board/board.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
@ -65,11 +67,14 @@
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static uint32 spi_setfrequency(FAR struct spi_dev_s *dev, uint32 frequency); static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev,
uint32_t frequency);
static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode); static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode);
static uint16 spi_send(FAR struct spi_dev_s *dev, uint16 wd); static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd);
static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const ubyte *buffer, size_t buflen); static void spi_sndblock(FAR struct spi_dev_s *dev,
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR ubyte *buffer, size_t buflen); FAR const uint8_t *buffer, size_t buflen);
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR uint8_t *buffer,
size_t buflen);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
@ -119,7 +124,7 @@ static struct spi_dev_s g_spidev = { &g_spiops };
* *
****************************************************************************/ ****************************************************************************/
static uint32 spi_setfrequency(FAR struct spi_dev_s *dev, uint32 frequency) static uint32_t spi_setfrequency(FAR struct spi_dev_s *dev, uint32_t frequency)
{ {
/* We want select divisor to provide the highest frequency (SPIR) that does NOT /* We want select divisor to provide the highest frequency (SPIR) that does NOT
* exceed the requested frequency.: * exceed the requested frequency.:
@ -131,7 +136,7 @@ static uint32 spi_setfrequency(FAR struct spi_dev_s *dev, uint32 frequency)
* BRG >= System Clock Frequency / (2 * SPIR) * BRG >= System Clock Frequency / (2 * SPIR)
*/ */
uint32 brg = ((EZ80_SYS_CLK_FREQ+1)/2 + frequency - 1) / frequency; uint32_t brg = ((EZ80_SYS_CLK_FREQ+1)/2 + frequency - 1) / frequency;
/* "When configured as a Master, the 16-bit divisor value must be between /* "When configured as a Master, the 16-bit divisor value must be between
* 0003h and FFFFh, inclusive. When configured as a Slave, the 16-bit * 0003h and FFFFh, inclusive. When configured as a Slave, the 16-bit
@ -170,8 +175,8 @@ static uint32 spi_setfrequency(FAR struct spi_dev_s *dev, uint32 frequency)
static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
{ {
ubyte modebits; uint8_t modebits;
ubyte regval; uint8_t regval;
/* Select the CTL register bits based on the selected mode */ /* Select the CTL register bits based on the selected mode */
@ -220,9 +225,9 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode)
* *
****************************************************************************/ ****************************************************************************/
static ubyte spi_waitspif(void) static uint8_t spi_waitspif(void)
{ {
ubyte status; uint8_t status;
/* Wait for the device to be ready to accept another byte (or for an error /* Wait for the device to be ready to accept another byte (or for an error
* to be reported * to be reported
@ -250,9 +255,9 @@ static ubyte spi_waitspif(void)
* *
****************************************************************************/ ****************************************************************************/
static ubyte spi_transfer(ubyte ch) static uint8_t spi_transfer(uint8_t ch)
{ {
ubyte status; uint8_t status;
/* Send the byte, repeating if some error occurs */ /* Send the byte, repeating if some error occurs */
@ -286,9 +291,9 @@ static ubyte spi_transfer(ubyte ch)
* *
****************************************************************************/ ****************************************************************************/
static uint16 spi_send(FAR struct spi_dev_s *dev, uint16 wd) static uint16_t spi_send(FAR struct spi_dev_s *dev, uint16_t wd)
{ {
return spi_transfer((ubyte)wd); return spi_transfer((uint8_t)wd);
} }
/************************************************************************* /*************************************************************************
@ -303,17 +308,19 @@ static uint16 spi_send(FAR struct spi_dev_s *dev, uint16 wd)
* buflen - the length of data to send from the buffer in number of words. * buflen - the length of data to send from the buffer in number of words.
* The wordsize is determined by the number of bits-per-word * The wordsize is determined by the number of bits-per-word
* selected for the SPI interface. If nbits <= 8, the data is * selected for the SPI interface. If nbits <= 8, the data is
* packed into ubytes; if nbits >8, the data is packed into uint16's * packed into uint8_t's; if nbits >8, the data is packed into
* uint16_t's
* *
* Returned Value: * Returned Value:
* None * None
* *
****************************************************************************/ ****************************************************************************/
static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size_t buflen) static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer,
size_t buflen)
{ {
FAR const ubyte *ptr = (FAR const ubyte*)buffer; FAR const uint8_t *ptr = (FAR const uint8_t*)buffer;
ubyte response; uint8_t response;
/* Loop while thre are bytes remaining to be sent */ /* Loop while thre are bytes remaining to be sent */
@ -335,7 +342,8 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size
* buflen - the length of data that can be received in the buffer in number * buflen - the length of data that can be received in the buffer in number
* of words. The wordsize is determined by the number of bits-per-word * of words. The wordsize is determined by the number of bits-per-word
* selected for the SPI interface. If nbits <= 8, the data is * selected for the SPI interface. If nbits <= 8, the data is
* packed into ubytes; if nbits >8, the data is packed into uint16's * packed into uint8_t's; if nbits >8, the data is packed into
* uint16_t's
* *
* Returned Value: * Returned Value:
* None * None
@ -344,8 +352,8 @@ static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const void *buffer, size
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t buflen) static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t buflen)
{ {
FAR ubyte *ptr = (FAR ubyte*)buffer; FAR uint8_t *ptr = (FAR uint8_t*)buffer;
ubyte response; uint8_t response;
/* Loop while thre are bytes remaining to be sent */ /* Loop while thre are bytes remaining to be sent */
@ -383,7 +391,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *buffer, size_t bu
FAR struct spi_dev_s *up_spiinitialize(int port) FAR struct spi_dev_s *up_spiinitialize(int port)
{ {
ubyte regval; uint8_t regval;
/* Only the SPI1 interface is supported */ /* Only the SPI1 interface is supported */

View File

@ -1,7 +1,7 @@
/*************************************************************************** /***************************************************************************
* arch/z80/src/ez80/ez80_timerisr.c * arch/z80/src/ez80/ez80_timerisr.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <debug.h> #include <debug.h>
#include <arch/io.h> #include <arch/io.h>
@ -76,7 +76,7 @@
int up_timerisr(int irq, chipreg_t *regs) int up_timerisr(int irq, chipreg_t *regs)
{ {
volatile ubyte reg; volatile uint8_t reg;
/* Read the appropropriate timer0 registr to clear the interrupt */ /* Read the appropropriate timer0 registr to clear the interrupt */
@ -112,8 +112,8 @@ int up_timerisr(int irq, chipreg_t *regs)
void up_timerinit(void) void up_timerinit(void)
{ {
uint16 reload; uint16_t) reload;
ubyte reg; uint8_t reg;
/* Disable the timer */ /* Disable the timer */
@ -142,9 +142,9 @@ void up_timerinit(void)
* NOTE: The system clock frequency value is defined in the board.h file * NOTE: The system clock frequency value is defined in the board.h file
*/ */
reload = (uint16)(ez80_systemclock / 1600); reload = (uint16_t))(ez80_systemclock / 1600);
outp(EZ80_TMR0_RRH, (ubyte)(reload >> 8)); outp(EZ80_TMR0_RRH, (uint8_t)(reload >> 8));
outp(EZ80_TMR0_RRL, (ubyte)(reload)); outp(EZ80_TMR0_RRL, (uint8_t)(reload));
/* Clear any pending timer interrupts */ /* Clear any pending timer interrupts */

View File

@ -2,7 +2,7 @@
* arch/z80/src/ez80/ez80f91_emac.h * arch/z80/src/ez80/ez80f91_emac.h
* arch/z80/src/chip/ez80f91_emac.h * arch/z80/src/chip/ez80f91_emac.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,6 +41,10 @@
* Included Files * Included Files
************************************************************************************/ ************************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/************************************************************************************ /************************************************************************************
* Definitions * Definitions
************************************************************************************/ ************************************************************************************/
@ -249,11 +253,11 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
struct ez80emac_desc_s struct ez80emac_desc_s
{ {
uint24 np; /* Pointer to the start of the next packet */ uint24_t np; /* Pointer to the start of the next packet */
uint16 pktsize; /* Number of bytes in the packet, including the 4 CRC uint16_t pktsize; /* Number of bytes in the packet, including the 4 CRC
* bytes, but excluding the 7 descriptor table bytes. */ * bytes, but excluding the 7 descriptor table bytes. */
uint16 stat; /* Status of the packet. Differs for TX and RX packets uint16_t stat; /* Status of the packet. Differs for TX and RX packets
* (see EMAC_RX/TXDESC_* definitions) */ * (see EMAC_RX/TXDESC_* definitions) */
}; };
#endif #endif

View File

@ -42,7 +42,6 @@
************************************************************************************/ ************************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
/************************************************************************************ /************************************************************************************
* Definitions * Definitions

View File

@ -42,7 +42,8 @@
************************************************************************************/ ************************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <stdbool.h>
#include <nuttx/spi.h> #include <nuttx/spi.h>
/************************************************************************************ /************************************************************************************
@ -113,8 +114,8 @@ extern "C" {
* for example, will bind the SPI driver to the SPI MMC/SD driver). * for example, will bind the SPI driver to the SPI MMC/SD driver).
*/ */
EXTERN void ez80_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, boolean selected); EXTERN void ez80_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
EXTERN ubyte ez80_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid); EXTERN uint8_t ez80_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
#undef EXTERN #undef EXTERN
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -2,7 +2,7 @@
* arch/z80/src/ez80/switch.h * arch/z80/src/ez80/switch.h
* arch/z80/src/chip/switch.h * arch/z80/src/chip/switch.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,7 +41,6 @@
* Included Files * Included Files
************************************************************************************/ ************************************************************************************/
#include <sys/types.h>
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
# include <nuttx/sched.h> # include <nuttx/sched.h>
# include <nuttx/arch.h> # include <nuttx/arch.h>
@ -62,7 +61,7 @@
#define INIT_IRQCONTEXT() current_regs = NULL #define INIT_IRQCONTEXT() current_regs = NULL
/* IN_INTERRUPT returns TRUE if the system is current operating in the interrupt /* IN_INTERRUPT returns true if the system is current operating in the interrupt
* context. IN_INTERRUPT is the inline equivalent of up_interrupt_context(). * context. IN_INTERRUPT is the inline equivalent of up_interrupt_context().
*/ */

View File

@ -2,7 +2,7 @@
* arch/z80/src/ez80/up_mem.h * arch/z80/src/ez80/up_mem.h
* arch/z80/src/chip/up_mem.h * arch/z80/src/chip/up_mem.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,6 +41,8 @@
* Included Files * Included Files
************************************************************************************/ ************************************************************************************/
#include <stdint.h>
/************************************************************************************ /************************************************************************************
* Definitions * Definitions
************************************************************************************/ ************************************************************************************/
@ -57,12 +59,12 @@
#ifndef CONFIG_HEAP1_BASE #ifndef CONFIG_HEAP1_BASE
extern unsigned long _heapbot; extern unsigned long _heapbot;
# define CONFIG_HEAP1_BASE ((uint24)&_heapbot) # define CONFIG_HEAP1_BASE ((uint24_t)&_heapbot)
#endif #endif
#ifndef CONFIG_HEAP1_END #ifndef CONFIG_HEAP1_END
extern unsigned long _stack; extern unsigned long _stack;
# define CONFIG_HEAP1_END (((uint24)&_stack) - CONFIG_IDLETHREAD_STACKSIZE) # define CONFIG_HEAP1_END (((uint24_t)&_stack) - CONFIG_IDLETHREAD_STACKSIZE)
#endif #endif
/************************************************************************************ /************************************************************************************

View File

@ -41,6 +41,10 @@
* Included Files * Included Files
************************************************************************************/ ************************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/************************************************************************************ /************************************************************************************
* Definitions * Definitions
************************************************************************************/ ************************************************************************************/
@ -118,11 +122,11 @@
/* UART0/1 Base Register Addresses **************************************************/ /* UART0/1 Base Register Addresses **************************************************/
#ifdef EZ8_UART0 #ifdef EZ8_UART0
# define Z8_UART0_BASE ((ubyte volatile far*)0xf40) # define Z8_UART0_BASE ((uint8_t volatile far*)0xf40)
#endif #endif
#ifdef EZ8_UART1 #ifdef EZ8_UART1
# define Z8_UART1_BASE ((ubyte volatile far*)0xf48) # define Z8_UART1_BASE ((uint8_t volatile far*)0xf48)
#endif #endif
/* UART0/1 Status 0 Register Bit Definitions ****************************************/ /* UART0/1 Status 0 Register Bit Definitions ****************************************/

View File

@ -2,7 +2,7 @@
* arch/z80/src/z8/switch.h * arch/z80/src/z8/switch.h
* arch/z80/src/chip/switch.h * arch/z80/src/chip/switch.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,8 +41,8 @@
* Included Files * Included Files
************************************************************************************/ ************************************************************************************/
#include <sys/types.h>
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
# include <stdint.h>
# include <nuttx/sched.h> # include <nuttx/sched.h>
# include <nuttx/arch.h> # include <nuttx/arch.h>
#endif #endif
@ -63,7 +63,7 @@
#define Z8_IRQSTATE_SAVED 2 /* In interrupt, context has been saved */ #define Z8_IRQSTATE_SAVED 2 /* In interrupt, context has been saved */
/* The information saved on interrupt entry can be retained in a array of two /* The information saved on interrupt entry can be retained in a array of two
* uint16 values. These are * uint24_t values. These are
* *
* value[0] = RP (MS byte) and Flags (LS) byte * value[0] = RP (MS byte) and Flags (LS) byte
* value[1] = PC * value[1] = PC
@ -105,7 +105,7 @@
g_z8irqstate.state = Z8_IRQSTATE_NONE; \ g_z8irqstate.state = Z8_IRQSTATE_NONE; \
} while (0) } while (0)
/* IN_INTERRUPT returns TRUE if the system is current operating in the interrupt /* IN_INTERRUPT returns true if the system is current operating in the interrupt
* context. IN_INTERRUPT is the inline equivalent of up_interrupt_context(). * context. IN_INTERRUPT is the inline equivalent of up_interrupt_context().
*/ */
@ -189,7 +189,7 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
struct z8_irqstate_s struct z8_irqstate_s
{ {
ubyte state; /* See Z8_IRQSTATE_* definitions above */ uint8_t state; /* See Z8_IRQSTATE_* definitions above */
chipreg_t *regs; /* Saved register information */ chipreg_t *regs; /* Saved register information */
}; };
#endif #endif

View File

@ -2,7 +2,7 @@
* arch/z80/src/z8/up_mem.h * arch/z80/src/z8/up_mem.h
* arch/z80/src/chip/up_mem.h * arch/z80/src/chip/up_mem.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,6 +41,8 @@
* Included Files * Included Files
************************************************************************************/ ************************************************************************************/
#include <stdint.h>
/************************************************************************************ /************************************************************************************
* Definitions * Definitions
************************************************************************************/ ************************************************************************************/
@ -57,12 +59,12 @@
#ifndef CONFIG_HEAP1_BASE #ifndef CONFIG_HEAP1_BASE
extern far unsigned long far_heapbot; extern far unsigned long far_heapbot;
# define CONFIG_HEAP1_BASE ((uint16)&far_heapbot) # define CONFIG_HEAP1_BASE ((uint16_t))&far_heapbot)
#endif #endif
#ifndef CONFIG_HEAP1_END #ifndef CONFIG_HEAP1_END
extern far unsigned long far_stacktop; extern far unsigned long far_stacktop;
# define CONFIG_HEAP1_END (((uint16)&far_stacktop) - CONFIG_IDLETHREAD_STACKSIZE + 1) # define CONFIG_HEAP1_END (((uint16_t))&far_stacktop) - CONFIG_IDLETHREAD_STACKSIZE + 1)
#endif #endif
/************************************************************************************ /************************************************************************************

View File

@ -39,7 +39,8 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
#include <semaphore.h> #include <semaphore.h>
#include <errno.h> #include <errno.h>
@ -63,8 +64,8 @@
struct z8_i2cdev_s struct z8_i2cdev_s
{ {
const struct i2c_ops_s *ops; /* I2C vtable */ const struct i2c_ops_s *ops; /* I2C vtable */
uint16 brg; /* Baud rate generator value */ uint16_t brg; /* Baud rate generator value */
ubyte addr; /* 8-bit address */ uint8_t addr; /* 8-bit address */
}; };
/**************************************************************************** /****************************************************************************
@ -75,15 +76,15 @@ struct z8_i2cdev_s
static void i2c_waittxempty(void); static void i2c_waittxempty(void);
static void i2c_waitrxavail(void); static void i2c_waitrxavail(void);
static void i2c_setbrg(uint16 brg); static void i2c_setbrg(uint16_t brg);
static uint16 i2c_getbrg(uint32 frequency); static uint16_t i2c_getbrg(uint32_t frequency);
/* I2C methods */ /* I2C methods */
static uint32 i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32 frequency); static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency);
static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits); static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits);
static int i2c_write(FAR struct i2c_dev_s *dev, const ubyte *buffer, int buflen); static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen);
static int i2c_read(FAR struct i2c_dev_s *dev, ubyte *buffer, int buflen); static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen);
/**************************************************************************** /****************************************************************************
* Public Function Prototypes * Public Function Prototypes
@ -91,15 +92,15 @@ static int i2c_read(FAR struct i2c_dev_s *dev, ubyte *buffer, int buflen);
/* This function is normally prototyped int the ZiLOG header file sio.h */ /* This function is normally prototyped int the ZiLOG header file sio.h */
extern uint32 get_freq(void); extern uint32_t get_freq(void);
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
static uint16 g_currbrg; /* Current BRG setting */ static uint16_t g_currbrg; /* Current BRG setting */
static boolean g_initialized; /* TRUE:I2C has been initialized */ static bool g_initialized; /* true:I2C has been initialized */
static sem_t g_i2csem; /* Serialize I2C transfers */ static sem_t g_i2csem; /* Serialize I2C transfers */
const struct i2c_ops_s g_ops = const struct i2c_ops_s g_ops =
{ {
@ -196,12 +197,12 @@ static void i2c_waitrxavail(void)
* *
****************************************************************************/ ****************************************************************************/
static void i2c_setbrg(uint16 brg) static void i2c_setbrg(uint16_t brg)
{ {
if (g_currbrg != brg) if (g_currbrg != brg)
{ {
I2CBRH = (ubyte)(brg >> 8); I2CBRH = (uint8_t)(brg >> 8);
I2CBRL = (ubyte)(brg & 0xff); I2CBRL = (uint8_t)(brg & 0xff);
g_currbrg = brg; g_currbrg = brg;
} }
} }
@ -220,9 +221,9 @@ static void i2c_setbrg(uint16 brg)
* *
****************************************************************************/ ****************************************************************************/
static uint16 i2c_getbrg(uint32 frequency) static uint16_t i2c_getbrg(uint32_t frequency)
{ {
uint32 sysclock = get_freq(); uint32_t sysclock = get_freq();
/* Max is 400 Kb/sec */ /* Max is 400 Kb/sec */
@ -253,7 +254,7 @@ static uint16 i2c_getbrg(uint32 frequency)
* *
****************************************************************************/ ****************************************************************************/
static uint32 i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32 frequency) static uint32_t i2c_setfrequency(FAR struct i2c_dev_s *dev, uint32_t frequency)
{ {
FAR struct z8_i2cdev_s *priv = (FAR struct z8_i2cdev_s *)dev; FAR struct z8_i2cdev_s *priv = (FAR struct z8_i2cdev_s *)dev;
@ -307,7 +308,7 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
/* Save the 7-bit address (10-bit address not yet supported) */ /* Save the 7-bit address (10-bit address not yet supported) */
DEBUGASSERT(nbits == 7); DEBUGASSERT(nbits == 7);
priv->addr = (ubyte)addr; priv->addr = (uint8_t)addr;
return OK; return OK;
} }
@ -330,10 +331,10 @@ static int i2c_setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits)
* *
****************************************************************************/ ****************************************************************************/
static int i2c_write(FAR struct i2c_dev_s *dev, const ubyte *buffer, int buflen) static int i2c_write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen)
{ {
FAR struct z8_i2cdev_s *priv = (FAR struct z8_i2cdev_s *)dev; FAR struct z8_i2cdev_s *priv = (FAR struct z8_i2cdev_s *)dev;
const ubyte *ptr; const uint8_t *ptr;
int retry; int retry;
int count; int count;
@ -443,10 +444,10 @@ static int i2c_write(FAR struct i2c_dev_s *dev, const ubyte *buffer, int buflen)
* *
****************************************************************************/ ****************************************************************************/
static int i2c_read(FAR struct i2c_dev_s *dev, ubyte *buffer, int buflen) static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen)
{ {
FAR struct z8_i2cdev_s *priv = (FAR struct z8_i2cdev_s *)dev; FAR struct z8_i2cdev_s *priv = (FAR struct z8_i2cdev_s *)dev;
ubyte *ptr; uint8_t *ptr;
int retry; int retry;
int count; int count;
@ -570,7 +571,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port)
{ {
/* Set up some initial BRG value */ /* Set up some initial BRG value */
uint16 brg = i2c_getbrg(100*1000); uint16_t brg = i2c_getbrg(100*1000);
i2c_setbrg(brg); i2c_setbrg(brg);
/* Make sure that GPIOs are configured for the alternate function (this /* Make sure that GPIOs are configured for the alternate function (this

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/z8/z8_initialstate.c * arch/z80/src/z8/z8_initialstate.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <string.h> #include <string.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/z8/z8_irq.c * arch/z80/src/z8/z8_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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <ez8.h> #include <ez8.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/z8/z8_loweruart.c * arch/z80/src/z8/z8_loweruart.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <ez8.h> #include <ez8.h>
@ -51,7 +51,7 @@
#ifdef CONFIG_USE_LOWUARTINIT #ifdef CONFIG_USE_LOWUARTINIT
extern uint32 get_freq(void); extern uint32_t get_freq(void);
/**************************************************************************** /****************************************************************************
* Private Definitions * Private Definitions
@ -75,13 +75,13 @@ extern uint32 get_freq(void);
void up_lowuartinit(void) void up_lowuartinit(void)
{ {
uint32 freq = get_freq(); uint32_t freq = get_freq();
uint16 brg; uint16_t brg;
ubyte val; uint8_t val;
#ifdef CONFIG_UART0_SERIAL_CONSOLE #ifdef CONFIG_UART0_SERIAL_CONSOLE
brg = (freq +(uint32)CONFIG_UART0_BAUD * 8) /((uint32)CONFIG_UART0_BAUD * 16) ; brg = (freq +(uint32_t)CONFIG_UART0_BAUD * 8) /((uint32_t)CONFIG_UART0_BAUD * 16) ;
/* Set the baudrate */ /* Set the baudrate */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/z8/z8_registerdump.c * arch/z80/src/z8/z8_registerdump.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <debug.h> #include <debug.h>
#include <nuttx/irq.h> #include <nuttx/irq.h>
@ -78,7 +78,8 @@ static inline void z8_dumpregs(FAR chipret_t *regs)
regs[XCPT_RR8], regs[XCPT_RR10], regs[XCPT_RR12], regs[XCPT_RR14]); regs[XCPT_RR8], regs[XCPT_RR10], regs[XCPT_RR12], regs[XCPT_RR14]);
} }
static inline void z8_dumpstate(chipreg_t sp, chipreg_t pc, ubyte irqctl, chipreg_t rpflags) static inline void z8_dumpstate(chipreg_t sp, chipreg_t pc, uint8_t irqctl,
chipreg_t rpflags)
{ {
lldbg("SP: %04x PC: %04x IRQCTL: %02x RP: %02x FLAGS: %02x\n", lldbg("SP: %04x PC: %04x IRQCTL: %02x RP: %02x FLAGS: %02x\n",
sp, pc, irqctl & 0xff, rpflags >> 8, rpflags & 0xff); sp, pc, irqctl & 0xff, rpflags >> 8, rpflags & 0xff);
@ -100,7 +101,7 @@ void z8_registerdump(void)
FAR chipret_t *regs; FAR chipret_t *regs;
FAR chipret_t *state; FAR chipret_t *state;
chipreg_t sp; chipreg_t sp;
uint16 rp; uint16_t rp;
switch (g_z8irqstate.state) switch (g_z8irqstate.state)
{ {
@ -108,7 +109,7 @@ void z8_registerdump(void)
/* Calculate the source address based on the saved RP value */ /* Calculate the source address based on the saved RP value */
rp = g_z8irqstate.regs[Z8_IRQSAVE_RPFLAGS] >> 8; rp = g_z8irqstate.regs[Z8_IRQSAVE_RPFLAGS] >> 8;
regs = (FAR uint16*)(rp & 0xf0); regs = (FAR uint16_t*)(rp & 0xf0);
/* Then dump the register values */ /* Then dump the register values */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/z8/z8_saveirqcontext.c * arch/z80/src/z8/z8_saveirqcontext.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <arch/irq.h> #include <arch/irq.h>
#include "chip/switch.h" #include "chip/switch.h"
@ -93,8 +93,8 @@ void z8_saveirqcontext(FAR chipreg_t *regs)
{ {
/* Calculate the source address based on the saved RP value */ /* Calculate the source address based on the saved RP value */
uint16 rp = g_z8irqstate.regs[Z8_IRQSAVE_RPFLAGS] >> 8; uint16_t rp = g_z8irqstate.regs[Z8_IRQSAVE_RPFLAGS] >> 8;
FAR chipreg_t *src = (FAR uint16*)(rp & 0xf0); FAR chipreg_t *src = (FAR uint16_t*)(rp & 0xf0);
FAR chipreg_t *dest = &regs[XCPT_RR0]; FAR chipreg_t *dest = &regs[XCPT_RR0];
/* Copy the interrupted tasks register into the TCB register save area. */ /* Copy the interrupted tasks register into the TCB register save area. */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/z8/z8_schedulesigaction.c * arch/z80/src/z8/z8_schedulesigaction.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <sched.h> #include <sched.h>
#include <debug.h> #include <debug.h>
@ -123,7 +123,7 @@ static void z8_sigsetup(FAR _TCB *tcb, sig_deliver_t sigdeliver, FAR chipreg_t *
void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver) void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver)
{ {
dbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16)sigdeliver); dbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver);
/* Refuse to handle nested signal actions */ /* Refuse to handle nested signal actions */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/z8/z8_serial.c * arch/z80/src/z8/z8_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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -40,6 +40,8 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h> #include <unistd.h>
#include <semaphore.h> #include <semaphore.h>
#include <string.h> #include <string.h>
@ -58,7 +60,7 @@
#ifdef CONFIG_USE_SERIALDRIVER #ifdef CONFIG_USE_SERIALDRIVER
extern uint32 get_freq(void); extern uint32_t get_freq(void);
/**************************************************************************** /****************************************************************************
* Definitions * Definitions
@ -76,35 +78,35 @@ extern uint32 get_freq(void);
struct z8_uart_s struct z8_uart_s
{ {
ubyte volatile far* uartbase; /* Base address of UART registers */ uint8_t volatile far* uartbase; /* Base address of UART registers */
uint32 baud; /* Configured baud */ uint32_t baud; /* Configured baud */
boolean rxenabled; /* RX interrupt enabled */ bool rxenabled; /* RX interrupt enabled */
boolean txenabled; /* TX interrupt enabled */ bool txenabled; /* TX interrupt enabled */
ubyte rxirq; /* RX IRQ associated with this UART */ uint8_t rxirq; /* RX IRQ associated with this UART */
ubyte txirq; /* RX IRQ associated with this UART */ uint8_t txirq; /* RX IRQ associated with this UART */
ubyte parity; /* 0=none, 1=odd, 2=even */ uint8_t parity; /* 0=none, 1=odd, 2=even */
boolean stopbits2; /* TRUE: Configure with 2 stop bits bool stopbits2; /* true: Configure with 2 stop bits
* (instead of 1) */ * (instead of 1) */
}; };
/**************************************************************************** /****************************************************************************
* Private Function Prototypes * Private Function Prototypes
****************************************************************************/ ****************************************************************************/
static int z8_setup(FAR struct uart_dev_s *dev); static int z8_setup(FAR struct uart_dev_s *dev);
static void z8_shutdown(FAR struct uart_dev_s *dev); static void z8_shutdown(FAR struct uart_dev_s *dev);
static int z8_attach(FAR struct uart_dev_s *dev); static int z8_attach(FAR struct uart_dev_s *dev);
static void z8_detach(FAR struct uart_dev_s *dev); static void z8_detach(FAR struct uart_dev_s *dev);
static int z8_rxinterrupt(int irq, FAR void *context); static int z8_rxinterrupt(int irq, FAR void *context);
static int z8_txinterrupt(int irq, FAR void *context); static int z8_txinterrupt(int irq, FAR void *context);
static int z8_ioctl(FAR struct file *filep, int cmd, unsigned long arg); static int z8_ioctl(FAR struct file *filep, int cmd, unsigned long arg);
static int z8_receive(FAR struct uart_dev_s *dev, FAR uint32 *status); static int z8_receive(FAR struct uart_dev_s *dev, FAR uint32_t *status);
static void z8_rxint(FAR struct uart_dev_s *dev, boolean enable); static void z8_rxint(FAR struct uart_dev_s *dev, bool enable);
static boolean z8_rxavailable(FAR struct uart_dev_s *dev); static bool z8_rxavailable(FAR struct uart_dev_s *dev);
static void z8_send(FAR struct uart_dev_s *dev, int ch); static void z8_send(FAR struct uart_dev_s *dev, int ch);
static void z8_txint(FAR struct uart_dev_s *dev, boolean enable); static void z8_txint(FAR struct uart_dev_s *dev, bool enable);
static boolean z8_txready(FAR struct uart_dev_s *dev); static bool z8_txready(FAR struct uart_dev_s *dev);
static boolean z8_txempty(FAR struct uart_dev_s *dev); static bool z8_txempty(FAR struct uart_dev_s *dev);
/**************************************************************************** /****************************************************************************
* Private Variables * Private Variables
@ -139,8 +141,8 @@ static struct z8_uart_s g_uart0priv =
{ {
Z8_UART0_BASE, /* uartbase */ Z8_UART0_BASE, /* uartbase */
CONFIG_UART0_BAUD, /* baud */ CONFIG_UART0_BAUD, /* baud */
FALSE, /* rxenabled */ false, /* rxenabled */
FALSE, /* txenabled */ false, /* txenabled */
Z8_UART0_RX_IRQ, /* rxirq */ Z8_UART0_RX_IRQ, /* rxirq */
Z8_UART0_TX_IRQ, /* txirq */ Z8_UART0_TX_IRQ, /* txirq */
CONFIG_UART0_PARITY, /* parity */ CONFIG_UART0_PARITY, /* parity */
@ -150,12 +152,12 @@ static struct z8_uart_s g_uart0priv =
static uart_dev_t g_uart0port = static uart_dev_t g_uart0port =
{ {
0, /* open_count */ 0, /* open_count */
FALSE, /* xmitwaiting */ false, /* xmitwaiting */
FALSE, /* recvwaiting */ false, /* recvwaiting */
#ifdef CONFIG_UART0_SERIAL_CONSOLE #ifdef CONFIG_UART0_SERIAL_CONSOLE
TRUE, /* isconsole */ true, /* isconsole */
#else #else
FALSE, /* isconsole */ false, /* isconsole */
#endif #endif
{ 0 }, /* closesem */ { 0 }, /* closesem */
{ 0 }, /* xmitsem */ { 0 }, /* xmitsem */
@ -184,8 +186,8 @@ static struct z8_uart_s g_uart1priv =
{ {
Z8_UART1_BASE, /* uartbase */ Z8_UART1_BASE, /* uartbase */
CONFIG_UART1_BAUD, /* baud */ CONFIG_UART1_BAUD, /* baud */
FALSE, /* rxenabled */ false, /* rxenabled */
FALSE, /* txenabled */ false, /* txenabled */
Z8_UART1_RX_IRQ, /* rxirq */ Z8_UART1_RX_IRQ, /* rxirq */
Z8_UART1_TX_IRQ, /* txirq */ Z8_UART1_TX_IRQ, /* txirq */
CONFIG_UART1_PARITY, /* parity */ CONFIG_UART1_PARITY, /* parity */
@ -195,12 +197,12 @@ static struct z8_uart_s g_uart1priv =
static uart_dev_t g_uart1port = static uart_dev_t g_uart1port =
{ {
0, /* open_count */ 0, /* open_count */
FALSE, /* xmitwaiting */ false, /* xmitwaiting */
FALSE, /* recvwaiting */ false, /* recvwaiting */
#ifdef CONFIG_UART1_SERIAL_CONSOLE #ifdef CONFIG_UART1_SERIAL_CONSOLE
TRUE, /* isconsole */ true, /* isconsole */
#else #else
FALSE, /* isconsole */ false, /* isconsole */
#endif #endif
{ 0 }, /* closesem */ { 0 }, /* closesem */
{ 0 }, /* xmitsem */ { 0 }, /* xmitsem */
@ -243,7 +245,8 @@ static uart_dev_t g_uart1port =
* Name: z8_putuart * Name: z8_putuart
****************************************************************************/ ****************************************************************************/
static inline void z8_putuart(FAR struct z8_uart_s *priv, ubyte value, ubyte offset) static inline void z8_putuart(FAR struct z8_uart_s *priv, uint8_t value,
uint8_t offset)
{ {
putreg8(value, *(priv->uartbase + offset)); putreg8(value, *(priv->uartbase + offset));
} }
@ -252,7 +255,7 @@ static inline void z8_putuart(FAR struct z8_uart_s *priv, ubyte value, ubyte off
* Name: z8_getuart * Name: z8_getuart
****************************************************************************/ ****************************************************************************/
static inline ubyte z8_getuart(FAR struct z8_uart_s *priv, ubyte offset) static inline uint8_t z8_getuart(FAR struct z8_uart_s *priv, uint8_t offset)
{ {
return getreg8(*(priv->uartbase + offset)); return getreg8(*(priv->uartbase + offset));
} }
@ -261,15 +264,15 @@ static inline ubyte z8_getuart(FAR struct z8_uart_s *priv, ubyte offset)
* Name: z8_disableuartirq * Name: z8_disableuartirq
****************************************************************************/ ****************************************************************************/
static ubyte z8_disableuartirq(FAR struct uart_dev_s *dev) static uint8_t z8_disableuartirq(FAR struct uart_dev_s *dev)
{ {
struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv; struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv;
irqstate_t flags = irqsave(); irqstate_t flags = irqsave();
ubyte state = priv->rxenabled ? STATE_RXENABLED : STATE_DISABLED | \ uint8_t state = priv->rxenabled ? STATE_RXENABLED : STATE_DISABLED | \
priv->txenabled ? STATE_TXENABLED : STATE_DISABLED; priv->txenabled ? STATE_TXENABLED : STATE_DISABLED;
z8_txint(dev, FALSE); z8_txint(dev, false);
z8_rxint(dev, FALSE); z8_rxint(dev, false);
irqrestore(flags); irqrestore(flags);
return state; return state;
@ -279,13 +282,13 @@ static ubyte z8_disableuartirq(FAR struct uart_dev_s *dev)
* Name: z8_restoreuartirq * Name: z8_restoreuartirq
****************************************************************************/ ****************************************************************************/
static void z8_restoreuartirq(FAR struct uart_dev_s *dev, ubyte state) static void z8_restoreuartirq(FAR struct uart_dev_s *dev, uint8_t state)
{ {
struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv; struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv;
irqstate_t flags = irqsave(); irqstate_t flags = irqsave();
z8_txint(dev, (state & STATE_TXENABLED) ? TRUE : FALSE); z8_txint(dev, (state & STATE_TXENABLED) ? true : false);
z8_rxint(dev, (state & STATE_RXENABLED) ? TRUE : FALSE); z8_rxint(dev, (state & STATE_RXENABLED) ? true : false);
irqrestore(flags); irqrestore(flags);
} }
@ -294,7 +297,7 @@ static void z8_restoreuartirq(FAR struct uart_dev_s *dev, ubyte state)
* Name: z8_consoleput * Name: z8_consoleput
****************************************************************************/ ****************************************************************************/
static void z8_consoleput(ubyte ch) static void z8_consoleput(uint8_t ch)
{ {
struct z8_uart_s *priv = (struct z8_uart_s*)CONSOLE_DEV.priv; struct z8_uart_s *priv = (struct z8_uart_s*)CONSOLE_DEV.priv;
int tmp; int tmp;
@ -319,8 +322,8 @@ static void z8_consoleput(ubyte ch)
void z8_uartconfigure(void) void z8_uartconfigure(void)
{ {
uint16 brg; uint16_t brg;
ubyte val; uint8_t val;
/* Configure GPIO Port A pins 4 & 5 for alternate function */ /* Configure GPIO Port A pins 4 & 5 for alternate function */
@ -364,10 +367,10 @@ static int z8_setup(FAR struct uart_dev_s *dev)
{ {
#ifndef CONFIG_SUPPRESS_UART_CONFIG #ifndef CONFIG_SUPPRESS_UART_CONFIG
struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv; struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv;
uint32 freq = get_freq(); uint32_t freq = get_freq();
uint16 brg; uint16_t brg;
ubyte ctl0; uint8_t ctl0;
ubyte ctl1; uint8_t ctl1;
/* Calculate and set the baud rate generation register. /* Calculate and set the baud rate generation register.
* BRG = (freq + baud * 8)/(baud * 16) * BRG = (freq + baud * 8)/(baud * 16)
@ -490,7 +493,7 @@ static int z8_rxinterrupt(int irq, FAR void *context)
{ {
struct uart_dev_s *dev = NULL; struct uart_dev_s *dev = NULL;
struct z8_uart_s *priv; struct z8_uart_s *priv;
ubyte status; uint8_t status;
if (g_uart1priv.rxirq == irq) if (g_uart1priv.rxirq == irq)
{ {
@ -539,7 +542,7 @@ static int z8_txinterrupt(int irq, FAR void *context)
{ {
struct uart_dev_s *dev = NULL; struct uart_dev_s *dev = NULL;
struct z8_uart_s *priv; struct z8_uart_s *priv;
ubyte status; uint8_t status;
if (g_uart1priv.txirq == irq) if (g_uart1priv.txirq == irq)
{ {
@ -592,15 +595,15 @@ static int z8_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
* *
****************************************************************************/ ****************************************************************************/
static int z8_receive(FAR struct uart_dev_s *dev, FAR uint32 *status) static int z8_receive(FAR struct uart_dev_s *dev, FAR uint32_t *status)
{ {
struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv; struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv;
ubyte rxd; uint8_t rxd;
ubyte stat0; uint8_t stat0;
rxd = z8_getuart(priv, Z8_UART_RXD); rxd = z8_getuart(priv, Z8_UART_RXD);
stat0 = z8_getuart(priv, Z8_UART_STAT0); stat0 = z8_getuart(priv, Z8_UART_STAT0);
*status = (uint32)rxd | (((uint32)stat0) << 8); *status = (uint32_t)rxd | (((uint32_t)stat0) << 8);
return rxd; return rxd;
} }
@ -612,7 +615,7 @@ static int z8_receive(FAR struct uart_dev_s *dev, FAR uint32 *status)
* *
****************************************************************************/ ****************************************************************************/
static void z8_rxint(FAR struct uart_dev_s *dev, boolean enable) static void z8_rxint(FAR struct uart_dev_s *dev, bool enable)
{ {
struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv; struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv;
irqstate_t flags = irqsave(); irqstate_t flags = irqsave();
@ -636,11 +639,11 @@ static void z8_rxint(FAR struct uart_dev_s *dev, boolean enable)
* Name: z8_rxavailable * Name: z8_rxavailable
* *
* Description: * Description:
* Return TRUE if the receive fifo is not empty * Return true if the receive fifo is not empty
* *
****************************************************************************/ ****************************************************************************/
static boolean z8_rxavailable(FAR struct uart_dev_s *dev) static bool z8_rxavailable(FAR struct uart_dev_s *dev)
{ {
struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv; struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv;
return ((z8_getuart(priv, Z8_UART_STAT0) & Z8_UARTSTAT0_RDA) != 0); return ((z8_getuart(priv, Z8_UART_STAT0) & Z8_UARTSTAT0_RDA) != 0);
@ -668,7 +671,7 @@ static void z8_send(FAR struct uart_dev_s *dev, int ch)
* *
****************************************************************************/ ****************************************************************************/
static void z8_txint(FAR struct uart_dev_s *dev, boolean enable) static void z8_txint(FAR struct uart_dev_s *dev, bool enable)
{ {
struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv; struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv;
irqstate_t flags = irqsave(); irqstate_t flags = irqsave();
@ -692,11 +695,11 @@ static void z8_txint(FAR struct uart_dev_s *dev, boolean enable)
* Name: z8_txready * Name: z8_txready
* *
* Description: * Description:
* Return TRUE if the tranmsit fifo is not full * Return true if the tranmsit fifo is not full
* *
****************************************************************************/ ****************************************************************************/
static boolean z8_txready(FAR struct uart_dev_s *dev) static bool z8_txready(FAR struct uart_dev_s *dev)
{ {
struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv; struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv;
return ((z8_getuart(priv, Z8_UART_STAT0) & Z8_UARTSTAT0_TDRE) != 0); return ((z8_getuart(priv, Z8_UART_STAT0) & Z8_UARTSTAT0_TDRE) != 0);
@ -706,11 +709,11 @@ static boolean z8_txready(FAR struct uart_dev_s *dev)
* Name: z8_txempty * Name: z8_txempty
* *
* Description: * Description:
* Return TRUE if the transmit fifo is empty * Return true if the transmit fifo is empty
* *
****************************************************************************/ ****************************************************************************/
static boolean z8_txempty(FAR struct uart_dev_s *dev) static bool z8_txempty(FAR struct uart_dev_s *dev)
{ {
struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv; struct z8_uart_s *priv = (struct z8_uart_s*)dev->priv;
return ((z8_getuart(priv, Z8_UART_STAT0) & Z8_UARTSTAT0_TXE) != 0); return ((z8_getuart(priv, Z8_UART_STAT0) & Z8_UARTSTAT0_TXE) != 0);
@ -736,7 +739,7 @@ void up_serialinit(void)
(void)z8_disableuartirq(&TTYS1_DEV); (void)z8_disableuartirq(&TTYS1_DEV);
/* Initialize the console for early use */ /* Initialize the console for early use */
CONSOLE_DEV.isconsole = TRUE; CONSOLE_DEV.isconsole = true;
z8_setup(&CONSOLE_DEV); z8_setup(&CONSOLE_DEV);
/* Reigster console and tty devices */ /* Reigster console and tty devices */
@ -757,7 +760,7 @@ void up_serialinit(void)
int up_putc(int ch) int up_putc(int ch)
{ {
ubyte state; uint8_t state;
/* Keep interrupts disabled so that we do not interfere with normal /* Keep interrupts disabled so that we do not interfere with normal
* driver operation * driver operation
@ -776,7 +779,7 @@ int up_putc(int ch)
/* Output the character */ /* Output the character */
z8_consoleput((ubyte)ch); z8_consoleput((uint8_t)ch);
/* It is important to restore the TX interrupt while the send is pending. /* It is important to restore the TX interrupt while the send is pending.
* otherwise, TRDE interrupts can be lost since they do not pend after the * otherwise, TRDE interrupts can be lost since they do not pend after the
@ -797,12 +800,12 @@ int up_putc(int ch)
# define z8_contrde() \ # define z8_contrde() \
((getreg8(*(Z8_UART1_BASE+Z8_UART_STAT0)) & Z8_UARTSTAT0_TDRE) != 0) ((getreg8(*(Z8_UART1_BASE+Z8_UART_STAT0)) & Z8_UARTSTAT0_TDRE) != 0)
# define z8_contxd(ch) \ # define z8_contxd(ch) \
putreg8((ubyte)(ch), *(Z8_UART1_BASE+Z8_UART_TXD)) putreg8((uint8_t)(ch), *(Z8_UART1_BASE+Z8_UART_TXD))
#else #else
# define z8_contrde() \ # define z8_contrde() \
((getreg8(*(Z8_UART0_BASE+Z8_UART_STAT0)) & Z8_UARTSTAT0_TDRE) != 0) ((getreg8(*(Z8_UART0_BASE+Z8_UART_STAT0)) & Z8_UARTSTAT0_TDRE) != 0)
# define z8_contxd(ch) \ # define z8_contxd(ch) \
putreg8((ubyte)(ch), *(Z8_UART0_BASE+Z8_UART_TXD)) putreg8((uint8_t)(ch), *(Z8_UART0_BASE+Z8_UART_TXD))
#endif #endif
/**************************************************************************** /****************************************************************************

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/z8/z8_sigdeliver.c * arch/z80/src/z8/z8_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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <sched.h> #include <sched.h>
#include <debug.h> #include <debug.h>

View File

@ -1,7 +1,7 @@
/*************************************************************************** /***************************************************************************
* arch/z80/src/z8/z8_timerisr.c * arch/z80/src/z8/z8_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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <debug.h> #include <debug.h>
#include <ez8.h> #include <ez8.h>
@ -67,7 +67,7 @@
/* This function is normally prototyped int the ZiLOG header file sio.h */ /* This function is normally prototyped int the ZiLOG header file sio.h */
extern uint32 get_freq(void); extern uint32_t get_freq(void);
/*************************************************************************** /***************************************************************************
* Function: up_timerisr * Function: up_timerisr
@ -78,7 +78,7 @@ extern uint32 get_freq(void);
* *
***************************************************************************/ ***************************************************************************/
int up_timerisr(int irq, uint32 *regs) int up_timerisr(int irq, uint32_t *regs)
{ {
/* Process timer interrupt */ /* Process timer interrupt */
@ -97,7 +97,7 @@ int up_timerisr(int irq, uint32 *regs)
void up_timerinit(void) void up_timerinit(void)
{ {
uint32 reload; uint32_t reload;
up_disable_irq(Z8_IRQ_SYSTIMER); up_disable_irq(Z8_IRQ_SYSTIMER);
@ -129,7 +129,7 @@ void up_timerinit(void)
*/ */
reload = get_freq() / 400; reload = get_freq() / 400;
putreg16((uint16)reload, T0R); putreg16((uint16_t)reload, T0R);
/* Write to the timer control register to enable the timer and to /* Write to the timer control register to enable the timer and to
* initiate counting * initiate counting

View File

@ -2,7 +2,7 @@
* z80/chip.h * z80/chip.h
* chip/chip.h * chip/chip.h
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,6 +41,10 @@
* Included Files * Included Files
************************************************************************************/ ************************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/************************************************************************************ /************************************************************************************
* Definitions * Definitions
************************************************************************************/ ************************************************************************************/
@ -58,12 +62,12 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
# define getreg8(a) (*(volatile ubyte *)(a)) # define getreg8(a) (*(volatile uint8_t *)(a))
# define putreg8(v,a) (*(volatile ubyte *)(a) = (v)) # define putreg8(v,a) (*(volatile uint8_t *)(a) = (v))
# define getreg16(a) (*(volatile uint16 *)(a)) # define getreg16(a) (*(volatile uint16_t *)(a))
# define putreg16(v,a) (*(volatile uint16 *)(a) = (v)) # define putreg16(v,a) (*(volatile uint16_t *)(a) = (v))
# define getreg32(a) (*(volatile uint32 *)(a)) # define getreg32(a) (*(volatile uint32_t *)(a))
# define putreg32(v,a) (*(volatile uint32 *)(a) = (v)) # define putreg32(v,a) (*(volatile uint32_t *)(a) = (v))
#endif #endif

View File

@ -41,9 +41,9 @@
* Included Files * Included Files
************************************************************************************/ ************************************************************************************/
#include <sys/types.h>
#include <nuttx/sched.h> #include <nuttx/sched.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include "up_internal.h" #include "up_internal.h"
/************************************************************************************ /************************************************************************************
@ -60,7 +60,7 @@
#define INIT_IRQCONTEXT() current_regs = NULL #define INIT_IRQCONTEXT() current_regs = NULL
/* IN_INTERRUPT returns TRUE if the system is currently operating in the interrupt /* IN_INTERRUPT returns true if the system is currently operating in the interrupt
* context. IN_INTERRUPT is the inline equivalent of up_interrupt_context(). * context. IN_INTERRUPT is the inline equivalent of up_interrupt_context().
*/ */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/z80/z80_copystate.c * arch/z80/src/z80/z80_copystate.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <arch/irq.h> #include <arch/irq.h>
#include "chip/switch.h" #include "chip/switch.h"

View File

@ -39,7 +39,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <string.h> #include <string.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/z80/z80_io.c * arch/z80/src/z80/z80_io.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> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -38,9 +38,6 @@
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
/* #include <nuttx/irq.h> */ /* #include <nuttx/irq.h> */

View File

@ -38,9 +38,6 @@
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/irq.h> #include <nuttx/irq.h>

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/z80/z80_registerdump.c * arch/z80/src/z80/z80_registerdump.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <debug.h> #include <debug.h>
#include <nuttx/irq.h> #include <nuttx/irq.h>

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/z80/z80_schedulesigaction.c * arch/z80/src/z80/z80_schedulesigaction.c
* *
* Copyright (C) 2007,2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <stdint.h>
#include <sched.h> #include <sched.h>
#include <debug.h> #include <debug.h>
@ -123,7 +123,7 @@ static void z80_sigsetup(FAR _TCB *tcb, sig_deliver_t sigdeliver, FAR chipreg_t
void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver) void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver)
{ {
dbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16)sigdeliver); dbg("tcb=0x%p sigdeliver=0x%04x\n", tcb, (uint16_t)sigdeliver);
/* Refuse to handle nested signal actions */ /* Refuse to handle nested signal actions */

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* arch/z80/src/z80/z80_sigdeliver.c * arch/z80/src/z80/z80_sigdeliver.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -39,7 +39,6 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h>
#include <sched.h> #include <sched.h>
#include <debug.h> #include <debug.h>