interrupts_and_exceptions.py (5812:d12ff89c7692) interrupts_and_exceptions.py (5916:4bbd6239223c)
1# Copyright (c) 2007-2008 The Hewlett-Packard Development Company
2# All rights reserved.
3#
4# Redistribution and use of this software in source and binary forms,
5# with or without modification, are permitted provided that the
6# following conditions are met:
7#
8# The software must be used only for Non-Commercial Use which means any

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

113###
114
115 #CS = READ_DESCRIPTOR (temp_CS, iret_chk)
116 andi t0, t2, 0xFC, flags=(EZF,), dataSize=2
117 br label("processCSDescriptor"), flags=(CEZF,)
118 andi t6, t2, 0xF8, dataSize=8
119 andi t0, t2, 0x4, flags=(EZF,), dataSize=2
120 br label("globalCSDescriptor"), flags=(CEZF,)
1# Copyright (c) 2007-2008 The Hewlett-Packard Development Company
2# All rights reserved.
3#
4# Redistribution and use of this software in source and binary forms,
5# with or without modification, are permitted provided that the
6# following conditions are met:
7#
8# The software must be used only for Non-Commercial Use which means any

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

113###
114
115 #CS = READ_DESCRIPTOR (temp_CS, iret_chk)
116 andi t0, t2, 0xFC, flags=(EZF,), dataSize=2
117 br label("processCSDescriptor"), flags=(CEZF,)
118 andi t6, t2, 0xF8, dataSize=8
119 andi t0, t2, 0x4, flags=(EZF,), dataSize=2
120 br label("globalCSDescriptor"), flags=(CEZF,)
121 ld t6, tsl, [1, t0, t6], dataSize=8
121 ld t8, tsl, [1, t0, t6], dataSize=8
122 br label("processCSDescriptor")
123globalCSDescriptor:
122 br label("processCSDescriptor")
123globalCSDescriptor:
124 ld t6, tsg, [1, t0, t6], dataSize=8
124 ld t8, tsg, [1, t0, t6], dataSize=8
125processCSDescriptor:
126 chks t2, t6, dataSize=8
127
125processCSDescriptor:
126 chks t2, t6, dataSize=8
127
128 # This actually updates state which is wrong. It should wait until we know
129 # we're not going to fault. Unfortunately, that's hard to do.
130 wrdl cs, t6, t2
131 wrsel cs, t2
132
128
133 #CPL = temp_CPL
134
135
136###
137### Get the new stack pointer and stack segment off the old stack if necessary,
138### and piggyback on the logic to check the new RIP value.
139###
140 #IF ((64BIT_MODE) || (temp_CPL!=CPL))
141 #{
142
143 #(64BIT_MODE)

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

170 br label("doPopStackStuff"), flags=(CEZF,)
171 addi t0, t7, 1, flags=(EZF,), dataSize=ssz
172 fault "new GeneralProtection(0)", flags=(nCEZF,)
173
174doPopStackStuff:
175 # POP.v temp_RSP
176 ld t6, ss, [1, t0, rsp], "3 * env.dataSize", dataSize=ssz
177 # POP.v temp_SS
129###
130### Get the new stack pointer and stack segment off the old stack if necessary,
131### and piggyback on the logic to check the new RIP value.
132###
133 #IF ((64BIT_MODE) || (temp_CPL!=CPL))
134 #{
135
136 #(64BIT_MODE)

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

163 br label("doPopStackStuff"), flags=(CEZF,)
164 addi t0, t7, 1, flags=(EZF,), dataSize=ssz
165 fault "new GeneralProtection(0)", flags=(nCEZF,)
166
167doPopStackStuff:
168 # POP.v temp_RSP
169 ld t6, ss, [1, t0, rsp], "3 * env.dataSize", dataSize=ssz
170 # POP.v temp_SS
178 ld t2, ss, [1, t0, rsp], "4 * env.dataSize", dataSize=ssz
171 ld t9, ss, [1, t0, rsp], "4 * env.dataSize", dataSize=ssz
179 # SS = READ_DESCRIPTOR (temp_SS, ss_chk)
172 # SS = READ_DESCRIPTOR (temp_SS, ss_chk)
180 andi t0, t2, 0xFC, flags=(EZF,), dataSize=2
173 andi t0, t9, 0xFC, flags=(EZF,), dataSize=2
181 br label("processSSDescriptor"), flags=(CEZF,)
174 br label("processSSDescriptor"), flags=(CEZF,)
182 andi t7, t2, 0xF8, dataSize=8
183 andi t0, t2, 0x4, flags=(EZF,), dataSize=2
175 andi t7, t9, 0xF8, dataSize=8
176 andi t0, t9, 0x4, flags=(EZF,), dataSize=2
184 br label("globalSSDescriptor"), flags=(CEZF,)
185 ld t7, tsl, [1, t0, t7], dataSize=8
186 br label("processSSDescriptor")
187globalSSDescriptor:
188 ld t7, tsg, [1, t0, t7], dataSize=8
189processSSDescriptor:
177 br label("globalSSDescriptor"), flags=(CEZF,)
178 ld t7, tsl, [1, t0, t7], dataSize=8
179 br label("processSSDescriptor")
180globalSSDescriptor:
181 ld t7, tsg, [1, t0, t7], dataSize=8
182processSSDescriptor:
190 chks t2, t7, dataSize=8
183 chks t9, t7, dataSize=8
191
192 # This actually updates state which is wrong. It should wait until we know
193 # we're not going to fault. Unfortunately, that's hard to do.
184
185 # This actually updates state which is wrong. It should wait until we know
186 # we're not going to fault. Unfortunately, that's hard to do.
194 wrdl ss, t7, t2
195 wrsel ss, t2
187 wrdl ss, t7, t9
188 wrsel ss, t9
196
197###
198### From this point downwards, we can't fault. We can update user visible state.
199###
200 # RSP.s = temp_RSP
201 mov rsp, rsp, t6, dataSize=ssz
202
203 #}
204
205fallThroughPopStackStuff:
206
189
190###
191### From this point downwards, we can't fault. We can update user visible state.
192###
193 # RSP.s = temp_RSP
194 mov rsp, rsp, t6, dataSize=ssz
195
196 #}
197
198fallThroughPopStackStuff:
199
200 # Update CS
201 wrdl cs, t8, t2
202 wrsel cs, t2
203
204 #CPL = temp_CPL
205
207 #IF (changing CPL)
208 #{
209 srli t7, t4, 4
210 xor t7, t7, t5
211 andi t0, t7, 0x3, flags=(EZF,)
212 br label("skipSegmentSquashing"), flags=(CEZF,)
213
214 # The attribute register needs to keep track of more info before this will

--- 33 unchanged lines hidden ---
206 #IF (changing CPL)
207 #{
208 srli t7, t4, 4
209 xor t7, t7, t5
210 andi t0, t7, 0x3, flags=(EZF,)
211 br label("skipSegmentSquashing"), flags=(CEZF,)
212
213 # The attribute register needs to keep track of more info before this will

--- 33 unchanged lines hidden ---