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 4370e6ad13
commit 549ab23bfd
65 changed files with 2048 additions and 2011 deletions
+4 -4
View File
@@ -2,7 +2,7 @@
* arch/z80/include/ez80/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>
*
* Redistribution and use in source and binary forms, with or without
@@ -45,7 +45,7 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <stdint.h>
/****************************************************************************
* Definitions
@@ -75,8 +75,8 @@ extern "C" {
#define EXTERN extern
#endif
EXTERN void outp(uint16 p, ubyte c);
EXTERN ubyte inp(uint16 p);
EXTERN void outp(uint16_t p, uint8_t c);
EXTERN uint8_t inp(uint16_t p);
#undef EXTERN
#ifdef __cplusplus
+5 -1
View File
@@ -2,7 +2,7 @@
* arch/ez80/include/ez80/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>
*
* Redistribution and use in source and binary forms, with or without
@@ -49,6 +49,10 @@
* Included Files
****************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/****************************************************************************
* Definitions
****************************************************************************/
+1 -1
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
+8 -4
View File
@@ -2,7 +2,7 @@
* arch/z8/include/z8/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>
*
* Redistribution and use in source and binary forms, with or without
@@ -45,6 +45,10 @@
* Included Files
****************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/****************************************************************************
* Definitions
****************************************************************************/
@@ -321,12 +325,12 @@ struct xcptcontext
*/
#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 */
uint16 saved_pc; /* Saved return address */
uint16 saved_irqctl; /* Saved interrupt state */
uint16_t saved_pc; /* Saved return address */
uint16_t saved_irqctl; /* Saved interrupt state */
#endif
};
#endif
+1 -1
View File
@@ -2,7 +2,7 @@
* arch/z80/include/z80/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>
*
* Redistribution and use in source and binary forms, with or without
+7 -3
View File
@@ -2,7 +2,7 @@
* arch/z80/include/z80/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>
*
* Redistribution and use in source and binary forms, with or without
@@ -45,6 +45,10 @@
* Included Files
****************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/****************************************************************************
* Definitions
****************************************************************************/
@@ -109,8 +113,8 @@ struct xcptcontext
/* The following retains that state during signal execution */
uint16 saved_pc; /* Saved return address */
uint16 saved_i; /* Saved interrupt state */
uint16_t saved_pc; /* Saved return address */
uint16_t saved_i; /* Saved interrupt state */
#endif
};
#endif
+2 -5
View File
@@ -1,7 +1,7 @@
/************************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name Gregory Nutt nor the names of its contributors may be
* 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -41,9 +41,6 @@
************************************************************************************/
#include <nuttx/config.h>
#ifndef __ASSEMBLY__
# include <sys/types.h>
#endif
#include <arch/board/board.h>
#include "chip/chip.h"
+4 -4
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
#include <debug.h>
@@ -109,7 +109,7 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */
****************************************************************************/
#ifdef CONFIG_HAVE_FILENAME
void up_assert(const ubyte *filename, int lineno)
void up_assert(const uint8_t *filename, int lineno)
#else
void up_assert(void)
#endif
@@ -146,7 +146,7 @@ void up_assert(void)
****************************************************************************/
#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
void up_assert_code(int errorcode)
#endif
+3 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdbool.h>
#include <sched.h>
#include <debug.h>
@@ -97,7 +97,7 @@ void up_block_task(FAR _TCB *tcb, tstate_t task_state)
else
{
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
boolean switch_needed;
bool switch_needed;
/* dbg("Blocking TCB=%p\n", tcb); */
+7 -4
View File
@@ -38,11 +38,14 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <sched.h>
#include <debug.h>
#include <nuttx/kmalloc.h>
#include <nuttx/arch.h>
#include "up_arch.h"
#include "up_internal.h"
@@ -90,7 +93,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
if (!tcb->stack_alloc_ptr)
{
tcb->stack_alloc_ptr = (uint32 *)kzmalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t*)kzmalloc(stack_size);
}
if (tcb->stack_alloc_ptr)
@@ -105,7 +108,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
* referenced as positive word offsets from sp.
*/
top_of_stack = (uint32)tcb->stack_alloc_ptr + stack_size - 4;
top_of_stack = (uint32_t)tcb->stack_alloc_ptr + stack_size - 4;
/* The Arm7Tdmi stack must be aligned at word (4 byte)
* boundaries. If necessary top_of_stack must be rounded
@@ -113,11 +116,11 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
*/
top_of_stack &= ~3;
size_of_stack = top_of_stack - (uint32)tcb->stack_alloc_ptr + 4;
size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4;
/* Save the adjusted stack values in the _TCB */
tcb->adj_stack_ptr = (uint32*)top_of_stack;
tcb->adj_stack_ptr = (uint32_t*)top_of_stack;
tcb->adj_stack_size = size_of_stack;
up_ledon(LED_STACKCREATED);
+3 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <assert.h>
#include "up_arch.h"
@@ -70,7 +70,7 @@
* 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);
+2 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <sched.h>
#include <debug.h>
+3 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <nuttx/arch.h>
#include <arch/board/board.h>
@@ -55,7 +55,7 @@
****************************************************************************/
#if defined(CONFIG_ARCH_LEDS) && defined(CONFIG_ARCH_BRINGUP)
static ubyte g_ledtoggle = 0;
static uint8_t g_ledtoggle = 0;
#endif
/****************************************************************************
+1 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,6 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <debug.h>
#include <nuttx/arch.h>
+7 -4
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -55,6 +55,9 @@
* Included Files
****************************************************************************/
#include <stdint.h>
#include <stdbool.h>
#include <arch/irq.h>
#include "chip/chip.h"
#include "chip/switch.h"
@@ -108,7 +111,7 @@ EXTERN void up_lowuartinit(void);
/* 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 */
@@ -168,7 +171,7 @@ EXTERN void up_timerhook(void);
EXTERN int up_netinitialize(void);
EXTERN void up_netuninitialize(void);
# 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
# define up_multicastfilter(dev, mac, enable)
# 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) */
EXTERN uint16 up_getsp(void);
EXTERN uint16_t up_getsp(void);
/* Dump stack and registers */
+4 -4
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdbool.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h>
@@ -62,11 +62,11 @@
/****************************************************************************
* Name: up_interrupt_context
*
* Description: Return TRUE is we are currently executing in
* Description: Return true is we are currently executing in
* the interrupt handler context.
****************************************************************************/
boolean up_interrupt_context(void)
bool up_interrupt_context(void)
{
return IN_INTERRUPT();
}
-1
View File
@@ -38,7 +38,6 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/arch.h>
#include "up_internal.h"
+1 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,6 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <sched.h>
#include <debug.h>
+3 -2
View File
@@ -1,7 +1,7 @@
/************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -38,10 +38,11 @@
************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <sched.h>
#include <debug.h>
#include <nuttx/arch.h>
#include "os_internal.h"
#include "up_internal.h"
+7 -6
View File
@@ -39,7 +39,8 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <sched.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 */
@@ -100,12 +101,12 @@ void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority)
else
{
FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head;
boolean switch_needed;
bool switch_needed;
slldbg("TCB=%p PRI=%d\n", tcb, priority);
/* Remove the tcb task from the ready-to-run list.
* sched_removereadytorun will return TRUE if we just
* sched_removereadytorun will return true if we just
* remove the head of the ready to run list.
*/
@@ -113,10 +114,10 @@ void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority)
/* Setup up the new task priority */
tcb->sched_priority = (ubyte)priority;
tcb->sched_priority = (uint8_t)priority;
/* Return the task to the specified blocked task list.
* sched_addreadytorun will return TRUE if the task was
* sched_addreadytorun will return true if the task was
* added to the new list. We will need to perform a context
* switch only if the EXCLUSIVE or of the two calls is non-zero
* (i.e., one and only one the calls changes the head of the
+8 -8
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <debug.h>
#include "up_arch.h"
@@ -80,9 +80,9 @@
static void up_stackdump(void)
{
_TCB *rtcb = (_TCB*)g_readytorun.head;
uint16 sp = up_getsp();
uint16 stack_base = (uint16)rtcb->adj_stack_ptr;
uint16 stack_size = (uint16)rtcb->adj_stack_size;
uint16_t) sp = up_getsp();
uint16_t) stack_base = (uint16_t))rtcb->adj_stack_ptr;
uint16_t) stack_size = (uint16_t))rtcb->adj_stack_size;
lldbg("stack_base: %04x\n", stack_base);
lldbg("stack_size: %04x\n", stack_size);
@@ -95,11 +95,11 @@ static void up_stackdump(void)
}
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",
stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
+1 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,6 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <sched.h>
#include <debug.h>
+5 -2
View File
@@ -38,11 +38,14 @@
************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <sched.h>
#include <debug.h>
#include <nuttx/kmalloc.h>
#include <nuttx/arch.h>
#include "up_internal.h"
/************************************************************
@@ -99,7 +102,7 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
* referenced as positive word offsets from sp.
*/
top_of_stack = (uint32)tcb->stack_alloc_ptr + stack_size - 4;
top_of_stack = (uint32_t)tcb->stack_alloc_ptr + stack_size - 4;
/* The Arm7Tdmi stack must be aligned at word (4 byte)
* boundaries. If necessary top_of_stack must be rounded
@@ -107,7 +110,7 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
*/
top_of_stack &= ~3;
size_of_stack = top_of_stack - (uint32)tcb->stack_alloc_ptr + 4;
size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4;
/* Save the adjusted stack values in the _TCB */
+6 -2
View File
@@ -2,7 +2,7 @@
* arch/z80/src/ez80/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>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,10 @@
* Included Files
************************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/************************************************************************************
* Definitions
************************************************************************************/
@@ -78,7 +82,7 @@ extern "C" {
#define EXTERN extern
#endif
EXTERN uint32 ez80_systemclock;
EXTERN uint32_t ez80_systemclock;
/************************************************************************************
* Public Function Prototypes
+2 -2
View File
@@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include "arch/board/board.h"
@@ -54,7 +54,7 @@
* Private Data
****************************************************************************/
uint32 ez80_systemclock = EZ80_SYS_CLK_FREQ;
uint32_t ez80_systemclock = EZ80_SYS_CLK_FREQ;
/****************************************************************************
* Private Functions
+1 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,6 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <arch/irq.h>
#include "chip/switch.h"
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <string.h>
#include <nuttx/arch.h>
@@ -85,7 +85,7 @@ void up_initial_state(_TCB *tcb)
memset(xcp, 0, sizeof(struct xcptcontext));
#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
xcp->regs[XCPT_SP] = (chipreg_t)tcb->adj_stack_ptr;
xcp->regs[XCPT_PC] = (chipreg_t)tcb->start;
+3 -3
View File
@@ -1,7 +1,7 @@
;**************************************************************************
; 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>
;
; Redistribution and use in source and binary forms, with or without
@@ -58,7 +58,7 @@
.assume ADL=1
;**************************************************************************
; Name: void outp(uint16 p, ubyte c)
; Name: void outp(uint16_t p, uint8_t c)
;
; Description:
; Output byte c on port p
@@ -108,7 +108,7 @@ _outp:
ret
;**************************************************************************
; Name: ubyte inp(uint16 p)
; Name: uint8_t inp(uint16_t p)
;
; Description:
; Input byte from port p
+1 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,6 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h>
+7 -7
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <string.h>
#include <arch/io.h>
@@ -140,8 +140,8 @@
#if defined(HAVE_SERIALCONSOLE) && !defined(CONFIG_SUPPRESS_UART_CONFIG)
static void ez80_setbaud(void)
{
uint32 brg_divisor;
ubyte lctl;
uint32_t brg_divisor;
uint8_t lctl;
/* The resulting BAUD and depends on the system clock frequency and the
* BRG divisor as follows:
@@ -163,8 +163,8 @@ static void ez80_setbaud(void)
lctl |= EZ80_UARTLCTL_DLAB;
ez80_outp(EZ80_UART_LCTL, lctl);
ez80_outp(EZ80_UART_BRGL, (ubyte)(brg_divisor & 0xff));
ez80_outp(EZ80_UART_BRGH, (ubyte)(brg_divisor >> 8));
ez80_outp(EZ80_UART_BRGL, (uint8_t)(brg_divisor & 0xff));
ez80_outp(EZ80_UART_BRGH, (uint8_t)(brg_divisor >> 8));
lctl &= ~EZ80_UARTLCTL_DLAB;
ez80_outp(EZ80_UART_LCTL, lctl);
@@ -182,7 +182,7 @@ static void ez80_setbaud(void)
void up_lowuartinit(void)
{
#ifdef HAVE_SERIAL
ubyte regval;
uint8_t regval;
/* Configure pins for usage of UARTs (whether or not we have a console) */
+1 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,6 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <debug.h>
#include <nuttx/irq.h>
+3 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <sched.h>
#include <debug.h>
@@ -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)
{
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 */
+63 -60
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -40,6 +40,8 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <unistd.h>
#include <semaphore.h>
#include <string.h>
@@ -68,31 +70,31 @@
struct ez80_dev_s
{
uint16 uartbase; /* Base address of UART registers */
unsigned int baud; /* Configured baud */
ubyte irq; /* IRQ associated with this UART */
ubyte parity; /* 0=none, 1=odd, 2=even */
ubyte bits; /* Number of bits (7 or 8) */
boolean stopbits2; /* TRUE: Configure with 2 (vs 1) */
uint16_t uartbase; /* Base address of UART registers */
unsigned int baud; /* Configured baud */
uint8_t irq; /* IRQ associated with this UART */
uint8_t parity; /* 0=none, 1=odd, 2=even */
uint8_t bits; /* Number of bits (7 or 8) */
bool stopbits2; /* true: Configure with 2 (vs 1) */
};
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
static int ez80_setup(struct uart_dev_s *dev);
static void ez80_shutdown(struct uart_dev_s *dev);
static int ez80_attach(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_ioctl(struct file *filep, int cmd, unsigned long arg);
static int ez80_receive(struct uart_dev_s *dev, unsigned int *status);
static void ez80_rxint(struct uart_dev_s *dev, boolean enable);
static boolean ez80_rxavailable(struct uart_dev_s *dev);
static void ez80_send(struct uart_dev_s *dev, int ch);
static void ez80_txint(struct uart_dev_s *dev, boolean enable);
static boolean ez80_txready(struct uart_dev_s *dev);
static boolean ez80_txempty(struct uart_dev_s *dev);
static int ez80_setup(struct uart_dev_s *dev);
static void ez80_shutdown(struct uart_dev_s *dev);
static int ez80_attach(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_ioctl(struct file *filep, int cmd, unsigned long arg);
static int ez80_receive(struct uart_dev_s *dev, unsigned int *status);
static void ez80_rxint(struct uart_dev_s *dev, bool enable);
static bool ez80_rxavailable(struct uart_dev_s *dev);
static void ez80_send(struct uart_dev_s *dev, int ch);
static void ez80_txint(struct uart_dev_s *dev, bool enable);
static bool ez80_txready(struct uart_dev_s *dev);
static bool ez80_txempty(struct uart_dev_s *dev);
/****************************************************************************
* Private Variables
@@ -141,12 +143,12 @@ static struct ez80_dev_s g_uart0priv =
static uart_dev_t g_uart0port =
{
0, /* open_count */
FALSE, /* xmitwaiting */
FALSE, /* recvwaiting */
false, /* xmitwaiting */
false, /* recvwaiting */
#ifdef CONFIG_UART0_SERIAL_CONSOLE
TRUE, /* isconsole */
true, /* isconsole */
#else
FALSE, /* isconsole */
false, /* isconsole */
#endif
{ 0 }, /* closesem */
{ 0 }, /* xmitsem */
@@ -186,12 +188,12 @@ static struct ez80_dev_s g_uart1priv =
static uart_dev_t g_uart1port =
{
0, /* open_count */
FALSE, /* xmitwaiting */
FALSE, /* recvwaiting */
false, /* xmitwaiting */
false, /* recvwaiting */
#ifdef CONFIG_UART1_SERIAL_CONSOLE
TRUE, /* isconsole */
true, /* isconsole */
#else
FALSE, /* isconsole */
false, /* isconsole */
#endif
{ 0 }, /* closesem */
{ 0 }, /* xmitsem */
@@ -246,7 +248,7 @@ static uart_dev_t g_uart1port =
* 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);
}
@@ -255,7 +257,8 @@ static inline ubyte ez80_serialin(struct ez80_dev_s *priv, ubyte offset)
* 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);
}
@@ -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)
{
ubyte ier = ez80_serialin(priv, EZ80_UART_IER);
uint8_t ier = ez80_serialin(priv, EZ80_UART_IER);
ier &= ~EZ80_UARTEIR_INTMASK;
ez80_serialout(priv, EZ80_UART_IER, ier);
}
@@ -275,9 +278,9 @@ static inline void ez80_disableuartint(struct ez80_dev_s *priv)
* 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);
ez80_serialout(priv, EZ80_UART_IER, ier);
}
@@ -303,10 +306,10 @@ static inline void ez80_waittxready(struct ez80_dev_s *priv)
* 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;
ubyte lctl;
uint32_t brg_divisor;
uint8_t lctl;
/* The resulting BAUD and depends on the system clock frequency and the
* BRG divisor as follows:
@@ -326,8 +329,8 @@ static inline void ez80_setbaud(struct ez80_dev_s *priv, uint24 baud)
lctl |= EZ80_UARTLCTL_DLAB;
ez80_serialout(priv, EZ80_UART_LCTL, lctl);
ez80_serialout(priv, EZ80_UART_BRGL, (ubyte)(brg_divisor & 0xff));
ez80_serialout(priv, EZ80_UART_BRGH, (ubyte)(brg_divisor >> 8));
ez80_serialout(priv, EZ80_UART_BRGL, (uint8_t)(brg_divisor & 0xff));
ez80_serialout(priv, EZ80_UART_BRGH, (uint8_t)(brg_divisor >> 8));
lctl &= ~EZ80_UARTLCTL_DLAB;
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
struct ez80_dev_s *priv = dev->priv;
ubyte reg;
ubyte cval;
uint8_t reg;
uint8_t cval;
if (priv->bits == 7)
{
@@ -441,8 +444,8 @@ static int ez80_attach(struct uart_dev_s *dev)
*
* Description:
* Detach UART interrupts. This method is called when the serial port is
* closed normally just before the shutdown method is called. The exception is
* the serial console which is never shutdown.
* closed normally just before the shutdown method is called. The exception
* 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 ez80_dev_s *priv;
volatile uint32 cause;
volatile uint32_t cause;
#ifndef CONFIG_UART0_DISABLE
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)
{
struct ez80_dev_s *priv = (struct ez80_dev_s*)dev->priv;
ubyte rbr = ez80_serialin(priv, EZ80_UART_RBR);
ubyte lsr = ez80_serialin(priv, EZ80_UART_LSR);
uint8_t rbr = ez80_serialin(priv, EZ80_UART_RBR);
uint8_t lsr = ez80_serialin(priv, EZ80_UART_LSR);
*status = (unsigned int)lsr;
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;
ubyte ier = ez80_serialin(priv, EZ80_UART_IER);
uint8_t ier = ez80_serialin(priv, EZ80_UART_IER);
if (enable)
{
@@ -577,11 +580,11 @@ static void ez80_rxint(struct uart_dev_s *dev, boolean enable)
* Name: ez80_rxavailable
*
* 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;
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)
{
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;
ubyte ier = ez80_serialin(priv, EZ80_UART_IER);
uint8_t ier = ez80_serialin(priv, EZ80_UART_IER);
if (enable)
{
@@ -632,11 +635,11 @@ static void ez80_txint(struct uart_dev_s *dev, boolean enable)
* Name: ez80_txready
*
* 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;
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
*
* 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;
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)
{
ubyte regval;
uint8_t regval;
/* 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 */
#ifdef CONSOLE_DEV
CONSOLE_DEV.isconsole = TRUE;
CONSOLE_DEV.isconsole = true;
ez80_setup(&CONSOLE_DEV);
#endif
@@ -744,7 +747,7 @@ int up_putc(int ch)
{
#ifdef CONSOLE_DEV
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);
@@ -761,7 +764,7 @@ int up_putc(int ch)
/* Output the character */
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 */
+1 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,6 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <sched.h>
#include <debug.h>
+31 -23
View File
@@ -38,7 +38,9 @@
****************************************************************************/
#include <nuttx/config.h>
#include <nuttx/spi.h>
#include <sys/types.h>
#include <stdint.h>
#include <arch/board/board.h>
#include <nuttx/arch.h>
@@ -65,11 +67,14 @@
* 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 uint16 spi_send(FAR struct spi_dev_s *dev, uint16 wd);
static void spi_sndblock(FAR struct spi_dev_s *dev, FAR const ubyte *buffer, size_t buflen);
static void spi_recvblock(FAR struct spi_dev_s *dev, FAR ubyte *buffer, size_t buflen);
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 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
@@ -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
* 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)
*/
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
* 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)
{
ubyte modebits;
ubyte regval;
uint8_t modebits;
uint8_t regval;
/* 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
* 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 */
@@ -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.
* The wordsize is determined by the number of bits-per-word
* 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:
* 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;
ubyte response;
FAR const uint8_t *ptr = (FAR const uint8_t*)buffer;
uint8_t response;
/* 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
* of words. The wordsize is determined by the number of bits-per-word
* 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:
* 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)
{
FAR ubyte *ptr = (FAR ubyte*)buffer;
ubyte response;
FAR uint8_t *ptr = (FAR uint8_t*)buffer;
uint8_t response;
/* 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)
{
ubyte regval;
uint8_t regval;
/* Only the SPI1 interface is supported */
+8 -8
View File
@@ -1,7 +1,7 @@
/***************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <debug.h>
#include <arch/io.h>
@@ -76,7 +76,7 @@
int up_timerisr(int irq, chipreg_t *regs)
{
volatile ubyte reg;
volatile uint8_t reg;
/* 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)
{
uint16 reload;
ubyte reg;
uint16_t) reload;
uint8_t reg;
/* Disable the timer */
@@ -142,9 +142,9 @@ void up_timerinit(void)
* NOTE: The system clock frequency value is defined in the board.h file
*/
reload = (uint16)(ez80_systemclock / 1600);
outp(EZ80_TMR0_RRH, (ubyte)(reload >> 8));
outp(EZ80_TMR0_RRL, (ubyte)(reload));
reload = (uint16_t))(ez80_systemclock / 1600);
outp(EZ80_TMR0_RRH, (uint8_t)(reload >> 8));
outp(EZ80_TMR0_RRL, (uint8_t)(reload));
/* Clear any pending timer interrupts */
+10 -6
View File
@@ -2,7 +2,7 @@
* arch/z80/src/ez80/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>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,10 @@
* Included Files
************************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/************************************************************************************
* Definitions
************************************************************************************/
@@ -249,11 +253,11 @@
#ifndef __ASSEMBLY__
struct ez80emac_desc_s
{
uint24 np; /* Pointer to the start of the next packet */
uint16 pktsize; /* Number of bytes in the packet, including the 4 CRC
* bytes, but excluding the 7 descriptor table bytes. */
uint16 stat; /* Status of the packet. Differs for TX and RX packets
* (see EMAC_RX/TXDESC_* definitions) */
uint24_t np; /* Pointer to the start of the next packet */
uint16_t pktsize; /* Number of bytes in the packet, including the 4 CRC
* bytes, but excluding the 7 descriptor table bytes. */
uint16_t stat; /* Status of the packet. Differs for TX and RX packets
* (see EMAC_RX/TXDESC_* definitions) */
};
#endif
-1
View File
@@ -42,7 +42,6 @@
************************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
/************************************************************************************
* Definitions
+4 -3
View File
@@ -42,7 +42,8 @@
************************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <nuttx/spi.h>
/************************************************************************************
@@ -113,8 +114,8 @@ extern "C" {
* 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 ubyte ez80_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
EXTERN void ez80_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
EXTERN uint8_t ez80_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
#undef EXTERN
#ifdef __cplusplus
+2 -3
View File
@@ -2,7 +2,7 @@
* arch/z80/src/ez80/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>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
* Included Files
************************************************************************************/
#include <sys/types.h>
#ifndef __ASSEMBLY__
# include <nuttx/sched.h>
# include <nuttx/arch.h>
@@ -62,7 +61,7 @@
#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().
*/
+5 -3
View File
@@ -2,7 +2,7 @@
* arch/z80/src/ez80/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>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,8 @@
* Included Files
************************************************************************************/
#include <stdint.h>
/************************************************************************************
* Definitions
************************************************************************************/
@@ -57,12 +59,12 @@
#ifndef CONFIG_HEAP1_BASE
extern unsigned long _heapbot;
# define CONFIG_HEAP1_BASE ((uint24)&_heapbot)
# define CONFIG_HEAP1_BASE ((uint24_t)&_heapbot)
#endif
#ifndef CONFIG_HEAP1_END
extern unsigned long _stack;
# define CONFIG_HEAP1_END (((uint24)&_stack) - CONFIG_IDLETHREAD_STACKSIZE)
# define CONFIG_HEAP1_END (((uint24_t)&_stack) - CONFIG_IDLETHREAD_STACKSIZE)
#endif
/************************************************************************************
+6 -2
View File
@@ -41,6 +41,10 @@
* Included Files
************************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/************************************************************************************
* Definitions
************************************************************************************/
@@ -118,11 +122,11 @@
/* UART0/1 Base Register Addresses **************************************************/
#ifdef EZ8_UART0
# define Z8_UART0_BASE ((ubyte volatile far*)0xf40)
# define Z8_UART0_BASE ((uint8_t volatile far*)0xf40)
#endif
#ifdef EZ8_UART1
# define Z8_UART1_BASE ((ubyte volatile far*)0xf48)
# define Z8_UART1_BASE ((uint8_t volatile far*)0xf48)
#endif
/* UART0/1 Status 0 Register Bit Definitions ****************************************/
+5 -5
View File
@@ -2,7 +2,7 @@
* arch/z80/src/z8/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>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,8 @@
* Included Files
************************************************************************************/
#include <sys/types.h>
#ifndef __ASSEMBLY__
# include <stdint.h>
# include <nuttx/sched.h>
# include <nuttx/arch.h>
#endif
@@ -63,7 +63,7 @@
#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
* uint16 values. These are
* uint24_t values. These are
*
* value[0] = RP (MS byte) and Flags (LS) byte
* value[1] = PC
@@ -105,7 +105,7 @@
g_z8irqstate.state = Z8_IRQSTATE_NONE; \
} 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().
*/
@@ -189,7 +189,7 @@
#ifndef __ASSEMBLY__
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 */
};
#endif
+5 -3
View File
@@ -2,7 +2,7 @@
* arch/z80/src/z8/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>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,8 @@
* Included Files
************************************************************************************/
#include <stdint.h>
/************************************************************************************
* Definitions
************************************************************************************/
@@ -57,12 +59,12 @@
#ifndef CONFIG_HEAP1_BASE
extern far unsigned long far_heapbot;
# define CONFIG_HEAP1_BASE ((uint16)&far_heapbot)
# define CONFIG_HEAP1_BASE ((uint16_t))&far_heapbot)
#endif
#ifndef CONFIG_HEAP1_END
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
/************************************************************************************
+604 -603
View File
File diff suppressed because it is too large Load Diff
+1 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,6 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <string.h>
#include <nuttx/arch.h>
+1 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,6 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <ez8.h>
#include <nuttx/arch.h>
+7 -7
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* 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>
*
* Redistribution and use in source and binary forms, with or without
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <string.h>
#include <ez8.h>
@@ -51,7 +51,7 @@
#ifdef CONFIG_USE_LOWUARTINIT
extern uint32 get_freq(void);
extern uint32_t get_freq(void);
/****************************************************************************
* Private Definitions
@@ -75,13 +75,13 @@ extern uint32 get_freq(void);
void up_lowuartinit(void)
{
uint32 freq = get_freq();
uint16 brg;
ubyte val;
uint32_t freq = get_freq();
uint16_t brg;
uint8_t val;
#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 */

Some files were not shown because too many files have changed in this diff Show More