Deleted Added
sdiff udiff text old ( 7087:fb8d5786ff30 ) new ( 7622:b49144029ec8 )
full compact
1# Copyright (c) 2007 The Hewlett-Packard Development Company
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 24 unchanged lines hidden (view full) ---

33# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35#
36# Authors: Gabe Black
37
38microcode = '''
39def macroop LGDT_M
40{
41 .serializing
42 .adjust_env maxOsz
43
44 # Get the limit
45 ld t1, seg, sib, disp, dataSize=2
46 # Get the base
47 ld t2, seg, sib, 'adjustedDisp + 2'
48 wrbase tsg, t2
49 wrlimit tsg, t1
50};
51
52def macroop LGDT_P
53{
54 .serializing
55 .adjust_env maxOsz
56
57 rdip t7
58 # Get the limit
59 ld t1, seg, riprel, disp, dataSize=2
60 # Get the base
61 ld t2, seg, riprel, 'adjustedDisp + 2'
62 wrbase tsg, t2
63 wrlimit tsg, t1
64};
65
66#
67# These versions are for when the original data size was 16 bits. The base is
68# still 32 bits, but the top byte is zeroed before being used.
69#
70
71def macroop LGDT_16_M
72{
73 .serializing
74 .adjust_env maxOsz
75
76 # Get the limit
77 ld t1, seg, sib, disp, dataSize=2
78 # Get the base
79 ld t2, seg, sib, 'adjustedDisp + 2', dataSize=4
80 zexti t2, t2, 23, dataSize=8
81 wrbase tsg, t2
82 wrlimit tsg, t1
83};
84
85def macroop LGDT_16_P
86{
87 .serializing
88 .adjust_env maxOsz
89
90 rdip t7
91 # Get the limit
92 ld t1, seg, riprel, disp, dataSize=2
93 # Get the base
94 ld t2, seg, riprel, 'adjustedDisp + 2', dataSize=4
95 zexti t2, t2, 23, dataSize=8
96 wrbase tsg, t2
97 wrlimit tsg, t1
98};
99
100def macroop LIDT_M
101{
102 .serializing
103 .adjust_env maxOsz
104
105 # Get the limit
106 ld t1, seg, sib, disp, dataSize=2
107 # Get the base
108 ld t2, seg, sib, 'adjustedDisp + 2'
109 wrbase idtr, t2
110 wrlimit idtr, t1
111};
112
113def macroop LIDT_P
114{
115 .serializing
116 .adjust_env maxOsz
117
118 rdip t7
119 # Get the limit
120 ld t1, seg, riprel, disp, dataSize=2
121 # Get the base
122 ld t2, seg, riprel, 'adjustedDisp + 2'
123 wrbase idtr, t2
124 wrlimit idtr, t1
125};
126
127#
128# These versions are for when the original data size was 16 bits. The base is
129# still 32 bits, but the top byte is zeroed before being used.
130#
131
132def macroop LIDT_16_M
133{
134 .serializing
135 .adjust_env maxOsz
136
137 # Get the limit
138 ld t1, seg, sib, disp, dataSize=2
139 # Get the base
140 ld t2, seg, sib, 'adjustedDisp + 2', dataSize=4
141 zexti t2, t2, 23, dataSize=8
142 wrbase idtr, t2
143 wrlimit idtr, t1
144};
145
146def macroop LIDT_16_P
147{
148 .serializing
149 .adjust_env maxOsz
150
151 rdip t7
152 # Get the limit
153 ld t1, seg, riprel, disp, dataSize=2
154 # Get the base
155 ld t2, seg, riprel, 'adjustedDisp + 2', dataSize=4
156 zexti t2, t2, 23, dataSize=8
157 wrbase idtr, t2
158 wrlimit idtr, t1
159};
160
161def macroop LTR_R
162{
163 .serializing
164 chks reg, t0, TRCheck
165 limm t4, 0, dataSize=8
166 srli t4, reg, 3, dataSize=2
167 ldst t1, tsg, [8, t4, t0], dataSize=8
168 ld t2, tsg, [8, t4, t0], 8, dataSize=8
169 chks reg, t1, TSSCheck
170 wrdh t3, t1, t2
171 wrdl tr, t1, reg
172 wrbase tr, t3, dataSize=8
173 limm t5, (1 << 9)
174 or t1, t1, t5
175 st t1, tsg, [8, t4, t0], dataSize=8
176};
177
178def macroop LTR_M
179{
180 .serializing
181 ld t5, seg, sib, disp, dataSize=2
182 chks t5, t0, TRCheck
183 limm t4, 0, dataSize=8
184 srli t4, t5, 3, dataSize=2
185 ldst t1, tsg, [8, t4, t0], dataSize=8
186 ld t2, tsg, [8, t4, t0], 8, dataSize=8
187 chks t5, t1, TSSCheck
188 wrdh t3, t1, t2
189 wrdl tr, t1, t5
190 wrbase tr, t3, dataSize=8
191 limm t5, (1 << 9)
192 or t1, t1, t5
193 st t1, tsg, [8, t4, t0], dataSize=8
194};
195
196def macroop LTR_P
197{
198 .serializing
199 rdip t7
200 ld t5, seg, riprel, disp, dataSize=2
201 chks t5, t0, TRCheck
202 limm t4, 0, dataSize=8
203 srli t4, t5, 3, dataSize=2
204 ldst t1, tsg, [8, t4, t0], dataSize=8
205 ld t2, tsg, [8, t4, t0], 8, dataSize=8
206 chks t5, t1, TSSCheck
207 wrdh t3, t1, t2
208 wrdl tr, t1, t5
209 wrbase tr, t3, dataSize=8
210 limm t5, (1 << 9)
211 or t1, t1, t5
212 st t1, tsg, [8, t4, t0], dataSize=8
213};
214
215def macroop LLDT_R
216{
217 .serializing
218 chks reg, t0, InGDTCheck, flags=(EZF,)
219 br label("end"), flags=(CEZF,)
220 limm t4, 0, dataSize=8
221 srli t4, reg, 3, dataSize=2
222 ldst t1, tsg, [8, t4, t0], dataSize=8
223 ld t2, tsg, [8, t4, t0], 8, dataSize=8
224 chks reg, t1, LDTCheck
225 wrdh t3, t1, t2
226 wrdl tr, t1, reg
227 wrbase tr, t3, dataSize=8
228end:
229 fault "NoFault"
230};
231
232def macroop LLDT_M
233{
234 .serializing
235 ld t5, seg, sib, disp, dataSize=2
236 chks t5, t0, InGDTCheck, flags=(EZF,)
237 br label("end"), flags=(CEZF,)
238 limm t4, 0, dataSize=8
239 srli t4, t5, 3, dataSize=2
240 ldst t1, tsg, [8, t4, t0], dataSize=8
241 ld t2, tsg, [8, t4, t0], 8, dataSize=8
242 chks t5, t1, LDTCheck
243 wrdh t3, t1, t2
244 wrdl tr, t1, t5
245 wrbase tr, t3, dataSize=8
246end:
247 fault "NoFault"
248};
249
250def macroop LLDT_P
251{
252 .serializing
253 rdip t7
254 ld t5, seg, riprel, disp, dataSize=2
255 chks t5, t0, InGDTCheck, flags=(EZF,)
256 br label("end"), flags=(CEZF,)
257 limm t4, 0, dataSize=8
258 srli t4, t5, 3, dataSize=2
259 ldst t1, tsg, [8, t4, t0], dataSize=8
260 ld t2, tsg, [8, t4, t0], 8, dataSize=8

--- 16 unchanged lines hidden ---