summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/insts
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-12-01 23:01:31 -0800
committerGabe Black <gblack@eecs.umich.edu>2007-12-01 23:01:31 -0800
commit557bc8064752ac66c099542956af63670a666de5 (patch)
tree41997693d55c22ab9ed923febbeaa3eb10e37158 /src/arch/x86/isa/insts
parent62c79ca63703ee2b2c5947016c0c5e10744c2479 (diff)
downloadgem5-557bc8064752ac66c099542956af63670a666de5.tar.xz
X86: Implement the LIDT instruction.
--HG-- extra : convert_revision : 380515e985318311632e00b13000585afb052e3b
Diffstat (limited to 'src/arch/x86/isa/insts')
-rw-r--r--src/arch/x86/isa/insts/system/segmentation.py57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/arch/x86/isa/insts/system/segmentation.py b/src/arch/x86/isa/insts/system/segmentation.py
index 6067f64a0..e46941e53 100644
--- a/src/arch/x86/isa/insts/system/segmentation.py
+++ b/src/arch/x86/isa/insts/system/segmentation.py
@@ -110,4 +110,61 @@ def macroop LGDT_16_P
wrbase gdtr, t2
wrlimit gdtr, t1
};
+
+def macroop LIDT_M
+{
+ .adjust_env oszForPseudoDesc
+
+ # Get the limit
+ ld t1, seg, sib, disp, dataSize=2
+ # Get the base
+ ld t2, seg, sib, 'adjustedDisp + 2'
+ wrbase idtr, t2
+ wrlimit idtr, t1
+};
+
+def macroop LIDT_P
+{
+ .adjust_env oszForPseudoDesc
+
+ rdip t7
+ # Get the limit
+ ld t1, seg, riprel, disp, dataSize=2
+ # Get the base
+ ld t2, seg, riprel, 'adjustedDisp + 2'
+ wrbase idtr, t2
+ wrlimit idtr, t1
+};
+
+#
+# These versions are for when the original data size was 16 bits. The base is
+# still 32 bits, but the top byte is zeroed before being used.
+#
+
+def macroop LIDT_16_M
+{
+ .adjust_env oszForPseudoDesc
+
+ # Get the limit
+ ld t1, seg, sib, disp, dataSize=2
+ # Get the base
+ ld t2, seg, sib, 'adjustedDisp + 2', dataSize=4
+ zexti t2, t2, 23
+ wrbase idtr, t2
+ wrlimit idtr, t1
+};
+
+def macroop LIDT_16_P
+{
+ .adjust_env oszForPseudoDesc
+
+ rdip t7
+ # Get the limit
+ ld t1, seg, riprel, disp, dataSize=2
+ # Get the base
+ ld t2, seg, riprel, 'adjustedDisp + 2', dataSize=4
+ zexti t2, t2, 23
+ wrbase idtr, t2
+ wrlimit idtr, t1
+};
'''