Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: isa3_va_watchpoint.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 MAIN_PAGE_HV_ALSO | |
39 | #define MAIN_PAGE_NUCLEUS_ALSO | |
40 | ||
41 | !# Set up VA trap | |
42 | #define H_HT0_VA_Watchpoint_0x62 | |
43 | #define My_H_HT0_VA_Watchpoint_0x62 \ | |
44 | add %l7, 0x1, %l7; \ | |
45 | done; \ | |
46 | nop | |
47 | ||
48 | ||
49 | #include "hboot.s" | |
50 | ||
51 | /************************************************************************ | |
52 | Test case code start | |
53 | ************************************************************************/ | |
54 | ||
55 | .text | |
56 | .global main | |
57 | ||
58 | main: /* test begin */ | |
59 | ||
60 | setx user_data_start, %i0, %l0 | |
61 | ldx [%l0], %l1 /* load first so that tlb doesn't miss next time */ | |
62 | ||
63 | ta T_CHANGE_HPRIV | |
64 | mov 0x0, %l7 ! set watchpoint trap counter | |
65 | ||
66 | setx user_data_start, %i0, %l0 | |
67 | add %l0, 0x3, %l0 | |
68 | ||
69 | /* Set data watchpoint */ | |
70 | st_asi: wr %g0, ASI_DMMU_VA_WATCHPOINT, %asi | |
71 | stxa %l0, [ASI_DMMU_VA_WATCHPOINT_VAL] %asi | |
72 | ||
73 | /* Read data watchpoint */ | |
74 | ldxa [ASI_DMMU_VA_WATCHPOINT_VAL] %asi, %i0 | |
75 | ||
76 | /* Enable load VA watchpoint */ | |
77 | en_va: | |
78 | /* Mask=0x55 */ | |
79 | set 0x55, %l1 | |
80 | sll %l1, 25, %l1 | |
81 | ||
82 | /* Read/write enable */ | |
83 | set 0x3, %l2 | |
84 | sll %l2, 23, %l2 | |
85 | or %l1, %l2, %l1 | |
86 | ||
87 | /* Mode=Data VA */ | |
88 | set 0x3, %l2 | |
89 | sllx %l2, 33, %l2 | |
90 | or %l1, %l2, %l1 | |
91 | ||
92 | !! ldxa [%g0] ASI_LSU_CONTROL, %l2 | |
93 | or %l1, 0x1f, %l1 /* keep caches and spec bit on */ | |
94 | stxa %l1, [%g0] ASI_LSU_CONTROL | |
95 | ||
96 | ta T_CHANGE_NONHPRIV | |
97 | ||
98 | /* Load data from watchpoint address */ | |
99 | setx user_data_start, %i0, %l0 | |
100 | ldx [%l0], %l1 | |
101 | ldsb [%l0+0x1], %l1 /* This one shouldn't cause a watchpoint trap */ | |
102 | ||
103 | !! ta T_CHANGE_HPRIV | |
104 | ||
105 | /* Read ASI_LSU_CTL_REG */ | |
106 | !! ldxa [%g0] ASI_LSU_CONTROL, %i0 | |
107 | ||
108 | ! Check how many traps we've taken (should be one) | |
109 | cmp %l7,0x1 | |
110 | bne bad_exit | |
111 | nop | |
112 | EXIT_GOOD | |
113 | bad_exit: EXIT_BAD | |
114 | ||
115 | /************************************************************************ | |
116 | Test case data start | |
117 | ************************************************************************/ | |
118 | .data | |
119 | ||
120 | user_data_start: | |
121 | .xword 0x0001020304050607 | |
122 | .xword 0x08090a0b0c0d0e0f | |
123 | .xword 0x1011121314151617 | |
124 | .xword 0x18191a1b1c1d1e1f | |
125 | .xword 0x2021222324252627 | |
126 | .xword 0x28292a2b2c2d2e2f | |
127 | .xword 0x3031323334353637 | |
128 | .xword 0x38393a3b3c3d3e3f | |
129 | .xword 0x4041424344454647 | |
130 | .xword 0x48494a4b4c4d4e4f | |
131 | .xword 0x5051525354555657 | |
132 | .xword 0x58595a5b5c5d5e5f | |
133 | .xword 0x6061626364656667 | |
134 | .xword 0x68696a6b6c6d6e6f | |
135 | .xword 0x7071727374757677 | |
136 | .xword 0x78797a7b7c7d7e7f | |
137 | .xword 0x8081828384858687 | |
138 | .xword 0x88898a8b8c8d8e8f | |
139 | .xword 0x9091929394959697 | |
140 | .xword 0x98999a9b9c9d9e9f | |
141 | .xword 0xa0a1a2a3a4a5a6a7 | |
142 | .xword 0xa8a9aaabacadaeaf | |
143 | .xword 0xb0b1b2b3b4b5b6b7 | |
144 | .xword 0xb8b9babbbcbdbebf | |
145 | .xword 0xc0c1c2c3c4c5c6c7 | |
146 | .xword 0xc8c9cacbcccdcecf | |
147 | .xword 0xd0d1d2d3d4d5d6d7 | |
148 | .xword 0xd8d9dadbdcdddedf | |
149 | .xword 0xe0e1e2e3e4e5e6e7 | |
150 | .xword 0xe8e9eaebecedeeef | |
151 | .xword 0xf0f1f2f3f4f5f6f7 | |
152 | .xword 0xf8f9fafbfcfdfeff | |
153 | .end |