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@2359 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2009-12-16 20:05:51 +00:00
parent 59ca96e726
commit c23f8334c8
172 changed files with 2768 additions and 2707 deletions
+6 -3
View File
@@ -45,6 +45,9 @@
****************************************************************************/
#include <nuttx/config.h>
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/****************************************************************************
* Definitions
@@ -60,14 +63,14 @@
#define PIC_REG_STRING "r10"
/* Macros to get and set the PIC base register. picbase is assumed to be
* of type (void*) and that it will fit into a uint32. These must be
* of type (void*) and that it will fit into a uint32_t. These must be
* inline so that they will be compatible with the ABIs rules for
* preserving the PIC register
*/
#define up_getpicbase(ppicbase) \
do { \
uint32 picbase; \
uint32_t picbase; \
__asm__ \
( \
"\tmov %0, " PIC_REG_STRING "\n\t" \
@@ -78,7 +81,7 @@ do { \
#define up_setpicbase(picbase) \
do { \
uint32 _picbase = (uint32)picbase; \
uint32_t _picbase = (uint32_t)picbase; \
__asm__ \
( \
"\tmov " PIC_REG_STRING ", %0\n\t" \
+6 -4
View File
@@ -45,7 +45,9 @@
****************************************************************************/
#include <nuttx/irq.h>
#include <sys/types.h>
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/****************************************************************************
* Definitions
@@ -147,13 +149,13 @@ struct xcptcontext
* signal processing.
*/
uint32 saved_pc;
uint32 saved_cpsr;
uint32_t saved_pc;
uint32_t saved_cpsr;
#endif
/* Register save area */
uint32 regs[XCPTCONTEXT_REGS];
uint32_t regs[XCPTCONTEXT_REGS];
};
#endif
+19 -16
View File
@@ -45,7 +45,10 @@
****************************************************************************/
#include <nuttx/irq.h>
#include <sys/types.h>
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/****************************************************************************
* Definitions
@@ -137,14 +140,14 @@ struct xcptcontext
* signal processing.
*/
uint32 saved_pc;
uint32 saved_primask;
uint32 saved_xpsr;
uint32_t saved_pc;
uint32_t saved_primask;
uint32_t saved_xpsr;
#endif
/* Register save area */
uint32 regs[XCPTCONTEXT_REGS];
uint32_t regs[XCPTCONTEXT_REGS];
};
#endif
@@ -195,19 +198,19 @@ static inline void irqrestore(irqstate_t primask)
/* Get/set the primask register */
static inline ubyte getprimask(void)
static inline uint8_t getprimask(void)
{
uint32 primask;
uint32_t primask;
__asm__ __volatile__
(
"\tmrs %0, primask\n"
: "=r" (primask)
:
: "memory");
return (ubyte)primask;
return (uint8_t)primask;
}
static inline void setprimask(uint32 primask)
static inline void setprimask(uint32_t primask)
{
__asm__ __volatile__
(
@@ -219,19 +222,19 @@ static inline void setprimask(uint32 primask)
/* Get/set the basepri register */
static inline ubyte getbasepri(void)
static inline uint8_t getbasepri(void)
{
uint32 basepri;
uint32_t basepri;
__asm__ __volatile__
(
"\tmrs %0, basepri\n"
: "=r" (basepri)
:
: "memory");
return (ubyte)basepri;
return (uint8_t)basepri;
}
static inline void setbasepri(uint32 basepri)
static inline void setbasepri(uint32_t basepri)
{
__asm__ __volatile__
(
@@ -243,9 +246,9 @@ static inline void setbasepri(uint32 basepri)
/* Get IPSR */
static inline uint32 getipsr(void)
static inline uint32_t getipsr(void)
{
uint32 ipsr;
uint32_t ipsr;
__asm__ __volatile__
(
"\tmrs %0, ipsr\n"
@@ -257,7 +260,7 @@ static inline uint32 getipsr(void)
/* SVC system call */
static inline void svcall(uint32 cmd, uint32 arg)
static inline void svcall(uint32_t cmd, uint32_t arg)
{
__asm__ __volatile__
(
-1
View File
@@ -45,7 +45,6 @@
************************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/irq.h>
/************************************************************************************
+5 -1
View File
@@ -44,6 +44,10 @@
* Included Files
****************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/****************************************************************************
* Definitions
****************************************************************************/
@@ -88,7 +92,7 @@
****************************************************************************/
#ifndef __ASSEMBLY__
typedef void (*vic_vector_t)(uint32 *regs);
typedef void (*vic_vector_t)(uint32_t *regs);
#endif
/****************************************************************************
+3 -1
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/include/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
@@ -40,6 +40,8 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
/****************************************************************************
* Definitions
****************************************************************************/
-1
View File
@@ -45,7 +45,6 @@
************************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/irq.h>
/************************************************************************************
-1
View File
@@ -45,7 +45,6 @@
************************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
/************************************************************************************
* Definitions
+1 -5
View File
@@ -40,12 +40,8 @@
* Included Files
************************************************************************************/
#ifndef __ASSEMBLY__
# include <sys/types.h>
#endif
/************************************************************************************
* Definitions
* Pre-processor Definitions
************************************************************************************/
#undef CONFIG_ALIGNMENT_TRAP
+19 -19
View File
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
#include <debug.h>
@@ -52,7 +52,7 @@
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* Output debug info if stack dump is selected -- even if
@@ -78,9 +78,9 @@
/* I don't know if the builtin to get SP is enabled */
static inline uint32 up_getsp(void)
static inline uint32_t up_getsp(void)
{
uint32 sp;
uint32_t sp;
__asm__
(
"\tmov %0, sp\n\t"
@@ -94,13 +94,13 @@ static inline uint32 up_getsp(void)
****************************************************************************/
#ifdef CONFIG_ARCH_STACKDUMP
static void up_stackdump(uint32 sp, uint32 stack_base)
static void up_stackdump(uint32_t sp, uint32_t stack_base)
{
uint32 stack ;
uint32_t stack ;
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
{
uint32 *ptr = (uint32*)stack;
uint32_t *ptr = (uint32_t*)stack;
lldbg("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
@@ -127,7 +127,7 @@ static inline void up_registerdump(void)
for (regs = REG_R0; regs <= REG_R15; regs += 8)
{
uint32 *ptr = (uint32*)&current_regs[regs];
uint32_t *ptr = (uint32_t*)&current_regs[regs];
lldbg("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
regs, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
@@ -147,13 +147,13 @@ static inline void up_registerdump(void)
#ifdef CONFIG_ARCH_STACKDUMP
static void up_dumpstate(void)
{
_TCB *rtcb = (_TCB*)g_readytorun.head;
uint32 sp = up_getsp();
uint32 ustackbase;
uint32 ustacksize;
_TCB *rtcb = (_TCB*)g_readytorun.head;
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3
uint32 istackbase;
uint32 istacksize;
uint32_t istackbase;
uint32_t istacksize;
#endif
/* Get the limits on the user stack memory */
@@ -165,14 +165,14 @@ static void up_dumpstate(void)
}
else
{
ustackbase = (uint32)rtcb->adj_stack_ptr;
ustacksize = (uint32)rtcb->adj_stack_size;
ustackbase = (uint32_t)rtcb->adj_stack_ptr;
ustacksize = (uint32_t)rtcb->adj_stack_size;
}
/* Get the limits on the interrupt stack memory */
#if CONFIG_ARCH_INTERRUPTSTACK > 3
istackbase = (uint32)&g_userstack;
istackbase = (uint32_t)&g_userstack;
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3) - 4;
/* Show interrupt stack info */
@@ -269,7 +269,7 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */
* Name: up_assert
****************************************************************************/
void up_assert(const ubyte *filename, int lineno)
void up_assert(const uint8_t *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG)
_TCB *rtcb = (_TCB*)g_readytorun.head;
@@ -291,7 +291,7 @@ void up_assert(const ubyte *filename, int lineno)
* Name: up_assert_code
****************************************************************************/
void up_assert_code(const ubyte *filename, int lineno, int errorcode)
void up_assert_code(const uint8_t *filename, int lineno, int errorcode)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG)
_TCB *rtcb = (_TCB*)g_readytorun.head;
+3 -3
View File
@@ -38,8 +38,8 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdbool.h>
#include <sched.h>
#include <debug.h>
@@ -49,7 +49,7 @@
#include "up_internal.h"
/****************************************************************************
* Private Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -96,7 +96,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
else
{
_TCB *rtcb = (_TCB*)g_readytorun.head;
boolean switch_needed;
bool switch_needed;
/* Remove the tcb task from the ready-to-run list. If we
* are blocking the task at the head of the task list (the
+3 -3
View File
@@ -39,13 +39,13 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include "os_internal.h"
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -66,7 +66,7 @@
/* A little faster than most memcpy's */
void up_copystate(uint32 *dest, uint32 *src)
void up_copystate(uint32_t *dest, uint32_t *src)
{
int i;
+6 -3
View File
@@ -38,14 +38,17 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <debug.h>
#include <nuttx/irq.h>
#include "os_internal.h"
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* Output debug info if stack dump is selected -- even if
@@ -73,7 +76,7 @@
* Name: up_dataabort
****************************************************************************/
void up_dataabort(uint32 *regs)
void up_dataabort(uint32_t *regs)
{
lldbg("Data abort at 0x%x\n", regs[REG_PC]);
current_regs = regs;
+5 -3
View File
@@ -38,16 +38,18 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <assert.h>
#include "up_arch.h"
#include "os_internal.h"
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -66,7 +68,7 @@
* Public Functions
****************************************************************************/
void up_doirq(int irq, uint32 *regs)
void up_doirq(int irq, uint32_t *regs)
{
up_ledon(LED_INIRQ);
#ifdef CONFIG_SUPPRESS_INTERRUPTS
+6 -5
View File
@@ -38,7 +38,8 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <string.h>
#include <nuttx/arch.h>
@@ -48,7 +49,7 @@
#include "up_arch.h"
/****************************************************************************
* Private Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -87,11 +88,11 @@ void up_initial_state(_TCB *tcb)
/* Save the initial stack pointer */
xcp->regs[REG_SP] = (uint32)tcb->adj_stack_ptr;
xcp->regs[REG_SP] = (uint32_t)tcb->adj_stack_ptr;
/* Save the task entry point */
xcp->regs[REG_PC] = (uint32)tcb->start;
xcp->regs[REG_PC] = (uint32_t)tcb->start;
/* If this task is running PIC, then set the PIC base register to the
* address of the allocated D-Space region.
@@ -104,7 +105,7 @@ void up_initial_state(_TCB *tcb)
* alloacated D-Space region.
*/
xcp->regs[REG_PIC] = (uint32)tcb->dspace->region;
xcp->regs[REG_PIC] = (uint32_t)tcb->dspace->region;
}
#endif
+5 -3
View File
@@ -38,14 +38,16 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <debug.h>
#include <nuttx/irq.h>
#include "os_internal.h"
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* Output debug info if stack dump is selected -- even if
@@ -73,7 +75,7 @@
* Name: up_prefetchabort
****************************************************************************/
void up_prefetchabort(uint32 *regs)
void up_prefetchabort(uint32_t *regs)
{
lldbg("Prefetch abort at 0x%x\n", regs[REG_PC]);
current_regs = regs;
+3 -2
View File
@@ -38,15 +38,16 @@
****************************************************************************/
#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"
/****************************************************************************
* Private Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
+10 -7
View File
@@ -38,15 +38,18 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <sched.h>
#include <debug.h>
#include <nuttx/arch.h>
#include "os_internal.h"
#include "up_internal.h"
/****************************************************************************
* Private Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -81,7 +84,7 @@
*
****************************************************************************/
void up_reprioritize_rtr(_TCB *tcb, ubyte priority)
void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
{
/* Verify that the caller is sane */
@@ -95,12 +98,12 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority)
else
{
_TCB *rtcb = (_TCB*)g_readytorun.head;
boolean switch_needed;
bool switch_needed;
slldbg("TCB=%p PRI=%d\n", tcb, priority);
/* Remove the tcb task from the ready-to-run list.
* sched_removereadytorun will return TRUE if we just
* sched_removereadytorun will return true if we just
* remove the head of the ready to run list.
*/
@@ -108,10 +111,10 @@ void up_reprioritize_rtr(_TCB *tcb, ubyte priority)
/* Setup up the new task priority */
tcb->sched_priority = (ubyte)priority;
tcb->sched_priority = (uint8_t)priority;
/* Return the task to the specified blocked task list.
* sched_addreadytorun will return TRUE if the task was
* sched_addreadytorun will return true if the task was
* added to the new list. We will need to perform a context
* switch only if the EXCLUSIVE or of the two calls is non-zero
* (i.e., one and only one the calls changes the head of the
+4 -4
View File
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <sched.h>
#include <debug.h>
@@ -53,7 +53,7 @@
#ifndef CONFIG_DISABLE_SIGNALS
/****************************************************************************
* Private Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -161,7 +161,7 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver)
* disabled
*/
current_regs[REG_PC] = (uint32)up_sigdeliver;
current_regs[REG_PC] = (uint32_t)up_sigdeliver;
current_regs[REG_CPSR] = SVC_MODE | PSR_I_BIT | PSR_F_BIT;
/* And make sure that the saved context in the TCB
@@ -193,7 +193,7 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver)
* disabled
*/
tcb->xcp.regs[REG_PC] = (uint32)up_sigdeliver;
tcb->xcp.regs[REG_PC] = (uint32_t)up_sigdeliver;
tcb->xcp.regs[REG_CPSR] = SVC_MODE | PSR_I_BIT | PSR_F_BIT;
}
+3 -3
View File
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <sched.h>
#include <debug.h>
@@ -53,7 +53,7 @@
#ifndef CONFIG_DISABLE_SIGNALS
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -82,7 +82,7 @@
void up_sigdeliver(void)
{
_TCB *rtcb = (_TCB*)g_readytorun.head;
uint32 regs[XCPTCONTEXT_REGS];
uint32_t regs[XCPTCONTEXT_REGS];
sig_deliver_t sigdeliver;
/* Save the errno. This must be preserved throughout the
+5 -3
View File
@@ -38,14 +38,16 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <debug.h>
#include "up_arch.h"
#include "os_internal.h"
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* Output debug info if stack dump is selected -- even if
@@ -86,7 +88,7 @@
*
****************************************************************************/
void up_syscall(uint32 *regs)
void up_syscall(uint32_t *regs)
{
lldbg("Syscall from 0x%x\n", regs[REG_PC]);
current_regs = regs;
+3 -2
View File
@@ -38,16 +38,17 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <sched.h>
#include <debug.h>
#include <nuttx/arch.h>
#include "os_internal.h"
#include "clock_internal.h"
#include "up_internal.h"
/****************************************************************************
* Private Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
+3 -3
View File
@@ -38,14 +38,14 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <debug.h>
#include "os_internal.h"
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* Output debug info if stack dump is selected -- even if
@@ -73,7 +73,7 @@
* Name: up_undefinedinsn
****************************************************************************/
void up_undefinedinsn(uint32 *regs)
void up_undefinedinsn(uint32_t *regs)
{
lldbg("Undefined instruction at 0x%x\n", regs[REG_PC]);
current_regs = regs;
+81 -81
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/c5471/c5471_ethernet.c
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Based one a C5471 Linux driver and released under this BSD license with
@@ -45,8 +45,8 @@
#include <nuttx/config.h>
#if defined(CONFIG_NET)
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
@@ -67,7 +67,7 @@
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* Configuration ************************************************************/
@@ -293,9 +293,9 @@
struct c5471_driver_s
{
boolean c_bifup; /* TRUE:ifup FALSE:ifdown */
WDOG_ID c_txpoll; /* TX poll timer */
WDOG_ID c_txtimeout; /* TX timeout timer */
bool c_bifup; /* true:ifup false:ifdown */
WDOG_ID c_txpoll; /* TX poll timer */
WDOG_ID c_txtimeout; /* TX timeout timer */
/* Note: According to the C547x documentation: "The software has to maintain
* two pointers to the current RX-CPU and TX-CPU descriptors. At init time,
@@ -303,40 +303,40 @@ struct c5471_driver_s
* to be incremented each time a descriptor ownership is give to the SWITCH".
*/
volatile uint32 c_txcpudesc;
volatile uint32 c_rxcpudesc;
volatile uint32_t c_txcpudesc;
volatile uint32_t c_rxcpudesc;
/* Last TX descriptor saved for error handling */
uint32 c_lastdescstart;
uint32 c_lastdescend;
uint32_t c_lastdescstart;
uint32_t c_lastdescend;
/* Shadowed registers */
uint32 c_eimstatus;
uint32_t c_eimstatus;
#ifdef CONFIG_C5471_NET_STATS
/* TX statistics */
uint32 c_txpackets; /* Number of packets sent */
uint32 c_txmiss; /* Miss */
uint32 c_txvlan; /* VLAN */
uint32 c_txlframe; /* Long frame errors */
uint32 c_txsframe; /* Short frame errors */
uint32 c_txcrc; /* CRC errors */
uint32 c_txoverrun; /* Overrun errors */
uint32 c_txalign; /* Non-octect align errors */
uint32 c_txtimeouts; /* TX timeouts */
uint32_t c_txpackets; /* Number of packets sent */
uint32_t c_txmiss; /* Miss */
uint32_t c_txvlan; /* VLAN */
uint32_t c_txlframe; /* Long frame errors */
uint32_t c_txsframe; /* Short frame errors */
uint32_t c_txcrc; /* CRC errors */
uint32_t c_txoverrun; /* Overrun errors */
uint32_t c_txalign; /* Non-octect align errors */
uint32_t c_txtimeouts; /* TX timeouts */
uint32 c_rxpackets; /* Number of packets received */
uint32 c_rxretries; /* Exceed retry errors */
uint32 c_rxheartbeat; /* Heartbeat (SQE) */
uint32 c_rxlcollision; /* Late collision errors */
uint32 c_rxcollision; /* Collision */
uint32 c_rxcrc; /* CRC errors */
uint32 c_rxunderrun; /* Underrun errors */
uint32 c_rxloc; /* Loss of carrier */
uint32 c_rxdropped; /* Packets dropped because of size */
uint32_t c_rxpackets; /* Number of packets received */
uint32_t c_rxretries; /* Exceed retry errors */
uint32_t c_rxheartbeat; /* Heartbeat (SQE) */
uint32_t c_rxlcollision; /* Late collision errors */
uint32_t c_rxcollision; /* Collision */
uint32_t c_rxcrc; /* CRC errors */
uint32_t c_rxunderrun; /* Underrun errors */
uint32_t c_rxloc; /* Loss of carrier */
uint32_t c_rxdropped; /* Packets dropped because of size */
#endif
/* This holds the information visible to uIP/NuttX */
@@ -386,8 +386,8 @@ static int c5471_interrupt(int irq, FAR void *context);
/* Watchdog timer expirations */
static void c5471_polltimer(int argc, uint32 arg, ...);
static void c5471_txtimeout(int argc, uint32 arg, ...);
static void c5471_polltimer(int argc, uint32_t arg, ...);
static void c5471_txtimeout(int argc, uint32_t arg, ...);
/* NuttX callback functions */
@@ -415,7 +415,7 @@ static void c5471_macassign(struct c5471_driver_s *c5471);
****************************************************************************/
#ifdef CONFIG_C5471_NET_DUMPBUFFER
static inline void c5471_dumpbuffer(const char *msg, const ubyte *buffer, unsigned int nbytes)
static inline void c5471_dumpbuffer(const char *msg, const uint8_t *buffer, unsigned int nbytes)
{
/* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_NET have to be
* defined or the following does nothing.
@@ -516,7 +516,7 @@ static void c5471_mdtxbit (int bit_state)
static int c5471_mdrxbit (void)
{
register volatile uint32 bit_state;
register volatile uint32_t bit_state;
/* config MDIO as input pin. */
@@ -807,7 +807,7 @@ static inline void c5471_inctxcpu(struct c5471_driver_s *c5471)
}
else
{
c5471->c_txcpudesc += 2*sizeof(uint32);
c5471->c_txcpudesc += 2*sizeof(uint32_t);
}
nvdbg("TX CPU desc: %08x\n", c5471->c_txcpudesc);
@@ -830,7 +830,7 @@ static inline void c5471_incrxcpu(struct c5471_driver_s *c5471)
}
else
{
c5471->c_rxcpudesc += 2*sizeof(uint32);
c5471->c_rxcpudesc += 2*sizeof(uint32_t);
}
nvdbg("RX CPU desc: %08x\n", c5471->c_rxcpudesc);
@@ -856,9 +856,9 @@ static inline void c5471_incrxcpu(struct c5471_driver_s *c5471)
static int c5471_transmit(struct c5471_driver_s *c5471)
{
struct uip_driver_s *dev = &c5471->c_dev;
volatile uint16 *packetmem;
uint16 framelen;
boolean bfirstframe;
volatile uint16_t *packetmem;
uint16_t framelen;
bool bfirstframe;
int nbytes;
int nshorts;
unsigned int i;
@@ -866,7 +866,7 @@ static int c5471_transmit(struct c5471_driver_s *c5471)
nbytes = (dev->d_len + 1) & ~1;
j = 0;
bfirstframe = TRUE;
bfirstframe = true;
c5471->c_lastdescstart = c5471->c_rxcpudesc;
nvdbg("Packet size: %d RX CPU desc: %08x\n", nbytes, c5471->c_rxcpudesc);
@@ -916,12 +916,12 @@ static int c5471_transmit(struct c5471_driver_s *c5471)
/* Words #2 and #3 of descriptor */
packetmem = (uint16*)getreg32(c5471->c_rxcpudesc + sizeof(uint32));
packetmem = (uint16_t*)getreg32(c5471->c_rxcpudesc + sizeof(uint32_t));
for (i = 0; i < nshorts; i++, j++)
{
/* 16-bits at a time. */
packetmem[i] = htons(((uint16*)dev->d_buf)[j]);
packetmem[i] = htons(((uint16_t*)dev->d_buf)[j]);
}
putreg32(((getreg32(c5471->c_rxcpudesc) & ~EIM_RXDESC_BYTEMASK) | framelen), c5471->c_rxcpudesc);
@@ -949,7 +949,7 @@ static int c5471_transmit(struct c5471_driver_s *c5471)
/* Advance to the next free descriptor */
c5471_incrxcpu(c5471);
bfirstframe = FALSE;
bfirstframe = false;
}
/* Packet transferred .. Update statistics */
@@ -960,7 +960,7 @@ static int c5471_transmit(struct c5471_driver_s *c5471)
/* Setup the TX timeout watchdog (perhaps restarting the timer) */
(void)wd_start(c5471->c_txtimeout, C5471_TXTIMEOUT, c5471_txtimeout, 1, (uint32)c5471);
(void)wd_start(c5471->c_txtimeout, C5471_TXTIMEOUT, c5471_txtimeout, 1, (uint32_t)c5471);
return OK;
}
@@ -1036,8 +1036,8 @@ static int c5471_uiptxpoll(struct uip_driver_s *dev)
#ifdef CONFIG_C5471_NET_STATS
static void c5471_rxstatus(struct c5471_driver_s *c5471)
{
uint32 desc = c5471->c_txcpudesc;
uint32 rxstatus;
uint32_t desc = c5471->c_txcpudesc;
uint32_t rxstatus;
/* Walk that last packet we just received to collect xmit status bits. */
@@ -1068,7 +1068,7 @@ static void c5471_rxstatus(struct c5471_driver_s *c5471)
}
else
{
desc += 2 * sizeof(uint32);
desc += 2 * sizeof(uint32_t);
}
}
@@ -1138,8 +1138,8 @@ static void c5471_rxstatus(struct c5471_driver_s *c5471)
static void c5471_receive(struct c5471_driver_s *c5471)
{
struct uip_driver_s *dev = &c5471->c_dev;
uint16 *packetmem;
boolean bmore = TRUE;
uint16_t *packetmem;
bool bmore = true;
int packetlen = 0;
int framelen;
int nshorts;
@@ -1176,7 +1176,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
{
/* Get the packet memory from words #2 and #3 of descriptor */
packetmem = (uint16*)getreg32(c5471->c_txcpudesc + sizeof(uint32));
packetmem = (uint16_t*)getreg32(c5471->c_txcpudesc + sizeof(uint32_t));
/* Divide by 2 with round up to get the number of 16-bit words. */
@@ -1190,7 +1190,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
* a time.
*/
((uint16*)dev->d_buf)[j] = htons(packetmem[i]);
((uint16_t*)dev->d_buf)[j] = htons(packetmem[i]);
}
}
else
@@ -1200,7 +1200,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
if (getreg32(c5471->c_txcpudesc) & EIM_TXDESC_LIF)
{
bmore = FALSE;
bmore = false;
}
/* Next, Clear all bits of words0/1 of the emptied descriptor except preserve
@@ -1312,8 +1312,8 @@ static void c5471_receive(struct c5471_driver_s *c5471)
#ifdef CONFIG_C5471_NET_STATS
static void c5471_txstatus(struct c5471_driver_s *c5471)
{
uint32 desc = c5471->c_lastdescstart;
uint32 txstatus;
uint32_t desc = c5471->c_lastdescstart;
uint32_t txstatus;
/* Walk that last packet we just sent to collect xmit status bits. */
@@ -1338,7 +1338,7 @@ static void c5471_txstatus(struct c5471_driver_s *c5471)
}
else
{
desc += 2 * sizeof(uint32);
desc += 2 * sizeof(uint32_t);
}
}
}
@@ -1515,7 +1515,7 @@ static int c5471_interrupt(int irq, FAR void *context)
*
****************************************************************************/
static void c5471_txtimeout(int argc, uint32 arg, ...)
static void c5471_txtimeout(int argc, uint32_t arg, ...)
{
struct c5471_driver_s *c5471 = (struct c5471_driver_s *)arg;
@@ -1553,7 +1553,7 @@ static void c5471_txtimeout(int argc, uint32 arg, ...)
*
****************************************************************************/
static void c5471_polltimer(int argc, uint32 arg, ...)
static void c5471_polltimer(int argc, uint32_t arg, ...)
{
struct c5471_driver_s *c5471 = (struct c5471_driver_s *)arg;
@@ -1594,7 +1594,7 @@ static void c5471_polltimer(int argc, uint32 arg, ...)
static int c5471_ifup(struct uip_driver_s *dev)
{
struct c5471_driver_s *c5471 = (struct c5471_driver_s *)dev->d_private;
volatile uint32 clearbits;
volatile uint32_t clearbits;
ndbg("Bringing up: %d.%d.%d.%d\n",
dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff,
@@ -1626,11 +1626,11 @@ static int c5471_ifup(struct uip_driver_s *dev)
/* Set and activate a timer process */
(void)wd_start(c5471->c_txpoll, C5471_WDDELAY, c5471_polltimer, 1, (uint32)c5471);
(void)wd_start(c5471->c_txpoll, C5471_WDDELAY, c5471_polltimer, 1, (uint32_t)c5471);
/* Enable the Ethernet interrupt */
c5471->c_bifup = TRUE;
c5471->c_bifup = true;
up_enable_irq(C5471_IRQ_ETHER);
return OK;
}
@@ -1682,7 +1682,7 @@ static int c5471_ifdown(struct uip_driver_s *dev)
/* Reset the device */
c5471->c_bifup = FALSE;
c5471->c_bifup = false;
irqrestore(flags);
return OK;
}
@@ -1793,9 +1793,9 @@ static void c5471_eimreset (struct c5471_driver_s *c5471)
static void c5471_eimconfig(struct c5471_driver_s *c5471)
{
volatile uint32 pbuf;
volatile uint32 desc;
volatile uint32 val;
volatile uint32_t pbuf;
volatile uint32_t desc;
volatile uint32_t val;
int i;
desc = EIM_RAM_START;
@@ -1815,16 +1815,16 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471)
val |= EIM_TXDESC_OWN_HOST|EIM_TXDESC_INTRE|EIM_TXDESC_PADCRC|EIM_PACKET_BYTES;
putreg32(val, desc);
desc += sizeof(uint32);
desc += sizeof(uint32_t);
putreg32(pbuf, desc);
desc += sizeof(uint32);
desc += sizeof(uint32_t);
putreg32(0, pbuf);
pbuf += EIM_PACKET_BYTES;
putreg32(0, pbuf);
pbuf += sizeof(uint32); /* Ether Module's "Buffer Usage Word" */
pbuf += sizeof(uint32_t); /* Ether Module's "Buffer Usage Word" */
}
/* RX ENET 0 */
@@ -1841,16 +1841,16 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471)
val |= EIM_RXDESC_OWN_ENET|EIM_RXDESC_INTRE|EIM_RXDESC_PADCRC|EIM_PACKET_BYTES;
putreg32(val, desc);
desc += sizeof(uint32);
desc += sizeof(uint32_t);
putreg32(pbuf, desc);
desc += sizeof(uint32);
desc += sizeof(uint32_t);
putreg32(0, pbuf);
pbuf += EIM_PACKET_BYTES;
putreg32(0, pbuf);
pbuf += sizeof(uint32); /* Ether Module's "Buffer Usage Word" */
pbuf += sizeof(uint32_t); /* Ether Module's "Buffer Usage Word" */
}
/* TX CPU */
@@ -1870,16 +1870,16 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471)
val |= EIM_TXDESC_OWN_HOST|EIM_TXDESC_INTRE|EIM_TXDESC_PADCRC|EIM_PACKET_BYTES;
putreg32(val, desc);
desc += sizeof(uint32);
desc += sizeof(uint32_t);
putreg32(pbuf, desc);
desc += sizeof(uint32);
desc += sizeof(uint32_t);
putreg(0, pbuf);
pbuf += EIM_PACKET_BYTES;
putreg(0, pbuf);
pbuf += sizeof(uint32); /* Ether Module's "Buffer Usage Word" */
pbuf += sizeof(uint32_t); /* Ether Module's "Buffer Usage Word" */
}
/* RX CPU */
@@ -1899,16 +1899,16 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471)
val |= EIM_RXDESC_OWN_ENET|EIM_RXDESC_INTRE|EIM_RXDESC_PADCRC|EIM_PACKET_BYTES;
putreg32(val, desc);
desc += sizeof(uint32);
desc += sizeof(uint32_t);
putreg32(pbuf, desc);
desc += sizeof(uint32);
desc += sizeof(uint32_t);
putreg32(0, pbuf);
pbuf += EIM_PACKET_BYTES;
putreg32(0, pbuf);
pbuf += sizeof(uint32); /* Ether Module's "Buffer Usage Word" */
pbuf += sizeof(uint32_t); /* Ether Module's "Buffer Usage Word" */
}
ndbg("END desc: %08x pbuf: %08x\n", desc, pbuf);
@@ -2018,8 +2018,8 @@ static void c5471_reset(struct c5471_driver_s *c5471)
static void c5471_macassign(struct c5471_driver_s *c5471)
{
struct uip_driver_s *dev = &c5471->c_dev;
uint8 *mptr = dev->d_mac.ether_addr_octet;
register uint32 tmp;
uint8_t *mptr = dev->d_mac.ether_addr_octet;
register uint32_t tmp;
ndbg("MAC: %0x:%0x:%0x:%0x:%0x:%0x\n",
mptr[0], mptr[1], mptr[2], mptr[3], mptr[4], mptr[5]);
@@ -2028,11 +2028,11 @@ static void c5471_macassign(struct c5471_driver_s *c5471)
* this destination address.
*/
tmp = (((uint32)mptr[0]) << 8) | ((uint32)mptr[1]);
tmp = (((uint32_t)mptr[0]) << 8) | ((uint32_t)mptr[1]);
putreg32(tmp, EIM_CPU_DAHI);
tmp = (((uint32)mptr[2]) << 24) | (((uint32)mptr[3]) << 16) |
(((uint32)mptr[4]) << 8) | ((uint32)mptr[5]);
tmp = (((uint32_t)mptr[2]) << 24) | (((uint32_t)mptr[3]) << 16) |
(((uint32_t)mptr[4]) << 8) | ((uint32_t)mptr[5]);
putreg32(tmp, EIM_CPU_DALO);
#if 0
+8 -8
View File
@@ -38,8 +38,8 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <nuttx/irq.h>
#include "arm.h"
@@ -48,7 +48,7 @@
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
#define ILR_EDGESENSITIVE 0x00000020
@@ -58,7 +58,7 @@
* Public Data
****************************************************************************/
uint32 *current_regs;
uint32_t *current_regs;
/****************************************************************************
* Private Data
@@ -107,7 +107,7 @@ static up_vector_t g_vectorinittab[] =
static inline void up_ackirq(unsigned int irq)
{
uint32 reg;
uint32_t reg;
reg = getreg32(SRC_IRQ_REG); /* Insure appropriate IT_REG bit clears */
putreg32(reg | 0x00000001, INT_CTRL_REG); /* write the NEW_IRQ_AGR bit. */
}
@@ -125,7 +125,7 @@ static inline void up_ackirq(unsigned int irq)
static inline void up_ackfiq(unsigned int irq)
{
uint32 reg;
uint32_t reg;
reg = getreg32(SRC_FIQ_REG); /* Insure appropriate IT_REG bit clears */
putreg32(reg | 0x00000002, INT_CTRL_REG); /* write the NEW_FIQ_AGR bit. */
}
@@ -197,7 +197,7 @@ void up_disable_irq(int irq)
{
if ((unsigned)irq < NR_IRQS)
{
uint32 reg = getreg32(MASK_IT_REG);
uint32_t reg = getreg32(MASK_IT_REG);
putreg32(reg | (1 << irq), MASK_IT_REG);
}
}
@@ -214,7 +214,7 @@ void up_enable_irq(int irq)
{
if ((unsigned)irq < NR_IRQS)
{
uint32 reg = getreg32(MASK_IT_REG);
uint32_t reg = getreg32(MASK_IT_REG);
putreg32(reg & ~(1 << irq), MASK_IT_REG);
}
}
@@ -229,7 +229,7 @@ void up_enable_irq(int irq)
void up_maskack_irq(int irq)
{
uint32 reg = getreg32(INT_CTRL_REG);
uint32_t reg = getreg32(INT_CTRL_REG);
/* Mask the interrupt */
+54 -52
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* c5471/c5471_serial.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
@@ -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>
@@ -56,7 +58,7 @@
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
#define BASE_BAUD 115200
@@ -71,12 +73,12 @@
struct uart_regs_s
{
uint32 ier;
uint32 lcr;
uint32 fcr;
uint32_t ier;
uint32_t lcr;
uint32_t fcr;
#ifdef CONFIG_UART_HWFLOWCONTROL
uint32 efr;
uint32 tcr;
uint32_t efr;
uint32_t tcr;
#endif
};
@@ -85,16 +87,16 @@ struct up_dev_s
unsigned int uartbase; /* Base address of UART registers */
unsigned int baud_base; /* Base baud for conversions */
unsigned int baud; /* Configured baud */
ubyte xmit_fifo_size; /* Size of transmit FIFO */
ubyte irq; /* IRQ associated with this UART */
ubyte parity; /* 0=none, 1=odd, 2=even */
ubyte bits; /* Number of bits (7 or 8) */
uint8_t xmit_fifo_size; /* Size of transmit FIFO */
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) */
#ifdef CONFIG_UART_HWFLOWCONTROL
boolean flowcontrol; /* TRUE: Hardware flow control
* is enabled. */
bool flowcontrol; /* true: Hardware flow control
* is enabled. */
#endif
boolean stopbits2; /* TRUE: Configure with 2
* stop bits instead of 1 */
bool stopbits2; /* true: Configure with 2
* stop bits instead of 1 */
struct uart_regs_s regs; /* Shadow copy of readonly regs */
};
@@ -102,19 +104,19 @@ struct up_dev_s
* Private Function Prototypes
****************************************************************************/
static int up_setup(struct uart_dev_s *dev);
static void up_shutdown(struct uart_dev_s *dev);
static int up_attach(struct uart_dev_s *dev);
static void up_detach(struct uart_dev_s *dev);
static int up_interrupt(int irq, void *context);
static int up_ioctl(struct file *filep, int cmd, unsigned long arg);
static int up_receive(struct uart_dev_s *dev, unsigned int *status);
static void up_rxint(struct uart_dev_s *dev, boolean enable);
static boolean up_rxavailable(struct uart_dev_s *dev);
static void up_send(struct uart_dev_s *dev, int ch);
static void up_txint(struct uart_dev_s *dev, boolean enable);
static boolean up_txready(struct uart_dev_s *dev);
static boolean up_txempty(struct uart_dev_s *dev);
static int up_setup(struct uart_dev_s *dev);
static void up_shutdown(struct uart_dev_s *dev);
static int up_attach(struct uart_dev_s *dev);
static void up_detach(struct uart_dev_s *dev);
static int up_interrupt(int irq, void *context);
static int up_ioctl(struct file *filep, int cmd, unsigned long arg);
static int up_receive(struct uart_dev_s *dev, unsigned int *status);
static void up_rxint(struct uart_dev_s *dev, bool enable);
static bool up_rxavailable(struct uart_dev_s *dev);
static void up_send(struct uart_dev_s *dev, int ch);
static void up_txint(struct uart_dev_s *dev, bool enable);
static bool up_txready(struct uart_dev_s *dev);
static bool up_txempty(struct uart_dev_s *dev);
/****************************************************************************
* Private Variables
@@ -155,7 +157,7 @@ static struct up_dev_s g_irdapriv =
.parity = CONFIG_UART_IRDA_PARITY,
.bits = CONFIG_UART_IRDA_BITS,
#ifdef CONFIG_UART_IRDA_HWFLOWCONTROL
.flowcontrol = TRUE,
.flowcontrol = true,
#endif
.stopbits2 = CONFIG_UART_IRDA_2STOP,
};
@@ -188,7 +190,7 @@ static struct up_dev_s g_modempriv =
.parity = CONFIG_UART_MODEM_PARITY,
.bits = CONFIG_UART_MODEM_BITS,
#ifdef CONFIG_UART_MODEM_HWFLOWCONTROL
.flowcontrol = TRUE,
.flowcontrol = true,
#endif
.stopbits2 = CONFIG_UART_MODEM_2STOP,
};
@@ -229,7 +231,7 @@ static uart_dev_t g_modemport =
* Name: up_inserial
****************************************************************************/
static inline uint32 up_inserial(struct up_dev_s *priv, uint32 offset)
static inline uint32_t up_inserial(struct up_dev_s *priv, uint32_t offset)
{
return getreg32(priv->uartbase + offset);
}
@@ -238,7 +240,7 @@ static inline uint32 up_inserial(struct up_dev_s *priv, uint32 offset)
* Name: up_serialout
****************************************************************************/
static inline void up_serialout(struct up_dev_s *priv, uint32 offset, uint32 value)
static inline void up_serialout(struct up_dev_s *priv, uint32_t offset, uint32_t value)
{
putreg32(value, priv->uartbase + offset);
}
@@ -247,7 +249,7 @@ static inline void up_serialout(struct up_dev_s *priv, uint32 offset, uint32 val
* Name: up_disableuartint
****************************************************************************/
static inline void up_disableuartint(struct up_dev_s *priv, uint16 *ier)
static inline void up_disableuartint(struct up_dev_s *priv, uint16_t *ier)
{
if (ier)
{
@@ -261,7 +263,7 @@ static inline void up_disableuartint(struct up_dev_s *priv, uint16 *ier)
* Name: up_restoreuartint
****************************************************************************/
static inline void up_restoreuartint(struct up_dev_s *priv, uint16 ier)
static inline void up_restoreuartint(struct up_dev_s *priv, uint16_t ier)
{
priv->regs.ier |= ier & (UART_IER_RECVINT|UART_IER_XMITINT);
up_serialout(priv, UART_IER_OFFS, priv->regs.ier);
@@ -309,7 +311,7 @@ static inline void up_enablebreaks(struct up_dev_s *priv)
static inline void up_setrate(struct up_dev_s *priv, unsigned int rate)
{
uint32 div_bit_rate;
uint32_t div_bit_rate;
switch (rate)
{
@@ -420,7 +422,7 @@ static int up_setup(struct uart_dev_s *dev)
up_setrate(priv, priv->baud);
priv->regs.lcr &= 0xffffffe0; /* clear original field, and... */
priv->regs.lcr |= (uint32)cval; /* Set new bits in that field. */
priv->regs.lcr |= (uint32_t)cval; /* Set new bits in that field. */
up_serialout(priv, UART_LCR_OFFS, priv->regs.lcr);
#ifdef CONFIG_UART_HWFLOWCONTROL
@@ -532,7 +534,7 @@ static int up_interrupt(int irq, void *context)
{
struct uart_dev_s *dev = NULL;
struct up_dev_s *priv;
volatile uint32 cause;
volatile uint32_t cause;
if (g_irdapriv.irq == irq)
{
@@ -552,7 +554,7 @@ static int up_interrupt(int irq, void *context)
if ((cause & 0x0000000c) == 0x0000000c)
{
uint32 ier_val = 0;
uint32_t ier_val = 0;
/* Is this an interrupt from the IrDA UART? */
@@ -671,8 +673,8 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
static int up_receive(struct uart_dev_s *dev, unsigned int *status)
{
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
uint32 rhr;
uint32 lsr;
uint32_t rhr;
uint32_t lsr;
/* Construct a 16bit status word that uses the high byte to
* hold the status bits associated with framing,parity,break
@@ -696,7 +698,7 @@ static int up_receive(struct uart_dev_s *dev, unsigned int *status)
*
****************************************************************************/
static void up_rxint(struct uart_dev_s *dev, boolean enable)
static void up_rxint(struct uart_dev_s *dev, bool enable)
{
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
if (enable)
@@ -717,11 +719,11 @@ static void up_rxint(struct uart_dev_s *dev, boolean enable)
* Name: up_rxavailable
*
* Description:
* Return TRUE if the receive fifo is not empty
* Return true if the receive fifo is not empty
*
****************************************************************************/
static boolean up_rxavailable(struct uart_dev_s *dev)
static bool up_rxavailable(struct uart_dev_s *dev)
{
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
return up_inserial(priv, UART_LSR_OFFS) & UART_RX_FIFO_NOEMPTY;
@@ -738,7 +740,7 @@ static boolean up_rxavailable(struct uart_dev_s *dev)
static void up_send(struct uart_dev_s *dev, int ch)
{
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
up_serialout(priv, UART_THR_OFFS, (ubyte)ch);
up_serialout(priv, UART_THR_OFFS, (uint8_t)ch);
}
/****************************************************************************
@@ -749,7 +751,7 @@ static void up_send(struct uart_dev_s *dev, int ch)
*
****************************************************************************/
static void up_txint(struct uart_dev_s *dev, boolean enable)
static void up_txint(struct uart_dev_s *dev, bool enable)
{
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
if (enable)
@@ -770,11 +772,11 @@ static void up_txint(struct uart_dev_s *dev, boolean enable)
* Name: up_txready
*
* Description:
* Return TRUE if the tranmsit fifo is not full
* Return true if the tranmsit fifo is not full
*
****************************************************************************/
static boolean up_txready(struct uart_dev_s *dev)
static bool up_txready(struct uart_dev_s *dev)
{
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
return (up_inserial(priv, UART_SSR_OFFS) & UART_SSR_TXFULL) == 0;
@@ -784,11 +786,11 @@ static boolean up_txready(struct uart_dev_s *dev)
* Name: up_txempty
*
* Description:
* Return TRUE if the transmit fifo is empty
* Return true if the transmit fifo is empty
*
****************************************************************************/
static boolean up_txempty(struct uart_dev_s *dev)
static bool up_txempty(struct uart_dev_s *dev)
{
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
return (up_inserial(priv, UART_LSR_OFFS) & UART_LSR_TREF) != 0;
@@ -813,7 +815,7 @@ void up_earlyserialinit(void)
up_disableuartint(TTYS0_DEV.priv, NULL);
up_disableuartint(TTYS1_DEV.priv, NULL);
CONSOLE_DEV.isconsole = TRUE;
CONSOLE_DEV.isconsole = true;
up_setup(&CONSOLE_DEV);
}
@@ -845,11 +847,11 @@ void up_serialinit(void)
int up_putc(int ch)
{
struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv;
uint16 ier;
uint16_t ier;
up_disableuartint(priv, &ier);
up_waittxready(priv);
up_serialout(priv, UART_THR_OFFS, (ubyte)ch);
up_serialout(priv, UART_THR_OFFS, (uint8_t)ch);
/* Check for LF */
+8 -6
View File
@@ -1,7 +1,7 @@
/************************************************************
* c5471/c5471_timerisr.c
*
* 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.
*
@@ -38,15 +38,17 @@
************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <debug.h>
#include <nuttx/arch.h>
#include "clock_internal.h"
#include "up_internal.h"
#include "up_arch.h"
/************************************************************
* Definitions
* Pre-processor Definitions
************************************************************/
/* We want the general purpose timer running at the rate
@@ -87,7 +89,7 @@
*
************************************************************/
int up_timerisr(int irq, uint32 *regs)
int up_timerisr(int irq, uint32_t *regs)
{
/* Process timer interrupt */
@@ -106,7 +108,7 @@ int up_timerisr(int irq, uint32 *regs)
void up_timerinit(void)
{
uint32 val;
uint32_t val;
up_disable_irq(C5471_IRQ_SYSTIMER);
+19 -14
View File
@@ -1,7 +1,7 @@
/**************************************************************************
* c5471/c5471_watchdog.c
*
* 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.
*
@@ -38,13 +38,18 @@
**************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/fs.h>
#include <nuttx/irq.h>
#include <arch/watchdog.h>
#include "up_arch.h"
/**************************************************************************
@@ -72,8 +77,8 @@
/* Macros to manage access to to watchdog timer macros */
#define c5471_wdt_cntl (*(volatile uint32*)C5471_TIMER0_CTRL)
#define c5471_wdt_count (*(volatile uint32*)C5471_TIMER0_CNT)
#define c5471_wdt_cntl (*(volatile uint32_t*)C5471_TIMER0_CTRL)
#define c5471_wdt_count (*(volatile uint32_t*)C5471_TIMER0_CNT)
/**************************************************************************
* Private Types
@@ -87,20 +92,20 @@
static inline unsigned int wdt_prescaletoptv(unsigned int prescale);
static int wdt_setusec(uint32 usec);
static int wdt_setusec(uint32_t usec);
static int wdt_interrupt(int irq, void *context);
static int wdt_open(struct file *filep);
static int wdt_close(struct file *filep);
static ssize_t wdt_read(struct file *filep, char *buffer, size_t buflen);
static ssize_t wdt_write(struct file *filep, const char *buffer, size_t buflen);
static int wdt_ioctl(struct file *filep, int cmd, uint32 arg);
static int wdt_ioctl(struct file *filep, int cmd, uint32_t arg);
/**************************************************************************
* Private Data
**************************************************************************/
static boolean g_wdtopen;
static bool g_wdtopen;
static const struct file_operations g_wdtops =
{
@@ -156,15 +161,15 @@ static inline unsigned int wdt_prescaletoptv(unsigned int prescale)
* Name: wdt_setusec
**************************************************************************/
static int wdt_setusec(uint32 usec)
static int wdt_setusec(uint32_t usec)
{
/* prescaler: clock / prescaler = #clock ticks per counter in ptv
* divisor: #counts until the interrupt comes.
*/
uint32 prescaler = MAX_PRESCALER;
uint32 divisor = 1;
uint32 mode;
uint32_t prescaler = MAX_PRESCALER;
uint32_t divisor = 1;
uint32_t mode;
dbg("usec=%d\n", usec);
@@ -283,7 +288,7 @@ static ssize_t wdt_write(struct file *filep, const char *buffer, size_t buflen)
* Name: wdt_ioctl
**************************************************************************/
static int wdt_ioctl(struct file *filep, int cmd, uint32 arg)
static int wdt_ioctl(struct file *filep, int cmd, uint32_t arg)
{
dbg("ioctl Call: cmd=0x%x arg=0x%x", cmd, arg);
@@ -323,7 +328,7 @@ static int wdt_open(struct file *filep)
c5471_wdt_cntl = C5471_DISABLE_VALUE1;
c5471_wdt_cntl = C5471_DISABLE_VALUE2;
g_wdtopen = TRUE;
g_wdtopen = true;
return OK;
}
@@ -345,7 +350,7 @@ static int wdt_close(struct file *filep)
c5471_wdt_cntl = C5471_TIMER_MODE;
#endif
g_wdtopen = FALSE;
g_wdtopen = false;
return 0;
}
+14 -14
View File
@@ -42,14 +42,14 @@
#include <nuttx/config.h>
#ifndef __ASSEMBLY__
# include <sys/types.h>
# include <stdint.h>
#endif
#include <arch/board/board.h>
#include "chip.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -58,25 +58,25 @@
#ifndef __ASSEMBLY__
# define getreg8(a) (*(volatile ubyte *)(a))
# define putreg8(v,a) (*(volatile ubyte *)(a) = (v))
# define getreg32(a) (*(volatile uint32 *)(a))
# define putreg32(v,a) (*(volatile uint32 *)(a) = (v))
# define getreg8(a) (*(volatile uint8_t *)(a))
# define putreg8(v,a) (*(volatile uint8_t *)(a) = (v))
# define getreg32(a) (*(volatile uint32_t *)(a))
# define putreg32(v,a) (*(volatile uint32_t *)(a) = (v))
/* Some compiler options will convert short loads and stores into byte loads
* and stores. We don't want this to happen for IO reads and writes!
*/
/* # define getreg16(a) (*(volatile uint16 *)(a)) */
static inline uint16 getreg16(unsigned int addr)
/* # define getreg16(a) (*(volatile uint16_t *)(a)) */
static inline uint16_t getreg16(unsigned int addr)
{
uint16 retval;
uint16_t retval;
__asm__ __volatile__("\tldrh %0, [%1]\n\t" : "=r"(retval) : "r"(addr));
return retval;
}
/* define putreg16(v,a) (*(volatile uint16 *)(a) = (v)) */
static inline void putreg16(uint16 val, unsigned int addr)
/* define putreg16(v,a) (*(volatile uint16_t *)(a) = (v)) */
static inline void putreg16(uint16_t val, unsigned int addr)
{
__asm__ __volatile__("\tstrh %0, [%1]\n\t": : "r"(val), "r"(addr));
}
@@ -95,9 +95,9 @@ extern "C" {
/* Atomic modification of registers */
EXTERN void modifyreg8(unsigned int addr, ubyte clearbits, ubyte setbits);
EXTERN void modifyreg16(unsigned int addr, uint16 clearbits, uint16 setbits);
EXTERN void modifyreg32(unsigned int addr, uint32 clearbits, uint32 setbits);
EXTERN void modifyreg8(unsigned int addr, uint8_t clearbits, uint8_t setbits);
EXTERN void modifyreg16(unsigned int addr, uint16_t clearbits, uint16_t setbits);
EXTERN void modifyreg32(unsigned int addr, uint32_t clearbits, uint32_t setbits);
#undef EXTERN
#if defined(__cplusplus)
+5 -4
View File
@@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <sched.h>
#include <debug.h>
@@ -93,7 +94,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
if (!tcb->stack_alloc_ptr)
{
tcb->stack_alloc_ptr = (uint32 *)kzmalloc(stack_size);
tcb->stack_alloc_ptr = (uint32_t*)kzmalloc(stack_size);
}
if (tcb->stack_alloc_ptr)
@@ -108,7 +109,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
* referenced as positive word offsets from sp.
*/
top_of_stack = (uint32)tcb->stack_alloc_ptr + stack_size - 4;
top_of_stack = (uint32_t)tcb->stack_alloc_ptr + stack_size - 4;
/* The ARM stack must be aligned at word (4 byte)
* boundaries. If necessary top_of_stack must be rounded
@@ -116,11 +117,11 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
*/
top_of_stack &= ~3;
size_of_stack = top_of_stack - (uint32)tcb->stack_alloc_ptr + 4;
size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4;
/* Save the adjusted stack values in the _TCB */
tcb->adj_stack_ptr = (uint32*)top_of_stack;
tcb->adj_stack_ptr = (uint32_t*)top_of_stack;
tcb->adj_stack_size = size_of_stack;
up_ledon(LED_STACKCREATED);
+2 -2
View File
@@ -38,7 +38,7 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <sched.h>
#include <debug.h>
#include <nuttx/arch.h>
@@ -51,7 +51,7 @@
#endif
/****************************************************************************
* Private Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
+3 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/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
@@ -38,12 +38,12 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/arch.h>
#include "up_internal.h"
/****************************************************************************
* Private Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
+1 -2
View File
@@ -39,7 +39,6 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <debug.h>
#include <nuttx/arch.h>
@@ -49,7 +48,7 @@
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
+31 -27
View File
@@ -40,8 +40,12 @@
* Included Files
****************************************************************************/
#ifndef __ASSEMBLY__
# include <stdint.h>
#endif
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* Bring-up debug configurations. These are here (vs defconfig)
@@ -103,7 +107,7 @@ typedef void (*up_vector_t)(void);
* interrupt processing.
*/
extern uint32 *current_regs;
extern uint32_t *current_regs;
/* This is the beginning of heap as provided from up_head.S.
* This is the first address in DRAM after the loaded
@@ -111,33 +115,33 @@ extern uint32 *current_regs;
* CONFIG_DRAM_END
*/
extern uint32 g_heapbase;
extern uint32_t g_heapbase;
/* Address of the saved user stack pointer */
#if CONFIG_ARCH_INTERRUPTSTACK > 3
extern uint32 g_userstack;
extern uint32_t g_userstack;
#endif
/* These 'addresses' of these values are setup by the linker script. They are
* not actual uint32 storage locations! They are only used meaningfully in the
* not actual uint32_t storage locations! They are only used meaningfully in the
* following way:
*
* - The linker script defines, for example, the symbol_sdata.
* - The declareion extern uint32 _sdata; makes C happy. C will believe
* that the value _sdata is the address of a uint32 variable _data (it is
* - The declareion extern uint32_t _sdata; makes C happy. C will believe
* that the value _sdata is the address of a uint32_t variable _data (it is
* not!).
* - We can recoved the linker value then by simply taking the address of
* of _data. like: uint32 *pdata = &_sdata;
* of _data. like: uint32_t *pdata = &_sdata;
*/
extern uint32 _stext; /* Start of .text */
extern uint32 _etext; /* End_1 of .text + .rodata */
extern const uint32 _eronly; /* End+1 of read only section (.text + .rodata) */
extern uint32 _sdata; /* Start of .data */
extern uint32 _edata; /* End+1 of .data */
extern uint32 _sbss; /* Start of .bss */
extern uint32 _ebss; /* End+1 of .bss */
extern uint32_t _stext; /* Start of .text */
extern uint32_t _etext; /* End_1 of .text + .rodata */
extern const uint32_t _eronly; /* End+1 of read only section (.text + .rodata) */
extern uint32_t _sdata; /* Start of .data */
extern uint32_t _edata; /* End+1 of .data */
extern uint32_t _sbss; /* Start of .bss */
extern uint32_t _ebss; /* End+1 of .bss */
#endif
/****************************************************************************
@@ -153,31 +157,31 @@ extern uint32 _ebss; /* End+1 of .bss */
/* Defined in files with the same name as the function */
extern void up_boot(void);
extern void up_copystate(uint32 *dest, uint32 *src);
extern void up_decodeirq(uint32 *regs);
extern void up_copystate(uint32_t *dest, uint32_t *src);
extern void up_decodeirq(uint32_t *regs);
extern void up_irqinitialize(void);
#ifdef CONFIG_ARCH_DMA
extern void weak_function up_dmainitialize(void);
#endif
extern int up_saveusercontext(uint32 *saveregs);
extern void up_fullcontextrestore(uint32 *restoreregs) __attribute__ ((noreturn));
extern void up_switchcontext(uint32 *saveregs, uint32 *restoreregs);
extern int up_saveusercontext(uint32_t *saveregs);
extern void up_fullcontextrestore(uint32_t *restoreregs) __attribute__ ((noreturn));
extern void up_switchcontext(uint32_t *saveregs, uint32_t *restoreregs);
extern void up_sigdeliver(void);
extern int up_timerisr(int irq, uint32 *regs);
extern int up_timerisr(int irq, uint32_t *regs);
extern void up_lowputc(char ch);
extern void up_puts(const char *str);
extern void up_lowputs(const char *str);
#ifdef CONFIG_ARCH_CORTEXM3
extern uint32 *up_doirq(int irq, uint32 *regs);
extern uint32_t *up_doirq(int irq, uint32_t *regs);
extern int up_svcall(int irq, FAR void *context);
extern int up_hardfault(int irq, FAR void *context);
#else
extern void up_doirq(int irq, uint32 *regs);
extern void up_dataabort(uint32 *regs);
extern void up_prefetchabort(uint32 *regs);
extern void up_syscall(uint32 *regs);
extern void up_undefinedinsn(uint32 *regs);
extern void up_doirq(int irq, uint32_t *regs);
extern void up_dataabort(uint32_t *regs);
extern void up_prefetchabort(uint32_t *regs);
extern void up_syscall(uint32_t *regs);
extern void up_undefinedinsn(uint32_t *regs);
#endif
/* Defined in up_vectors.S */
+6 -4
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/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
@@ -38,9 +38,11 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdbool.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h>
#include "up_internal.h"
/****************************************************************************
@@ -58,11 +60,11 @@
/****************************************************************************
* Name: up_interrupt_context
*
* Description: Return TRUE is we are currently executing in
* Description: Return true is we are currently executing in
* the interrupt handler context.
****************************************************************************/
boolean up_interrupt_context(void)
bool up_interrupt_context(void)
{
return current_regs != NULL;
}
+2 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/common/up_lowputs.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -38,12 +38,11 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
+4 -4
View File
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <debug.h>
#include <arch/irq.h>
@@ -48,7 +48,7 @@
#include "up_arch.h"
/****************************************************************************
* Private Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -71,10 +71,10 @@
*
****************************************************************************/
void modifyreg16(unsigned int addr, uint16 clearbits, uint16 setbits)
void modifyreg16(unsigned int addr, uint16_t clearbits, uint16_t setbits)
{
irqstate_t flags;
uint16 regval;
uint16_t regval;
flags = irqsave();
regval = getreg16(addr);
+4 -4
View File
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <debug.h>
#include <arch/irq.h>
@@ -48,7 +48,7 @@
#include "up_arch.h"
/****************************************************************************
* Private Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -71,10 +71,10 @@
*
****************************************************************************/
void modifyreg32(unsigned int addr, uint32 clearbits, uint32 setbits)
void modifyreg32(unsigned int addr, uint32_t clearbits, uint32_t setbits)
{
irqstate_t flags;
uint32 regval;
uint32_t regval;
flags = irqsave();
regval = getreg32(addr);
+4 -4
View File
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <debug.h>
#include <arch/irq.h>
@@ -48,7 +48,7 @@
#include "up_arch.h"
/****************************************************************************
* Private Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -71,10 +71,10 @@
*
****************************************************************************/
void modifyreg8(unsigned int addr, ubyte clearbits, ubyte setbits)
void modifyreg8(unsigned int addr, uint8_t clearbits, uint8_t setbits)
{
irqstate_t flags;
ubyte regval;
uint8_t regval;
flags = irqsave();
regval = getreg8(addr);
+2 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/common/up_puts.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -38,13 +38,12 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/arch.h>
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
+3 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/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 -3
View File
@@ -38,11 +38,15 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <sched.h>
#include <debug.h>
#include <nuttx/kmalloc.h>
#include <nuttx/arch.h>
#include "up_internal.h"
/****************************************************************************
@@ -99,7 +103,7 @@ int up_use_stack(_TCB *tcb, void *stack, size_t stack_size)
* referenced as positive word offsets from sp.
*/
top_of_stack = (uint32)tcb->stack_alloc_ptr + stack_size - 4;
top_of_stack = (uint32_t)tcb->stack_alloc_ptr + stack_size - 4;
/* The ARM stack must be aligned at word (4 byte)
* boundaries. If necessary top_of_stack must be rounded
@@ -107,11 +111,11 @@ 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 */
tcb->adj_stack_ptr = (uint32*)top_of_stack;
tcb->adj_stack_ptr = (uint32_t*)top_of_stack;
tcb->adj_stack_size = size_of_stack;
return OK;
+1 -2
View File
@@ -41,10 +41,9 @@
************************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
/************************************************************************************
* Definitions
* Pre-processor Definitions
************************************************************************************/
/* NVIC base address ****************************************************************/
+1 -5
View File
@@ -40,12 +40,8 @@
* Included Files
************************************************************************************/
#ifndef __ASSEMBLY__
# include <sys/types.h>
#endif
/************************************************************************************
* Definitions
* Pre-processor Definitions
************************************************************************************/
/* Application Program Status Register (APSR) */
+18 -18
View File
@@ -39,7 +39,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>
#include <debug.h>
@@ -52,7 +52,7 @@
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* Output debug info if stack dump is selected -- even if
@@ -78,9 +78,9 @@
/* I don't know if the builtin to get SP is enabled */
static inline uint32 up_getsp(void)
static inline uint32_t up_getsp(void)
{
uint32 sp;
uint32_t sp;
__asm__
(
"\tmov %0, sp\n\t"
@@ -94,13 +94,13 @@ static inline uint32 up_getsp(void)
****************************************************************************/
#ifdef CONFIG_ARCH_STACKDUMP
static void up_stackdump(uint32 sp, uint32 stack_base)
static void up_stackdump(uint32_t sp, uint32_t stack_base)
{
uint32 stack ;
uint32_t stack ;
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
{
uint32 *ptr = (uint32*)stack;
uint32_t *ptr = (uint32_t*)stack;
lldbg("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
stack, ptr[0], ptr[1], ptr[2], ptr[3],
ptr[4], ptr[5], ptr[6], ptr[7]);
@@ -148,13 +148,13 @@ static inline void up_registerdump(void)
#ifdef CONFIG_ARCH_STACKDUMP
static void up_dumpstate(void)
{
_TCB *rtcb = (_TCB*)g_readytorun.head;
uint32 sp = up_getsp();
uint32 ustackbase;
uint32 ustacksize;
_TCB *rtcb = (_TCB*)g_readytorun.head;
uint32_t sp = up_getsp();
uint32_t ustackbase;
uint32_t ustacksize;
#if CONFIG_ARCH_INTERRUPTSTACK > 3
uint32 istackbase;
uint32 istacksize;
uint32_t istackbase;
uint32_t istacksize;
#endif
/* Get the limits on the user stack memory */
@@ -166,14 +166,14 @@ static void up_dumpstate(void)
}
else
{
ustackbase = (uint32)rtcb->adj_stack_ptr;
ustacksize = (uint32)rtcb->adj_stack_size;
ustackbase = (uint32_t)rtcb->adj_stack_ptr;
ustacksize = (uint32_t)rtcb->adj_stack_size;
}
/* Get the limits on the interrupt stack memory */
#if CONFIG_ARCH_INTERRUPTSTACK > 3
istackbase = (uint32)&g_userstack;
istackbase = (uint32_t)&g_userstack;
istacksize = (CONFIG_ARCH_INTERRUPTSTACK & ~3) - 4;
/* Show interrupt stack info */
@@ -270,7 +270,7 @@ static void _up_assert(int errorcode) /* __attribute__ ((noreturn)) */
* Name: up_assert
****************************************************************************/
void up_assert(const ubyte *filename, int lineno)
void up_assert(const uint8_t *filename, int lineno)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG)
_TCB *rtcb = (_TCB*)g_readytorun.head;
@@ -292,7 +292,7 @@ void up_assert(const ubyte *filename, int lineno)
* Name: up_assert_code
****************************************************************************/
void up_assert_code(const ubyte *filename, int lineno, int errorcode)
void up_assert_code(const uint8_t *filename, int lineno, int errorcode)
{
#if CONFIG_TASK_NAME_SIZE > 0 && defined(CONFIG_DEBUG)
_TCB *rtcb = (_TCB*)g_readytorun.head;
+3 -3
View File
@@ -38,8 +38,8 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdbool.h>
#include <sched.h>
#include <debug.h>
@@ -49,7 +49,7 @@
#include "up_internal.h"
/****************************************************************************
* Private Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -96,7 +96,7 @@ void up_block_task(_TCB *tcb, tstate_t task_state)
else
{
_TCB *rtcb = (_TCB*)g_readytorun.head;
boolean switch_needed;
bool switch_needed;
/* Remove the tcb task from the ready-to-run list. If we
* are blocking the task at the head of the task list (the
+3 -3
View File
@@ -39,13 +39,13 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include "os_internal.h"
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -66,7 +66,7 @@
/* A little faster than most memcpy's */
void up_copystate(uint32 *dest, uint32 *src)
void up_copystate(uint32_t *dest, uint32_t *src)
{
int i;
+5 -3
View File
@@ -38,16 +38,18 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <assert.h>
#include "up_arch.h"
#include "os_internal.h"
#include "up_internal.h"
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -66,7 +68,7 @@
* Public Functions
****************************************************************************/
uint32 *up_doirq(int irq, uint32 *regs)
uint32_t *up_doirq(int irq, uint32_t *regs)
{
up_ledon(LED_INIRQ);
#ifdef CONFIG_SUPPRESS_INTERRUPTS
@@ -67,7 +67,7 @@
* Description:
* Restore the current thread context. Full prototype is:
*
* void up_fullcontextrestore(uint32 *restoreregs) __attribute__ ((noreturn));
* void up_fullcontextrestore(uint32_t *restoreregs) __attribute__ ((noreturn));
*
* Return:
* None
+5 -5
View File
@@ -38,8 +38,8 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <string.h>
#include <assert.h>
#include <debug.h>
@@ -94,13 +94,13 @@
int up_hardfault(int irq, FAR void *context)
{
uint32 *regs = (uint32*)context;
uint16 *pc;
uint16 insn;
uint32_t *regs = (uint32_t*)context;
uint16_t *pc;
uint16_t insn;
/* Get the value of the program counter where the fault occurred */
pc = (uint16*)regs[REG_PC] - 1;
pc = (uint16_t*)regs[REG_PC] - 1;
if ((void*)pc >= (void*)&_stext && (void*)pc < (void*)&_etext)
{
/* Fetch the instruction that caused the Hard fault */

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