]> git.sur5r.net Git - freertos/blobdiff - Source/portable/GCC/ARM_CM3_MPU/port.c
Remove unnecessary use of portLONG, portCHAR and portSHORT.
[freertos] / Source / portable / GCC / ARM_CM3_MPU / port.c
index 48fa7d8586e662ce70e9e0a3f78c36ee9f5ce3a6..f335e9c9f32d6957de65c6aa593ddf8ff4ad9918 100644 (file)
@@ -62,18 +62,18 @@ task.h is included from an application file. */
 #undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
 \r
 /* Constants required to access and manipulate the NVIC. */\r
-#define portNVIC_SYSTICK_CTRL                                  ( ( volatile unsigned portLONG * ) 0xe000e010 )\r
-#define portNVIC_SYSTICK_LOAD                                  ( ( volatile unsigned portLONG * ) 0xe000e014 )\r
-#define portNVIC_SYSPRI2                                               ( ( volatile unsigned portLONG * ) 0xe000ed20 )\r
-#define portNVIC_SYSPRI1                                               ( ( volatile unsigned portLONG * ) 0xe000ed1c )\r
-#define portNVIC_SYS_CTRL_STATE                                        ( ( volatile unsigned portLONG * ) 0xe000ed24 )\r
+#define portNVIC_SYSTICK_CTRL                                  ( ( volatile unsigned long * ) 0xe000e010 )\r
+#define portNVIC_SYSTICK_LOAD                                  ( ( volatile unsigned long * ) 0xe000e014 )\r
+#define portNVIC_SYSPRI2                                               ( ( volatile unsigned long * ) 0xe000ed20 )\r
+#define portNVIC_SYSPRI1                                               ( ( volatile unsigned long * ) 0xe000ed1c )\r
+#define portNVIC_SYS_CTRL_STATE                                        ( ( volatile unsigned long * ) 0xe000ed24 )\r
 #define portNVIC_MEM_FAULT_ENABLE                              ( 1UL << 16UL )\r
 \r
 /* Constants required to access and manipulate the MPU. */\r
-#define portMPU_TYPE                                                   ( ( volatile unsigned portLONG * ) 0xe000ed90 )\r
-#define portMPU_REGION_BASE_ADDRESS                            ( ( volatile unsigned portLONG * ) 0xe000ed9C )\r
-#define portMPU_REGION_ATTRIBUTE                               ( ( volatile unsigned portLONG * ) 0xe000edA0 )\r
-#define portMPU_CTRL                                                   ( ( volatile unsigned portLONG * ) 0xe000ed94 )\r
+#define portMPU_TYPE                                                   ( ( volatile unsigned long * ) 0xe000ed90 )\r
+#define portMPU_REGION_BASE_ADDRESS                            ( ( volatile unsigned long * ) 0xe000ed9C )\r
+#define portMPU_REGION_ATTRIBUTE                               ( ( volatile unsigned long * ) 0xe000edA0 )\r
+#define portMPU_CTRL                                                   ( ( volatile unsigned long * ) 0xe000ed94 )\r
 #define portEXPECTED_MPU_TYPE_VALUE                            ( 8UL << 8UL ) /* 8 regions, unified. */\r
 #define portMPU_ENABLE                                                 ( 0x01UL )\r
 #define portMPU_BACKGROUND_ENABLE                              ( 1UL << 2UL )\r
@@ -87,9 +87,9 @@ task.h is included from an application file. */
 #define portNVIC_SYSTICK_CLK                                   ( 0x00000004UL )\r
 #define portNVIC_SYSTICK_INT                                   ( 0x00000002UL )\r
 #define portNVIC_SYSTICK_ENABLE                                        ( 0x00000001UL )\r
-#define portNVIC_PENDSV_PRI                                            ( ( ( unsigned portLONG ) configKERNEL_INTERRUPT_PRIORITY ) << 16UL )\r
-#define portNVIC_SYSTICK_PRI                                   ( ( ( unsigned portLONG ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL )\r
-#define portNVIC_SVC_PRI                                               ( ( ( unsigned portLONG ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL )\r
+#define portNVIC_PENDSV_PRI                                            ( ( ( unsigned long ) configKERNEL_INTERRUPT_PRIORITY ) << 16UL )\r
+#define portNVIC_SYSTICK_PRI                                   ( ( ( unsigned long ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL )\r
+#define portNVIC_SVC_PRI                                               ( ( ( unsigned long ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL )\r
 #define portNVIC_TEMP_SVC_PRI                                  ( 0x01UL << 24UL )\r
 \r
 /* Constants required to set up the initial stack. */\r
@@ -111,44 +111,44 @@ static unsigned portBASE_TYPE uxCriticalNesting = 0xaaaaaaaa;
 /*\r
  * Setup the timer to generate the tick interrupts.\r
  */\r
-static void prvSetupTimerInterrupt( void );\r
+static void prvSetupTimerInterrupt( void ) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * Configure a number of standard MPU regions that are used by all tasks.\r
  */\r
-static void prvSetupMPU( void );\r
+static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;\r
 \r
 /* \r
  * Return the smallest MPU region size that a given number of bytes will fit\r
  * into.  The region size is returned as the value that should be programmed\r
  * into the region attribute register for that region.\r
  */\r
-static unsigned long prvGetMPURegionSizeSetting( unsigned long ulActualSizeInBytes );\r
+static unsigned long prvGetMPURegionSizeSetting( unsigned long ulActualSizeInBytes ) PRIVILEGED_FUNCTION;\r
 \r
 /* \r
  * Checks to see if being called from the context of an unprivileged task, and\r
  * if so raises the privilege level and returns false - otherwise does nothing\r
  * other than return true.\r
  */\r
-portBASE_TYPE prvRaisePrivilege( void ) __attribute__(( naked ));\r
+static portBASE_TYPE prvRaisePrivilege( void ) __attribute__(( naked ));\r
 \r
 /*\r
  * Standard FreeRTOS exception handlers.\r
  */\r
-void xPortPendSVHandler( void ) __attribute__ (( naked ));\r
-void xPortSysTickHandler( void )  __attribute__ ((optimize("3")));\r
-void vPortSVCHandler( void ) __attribute__ (( naked ));\r
+void xPortPendSVHandler( void ) __attribute__ (( naked )) PRIVILEGED_FUNCTION;\r
+void xPortSysTickHandler( void )  __attribute__ ((optimize("3"))) PRIVILEGED_FUNCTION;\r
+void vPortSVCHandler( void ) __attribute__ (( naked )) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * Starts the scheduler by restoring the context of the first task to run.\r
  */\r
-static void prvRestoreContextOfFirstTask( void ) __attribute__(( naked ));\r
+static void prvRestoreContextOfFirstTask( void ) __attribute__(( naked )) PRIVILEGED_FUNCTION;\r
 \r
 /*\r
  * C portion of the SVC handler.  The SVC handler is split between an asm entry\r
  * and a C wrapper for simplicity of coding and maintenance.\r
  */\r
-static void prvSVCHandler(     unsigned long *pulRegisters ) __attribute__ ((optimize("3")));\r
+static void prvSVCHandler(     unsigned long *pulRegisters ) __attribute__ ((optimize("3"))) PRIVILEGED_FUNCTION;\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -366,7 +366,7 @@ void xPortPendSVHandler( void )
 \r
 void xPortSysTickHandler( void )\r
 {\r
-unsigned portLONG ulDummy;\r
+unsigned long ulDummy;\r
 \r
        /* If using preemption, also force a context switch. */\r
        #if configUSE_PREEMPTION == 1\r
@@ -480,7 +480,7 @@ unsigned long ulRegionSize, ulReturnValue = 4;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-portBASE_TYPE prvRaisePrivilege( void )\r
+static portBASE_TYPE prvRaisePrivilege( void )\r
 {\r
        __asm volatile\r
        ( \r
@@ -498,7 +498,7 @@ portBASE_TYPE prvRaisePrivilege( void )
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, portSTACK_TYPE *pxBottomOfStack, unsigned portSHORT usStackDepth )\r
+void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, portSTACK_TYPE *pxBottomOfStack, unsigned short usStackDepth )\r
 {\r
 extern unsigned long __SRAM_segment_start__[];\r
 extern unsigned long __SRAM_segment_end__[];\r
@@ -594,7 +594,7 @@ unsigned long ul;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-signed portBASE_TYPE MPU_xTaskGenericCreate( pdTASK_CODE pvTaskCode, const signed portCHAR * const pcName, unsigned portSHORT usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask, portSTACK_TYPE *puxStackBuffer, const xMemoryRegion * const xRegions )\r
+signed portBASE_TYPE MPU_xTaskGenericCreate( pdTASK_CODE pvTaskCode, const signed char * const pcName, unsigned short usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask, portSTACK_TYPE *puxStackBuffer, const xMemoryRegion * const xRegions )\r
 {\r
 signed portBASE_TYPE xReturn;\r
 portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();\r
@@ -748,7 +748,7 @@ portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void MPU_vTaskList( signed portCHAR *pcWriteBuffer )\r
+void MPU_vTaskList( signed char *pcWriteBuffer )\r
 {\r
 portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();\r
 \r
@@ -759,7 +759,7 @@ portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();
 /*-----------------------------------------------------------*/\r
 \r
 #if ( configGENERATE_RUN_TIME_STATS == 1 )\r
-       void MPU_vTaskGetRunTimeStats( signed portCHAR *pcWriteBuffer )\r
+       void MPU_vTaskGetRunTimeStats( signed char *pcWriteBuffer )\r
        {\r
     portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();\r
 \r
@@ -770,7 +770,7 @@ portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();
 /*-----------------------------------------------------------*/\r
 \r
 #if ( configUSE_TRACE_FACILITY == 1 )\r
-       void MPU_vTaskStartTrace( signed portCHAR * pcBuffer, unsigned portLONG ulBufferSize )\r
+       void MPU_vTaskStartTrace( signed char * pcBuffer, unsigned long ulBufferSize )\r
        {\r
     portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();\r
 \r
@@ -781,9 +781,9 @@ portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();
 /*-----------------------------------------------------------*/\r
 \r
 #if ( configUSE_TRACE_FACILITY == 1 )\r
-       unsigned portLONG MPU_ulTaskEndTrace( void )\r
+       unsigned long MPU_ulTaskEndTrace( void )\r
        {\r
-       unsigned portLONG ulReturn;\r
+       unsigned long ulReturn;\r
     portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();\r
 \r
                ulReturn = ulTaskEndTrace();\r
@@ -992,7 +992,7 @@ signed portBASE_TYPE xReturn;
 /*-----------------------------------------------------------*/\r
 \r
 #if configQUEUE_REGISTRY_SIZE > 0\r
-       void MPU_vQueueAddToRegistry( xQueueHandle xQueue, signed portCHAR *pcName )\r
+       void MPU_vQueueAddToRegistry( xQueueHandle xQueue, signed char *pcName )\r
        {\r
        portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();\r
 \r