]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/GCC/MicroBlazeV8/port.c
Replace standard types with stdint.h types.
[freertos] / FreeRTOS / Source / portable / GCC / MicroBlazeV8 / port.c
index 1fe020a30ed001a623e9b038963c5be65bc63d81..f6cb4f3eef6169174b637d6b5fd8e386470d8d46 100644 (file)
@@ -98,24 +98,24 @@ created. */
 /*\r
  * Initialise the interrupt controller instance.\r
  */\r
-static long prvInitialiseInterruptController( void );\r
+static int32_t prvInitialiseInterruptController( void );\r
 \r
 /* Ensure the interrupt controller instance variable is initialised before it is\r
  * used, and that the initialisation only happens once.\r
  */\r
-static long prvEnsureInterruptControllerIsInitialised( void );\r
+static int32_t prvEnsureInterruptControllerIsInitialised( void );\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
 /* Counts the nesting depth of calls to portENTER_CRITICAL().  Each task\r
 maintains its own count, so this variable is saved as part of the task\r
 context. */\r
-volatile unsigned portBASE_TYPE uxCriticalNesting = portINITIAL_NESTING_VALUE;\r
+volatile UBaseType_t uxCriticalNesting = portINITIAL_NESTING_VALUE;\r
 \r
 /* This port uses a separate stack for interrupts.  This prevents the stack of\r
 every task needing to be large enough to hold an entire interrupt stack on top\r
 of the task stack. */\r
-unsigned long *pulISRStack;\r
+uint32_t *pulISRStack;\r
 \r
 /* If an interrupt requests a context switch, then ulTaskSwitchRequested will\r
 get set to 1.  ulTaskSwitchRequested is inspected just before the main interrupt\r
@@ -125,7 +125,7 @@ the interrupt exists is the highest priority task that is able to run.  This is
 an unusual mechanism, but is used for this port because a single interrupt can\r
 cause the servicing of multiple peripherals - and it is inefficient to call\r
 vTaskSwitchContext() multiple times as each peripheral is serviced. */\r
-volatile unsigned long ulTaskSwitchRequested = 0UL;\r
+volatile uint32_t ulTaskSwitchRequested = 0UL;\r
 \r
 /* The instance of the interrupt controller used by this port.  This is required\r
 by the Xilinx library API functions. */\r
@@ -139,20 +139,20 @@ static XIntc xInterruptControllerInstance;
  *\r
  * See the portable.h header file.\r
  */\r
-portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )\r
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )\r
 {\r
 extern void *_SDA2_BASE_, *_SDA_BASE_;\r
-const unsigned long ulR2 = ( unsigned long ) &_SDA2_BASE_;\r
-const unsigned long ulR13 = ( unsigned long ) &_SDA_BASE_;\r
+const uint32_t ulR2 = ( uint32_t ) &_SDA2_BASE_;\r
+const uint32_t ulR13 = ( uint32_t ) &_SDA_BASE_;\r
 \r
        /* Place a few bytes of known values on the bottom of the stack.\r
        This is essential for the Microblaze port and these lines must\r
        not be omitted. */\r
-       *pxTopOfStack = ( portSTACK_TYPE ) 0x00000000;\r
+       *pxTopOfStack = ( StackType_t ) 0x00000000;\r
        pxTopOfStack--;\r
-       *pxTopOfStack = ( portSTACK_TYPE ) 0x00000000;\r
+       *pxTopOfStack = ( StackType_t ) 0x00000000;\r
        pxTopOfStack--;\r
-       *pxTopOfStack = ( portSTACK_TYPE ) 0x00000000;\r
+       *pxTopOfStack = ( StackType_t ) 0x00000000;\r
        pxTopOfStack--;\r
 \r
        #if XPAR_MICROBLAZE_0_USE_FPU == 1\r
@@ -169,86 +169,86 @@ const unsigned long ulR13 = ( unsigned long ) &_SDA_BASE_;
 \r
        /* First stack an initial value for the critical section nesting.  This\r
        is initialised to zero. */\r
-       *pxTopOfStack = ( portSTACK_TYPE ) 0x00;\r
+       *pxTopOfStack = ( StackType_t ) 0x00;\r
 \r
        /* R0 is always zero. */\r
        /* R1 is the SP. */\r
 \r
        /* Place an initial value for all the general purpose registers. */\r
        pxTopOfStack--;\r
-       *pxTopOfStack = ( portSTACK_TYPE ) ulR2;        /* R2 - read only small data area. */\r
+       *pxTopOfStack = ( StackType_t ) ulR2;   /* R2 - read only small data area. */\r
        pxTopOfStack--;\r
-       *pxTopOfStack = ( portSTACK_TYPE ) 0x03;        /* R3 - return values and temporaries. */\r
+       *pxTopOfStack = ( StackType_t ) 0x03;   /* R3 - return values and temporaries. */\r
        pxTopOfStack--;\r
-       *pxTopOfStack = ( portSTACK_TYPE ) 0x04;        /* R4 - return values and temporaries. */\r
+       *pxTopOfStack = ( StackType_t ) 0x04;   /* R4 - return values and temporaries. */\r
        pxTopOfStack--;\r
-       *pxTopOfStack = ( portSTACK_TYPE ) pvParameters;/* R5 contains the function call parameters. */\r
+       *pxTopOfStack = ( StackType_t ) pvParameters;/* R5 contains the function call parameters. */\r
 \r
        #ifdef portPRE_LOAD_STACK_FOR_DEBUGGING\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x06;        /* R6 - other parameters and temporaries.  Used as the return address from vPortTaskEntryPoint. */\r
+               *pxTopOfStack = ( StackType_t ) 0x06;   /* R6 - other parameters and temporaries.  Used as the return address from vPortTaskEntryPoint. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x07;        /* R7 - other parameters and temporaries. */\r
+               *pxTopOfStack = ( StackType_t ) 0x07;   /* R7 - other parameters and temporaries. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x08;        /* R8 - other parameters and temporaries. */\r
+               *pxTopOfStack = ( StackType_t ) 0x08;   /* R8 - other parameters and temporaries. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x09;        /* R9 - other parameters and temporaries. */\r
+               *pxTopOfStack = ( StackType_t ) 0x09;   /* R9 - other parameters and temporaries. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x0a;        /* R10 - other parameters and temporaries. */\r
+               *pxTopOfStack = ( StackType_t ) 0x0a;   /* R10 - other parameters and temporaries. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x0b;        /* R11 - temporaries. */\r
+               *pxTopOfStack = ( StackType_t ) 0x0b;   /* R11 - temporaries. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x0c;        /* R12 - temporaries. */\r
+               *pxTopOfStack = ( StackType_t ) 0x0c;   /* R12 - temporaries. */\r
                pxTopOfStack--;\r
        #else\r
                pxTopOfStack-= 8;\r
        #endif\r
 \r
-       *pxTopOfStack = ( portSTACK_TYPE ) ulR13;       /* R13 - read/write small data area. */\r
+       *pxTopOfStack = ( StackType_t ) ulR13;  /* R13 - read/write small data area. */\r
        pxTopOfStack--;\r
-       *pxTopOfStack = ( portSTACK_TYPE ) pxCode;      /* R14 - return address for interrupt. */\r
+       *pxTopOfStack = ( StackType_t ) pxCode; /* R14 - return address for interrupt. */\r
        pxTopOfStack--;\r
-       *pxTopOfStack = ( portSTACK_TYPE ) NULL;        /* R15 - return address for subroutine. */\r
+       *pxTopOfStack = ( StackType_t ) NULL;   /* R15 - return address for subroutine. */\r
 \r
        #ifdef portPRE_LOAD_STACK_FOR_DEBUGGING\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x10;        /* R16 - return address for trap (debugger). */\r
+               *pxTopOfStack = ( StackType_t ) 0x10;   /* R16 - return address for trap (debugger). */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x11;        /* R17 - return address for exceptions, if configured. */\r
+               *pxTopOfStack = ( StackType_t ) 0x11;   /* R17 - return address for exceptions, if configured. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x12;        /* R18 - reserved for assembler and compiler temporaries. */\r
+               *pxTopOfStack = ( StackType_t ) 0x12;   /* R18 - reserved for assembler and compiler temporaries. */\r
                pxTopOfStack--;\r
        #else\r
                pxTopOfStack -= 4;\r
        #endif\r
 \r
-       *pxTopOfStack = ( portSTACK_TYPE ) 0x00;        /* R19 - must be saved across function calls. Callee-save.  Seems to be interpreted as the frame pointer. */\r
+       *pxTopOfStack = ( StackType_t ) 0x00;   /* R19 - must be saved across function calls. Callee-save.  Seems to be interpreted as the frame pointer. */\r
 \r
        #ifdef portPRE_LOAD_STACK_FOR_DEBUGGING\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x14;        /* R20 - reserved for storing a pointer to the Global Offset Table (GOT) in Position Independent Code (PIC). Non-volatile in non-PIC code. Must be saved across function calls. Callee-save.  Not used by FreeRTOS. */\r
+               *pxTopOfStack = ( StackType_t ) 0x14;   /* R20 - reserved for storing a pointer to the Global Offset Table (GOT) in Position Independent Code (PIC). Non-volatile in non-PIC code. Must be saved across function calls. Callee-save.  Not used by FreeRTOS. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x15;        /* R21 - must be saved across function calls. Callee-save. */\r
+               *pxTopOfStack = ( StackType_t ) 0x15;   /* R21 - must be saved across function calls. Callee-save. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x16;        /* R22 - must be saved across function calls. Callee-save. */\r
+               *pxTopOfStack = ( StackType_t ) 0x16;   /* R22 - must be saved across function calls. Callee-save. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x17;        /* R23 - must be saved across function calls. Callee-save. */\r
+               *pxTopOfStack = ( StackType_t ) 0x17;   /* R23 - must be saved across function calls. Callee-save. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x18;        /* R24 - must be saved across function calls. Callee-save. */\r
+               *pxTopOfStack = ( StackType_t ) 0x18;   /* R24 - must be saved across function calls. Callee-save. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x19;        /* R25 - must be saved across function calls. Callee-save. */\r
+               *pxTopOfStack = ( StackType_t ) 0x19;   /* R25 - must be saved across function calls. Callee-save. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x1a;        /* R26 - must be saved across function calls. Callee-save. */\r
+               *pxTopOfStack = ( StackType_t ) 0x1a;   /* R26 - must be saved across function calls. Callee-save. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x1b;        /* R27 - must be saved across function calls. Callee-save. */\r
+               *pxTopOfStack = ( StackType_t ) 0x1b;   /* R27 - must be saved across function calls. Callee-save. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x1c;        /* R28 - must be saved across function calls. Callee-save. */\r
+               *pxTopOfStack = ( StackType_t ) 0x1c;   /* R28 - must be saved across function calls. Callee-save. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x1d;        /* R29 - must be saved across function calls. Callee-save. */\r
+               *pxTopOfStack = ( StackType_t ) 0x1d;   /* R29 - must be saved across function calls. Callee-save. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x1e;        /* R30 - must be saved across function calls. Callee-save. */\r
+               *pxTopOfStack = ( StackType_t ) 0x1e;   /* R30 - must be saved across function calls. Callee-save. */\r
                pxTopOfStack--;\r
-               *pxTopOfStack = ( portSTACK_TYPE ) 0x1f;        /* R31 - must be saved across function calls. Callee-save. */\r
+               *pxTopOfStack = ( StackType_t ) 0x1f;   /* R31 - must be saved across function calls. Callee-save. */\r
                pxTopOfStack--;\r
        #else\r
                pxTopOfStack -= 13;\r
@@ -260,10 +260,10 @@ const unsigned long ulR13 = ( unsigned long ) &_SDA_BASE_;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-portBASE_TYPE xPortStartScheduler( void )\r
+BaseType_t xPortStartScheduler( void )\r
 {\r
 extern void ( vPortStartFirstTask )( void );\r
-extern unsigned long _stack[];\r
+extern uint32_t _stack[];\r
 \r
        /* Setup the hardware to generate the tick.  Interrupts are disabled when\r
        this function is called.\r
@@ -277,7 +277,7 @@ extern unsigned long _stack[];
        vApplicationSetupTimerInterrupt();\r
 \r
        /* Reuse the stack from main() as the stack for the interrupts/exceptions. */\r
-       pulISRStack = ( unsigned long * ) _stack;\r
+       pulISRStack = ( uint32_t * ) _stack;\r
 \r
        /* Ensure there is enough space for the functions called from the interrupt\r
        service routines to write back into the stack frame of the caller. */\r
@@ -321,9 +321,9 @@ extern void VPortYieldASM( void );
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vPortEnableInterrupt( unsigned char ucInterruptID )\r
+void vPortEnableInterrupt( uint8_t ucInterruptID )\r
 {\r
-long lReturn;\r
+int32_t lReturn;\r
 \r
        /* An API function is provided to enable an interrupt in the interrupt\r
        controller because the interrupt controller instance variable is private\r
@@ -338,9 +338,9 @@ long lReturn;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vPortDisableInterrupt( unsigned char ucInterruptID )\r
+void vPortDisableInterrupt( uint8_t ucInterruptID )\r
 {\r
-long lReturn;\r
+int32_t lReturn;\r
 \r
        /* An API function is provided to disable an interrupt in the interrupt\r
        controller because the interrupt controller instance variable is private\r
@@ -356,9 +356,9 @@ long lReturn;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-portBASE_TYPE xPortInstallInterruptHandler( unsigned char ucInterruptID, XInterruptHandler pxHandler, void *pvCallBackRef )\r
+BaseType_t xPortInstallInterruptHandler( uint8_t ucInterruptID, XInterruptHandler pxHandler, void *pvCallBackRef )\r
 {\r
-long lReturn;\r
+int32_t lReturn;\r
 \r
        /* An API function is provided to install an interrupt handler because the\r
        interrupt controller instance variable is private to this file. */\r
@@ -381,10 +381,10 @@ long lReturn;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static long prvEnsureInterruptControllerIsInitialised( void )\r
+static int32_t prvEnsureInterruptControllerIsInitialised( void )\r
 {\r
-static long lInterruptControllerInitialised = pdFALSE;\r
-long lReturn;\r
+static int32_t lInterruptControllerInitialised = pdFALSE;\r
+int32_t lReturn;\r
 \r
        /* Ensure the interrupt controller instance variable is initialised before\r
        it is used, and that the initialisation only happens once. */\r
@@ -434,9 +434,9 @@ extern void vApplicationClearTimerInterrupt( void );
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static long prvInitialiseInterruptController( void )\r
+static int32_t prvInitialiseInterruptController( void )\r
 {\r
-long lStatus;\r
+int32_t lStatus;\r
 \r
        lStatus = XIntc_Initialize( &xInterruptControllerInstance, configINTERRUPT_CONTROLLER_TO_USE );\r
 \r