gem5
v24.0.0.0
Loading...
Searching...
No Matches
arch
arm
freebsd
se_workload.hh
Go to the documentation of this file.
1
/*
2
* Copyright 2015 Ruslan Bukin <br@bsdpad.com>
3
*
4
* This software was developed by the University of Cambridge Computer
5
* Laboratory as part of the CTSRD Project, with support from the UK Higher
6
* Education Innovation Fund (HEIF).
7
*
8
* Copyright 2020 Google Inc.
9
*
10
* Redistribution and use in source and binary forms, with or without
11
* modification, are permitted provided that the following conditions are
12
* met: redistributions of source code must retain the above copyright
13
* notice, this list of conditions and the following disclaimer;
14
* redistributions in binary form must reproduce the above copyright
15
* notice, this list of conditions and the following disclaimer in the
16
* documentation and/or other materials provided with the distribution;
17
* neither the name of the copyright holders nor the names of its
18
* contributors may be used to endorse or promote products derived from
19
* this software without specific prior written permission.
20
*
21
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
*/
33
34
#ifndef __ARCH_ARM_FREEBSD_SE_WORKLOAD_HH__
35
#define __ARCH_ARM_FREEBSD_SE_WORKLOAD_HH__
36
37
#include "
arch/arm/freebsd/freebsd.hh
"
38
#include "
arch/arm/page_size.hh
"
39
#include "
arch/arm/regs/cc.hh
"
40
#include "
arch/arm/regs/int.hh
"
41
#include "
arch/arm/se_workload.hh
"
42
#include "params/ArmEmuFreebsd.hh"
43
#include "
sim/syscall_desc.hh
"
44
45
namespace
gem5
46
{
47
48
namespace
ArmISA
49
{
50
51
class
EmuFreebsd
:
public
SEWorkload
52
{
53
public
:
54
using
Params
= ArmEmuFreebsdParams;
55
56
EmuFreebsd
(
const
Params
&
p
) :
SEWorkload
(
p
,
PageShift
) {}
57
58
ByteOrder
byteOrder
()
const override
{
return
ByteOrder::little; }
59
60
struct
BaseSyscallABI
{};
61
struct
SyscallABI32
:
public
SEWorkload::SyscallABI32
,
62
public
BaseSyscallABI
63
{};
64
struct
SyscallABI64
:
public
SEWorkload::SyscallABI64
,
65
public
BaseSyscallABI
66
{};
67
68
void
syscall
(
ThreadContext
*tc)
override
;
69
};
70
71
}
// namespace ArmISA
72
73
namespace
guest_abi
74
{
75
76
template
<
typename
ABI>
77
struct
Result
<ABI,
SyscallReturn
,
78
typename
std
::enable_if_t<std::is_base_of_v<
79
ArmISA::EmuFreebsd::BaseSyscallABI, ABI>>>
80
{
81
static
void
82
store
(
ThreadContext
*tc,
const
SyscallReturn
&ret)
83
{
84
RegVal
val
;
85
if
(ret.
successful
()) {
86
tc->
setReg
(
ArmISA::cc_reg::C
, (
RegVal
)0);
87
val
= ret.
returnValue
();
88
}
else
{
89
tc->
setReg
(
ArmISA::cc_reg::C
, 1);
90
val
= ret.
encodedValue
();
91
}
92
tc->
setReg
(
ArmISA::ReturnValueReg
,
val
);
93
if
(ret.
count
() > 1)
94
tc->
setReg
(
ArmISA::SyscallPseudoReturnReg
, ret.
value2
());
95
}
96
};
97
98
}
// namespace guest_abi
99
}
// namespace gem5
100
101
#endif
// __ARCH_ARM_FREEBSD_SE_WORKLOAD_HH__
freebsd.hh
se_workload.hh
page_size.hh
int.hh
cc.hh
gem5::ArmISA::EmuFreebsd
Definition
se_workload.hh:52
gem5::ArmISA::EmuFreebsd::EmuFreebsd
EmuFreebsd(const Params &p)
Definition
se_workload.hh:56
gem5::ArmISA::EmuFreebsd::byteOrder
ByteOrder byteOrder() const override
Definition
se_workload.hh:58
gem5::ArmISA::EmuFreebsd::Params
ArmEmuFreebsdParams Params
Definition
se_workload.hh:54
gem5::ArmISA::EmuFreebsd::syscall
void syscall(ThreadContext *tc) override
Definition
se_workload.cc:152
gem5::ArmISA::SEWorkload
Definition
se_workload.hh:43
gem5::SyscallReturn
This class represents the return value from an emulated system call, including any errno setting.
Definition
syscall_return.hh:56
gem5::SyscallReturn::encodedValue
int64_t encodedValue() const
The encoded value (as described above)
Definition
syscall_return.hh:122
gem5::SyscallReturn::returnValue
int64_t returnValue() const
The return value.
Definition
syscall_return.hh:107
gem5::SyscallReturn::count
int count() const
How many values did the syscall attempt to return?
Definition
syscall_return.hh:103
gem5::SyscallReturn::value2
int64_t value2() const
Definition
syscall_return.hh:123
gem5::SyscallReturn::successful
bool successful() const
Was the system call successful?
Definition
syscall_return.hh:91
gem5::ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition
guest_abi.test.cc:41
gem5::ThreadContext::setReg
virtual void setReg(const RegId ®, RegVal val)
Definition
thread_context.cc:188
gem5::ArmISA::cc_reg::C
constexpr RegId C
Definition
cc.hh:95
gem5::ArmISA::ReturnValueReg
constexpr auto & ReturnValueReg
Definition
int.hh:648
gem5::ArmISA::SyscallPseudoReturnReg
constexpr auto & SyscallPseudoReturnReg
Definition
int.hh:658
gem5::ArmISA::PageShift
const Addr PageShift
Definition
page_size.hh:52
gem5::MipsISA::p
Bitfield< 0 > p
Definition
pra_constants.hh:326
gem5::X86ISA::val
Bitfield< 63 > val
Definition
misc.hh:804
gem5
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition
binary32.hh:36
gem5::RegVal
uint64_t RegVal
Definition
types.hh:173
std
Overload hash function for BasicBlockRange type.
Definition
binary32.hh:81
gem5::ArmISA::EmuFreebsd::BaseSyscallABI
Definition
se_workload.hh:60
gem5::ArmISA::EmuFreebsd::SyscallABI32
Definition
se_workload.hh:63
gem5::ArmISA::EmuFreebsd::SyscallABI64
Definition
se_workload.hh:66
gem5::ArmISA::RegABI32
Definition
reg_abi.hh:44
gem5::ArmISA::RegABI64
Definition
reg_abi.hh:49
gem5::guest_abi::Result< ABI, SyscallReturn, typename std::enable_if_t< std::is_base_of_v< ArmISA::EmuFreebsd::BaseSyscallABI, ABI > > >::store
static void store(ThreadContext *tc, const SyscallReturn &ret)
Definition
se_workload.hh:82
gem5::guest_abi::Result
Definition
definition.hh:64
syscall_desc.hh
Generated on Tue Jun 18 2024 16:23:57 for gem5 by
doxygen
1.11.0