mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 17:48:33 -04:00
Replace standard types with stdint.h types.
Replace #define types with typedefs. Rename all typedefs to have a _t extension. Add #defines to automatically convert old FreeRTOS specific types to their new names (with the _t).
This commit is contained in:
parent
f292243dcf
commit
3e20aa7d60
190 changed files with 4940 additions and 4603 deletions
|
@ -81,7 +81,7 @@
|
|||
#include "task.h"
|
||||
|
||||
/* Interrupts are enabled. */
|
||||
#define portINITIAL_ESTATUS ( portSTACK_TYPE ) 0x01
|
||||
#define portINITIAL_ESTATUS ( StackType_t ) 0x01
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -97,7 +97,7 @@ void vPortSysTickHandler( void * context, alt_u32 id );
|
|||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvReadGp( unsigned long *ulValue )
|
||||
static void prvReadGp( uint32_t *ulValue )
|
||||
{
|
||||
asm( "stw gp, (%0)" :: "r"(ulValue) );
|
||||
}
|
||||
|
@ -106,10 +106,10 @@ static void prvReadGp( unsigned long *ulValue )
|
|||
/*
|
||||
* See header file for description.
|
||||
*/
|
||||
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
|
||||
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
|
||||
{
|
||||
portSTACK_TYPE *pxFramePointer = pxTopOfStack - 1;
|
||||
portSTACK_TYPE xGlobalPointer;
|
||||
StackType_t *pxFramePointer = pxTopOfStack - 1;
|
||||
StackType_t xGlobalPointer;
|
||||
|
||||
prvReadGp( &xGlobalPointer );
|
||||
|
||||
|
@ -117,7 +117,7 @@ portSTACK_TYPE xGlobalPointer;
|
|||
*pxTopOfStack = 0xdeadbeef;
|
||||
pxTopOfStack--;
|
||||
|
||||
*pxTopOfStack = ( portSTACK_TYPE ) pxFramePointer;
|
||||
*pxTopOfStack = ( StackType_t ) pxFramePointer;
|
||||
pxTopOfStack--;
|
||||
|
||||
*pxTopOfStack = xGlobalPointer;
|
||||
|
@ -125,7 +125,7 @@ portSTACK_TYPE xGlobalPointer;
|
|||
/* Space for R23 to R16. */
|
||||
pxTopOfStack -= 9;
|
||||
|
||||
*pxTopOfStack = ( portSTACK_TYPE ) pxCode;
|
||||
*pxTopOfStack = ( StackType_t ) pxCode;
|
||||
pxTopOfStack--;
|
||||
|
||||
*pxTopOfStack = portINITIAL_ESTATUS;
|
||||
|
@ -133,7 +133,7 @@ portSTACK_TYPE xGlobalPointer;
|
|||
/* Space for R15 to R5. */
|
||||
pxTopOfStack -= 12;
|
||||
|
||||
*pxTopOfStack = ( portSTACK_TYPE ) pvParameters;
|
||||
*pxTopOfStack = ( StackType_t ) pvParameters;
|
||||
|
||||
/* Space for R3 to R1, muldiv and RA. */
|
||||
pxTopOfStack -= 5;
|
||||
|
@ -145,7 +145,7 @@ portSTACK_TYPE xGlobalPointer;
|
|||
/*
|
||||
* See header file for description.
|
||||
*/
|
||||
portBASE_TYPE xPortStartScheduler( void )
|
||||
BaseType_t xPortStartScheduler( void )
|
||||
{
|
||||
/* Start the timer that generates the tick ISR. Interrupts are disabled
|
||||
here already. */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.
|
||||
FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd.
|
||||
All rights reserved
|
||||
|
||||
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
||||
|
@ -73,7 +73,7 @@ extern "C" {
|
|||
#include "sys/alt_irq.h"
|
||||
|
||||
/*-----------------------------------------------------------
|
||||
* Port specific definitions.
|
||||
* Port specific definitions.
|
||||
*
|
||||
* The settings in this file configure FreeRTOS correctly for the
|
||||
* given hardware and compiler.
|
||||
|
@ -88,25 +88,29 @@ extern "C" {
|
|||
#define portDOUBLE double
|
||||
#define portLONG long
|
||||
#define portSHORT short
|
||||
#define portSTACK_TYPE unsigned portLONG
|
||||
#define portSTACK_TYPE uint32_t
|
||||
#define portBASE_TYPE long
|
||||
|
||||
typedef portSTACK_TYPE StackType_t;
|
||||
typedef long BaseType_t;
|
||||
typedef unsigned long UBaseType_t;
|
||||
|
||||
#if( configUSE_16_BIT_TICKS == 1 )
|
||||
typedef unsigned portSHORT portTickType;
|
||||
#define portMAX_DELAY ( portTickType ) 0xffff
|
||||
typedef uint16_t TickType_t;
|
||||
#define portMAX_DELAY ( TickType_t ) 0xffff
|
||||
#else
|
||||
typedef unsigned portLONG portTickType;
|
||||
#define portMAX_DELAY ( portTickType ) 0xffffffffUL
|
||||
typedef uint32_t TickType_t;
|
||||
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Architecture specifics. */
|
||||
#define portSTACK_GROWTH ( -1 )
|
||||
#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )
|
||||
#define portTICK_RATE_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
|
||||
#define portBYTE_ALIGNMENT 4
|
||||
#define portNOP() asm volatile ( "NOP" )
|
||||
#define portCRITICAL_NESTING_IN_TCB 1
|
||||
/*-----------------------------------------------------------*/
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
extern void vTaskSwitchContext( void );
|
||||
#define portYIELD() asm volatile ( "trap" );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue