2 * FreeRTOS Kernel V11.2.0
3 * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 * SPDX-License-Identifier: MIT
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:
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
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.
24 * https://www.FreeRTOS.org
25 * https://github.com/FreeRTOS
29 #include "FreeRTOSConfig.h"
30 #include "ISR_Support.h"
33 .global _vPortStartFirstTask
36 .extern _vTaskSwitchContext
37 .extern _xTaskIncrementTick
42 /* FreeRTOS yield handler. This is installed as the BRK software interrupt
45 /* Save the context of the current task. */
47 /* Call the scheduler to select the next task. */
48 call !!_vTaskSwitchContext
49 /* Restore the context of the next task to run. */
54 /* Starts the scheduler by restoring the context of the task that will execute
58 /* Restore the context of whichever task will execute first. */
60 /* An interrupt stack frame is used so the task is started using RETI. */
63 /* FreeRTOS tick handler. This is installed as the interval timer interrupt
68 /* Save the context of the currently executing task. */
70 /* Call the RTOS tick function. */
71 call !!_xTaskIncrementTick
72 #if configUSE_PREEMPTION == 1
73 /* Select the next task to run. */
74 call !!_vTaskSwitchContext
76 /* Retore the context of whichever task will run next. */