summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-02-25 10:18:16 -0800
committerGabe Black <gblack@eecs.umich.edu>2009-02-25 10:18:16 -0800
commit897c3748925e83301027d85dbc4c0479d972fda4 (patch)
tree7ff1529974edf23889e19fc526470461ba3b9ff8 /src
parent710b43dfbdbbaf0588d182ce0bc82a0b7db0b550 (diff)
downloadgem5-897c3748925e83301027d85dbc4c0479d972fda4.tar.xz
X86: Move where CS is set so CPL checks work out.
Diffstat (limited to 'src')
-rw-r--r--src/arch/x86/isa/insts/romutil.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/arch/x86/isa/insts/romutil.py b/src/arch/x86/isa/insts/romutil.py
index a39ba202f..93276addc 100644
--- a/src/arch/x86/isa/insts/romutil.py
+++ b/src/arch/x86/isa/insts/romutil.py
@@ -124,6 +124,18 @@ def rom
##
wrip t0, t9, dataSize=8
+ #
+ # Set up the target code segment. Do this now so we have the right
+ # permissions when setting up the stack frame.
+ #
+ srli t5, t4, 16, dataSize=8
+ andi t5, t5, 0xFF, dataSize=8
+ wrdl cs, t3, t5, dataSize=8
+ # Tuck away the old CS for use below
+ limm t10, 0, dataSize=8
+ rdsel t10, cs, dataSize=2
+ wrsel cs, t5, dataSize=2
+
#
# Build up the interrupt stack frame
@@ -133,9 +145,7 @@ def rom
# Write out the contents of memory
%(errorCodeCode)s
st t7, hs, [1, t0, t6], %(errorCodeSize)d, dataSize=8, addressSize=8
- limm t5, 0, dataSize=8
- rdsel t5, cs, dataSize=2
- st t5, hs, [1, t0, t6], 8 + %(errorCodeSize)d, dataSize=8, addressSize=8
+ st t10, hs, [1, t0, t6], 8 + %(errorCodeSize)d, dataSize=8, addressSize=8
rflags t10, dataSize=8
st t10, hs, [1, t0, t6], 16 + %(errorCodeSize)d, dataSize=8, addressSize=8
st rsp, hs, [1, t0, t6], 24 + %(errorCodeSize)d, dataSize=8, addressSize=8
@@ -147,14 +157,6 @@ def rom
wrsel ss, t11, dataSize=2
#
- # Set up the target code segment
- #
- srli t5, t4, 16, dataSize=8
- andi t5, t5, 0xFF, dataSize=8
- wrdl cs, t3, t5, dataSize=8
- wrsel cs, t5, dataSize=2
-
- #
# Adjust rflags which is still in t10 from above
#