From: Gabe Black Date: Mon, 13 Oct 2008 06:00:07 +0000 (-0700) Subject: X86: Implement the swapgs instruction. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=564eda827bc9ebe3bacfb9a44838e4abc1deb61b;p=gem5.git X86: Implement the swapgs instruction. --- diff --git a/src/arch/x86/isa/decoder/two_byte_opcodes.isa b/src/arch/x86/isa/decoder/two_byte_opcodes.isa index bceb0595e..b8013165e 100644 --- a/src/arch/x86/isa/decoder/two_byte_opcodes.isa +++ b/src/arch/x86/isa/decoder/two_byte_opcodes.isa @@ -128,7 +128,7 @@ 0x4: smsw_Rv(); 0x6: lmsw_Rv(); 0x7: decode MODRM_RM { - 0x0: swapgs(); + 0x0: Inst::SWAPGS(); 0x1: rdtscp(); default: Inst::UD2(); } diff --git a/src/arch/x86/isa/insts/system/segmentation.py b/src/arch/x86/isa/insts/system/segmentation.py index 97846f79c..49d8eb110 100644 --- a/src/arch/x86/isa/insts/system/segmentation.py +++ b/src/arch/x86/isa/insts/system/segmentation.py @@ -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 +}; '''