source: rtems/cpukit/score/cpu/m32c/context_switch.S @ 55b115ec

4.104.115
Last change on this file since 55b115ec was 55b115ec, checked in by Joel Sherrill <joel.sherrill@…>, on 10/28/08 at 21:44:58

2008-10-28 Joel Sherrill <joel.sherrill@…>

  • context_init.c, context_switch.S, cpu.c, cpu_asm.c: Correct file headers.
  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  Context switch for the Reneas M32C
3 *
4 *  COPYRIGHT (c) 1989-2008.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#define ARG_EXECUTING 8
15#define ARG_HEIR      12
16
17#define CTXT_SP  0
18#define CTXT_FB  4
19
20        .file   "context_switch.S"
21        .text
22        .global __CPU_Context_switch
23        .type   __CPU_Context_switch, @function
24__CPU_Context_switch:
25        enter   #0
26        pushm   a0,a1,r0,r1,r2,r3
27        pushc   flg
28        pushc   sb
29
30        mov.l   ARG_EXECUTING[fb],a0    ; a0 = executing
31        stc     fb,a1
32        mov.l   a1,CTXT_FB[a0]          ; save fb
33        stc     sp,a1
34        mov.l   a1,CTXT_SP[a0]          ; save sp
35
36        mov.l   ARG_HEIR[fb],a0         ; a0 = heir
37
38restore:
39        mov.l   CTXT_SP[a0],a1
40        ldc     a1,sp                   ; restore sp
41        mov.l   CTXT_FB[a0],a1
42        ldc     a1,fb                   ; restore fb
43        popc    sb
44        popc    flg
45        popm    a0,a1,r0,r1,r2,r3
46        exitd
47        .size   __CPU_Context_switch, .-__CPU_Context_switch
48
49#define ARG_RESTART 8
50
51        .global __CPU_Context_Restart_self
52        .type   __CPU_Context_Restart_self, @function
53__CPU_Context_Restart_self:
54        enter   #0
55        mov.l   ARG_RESTART[fb],a0      ; a0 = heir
56        jmp.s   restore
Note: See TracBrowser for help on using the repository browser.