gem5
v24.0.0.0
Loading...
Searching...
No Matches
arch
x86
isa.hh
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 The Regents of The University of Michigan
3
* All rights reserved.
4
*
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions are
7
* met: redistributions of source code must retain the above copyright
8
* notice, this list of conditions and the following disclaimer;
9
* redistributions in binary form must reproduce the above copyright
10
* notice, this list of conditions and the following disclaimer in the
11
* documentation and/or other materials provided with the distribution;
12
* neither the name of the copyright holders nor the names of its
13
* contributors may be used to endorse or promote products derived from
14
* this software without specific prior written permission.
15
*
16
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
*/
28
29
#ifndef __ARCH_X86_ISA_HH__
30
#define __ARCH_X86_ISA_HH__
31
32
#include <iostream>
33
#include <string>
34
35
#include "
arch/generic/isa.hh
"
36
#include "
arch/x86/cpuid.hh
"
37
#include "
arch/x86/pcstate.hh
"
38
#include "
arch/x86/regs/ccr.hh
"
39
#include "
arch/x86/regs/float.hh
"
40
#include "
arch/x86/regs/int.hh
"
41
#include "
arch/x86/regs/misc.hh
"
42
#include "
base/types.hh
"
43
#include "
cpu/reg_class.hh
"
44
45
namespace
gem5
46
{
47
48
class
ThreadContext;
49
struct
X86ISAParams;
50
51
namespace
X86ISA
52
{
53
54
class
ISA
:
public
BaseISA
55
{
56
private
:
57
RegVal
regVal
[
misc_reg::NumRegs
];
58
void
updateHandyM5Reg
(Efer efer, CR0 cr0,
59
SegAttr csAttr, SegAttr ssAttr, RFLAGS rflags);
60
61
std::string
vendorString
;
62
63
public
:
64
void
clear
()
override
;
65
66
PCStateBase
*
67
newPCState
(
Addr
new_inst_addr=0)
const override
68
{
69
return
new
PCState
(new_inst_addr);
70
}
71
72
using
Params
= X86ISAParams;
73
74
ISA
(
const
Params
&
p
);
75
76
RegVal
readMiscRegNoEffect
(
RegIndex
idx)
const override
;
77
RegVal
readMiscReg
(
RegIndex
idx)
override
;
78
79
void
setMiscRegNoEffect
(
RegIndex
idx,
RegVal
val
)
override
;
80
void
setMiscReg
(
RegIndex
idx,
RegVal
val
)
override
;
81
82
bool
83
inUserMode
()
const override
84
{
85
HandyM5Reg m5reg =
readMiscRegNoEffect
(
misc_reg::M5Reg
);
86
return
m5reg.cpl == 3;
87
}
88
89
void
copyRegsFrom
(
ThreadContext
*src)
override
;
90
91
void
serialize
(
CheckpointOut
&cp)
const override
;
92
void
unserialize
(
CheckpointIn
&cp)
override
;
93
94
void
setThreadContext
(
ThreadContext
*_tc)
override
;
95
96
std::string
getVendorString
()
const
;
97
98
std::unique_ptr<X86CPUID>
cpuid
;
99
};
100
101
}
// namespace X86ISA
102
}
// namespace gem5
103
104
#endif
misc.hh
types.hh
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
ccr.hh
gem5::BaseISA
Definition
isa.hh:59
gem5::CheckpointIn
Definition
serialize.hh:69
gem5::PCStateBase
Definition
pcstate.hh:59
gem5::ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition
guest_abi.test.cc:41
gem5::X86ISA::ISA
Definition
isa.hh:55
gem5::X86ISA::ISA::inUserMode
bool inUserMode() const override
Definition
isa.hh:83
gem5::X86ISA::ISA::cpuid
std::unique_ptr< X86CPUID > cpuid
Definition
isa.hh:98
gem5::X86ISA::ISA::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition
isa.cc:498
gem5::X86ISA::ISA::vendorString
std::string vendorString
Definition
isa.hh:61
gem5::X86ISA::ISA::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition
isa.cc:506
gem5::X86ISA::ISA::readMiscReg
RegVal readMiscReg(RegIndex idx) override
Definition
isa.cc:229
gem5::X86ISA::ISA::updateHandyM5Reg
void updateHandyM5Reg(Efer efer, CR0 cr0, SegAttr csAttr, SegAttr ssAttr, RFLAGS rflags)
Definition
isa.cc:51
gem5::X86ISA::ISA::getVendorString
std::string getVendorString() const
Definition
isa.cc:524
gem5::X86ISA::ISA::ISA
ISA(const Params &p)
Definition
isa.cc:154
gem5::X86ISA::ISA::setMiscReg
void setMiscReg(RegIndex idx, RegVal val) override
Definition
isa.cc:297
gem5::X86ISA::ISA::newPCState
PCStateBase * newPCState(Addr new_inst_addr=0) const override
Definition
isa.hh:67
gem5::X86ISA::ISA::setThreadContext
void setThreadContext(ThreadContext *_tc) override
Definition
isa.cc:517
gem5::X86ISA::ISA::setMiscRegNoEffect
void setMiscRegNoEffect(RegIndex idx, RegVal val) override
Definition
isa.cc:255
gem5::X86ISA::ISA::Params
X86ISAParams Params
Definition
isa.hh:72
gem5::X86ISA::ISA::clear
void clear() override
Definition
isa.cc:112
gem5::X86ISA::ISA::readMiscRegNoEffect
RegVal readMiscRegNoEffect(RegIndex idx) const override
Definition
isa.cc:218
gem5::X86ISA::ISA::copyRegsFrom
void copyRegsFrom(ThreadContext *src) override
Definition
isa.cc:202
gem5::X86ISA::ISA::regVal
RegVal regVal[misc_reg::NumRegs]
Definition
isa.hh:57
cpuid.hh
isa.hh
gem5::MipsISA::PCState
GenericISA::DelaySlotPCState< 4 > PCState
Definition
pcstate.hh:40
gem5::X86ISA::misc_reg::NumRegs
@ NumRegs
Definition
misc.hh:411
gem5::X86ISA::misc_reg::M5Reg
@ M5Reg
Definition
misc.hh:148
gem5::X86ISA::val
Bitfield< 63 > val
Definition
misc.hh:804
gem5::X86ISA::p
Bitfield< 0 > p
Definition
pagetable.hh:151
gem5
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition
binary32.hh:36
gem5::RegIndex
uint16_t RegIndex
Definition
types.hh:176
gem5::RegVal
uint64_t RegVal
Definition
types.hh:173
gem5::CheckpointOut
std::ostream CheckpointOut
Definition
serialize.hh:66
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition
types.hh:147
reg_class.hh
pcstate.hh
float.hh
int.hh
Generated on Tue Jun 18 2024 16:23:57 for gem5 by
doxygen
1.11.0