gem5
v20.1.0.0
arch
arm
linux
process.hh
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011-2012 ARM Limited
3
* All rights reserved
4
*
5
* The license below extends only to copyright in the software and shall
6
* not be construed as granting a license to any other intellectual
7
* property including but not limited to intellectual property relating
8
* to a hardware implementation of the functionality of the software
9
* licensed hereunder. You may use the software subject to the license
10
* terms below provided that you ensure that this notice is replicated
11
* unmodified and in its entirety in all distributions of the software,
12
* modified or unmodified, in source code or in binary form.
13
*
14
* Copyright (c) 2007-2008 The Florida State University
15
* All rights reserved.
16
*
17
* Redistribution and use in source and binary forms, with or without
18
* modification, are permitted provided that the following conditions are
19
* met: redistributions of source code must retain the above copyright
20
* notice, this list of conditions and the following disclaimer;
21
* redistributions in binary form must reproduce the above copyright
22
* notice, this list of conditions and the following disclaimer in the
23
* documentation and/or other materials provided with the distribution;
24
* neither the name of the copyright holders nor the names of its
25
* contributors may be used to endorse or promote products derived from
26
* this software without specific prior written permission.
27
*
28
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
*/
40
41
#ifndef __ARM_LINUX_PROCESS_HH__
42
#define __ARM_LINUX_PROCESS_HH__
43
44
#include <vector>
45
46
#include "
arch/arm/process.hh
"
47
48
class
ArmLinuxProcessBits
49
{
50
public
:
51
struct
SyscallABI
{};
52
};
53
54
namespace
GuestABI
55
{
56
57
template
<
typename
ABI>
58
struct
Result
<ABI,
SyscallReturn
,
59
typename
std
::enable_if<std::is_base_of<
60
ArmLinuxProcessBits::SyscallABI, ABI>::value>
::type
>
61
{
62
static
void
63
store
(
ThreadContext
*tc,
const
SyscallReturn
&ret)
64
{
65
if
(ret.
suppressed
() || ret.
needsRetry
())
66
return
;
67
68
tc->
setIntReg
(
ArmISA::ReturnValueReg
, ret.
encodedValue
());
69
if
(ret.
count
() > 1)
70
tc->
setIntReg
(
ArmISA::SyscallPseudoReturnReg
, ret.
value2
());
71
}
72
};
73
74
}
// namespace GuestABI
75
77
class
ArmLinuxProcess32
:
public
ArmProcess32
,
public
ArmLinuxProcessBits
78
{
79
public
:
80
ArmLinuxProcess32
(ProcessParams *
params
, ::
Loader::ObjectFile
*
objFile
,
81
::
Loader::Arch
_arch);
82
83
void
initState
()
override
;
84
85
void
syscall
(
ThreadContext
*tc)
override
;
86
88
static
const
Addr
commPage
;
89
90
struct
SyscallABI
:
public
ArmProcess32::SyscallABI
,
91
public
ArmLinuxProcessBits::SyscallABI
92
{};
93
};
94
96
class
ArmLinuxProcess64
:
public
ArmProcess64
,
public
ArmLinuxProcessBits
97
{
98
public
:
99
ArmLinuxProcess64
(ProcessParams *
params
, ::
Loader::ObjectFile
*
objFile
,
100
::
Loader::Arch
_arch);
101
102
void
initState
()
override
;
103
void
syscall
(
ThreadContext
*tc)
override
;
104
105
struct
SyscallABI
:
public
ArmProcess64::SyscallABI
,
106
public
ArmLinuxProcessBits::SyscallABI
107
{};
108
};
109
110
#endif // __ARM_LINUX_PROCESS_HH__
ArmLinuxProcess64::SyscallABI
Definition:
process.hh:105
ArmLinuxProcess64::syscall
void syscall(ThreadContext *tc) override
Definition:
process.cc:929
ArmProcess64
Definition:
process.hh:117
type
uint8_t type
Definition:
inet.hh:421
ThreadContext::setIntReg
virtual void setIntReg(RegIndex reg_idx, RegVal val)=0
SyscallReturn::value2
int64_t value2() const
Definition:
syscall_return.hh:120
ArmISA::ReturnValueReg
const int ReturnValueReg
Definition:
registers.hh:104
ArmLinuxProcess64::ArmLinuxProcess64
ArmLinuxProcess64(ProcessParams *params, ::Loader::ObjectFile *objFile, ::Loader::Arch _arch)
Definition:
process.cc:853
ArmISA::SyscallPseudoReturnReg
const int SyscallPseudoReturnReg
Definition:
registers.hh:131
ArmProcess32::SyscallABI
Definition:
process.hh:86
Loader::ObjectFile
Definition:
object_file.hh:70
SyscallReturn::suppressed
bool suppressed() const
Should returning this value be suppressed?
Definition:
syscall_return.hh:97
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition:
thread_context.hh:88
ArmLinuxProcess32
A process with emulated Arm/Linux syscalls.
Definition:
process.hh:77
GuestABI
Definition:
aapcs32.hh:66
SyscallReturn::needsRetry
bool needsRetry() const
Does the syscall need to be retried?
Definition:
syscall_return.hh:94
ArmLinuxProcess32::initState
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition:
process.cc:861
ArmProcess32
Definition:
process.hh:74
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition:
types.hh:142
Process::objFile
::Loader::ObjectFile * objFile
Definition:
process.hh:213
SyscallReturn
This class represents the return value from an emulated system call, including any errno setting.
Definition:
syscall_return.hh:52
SimObject::params
const Params * params() const
Definition:
sim_object.hh:119
ArmLinuxProcess64::initState
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Definition:
process.cc:908
Loader::Arch
Arch
Definition:
object_file.hh:44
ArmLinuxProcessBits::SyscallABI
Definition:
process.hh:51
ArmProcess64::SyscallABI
Definition:
process.hh:129
GuestABI::Result
Definition:
definition.hh:58
std
Overload hash function for BasicBlockRange type.
Definition:
vec_reg.hh:587
SyscallReturn::encodedValue
int64_t encodedValue() const
The encoded value (as described above)
Definition:
syscall_return.hh:119
SyscallReturn::count
int count() const
How many values did the syscall attempt to return?
Definition:
syscall_return.hh:100
ArmLinuxProcessBits
Definition:
process.hh:48
ArmLinuxProcess32::commPage
static const Addr commPage
A page to hold "kernel" provided functions. The name might be wrong.
Definition:
process.hh:88
ArmLinuxProcess32::syscall
void syscall(ThreadContext *tc) override
Definition:
process.cc:915
ArmLinuxProcess64
A process with emulated Arm/Linux syscalls.
Definition:
process.hh:96
GuestABI::Result< ABI, SyscallReturn, typename std::enable_if< std::is_base_of< ArmLinuxProcessBits::SyscallABI, ABI >::value >::type >::store
static void store(ThreadContext *tc, const SyscallReturn &ret)
Definition:
process.hh:63
process.hh
ArmLinuxProcess32::ArmLinuxProcess32
ArmLinuxProcess32(ProcessParams *params, ::Loader::ObjectFile *objFile, ::Loader::Arch _arch)
Definition:
process.cc:848
ArmLinuxProcess32::SyscallABI
Definition:
process.hh:90
Generated on Wed Sep 30 2020 14:02:00 for gem5 by
doxygen
1.8.17