Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: stackinit_st.s | |
5 | * Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
6 | * 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
7 | * | |
8 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation; version 2 of the License. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 | * | |
23 | * For the avoidance of doubt, and except that if any non-GPL license | |
24 | * choice is available it will apply instead, Sun elects to use only | |
25 | * the General Public License version 2 (GPLv2) at this time for any | |
26 | * software where a choice of GPL license versions is made | |
27 | * available with the language indicating that GPLv2 or any later version | |
28 | * may be used, or where a choice of which version of the GPL is applied is | |
29 | * otherwise unspecified. | |
30 | * | |
31 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
32 | * CA 95054 USA or visit www.sun.com if you need additional information or | |
33 | * have any questions. | |
34 | * | |
35 | * | |
36 | * ========== Copyright Header End ============================================ | |
37 | */ | |
38 | #include "defines.h" | |
39 | ||
40 | #define SP_OFFSET (STACKSIZE-4095) | |
41 | #define INIT_LOCAL_REGS \ | |
42 | set 0x0, %l0; \ | |
43 | set 0x0, %l1; \ | |
44 | set 0x0, %l2; \ | |
45 | set 0x0, %l3; \ | |
46 | set 0x0, %l4; \ | |
47 | set 0x0, %l5; \ | |
48 | set 0x0, %l6; \ | |
49 | set 0x0, %l7; \ | |
50 | set 0x0, %i0; \ | |
51 | set 0x0, %i1; \ | |
52 | set 0x0, %i2; \ | |
53 | set 0x0, %i3; \ | |
54 | set 0x0, %i4; \ | |
55 | set 0x0, %i5; \ | |
56 | set 0x0, %i6; \ | |
57 | set 0x0, %i7; | |
58 | ||
59 | ||
60 | .section .text | |
61 | .align 4 | |
62 | .global c_start | |
63 | ||
64 | c_start: | |
65 | ||
66 | ! register init - avoid mismatches in spill/fill traps | |
67 | ||
68 | ta T_CHANGE_PRIV | |
69 | ||
70 | wrpr %g0, 0, %cwp | |
71 | INIT_LOCAL_REGS | |
72 | wrpr %g0, 1, %cwp | |
73 | INIT_LOCAL_REGS | |
74 | wrpr %g0, 2, %cwp | |
75 | INIT_LOCAL_REGS | |
76 | wrpr %g0, 3, %cwp | |
77 | INIT_LOCAL_REGS | |
78 | wrpr %g0, 4, %cwp | |
79 | INIT_LOCAL_REGS | |
80 | wrpr %g0, 5, %cwp | |
81 | INIT_LOCAL_REGS | |
82 | wrpr %g0, 6, %cwp | |
83 | INIT_LOCAL_REGS | |
84 | wrpr %g0, 7, %cwp | |
85 | INIT_LOCAL_REGS | |
86 | wrpr %g0, 0, %cwp | |
87 | ||
88 | ta T_CHANGE_NONPRIV | |
89 | ||
90 | ||
91 | ||
92 | ! set up stack | |
93 | setx stacklocs, %l5, %l0 | |
94 | ldx [%l0], %sp | |
95 | ||
96 | ! call main | |
97 | ||
98 | call main | |
99 | nop | |
100 | ||
101 | brnz %o0, c_fail | |
102 | nop | |
103 | ||
104 | ta T_GOOD_TRAP | |
105 | nop | |
106 | ||
107 | c_fail: | |
108 | ta T_BAD_TRAP | |
109 | nop | |
110 | ||
111 | ||
112 | ||
113 | /* | |
114 | stack0: | |
115 | .skip STACKSIZE | |
116 | */ | |
117 | ||
118 | .section .data | |
119 | ||
120 | .align 16 | |
121 | .global stacklocs | |
122 | stacklocs: | |
123 | .xword stack0+SP_OFFSET |