]> begriffs open source - freertos/blob - portable/IAR/ARM_CM33_NTZ/non_secure/portasm.h
[AUTO][RELEASE]: Bump file header version to "10.4.4"
[freertos] / portable / IAR / ARM_CM33_NTZ / non_secure / portasm.h
1 /*\r
2  * FreeRTOS Kernel V10.4.4\r
3  * Copyright (C) 2021 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
4  *\r
5  * SPDX-License-Identifier: MIT
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
8  * this software and associated documentation files (the "Software"), to deal in\r
9  * the Software without restriction, including without limitation the rights to\r
10  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
11  * the Software, and to permit persons to whom the Software is furnished to do so,\r
12  * subject to the following conditions:\r
13  *\r
14  * The above copyright notice and this permission notice shall be included in all\r
15  * copies or substantial portions of the Software.\r
16  *\r
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
19  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
20  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
21  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
22  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
23  *\r
24  * https://www.FreeRTOS.org\r
25  * https://github.com/FreeRTOS\r
26  *\r
27  */\r
28 \r
29 #ifndef __PORT_ASM_H__\r
30 #define __PORT_ASM_H__\r
31 \r
32 /* Scheduler includes. */\r
33 #include "FreeRTOS.h"\r
34 \r
35 /* MPU wrappers includes. */\r
36 #include "mpu_wrappers.h"\r
37 \r
38 /**\r
39  * @brief Restore the context of the first task so that the first task starts\r
40  * executing.\r
41  */\r
42 void vRestoreContextOfFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;\r
43 \r
44 /**\r
45  * @brief Checks whether or not the processor is privileged.\r
46  *\r
47  * @return 1 if the processor is already privileged, 0 otherwise.\r
48  */\r
49 BaseType_t xIsPrivileged( void ) __attribute__( ( naked ) );\r
50 \r
51 /**\r
52  * @brief Raises the privilege level by clearing the bit 0 of the CONTROL\r
53  * register.\r
54  *\r
55  * @note This is a privileged function and should only be called from the kenrel\r
56  * code.\r
57  *\r
58  * Bit 0 of the CONTROL register defines the privilege level of Thread Mode.\r
59  *  Bit[0] = 0 --> The processor is running privileged\r
60  *  Bit[0] = 1 --> The processor is running unprivileged.\r
61  */\r
62 void vRaisePrivilege( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;\r
63 \r
64 /**\r
65  * @brief Lowers the privilege level by setting the bit 0 of the CONTROL\r
66  * register.\r
67  *\r
68  * Bit 0 of the CONTROL register defines the privilege level of Thread Mode.\r
69  *  Bit[0] = 0 --> The processor is running privileged\r
70  *  Bit[0] = 1 --> The processor is running unprivileged.\r
71  */\r
72 void vResetPrivilege( void ) __attribute__( ( naked ) );\r
73 \r
74 /**\r
75  * @brief Starts the first task.\r
76  */\r
77 void vStartFirstTask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;\r
78 \r
79 /**\r
80  * @brief Disables interrupts.\r
81  */\r
82 uint32_t ulSetInterruptMask( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;\r
83 \r
84 /**\r
85  * @brief Enables interrupts.\r
86  */\r
87 void vClearInterruptMask( uint32_t ulMask ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;\r
88 \r
89 /**\r
90  * @brief PendSV Exception handler.\r
91  */\r
92 void PendSV_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;\r
93 \r
94 /**\r
95  * @brief SVC Handler.\r
96  */\r
97 void SVC_Handler( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;\r
98 \r
99 /**\r
100  * @brief Allocate a Secure context for the calling task.\r
101  *\r
102  * @param[in] ulSecureStackSize The size of the stack to be allocated on the\r
103  * secure side for the calling task.\r
104  */\r
105 void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__( ( naked ) );\r
106 \r
107 /**\r
108  * @brief Free the task's secure context.\r
109  *\r
110  * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task.\r
111  */\r
112 void vPortFreeSecureContext( uint32_t * pulTCB ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;\r
113 \r
114 #endif /* __PORT_ASM_H__ */\r