xen-vtx-unstable

view xen/include/asm-x86/vmx_platform.h @ 6774:4d899a738d59

merge?
author cl349@firebug.cl.cam.ac.uk
date Tue Sep 13 15:05:49 2005 +0000 (2005-09-13)
parents 3feb7fa331ed b6c98fe62e1a
children e7c7196fa329 8ca0f98ba8e2
line source
1 /*
2 * vmx_platform.h: VMX platform support
3 * Copyright (c) 2004, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 *
18 */
20 #ifndef __ASM_X86_VMX_PLATFORM_H__
21 #define __ASM_X86_VMX_PLATFORM_H__
23 #include <public/xen.h>
24 #include <asm/e820.h>
25 #include <asm/vmx_virpit.h>
26 #include <asm/vmx_intercept.h>
28 #define MAX_OPERAND_NUM 2
30 #define mk_operand(size, index, seg, flag) \
31 (((size) << 24) | ((index) << 16) | ((seg) << 8) | (flag))
33 #define operand_size(operand) \
34 ((operand >> 24) & 0xFF)
36 #define operand_index(operand) \
37 ((operand >> 16) & 0xFF)
39 /* for instruction.operand[].size */
40 #define BYTE 1
41 #define WORD 2
42 #define LONG 4
43 #define QUAD 8
44 #define BYTE_64 16
46 /* for instruction.operand[].flag */
47 #define REGISTER 0x1
48 #define MEMORY 0x2
49 #define IMMEDIATE 0x4
51 /* for instruction.flags */
52 #define REPZ 0x1
53 #define REPNZ 0x2
54 #define OVERLAP 0x4
56 #define INSTR_PIO 1
57 #define INSTR_OR 2
58 #define INSTR_AND 3
59 #define INSTR_XOR 4
60 #define INSTR_CMP 5
61 #define INSTR_MOV 6
62 #define INSTR_MOVS 7
63 #define INSTR_MOVZ 8
64 #define INSTR_STOS 9
65 #define INSTR_TEST 10
67 struct instruction {
68 __s8 instr; /* instruction type */
69 __s16 op_size; /* the operand's bit size, e.g. 16-bit or 32-bit */
70 __u64 immediate;
71 __u16 seg_sel; /* segmentation selector */
72 __u32 operand[MAX_OPERAND_NUM]; /* order is AT&T assembly */
73 __u32 flags;
74 };
76 #define MAX_INST_LEN 32
78 struct mi_per_cpu_info {
79 int flags;
80 int instr; /* instruction */
81 unsigned long operand[2]; /* operands */
82 unsigned long immediate; /* immediate portion */
83 struct cpu_user_regs *inst_decoder_regs; /* current context */
84 };
86 struct virtual_platform_def {
87 unsigned long *real_mode_data; /* E820, etc. */
88 unsigned long shared_page_va;
89 struct vmx_virpit_t vmx_pit;
90 struct vmx_handler_t vmx_handler;
91 struct mi_per_cpu_info mpci; /* MMIO */
92 };
94 extern void handle_mmio(unsigned long, unsigned long);
95 extern void vmx_wait_io(void);
96 extern int vmx_setup_platform(struct vcpu *, struct cpu_user_regs *);
97 extern void vmx_io_assist(struct vcpu *v);
99 // XXX - think about this -- maybe use bit 30 of the mfn to signify an MMIO frame.
100 #define mmio_space(gpa) (!VALID_MFN(get_mfn_from_pfn((gpa) >> PAGE_SHIFT)))
102 #endif