Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: isa3_trap_0x8.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_VA 0xa0000 | |
39 | #define MY_USER_RA 0x00000000400b0000 | |
40 | #define MY_USER_PA 0x00000010400b0000 | |
41 | #define MY_PRIV_VA 0xd0000 | |
42 | #define MY_PRIV_RA 0x00000000400e0000 | |
43 | #define MY_PRIV_PA 0x00000010400e0000 | |
44 | ||
45 | #define MAIN_PAGE_HV_ALSO | |
46 | #define MAIN_PAGE_NUCLEUS_ALSO | |
47 | ||
48 | !!! Custom trap handler | |
49 | #define H_HT0_IAE_privilege_violation_0x08 | |
50 | #define My_HT0_IAE_privilege_violation_0x08 \ | |
51 | EXIT_GOOD ; \ | |
52 | nop ; | |
53 | ! setx my_hp_code, %l1, %l2 ; \ | |
54 | ! jmp %l2 ; \ | |
55 | ! nop ; | |
56 | ||
57 | #define H_HT0_IAE_unauth_access_0x0b | |
58 | #define SUN_H_HT0_IAE_unauth_access_0x0b \ | |
59 | EXIT_GOOD ; \ | |
60 | nop ; | |
61 | ||
62 | #include "hboot.s" | |
63 | ||
64 | /************************************************************************ | |
65 | Test case code start | |
66 | ************************************************************************/ | |
67 | ||
68 | .text | |
69 | .global main | |
70 | ||
71 | main: /* test begin */ | |
72 | ||
73 | !ta T_CHANGE_HPRIV | |
74 | !mov 16, %l1 | |
75 | !ldxa [%l1] ASI_MMU_ZERO_CONTEXT_TSB_CONFIG, %l2 | |
76 | !add %l2, 2, %l2 | |
77 | !stxa %l2, [ASI_MMU_ZERO_CONTEXT_TSB_CONFIG_0] %asi | |
78 | !ta T_CHANGE_NONHPRIV | |
79 | !ta T_CHANGE_NONPRIV | |
80 | !ta T_CHANGE_PRIV | |
81 | setx supervisor_code_begin, %l1, %l3 | |
82 | jmp %l3 | |
83 | nop | |
84 | ||
85 | EXIT_BAD /* test finish */ | |
86 | ||
87 | /************************************************************************ | |
88 | Test case data start | |
89 | ************************************************************************/ | |
90 | .data | |
91 | ||
92 | user_data_start: | |
93 | .word 0xD6B3479D | |
94 | .word 0xDB28926C | |
95 | ||
96 | SECTION .My_User_Section TEXT_VA=MY_USER_VA | |
97 | attr_text { | |
98 | Name = .My_User_Section, | |
99 | VA = MY_USER_VA, | |
100 | RA = MY_USER_RA, | |
101 | PA = MY_USER_PA, | |
102 | part_0_ctx_nonzero_tsb_config_0, | |
103 | TTE_G=1, TTE_Context=0x44, TTE_V=1, TTE_Size=0, TTE_NFO=0, | |
104 | TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0, | |
105 | TTE_L=0, TTE_CP=1, TTE_CV=0, TTE_E=0, TTE_P=0, TTE_W=1 | |
106 | } | |
107 | ||
108 | .text | |
109 | .global user_code_begin | |
110 | ||
111 | user_code_begin: | |
112 | nop | |
113 | nop | |
114 | EXIT_GOOD | |
115 | ||
116 | SECTION .My_Priv_Section TEXT_VA=MY_PRIV_VA | |
117 | attr_text { | |
118 | Name = .My_Priv_Section, | |
119 | VA = MY_PRIV_VA, | |
120 | RA = MY_PRIV_RA, | |
121 | PA = MY_PRIV_PA, | |
122 | part_0_ctx_nonzero_tsb_config_0, | |
123 | TTE_G=1, TTE_Context=0x44, TTE_V=1, TTE_Size=0, TTE_NFO=0, | |
124 | TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0, | |
125 | TTE_L=0, TTE_CP=1, TTE_CV=0, TTE_E=0, TTE_P=1, TTE_W=1 | |
126 | } | |
127 | ||
128 | .text | |
129 | .global supervisor_code_begin | |
130 | ||
131 | supervisor_code_begin: | |
132 | nop ! should take a trap here | |
133 | nop | |
134 | EXIT_BAD | |
135 | ||
136 | .end |