2 * FreeRTOS Kernel V10.2.1
\r
3 * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\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
12 * The above copyright notice and this permission notice shall be included in all
\r
13 * copies or substantial portions of the Software.
\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
22 * http://www.FreeRTOS.org
\r
23 * http://aws.amazon.com/freertos
\r
25 * 1 tab == 4 spaces!
\r
28 #ifndef __PORT_ASM_H__
\r
29 #define __PORT_ASM_H__
\r
31 /* Scheduler includes. */
\r
32 #include "FreeRTOS.h"
\r
34 /* MPU wrappers includes. */
\r
35 #include "mpu_wrappers.h"
\r
38 * @brief Restore the context of the first task so that the first task starts
\r
41 void vRestoreContextOfFirstTask( void ) __attribute__ (( naked )) PRIVILEGED_FUNCTION;
\r
44 * @brief Checks whether or not the processor is privileged.
\r
46 * @return 1 if the processor is already privileged, 0 otherwise.
\r
48 BaseType_t xIsPrivileged( void ) __attribute__ (( naked ));
\r
51 * @brief Raises the privilege level by clearing the bit 0 of the CONTROL
\r
54 * @note This is a privileged function and should only be called from the kenrel
\r
57 * Bit 0 of the CONTROL register defines the privilege level of Thread Mode.
\r
58 * Bit[0] = 0 --> The processor is running privileged
\r
59 * Bit[0] = 1 --> The processor is running unprivileged.
\r
61 void vRaisePrivilege( void ) __attribute__ (( naked )) PRIVILEGED_FUNCTION;
\r
64 * @brief Lowers the privilege level by setting the bit 0 of the CONTROL
\r
67 * Bit 0 of the CONTROL register defines the privilege level of Thread Mode.
\r
68 * Bit[0] = 0 --> The processor is running privileged
\r
69 * Bit[0] = 1 --> The processor is running unprivileged.
\r
71 void vResetPrivilege( void ) __attribute__ (( naked ));
\r
74 * @brief Starts the first task.
\r
76 void vStartFirstTask( void ) __attribute__ (( naked )) PRIVILEGED_FUNCTION;
\r
79 * @brief Disables interrupts.
\r
81 uint32_t ulSetInterruptMaskFromISR( void ) __attribute__(( naked )) PRIVILEGED_FUNCTION;
\r
84 * @brief Enables interrupts.
\r
86 void vClearInterruptMaskFromISR( uint32_t ulMask ) __attribute__(( naked )) PRIVILEGED_FUNCTION;
\r
89 * @brief PendSV Exception handler.
\r
91 void PendSV_Handler( void ) __attribute__ (( naked )) PRIVILEGED_FUNCTION;
\r
94 * @brief SVC Handler.
\r
96 void SVC_Handler( void ) __attribute__ (( naked )) PRIVILEGED_FUNCTION;
\r
99 * @brief Allocate a Secure context for the calling task.
\r
101 * @param[in] ulSecureStackSize The size of the stack to be allocated on the
\r
102 * secure side for the calling task.
\r
104 void vPortAllocateSecureContext( uint32_t ulSecureStackSize ) __attribute__ (( naked ));
\r
107 * @brief Free the task's secure context.
\r
109 * @param[in] pulTCB Pointer to the Task Control Block (TCB) of the task.
\r
111 void vPortFreeSecureContext( uint32_t *pulTCB ) __attribute__ (( naked )) PRIVILEGED_FUNCTION;
\r
113 #endif /* __PORT_ASM_H__ */
\r