├── Source ├── portable │ ├── Keil │ │ └── See-also-the-RVDS-directory.txt │ ├── MemMang │ │ ├── ReadMe.url │ │ └── heap_3.c │ ├── readme.txt │ ├── GCC │ │ ├── ARM_CM7 │ │ │ └── ReadMe.txt │ │ ├── ARM_CM23 │ │ │ ├── secure │ │ │ │ ├── secure_init.h │ │ │ │ └── secure_heap.h │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ ├── ARM_CM33 │ │ │ ├── secure │ │ │ │ ├── secure_init.h │ │ │ │ └── secure_heap.h │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ ├── ARM_CM55 │ │ │ ├── secure │ │ │ │ ├── secure_init.h │ │ │ │ └── secure_heap.h │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ ├── ARM_CM85 │ │ │ ├── secure │ │ │ │ ├── secure_init.h │ │ │ │ └── secure_heap.h │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ ├── ARM_CM55_NTZ │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ ├── ARM_CM85_NTZ │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ ├── ARM_CM33_NTZ │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ ├── ARM_CM23_NTZ │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ └── ARM_CM0 │ │ │ └── portasm.h │ ├── IAR │ │ ├── ARM_CM7 │ │ │ └── ReadMe.txt │ │ ├── ARM_CM23 │ │ │ ├── secure │ │ │ │ ├── secure_init.h │ │ │ │ └── secure_heap.h │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ ├── ARM_CM33 │ │ │ ├── secure │ │ │ │ ├── secure_init.h │ │ │ │ ├── secure_heap.h │ │ │ │ └── secure_context_port_asm.s │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ ├── ARM_CM55 │ │ │ ├── secure │ │ │ │ ├── secure_init.h │ │ │ │ ├── secure_heap.h │ │ │ │ └── secure_context_port_asm.s │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ ├── ARM_CM85 │ │ │ ├── secure │ │ │ │ ├── secure_init.h │ │ │ │ └── secure_heap.h │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ ├── ARM_CM55_NTZ │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ ├── ARM_CM85_NTZ │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ ├── ARM_CM33_NTZ │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ ├── ARM_CM3 │ │ │ └── portasm.s │ │ ├── ARM_CM23_NTZ │ │ │ └── non_secure │ │ │ │ ├── portmacro.h │ │ │ │ └── portasm.h │ │ └── ARM_CA9 │ │ │ └── portASM.h │ ├── RVDS │ │ ├── ARM_CM7 │ │ │ └── ReadMe.txt │ │ └── ARM_CA9 │ │ │ └── portmacro.inc │ └── ThirdParty │ │ ├── README.md │ │ └── GCC │ │ └── ARM_CM33_TFM │ │ └── os_wrapper_freertos.c ├── readme.txt ├── LICENSE ├── CMSIS_RTOS_V2 │ ├── cmsis_os.h │ └── freertos_mpool.h └── include │ ├── StackMacros.h │ ├── stdint.readme │ └── newlib-freertos.h ├── .github ├── PULL_REQUEST_TEMPLATE.md └── ISSUE_TEMPLATE │ ├── other-issue.md │ └── bug_report.md ├── LICENSE.md ├── SECURITY.md ├── README.md ├── CONTRIBUTING.md └── CODE_OF_CONDUCT.md /Source/portable/Keil/See-also-the-RVDS-directory.txt: -------------------------------------------------------------------------------- 1 | Nothing to see here. 2 | -------------------------------------------------------------------------------- /Source/portable/MemMang/ReadMe.url: -------------------------------------------------------------------------------- 1 | [{000214A0-0000-0000-C000-000000000046}] 2 | Prop3=19,2 3 | [InternetShortcut] 4 | URL=https://www.FreeRTOS.org/a00111.html 5 | IDList= 6 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## IMPORTANT INFORMATION 2 | 3 | ### Contributor License Agreement (CLA) 4 | * The Pull Request feature will be considered by STMicroelectronics after the signature of a **Contributor License Agreement (CLA)** by the submitter. 5 | * If you did not sign such agreement, please follow the steps mentioned in the [CONTRIBUTING.md](https://github.com/STMicroelectronics/stm32_mw_freertos/blob/master/CONTRIBUTING.md) file. 6 | -------------------------------------------------------------------------------- /Source/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and or compiler. 4 | 5 | + The FreeRTOS/Source directory contains the three files that are common to 6 | every port - list.c, queue.c and tasks.c. The kernel is contained within these 7 | three files. croutine.c implements the optional co-routine functionality - which 8 | is normally only used on very memory limited systems. 9 | 10 | + The FreeRTOS/Source/Portable directory contains the files that are specific to 11 | a particular microcontroller and or compiler. 12 | 13 | + The FreeRTOS/Source/include directory contains the real time kernel header 14 | files. 15 | 16 | See the readme file in the FreeRTOS/Source/Portable directory for more 17 | information. -------------------------------------------------------------------------------- /Source/portable/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and/or compiler. 4 | 5 | 6 | + The FreeRTOS/Source/Portable/MemMang directory contains the five sample 7 | memory allocators as described on the https://www.FreeRTOS.org WEB site. 8 | 9 | + The other directories each contain files specific to a particular 10 | microcontroller or compiler, where the directory name denotes the compiler 11 | specific files the directory contains. 12 | 13 | 14 | 15 | For example, if you are interested in the [compiler] port for the [architecture] 16 | microcontroller, then the port specific files are contained in 17 | FreeRTOS/Source/Portable/[compiler]/[architecture] directory. If this is the 18 | only port you are interested in then all the other directories can be 19 | ignored. 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/other-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'Other Issue ' 3 | about: Generic issue description 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Caution** 11 | The Issues are strictly limited for the reporting of problem encountered with the software provided in this project. 12 | For any other problem related to the STM32 product, the performance, the hardware characteristics and boards, the tools the environment in general, please post a topic in the [ST Community/STM32 MCUs forum](https://community.st.com/s/group/0F90X000000AXsASAW/stm32-mcus). 13 | 14 | **Describe the set-up** 15 | * The board (either ST RPN reference or your custom board). 16 | * IDE or at least the compiler and its version. 17 | 18 | **Additional context** 19 | If you have a first analysis or a patch proposal, thank you to share your proposal. 20 | 21 | **Screenshots** 22 | If applicable, add screenshots to help explain your problem. 23 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. -------------------------------------------------------------------------------- /Source/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM7/ReadMe.txt: -------------------------------------------------------------------------------- 1 | There are two options for running FreeRTOS on ARM Cortex-M7 microcontrollers. 2 | The best option depends on the revision of the ARM Cortex-M7 core in use. The 3 | revision is specified by an 'r' number, and a 'p' number, so will look something 4 | like 'r0p1'. Check the documentation for the microcontroller in use to find the 5 | revision of the Cortex-M7 core used in that microcontroller. If in doubt, use 6 | the FreeRTOS port provided specifically for r0p1 revisions, as that can be used 7 | with all core revisions. 8 | 9 | The first option is to use the ARM Cortex-M4F port, and the second option is to 10 | use the Cortex-M7 r0p1 port - the latter containing a minor errata workaround. 11 | 12 | If the revision of the ARM Cortex-M7 core is not r0p1 then either option can be 13 | used, but it is recommended to use the FreeRTOS ARM Cortex-M4F port located in 14 | the /FreeRTOS/Source/portable/GCC/ARM_CM4F directory. 15 | 16 | If the revision of the ARM Cortex-M7 core is r0p1 then use the FreeRTOS ARM 17 | Cortex-M7 r0p1 port located in the /FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1 18 | directory. 19 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM7/ReadMe.txt: -------------------------------------------------------------------------------- 1 | There are two options for running FreeRTOS on ARM Cortex-M7 microcontrollers. 2 | The best option depends on the revision of the ARM Cortex-M7 core in use. The 3 | revision is specified by an 'r' number, and a 'p' number, so will look something 4 | like 'r0p1'. Check the documentation for the microcontroller in use to find the 5 | revision of the Cortex-M7 core used in that microcontroller. If in doubt, use 6 | the FreeRTOS port provided specifically for r0p1 revisions, as that can be used 7 | with all core revisions. 8 | 9 | The first option is to use the ARM Cortex-M4F port, and the second option is to 10 | use the Cortex-M7 r0p1 port - the latter containing a minor errata workaround. 11 | 12 | If the revision of the ARM Cortex-M7 core is not r0p1 then either option can be 13 | used, but it is recommended to use the FreeRTOS ARM Cortex-M4F port located in 14 | the /FreeRTOS/Source/portable/IAR/ARM_CM4F directory. 15 | 16 | If the revision of the ARM Cortex-M7 core is r0p1 then use the FreeRTOS ARM 17 | Cortex-M7 r0p1 port located in the /FreeRTOS/Source/portable/IAR/ARM_CM7/r0p1 18 | directory. 19 | -------------------------------------------------------------------------------- /Source/portable/RVDS/ARM_CM7/ReadMe.txt: -------------------------------------------------------------------------------- 1 | There are two options for running FreeRTOS on ARM Cortex-M7 microcontrollers. 2 | The best option depends on the revision of the ARM Cortex-M7 core in use. The 3 | revision is specified by an 'r' number, and a 'p' number, so will look something 4 | like 'r0p1'. Check the documentation for the microcontroller in use to find the 5 | revision of the Cortex-M7 core used in that microcontroller. If in doubt, use 6 | the FreeRTOS port provided specifically for r0p1 revisions, as that can be used 7 | with all core revisions. 8 | 9 | The first option is to use the ARM Cortex-M4F port, and the second option is to 10 | use the Cortex-M7 r0p1 port - the latter containing a minor errata workaround. 11 | 12 | If the revision of the ARM Cortex-M7 core is not r0p1 then either option can be 13 | used, but it is recommended to use the FreeRTOS ARM Cortex-M4F port located in 14 | the /FreeRTOS/Source/portable/RVDS/ARM_CM4F directory. 15 | 16 | If the revision of the ARM Cortex-M7 core is r0p1 then use the FreeRTOS ARM 17 | Cortex-M7 r0p1 port located in the /FreeRTOS/Source/portable/RVDS/ARM_CM7/r0p1 18 | directory. 19 | -------------------------------------------------------------------------------- /Source/CMSIS_RTOS_V2/cmsis_os.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2019 ARM Limited. All rights reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the License); you may 7 | * not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * ---------------------------------------------------------------------- 19 | * 20 | * $Date: 10. January 2017 21 | * $Revision: V2.1.0 22 | * 23 | * Project: CMSIS-RTOS API 24 | * Title: cmsis_os.h FreeRTOS header file 25 | *---------------------------------------------------------------------------*/ 26 | 27 | #ifndef CMSIS_OS_H_ 28 | #define CMSIS_OS_H_ 29 | 30 | #define osCMSIS 0x20001U ///< API version (main[31:16].sub[15:0]) 31 | 32 | #include "cmsis_os2.h" 33 | 34 | #endif // CMSIS_OS_H_ 35 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve the quality of our software 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Caution** 11 | The Issues are strictly limited for the reporting of problem encountered with the software provided in this project. 12 | For any other problem related to the STM32 product, the performance, the hardware characteristics and boards, the tools the environment in general, please post a topic in the [ST Community/STM32 MCUs forum](https://community.st.com/s/group/0F90X000000AXsASAW/stm32-mcus). 13 | 14 | **Describe the set-up** 15 | * The board (either ST RPN reference or your custom board). 16 | * IDE or at least the compiler and its version. 17 | 18 | **Describe the bug** 19 | A clear and concise description of what the bug is. 20 | 21 | **How To Reproduce** 22 | 1. Indicate the global behavior of your application project. 23 | 24 | 2. The modules that you suspect to be the cause of the problem (Driver, BSP, MW ...). 25 | 26 | 3. The use case that generates the problem. 27 | 28 | 4. How we can reproduce the problem. 29 | 30 | 31 | **Additional context** 32 | If you have a first analysis or patch correction, thank you to share your proposal. 33 | 34 | **Screenshots** 35 | If applicable, add screenshots to help explain your problem. 36 | -------------------------------------------------------------------------------- /Source/include/StackMacros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | 30 | #ifndef _MSC_VER /* Visual Studio doesn't support #warning. */ 31 | #warning The name of this file has changed to stack_macros.h. Please update your code accordingly. This source file (which has the original name) will be removed in a future release. 32 | #endif 33 | 34 | #include "stack_macros.h" 35 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Report potential product security vulnerabilities 2 | 3 | ST places a high priority on security, and our Product Security Incident 4 | Response Team (PSIRT) is committed to rapidly addressing potential security 5 | vulnerabilities affecting our products. PSIRT's long history and vast experience 6 | in security allows ST to perform clear analyses and provide appropriate guidance 7 | on mitigations and solutions when applicable. 8 | 9 | If you wish to report potential security vulnerabilities regarding our products, 10 | **please do not report them through public GitHub issues.** Instead, we 11 | encourage you to report them to our ST PSIRT following the process described at: 12 | **https://www.st.com/content/st_com/en/security/report-vulnerabilities.html** 13 | 14 | ### IMPORTANT - READ CAREFULLY: 15 | 16 | STMicroelectronics International N.V., on behalf of itself, its affiliates and 17 | subsidiaries, (collectively “ST”) takes all potential security vulnerability 18 | reports or other related communications (“Report(s)”) seriously. In order to 19 | review Your Report (the terms “You” and “Yours” include your employer, and all 20 | affiliates, subsidiaries and related persons or entities) and take actions as 21 | deemed appropriate, ST requires that we have the rights and Your permission to 22 | do so. 23 | 24 | As such, by submitting Your Report to ST, You agree that You have the right to 25 | do so, and You grant to ST the rights to use the Report for purposes related to 26 | security vulnerability analysis, testing, correction, patching, reporting and 27 | any other related purpose or function. 28 | 29 | By submitting Your Report, You agree that ST’s 30 | [Privacy Policy](https://www.st.com/content/st_com/en/common/privacy-portal.html) 31 | applies to all related communications. 32 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM23/secure/secure_init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_INIT_H__ 30 | #define __SECURE_INIT_H__ 31 | 32 | /** 33 | * @brief De-prioritizes the non-secure exceptions. 34 | * 35 | * This is needed to ensure that the non-secure PendSV runs at the lowest 36 | * priority. Context switch is done in the non-secure PendSV handler. 37 | * 38 | * @note This function must be called in the handler mode. It is no-op if called 39 | * in the thread mode. 40 | */ 41 | void SecureInit_DePrioritizeNSExceptions( void ); 42 | 43 | /** 44 | * @brief Sets up the Floating Point Unit (FPU) for Non-Secure access. 45 | * 46 | * Also sets FPCCR.TS=1 to ensure that the content of the Floating Point 47 | * Registers are not leaked to the non-secure side. 48 | * 49 | * @note This function must be called in the handler mode. It is no-op if called 50 | * in the thread mode. 51 | */ 52 | void SecureInit_EnableNSFPUAccess( void ); 53 | 54 | #endif /* __SECURE_INIT_H__ */ 55 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM33/secure/secure_init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_INIT_H__ 30 | #define __SECURE_INIT_H__ 31 | 32 | /** 33 | * @brief De-prioritizes the non-secure exceptions. 34 | * 35 | * This is needed to ensure that the non-secure PendSV runs at the lowest 36 | * priority. Context switch is done in the non-secure PendSV handler. 37 | * 38 | * @note This function must be called in the handler mode. It is no-op if called 39 | * in the thread mode. 40 | */ 41 | void SecureInit_DePrioritizeNSExceptions( void ); 42 | 43 | /** 44 | * @brief Sets up the Floating Point Unit (FPU) for Non-Secure access. 45 | * 46 | * Also sets FPCCR.TS=1 to ensure that the content of the Floating Point 47 | * Registers are not leaked to the non-secure side. 48 | * 49 | * @note This function must be called in the handler mode. It is no-op if called 50 | * in the thread mode. 51 | */ 52 | void SecureInit_EnableNSFPUAccess( void ); 53 | 54 | #endif /* __SECURE_INIT_H__ */ 55 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM55/secure/secure_init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_INIT_H__ 30 | #define __SECURE_INIT_H__ 31 | 32 | /** 33 | * @brief De-prioritizes the non-secure exceptions. 34 | * 35 | * This is needed to ensure that the non-secure PendSV runs at the lowest 36 | * priority. Context switch is done in the non-secure PendSV handler. 37 | * 38 | * @note This function must be called in the handler mode. It is no-op if called 39 | * in the thread mode. 40 | */ 41 | void SecureInit_DePrioritizeNSExceptions( void ); 42 | 43 | /** 44 | * @brief Sets up the Floating Point Unit (FPU) for Non-Secure access. 45 | * 46 | * Also sets FPCCR.TS=1 to ensure that the content of the Floating Point 47 | * Registers are not leaked to the non-secure side. 48 | * 49 | * @note This function must be called in the handler mode. It is no-op if called 50 | * in the thread mode. 51 | */ 52 | void SecureInit_EnableNSFPUAccess( void ); 53 | 54 | #endif /* __SECURE_INIT_H__ */ 55 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM85/secure/secure_init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_INIT_H__ 30 | #define __SECURE_INIT_H__ 31 | 32 | /** 33 | * @brief De-prioritizes the non-secure exceptions. 34 | * 35 | * This is needed to ensure that the non-secure PendSV runs at the lowest 36 | * priority. Context switch is done in the non-secure PendSV handler. 37 | * 38 | * @note This function must be called in the handler mode. It is no-op if called 39 | * in the thread mode. 40 | */ 41 | void SecureInit_DePrioritizeNSExceptions( void ); 42 | 43 | /** 44 | * @brief Sets up the Floating Point Unit (FPU) for Non-Secure access. 45 | * 46 | * Also sets FPCCR.TS=1 to ensure that the content of the Floating Point 47 | * Registers are not leaked to the non-secure side. 48 | * 49 | * @note This function must be called in the handler mode. It is no-op if called 50 | * in the thread mode. 51 | */ 52 | void SecureInit_EnableNSFPUAccess( void ); 53 | 54 | #endif /* __SECURE_INIT_H__ */ 55 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM23/secure/secure_init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_INIT_H__ 30 | #define __SECURE_INIT_H__ 31 | 32 | /** 33 | * @brief De-prioritizes the non-secure exceptions. 34 | * 35 | * This is needed to ensure that the non-secure PendSV runs at the lowest 36 | * priority. Context switch is done in the non-secure PendSV handler. 37 | * 38 | * @note This function must be called in the handler mode. It is no-op if called 39 | * in the thread mode. 40 | */ 41 | void SecureInit_DePrioritizeNSExceptions( void ); 42 | 43 | /** 44 | * @brief Sets up the Floating Point Unit (FPU) for Non-Secure access. 45 | * 46 | * Also sets FPCCR.TS=1 to ensure that the content of the Floating Point 47 | * Registers are not leaked to the non-secure side. 48 | * 49 | * @note This function must be called in the handler mode. It is no-op if called 50 | * in the thread mode. 51 | */ 52 | void SecureInit_EnableNSFPUAccess( void ); 53 | 54 | #endif /* __SECURE_INIT_H__ */ 55 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM33/secure/secure_init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_INIT_H__ 30 | #define __SECURE_INIT_H__ 31 | 32 | /** 33 | * @brief De-prioritizes the non-secure exceptions. 34 | * 35 | * This is needed to ensure that the non-secure PendSV runs at the lowest 36 | * priority. Context switch is done in the non-secure PendSV handler. 37 | * 38 | * @note This function must be called in the handler mode. It is no-op if called 39 | * in the thread mode. 40 | */ 41 | void SecureInit_DePrioritizeNSExceptions( void ); 42 | 43 | /** 44 | * @brief Sets up the Floating Point Unit (FPU) for Non-Secure access. 45 | * 46 | * Also sets FPCCR.TS=1 to ensure that the content of the Floating Point 47 | * Registers are not leaked to the non-secure side. 48 | * 49 | * @note This function must be called in the handler mode. It is no-op if called 50 | * in the thread mode. 51 | */ 52 | void SecureInit_EnableNSFPUAccess( void ); 53 | 54 | #endif /* __SECURE_INIT_H__ */ 55 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM55/secure/secure_init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_INIT_H__ 30 | #define __SECURE_INIT_H__ 31 | 32 | /** 33 | * @brief De-prioritizes the non-secure exceptions. 34 | * 35 | * This is needed to ensure that the non-secure PendSV runs at the lowest 36 | * priority. Context switch is done in the non-secure PendSV handler. 37 | * 38 | * @note This function must be called in the handler mode. It is no-op if called 39 | * in the thread mode. 40 | */ 41 | void SecureInit_DePrioritizeNSExceptions( void ); 42 | 43 | /** 44 | * @brief Sets up the Floating Point Unit (FPU) for Non-Secure access. 45 | * 46 | * Also sets FPCCR.TS=1 to ensure that the content of the Floating Point 47 | * Registers are not leaked to the non-secure side. 48 | * 49 | * @note This function must be called in the handler mode. It is no-op if called 50 | * in the thread mode. 51 | */ 52 | void SecureInit_EnableNSFPUAccess( void ); 53 | 54 | #endif /* __SECURE_INIT_H__ */ 55 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM85/secure/secure_init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_INIT_H__ 30 | #define __SECURE_INIT_H__ 31 | 32 | /** 33 | * @brief De-prioritizes the non-secure exceptions. 34 | * 35 | * This is needed to ensure that the non-secure PendSV runs at the lowest 36 | * priority. Context switch is done in the non-secure PendSV handler. 37 | * 38 | * @note This function must be called in the handler mode. It is no-op if called 39 | * in the thread mode. 40 | */ 41 | void SecureInit_DePrioritizeNSExceptions( void ); 42 | 43 | /** 44 | * @brief Sets up the Floating Point Unit (FPU) for Non-Secure access. 45 | * 46 | * Also sets FPCCR.TS=1 to ensure that the content of the Floating Point 47 | * Registers are not leaked to the non-secure side. 48 | * 49 | * @note This function must be called in the handler mode. It is no-op if called 50 | * in the thread mode. 51 | */ 52 | void SecureInit_EnableNSFPUAccess( void ); 53 | 54 | #endif /* __SECURE_INIT_H__ */ 55 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM23/secure/secure_heap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_HEAP_H__ 30 | #define __SECURE_HEAP_H__ 31 | 32 | /* Standard includes. */ 33 | #include 34 | 35 | /** 36 | * @brief Allocates memory from heap. 37 | * 38 | * @param[in] xWantedSize The size of the memory to be allocated. 39 | * 40 | * @return Pointer to the memory region if the allocation is successful, NULL 41 | * otherwise. 42 | */ 43 | void * pvPortMalloc( size_t xWantedSize ); 44 | 45 | /** 46 | * @brief Frees the previously allocated memory. 47 | * 48 | * @param[in] pv Pointer to the memory to be freed. 49 | */ 50 | void vPortFree( void * pv ); 51 | 52 | /** 53 | * @brief Get the free heap size. 54 | * 55 | * @return Free heap size. 56 | */ 57 | size_t xPortGetFreeHeapSize( void ); 58 | 59 | /** 60 | * @brief Get the minimum ever free heap size. 61 | * 62 | * @return Minimum ever free heap size. 63 | */ 64 | size_t xPortGetMinimumEverFreeHeapSize( void ); 65 | 66 | #endif /* __SECURE_HEAP_H__ */ 67 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM33/secure/secure_heap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_HEAP_H__ 30 | #define __SECURE_HEAP_H__ 31 | 32 | /* Standard includes. */ 33 | #include 34 | 35 | /** 36 | * @brief Allocates memory from heap. 37 | * 38 | * @param[in] xWantedSize The size of the memory to be allocated. 39 | * 40 | * @return Pointer to the memory region if the allocation is successful, NULL 41 | * otherwise. 42 | */ 43 | void * pvPortMalloc( size_t xWantedSize ); 44 | 45 | /** 46 | * @brief Frees the previously allocated memory. 47 | * 48 | * @param[in] pv Pointer to the memory to be freed. 49 | */ 50 | void vPortFree( void * pv ); 51 | 52 | /** 53 | * @brief Get the free heap size. 54 | * 55 | * @return Free heap size. 56 | */ 57 | size_t xPortGetFreeHeapSize( void ); 58 | 59 | /** 60 | * @brief Get the minimum ever free heap size. 61 | * 62 | * @return Minimum ever free heap size. 63 | */ 64 | size_t xPortGetMinimumEverFreeHeapSize( void ); 65 | 66 | #endif /* __SECURE_HEAP_H__ */ 67 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM55/secure/secure_heap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_HEAP_H__ 30 | #define __SECURE_HEAP_H__ 31 | 32 | /* Standard includes. */ 33 | #include 34 | 35 | /** 36 | * @brief Allocates memory from heap. 37 | * 38 | * @param[in] xWantedSize The size of the memory to be allocated. 39 | * 40 | * @return Pointer to the memory region if the allocation is successful, NULL 41 | * otherwise. 42 | */ 43 | void * pvPortMalloc( size_t xWantedSize ); 44 | 45 | /** 46 | * @brief Frees the previously allocated memory. 47 | * 48 | * @param[in] pv Pointer to the memory to be freed. 49 | */ 50 | void vPortFree( void * pv ); 51 | 52 | /** 53 | * @brief Get the free heap size. 54 | * 55 | * @return Free heap size. 56 | */ 57 | size_t xPortGetFreeHeapSize( void ); 58 | 59 | /** 60 | * @brief Get the minimum ever free heap size. 61 | * 62 | * @return Minimum ever free heap size. 63 | */ 64 | size_t xPortGetMinimumEverFreeHeapSize( void ); 65 | 66 | #endif /* __SECURE_HEAP_H__ */ 67 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM85/secure/secure_heap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_HEAP_H__ 30 | #define __SECURE_HEAP_H__ 31 | 32 | /* Standard includes. */ 33 | #include 34 | 35 | /** 36 | * @brief Allocates memory from heap. 37 | * 38 | * @param[in] xWantedSize The size of the memory to be allocated. 39 | * 40 | * @return Pointer to the memory region if the allocation is successful, NULL 41 | * otherwise. 42 | */ 43 | void * pvPortMalloc( size_t xWantedSize ); 44 | 45 | /** 46 | * @brief Frees the previously allocated memory. 47 | * 48 | * @param[in] pv Pointer to the memory to be freed. 49 | */ 50 | void vPortFree( void * pv ); 51 | 52 | /** 53 | * @brief Get the free heap size. 54 | * 55 | * @return Free heap size. 56 | */ 57 | size_t xPortGetFreeHeapSize( void ); 58 | 59 | /** 60 | * @brief Get the minimum ever free heap size. 61 | * 62 | * @return Minimum ever free heap size. 63 | */ 64 | size_t xPortGetMinimumEverFreeHeapSize( void ); 65 | 66 | #endif /* __SECURE_HEAP_H__ */ 67 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM23/secure/secure_heap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_HEAP_H__ 30 | #define __SECURE_HEAP_H__ 31 | 32 | /* Standard includes. */ 33 | #include 34 | 35 | /** 36 | * @brief Allocates memory from heap. 37 | * 38 | * @param[in] xWantedSize The size of the memory to be allocated. 39 | * 40 | * @return Pointer to the memory region if the allocation is successful, NULL 41 | * otherwise. 42 | */ 43 | void * pvPortMalloc( size_t xWantedSize ); 44 | 45 | /** 46 | * @brief Frees the previously allocated memory. 47 | * 48 | * @param[in] pv Pointer to the memory to be freed. 49 | */ 50 | void vPortFree( void * pv ); 51 | 52 | /** 53 | * @brief Get the free heap size. 54 | * 55 | * @return Free heap size. 56 | */ 57 | size_t xPortGetFreeHeapSize( void ); 58 | 59 | /** 60 | * @brief Get the minimum ever free heap size. 61 | * 62 | * @return Minimum ever free heap size. 63 | */ 64 | size_t xPortGetMinimumEverFreeHeapSize( void ); 65 | 66 | #endif /* __SECURE_HEAP_H__ */ 67 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM33/secure/secure_heap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_HEAP_H__ 30 | #define __SECURE_HEAP_H__ 31 | 32 | /* Standard includes. */ 33 | #include 34 | 35 | /** 36 | * @brief Allocates memory from heap. 37 | * 38 | * @param[in] xWantedSize The size of the memory to be allocated. 39 | * 40 | * @return Pointer to the memory region if the allocation is successful, NULL 41 | * otherwise. 42 | */ 43 | void * pvPortMalloc( size_t xWantedSize ); 44 | 45 | /** 46 | * @brief Frees the previously allocated memory. 47 | * 48 | * @param[in] pv Pointer to the memory to be freed. 49 | */ 50 | void vPortFree( void * pv ); 51 | 52 | /** 53 | * @brief Get the free heap size. 54 | * 55 | * @return Free heap size. 56 | */ 57 | size_t xPortGetFreeHeapSize( void ); 58 | 59 | /** 60 | * @brief Get the minimum ever free heap size. 61 | * 62 | * @return Minimum ever free heap size. 63 | */ 64 | size_t xPortGetMinimumEverFreeHeapSize( void ); 65 | 66 | #endif /* __SECURE_HEAP_H__ */ 67 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM55/secure/secure_heap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_HEAP_H__ 30 | #define __SECURE_HEAP_H__ 31 | 32 | /* Standard includes. */ 33 | #include 34 | 35 | /** 36 | * @brief Allocates memory from heap. 37 | * 38 | * @param[in] xWantedSize The size of the memory to be allocated. 39 | * 40 | * @return Pointer to the memory region if the allocation is successful, NULL 41 | * otherwise. 42 | */ 43 | void * pvPortMalloc( size_t xWantedSize ); 44 | 45 | /** 46 | * @brief Frees the previously allocated memory. 47 | * 48 | * @param[in] pv Pointer to the memory to be freed. 49 | */ 50 | void vPortFree( void * pv ); 51 | 52 | /** 53 | * @brief Get the free heap size. 54 | * 55 | * @return Free heap size. 56 | */ 57 | size_t xPortGetFreeHeapSize( void ); 58 | 59 | /** 60 | * @brief Get the minimum ever free heap size. 61 | * 62 | * @return Minimum ever free heap size. 63 | */ 64 | size_t xPortGetMinimumEverFreeHeapSize( void ); 65 | 66 | #endif /* __SECURE_HEAP_H__ */ 67 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM85/secure/secure_heap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __SECURE_HEAP_H__ 30 | #define __SECURE_HEAP_H__ 31 | 32 | /* Standard includes. */ 33 | #include 34 | 35 | /** 36 | * @brief Allocates memory from heap. 37 | * 38 | * @param[in] xWantedSize The size of the memory to be allocated. 39 | * 40 | * @return Pointer to the memory region if the allocation is successful, NULL 41 | * otherwise. 42 | */ 43 | void * pvPortMalloc( size_t xWantedSize ); 44 | 45 | /** 46 | * @brief Frees the previously allocated memory. 47 | * 48 | * @param[in] pv Pointer to the memory to be freed. 49 | */ 50 | void vPortFree( void * pv ); 51 | 52 | /** 53 | * @brief Get the free heap size. 54 | * 55 | * @return Free heap size. 56 | */ 57 | size_t xPortGetFreeHeapSize( void ); 58 | 59 | /** 60 | * @brief Get the minimum ever free heap size. 61 | * 62 | * @return Minimum ever free heap size. 63 | */ 64 | size_t xPortGetMinimumEverFreeHeapSize( void ); 65 | 66 | #endif /* __SECURE_HEAP_H__ */ 67 | -------------------------------------------------------------------------------- /Source/include/stdint.readme: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef FREERTOS_STDINT 30 | #define FREERTOS_STDINT 31 | 32 | /******************************************************************************* 33 | * THIS IS NOT A FULL stdint.h IMPLEMENTATION - It only contains the definitions 34 | * necessary to build the FreeRTOS code. It is provided to allow FreeRTOS to be 35 | * built using compilers that do not provide their own stdint.h definition. 36 | * 37 | * To use this file: 38 | * 39 | * 1) Copy this file into the directory that contains your FreeRTOSConfig.h 40 | * header file, as that directory will already be in the compiler's include 41 | * path. 42 | * 43 | * 2) Rename the copied file stdint.h. 44 | * 45 | */ 46 | 47 | typedef signed char int8_t; 48 | typedef unsigned char uint8_t; 49 | typedef short int16_t; 50 | typedef unsigned short uint16_t; 51 | typedef long int32_t; 52 | typedef unsigned long uint32_t; 53 | 54 | #ifndef SIZE_MAX 55 | #define SIZE_MAX ( ( size_t ) -1 ) 56 | #endif 57 | 58 | #endif /* FREERTOS_STDINT */ 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Middleware FreeRTOS MCU Component 2 | 3 | ![latest tag](https://img.shields.io/github/v/tag/STMicroelectronics/stm32_mw_freertos.svg?color=brightgreen) 4 | 5 | ## Overview 6 | 7 | **STM32Cube** is an STMicroelectronics original initiative to ease developers' life by reducing efforts, time and cost. 8 | 9 | **STM32Cube** covers the overall STM32 products portfolio. It includes a comprehensive embedded software platform delivered for each STM32 series. 10 | * The CMSIS modules (core and device) corresponding to the ARM(tm) core implemented in this STM32 product. 11 | * The STM32 HAL-LL drivers, an abstraction layer offering a set of APIs ensuring maximized portability across the STM32 portfolio. 12 | * The BSP drivers of each evaluation, discovery, or nucleo board provided for this STM32 series. 13 | * A consistent set of middleware libraries such as RTOS, USB, FatFS, graphics, touch sensing library... 14 | * A full set of software projects (basic examples, applications, and demonstrations) for each board provided for this STM32 series. 15 | 16 | Two models of publication are proposed for the STM32Cube embedded software: 17 | * The monolithic **MCU Package**: all STM32Cube software modules of one STM32 series are present (Drivers, Middleware, Projects, Utilities) in the repository (usual name **STM32Cubexx**, xx corresponding to the STM32 series). 18 | * The **MCU component**: each STM32Cube software module being part of the STM32Cube MCU Package, is delivered as an individual repository, allowing the user to select and get only the required software functions. 19 | 20 | ## Description 21 | 22 | This **stm32_mw_freertos** MCU component repository is one element **common to all** STM32Cube MCU embedded software packages, providing the **FreeRTOS Middleware** part. 23 | 24 | ## Release note 25 | 26 | * Details about the content of this release are available in the release note [here](./Source/History.txt). 27 | * Details about the updates made by STMicroelectronics are available in the release note [here](./Source/st_readme.txt). 28 | 29 | ## Compatibility information 30 | 31 | Please refer to the release note in the repository of the STM32Cube **firmware** you are using to know which version of this middleware library to use with other components' versions (**e.g.**, other middleware libraries, drivers). It is **crucial** that you use a consistent set of versions. 32 | 33 | ## Troubleshooting 34 | 35 | Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) guide. 36 | -------------------------------------------------------------------------------- /Source/portable/ThirdParty/README.md: -------------------------------------------------------------------------------- 1 | # FreeRTOS Third Party Ports 2 | 3 | FreeRTOS third party ports can be supported by the FreeRTOS team, a FreeRTOS 4 | partner or FreeRTOS community members. Depending on who supports it, the support 5 | provided will differ as follows: 6 | 7 | ## FreeRTOS Team Supported Third Party FreeRTOS Ports 8 | 9 | Location: https://github.com/FreeRTOS/FreeRTOS-Kernel/tree/main/portable/ThirdParty 10 | 11 | These third party FreeRTOS ports are supported by the FreeRTOS team. For a 12 | FreeRTOS team supported third party FreeRTOS port: 13 | 14 | * The code has been reviewed by the FreeRTOS team. 15 | * FreeRTOS team has access to the hardware and the test results have been 16 | verified by the FreeRTOS team. 17 | * Customer queries as well as bugs are addressed by the FreeRTOS team. 18 | * The code can be included in Long Term Support (LTS) releases. 19 | 20 | A new FreeRTOS port cannot be directly contributed to this location. Instead, 21 | the FreeRTOS team will decide to take ownership of a partner supported or a 22 | community supported FreeRTOS port based on the community interest. 23 | 24 | ## Partner Supported FreeRTOS Ports 25 | 26 | Location: https://github.com/FreeRTOS/FreeRTOS-Kernel-Partner-Supported-Ports/tree/main 27 | 28 | These FreeRTOS ports are supported by a FreeRTOS partner. For a partner 29 | supported FreeRTOS port: 30 | 31 | * The code has not been reviewed by the FreeRTOS team. 32 | * FreeRTOS team has not verified the tests results but tests exist and are 33 | reported to be successful by the partner. 34 | * Customer queries as well as bugs are addressed by the partner. 35 | 36 | A new FreeRTOS port can be directly contributed by a partner. The process to 37 | contribute a FreeRTOS port is documented [here](https://github.com/FreeRTOS/FreeRTOS-Kernel-Partner-Supported-Ports/blob/main/README.md). 38 | 39 | ## Community Supported FreeRTOS Ports 40 | 41 | Location: https://github.com/FreeRTOS/FreeRTOS-Kernel-Community-Supported-Ports/tree/main 42 | 43 | These FreeRTOS ports are supported by the FreeRTOS community members. For a 44 | community supported FreeRTOS port: 45 | 46 | * The code has not been reviewed by the FreeRTOS team. 47 | * Tests may or may not exist for the FreeRTOS port. 48 | * Customer queries as well as bugs are addressed by the community. 49 | 50 | A new FreeRTOS port can be directly contributed by anyone. The process to 51 | contribute a FreeRTOS port is documented [here](https://github.com/FreeRTOS/FreeRTOS-Kernel-Community-Supported-Ports/blob/main/README.md). 52 | -------------------------------------------------------------------------------- /Source/CMSIS_RTOS_V2/freertos_mpool.h: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------- 2 | * Copyright (c) 2013-2020 Arm Limited. All rights reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the License); you may 7 | * not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * Name: freertos_mpool.h 19 | * Purpose: CMSIS RTOS2 wrapper for FreeRTOS 20 | * 21 | *---------------------------------------------------------------------------*/ 22 | 23 | #ifndef FREERTOS_MPOOL_H_ 24 | #define FREERTOS_MPOOL_H_ 25 | 26 | #include 27 | #include "FreeRTOS.h" 28 | #include "semphr.h" 29 | 30 | /* Memory Pool implementation definitions */ 31 | #define MPOOL_STATUS 0x5EED0000U 32 | 33 | /* Memory Block header */ 34 | typedef struct { 35 | void *next; /* Pointer to next block */ 36 | } MemPoolBlock_t; 37 | 38 | /* Memory Pool control block */ 39 | typedef struct MemPoolDef_t { 40 | MemPoolBlock_t *head; /* Pointer to head block */ 41 | SemaphoreHandle_t sem; /* Pool semaphore handle */ 42 | uint8_t *mem_arr; /* Pool memory array */ 43 | uint32_t mem_sz; /* Pool memory array size */ 44 | const char *name; /* Pointer to name string */ 45 | uint32_t bl_sz; /* Size of a single block */ 46 | uint32_t bl_cnt; /* Number of blocks */ 47 | uint32_t n; /* Block allocation index */ 48 | volatile uint32_t status; /* Object status flags */ 49 | #if (configSUPPORT_STATIC_ALLOCATION == 1) 50 | StaticSemaphore_t mem_sem; /* Semaphore object memory */ 51 | #endif 52 | } MemPool_t; 53 | 54 | /* No need to hide static object type, just align to coding style */ 55 | #define StaticMemPool_t MemPool_t 56 | 57 | /* Define memory pool control block size */ 58 | #define MEMPOOL_CB_SIZE (sizeof(StaticMemPool_t)) 59 | 60 | /* Define size of the byte array required to create count of blocks of given size */ 61 | #define MEMPOOL_ARR_SIZE(bl_count, bl_size) (((((bl_size) + (4 - 1)) / 4) * 4)*(bl_count)) 62 | 63 | #endif /* FREERTOS_MPOOL_H_ */ 64 | -------------------------------------------------------------------------------- /Source/include/newlib-freertos.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef INC_NEWLIB_FREERTOS_H 30 | #define INC_NEWLIB_FREERTOS_H 31 | 32 | /* Note Newlib support has been included by popular demand, but is not 33 | * used by the FreeRTOS maintainers themselves. FreeRTOS is not 34 | * responsible for resulting newlib operation. User must be familiar with 35 | * newlib and must provide system-wide implementations of the necessary 36 | * stubs. Be warned that (at the time of writing) the current newlib design 37 | * implements a system-wide malloc() that must be provided with locks. 38 | * 39 | * See the third party link http://www.nadler.com/embedded/newlibAndFreeRTOS.html 40 | * for additional information. */ 41 | 42 | #include 43 | 44 | #define configUSE_C_RUNTIME_TLS_SUPPORT 1 45 | 46 | #ifndef configTLS_BLOCK_TYPE 47 | #define configTLS_BLOCK_TYPE struct _reent 48 | #endif 49 | 50 | #ifndef configINIT_TLS_BLOCK 51 | #define configINIT_TLS_BLOCK( xTLSBlock, pxTopOfStack ) _REENT_INIT_PTR( &( xTLSBlock ) ) 52 | #endif 53 | 54 | #ifndef configSET_TLS_BLOCK 55 | #define configSET_TLS_BLOCK( xTLSBlock ) ( _impure_ptr = &( xTLSBlock ) ) 56 | #endif 57 | 58 | #ifndef configDEINIT_TLS_BLOCK 59 | #define configDEINIT_TLS_BLOCK( xTLSBlock ) _reclaim_reent( &( xTLSBlock ) ) 60 | #endif 61 | 62 | #endif /* INC_NEWLIB_FREERTOS_H */ 63 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing guide 2 | 3 | This guide serves as a checklist before contributing to this repository. It mainly focuses on the steps to follow to submit an issue or a pull-request. 4 | 5 | ## 1. Issues 6 | 7 | ### 1.1 Before opening an issue 8 | 9 | Please check the following points before posting an issue: 10 | * Make sure you are using the latest commit (major releases are tagged, but corrections are available as new commits). 11 | * Make sure your issue is a question/feedback/suggestions **related to** the software provided in this repository. Otherwise, please refer to section [3](CONTRIBUTING.md#3-support-requests-and-questions) below. 12 | * Make sure your issue is not already reported/fixed on GitHub or discussed on a previous issue. Do not forget to browse into the **closed** issues. 13 | 14 | ### 1.2 Posting the issue 15 | 16 | When you have checked the previous points, create a new report from the **Issues** tab of this repository. A template is available [here](../../issues/new/choose) to help you report the issue you are facing or the enhancement you would like to propose. 17 | 18 | ## 2. Pull Requests 19 | 20 | ### 2.1 Before opening a pull-request 21 | 22 | STMicrolectronics is happy to receive contributions from the community, based on an initial Contributor License Agreement (CLA) procedure. 23 | 24 | * If you are an individual writing original source code and you are sure **you own the intellectual property**, then you need to sign an Individual [CLA](https://cla.st.com). 25 | * If you work for a company that wants also to allow you to contribute with your work, your company needs to provide a Corporate [CLA](https://cla.st.com) mentioning your GitHub account name. 26 | * If you are not sure that a CLA (Individual or Corporate) has been signed for your GitHub account you can check the [CLA](https://cla.st.com) dedicated page. 27 | 28 | Please note that: 29 | * The Corporate CLA will always take precedence over the Individual CLA. 30 | * One CLA submission is sufficient, for any project proposed by STMicroelectronics. 31 | 32 | ### 2.2 How to proceed 33 | 34 | * We recommend to engage first a communication thru an issue, in order to present your proposal, just to confirm that it corresponds to STMicroelectronics' domain or scope. 35 | * Then fork the project to your GitHub account to further develop your contribution. Please use the latest commit version. 36 | * Please, submit one pull-request per new feature or proposal. This will ease the analysis and the final merge if accepted. 37 | 38 | ## 3. Support requests and questions 39 | 40 | For support requests or any other question related to the product, the tools, the environment, you can submit a post to the **ST Community** on the appropriate topic [page](https://community.st.com/s/topiccatalog). 41 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM55/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | #ifndef configENABLE_MVE 49 | #error configENABLE_MVE must be defined in FreeRTOSConfig.h. Set configENABLE_MVE to 1 to enable the MVE or 0 to disable the MVE. 50 | #endif /* configENABLE_MVE */ 51 | /*-----------------------------------------------------------*/ 52 | 53 | /** 54 | * Architecture specifics. 55 | */ 56 | #define portARCH_NAME "Cortex-M55" 57 | #define portHAS_ARMV8M_MAIN_EXTENSION 1 58 | #define portARMV8M_MINOR_VERSION 1 59 | #define portDONT_DISCARD __attribute__( ( used ) ) 60 | /*-----------------------------------------------------------*/ 61 | 62 | /* ARMv8-M common port configurations. */ 63 | #include "portmacrocommon.h" 64 | /*-----------------------------------------------------------*/ 65 | 66 | /** 67 | * @brief Critical section management. 68 | */ 69 | #define portDISABLE_INTERRUPTS() ulSetInterruptMask() 70 | #define portENABLE_INTERRUPTS() vClearInterruptMask( 0 ) 71 | /*-----------------------------------------------------------*/ 72 | 73 | /* *INDENT-OFF* */ 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | /* *INDENT-ON* */ 78 | 79 | #endif /* PORTMACRO_H */ 80 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM55_NTZ/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | #ifndef configENABLE_MVE 49 | #error configENABLE_MVE must be defined in FreeRTOSConfig.h. Set configENABLE_MVE to 1 to enable the MVE or 0 to disable the MVE. 50 | #endif /* configENABLE_MVE */ 51 | /*-----------------------------------------------------------*/ 52 | 53 | /** 54 | * Architecture specifics. 55 | */ 56 | #define portARCH_NAME "Cortex-M55" 57 | #define portHAS_ARMV8M_MAIN_EXTENSION 1 58 | #define portARMV8M_MINOR_VERSION 1 59 | #define portDONT_DISCARD __attribute__( ( used ) ) 60 | /*-----------------------------------------------------------*/ 61 | 62 | /* ARMv8-M common port configurations. */ 63 | #include "portmacrocommon.h" 64 | /*-----------------------------------------------------------*/ 65 | 66 | /** 67 | * @brief Critical section management. 68 | */ 69 | #define portDISABLE_INTERRUPTS() ulSetInterruptMask() 70 | #define portENABLE_INTERRUPTS() vClearInterruptMask( 0 ) 71 | /*-----------------------------------------------------------*/ 72 | 73 | /* *INDENT-OFF* */ 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | /* *INDENT-ON* */ 78 | 79 | #endif /* PORTMACRO_H */ 80 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM85/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | #ifndef configENABLE_MVE 49 | #error configENABLE_MVE must be defined in FreeRTOSConfig.h. Set configENABLE_MVE to 1 to enable the MVE or 0 to disable the MVE. 50 | #endif /* configENABLE_MVE */ 51 | /*-----------------------------------------------------------*/ 52 | 53 | /** 54 | * Architecture specifics. 55 | */ 56 | #define portARCH_NAME "Cortex-M85" 57 | #define portHAS_ARMV8M_MAIN_EXTENSION 1 58 | #define portARMV8M_MINOR_VERSION 1 59 | #define portDONT_DISCARD __attribute__( ( used ) ) 60 | /*-----------------------------------------------------------*/ 61 | 62 | /* ARMv8-M common port configurations. */ 63 | #include "portmacrocommon.h" 64 | /*-----------------------------------------------------------*/ 65 | 66 | /** 67 | * @brief Critical section management. 68 | */ 69 | #define portDISABLE_INTERRUPTS() ulSetInterruptMask() 70 | #define portENABLE_INTERRUPTS() vClearInterruptMask( 0 ) 71 | /*-----------------------------------------------------------*/ 72 | 73 | /* *INDENT-OFF* */ 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | /* *INDENT-ON* */ 78 | 79 | #endif /* PORTMACRO_H */ 80 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM85_NTZ/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | #ifndef configENABLE_MVE 49 | #error configENABLE_MVE must be defined in FreeRTOSConfig.h. Set configENABLE_MVE to 1 to enable the MVE or 0 to disable the MVE. 50 | #endif /* configENABLE_MVE */ 51 | /*-----------------------------------------------------------*/ 52 | 53 | /** 54 | * Architecture specifics. 55 | */ 56 | #define portARCH_NAME "Cortex-M85" 57 | #define portHAS_ARMV8M_MAIN_EXTENSION 1 58 | #define portARMV8M_MINOR_VERSION 1 59 | #define portDONT_DISCARD __attribute__( ( used ) ) 60 | /*-----------------------------------------------------------*/ 61 | 62 | /* ARMv8-M common port configurations. */ 63 | #include "portmacrocommon.h" 64 | /*-----------------------------------------------------------*/ 65 | 66 | /** 67 | * @brief Critical section management. 68 | */ 69 | #define portDISABLE_INTERRUPTS() ulSetInterruptMask() 70 | #define portENABLE_INTERRUPTS() vClearInterruptMask( 0 ) 71 | /*-----------------------------------------------------------*/ 72 | 73 | /* *INDENT-OFF* */ 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | /* *INDENT-ON* */ 78 | 79 | #endif /* PORTMACRO_H */ 80 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM33/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | /** 49 | * Architecture specifics. 50 | */ 51 | #define portARCH_NAME "Cortex-M33" 52 | #define portHAS_ARMV8M_MAIN_EXTENSION 1 53 | #define portARMV8M_MINOR_VERSION 0 54 | #define portDONT_DISCARD __attribute__( ( used ) ) 55 | /*-----------------------------------------------------------*/ 56 | 57 | /* ARMv8-M common port configurations. */ 58 | #include "portmacrocommon.h" 59 | /*-----------------------------------------------------------*/ 60 | 61 | #ifndef configENABLE_MVE 62 | #define configENABLE_MVE 0 63 | #elif ( configENABLE_MVE != 0 ) 64 | #error configENABLE_MVE must be left undefined, or defined to 0 for the Cortex-M33. 65 | #endif 66 | /*-----------------------------------------------------------*/ 67 | 68 | /** 69 | * @brief Critical section management. 70 | */ 71 | #define portDISABLE_INTERRUPTS() ulSetInterruptMask() 72 | #define portENABLE_INTERRUPTS() vClearInterruptMask( 0 ) 73 | /*-----------------------------------------------------------*/ 74 | 75 | /* *INDENT-OFF* */ 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | /* *INDENT-ON* */ 80 | 81 | #endif /* PORTMACRO_H */ 82 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM33_NTZ/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | /** 49 | * Architecture specifics. 50 | */ 51 | #define portARCH_NAME "Cortex-M33" 52 | #define portHAS_ARMV8M_MAIN_EXTENSION 1 53 | #define portARMV8M_MINOR_VERSION 0 54 | #define portDONT_DISCARD __attribute__( ( used ) ) 55 | /*-----------------------------------------------------------*/ 56 | 57 | /* ARMv8-M common port configurations. */ 58 | #include "portmacrocommon.h" 59 | /*-----------------------------------------------------------*/ 60 | 61 | #ifndef configENABLE_MVE 62 | #define configENABLE_MVE 0 63 | #elif ( configENABLE_MVE != 0 ) 64 | #error configENABLE_MVE must be left undefined, or defined to 0 for the Cortex-M33. 65 | #endif 66 | /*-----------------------------------------------------------*/ 67 | 68 | /** 69 | * @brief Critical section management. 70 | */ 71 | #define portDISABLE_INTERRUPTS() ulSetInterruptMask() 72 | #define portENABLE_INTERRUPTS() vClearInterruptMask( 0 ) 73 | /*-----------------------------------------------------------*/ 74 | 75 | /* *INDENT-OFF* */ 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | /* *INDENT-ON* */ 80 | 81 | #endif /* PORTMACRO_H */ 82 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM23/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | /** 49 | * Architecture specifics. 50 | */ 51 | #define portARCH_NAME "Cortex-M23" 52 | #define portHAS_ARMV8M_MAIN_EXTENSION 0 53 | #define portARMV8M_MINOR_VERSION 0 54 | #define portDONT_DISCARD __attribute__( ( used ) ) 55 | /*-----------------------------------------------------------*/ 56 | 57 | /* ARMv8-M common port configurations. */ 58 | #include "portmacrocommon.h" 59 | /*-----------------------------------------------------------*/ 60 | 61 | #if ( configTOTAL_MPU_REGIONS == 16 ) 62 | #error 16 MPU regions are not yet supported for this port. 63 | #endif 64 | 65 | #ifndef configENABLE_MVE 66 | #define configENABLE_MVE 0 67 | #elif ( configENABLE_MVE != 0 ) 68 | #error configENABLE_MVE must be left undefined, or defined to 0 for the Cortex-M23. 69 | #endif 70 | /*-----------------------------------------------------------*/ 71 | 72 | /** 73 | * @brief Critical section management. 74 | */ 75 | #define portDISABLE_INTERRUPTS() __asm volatile ( " cpsid i " ::: "memory" ) 76 | #define portENABLE_INTERRUPTS() __asm volatile ( " cpsie i " ::: "memory" ) 77 | /*-----------------------------------------------------------*/ 78 | 79 | /* *INDENT-OFF* */ 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | /* *INDENT-ON* */ 84 | 85 | #endif /* PORTMACRO_H */ 86 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM23_NTZ/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | /** 49 | * Architecture specifics. 50 | */ 51 | #define portARCH_NAME "Cortex-M23" 52 | #define portHAS_ARMV8M_MAIN_EXTENSION 0 53 | #define portARMV8M_MINOR_VERSION 0 54 | #define portDONT_DISCARD __attribute__( ( used ) ) 55 | /*-----------------------------------------------------------*/ 56 | 57 | /* ARMv8-M common port configurations. */ 58 | #include "portmacrocommon.h" 59 | /*-----------------------------------------------------------*/ 60 | 61 | #if ( configTOTAL_MPU_REGIONS == 16 ) 62 | #error 16 MPU regions are not yet supported for this port. 63 | #endif 64 | 65 | #ifndef configENABLE_MVE 66 | #define configENABLE_MVE 0 67 | #elif ( configENABLE_MVE != 0 ) 68 | #error configENABLE_MVE must be left undefined, or defined to 0 for the Cortex-M23. 69 | #endif 70 | /*-----------------------------------------------------------*/ 71 | 72 | /** 73 | * @brief Critical section management. 74 | */ 75 | #define portDISABLE_INTERRUPTS() __asm volatile ( " cpsid i " ::: "memory" ) 76 | #define portENABLE_INTERRUPTS() __asm volatile ( " cpsie i " ::: "memory" ) 77 | /*-----------------------------------------------------------*/ 78 | 79 | /* *INDENT-OFF* */ 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | /* *INDENT-ON* */ 84 | 85 | #endif /* PORTMACRO_H */ 86 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM55/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | #ifndef configENABLE_MVE 49 | #error configENABLE_MVE must be defined in FreeRTOSConfig.h. Set configENABLE_MVE to 1 to enable the MVE or 0 to disable the MVE. 50 | #endif /* configENABLE_MVE */ 51 | /*-----------------------------------------------------------*/ 52 | 53 | /** 54 | * Architecture specifics. 55 | */ 56 | #define portARCH_NAME "Cortex-M55" 57 | #define portHAS_ARMV8M_MAIN_EXTENSION 1 58 | #define portARMV8M_MINOR_VERSION 1 59 | #define portDONT_DISCARD __root 60 | /*-----------------------------------------------------------*/ 61 | 62 | /* ARMv8-M common port configurations. */ 63 | #include "portmacrocommon.h" 64 | /*-----------------------------------------------------------*/ 65 | 66 | /** 67 | * @brief Critical section management. 68 | */ 69 | #define portDISABLE_INTERRUPTS() ulSetInterruptMask() 70 | #define portENABLE_INTERRUPTS() vClearInterruptMask( 0 ) 71 | /*-----------------------------------------------------------*/ 72 | 73 | /* Suppress warnings that are generated by the IAR tools, but cannot be fixed in 74 | * the source code because to do so would cause other compilers to generate 75 | * warnings. */ 76 | #pragma diag_suppress=Be006 77 | #pragma diag_suppress=Pa082 78 | /*-----------------------------------------------------------*/ 79 | 80 | /* *INDENT-OFF* */ 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | /* *INDENT-ON* */ 85 | 86 | #endif /* PORTMACRO_H */ 87 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM55_NTZ/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | #ifndef configENABLE_MVE 49 | #error configENABLE_MVE must be defined in FreeRTOSConfig.h. Set configENABLE_MVE to 1 to enable the MVE or 0 to disable the MVE. 50 | #endif /* configENABLE_MVE */ 51 | /*-----------------------------------------------------------*/ 52 | 53 | /** 54 | * Architecture specifics. 55 | */ 56 | #define portARCH_NAME "Cortex-M55" 57 | #define portHAS_ARMV8M_MAIN_EXTENSION 1 58 | #define portARMV8M_MINOR_VERSION 1 59 | #define portDONT_DISCARD __root 60 | /*-----------------------------------------------------------*/ 61 | 62 | /* ARMv8-M common port configurations. */ 63 | #include "portmacrocommon.h" 64 | /*-----------------------------------------------------------*/ 65 | 66 | /** 67 | * @brief Critical section management. 68 | */ 69 | #define portDISABLE_INTERRUPTS() ulSetInterruptMask() 70 | #define portENABLE_INTERRUPTS() vClearInterruptMask( 0 ) 71 | /*-----------------------------------------------------------*/ 72 | 73 | /* Suppress warnings that are generated by the IAR tools, but cannot be fixed in 74 | * the source code because to do so would cause other compilers to generate 75 | * warnings. */ 76 | #pragma diag_suppress=Be006 77 | #pragma diag_suppress=Pa082 78 | /*-----------------------------------------------------------*/ 79 | 80 | /* *INDENT-OFF* */ 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | /* *INDENT-ON* */ 85 | 86 | #endif /* PORTMACRO_H */ 87 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM85/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | #ifndef configENABLE_MVE 49 | #error configENABLE_MVE must be defined in FreeRTOSConfig.h. Set configENABLE_MVE to 1 to enable the MVE or 0 to disable the MVE. 50 | #endif /* configENABLE_MVE */ 51 | /*-----------------------------------------------------------*/ 52 | 53 | /** 54 | * Architecture specifics. 55 | */ 56 | #define portARCH_NAME "Cortex-M85" 57 | #define portHAS_ARMV8M_MAIN_EXTENSION 1 58 | #define portARMV8M_MINOR_VERSION 1 59 | #define portDONT_DISCARD __root 60 | /*-----------------------------------------------------------*/ 61 | 62 | /* ARMv8-M common port configurations. */ 63 | #include "portmacrocommon.h" 64 | /*-----------------------------------------------------------*/ 65 | 66 | /** 67 | * @brief Critical section management. 68 | */ 69 | #define portDISABLE_INTERRUPTS() ulSetInterruptMask() 70 | #define portENABLE_INTERRUPTS() vClearInterruptMask( 0 ) 71 | /*-----------------------------------------------------------*/ 72 | 73 | /* Suppress warnings that are generated by the IAR tools, but cannot be fixed in 74 | * the source code because to do so would cause other compilers to generate 75 | * warnings. */ 76 | #pragma diag_suppress=Be006 77 | #pragma diag_suppress=Pa082 78 | /*-----------------------------------------------------------*/ 79 | 80 | /* *INDENT-OFF* */ 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | /* *INDENT-ON* */ 85 | 86 | #endif /* PORTMACRO_H */ 87 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM85_NTZ/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | #ifndef configENABLE_MVE 49 | #error configENABLE_MVE must be defined in FreeRTOSConfig.h. Set configENABLE_MVE to 1 to enable the MVE or 0 to disable the MVE. 50 | #endif /* configENABLE_MVE */ 51 | /*-----------------------------------------------------------*/ 52 | 53 | /** 54 | * Architecture specifics. 55 | */ 56 | #define portARCH_NAME "Cortex-M85" 57 | #define portHAS_ARMV8M_MAIN_EXTENSION 1 58 | #define portARMV8M_MINOR_VERSION 1 59 | #define portDONT_DISCARD __root 60 | /*-----------------------------------------------------------*/ 61 | 62 | /* ARMv8-M common port configurations. */ 63 | #include "portmacrocommon.h" 64 | /*-----------------------------------------------------------*/ 65 | 66 | /** 67 | * @brief Critical section management. 68 | */ 69 | #define portDISABLE_INTERRUPTS() ulSetInterruptMask() 70 | #define portENABLE_INTERRUPTS() vClearInterruptMask( 0 ) 71 | /*-----------------------------------------------------------*/ 72 | 73 | /* Suppress warnings that are generated by the IAR tools, but cannot be fixed in 74 | * the source code because to do so would cause other compilers to generate 75 | * warnings. */ 76 | #pragma diag_suppress=Be006 77 | #pragma diag_suppress=Pa082 78 | /*-----------------------------------------------------------*/ 79 | 80 | /* *INDENT-OFF* */ 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | /* *INDENT-ON* */ 85 | 86 | #endif /* PORTMACRO_H */ 87 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM33/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | /** 49 | * Architecture specifics. 50 | */ 51 | #define portARCH_NAME "Cortex-M33" 52 | #define portHAS_ARMV8M_MAIN_EXTENSION 1 53 | #define portARMV8M_MINOR_VERSION 0 54 | #define portDONT_DISCARD __root 55 | /*-----------------------------------------------------------*/ 56 | 57 | /* ARMv8-M common port configurations. */ 58 | #include "portmacrocommon.h" 59 | /*-----------------------------------------------------------*/ 60 | 61 | #ifndef configENABLE_MVE 62 | #define configENABLE_MVE 0 63 | #elif ( configENABLE_MVE != 0 ) 64 | #error configENABLE_MVE must be left undefined, or defined to 0 for the Cortex-M33. 65 | #endif 66 | /*-----------------------------------------------------------*/ 67 | 68 | /** 69 | * @brief Critical section management. 70 | */ 71 | #define portDISABLE_INTERRUPTS() ulSetInterruptMask() 72 | #define portENABLE_INTERRUPTS() vClearInterruptMask( 0 ) 73 | /*-----------------------------------------------------------*/ 74 | 75 | /* Suppress warnings that are generated by the IAR tools, but cannot be fixed in 76 | * the source code because to do so would cause other compilers to generate 77 | * warnings. */ 78 | #pragma diag_suppress=Be006 79 | #pragma diag_suppress=Pa082 80 | /*-----------------------------------------------------------*/ 81 | 82 | /* *INDENT-OFF* */ 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | /* *INDENT-ON* */ 87 | 88 | #endif /* PORTMACRO_H */ 89 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM33_NTZ/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | /** 49 | * Architecture specifics. 50 | */ 51 | #define portARCH_NAME "Cortex-M33" 52 | #define portHAS_ARMV8M_MAIN_EXTENSION 1 53 | #define portARMV8M_MINOR_VERSION 0 54 | #define portDONT_DISCARD __root 55 | /*-----------------------------------------------------------*/ 56 | 57 | /* ARMv8-M common port configurations. */ 58 | #include "portmacrocommon.h" 59 | /*-----------------------------------------------------------*/ 60 | 61 | #ifndef configENABLE_MVE 62 | #define configENABLE_MVE 0 63 | #elif ( configENABLE_MVE != 0 ) 64 | #error configENABLE_MVE must be left undefined, or defined to 0 for the Cortex-M33. 65 | #endif 66 | /*-----------------------------------------------------------*/ 67 | 68 | /** 69 | * @brief Critical section management. 70 | */ 71 | #define portDISABLE_INTERRUPTS() ulSetInterruptMask() 72 | #define portENABLE_INTERRUPTS() vClearInterruptMask( 0 ) 73 | /*-----------------------------------------------------------*/ 74 | 75 | /* Suppress warnings that are generated by the IAR tools, but cannot be fixed in 76 | * the source code because to do so would cause other compilers to generate 77 | * warnings. */ 78 | #pragma diag_suppress=Be006 79 | #pragma diag_suppress=Pa082 80 | /*-----------------------------------------------------------*/ 81 | 82 | /* *INDENT-OFF* */ 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | /* *INDENT-ON* */ 87 | 88 | #endif /* PORTMACRO_H */ 89 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM3/portasm.s: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #include 30 | 31 | RSEG CODE:CODE(2) 32 | thumb 33 | 34 | EXTERN pxCurrentTCB 35 | EXTERN vTaskSwitchContext 36 | 37 | PUBLIC xPortPendSVHandler 38 | PUBLIC vPortSVCHandler 39 | PUBLIC vPortStartFirstTask 40 | 41 | 42 | 43 | /*-----------------------------------------------------------*/ 44 | 45 | xPortPendSVHandler: 46 | mrs r0, psp 47 | isb 48 | ldr r3, =pxCurrentTCB /* Get the location of the current TCB. */ 49 | ldr r2, [r3] 50 | 51 | stmdb r0!, {r4-r11} /* Save the remaining registers. */ 52 | str r0, [r2] /* Save the new top of stack into the first member of the TCB. */ 53 | 54 | stmdb sp!, {r3, r14} 55 | mov r0, #configMAX_SYSCALL_INTERRUPT_PRIORITY 56 | msr basepri, r0 57 | dsb 58 | isb 59 | bl vTaskSwitchContext 60 | mov r0, #0 61 | msr basepri, r0 62 | ldmia sp!, {r3, r14} 63 | 64 | ldr r1, [r3] 65 | ldr r0, [r1] /* The first item in pxCurrentTCB is the task top of stack. */ 66 | ldmia r0!, {r4-r11} /* Pop the registers. */ 67 | msr psp, r0 68 | isb 69 | bx r14 70 | 71 | 72 | /*-----------------------------------------------------------*/ 73 | 74 | vPortSVCHandler: 75 | /* Get the location of the current TCB. */ 76 | ldr r3, =pxCurrentTCB 77 | ldr r1, [r3] 78 | ldr r0, [r1] 79 | /* Pop the core registers. */ 80 | ldmia r0!, {r4-r11} 81 | msr psp, r0 82 | isb 83 | mov r0, #0 84 | msr basepri, r0 85 | orr r14, r14, #13 86 | bx r14 87 | 88 | /*-----------------------------------------------------------*/ 89 | 90 | vPortStartFirstTask 91 | /* Use the NVIC offset register to locate the stack. */ 92 | ldr r0, =0xE000ED08 93 | ldr r0, [r0] 94 | ldr r0, [r0] 95 | /* Set the msp back to the start of the stack. */ 96 | msr msp, r0 97 | /* Call SVC to start the first task, ensuring interrupts are enabled. */ 98 | cpsie i 99 | cpsie f 100 | dsb 101 | isb 102 | svc 0 103 | 104 | END 105 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM23/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | /** 49 | * Architecture specifics. 50 | */ 51 | #define portARCH_NAME "Cortex-M23" 52 | #define portHAS_ARMV8M_MAIN_EXTENSION 0 53 | #define portARMV8M_MINOR_VERSION 0 54 | #define portDONT_DISCARD __root 55 | /*-----------------------------------------------------------*/ 56 | 57 | /* ARMv8-M common port configurations. */ 58 | #include "portmacrocommon.h" 59 | /*-----------------------------------------------------------*/ 60 | 61 | #if ( configTOTAL_MPU_REGIONS == 16 ) 62 | #error 16 MPU regions are not yet supported for this port. 63 | #endif 64 | 65 | #ifndef configENABLE_MVE 66 | #define configENABLE_MVE 0 67 | #elif ( configENABLE_MVE != 0 ) 68 | #error configENABLE_MVE must be left undefined, or defined to 0 for the Cortex-M23. 69 | #endif 70 | /*-----------------------------------------------------------*/ 71 | 72 | /** 73 | * @brief Critical section management. 74 | */ 75 | #define portDISABLE_INTERRUPTS() __asm volatile ( " cpsid i " ::: "memory" ) 76 | #define portENABLE_INTERRUPTS() __asm volatile ( " cpsie i " ::: "memory" ) 77 | /*-----------------------------------------------------------*/ 78 | 79 | /* Suppress warnings that are generated by the IAR tools, but cannot be fixed in 80 | * the source code because to do so would cause other compilers to generate 81 | * warnings. */ 82 | #pragma diag_suppress=Be006 83 | #pragma diag_suppress=Pa082 84 | /*-----------------------------------------------------------*/ 85 | 86 | /* *INDENT-OFF* */ 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | /* *INDENT-ON* */ 91 | 92 | #endif /* PORTMACRO_H */ 93 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM23_NTZ/non_secure/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | /* *INDENT-OFF* */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | /* *INDENT-ON* */ 37 | 38 | /*------------------------------------------------------------------------------ 39 | * Port specific definitions. 40 | * 41 | * The settings in this file configure FreeRTOS correctly for the given hardware 42 | * and compiler. 43 | * 44 | * These settings should not be altered. 45 | *------------------------------------------------------------------------------ 46 | */ 47 | 48 | /** 49 | * Architecture specifics. 50 | */ 51 | #define portARCH_NAME "Cortex-M23" 52 | #define portHAS_ARMV8M_MAIN_EXTENSION 0 53 | #define portARMV8M_MINOR_VERSION 0 54 | #define portDONT_DISCARD __root 55 | /*-----------------------------------------------------------*/ 56 | 57 | /* ARMv8-M common port configurations. */ 58 | #include "portmacrocommon.h" 59 | /*-----------------------------------------------------------*/ 60 | 61 | #if ( configTOTAL_MPU_REGIONS == 16 ) 62 | #error 16 MPU regions are not yet supported for this port. 63 | #endif 64 | 65 | #ifndef configENABLE_MVE 66 | #define configENABLE_MVE 0 67 | #elif ( configENABLE_MVE != 0 ) 68 | #error configENABLE_MVE must be left undefined, or defined to 0 for the Cortex-M23. 69 | #endif 70 | /*-----------------------------------------------------------*/ 71 | 72 | /** 73 | * @brief Critical section management. 74 | */ 75 | #define portDISABLE_INTERRUPTS() __asm volatile ( " cpsid i " ::: "memory" ) 76 | #define portENABLE_INTERRUPTS() __asm volatile ( " cpsie i " ::: "memory" ) 77 | /*-----------------------------------------------------------*/ 78 | 79 | /* Suppress warnings that are generated by the IAR tools, but cannot be fixed in 80 | * the source code because to do so would cause other compilers to generate 81 | * warnings. */ 82 | #pragma diag_suppress=Be006 83 | #pragma diag_suppress=Pa082 84 | /*-----------------------------------------------------------*/ 85 | 86 | /* *INDENT-OFF* */ 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | /* *INDENT-ON* */ 91 | 92 | #endif /* PORTMACRO_H */ 93 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at https://www.st.com/content/st_com/en/contact-us.html. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM0/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | #endif /* __PORT_ASM_H__ */ 100 | -------------------------------------------------------------------------------- /Source/portable/MemMang/heap_3.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | 30 | /* 31 | * Implementation of pvPortMalloc() and vPortFree() that relies on the 32 | * compilers own malloc() and free() implementations. 33 | * 34 | * This file can only be used if the linker is configured to to generate 35 | * a heap memory area. 36 | * 37 | * See heap_1.c, heap_2.c and heap_4.c for alternative implementations, and the 38 | * memory management pages of https://www.FreeRTOS.org for more information. 39 | */ 40 | 41 | #include 42 | 43 | /* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining 44 | * all the API functions to use the MPU wrappers. That should only be done when 45 | * task.h is included from an application file. */ 46 | #define MPU_WRAPPERS_INCLUDED_FROM_API_FILE 47 | 48 | #include "FreeRTOS.h" 49 | #include "task.h" 50 | 51 | #undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE 52 | 53 | #if ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) 54 | #error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0 55 | #endif 56 | 57 | /*-----------------------------------------------------------*/ 58 | 59 | void * pvPortMalloc( size_t xWantedSize ) 60 | { 61 | void * pvReturn; 62 | 63 | vTaskSuspendAll(); 64 | { 65 | pvReturn = malloc( xWantedSize ); 66 | traceMALLOC( pvReturn, xWantedSize ); 67 | } 68 | ( void ) xTaskResumeAll(); 69 | 70 | #if ( configUSE_MALLOC_FAILED_HOOK == 1 ) 71 | { 72 | if( pvReturn == NULL ) 73 | { 74 | vApplicationMallocFailedHook(); 75 | } 76 | } 77 | #endif 78 | 79 | return pvReturn; 80 | } 81 | /*-----------------------------------------------------------*/ 82 | 83 | void vPortFree( void * pv ) 84 | { 85 | if( pv != NULL ) 86 | { 87 | vTaskSuspendAll(); 88 | { 89 | free( pv ); 90 | traceFREE( pv, 0 ); 91 | } 92 | ( void ) xTaskResumeAll(); 93 | } 94 | } 95 | /*-----------------------------------------------------------*/ 96 | 97 | /* 98 | * Reset the state in this file. This state is normally initialized at start up. 99 | * This function must be called by the application before restarting the 100 | * scheduler. 101 | */ 102 | void vPortHeapResetState( void ) 103 | { 104 | /* No state needs to be re-initialised in heap_3. */ 105 | } 106 | /*-----------------------------------------------------------*/ 107 | -------------------------------------------------------------------------------- /Source/portable/ThirdParty/GCC/ARM_CM33_TFM/os_wrapper_freertos.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019-2024, Arm Limited. All rights reserved. 3 | * 4 | * SPDX-License-Identifier: MIT 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | * the Software, and to permit persons to whom the Software is furnished to do so, 11 | * subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | * 23 | */ 24 | 25 | /* 26 | * This file contains the implementation of APIs which are defined in 27 | * \interface/include/os_wrapper/mutex.h by TF-M(tag: TF-Mv2.0.0). 28 | * The implementation is based on FreeRTOS mutex type semaphore. 29 | */ 30 | 31 | #include "os_wrapper/mutex.h" 32 | 33 | #include "FreeRTOS.h" 34 | #include "semphr.h" 35 | #include "mpu_wrappers.h" 36 | 37 | #if ( configSUPPORT_STATIC_ALLOCATION == 1 ) 38 | 39 | /* 40 | * In the static allocation, the RAM is required to hold the semaphore's 41 | * state. 42 | */ 43 | StaticSemaphore_t xSecureMutexBuffer; 44 | #endif 45 | 46 | void * os_wrapper_mutex_create( void ) 47 | { 48 | SemaphoreHandle_t xMutexHandle = NULL; 49 | 50 | #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) 51 | xMutexHandle = xSemaphoreCreateMutex(); 52 | #elif ( configSUPPORT_STATIC_ALLOCATION == 1 ) 53 | xMutexHandle = xSemaphoreCreateMutexStatic( &xSecureMutexBuffer ); 54 | #endif 55 | return ( void * ) xMutexHandle; 56 | } 57 | /*-----------------------------------------------------------*/ 58 | 59 | uint32_t os_wrapper_mutex_acquire( void * handle, 60 | uint32_t timeout ) 61 | { 62 | BaseType_t xRet; 63 | 64 | if( !handle ) 65 | { 66 | return OS_WRAPPER_ERROR; 67 | } 68 | 69 | xRet = xSemaphoreTake( ( SemaphoreHandle_t ) handle, 70 | ( timeout == OS_WRAPPER_WAIT_FOREVER ) ? 71 | portMAX_DELAY : ( TickType_t ) timeout ); 72 | 73 | if( xRet != pdPASS ) 74 | { 75 | return OS_WRAPPER_ERROR; 76 | } 77 | else 78 | { 79 | return OS_WRAPPER_SUCCESS; 80 | } 81 | } 82 | /*-----------------------------------------------------------*/ 83 | 84 | uint32_t os_wrapper_mutex_release( void * handle ) 85 | { 86 | BaseType_t xRet; 87 | 88 | if( !handle ) 89 | { 90 | return OS_WRAPPER_ERROR; 91 | } 92 | 93 | xRet = xSemaphoreGive( ( SemaphoreHandle_t ) handle ); 94 | 95 | if( xRet != pdPASS ) 96 | { 97 | return OS_WRAPPER_ERROR; 98 | } 99 | else 100 | { 101 | return OS_WRAPPER_SUCCESS; 102 | } 103 | } 104 | /*-----------------------------------------------------------*/ 105 | 106 | uint32_t os_wrapper_mutex_delete( void * handle ) 107 | { 108 | vSemaphoreDelete( ( SemaphoreHandle_t ) handle ); 109 | 110 | return OS_WRAPPER_SUCCESS; 111 | } 112 | /*-----------------------------------------------------------*/ 113 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CA9/portASM.h: -------------------------------------------------------------------------------- 1 | ;/* 2 | ; * FreeRTOS Kernel V11.2.0 3 | ; * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | ; * 5 | ; * SPDX-License-Identifier: MIT 6 | ; * 7 | ; * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | ; * this software and associated documentation files (the "Software"), to deal in 9 | ; * the Software without restriction, including without limitation the rights to 10 | ; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | ; * the Software, and to permit persons to whom the Software is furnished to do so, 12 | ; * subject to the following conditions: 13 | ; * 14 | ; * The above copyright notice and this permission notice shall be included in all 15 | ; * copies or substantial portions of the Software. 16 | ; * 17 | ; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | ; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | ; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | ; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | ; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | ; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | ; * 24 | ; * https://www.FreeRTOS.org 25 | ; * https://github.com/FreeRTOS 26 | ; * 27 | ; */ 28 | 29 | EXTERN vTaskSwitchContext 30 | EXTERN ulCriticalNesting 31 | EXTERN pxCurrentTCB 32 | EXTERN ulPortTaskHasFPUContext 33 | EXTERN ulAsmAPIPriorityMask 34 | 35 | portSAVE_CONTEXT macro 36 | 37 | ; Save the LR and SPSR onto the system mode stack before switching to 38 | ; system mode to save the remaining system mode registers 39 | SRSDB sp!, #SYS_MODE 40 | CPS #SYS_MODE 41 | PUSH {R0-R12, R14} 42 | 43 | ; Push the critical nesting count 44 | LDR R2, =ulCriticalNesting 45 | LDR R1, [R2] 46 | PUSH {R1} 47 | 48 | ; Does the task have a floating point context that needs saving? If 49 | ; ulPortTaskHasFPUContext is 0 then no. 50 | LDR R2, =ulPortTaskHasFPUContext 51 | LDR R3, [R2] 52 | CMP R3, #0 53 | 54 | ; Save the floating point context, if any 55 | FMRXNE R1, FPSCR 56 | VPUSHNE {D0-D15} 57 | VPUSHNE {D16-D31} 58 | PUSHNE {R1} 59 | 60 | ; Save ulPortTaskHasFPUContext itself 61 | PUSH {R3} 62 | 63 | ; Save the stack pointer in the TCB 64 | LDR R0, =pxCurrentTCB 65 | LDR R1, [R0] 66 | STR SP, [R1] 67 | 68 | endm 69 | 70 | ; /**********************************************************************/ 71 | 72 | portRESTORE_CONTEXT macro 73 | 74 | ; Set the SP to point to the stack of the task being restored. 75 | LDR R0, =pxCurrentTCB 76 | LDR R1, [R0] 77 | LDR SP, [R1] 78 | 79 | ; Is there a floating point context to restore? If the restored 80 | ; ulPortTaskHasFPUContext is zero then no. 81 | LDR R0, =ulPortTaskHasFPUContext 82 | POP {R1} 83 | STR R1, [R0] 84 | CMP R1, #0 85 | 86 | ; Restore the floating point context, if any 87 | POPNE {R0} 88 | VPOPNE {D16-D31} 89 | VPOPNE {D0-D15} 90 | VMSRNE FPSCR, R0 91 | 92 | ; Restore the critical section nesting depth 93 | LDR R0, =ulCriticalNesting 94 | POP {R1} 95 | STR R1, [R0] 96 | 97 | ; Ensure the priority mask is correct for the critical nesting depth 98 | LDR R2, =portICCPMR_PRIORITY_MASK_REGISTER_ADDRESS 99 | CMP R1, #0 100 | MOVEQ R4, #255 101 | LDRNE R4, =( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) 102 | STR R4, [r2] 103 | 104 | ; Restore all system mode registers other than the SP (which is already 105 | ; being used) 106 | POP {R0-R12, R14} 107 | 108 | ; Return to the task code, loading CPSR on the way. 109 | RFEIA sp! 110 | 111 | endm 112 | -------------------------------------------------------------------------------- /Source/portable/RVDS/ARM_CA9/portmacro.inc: -------------------------------------------------------------------------------- 1 | ;/* 2 | ; * FreeRTOS Kernel V11.2.0 3 | ; * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | ; * 5 | ; * SPDX-License-Identifier: MIT 6 | ; * 7 | ; * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | ; * this software and associated documentation files (the "Software"), to deal in 9 | ; * the Software without restriction, including without limitation the rights to 10 | ; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | ; * the Software, and to permit persons to whom the Software is furnished to do so, 12 | ; * subject to the following conditions: 13 | ; * 14 | ; * The above copyright notice and this permission notice shall be included in all 15 | ; * copies or substantial portions of the Software. 16 | ; * 17 | ; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | ; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | ; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | ; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | ; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | ; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | ; * 24 | ; * https://www.FreeRTOS.org 25 | ; * https://github.com/FreeRTOS 26 | ; * 27 | ; */ 28 | 29 | SYS_MODE EQU 0x1f 30 | SVC_MODE EQU 0x13 31 | IRQ_MODE EQU 0x12 32 | 33 | IMPORT ulCriticalNesting 34 | IMPORT pxCurrentTCB 35 | IMPORT ulPortTaskHasFPUContext 36 | IMPORT ulAsmAPIPriorityMask 37 | IMPORT ulICCPMR 38 | 39 | 40 | MACRO 41 | portSAVE_CONTEXT 42 | 43 | ; Save the LR and SPSR onto the system mode stack before switching to 44 | ; system mode to save the remaining system mode registers 45 | SRSDB sp!, #SYS_MODE 46 | CPS #SYS_MODE 47 | PUSH {R0-R12, R14} 48 | 49 | ; Push the critical nesting count 50 | LDR R2, =ulCriticalNesting 51 | LDR R1, [R2] 52 | PUSH {R1} 53 | 54 | ; Does the task have a floating point context that needs saving? If 55 | ; ulPortTaskHasFPUContext is 0 then no. 56 | LDR R2, =ulPortTaskHasFPUContext 57 | LDR R3, [R2] 58 | CMP R3, #0 59 | 60 | ; Save the floating point context, if any 61 | FMRXNE R1, FPSCR 62 | VPUSHNE {D0-D15} 63 | VPUSHNE {D16-D31} 64 | PUSHNE {R1} 65 | 66 | ; Save ulPortTaskHasFPUContext itself 67 | PUSH {R3} 68 | 69 | ; Save the stack pointer in the TCB 70 | LDR R0, =pxCurrentTCB 71 | LDR R1, [R0] 72 | STR SP, [R1] 73 | 74 | MEND 75 | 76 | ; /**********************************************************************/ 77 | 78 | MACRO 79 | portRESTORE_CONTEXT 80 | 81 | ; Set the SP to point to the stack of the task being restored. 82 | LDR R0, =pxCurrentTCB 83 | LDR R1, [R0] 84 | LDR SP, [R1] 85 | 86 | ; Is there a floating point context to restore? If the restored 87 | ; ulPortTaskHasFPUContext is zero then no. 88 | LDR R0, =ulPortTaskHasFPUContext 89 | POP {R1} 90 | STR R1, [R0] 91 | CMP R1, #0 92 | 93 | ; Restore the floating point context, if any 94 | POPNE {R0} 95 | VPOPNE {D16-D31} 96 | VPOPNE {D0-D15} 97 | VMSRNE FPSCR, R0 98 | 99 | ; Restore the critical section nesting depth 100 | LDR R0, =ulCriticalNesting 101 | POP {R1} 102 | STR R1, [R0] 103 | 104 | ; Ensure the priority mask is correct for the critical nesting depth 105 | LDR R2, =ulICCPMR 106 | CMP R1, #0 107 | MOVEQ R4, #255 108 | LDRNE R4, =ulAsmAPIPriorityMask 109 | STR R4, [r2] 110 | 111 | ; Restore all system mode registers other than the SP (which is already 112 | ; being used) 113 | POP {R0-R12, R14} 114 | 115 | ; Return to the task code, loading CPSR on the way. 116 | RFEIA sp! 117 | 118 | MEND 119 | 120 | END 121 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM23/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM33/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM55/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM85/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM23/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM33/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM55/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM85/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM23_NTZ/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM33_NTZ/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM55_NTZ/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/GCC/ARM_CM85_NTZ/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM23_NTZ/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM33_NTZ/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM55_NTZ/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM85_NTZ/non_secure/portasm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | #ifndef __PORT_ASM_H__ 30 | #define __PORT_ASM_H__ 31 | 32 | /* Scheduler includes. */ 33 | #include "FreeRTOS.h" 34 | 35 | /* MPU wrappers includes. */ 36 | #include "mpu_wrappers.h" 37 | 38 | /** 39 | * @brief Restore the context of the first task so that the first task starts 40 | * executing. 41 | */ 42 | void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 43 | 44 | /** 45 | * @brief Checks whether or not the processor is privileged. 46 | * 47 | * @return 1 if the processor is already privileged, 0 otherwise. 48 | */ 49 | BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) ); 50 | 51 | /** 52 | * @brief Raises the privilege level by clearing the bit 0 of the CONTROL 53 | * register. 54 | * 55 | * @note This is a privileged function and should only be called from the kernel 56 | * code. 57 | * 58 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 59 | * Bit[0] = 0 --> The processor is running privileged 60 | * Bit[0] = 1 --> The processor is running unprivileged. 61 | */ 62 | void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 63 | 64 | /** 65 | * @brief Lowers the privilege level by setting the bit 0 of the CONTROL 66 | * register. 67 | * 68 | * Bit 0 of the CONTROL register defines the privilege level of Thread Mode. 69 | * Bit[0] = 0 --> The processor is running privileged 70 | * Bit[0] = 1 --> The processor is running unprivileged. 71 | */ 72 | void vResetPrivilege( void ) __attribute__( ( naked ) ); 73 | 74 | /** 75 | * @brief Starts the first task. 76 | */ 77 | void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 78 | 79 | /** 80 | * @brief Disables interrupts. 81 | */ 82 | uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 83 | 84 | /** 85 | * @brief Enables interrupts. 86 | */ 87 | void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 88 | 89 | /** 90 | * @brief PendSV Exception handler. 91 | */ 92 | void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 93 | 94 | /** 95 | * @brief SVC Handler. 96 | */ 97 | void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 98 | 99 | /** 100 | * @brief Allocate a Secure context for the calling task. 101 | * 102 | * @param[in] ulSecureStackSize The size of the stack to be allocated on the 103 | * secure side for the calling task. 104 | */ 105 | void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) ); 106 | 107 | /** 108 | * @brief Free the task's secure context. 109 | * 110 | * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task. 111 | */ 112 | void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION; 113 | 114 | #endif /* __PORT_ASM_H__ */ 115 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM33/secure/secure_context_port_asm.s: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | SECTION .text:CODE:NOROOT(2) 30 | THUMB 31 | 32 | /* Including FreeRTOSConfig.h here will cause build errors if the header file 33 | contains code not understood by the assembler - for example the 'extern' keyword. 34 | To avoid errors place any such code inside a #ifdef __ICCARM__/#endif block so 35 | the code is included in C files but excluded by the preprocessor in assembly 36 | files (__ICCARM__ is defined by the IAR C compiler but not by the IAR assembler. */ 37 | #include "FreeRTOSConfig.h" 38 | 39 | PUBLIC SecureContext_LoadContextAsm 40 | PUBLIC SecureContext_SaveContextAsm 41 | /*-----------------------------------------------------------*/ 42 | 43 | SecureContext_LoadContextAsm: 44 | /* pxSecureContext value is in r0. */ 45 | mrs r1, ipsr /* r1 = IPSR. */ 46 | cbz r1, load_ctx_therad_mode /* Do nothing if the processor is running in the Thread Mode. */ 47 | ldmia r0!, {r1, r2} /* r1 = pxSecureContext->pucCurrentStackPointer, r2 = pxSecureContext->pucStackLimit. */ 48 | 49 | #if ( configENABLE_MPU == 1 ) 50 | ldmia r1!, {r3} /* Read CONTROL register value from task's stack. r3 = CONTROL. */ 51 | msr control, r3 /* CONTROL = r3. */ 52 | #endif /* configENABLE_MPU */ 53 | 54 | msr psplim, r2 /* PSPLIM = r2. */ 55 | msr psp, r1 /* PSP = r1. */ 56 | 57 | load_ctx_therad_mode: 58 | bx lr 59 | /*-----------------------------------------------------------*/ 60 | 61 | SecureContext_SaveContextAsm: 62 | /* pxSecureContext value is in r0. */ 63 | mrs r1, ipsr /* r1 = IPSR. */ 64 | cbz r1, save_ctx_therad_mode /* Do nothing if the processor is running in the Thread Mode. */ 65 | mrs r1, psp /* r1 = PSP. */ 66 | 67 | #if ( ( configENABLE_FPU == 1 ) || ( configENABLE_MVE == 1 ) ) 68 | vstmdb r1!, {s0} /* Trigger the deferred stacking of FPU registers. */ 69 | vldmia r1!, {s0} /* Nullify the effect of the previous statement. */ 70 | #endif /* configENABLE_FPU || configENABLE_MVE */ 71 | 72 | #if ( configENABLE_MPU == 1 ) 73 | mrs r2, control /* r2 = CONTROL. */ 74 | stmdb r1!, {r2} /* Store CONTROL value on the stack. */ 75 | #endif /* configENABLE_MPU */ 76 | 77 | str r1, [r0] /* Save the top of stack in context. pxSecureContext->pucCurrentStackPointer = r1. */ 78 | movs r1, #0 /* r1 = securecontextNO_STACK. */ 79 | msr psplim, r1 /* PSPLIM = securecontextNO_STACK. */ 80 | msr psp, r1 /* PSP = securecontextNO_STACK i.e. No stack for thread mode until next task's context is loaded. */ 81 | 82 | save_ctx_therad_mode: 83 | bx lr 84 | /*-----------------------------------------------------------*/ 85 | 86 | END 87 | -------------------------------------------------------------------------------- /Source/portable/IAR/ARM_CM55/secure/secure_context_port_asm.s: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V11.2.0 3 | * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * SPDX-License-Identifier: MIT 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 8 | * this software and associated documentation files (the "Software"), to deal in 9 | * the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 11 | * the Software, and to permit persons to whom the Software is furnished to do so, 12 | * subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be included in all 15 | * copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | * 24 | * https://www.FreeRTOS.org 25 | * https://github.com/FreeRTOS 26 | * 27 | */ 28 | 29 | SECTION .text:CODE:NOROOT(2) 30 | THUMB 31 | 32 | /* Including FreeRTOSConfig.h here will cause build errors if the header file 33 | contains code not understood by the assembler - for example the 'extern' keyword. 34 | To avoid errors place any such code inside a #ifdef __ICCARM__/#endif block so 35 | the code is included in C files but excluded by the preprocessor in assembly 36 | files (__ICCARM__ is defined by the IAR C compiler but not by the IAR assembler. */ 37 | #include "FreeRTOSConfig.h" 38 | 39 | PUBLIC SecureContext_LoadContextAsm 40 | PUBLIC SecureContext_SaveContextAsm 41 | /*-----------------------------------------------------------*/ 42 | 43 | SecureContext_LoadContextAsm: 44 | /* pxSecureContext value is in r0. */ 45 | mrs r1, ipsr /* r1 = IPSR. */ 46 | cbz r1, load_ctx_therad_mode /* Do nothing if the processor is running in the Thread Mode. */ 47 | ldmia r0!, {r1, r2} /* r1 = pxSecureContext->pucCurrentStackPointer, r2 = pxSecureContext->pucStackLimit. */ 48 | 49 | #if ( configENABLE_MPU == 1 ) 50 | ldmia r1!, {r3} /* Read CONTROL register value from task's stack. r3 = CONTROL. */ 51 | msr control, r3 /* CONTROL = r3. */ 52 | #endif /* configENABLE_MPU */ 53 | 54 | msr psplim, r2 /* PSPLIM = r2. */ 55 | msr psp, r1 /* PSP = r1. */ 56 | 57 | load_ctx_therad_mode: 58 | bx lr 59 | /*-----------------------------------------------------------*/ 60 | 61 | SecureContext_SaveContextAsm: 62 | /* pxSecureContext value is in r0. */ 63 | mrs r1, ipsr /* r1 = IPSR. */ 64 | cbz r1, save_ctx_therad_mode /* Do nothing if the processor is running in the Thread Mode. */ 65 | mrs r1, psp /* r1 = PSP. */ 66 | 67 | #if ( ( configENABLE_FPU == 1 ) || ( configENABLE_MVE == 1 ) ) 68 | vstmdb r1!, {s0} /* Trigger the deferred stacking of FPU registers. */ 69 | vldmia r1!, {s0} /* Nullify the effect of the previous statement. */ 70 | #endif /* configENABLE_FPU || configENABLE_MVE */ 71 | 72 | #if ( configENABLE_MPU == 1 ) 73 | mrs r2, control /* r2 = CONTROL. */ 74 | stmdb r1!, {r2} /* Store CONTROL value on the stack. */ 75 | #endif /* configENABLE_MPU */ 76 | 77 | str r1, [r0] /* Save the top of stack in context. pxSecureContext->pucCurrentStackPointer = r1. */ 78 | movs r1, #0 /* r1 = securecontextNO_STACK. */ 79 | msr psplim, r1 /* PSPLIM = securecontextNO_STACK. */ 80 | msr psp, r1 /* PSP = securecontextNO_STACK i.e. No stack for thread mode until next task's context is loaded. */ 81 | 82 | save_ctx_therad_mode: 83 | bx lr 84 | /*-----------------------------------------------------------*/ 85 | 86 | END 87 | --------------------------------------------------------------------------------