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.
39 .global mcf5xxx_wr_cacr
40 .global __cs3_isr_interrupt_80
41 .global vPortStartFirstTask
45 .macro portSAVE_CONTEXT
48 movem.l %d0-%fp, (%sp)
49 move.l pxCurrentTCB, %a0
54 .macro portRESTORE_CONTEXT
56 move.l pxCurrentTCB, %a0
58 movem.l (%sp), %d0-%fp
64 /********************************************************************/
66 * This routines changes the IPL to the value passed into the routine.
67 * It also returns the old IPL value back.
68 * Calling convention from C:
69 * old_ipl = asm_set_ipl(new_ipl);
70 * For the Diab Data C compiler, it passes return value thru D0.
71 * Note that only the least significant three bits of the passed
79 move.w SR,D7 /* current sr */
81 move.l D7,D0 /* prepare return value */
82 andi.l #0x0700,D0 /* mask out IPL */
85 move.l 8(A6),D6 /* get argument */
86 andi.l #0x07,D6 /* least significant three bits */
87 lsl.l #8,D6 /* move over to make mask */
89 andi.l #0x0000F8FF,D7 /* zero out current IPL */
90 or.l D6,D7 /* place new IPL in sr */
97 /********************************************************************/
101 .long 0x4e7b0002 /* movec d0,cacr */
105 /********************************************************************/
107 /* Yield interrupt. */
108 __cs3_isr_interrupt_80:
110 jsr vPortYieldHandler
113 /********************************************************************/