summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2014-11-17 00:20:01 -0800
committerGabe Black <gabeblack@google.com>2014-11-17 00:20:01 -0800
commitf8603fa1204d1ea16e382d0ce6bc4059dbea9661 (patch)
treeab01a56ba8edecb787e5d73e7a3abda095bbda93 /src/arch/x86/isa
parent7739c24fbeac2979e36de29d8079fb19ed766999 (diff)
downloadgem5-f8603fa1204d1ea16e382d0ce6bc4059dbea9661.tar.xz
x86: Fix some bugs in the real mode far jmp instruction.
The far pointer should be shifted right to get the selector value, not left. Also, when calculating the width of the offset, the wrong register was used in one spot.
Diffstat (limited to 'src/arch/x86/isa')
-rw-r--r--src/arch/x86/isa/insts/general_purpose/control_transfer/jump.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/arch/x86/isa/insts/general_purpose/control_transfer/jump.py b/src/arch/x86/isa/insts/general_purpose/control_transfer/jump.py
index 74cfcfccd..6999b913d 100644
--- a/src/arch/x86/isa/insts/general_purpose/control_transfer/jump.py
+++ b/src/arch/x86/isa/insts/general_purpose/control_transfer/jump.py
@@ -162,11 +162,11 @@ def macroop JMP_FAR_REAL_I
limm t3, dsz, dataSize=8
slli t3, t3, 3, dataSize=8
# Get the selector into t1.
- sll t1, t2, t3, dataSize=8
+ srl t1, t2, t3, dataSize=8
mov t1, t0, t1, dataSize=2
# And get the offset into t2
mov t2, t0, t2
- slli t3, t3, 4, dataSize=8
+ slli t3, t1, 4, dataSize=8
wrsel cs, t1, dataSize=2
wrbase cs, t3
wrip t0, t2, dataSize=asz