2 * FreeRTOS Kernel V10.4.3
3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
6 * this software and associated documentation files (the "Software"), to deal in
7 * the Software without restriction, including without limitation the rights to
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 * the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 * https://www.FreeRTOS.org
23 * https://github.com/FreeRTOS
29 * Purpose: Lowest level routines for all ColdFire processors.
33 * ulPortSetIPL() and mcf5xxx_wr_cacr() copied with permission from FreeScale
34 * supplied source files.
39 .global mcf5xxx_wr_cacrx
40 .global _mcf5xxx_wr_cacrx
42 .global _vPortYieldISR
43 .global vPortStartFirstTask
44 .global _vPortStartFirstTask
46 .extern _vPortYieldHandler
50 .macro portSAVE_CONTEXT
54 move.l _pxCurrentTCB, a0
59 .macro portRESTORE_CONTEXT
61 move.l _pxCurrentTCB, a0
69 /********************************************************************/
71 * This routines changes the IPL to the value passed into the routine.
72 * It also returns the old IPL value back.
73 * Calling convention from C:
74 * old_ipl = asm_set_ipl(new_ipl);
75 * For the Diab Data C compiler, it passes return value thru D0.
76 * Note that only the least significant three bits of the passed
85 move.w SR,D7 /* current sr */
87 move.l D7,D6 /* prepare return value */
88 andi.l #0x0700,D6 /* mask out IPL */
91 andi.l #0x07,D0 /* least significant three bits */
92 lsl.l #8,D0 /* move over to make mask */
94 andi.l #0x0000F8FF,D7 /* zero out current IPL */
95 or.l D0,D7 /* place new IPL in sr */
98 move.l D6, D0 /* Return value in D0. */
103 /********************************************************************/
108 .long 0x4e7b0002 /* movec d0,cacr */
112 /********************************************************************/
114 /* Yield interrupt. */
118 jsr _vPortYieldHandler
121 /********************************************************************/
125 _vPortStartFirstTask: