xen-vtx-unstable

view xen/include/asm-x86/vmx_platform.h @ 6609:b6c98fe62e1a

merge?
author cl349@firebug.cl.cam.ac.uk
date Sat Sep 03 18:48:59 2005 +0000 (2005-09-03)
parents f27205ea60ef 29808fef9148
children 3feb7fa331ed 4d899a738d59 e7c7196fa329
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 */
19 #ifndef __ASM_X86_VMX_PLATFORM_H__
20 #define __ASM_X86_VMX_PLATFORM_H__
22 #include <public/xen.h>
23 #include <asm/e820.h>
24 #include <asm/vmx_virpit.h>
25 #include <asm/vmx_intercept.h>
27 #define MAX_OPERAND_NUM 2
29 #define mk_operand(size, index, seg, flag) \
30 (((size) << 24) | ((index) << 16) | ((seg) << 8) | (flag))
32 #define operand_size(operand) \
33 ((operand >> 24) & 0xFF)
35 #define operand_index(operand) \
36 ((operand >> 16) & 0xFF)
38 /* for instruction.operand[].size */
39 #define BYTE 1
40 #define WORD 2
41 #define LONG 4
42 #define QUAD 8
43 #define BYTE_64 16
45 /* for instruction.operand[].flag */
46 #define REGISTER 0x1
47 #define MEMORY 0x2
48 #define IMMEDIATE 0x4
50 /* for instruction.flags */
51 #define REPZ 0x1
52 #define REPNZ 0x2
53 #define OVERLAP 0x4
55 #define INSTR_PIO 1
56 #define INSTR_OR 2
57 #define INSTR_AND 3
58 #define INSTR_XOR 4
59 #define INSTR_CMP 5
60 #define INSTR_MOV 6
61 #define INSTR_MOVS 7
62 #define INSTR_MOVZ 8
63 #define INSTR_STOS 9
64 #define INSTR_TEST 10
66 struct instruction {
67 __s8 instr; /* instruction type */
68 __s16 op_size; /* the operand's bit size, e.g. 16-bit or 32-bit */
69 __u64 immediate;
70 __u16 seg_sel; /* segmentation selector */
71 __u32 operand[MAX_OPERAND_NUM]; /* order is AT&T assembly */
72 __u32 flags;
73 };
75 #define MAX_INST_LEN 32
77 struct mi_per_cpu_info {
78 int flags;
79 int instr; /* instruction */
80 unsigned long operand[2]; /* operands */
81 unsigned long immediate; /* immediate portion */
82 struct cpu_user_regs *inst_decoder_regs; /* current context */
83 };
85 struct virtual_platform_def {
86 unsigned long *real_mode_data; /* E820, etc. */
87 unsigned long shared_page_va;
88 struct vmx_virpit_t vmx_pit;
89 struct vmx_handler_t vmx_handler;
90 struct mi_per_cpu_info mpci; /* MMIO */
91 };
93 extern void handle_mmio(unsigned long, unsigned long);
94 extern void vmx_wait_io(void);
95 extern int vmx_setup_platform(struct vcpu *, struct cpu_user_regs *);
96 extern void vmx_io_assist(struct vcpu *v);
98 // XXX - think about this -- maybe use bit 30 of the mfn to signify an MMIO frame.
99 #define mmio_space(gpa) (!VALID_MFN(get_mfn_from_pfn((gpa) >> PAGE_SHIFT)))
101 #endif