X86: Implement the swapgs instruction.

This commit is contained in:
Gabe Black
2008-10-12 23:00:07 -07:00
parent a2e0d539d8
commit 564eda827b
2 changed files with 9 additions and 1 deletions

View File

@@ -128,7 +128,7 @@
0x4: smsw_Rv();
0x6: lmsw_Rv();
0x7: decode MODRM_RM {
0x0: swapgs();
0x0: Inst::SWAPGS();
0x1: rdtscp();
default: Inst::UD2();
}

View 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
};
'''