X86: Implement the swapgs instruction.
authorGabe Black <gblack@eecs.umich.edu>
Mon, 13 Oct 2008 06:00:07 +0000 (23:00 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Mon, 13 Oct 2008 06:00:07 +0000 (23:00 -0700)
src/arch/x86/isa/decoder/two_byte_opcodes.isa
src/arch/x86/isa/insts/system/segmentation.py

index bceb0595e26e680e098ce2c40fbfd25d0db73609..b8013165ee97dc5ceb03de3b86a973d47722597a 100644 (file)
                         0x4: smsw_Rv();
                         0x6: lmsw_Rv();
                         0x7: decode MODRM_RM {
-                            0x0: swapgs();
+                            0x0: Inst::SWAPGS();
                             0x1: rdtscp();
                             default: Inst::UD2();
                         }
index 97846f79c9e7120140370b06c20ab5d865d40410..49d8eb110729da2a9ef45cecd39d09a7f13877f8 100644 (file)
@@ -167,4 +167,12 @@ def macroop LIDT_16_P
     wrbase idtr, t2
     wrlimit idtr, t1
 };
+
+def macroop SWAPGS
+{
+    rdval t1, kernel_gs_base, dataSize=8
+    rdbase t2, gs, dataSize=8
+    wrbase gs, t1, dataSize=8
+    wrval kernel_gs_base, t2, dataSize=8
+};
 '''