]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/alpha/alpha/exception.s
This commit was generated by cvs2svn to compensate for changes in r47558,
[FreeBSD/FreeBSD.git] / sys / alpha / alpha / exception.s
1 /* $Id$ */
2 /* $NetBSD: locore.s,v 1.47 1998/03/22 07:26:32 thorpej Exp $ */
3
4 /*
5  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
6  * All rights reserved.
7  *
8  * Author: Chris G. Demetriou
9  *
10  * Permission to use, copy, modify and distribute this software and
11  * its documentation is hereby granted, provided that both the copyright
12  * notice and this permission notice appear in all copies of the
13  * software, derivative works or modified versions, and any portions
14  * thereof, and that both notices appear in supporting documentation.
15  *
16  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
17  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
18  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19  *
20  * Carnegie Mellon requests users of this software to return to
21  *
22  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
23  *  School of Computer Science
24  *  Carnegie Mellon University
25  *  Pittsburgh PA 15213-3890
26  *
27  * any improvements or extensions that they make and grant Carnegie the
28  * rights to redistribute these changes.
29  */
30
31 #include <machine/asm.h>
32 #include <assym.s>
33
34 /**************************************************************************/
35
36 /*
37  * XentArith:
38  * System arithmetic trap entry point.
39  */
40
41         PALVECT(XentArith)              /* setup frame, save registers */
42
43         /* a0, a1, & a2 already set up */
44         ldiq    a3, ALPHA_KENTRY_ARITH
45         mov     sp, a4                  ; .loc 1 __LINE__
46         CALL(trap)
47
48         jmp     zero, exception_return
49         END(XentArith)
50
51 /**************************************************************************/
52
53 /*
54  * XentIF:
55  * System instruction fault trap entry point.
56  */
57
58         PALVECT(XentIF)                 /* setup frame, save registers */
59
60         /* a0, a1, & a2 already set up */
61         ldiq    a3, ALPHA_KENTRY_IF
62         mov     sp, a4                  ; .loc 1 __LINE__
63         CALL(trap)
64         jmp     zero, exception_return  
65         END(XentIF)
66
67 /**************************************************************************/
68
69 /*
70  * XentInt:
71  * System interrupt entry point.
72  */
73
74         PALVECT(XentInt)                /* setup frame, save registers */
75
76         /* a0, a1, & a2 already set up */
77         mov     sp, a3                  ; .loc 1 __LINE__
78         CALL(interrupt)
79         jmp     zero, exception_return
80         END(XentInt)
81
82 /**************************************************************************/
83
84 /*
85  * XentMM:
86  * System memory management fault entry point.
87  */
88
89         PALVECT(XentMM)                 /* setup frame, save registers */
90
91         /* a0, a1, & a2 already set up */
92         ldiq    a3, ALPHA_KENTRY_MM
93         mov     sp, a4                  ; .loc 1 __LINE__
94         CALL(trap)
95
96         jmp     zero, exception_return
97         END(XentMM)
98
99 /**************************************************************************/
100
101 /*
102  * XentSys:
103  * System call entry point.
104  */
105
106         ESETUP(XentSys)                 ; .loc 1 __LINE__
107
108         stq     v0,(FRAME_V0*8)(sp)             /* in case we need to restart */
109         stq     s0,(FRAME_S0*8)(sp)
110         stq     s1,(FRAME_S1*8)(sp)
111         stq     s2,(FRAME_S2*8)(sp)
112         stq     s3,(FRAME_S3*8)(sp)
113         stq     s4,(FRAME_S4*8)(sp)
114         stq     s5,(FRAME_S5*8)(sp)
115         stq     s6,(FRAME_S6*8)(sp)
116         stq     a0,(FRAME_A0*8)(sp)
117         stq     a1,(FRAME_A1*8)(sp)
118         stq     a2,(FRAME_A2*8)(sp)
119         stq     a3,(FRAME_A3*8)(sp)
120         stq     a4,(FRAME_A4*8)(sp)
121         stq     a5,(FRAME_A5*8)(sp)
122         stq     ra,(FRAME_RA*8)(sp)
123
124         /* syscall number, passed in v0, is first arg, frame pointer second */
125         mov     v0,a0
126         mov     sp,a1                   ; .loc 1 __LINE__
127         CALL(syscall)
128
129         jmp     zero, exception_return
130         END(XentSys)
131
132 /**************************************************************************/
133
134 /*
135  * XentUna:
136  * System unaligned access entry point.
137  */
138
139 LEAF(XentUna, 3)                                /* XXX should be NESTED */
140         .set noat
141         lda     sp,-(FRAME_SW_SIZE*8)(sp)
142         stq     at_reg,(FRAME_AT*8)(sp)
143         .set at
144         stq     ra,(FRAME_RA*8)(sp)
145         bsr     ra, exception_save_regs         /* jmp/CALL trashes pv/t12 */
146
147         /* a0, a1, & a2 already set up */
148         ldiq    a3, ALPHA_KENTRY_UNA
149         mov     sp, a4                  ; .loc 1 __LINE__
150         CALL(trap)
151
152         jmp     zero, exception_return
153         END(XentUna)
154         
155         
156 /**************************************************************************/
157
158 /*
159  * console 'restart' routine to be placed in HWRPB.
160  */
161 LEAF(XentRestart, 1)                    /* XXX should be NESTED */
162         .set noat
163         lda     sp,-(FRAME_SIZE*8)(sp)
164         stq     at_reg,(FRAME_AT*8)(sp)
165         .set at
166         stq     v0,(FRAME_V0*8)(sp)
167         stq     a3,(FRAME_A3*8)(sp)
168         stq     a4,(FRAME_A4*8)(sp)
169         stq     a5,(FRAME_A5*8)(sp)
170         stq     s0,(FRAME_S0*8)(sp)
171         stq     s1,(FRAME_S1*8)(sp)
172         stq     s2,(FRAME_S2*8)(sp)
173         stq     s3,(FRAME_S3*8)(sp)
174         stq     s4,(FRAME_S4*8)(sp)
175         stq     s5,(FRAME_S5*8)(sp)
176         stq     s6,(FRAME_S6*8)(sp)
177         stq     t0,(FRAME_T0*8)(sp)
178         stq     t1,(FRAME_T1*8)(sp)
179         stq     t2,(FRAME_T2*8)(sp)
180         stq     t3,(FRAME_T3*8)(sp)
181         stq     t4,(FRAME_T4*8)(sp)
182         stq     t5,(FRAME_T5*8)(sp)
183         stq     t6,(FRAME_T6*8)(sp)
184         stq     t7,(FRAME_T7*8)(sp)
185         stq     t8,(FRAME_T8*8)(sp)
186         stq     t9,(FRAME_T9*8)(sp)
187         stq     t10,(FRAME_T10*8)(sp)
188         stq     t11,(FRAME_T11*8)(sp)
189         stq     t12,(FRAME_T12*8)(sp)
190         stq     ra,(FRAME_RA*8)(sp)
191
192         br      pv,LXconsole_restart1
193 LXconsole_restart1: LDGP(pv)
194
195         ldq     a0,(FRAME_RA*8)(sp)             /* a0 = ra */
196         ldq     a1,(FRAME_T11*8)(sp)            /* a1 = ai */
197         ldq     a2,(FRAME_T12*8)(sp)            /* a2 = pv */
198         CALL(console_restart)
199
200         call_pal PAL_halt
201         END(XentRestart)