aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2012-09-03 08:24:27 -0400
committerAvi Kivity <avi@redhat.com>2012-09-06 11:07:01 -0400
commit9d1b39a967871b7c69025dba7b7bdaee42871021 (patch)
treef3c163ddc441849b0dd350db2b7e1c1e32e75e45 /arch/x86/include
parent716d51abff06f48425cef15d78ca6f36093f6dbf (diff)
KVM: emulator: make x86 emulation modes enum instead of defines
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/kvm_emulate.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h
index b5bb73aecc06..e9e5675c0dfb 100644
--- a/arch/x86/include/asm/kvm_emulate.h
+++ b/arch/x86/include/asm/kvm_emulate.h
@@ -249,6 +249,15 @@ struct read_cache {
249 unsigned long end; 249 unsigned long end;
250}; 250};
251 251
252/* Execution mode, passed to the emulator. */
253enum x86emul_mode {
254 X86EMUL_MODE_REAL, /* Real mode. */
255 X86EMUL_MODE_VM86, /* Virtual 8086 mode. */
256 X86EMUL_MODE_PROT16, /* 16-bit protected mode. */
257 X86EMUL_MODE_PROT32, /* 32-bit protected mode. */
258 X86EMUL_MODE_PROT64, /* 64-bit (long) mode. */
259};
260
252struct x86_emulate_ctxt { 261struct x86_emulate_ctxt {
253 const struct x86_emulate_ops *ops; 262 const struct x86_emulate_ops *ops;
254 263
@@ -256,7 +265,7 @@ struct x86_emulate_ctxt {
256 unsigned long eflags; 265 unsigned long eflags;
257 unsigned long eip; /* eip before instruction emulation */ 266 unsigned long eip; /* eip before instruction emulation */
258 /* Emulated execution mode, represented by an X86EMUL_MODE value. */ 267 /* Emulated execution mode, represented by an X86EMUL_MODE value. */
259 int mode; 268 enum x86emul_mode mode;
260 269
261 /* interruptibility state, as a result of execution of STI or MOV SS */ 270 /* interruptibility state, as a result of execution of STI or MOV SS */
262 int interruptibility; 271 int interruptibility;
@@ -308,17 +317,6 @@ struct x86_emulate_ctxt {
308#define REPE_PREFIX 0xf3 317#define REPE_PREFIX 0xf3
309#define REPNE_PREFIX 0xf2 318#define REPNE_PREFIX 0xf2
310 319
311/* Execution mode, passed to the emulator. */
312#define X86EMUL_MODE_REAL 0 /* Real mode. */
313#define X86EMUL_MODE_VM86 1 /* Virtual 8086 mode. */
314#define X86EMUL_MODE_PROT16 2 /* 16-bit protected mode. */
315#define X86EMUL_MODE_PROT32 4 /* 32-bit protected mode. */
316#define X86EMUL_MODE_PROT64 8 /* 64-bit (long) mode. */
317
318/* any protected mode */
319#define X86EMUL_MODE_PROT (X86EMUL_MODE_PROT16|X86EMUL_MODE_PROT32| \
320 X86EMUL_MODE_PROT64)
321
322/* CPUID vendors */ 320/* CPUID vendors */
323#define X86EMUL_CPUID_VENDOR_AuthenticAMD_ebx 0x68747541 321#define X86EMUL_CPUID_VENDOR_AuthenticAMD_ebx 0x68747541
324#define X86EMUL_CPUID_VENDOR_AuthenticAMD_ecx 0x444d4163 322#define X86EMUL_CPUID_VENDOR_AuthenticAMD_ecx 0x444d4163