debuggers.hg

view xen/include/asm-x86/vmx_platform.h @ 3612:d9cdcc864e90

bitkeeper revision 1.1159.212.48 (41fa4077FWhTpWbD65XTzGwOfmTJOQ)

Merge ssh://srg//auto/groups/xeno/BK/xeno.bk
into equilibrium.research:/home/irchomes/mwilli2/src/xen-3.0-devel.bk
author mwilli2@equilibrium.research
date Fri Jan 28 13:39:03 2005 +0000 (2005-01-28)
parents b9ab4345fd1b cd26f113b1b1
children d03ad25af1a8 bbe8541361dd
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 <asm/e820.h> /* from Linux */
24 #define MAX_OPERAND_NUM 3
25 #define I_NAME_LEN 16
27 #define mk_operand(size, index, seg, flag) \
28 (((size) << 24) | ((index) << 16) | ((seg) << 8) | (flag))
30 #define operand_size(operand) \
31 ((operand >> 24) & 0xFF)
33 #define operand_index(operand) \
34 ((operand >> 16) & 0xFF)
35 //For instruction.operand[].size
36 #define BYTE 1
37 #define WORD 2
38 #define LONG 4
39 #define QUAD 8
41 //For instruction.operand[].flag
42 #define REGISTER 0x1
43 #define MEMORY 0x2
44 #define IMMEDIATE 0x4
45 #define WZEROEXTEND 0x8
47 //For instruction.flags
48 #define REPZ 0x1
49 #define REPNZ 0x2
51 struct instruction {
52 __s8 i_name[I_NAME_LEN]; //Instruction's name
53 __s16 op_size; //The operand's bit size, e.g. 16-bit or 32-bit.
55 __u64 offset; //The effective address
56 //offset = Base + (Index * Scale) + Displacement
58 __u64 immediate;
60 __u16 seg_sel; //Segmentation selector
62 __u32 operand[MAX_OPERAND_NUM]; //The order of operand is from AT&T Assembly
63 __s16 op_num; //The operand numbers
65 __u32 flags; //
66 };
68 #define VGA_SPACE_START 0xA0000
69 #define VGA_SPACE_END 0xC0000
70 #define MAX_INST_LEN 32
72 struct mi_per_cpu_info
73 {
74 unsigned long mmio_target;
75 struct xen_regs *inst_decoder_regs;
76 };
78 struct virutal_platform_def {
79 unsigned long *real_mode_data; /* E820, etc. */
80 unsigned long shared_page_va;
81 struct mi_per_cpu_info mpci; /* MMIO */
82 };
84 extern int mmio_space(unsigned long);
85 extern void handle_mmio(unsigned long, unsigned long, unsigned long);
86 extern int vmx_setup_platform(struct exec_domain *, execution_context_t *);
88 extern inline int mmio_space(unsigned long gpa)
89 {
90 if (gpa >= VGA_SPACE_START && gpa < VGA_SPACE_END) {
91 return 1;
92 }
93 return 0;
94 }
96 #endif