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