Clean-up from big switch to stdint/stdbool
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2362 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
1e02bc99ff
commit
e385b1074b
@ -96,7 +96,7 @@ int up_create_stack(_TCB *tcb, size_t stack_size)
|
|||||||
|
|
||||||
/* Allocate the memory for the stack */
|
/* Allocate the memory for the stack */
|
||||||
|
|
||||||
uint32 *stack_alloc_ptr = (uint32_t*)kmalloc(adj_stack_size);
|
uint32_t *stack_alloc_ptr = (uint32_t*)kmalloc(adj_stack_size);
|
||||||
if (stack_alloc_ptr)
|
if (stack_alloc_ptr)
|
||||||
{
|
{
|
||||||
/* This is the address of the last word in the allocation */
|
/* This is the address of the last word in the allocation */
|
||||||
|
@ -90,9 +90,14 @@ void up_reprioritize_rtr(_TCB *tcb, uint8_t priority)
|
|||||||
/* Verify that the caller is sane */
|
/* Verify that the caller is sane */
|
||||||
|
|
||||||
if (tcb->task_state < FIRST_READY_TO_RUN_STATE ||
|
if (tcb->task_state < FIRST_READY_TO_RUN_STATE ||
|
||||||
tcb->task_state > LAST_READY_TO_RUN_STATE ||
|
tcb->task_state > LAST_READY_TO_RUN_STATE
|
||||||
priority < SCHED_PRIORITY_MIN ||
|
#if SCHED_PRIORITY_MIN > UINT8_MIN
|
||||||
priority > SCHED_PRIORITY_MAX)
|
|| priority < SCHED_PRIORITY_MIN
|
||||||
|
#endif
|
||||||
|
#if SCHED_PRIORITY_MAX < UINT8_MAX
|
||||||
|
|| priority > SCHED_PRIORITY_MAX
|
||||||
|
#endif
|
||||||
|
)
|
||||||
{
|
{
|
||||||
PANIC(OSERR_BADREPRIORITIZESTATE);
|
PANIC(OSERR_BADREPRIORITIZESTATE);
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -559,13 +559,13 @@ static int can_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
/* CANIOCTL_RTR: Send the remote transmission request and wait for the response.
|
/* CANIOCTL_RTR: Send the remote transmission request and wait for the response.
|
||||||
* Argument is a reference to struct canioctl_rtr_s (casting to uintptr first
|
* Argument is a reference to struct canioctl_rtr_s (casting to uintptr_t first
|
||||||
* eliminates complaints on some architectures where the sizeof long is different
|
* eliminates complaints on some architectures where the sizeof long is different
|
||||||
* from the size of a pointer).
|
* from the size of a pointer).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
case CANIOCTL_RTR:
|
case CANIOCTL_RTR:
|
||||||
ret = can_rtrread(dev, (struct canioctl_rtr_s*)((uintptr)arg));
|
ret = can_rtrread(dev, (struct canioctl_rtr_s*)((uintptr_t)arg));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Not a "built-in" ioctl command.. perhaps it is unique to this device driver */
|
/* Not a "built-in" ioctl command.. perhaps it is unique to this device driver */
|
||||||
|
@ -218,7 +218,9 @@ static int mmcsd_ioctl(FAR struct inode *inode, int cmd,
|
|||||||
|
|
||||||
static void mmcsd_mediachange(FAR void *arg);
|
static void mmcsd_mediachange(FAR void *arg);
|
||||||
static int mmcsd_widebus(FAR struct mmcsd_state_s *priv);
|
static int mmcsd_widebus(FAR struct mmcsd_state_s *priv);
|
||||||
|
#ifdef CONFIG_MMCSD_MMCSUPPORT
|
||||||
static int mmcsd_mmcinitialize(FAR struct mmcsd_state_s *priv);
|
static int mmcsd_mmcinitialize(FAR struct mmcsd_state_s *priv);
|
||||||
|
#endif
|
||||||
static int mmcsd_sdinitialize(FAR struct mmcsd_state_s *priv);
|
static int mmcsd_sdinitialize(FAR struct mmcsd_state_s *priv);
|
||||||
static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv);
|
static int mmcsd_cardidentify(FAR struct mmcsd_state_s *priv);
|
||||||
static int mmcsd_probe(FAR struct mmcsd_state_s *priv);
|
static int mmcsd_probe(FAR struct mmcsd_state_s *priv);
|
||||||
@ -2120,9 +2122,9 @@ static int mmcsd_widebus(FAR struct mmcsd_state_s *priv)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_MMCSD_MMCSUPPORT
|
||||||
static int mmcsd_mmcinitialize(FAR struct mmcsd_state_s *priv)
|
static int mmcsd_mmcinitialize(FAR struct mmcsd_state_s *priv)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_MMCSD_MMCSUPPORT
|
|
||||||
uint32_t cid[4];
|
uint32_t cid[4];
|
||||||
uint32_t csd[4];
|
uint32_t csd[4];
|
||||||
int ret;
|
int ret;
|
||||||
@ -2201,9 +2203,9 @@ static int mmcsd_mmcinitialize(FAR struct mmcsd_state_s *priv)
|
|||||||
|
|
||||||
SDIO_CLOCK(priv->dev, CLOCK_MMC_TRANSFER);
|
SDIO_CLOCK(priv->dev, CLOCK_MMC_TRANSFER);
|
||||||
up_udelay( MMCSD_CLK_DELAY);
|
up_udelay( MMCSD_CLK_DELAY);
|
||||||
#endif
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: mmcsd_sdinitialize
|
* Name: mmcsd_sdinitialize
|
||||||
|
@ -475,12 +475,12 @@ int ftl_initialize(int minor, uint8_t *buffer, FAR struct mtd_dev_s *mtd)
|
|||||||
|
|
||||||
dev->mtd = mtd;
|
dev->mtd = mtd;
|
||||||
|
|
||||||
/* Get the device geometry. (casting to uintptr first eliminates
|
/* Get the device geometry. (casting to uintptr_t first eliminates
|
||||||
* complaints on some architectures where the sizeof long is different
|
* complaints on some architectures where the sizeof long is different
|
||||||
* from the size of a pointer).
|
* from the size of a pointer).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ret = MTD_IOCTL(mtd, MTDIOC_GEOMETRY, (unsigned long)((uintptr)&dev->geo));
|
ret = MTD_IOCTL(mtd, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&dev->geo));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
fdbg("MTD ioctl(MTDIOC_GEOMETRY) failed: %d\n", ret);
|
fdbg("MTD ioctl(MTDIOC_GEOMETRY) failed: %d\n", ret);
|
||||||
@ -503,7 +503,7 @@ int ftl_initialize(int minor, uint8_t *buffer, FAR struct mtd_dev_s *mtd)
|
|||||||
/* Get the number of R/W blocks per erase block */
|
/* Get the number of R/W blocks per erase block */
|
||||||
|
|
||||||
dev->blkper = dev->geo.erasesize / dev->geo.blocksize;
|
dev->blkper = dev->geo.erasesize / dev->geo.blocksize;
|
||||||
DEBUGASSERT(dev->blkper * dev->geo.blocksize = dev->geo.erasesize);
|
DEBUGASSERT(dev->blkper * dev->geo.blocksize == dev->geo.erasesize);
|
||||||
|
|
||||||
/* Configure read-ahead/write buffering */
|
/* Configure read-ahead/write buffering */
|
||||||
|
|
||||||
|
@ -579,7 +579,7 @@ static int m25p_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
|||||||
{
|
{
|
||||||
case MTDIOC_GEOMETRY:
|
case MTDIOC_GEOMETRY:
|
||||||
{
|
{
|
||||||
FAR struct mtd_geometry_s *geo = (FAR struct mtd_geometry_s *)((uintptr)arg);
|
FAR struct mtd_geometry_s *geo = (FAR struct mtd_geometry_s *)((uintptr_t)arg);
|
||||||
if (geo)
|
if (geo)
|
||||||
{
|
{
|
||||||
/* Populate the geometry structure with information need to know
|
/* Populate the geometry structure with information need to know
|
||||||
|
@ -137,8 +137,8 @@ mkfatfs_nfatsect12(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
|
|||||||
uint32_t navailsects)
|
uint32_t navailsects)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_HAVE_LONG_LONG
|
#ifdef CONFIG_HAVE_LONG_LONG
|
||||||
uint64 denom;
|
uint64_t denom;
|
||||||
uint64 numer;
|
uint64_t numer;
|
||||||
#else
|
#else
|
||||||
uint32_t denom;
|
uint32_t denom;
|
||||||
uint32_t numer;
|
uint32_t numer;
|
||||||
@ -214,8 +214,8 @@ mkfatfs_nfatsect16(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
|
|||||||
uint32_t navailsects)
|
uint32_t navailsects)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_HAVE_LONG_LONG
|
#ifdef CONFIG_HAVE_LONG_LONG
|
||||||
uint64 denom;
|
uint64_t denom;
|
||||||
uint64 numer;
|
uint64_t numer;
|
||||||
#else
|
#else
|
||||||
uint32_t denom;
|
uint32_t denom;
|
||||||
uint32_t numer;
|
uint32_t numer;
|
||||||
@ -280,8 +280,8 @@ mkfatfs_nfatsect32(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
|
|||||||
uint32_t navailsects)
|
uint32_t navailsects)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_HAVE_LONG_LONG
|
#ifdef CONFIG_HAVE_LONG_LONG
|
||||||
uint64 denom;
|
uint64_t denom;
|
||||||
uint64 numer;
|
uint64_t numer;
|
||||||
#else
|
#else
|
||||||
uint32_t denom;
|
uint32_t denom;
|
||||||
uint32_t numer;
|
uint32_t numer;
|
||||||
|
@ -40,6 +40,8 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/compiler.h>
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
@ -317,7 +319,7 @@ extern "C" {
|
|||||||
|
|
||||||
/* Return a pointer to the thread specifid errno */
|
/* Return a pointer to the thread specifid errno */
|
||||||
|
|
||||||
extern FAR int *get_errno_ptr(void);
|
EXTERN FAR int *get_errno_ptr(void);
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
@ -163,7 +163,7 @@ struct pthread_attr_s
|
|||||||
size_t stacksize; /* Size of the stack allocated for the pthead */
|
size_t stacksize; /* Size of the stack allocated for the pthead */
|
||||||
int16_t priority; /* Priority of the pthread */
|
int16_t priority; /* Priority of the pthread */
|
||||||
uint8_t policy; /* Pthread scheduler policy */
|
uint8_t policy; /* Pthread scheduler policy */
|
||||||
uint8_t nheritsched; /* Inherit parent prio/policy? */
|
uint8_t inheritsched; /* Inherit parent prio/policy? */
|
||||||
};
|
};
|
||||||
typedef struct pthread_attr_s pthread_attr_t;
|
typedef struct pthread_attr_s pthread_attr_t;
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <nuttx/compiler.h>
|
#include <nuttx/compiler.h>
|
||||||
|
|
||||||
|
#include <arch/types.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -43,16 +43,22 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <nuttx/compiler.h>
|
#include <nuttx/compiler.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#ifndef __ASSEMBLY__
|
||||||
|
# include <stdint.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Alternative alues for type bool (for historic reasons) */
|
/* Alternative values for type bool (for historic reasons) */
|
||||||
|
|
||||||
#define TRUE 1
|
#ifndef TRUE
|
||||||
#define FALSE 0
|
# define TRUE 1
|
||||||
|
#endif
|
||||||
|
#ifndef FALSE
|
||||||
|
# define FALSE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/* NULL is usually defined in stddef.h (which includes this file) */
|
/* NULL is usually defined in stddef.h (which includes this file) */
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sigint.h>
|
#include <stdint.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <mqueue.h>
|
#include <mqueue.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <config/nuttx.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user