source: rtems/cpukit/score/cpu/m32r/context_switch.S @ 4990792

4.104.115
Last change on this file since 4990792 was 4990792, checked in by Joel Sherrill <joel.sherrill@…>, on 03/27/10 at 15:02:02

2010-03-27 Joel Sherrill <joel.sherrill@…>

  • context_init.c, context_switch.S, cpu.c, cpu_asm.c: Add include of config.h
  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[0e5b446]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
[4990792]14#ifdef HAVE_CONFIG_H
15#include "config.h"
16#endif
17
[0e5b446]18#define ARG_EXECUTING 8
19#define ARG_HEIR      12
20
21#define CONTEXT_R8       0x00
22#define CONTEXT_R9       0x04
23#define CONTEXT_R10      0x08
24#define CONTEXT_R11      0x0C
25#define CONTEXT_R12      0x10
26#define CONTEXT_R13_FP   0x14
27#define CONTEXT_R14_LR   0x18
28#define CONTEXT_R15_SP   0x1C
29#define CONTEXT_ACC_LOW  0x20
30#define CONTEXT_ACC_HIGH 0x24
31
32        .file   "context_switch.S"
33        .text
34        .global _CPU_Context_switch
35        .type   _CPU_Context_switch, @function
36_CPU_Context_switch:
37        st      r8,  @(CONTEXT_R8,r0)
38        st      r9,  @(CONTEXT_R9,r0)
39        st      r10, @(CONTEXT_R10,r0)
40        st      r11, @(CONTEXT_R11,r0)
41        st      r12, @(CONTEXT_R12,r0)
42        st      r13, @(CONTEXT_R13_FP,r0)
43        st      r14, @(CONTEXT_R14_LR,r0)
44        st      r15, @(CONTEXT_R15_SP,r0)
45        mvfaclo r2
46        st      r2,  @(CONTEXT_ACC_LOW,r0)
47        mvfachi r2
48        st      r2,  @(CONTEXT_ACC_HIGH,r0)
49
50restore:
51        ld      r8,  @(CONTEXT_R8,r1)
52        ld      r9,  @(CONTEXT_R9,r1)
53        ld      r10, @(CONTEXT_R10,r1)
54        ld      r11, @(CONTEXT_R11,r1)
55        ld      r12, @(CONTEXT_R12,r1)
56        ld      r13, @(CONTEXT_R13_FP,r1)
57        ld      r14, @(CONTEXT_R14_LR,r1)
58        ld      r15, @(CONTEXT_R15_SP,r1)
59        ld      r2,  @(CONTEXT_ACC_LOW,r1)
60        mvtaclo r2
61        ld      r2,  @(CONTEXT_ACC_HIGH,r1)
62        mvtachi r2
63        jmp     lr     
64
65        .global _CPU_Context_Restart_self
66        .type   _CPU_Context_Restart_self, @function
67_CPU_Context_Restart_self:
68        mv      r0, r1
69        bra     restore
Note: See TracBrowser for help on using the repository browser.