summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2008-10-12 23:00:07 -0700
committerGabe Black <gblack@eecs.umich.edu>2008-10-12 23:00:07 -0700
commit564eda827bc9ebe3bacfb9a44838e4abc1deb61b (patch)
treef88bd0326ea02aab5751a6080aaaa22aa958c22c /src/arch/x86
parenta2e0d539d89643ce5243be9b8a0be4c3bcee7520 (diff)
downloadgem5-564eda827bc9ebe3bacfb9a44838e4abc1deb61b.tar.xz
X86: Implement the swapgs instruction.
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/isa/decoder/two_byte_opcodes.isa2
-rw-r--r--src/arch/x86/isa/insts/system/segmentation.py8
2 files changed, 9 insertions, 1 deletions
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
+};
'''