source: rtems/cpukit/score/cpu/moxie/cpu_asm.S @ 2afb22b

5
Last change on this file since 2afb22b was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/*
2 * Moxie CPU functions
3 *   Copyright (C) 2011 Anthony Green
4 *
5 *  Based on example code and other ports with this copyright:
6 *
7 *  COPYRIGHT (c) 1989-1999.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.rtems.org/license/LICENSE.
13 */
14
15#ifdef HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#include <rtems/asm.h>
20
21        .text
22        .align 2
23
24        .global SYM(_CPU_Context_switch)
25
26SYM(_CPU_Context_switch):
27        sto.l   0($r0), $fp
28        sto.l   4($r0), $sp
29        sto.l   8($r0), $r0
30        sto.l   12($r0), $r1
31        sto.l   16($r0), $r2
32        sto.l   20($r0), $r3
33        sto.l   24($r0), $r4
34        sto.l   28($r0), $r5
35        sto.l   32($r0), $r6
36        sto.l   36($r0), $r7
37        sto.l   40($r0), $r8
38        sto.l   44($r0), $r9
39        sto.l   48($r0), $r10
40        sto.l   52($r0), $r11
41        sto.l   56($r0), $r12
42        sto.l   60($r0), $r13
43
44restore:
45        ldo.l   $fp, 0($r1)
46        ldo.l   $sp, 4($r1)
47        ldo.l   $r0, 8($r1)
48        ldo.l   $r2, 16($r1)
49        ldo.l   $r3, 20($r1)
50        ldo.l   $r4, 24($r1)
51        ldo.l   $r5, 28($r1)
52        ldo.l   $r6, 32($r1)
53        ldo.l   $r7, 36($r1)
54        ldo.l   $r8, 40($r1)
55        ldo.l   $r9, 44($r1)
56        ldo.l   $r10, 48($r1)
57        ldo.l   $r11, 52($r1)
58        ldo.l   $r12, 56($r1)
59        ldo.l   $r13, 60($r1)
60        ldo.l   $r1, 12($r1)
61
62        ret
63
64        .align 2
65
66        .global SYM(_CPU_Context_restore)
67
68SYM(_CPU_Context_restore):
69        mov     $r1, $r0
70        jmpa    restore
71
72
73/*
74        VHandler for Vectored Interrupts
75
76        All IRQ's are vectored to routine _ISR_#vector_number
77        This routine stacks er0 and loads er0 with vector number
78        before transferring to here
79
80*/
81        .align 2
82        .global SYM(_ISR_Handler)
83        .extern SYM(_Vector_table)
84
85
86SYM(_ISR_Handler):
87        brk
88
89
90/*
91        Called from ISR_Handler as a way of ending IRQ
92        but allowing dispatch to another task.
93        Must use RTE as CCR is still on stack but IRQ has been serviced.
94        CCR and PC occupy same word so rte can be used.
95        now using task stack
96*/
97
98        .align 2
99        .global SYM(_ISR_Dispatch)
100
101SYM(_ISR_Dispatch):
102        brk
103
104
105        .align 2
106        .global SYM(_CPU_Context_save_fp)
107
108SYM(_CPU_Context_save_fp):
109        brk
110
111
112        .align 2
113        .global SYM(_CPU_Context_restore_fp)
114
115SYM(_CPU_Context_restore_fp):
116        brk
117
Note: See TracBrowser for help on using the repository browser.