debuggers.hg

annotate xen/include/asm-x86/vmx_platform.h @ 3642:d03ad25af1a8

bitkeeper revision 1.1159.212.65 (42001ad5CoYcWQyfGjSHSJBFeqFrLg)

Make mmio_space() static inline.

Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: ian.pratt@cl.cam.ac.uk
author iap10@labyrinth.cl.cam.ac.uk
date Wed Feb 02 00:12:05 2005 +0000 (2005-02-02)
parents d9cdcc864e90
children bbe8541361dd 4294cfa9fad3
rev   line source
iap10@3328 1 /*
iap10@3328 2 * vmx_platform.h: VMX platform support
iap10@3328 3 * Copyright (c) 2004, Intel Corporation.
iap10@3328 4 *
iap10@3328 5 * This program is free software; you can redistribute it and/or modify it
iap10@3328 6 * under the terms and conditions of the GNU General Public License,
iap10@3328 7 * version 2, as published by the Free Software Foundation.
iap10@3328 8 *
iap10@3328 9 * This program is distributed in the hope it will be useful, but WITHOUT
iap10@3328 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
iap10@3328 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
iap10@3328 12 * more details.
iap10@3328 13 *
iap10@3328 14 * You should have received a copy of the GNU General Public License along with
iap10@3328 15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
iap10@3328 16 * Place - Suite 330, Boston, MA 02111-1307 USA.
iap10@3328 17 *
iap10@3328 18 */
iap10@3328 19 #ifndef __ASM_X86_VMX_PLATFORM_H__
iap10@3328 20 #define __ASM_X86_VMX_PLATFORM_H__
iap10@3328 21
iap10@3607 22 #include <asm/e820.h> /* from Linux */
iap10@3607 23
iap10@3607 24 #define MAX_OPERAND_NUM 3
iap10@3607 25 #define I_NAME_LEN 16
iap10@3607 26
iap10@3607 27 #define mk_operand(size, index, seg, flag) \
iap10@3607 28 (((size) << 24) | ((index) << 16) | ((seg) << 8) | (flag))
iap10@3607 29
iap10@3607 30 #define operand_size(operand) \
iap10@3607 31 ((operand >> 24) & 0xFF)
iap10@3607 32
iap10@3607 33 #define operand_index(operand) \
iap10@3607 34 ((operand >> 16) & 0xFF)
iap10@3607 35 //For instruction.operand[].size
iap10@3607 36 #define BYTE 1
iap10@3607 37 #define WORD 2
iap10@3607 38 #define LONG 4
iap10@3607 39 #define QUAD 8
iap10@3607 40
iap10@3607 41 //For instruction.operand[].flag
iap10@3607 42 #define REGISTER 0x1
iap10@3607 43 #define MEMORY 0x2
iap10@3607 44 #define IMMEDIATE 0x4
iap10@3607 45 #define WZEROEXTEND 0x8
iap10@3607 46
iap10@3607 47 //For instruction.flags
iap10@3607 48 #define REPZ 0x1
iap10@3607 49 #define REPNZ 0x2
iap10@3607 50
iap10@3607 51 struct instruction {
iap10@3607 52 __s8 i_name[I_NAME_LEN]; //Instruction's name
iap10@3607 53 __s16 op_size; //The operand's bit size, e.g. 16-bit or 32-bit.
iap10@3607 54
iap10@3607 55 __u64 offset; //The effective address
iap10@3607 56 //offset = Base + (Index * Scale) + Displacement
iap10@3607 57
iap10@3607 58 __u64 immediate;
iap10@3607 59
iap10@3607 60 __u16 seg_sel; //Segmentation selector
iap10@3607 61
iap10@3607 62 __u32 operand[MAX_OPERAND_NUM]; //The order of operand is from AT&T Assembly
iap10@3607 63 __s16 op_num; //The operand numbers
iap10@3607 64
iap10@3607 65 __u32 flags; //
iap10@3607 66 };
iap10@3607 67
iap10@3607 68 #define VGA_SPACE_START 0xA0000
iap10@3607 69 #define VGA_SPACE_END 0xC0000
iap10@3607 70 #define MAX_INST_LEN 32
iap10@3607 71
iap10@3607 72 struct mi_per_cpu_info
iap10@3607 73 {
iap10@3607 74 unsigned long mmio_target;
iap10@3607 75 struct xen_regs *inst_decoder_regs;
iap10@3607 76 };
iap10@3607 77
iap10@3607 78 struct virutal_platform_def {
iap10@3607 79 unsigned long *real_mode_data; /* E820, etc. */
iap10@3607 80 unsigned long shared_page_va;
iap10@3607 81 struct mi_per_cpu_info mpci; /* MMIO */
iap10@3607 82 };
iap10@3607 83
iap10@3607 84 extern void handle_mmio(unsigned long, unsigned long, unsigned long);
iap10@3607 85 extern int vmx_setup_platform(struct exec_domain *, execution_context_t *);
iap10@3607 86
iap10@3642 87 static inline int mmio_space(unsigned long gpa)
iap10@3607 88 {
iap10@3607 89 if (gpa >= VGA_SPACE_START && gpa < VGA_SPACE_END) {
iap10@3607 90 return 1;
iap10@3607 91 }
iap10@3607 92 return 0;
iap10@3607 93 }
iap10@3328 94
iap10@3328 95 #endif