From 744dc52ee75d8d8c23d27d321fc2a1db1c4e9926 Mon Sep 17 00:00:00 2001 From: Ahmed Ismail Date: Fri, 15 Nov 2024 09:45:37 +0000 Subject: [PATCH] armv8-m: Guard portasm.h and FreeRTOS.h declarations Some declarations in portasm.h and FreeRTOS.h will cause build errors if it's not understood by the assembler. For example the 'extern' keyword. To avoid these errors guard any such code inside a #ifdef #endif block so the code is included in C files but excluded by the preprocessor in assembly files. Signed-off-by: Ahmed Ismail --- include/FreeRTOS.h | 527 +++++++++--------- portable/ARMv8M/non_secure/portasm.h | 135 ++--- portable/GCC/ARM_CM23/non_secure/portasm.h | 135 ++--- .../GCC/ARM_CM23_NTZ/non_secure/portasm.h | 135 ++--- portable/GCC/ARM_CM33/non_secure/portasm.h | 135 ++--- .../GCC/ARM_CM33_NTZ/non_secure/portasm.h | 135 ++--- portable/GCC/ARM_CM35P/non_secure/portasm.h | 135 ++--- .../GCC/ARM_CM35P_NTZ/non_secure/portasm.h | 135 ++--- portable/GCC/ARM_CM55/non_secure/portasm.h | 135 ++--- .../GCC/ARM_CM55_NTZ/non_secure/portasm.h | 135 ++--- portable/GCC/ARM_CM85/non_secure/portasm.h | 135 ++--- .../GCC/ARM_CM85_NTZ/non_secure/portasm.h | 135 ++--- portable/IAR/ARM_CM23/non_secure/portasm.h | 135 ++--- .../IAR/ARM_CM23_NTZ/non_secure/portasm.h | 135 ++--- portable/IAR/ARM_CM33/non_secure/portasm.h | 135 ++--- .../IAR/ARM_CM33_NTZ/non_secure/portasm.h | 135 ++--- portable/IAR/ARM_CM35P/non_secure/portasm.h | 135 ++--- .../IAR/ARM_CM35P_NTZ/non_secure/portasm.h | 135 ++--- portable/IAR/ARM_CM55/non_secure/portasm.h | 135 ++--- .../IAR/ARM_CM55_NTZ/non_secure/portasm.h | 135 ++--- portable/IAR/ARM_CM85/non_secure/portasm.h | 135 ++--- .../IAR/ARM_CM85_NTZ/non_secure/portasm.h | 135 ++--- 22 files changed, 1739 insertions(+), 1623 deletions(-) diff --git a/include/FreeRTOS.h b/include/FreeRTOS.h index 3fecbdd734e..f4f0df4adf7 100644 --- a/include/FreeRTOS.h +++ b/include/FreeRTOS.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -29,25 +31,28 @@ #ifndef INC_FREERTOS_H #define INC_FREERTOS_H -/* - * Include the generic headers required for the FreeRTOS port being used. - */ -#include - -/* - * If stdint.h cannot be located then: - * + If using GCC ensure the -nostdint options is *not* being used. - * + Ensure the project's include path includes the directory in which your - * compiler stores stdint.h. - * + Set any compiler options necessary for it to support C99, as technically - * stdint.h is only mandatory with C99 (FreeRTOS does not require C99 in any - * other way). - * + The FreeRTOS download includes a simple stdint.h definition that can be - * used in cases where none is provided by the compiler. The files only - * contains the typedefs required to build FreeRTOS. Read the instructions - * in FreeRTOS/source/stdint.readme for more information. - */ -#include /* READ COMMENT ABOVE. */ +/* Ensure that standard library header files are included only in case of compilers, and not assemblers. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /* + * Include the generic headers required for the FreeRTOS port being used. + */ + #include + + /* + * If stdint.h cannot be located then: + * + If using GCC ensure the -nostdint options is *not* being used. + * + Ensure the project's include path includes the directory in which your + * compiler stores stdint.h. + * + Set any compiler options necessary for it to support C99, as technically + * stdint.h is only mandatory with C99 (FreeRTOS does not require C99 in any + * other way). + * + The FreeRTOS download includes a simple stdint.h definition that can be + * used in cases where none is provided by the compiler. The files only + * contains the typedefs required to build FreeRTOS. Read the instructions + * in FreeRTOS/source/stdint.readme for more information. + */ + #include /* READ COMMENT ABOVE. */ +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ /* Acceptable values for configTICK_TYPE_WIDTH_IN_BITS. */ #define TICK_TYPE_WIDTH_16_BITS 0 @@ -101,11 +106,14 @@ #define configASSERT_DEFINED 1 #endif -/* Basic FreeRTOS definitions. */ -#include "projdefs.h" +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /* Basic FreeRTOS definitions. */ + #include "projdefs.h" -/* Definitions specific to the port being used. */ -#include "portable.h" + /* Definitions specific to the port being used. */ + #include "portable.h" +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ /* Must be defaulted before configUSE_NEWLIB_REENTRANT is used below. */ #ifndef configUSE_NEWLIB_REENTRANT @@ -3088,259 +3096,262 @@ ( ( ( portUSING_MPU_WRAPPERS == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) || \ ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) ) -/* - * In line with software engineering best practice, FreeRTOS implements a strict - * data hiding policy, so the real structures used by FreeRTOS to maintain the - * state of tasks, queues, semaphores, etc. are not accessible to the application - * code. However, if the application writer wants to statically allocate such - * an object then the size of the object needs to be known. Dummy structures - * that are guaranteed to have the same size and alignment requirements of the - * real objects are used for this purpose. The dummy list and list item - * structures below are used for inclusion in such a dummy structure. - */ -struct xSTATIC_LIST_ITEM -{ - #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 ) - TickType_t xDummy1; - #endif - TickType_t xDummy2; - void * pvDummy3[ 4 ]; - #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 ) - TickType_t xDummy4; - #endif -}; -typedef struct xSTATIC_LIST_ITEM StaticListItem_t; - -#if ( configUSE_MINI_LIST_ITEM == 1 ) - /* See the comments above the struct xSTATIC_LIST_ITEM definition. */ - struct xSTATIC_MINI_LIST_ITEM +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /* + * In line with software engineering best practice, FreeRTOS implements a strict + * data hiding policy, so the real structures used by FreeRTOS to maintain the + * state of tasks, queues, semaphores, etc. are not accessible to the application + * code. However, if the application writer wants to statically allocate such + * an object then the size of the object needs to be known. Dummy structures + * that are guaranteed to have the same size and alignment requirements of the + * real objects are used for this purpose. The dummy list and list item + * structures below are used for inclusion in such a dummy structure. + */ + struct xSTATIC_LIST_ITEM { #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 ) TickType_t xDummy1; #endif TickType_t xDummy2; - void * pvDummy3[ 2 ]; + void * pvDummy3[ 4 ]; + #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 ) + TickType_t xDummy4; + #endif }; - typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t; -#else /* if ( configUSE_MINI_LIST_ITEM == 1 ) */ - typedef struct xSTATIC_LIST_ITEM StaticMiniListItem_t; -#endif /* if ( configUSE_MINI_LIST_ITEM == 1 ) */ - -/* See the comments above the struct xSTATIC_LIST_ITEM definition. */ -typedef struct xSTATIC_LIST -{ - #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 ) - TickType_t xDummy1; - #endif - UBaseType_t uxDummy2; - void * pvDummy3; - StaticMiniListItem_t xDummy4; - #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 ) - TickType_t xDummy5; - #endif -} StaticList_t; - -/* - * In line with software engineering best practice, especially when supplying a - * library that is likely to change in future versions, FreeRTOS implements a - * strict data hiding policy. This means the Task structure used internally by - * FreeRTOS is not accessible to application code. However, if the application - * writer wants to statically allocate the memory required to create a task then - * the size of the task object needs to be known. The StaticTask_t structure - * below is provided for this purpose. Its sizes and alignment requirements are - * guaranteed to match those of the genuine structure, no matter which - * architecture is being used, and no matter how the values in FreeRTOSConfig.h - * are set. Its contents are somewhat obfuscated in the hope users will - * recognise that it would be unwise to make direct use of the structure members. - */ -typedef struct xSTATIC_TCB -{ - void * pxDummy1; - #if ( portUSING_MPU_WRAPPERS == 1 ) - xMPU_SETTINGS xDummy2; - #endif - #if ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) - UBaseType_t uxDummy26; - #endif - StaticListItem_t xDummy3[ 2 ]; - UBaseType_t uxDummy5; - void * pxDummy6; - #if ( configNUMBER_OF_CORES > 1 ) - BaseType_t xDummy23; - UBaseType_t uxDummy24; - #endif - uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ]; - #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 ) - BaseType_t xDummy25; - #endif - #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) ) - void * pxDummy8; - #endif - #if ( portCRITICAL_NESTING_IN_TCB == 1 ) - UBaseType_t uxDummy9; - #endif - #if ( configUSE_TRACE_FACILITY == 1 ) - UBaseType_t uxDummy10[ 2 ]; - #endif - #if ( configUSE_MUTEXES == 1 ) - UBaseType_t uxDummy12[ 2 ]; - #endif - #if ( configUSE_APPLICATION_TASK_TAG == 1 ) - void * pxDummy14; - #endif - #if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) - void * pvDummy15[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ]; - #endif - #if ( configGENERATE_RUN_TIME_STATS == 1 ) - configRUN_TIME_COUNTER_TYPE ulDummy16; - #endif - #if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) - configTLS_BLOCK_TYPE xDummy17; - #endif - #if ( configUSE_TASK_NOTIFICATIONS == 1 ) - uint32_t ulDummy18[ configTASK_NOTIFICATION_ARRAY_ENTRIES ]; - uint8_t ucDummy19[ configTASK_NOTIFICATION_ARRAY_ENTRIES ]; - #endif - #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) - uint8_t uxDummy20; - #endif + typedef struct xSTATIC_LIST_ITEM StaticListItem_t; + + #if ( configUSE_MINI_LIST_ITEM == 1 ) + /* See the comments above the struct xSTATIC_LIST_ITEM definition. */ + struct xSTATIC_MINI_LIST_ITEM + { + #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 ) + TickType_t xDummy1; + #endif + TickType_t xDummy2; + void * pvDummy3[ 2 ]; + }; + typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t; + #else /* if ( configUSE_MINI_LIST_ITEM == 1 ) */ + typedef struct xSTATIC_LIST_ITEM StaticMiniListItem_t; + #endif /* if ( configUSE_MINI_LIST_ITEM == 1 ) */ - #if ( INCLUDE_xTaskAbortDelay == 1 ) - uint8_t ucDummy21; - #endif - #if ( configUSE_POSIX_ERRNO == 1 ) - int iDummy22; - #endif -} StaticTask_t; - -/* - * In line with software engineering best practice, especially when supplying a - * library that is likely to change in future versions, FreeRTOS implements a - * strict data hiding policy. This means the Queue structure used internally by - * FreeRTOS is not accessible to application code. However, if the application - * writer wants to statically allocate the memory required to create a queue - * then the size of the queue object needs to be known. The StaticQueue_t - * structure below is provided for this purpose. Its sizes and alignment - * requirements are guaranteed to match those of the genuine structure, no - * matter which architecture is being used, and no matter how the values in - * FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in the hope - * users will recognise that it would be unwise to make direct use of the - * structure members. - */ -typedef struct xSTATIC_QUEUE -{ - void * pvDummy1[ 3 ]; - - union + /* See the comments above the struct xSTATIC_LIST_ITEM definition. */ + typedef struct xSTATIC_LIST { - void * pvDummy2; + #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 ) + TickType_t xDummy1; + #endif UBaseType_t uxDummy2; - } u; - - StaticList_t xDummy3[ 2 ]; - UBaseType_t uxDummy4[ 3 ]; - uint8_t ucDummy5[ 2 ]; + void * pvDummy3; + StaticMiniListItem_t xDummy4; + #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 ) + TickType_t xDummy5; + #endif + } StaticList_t; + + /* + * In line with software engineering best practice, especially when supplying a + * library that is likely to change in future versions, FreeRTOS implements a + * strict data hiding policy. This means the Task structure used internally by + * FreeRTOS is not accessible to application code. However, if the application + * writer wants to statically allocate the memory required to create a task then + * the size of the task object needs to be known. The StaticTask_t structure + * below is provided for this purpose. Its sizes and alignment requirements are + * guaranteed to match those of the genuine structure, no matter which + * architecture is being used, and no matter how the values in FreeRTOSConfig.h + * are set. Its contents are somewhat obfuscated in the hope users will + * recognise that it would be unwise to make direct use of the structure members. + */ + typedef struct xSTATIC_TCB + { + void * pxDummy1; + #if ( portUSING_MPU_WRAPPERS == 1 ) + xMPU_SETTINGS xDummy2; + #endif + #if ( configUSE_CORE_AFFINITY == 1 ) && ( configNUMBER_OF_CORES > 1 ) + UBaseType_t uxDummy26; + #endif + StaticListItem_t xDummy3[ 2 ]; + UBaseType_t uxDummy5; + void * pxDummy6; + #if ( configNUMBER_OF_CORES > 1 ) + BaseType_t xDummy23; + UBaseType_t uxDummy24; + #endif + uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ]; + #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 ) + BaseType_t xDummy25; + #endif + #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) ) + void * pxDummy8; + #endif + #if ( portCRITICAL_NESTING_IN_TCB == 1 ) + UBaseType_t uxDummy9; + #endif + #if ( configUSE_TRACE_FACILITY == 1 ) + UBaseType_t uxDummy10[ 2 ]; + #endif + #if ( configUSE_MUTEXES == 1 ) + UBaseType_t uxDummy12[ 2 ]; + #endif + #if ( configUSE_APPLICATION_TASK_TAG == 1 ) + void * pxDummy14; + #endif + #if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) + void * pvDummy15[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ]; + #endif + #if ( configGENERATE_RUN_TIME_STATS == 1 ) + configRUN_TIME_COUNTER_TYPE ulDummy16; + #endif + #if ( configUSE_C_RUNTIME_TLS_SUPPORT == 1 ) + configTLS_BLOCK_TYPE xDummy17; + #endif + #if ( configUSE_TASK_NOTIFICATIONS == 1 ) + uint32_t ulDummy18[ configTASK_NOTIFICATION_ARRAY_ENTRIES ]; + uint8_t ucDummy19[ configTASK_NOTIFICATION_ARRAY_ENTRIES ]; + #endif + #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 ) + uint8_t uxDummy20; + #endif - #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) - uint8_t ucDummy6; - #endif + #if ( INCLUDE_xTaskAbortDelay == 1 ) + uint8_t ucDummy21; + #endif + #if ( configUSE_POSIX_ERRNO == 1 ) + int iDummy22; + #endif + } StaticTask_t; + + /* + * In line with software engineering best practice, especially when supplying a + * library that is likely to change in future versions, FreeRTOS implements a + * strict data hiding policy. This means the Queue structure used internally by + * FreeRTOS is not accessible to application code. However, if the application + * writer wants to statically allocate the memory required to create a queue + * then the size of the queue object needs to be known. The StaticQueue_t + * structure below is provided for this purpose. Its sizes and alignment + * requirements are guaranteed to match those of the genuine structure, no + * matter which architecture is being used, and no matter how the values in + * FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in the hope + * users will recognise that it would be unwise to make direct use of the + * structure members. + */ + typedef struct xSTATIC_QUEUE + { + void * pvDummy1[ 3 ]; - #if ( configUSE_QUEUE_SETS == 1 ) - void * pvDummy7; - #endif + union + { + void * pvDummy2; + UBaseType_t uxDummy2; + } u; - #if ( configUSE_TRACE_FACILITY == 1 ) - UBaseType_t uxDummy8; - uint8_t ucDummy9; - #endif -} StaticQueue_t; -typedef StaticQueue_t StaticSemaphore_t; + StaticList_t xDummy3[ 2 ]; + UBaseType_t uxDummy4[ 3 ]; + uint8_t ucDummy5[ 2 ]; -/* - * In line with software engineering best practice, especially when supplying a - * library that is likely to change in future versions, FreeRTOS implements a - * strict data hiding policy. This means the event group structure used - * internally by FreeRTOS is not accessible to application code. However, if - * the application writer wants to statically allocate the memory required to - * create an event group then the size of the event group object needs to be - * know. The StaticEventGroup_t structure below is provided for this purpose. - * Its sizes and alignment requirements are guaranteed to match those of the - * genuine structure, no matter which architecture is being used, and no matter - * how the values in FreeRTOSConfig.h are set. Its contents are somewhat - * obfuscated in the hope users will recognise that it would be unwise to make - * direct use of the structure members. - */ -typedef struct xSTATIC_EVENT_GROUP -{ - TickType_t xDummy1; - StaticList_t xDummy2; + #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) + uint8_t ucDummy6; + #endif - #if ( configUSE_TRACE_FACILITY == 1 ) - UBaseType_t uxDummy3; - #endif + #if ( configUSE_QUEUE_SETS == 1 ) + void * pvDummy7; + #endif - #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) - uint8_t ucDummy4; - #endif -} StaticEventGroup_t; + #if ( configUSE_TRACE_FACILITY == 1 ) + UBaseType_t uxDummy8; + uint8_t ucDummy9; + #endif + } StaticQueue_t; + typedef StaticQueue_t StaticSemaphore_t; + + /* + * In line with software engineering best practice, especially when supplying a + * library that is likely to change in future versions, FreeRTOS implements a + * strict data hiding policy. This means the event group structure used + * internally by FreeRTOS is not accessible to application code. However, if + * the application writer wants to statically allocate the memory required to + * create an event group then the size of the event group object needs to be + * know. The StaticEventGroup_t structure below is provided for this purpose. + * Its sizes and alignment requirements are guaranteed to match those of the + * genuine structure, no matter which architecture is being used, and no matter + * how the values in FreeRTOSConfig.h are set. Its contents are somewhat + * obfuscated in the hope users will recognise that it would be unwise to make + * direct use of the structure members. + */ + typedef struct xSTATIC_EVENT_GROUP + { + TickType_t xDummy1; + StaticList_t xDummy2; -/* - * In line with software engineering best practice, especially when supplying a - * library that is likely to change in future versions, FreeRTOS implements a - * strict data hiding policy. This means the software timer structure used - * internally by FreeRTOS is not accessible to application code. However, if - * the application writer wants to statically allocate the memory required to - * create a software timer then the size of the queue object needs to be known. - * The StaticTimer_t structure below is provided for this purpose. Its sizes - * and alignment requirements are guaranteed to match those of the genuine - * structure, no matter which architecture is being used, and no matter how the - * values in FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in - * the hope users will recognise that it would be unwise to make direct use of - * the structure members. - */ -typedef struct xSTATIC_TIMER -{ - void * pvDummy1; - StaticListItem_t xDummy2; - TickType_t xDummy3; - void * pvDummy5; - TaskFunction_t pvDummy6; - #if ( configUSE_TRACE_FACILITY == 1 ) - UBaseType_t uxDummy7; - #endif - uint8_t ucDummy8; -} StaticTimer_t; + #if ( configUSE_TRACE_FACILITY == 1 ) + UBaseType_t uxDummy3; + #endif -/* - * In line with software engineering best practice, especially when supplying a - * library that is likely to change in future versions, FreeRTOS implements a - * strict data hiding policy. This means the stream buffer structure used - * internally by FreeRTOS is not accessible to application code. However, if - * the application writer wants to statically allocate the memory required to - * create a stream buffer then the size of the stream buffer object needs to be - * known. The StaticStreamBuffer_t structure below is provided for this - * purpose. Its size and alignment requirements are guaranteed to match those - * of the genuine structure, no matter which architecture is being used, and - * no matter how the values in FreeRTOSConfig.h are set. Its contents are - * somewhat obfuscated in the hope users will recognise that it would be unwise - * to make direct use of the structure members. - */ -typedef struct xSTATIC_STREAM_BUFFER -{ - size_t uxDummy1[ 4 ]; - void * pvDummy2[ 3 ]; - uint8_t ucDummy3; - #if ( configUSE_TRACE_FACILITY == 1 ) - UBaseType_t uxDummy4; - #endif - #if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) - void * pvDummy5[ 2 ]; - #endif - UBaseType_t uxDummy6; -} StaticStreamBuffer_t; + #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) + uint8_t ucDummy4; + #endif + } StaticEventGroup_t; + + /* + * In line with software engineering best practice, especially when supplying a + * library that is likely to change in future versions, FreeRTOS implements a + * strict data hiding policy. This means the software timer structure used + * internally by FreeRTOS is not accessible to application code. However, if + * the application writer wants to statically allocate the memory required to + * create a software timer then the size of the queue object needs to be known. + * The StaticTimer_t structure below is provided for this purpose. Its sizes + * and alignment requirements are guaranteed to match those of the genuine + * structure, no matter which architecture is being used, and no matter how the + * values in FreeRTOSConfig.h are set. Its contents are somewhat obfuscated in + * the hope users will recognise that it would be unwise to make direct use of + * the structure members. + */ + typedef struct xSTATIC_TIMER + { + void * pvDummy1; + StaticListItem_t xDummy2; + TickType_t xDummy3; + void * pvDummy5; + TaskFunction_t pvDummy6; + #if ( configUSE_TRACE_FACILITY == 1 ) + UBaseType_t uxDummy7; + #endif + uint8_t ucDummy8; + } StaticTimer_t; + + /* + * In line with software engineering best practice, especially when supplying a + * library that is likely to change in future versions, FreeRTOS implements a + * strict data hiding policy. This means the stream buffer structure used + * internally by FreeRTOS is not accessible to application code. However, if + * the application writer wants to statically allocate the memory required to + * create a stream buffer then the size of the stream buffer object needs to be + * known. The StaticStreamBuffer_t structure below is provided for this + * purpose. Its size and alignment requirements are guaranteed to match those + * of the genuine structure, no matter which architecture is being used, and + * no matter how the values in FreeRTOSConfig.h are set. Its contents are + * somewhat obfuscated in the hope users will recognise that it would be unwise + * to make direct use of the structure members. + */ + typedef struct xSTATIC_STREAM_BUFFER + { + size_t uxDummy1[ 4 ]; + void * pvDummy2[ 3 ]; + uint8_t ucDummy3; + #if ( configUSE_TRACE_FACILITY == 1 ) + UBaseType_t uxDummy4; + #endif + #if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) + void * pvDummy5[ 2 ]; + #endif + UBaseType_t uxDummy6; + } StaticStreamBuffer_t; -/* Message buffers are built on stream buffers. */ -typedef StaticStreamBuffer_t StaticMessageBuffer_t; + /* Message buffers are built on stream buffers. */ + typedef StaticStreamBuffer_t StaticMessageBuffer_t; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ /* *INDENT-OFF* */ #ifdef __cplusplus diff --git a/portable/ARMv8M/non_secure/portasm.h b/portable/ARMv8M/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/ARMv8M/non_secure/portasm.h +++ b/portable/ARMv8M/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/GCC/ARM_CM23/non_secure/portasm.h b/portable/GCC/ARM_CM23/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/GCC/ARM_CM23/non_secure/portasm.h +++ b/portable/GCC/ARM_CM23/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/GCC/ARM_CM23_NTZ/non_secure/portasm.h b/portable/GCC/ARM_CM23_NTZ/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/GCC/ARM_CM23_NTZ/non_secure/portasm.h +++ b/portable/GCC/ARM_CM23_NTZ/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/GCC/ARM_CM33/non_secure/portasm.h b/portable/GCC/ARM_CM33/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/GCC/ARM_CM33/non_secure/portasm.h +++ b/portable/GCC/ARM_CM33/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/GCC/ARM_CM33_NTZ/non_secure/portasm.h b/portable/GCC/ARM_CM33_NTZ/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/GCC/ARM_CM33_NTZ/non_secure/portasm.h +++ b/portable/GCC/ARM_CM33_NTZ/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/GCC/ARM_CM35P/non_secure/portasm.h b/portable/GCC/ARM_CM35P/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/GCC/ARM_CM35P/non_secure/portasm.h +++ b/portable/GCC/ARM_CM35P/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/GCC/ARM_CM35P_NTZ/non_secure/portasm.h b/portable/GCC/ARM_CM35P_NTZ/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/GCC/ARM_CM35P_NTZ/non_secure/portasm.h +++ b/portable/GCC/ARM_CM35P_NTZ/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/GCC/ARM_CM55/non_secure/portasm.h b/portable/GCC/ARM_CM55/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/GCC/ARM_CM55/non_secure/portasm.h +++ b/portable/GCC/ARM_CM55/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/GCC/ARM_CM55_NTZ/non_secure/portasm.h b/portable/GCC/ARM_CM55_NTZ/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/GCC/ARM_CM55_NTZ/non_secure/portasm.h +++ b/portable/GCC/ARM_CM55_NTZ/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/GCC/ARM_CM85/non_secure/portasm.h b/portable/GCC/ARM_CM85/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/GCC/ARM_CM85/non_secure/portasm.h +++ b/portable/GCC/ARM_CM85/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/GCC/ARM_CM85_NTZ/non_secure/portasm.h b/portable/GCC/ARM_CM85_NTZ/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/GCC/ARM_CM85_NTZ/non_secure/portasm.h +++ b/portable/GCC/ARM_CM85_NTZ/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/IAR/ARM_CM23/non_secure/portasm.h b/portable/IAR/ARM_CM23/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/IAR/ARM_CM23/non_secure/portasm.h +++ b/portable/IAR/ARM_CM23/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/IAR/ARM_CM23_NTZ/non_secure/portasm.h b/portable/IAR/ARM_CM23_NTZ/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/IAR/ARM_CM23_NTZ/non_secure/portasm.h +++ b/portable/IAR/ARM_CM23_NTZ/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/IAR/ARM_CM33/non_secure/portasm.h b/portable/IAR/ARM_CM33/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/IAR/ARM_CM33/non_secure/portasm.h +++ b/portable/IAR/ARM_CM33/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/IAR/ARM_CM33_NTZ/non_secure/portasm.h b/portable/IAR/ARM_CM33_NTZ/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/IAR/ARM_CM33_NTZ/non_secure/portasm.h +++ b/portable/IAR/ARM_CM33_NTZ/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/IAR/ARM_CM35P/non_secure/portasm.h b/portable/IAR/ARM_CM35P/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/IAR/ARM_CM35P/non_secure/portasm.h +++ b/portable/IAR/ARM_CM35P/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/IAR/ARM_CM35P_NTZ/non_secure/portasm.h b/portable/IAR/ARM_CM35P_NTZ/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/IAR/ARM_CM35P_NTZ/non_secure/portasm.h +++ b/portable/IAR/ARM_CM35P_NTZ/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/IAR/ARM_CM55/non_secure/portasm.h b/portable/IAR/ARM_CM55/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/IAR/ARM_CM55/non_secure/portasm.h +++ b/portable/IAR/ARM_CM55/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/IAR/ARM_CM55_NTZ/non_secure/portasm.h b/portable/IAR/ARM_CM55_NTZ/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/IAR/ARM_CM55_NTZ/non_secure/portasm.h +++ b/portable/IAR/ARM_CM55_NTZ/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/IAR/ARM_CM85/non_secure/portasm.h b/portable/IAR/ARM_CM85/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/IAR/ARM_CM85/non_secure/portasm.h +++ b/portable/IAR/ARM_CM85/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */ diff --git a/portable/IAR/ARM_CM85_NTZ/non_secure/portasm.h b/portable/IAR/ARM_CM85_NTZ/non_secure/portasm.h index b7021b0242f..b89128ca6cb 100644 --- a/portable/IAR/ARM_CM85_NTZ/non_secure/portasm.h +++ b/portable/IAR/ARM_CM85_NTZ/non_secure/portasm.h @@ -1,6 +1,8 @@ /* * FreeRTOS Kernel * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * Copyright 2024 Arm Limited and/or its affiliates + * * * SPDX-License-Identifier: MIT * @@ -35,80 +37,83 @@ /* MPU wrappers includes. */ #include "mpu_wrappers.h" -/** - * @brief Restore the context of the first task so that the first task starts - * executing. - */ -void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +/* Ensure that typedefs are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) + /** + * @brief Restore the context of the first task so that the first task starts + * executing. + */ + void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Checks whether or not the processor is privileged. - * - * @return 1 if the processor is already privileged, 0 otherwise. - */ -BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); + /** + * @brief Checks whether or not the processor is privileged. + * + * @return 1 if the processor is already privileged, 0 otherwise. + */ + BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); -/** - * @brief Raises the privilege level by clearing the bit 0 of the CONTROL - * register. - * - * @note This is a privileged function and should only be called from the kernel - * code. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Raises the privilege level by clearing the bit 0 of the CONTROL + * register. + * + * @note This is a privileged function and should only be called from the kernel + * code. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Lowers the privilege level by setting the bit 0 of the CONTROL - * register. - * - * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. - * Bit[0] = 0 --> The processor is running privileged - * Bit[0] = 1 --> The processor is running unprivileged. - */ -void vResetPrivilege( void ) __attribute__( ( naked ) ); + /** + * @brief Lowers the privilege level by setting the bit 0 of the CONTROL + * register. + * + * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. + * Bit[0] = 0 --> The processor is running privileged + * Bit[0] = 1 --> The processor is running unprivileged. + */ + void vResetPrivilege( void ) __attribute__( ( naked ) ); -/** - * @brief Starts the first task. - */ -void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Starts the first task. + */ + void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Disables interrupts. - */ -uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Disables interrupts. + */ + uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Enables interrupts. - */ -void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Enables interrupts. + */ + void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief PendSV Exception handler. - */ -void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief PendSV Exception handler. + */ + void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief SVC Handler. - */ -void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief SVC Handler. + */ + void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; -/** - * @brief Allocate a Secure context for the calling task. - * - * @param[in] ulSecureStackSize The size of the stack to be allocated on the - * secure side for the calling task. - */ -void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); + /** + * @brief Allocate a Secure context for the calling task. + * + * @param[in] ulSecureStackSize The size of the stack to be allocated on the + * secure side for the calling task. + */ + void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); -/** - * @brief Free the task's secure context. - * - * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. - */ -void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; + /** + * @brief Free the task's secure context. + * + * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. + */ + void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; +#endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */ #endif /* __PORT_ASM_H__ */