Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: isa3_trap_0x30.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 | #define MY_USER_TEXT_VA 0xa0000 | |
39 | #define MY_USER_TEXT_RA 0x00000000400b0000 | |
40 | #define MY_USER_TEXT_PA 0x00000010400b0000 | |
41 | #define MY_PRIV_TEXT_VA 0xc0000 | |
42 | #define MY_PRIV_TEXT_RA 0x00000000400d0000 | |
43 | #define MY_PRIV_TEXT_PA 0x00000010400d0000 | |
44 | #define MY_PRIV_DATA_VA 0xe0000 | |
45 | #define MY_PRIV_DATA_RA 0x00000000400f0000 | |
46 | #define MY_PRIV_DATA_PA 0x00000010400f0000 | |
47 | #define MY_HP_TEXT_PA 0x0000001050000000 | |
48 | ||
49 | !!! Custom trap handler | |
50 | #define H_HT0_DAE_privilege_violation_0x15 | |
51 | #define SUN_H_HT0_DAE_privilege_violation_0x15 \ | |
52 | setx My_HP_Code_Begin, %l1, %l3 ; \ | |
53 | jmp %l3 ; \ | |
54 | nop ; | |
55 | ||
56 | #include "hboot.s" | |
57 | ||
58 | /************************************************************************ | |
59 | Test case code start | |
60 | ************************************************************************/ | |
61 | ||
62 | .text | |
63 | .global main | |
64 | .global test_point | |
65 | ||
66 | main: /* test begin */ | |
67 | ||
68 | setx supervisor_data_begin, %l1, %l3 | |
69 | test_point: | |
70 | ldx [%l3], %l1 | |
71 | nop | |
72 | ||
73 | EXIT_BAD /* test finish */ | |
74 | ||
75 | /************************************************************************ | |
76 | Test case data start | |
77 | ************************************************************************/ | |
78 | .data | |
79 | ||
80 | user_data_start: | |
81 | .word 0xD6B3479D | |
82 | .word 0xDB28926C | |
83 | ||
84 | SECTION .My_HP_Section TEXT_VA=MY_HP_TEXT_PA | |
85 | attr_text { | |
86 | Name = .My_HP_Section, | |
87 | hypervisor | |
88 | } | |
89 | .text | |
90 | .global My_HP_Code_Begin | |
91 | ||
92 | My_HP_Code_Begin: | |
93 | setx test_point, %l1, %l3 | |
94 | rdpr %tpc, %l2 | |
95 | cmp %l2, %l3 | |
96 | bne test_failed | |
97 | nop | |
98 | EXIT_GOOD | |
99 | test_failed: | |
100 | EXIT_BAD | |
101 | ||
102 | SECTION .My_User_Section TEXT_VA=MY_USER_TEXT_VA | |
103 | attr_text { | |
104 | Name = .My_User_Section, | |
105 | VA = MY_USER_TEXT_VA, | |
106 | RA = MY_USER_TEXT_RA, | |
107 | PA = MY_USER_TEXT_PA, | |
108 | part_0_ctx_nonzero_tsb_config_0, | |
109 | TTE_G=1, TTE_Context=0x44, TTE_V=1, TTE_Size=0, TTE_NFO=0, | |
110 | TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0, | |
111 | TTE_L=0, TTE_CP=1, TTE_CV=0, TTE_E=0, TTE_P=0, TTE_W=1 | |
112 | } | |
113 | ||
114 | .text | |
115 | .global user_code_begin | |
116 | ||
117 | user_code_begin: | |
118 | nop | |
119 | nop | |
120 | EXIT_GOOD | |
121 | ||
122 | SECTION .My_Priv_Section TEXT_VA=MY_PRIV_TEXT_VA | |
123 | attr_text { | |
124 | Name = .My_Priv_Section, | |
125 | VA = MY_PRIV_TEXT_VA, | |
126 | RA = MY_PRIV_TEXT_RA, | |
127 | PA = MY_PRIV_TEXT_PA, | |
128 | part_0_ctx_nonzero_tsb_config_0, | |
129 | TTE_G=1, TTE_Context=0x44, TTE_V=1, TTE_Size=0, TTE_NFO=0, | |
130 | TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0, | |
131 | TTE_L=0, TTE_CP=1, TTE_CV=0, TTE_E=0, TTE_P=1, TTE_W=1 | |
132 | } | |
133 | ||
134 | .text | |
135 | .global supervisor_code_begin | |
136 | ||
137 | supervisor_code_begin: | |
138 | nop ! should take a trap here | |
139 | nop | |
140 | EXIT_BAD | |
141 | ||
142 | SECTION .My_Priv_Data_Section DATA_VA=MY_PRIV_DATA_VA | |
143 | attr_data { | |
144 | Name = .My_Priv_Data_Section, | |
145 | VA = MY_PRIV_DATA_VA, | |
146 | RA = MY_PRIV_DATA_RA, | |
147 | PA = MY_PRIV_DATA_PA, | |
148 | part_0_ctx_nonzero_tsb_config_0, | |
149 | TTE_G=1, TTE_Context=0x44, TTE_V=1, TTE_Size=0, TTE_NFO=0, | |
150 | TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0, | |
151 | TTE_L=0, TTE_CP=1, TTE_CV=0, TTE_E=0, TTE_P=1, TTE_W=1 | |
152 | } | |
153 | ||
154 | .data | |
155 | .global supervisor_data_begin | |
156 | ||
157 | supervisor_data_begin: | |
158 | .xword 1212121212121212 | |
159 | .xword 1313131313131313 | |
160 | .xword 1414141414141414 | |
161 | .xword 1515151515151515 | |
162 | ||
163 | .end |