#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
#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
/*\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
\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
}\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE prvRaisePrivilege( void )\r
+static portBASE_TYPE prvRaisePrivilege( void )\r
{\r
__asm volatile\r
( \r
}\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
}\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
}\r
/*-----------------------------------------------------------*/\r
\r
-void MPU_vTaskList( signed portCHAR *pcWriteBuffer )\r
+void MPU_vTaskList( signed char *pcWriteBuffer )\r
{\r
portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();\r
\r
/*-----------------------------------------------------------*/\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
/*-----------------------------------------------------------*/\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
/*-----------------------------------------------------------*/\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
/*-----------------------------------------------------------*/\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