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
30 * Purpose: Lowest level routines for all ColdFire processors.
34 * ulPortSetIPL() and mcf5xxx_wr_cacr() copied with permission from FreeScale
35 * supplied source files.
40 .global mcf5xxx_wr_cacrx
41 .global _mcf5xxx_wr_cacrx
43 .global _vPortYieldISR
44 .global vPortStartFirstTask
45 .global _vPortStartFirstTask
47 .extern _vPortYieldHandler
51 .macro portSAVE_CONTEXT
55 move.l _pxCurrentTCB, a0
60 .macro portRESTORE_CONTEXT
62 move.l _pxCurrentTCB, a0
70 /********************************************************************/
72 * This routines changes the IPL to the value passed into the routine.
73 * It also returns the old IPL value back.
74 * Calling convention from C:
75 * old_ipl = asm_set_ipl(new_ipl);
76 * For the Diab Data C compiler, it passes return value thru D0.
77 * Note that only the least significant three bits of the passed
86 move.w SR,D7 /* current sr */
88 move.l D7,D0 /* prepare return value */
89 andi.l #0x0700,D0 /* mask out IPL */
92 move.l 8(A6),D6 /* get argument */
93 andi.l #0x07,D6 /* least significant three bits */
94 lsl.l #8,D6 /* move over to make mask */
96 andi.l #0x0000F8FF,D7 /* zero out current IPL */
97 or.l D6,D7 /* place new IPL in sr */
104 /********************************************************************/
109 .long 0x4e7b0002 /* movec d0,cacr */
113 /********************************************************************/
115 /* Yield interrupt. */
119 jsr _vPortYieldHandler
122 /********************************************************************/
126 _vPortStartFirstTask: