emulenv.hh revision 5966
12568SN/A/* 22568SN/A * Copyright (c) 2007 The Hewlett-Packard Development Company 32568SN/A * All rights reserved. 42568SN/A * 52568SN/A * Redistribution and use of this software in source and binary forms, 62568SN/A * with or without modification, are permitted provided that the 72568SN/A * following conditions are met: 82568SN/A * 92568SN/A * The software must be used only for Non-Commercial Use which means any 102568SN/A * use which is NOT directed to receiving any direct monetary 112568SN/A * compensation for, or commercial advantage from such use. Illustrative 122568SN/A * examples of non-commercial use are academic research, personal study, 132568SN/A * teaching, education and corporate research & development. 142568SN/A * Illustrative examples of commercial use are distributing products for 152568SN/A * commercial advantage and providing services using the software for 162568SN/A * commercial advantage. 172568SN/A * 182568SN/A * If you wish to use this software or functionality therein that may be 192568SN/A * covered by patents for commercial use, please contact: 202568SN/A * Director of Intellectual Property Licensing 212568SN/A * Office of Strategy and Technology 222568SN/A * Hewlett-Packard Company 232568SN/A * 1501 Page Mill Road 242568SN/A * Palo Alto, California 94304 252568SN/A * 262568SN/A * Redistributions of source code must retain the above copyright notice, 272568SN/A * this list of conditions and the following disclaimer. Redistributions 282665Ssaidi@eecs.umich.edu * in binary form must reproduce the above copyright notice, this list of 292665Ssaidi@eecs.umich.edu * conditions and the following disclaimer in the documentation and/or 302665Ssaidi@eecs.umich.edu * other materials provided with the distribution. Neither the name of 312568SN/A * the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its 322568SN/A * contributors may be used to endorse or promote products derived from 332568SN/A * this software without specific prior written permission. No right of 342982Sstever@eecs.umich.edu * sublicense is granted herewith. Derivatives of the software and 352982Sstever@eecs.umich.edu * output created using the software may be prepared, but only for 362568SN/A * Non-Commercial Uses. Derivatives of the software may be shared with 372568SN/A * others provided: (i) the others agree to abide by the list of 382643Sstever@eecs.umich.edu * conditions herein which includes the Non-Commercial Use restrictions; 392568SN/A * and (ii) such Derivatives of the software include the above copyright 402568SN/A * notice to acknowledge the contribution from this software where 412568SN/A * applicable, this list of conditions and the disclaimer below. 422568SN/A * 432568SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 442643Sstever@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 452643Sstever@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 464435Ssaidi@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 474435Ssaidi@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 482643Sstever@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 494435Ssaidi@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 504435Ssaidi@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 514435Ssaidi@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 522643Sstever@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 532643Sstever@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 542643Sstever@eecs.umich.edu * 554435Ssaidi@eecs.umich.edu * Authors: Gabe Black 564435Ssaidi@eecs.umich.edu */ 574435Ssaidi@eecs.umich.edu 584435Ssaidi@eecs.umich.edu#ifndef __ARCH_X86_EMULENV_HH__ 594435Ssaidi@eecs.umich.edu#define __ARCH_X86_EMULENV_HH__ 604435Ssaidi@eecs.umich.edu 614435Ssaidi@eecs.umich.edu#include "arch/x86/intregs.hh" 622643Sstever@eecs.umich.edu#include "arch/x86/segmentregs.hh" 634432Ssaidi@eecs.umich.edu#include "arch/x86/types.hh" 644432Ssaidi@eecs.umich.edu 652643Sstever@eecs.umich.edunamespace X86ISA 662643Sstever@eecs.umich.edu{ 672643Sstever@eecs.umich.edu struct EmulEnv 682738Sstever@eecs.umich.edu { 692643Sstever@eecs.umich.edu RegIndex reg; 702643Sstever@eecs.umich.edu RegIndex regm; 712643Sstever@eecs.umich.edu SegmentRegIndex seg; 722643Sstever@eecs.umich.edu uint8_t scale; 732643Sstever@eecs.umich.edu RegIndex index; 742643Sstever@eecs.umich.edu RegIndex base; 752643Sstever@eecs.umich.edu int dataSize; 762643Sstever@eecs.umich.edu int addressSize; 772643Sstever@eecs.umich.edu int stackSize; 782643Sstever@eecs.umich.edu 792643Sstever@eecs.umich.edu EmulEnv(RegIndex _reg, RegIndex _regm, 802643Sstever@eecs.umich.edu int _dataSize, int _addressSize, int _stackSize) : 812643Sstever@eecs.umich.edu reg(_reg), regm(_regm), seg(SEGMENT_REG_DS), 822643Sstever@eecs.umich.edu scale(0), index(NUM_INTREGS), 832643Sstever@eecs.umich.edu base(NUM_INTREGS), 842643Sstever@eecs.umich.edu dataSize(_dataSize), addressSize(_addressSize), 852568SN/A stackSize(_stackSize) 862568SN/A {;} 872568SN/A 882568SN/A void doModRM(const ExtMachInst & machInst); 892643Sstever@eecs.umich.edu void setSeg(const ExtMachInst & machInst); 904432Ssaidi@eecs.umich.edu }; 914432Ssaidi@eecs.umich.edu}; 924432Ssaidi@eecs.umich.edu 934432Ssaidi@eecs.umich.edu#endif // __ARCH_X86_TYPES_HH__ 942568SN/A