emulenv.hh revision 4604
15647Sgblack@eecs.umich.edu/*
29544Sandreas.hansson@arm.com * Copyright (c) 2007 The Hewlett-Packard Development Company
38922Swilliam.wang@arm.com * All rights reserved.
48922Swilliam.wang@arm.com *
58922Swilliam.wang@arm.com * Redistribution and use of this software in source and binary forms,
68922Swilliam.wang@arm.com * with or without modification, are permitted provided that the
78922Swilliam.wang@arm.com * following conditions are met:
88922Swilliam.wang@arm.com *
98922Swilliam.wang@arm.com * The software must be used only for Non-Commercial Use which means any
108922Swilliam.wang@arm.com * use which is NOT directed to receiving any direct monetary
118922Swilliam.wang@arm.com * compensation for, or commercial advantage from such use.  Illustrative
128922Swilliam.wang@arm.com * examples of non-commercial use are academic research, personal study,
138922Swilliam.wang@arm.com * teaching, education and corporate research & development.
145647Sgblack@eecs.umich.edu * Illustrative examples of commercial use are distributing products for
155647Sgblack@eecs.umich.edu * commercial advantage and providing services using the software for
165647Sgblack@eecs.umich.edu * commercial advantage.
177087Snate@binkert.org *
187087Snate@binkert.org * If you wish to use this software or functionality therein that may be
197087Snate@binkert.org * covered by patents for commercial use, please contact:
207087Snate@binkert.org *     Director of Intellectual Property Licensing
217087Snate@binkert.org *     Office of Strategy and Technology
227087Snate@binkert.org *     Hewlett-Packard Company
237087Snate@binkert.org *     1501 Page Mill Road
247087Snate@binkert.org *     Palo Alto, California  94304
255647Sgblack@eecs.umich.edu *
267087Snate@binkert.org * Redistributions of source code must retain the above copyright notice,
277087Snate@binkert.org * this list of conditions and the following disclaimer.  Redistributions
287087Snate@binkert.org * in binary form must reproduce the above copyright notice, this list of
297087Snate@binkert.org * conditions and the following disclaimer in the documentation and/or
307087Snate@binkert.org * other materials provided with the distribution.  Neither the name of
317087Snate@binkert.org * the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
327087Snate@binkert.org * contributors may be used to endorse or promote products derived from
337087Snate@binkert.org * this software without specific prior written permission.  No right of
345647Sgblack@eecs.umich.edu * sublicense is granted herewith.  Derivatives of the software and
357087Snate@binkert.org * output created using the software may be prepared, but only for
365647Sgblack@eecs.umich.edu * Non-Commercial Uses.  Derivatives of the software may be shared with
375647Sgblack@eecs.umich.edu * others provided: (i) the others agree to abide by the list of
385647Sgblack@eecs.umich.edu * conditions herein which includes the Non-Commercial Use restrictions;
395647Sgblack@eecs.umich.edu * and (ii) such Derivatives of the software include the above copyright
405647Sgblack@eecs.umich.edu * notice to acknowledge the contribution from this software where
415647Sgblack@eecs.umich.edu * applicable, this list of conditions and the disclaimer below.
425647Sgblack@eecs.umich.edu *
435647Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
445647Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
455647Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
465647Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
475647Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
485647Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
495647Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
505647Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
515647Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
5210474Sandreas.hansson@arm.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5310474Sandreas.hansson@arm.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
548229Snate@binkert.org *
555647Sgblack@eecs.umich.edu * Authors: Gabe Black
565654Sgblack@eecs.umich.edu */
575647Sgblack@eecs.umich.edu
588232Snate@binkert.org#ifndef __ARCH_X86_EMULENV_HH__
596137Sgblack@eecs.umich.edu#define __ARCH_X86_EMULENV_HH__
606137Sgblack@eecs.umich.edu
616137Sgblack@eecs.umich.edu#include "arch/x86/types.hh"
625654Sgblack@eecs.umich.edu#include "arch/x86/intregs.hh"
636046Sgblack@eecs.umich.edu
648781Sgblack@eecs.umich.edunamespace X86ISA
655647Sgblack@eecs.umich.edu{
665648Sgblack@eecs.umich.edu    struct EmulEnv
675648Sgblack@eecs.umich.edu    {
685647Sgblack@eecs.umich.edu        RegIndex reg;
695647Sgblack@eecs.umich.edu        RegIndex regm;
705647Sgblack@eecs.umich.edu        uint8_t scale;
715647Sgblack@eecs.umich.edu        RegIndex index;
725647Sgblack@eecs.umich.edu        RegIndex base;
735647Sgblack@eecs.umich.edu        int dataSize;
745647Sgblack@eecs.umich.edu        int addressSize;
755647Sgblack@eecs.umich.edu        int stackSize;
765647Sgblack@eecs.umich.edu
775648Sgblack@eecs.umich.edu        EmulEnv(RegIndex _reg, RegIndex _regm,
785647Sgblack@eecs.umich.edu                int _dataSize, int _addressSize, int _stackSize) :
795648Sgblack@eecs.umich.edu            reg(_reg), regm(_regm),
805648Sgblack@eecs.umich.edu            scale(0), index(NUM_INTREGS),
815648Sgblack@eecs.umich.edu            base(NUM_INTREGS),
825648Sgblack@eecs.umich.edu            dataSize(_dataSize), addressSize(_addressSize),
835648Sgblack@eecs.umich.edu            stackSize(_stackSize)
845648Sgblack@eecs.umich.edu        {;}
855648Sgblack@eecs.umich.edu
865648Sgblack@eecs.umich.edu        void doModRM(const ExtMachInst & machInst);
875648Sgblack@eecs.umich.edu    };
885648Sgblack@eecs.umich.edu};
895648Sgblack@eecs.umich.edu
905648Sgblack@eecs.umich.edu#endif // __ARCH_X86_TYPES_HH__
915648Sgblack@eecs.umich.edu