gem5 v24.0.0.0
Loading...
Searching...
No Matches
se_workload.hh
Go to the documentation of this file.
1/*
2 * Copyright 2007 The Hewlett-Packard Development Company
3 *
4 * The license below extends only to copyright in the software and shall
5 * not be construed as granting a license to any other intellectual
6 * property including but not limited to intellectual property relating
7 * to a hardware implementation of the functionality of the software
8 * licensed hereunder. You may use the software subject to the license
9 * terms below provided that you ensure that this notice is replicated
10 * unmodified and in its entirety in all distributions of the software,
11 * modified or unmodified, in source code or in binary form.
12 *
13 * Copyright 2020 Google Inc.
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions are
17 * met: redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer;
19 * redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution;
22 * neither the name of the copyright holders nor the names of its
23 * contributors may be used to endorse or promote products derived from
24 * this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 */
38
39#ifndef __ARCH_X86_LINUX_SE_WORKLOAD_HH__
40#define __ARCH_X86_LINUX_SE_WORKLOAD_HH__
41
43#include "arch/x86/regs/int.hh"
45#include "params/X86EmuLinux.hh"
46#include "sim/process.hh"
47#include "sim/se_workload.hh"
48#include "sim/syscall_abi.hh"
49#include "sim/syscall_desc.hh"
50
51namespace gem5
52{
53
54namespace X86ISA
55{
56
57class EmuLinux : public SEWorkload
58{
59 public:
60 PARAMS(X86EmuLinux);
61
62 EmuLinux(const Params &p);
63
64 void
65 setSystem(System *sys) override
66 {
69 params().remote_gdb_port, system);
70 }
71
72 loader::Arch getArch() const override { return loader::X86_64; }
73 ByteOrder byteOrder() const override { return ByteOrder::little; }
74
75 void syscall(ThreadContext *tc) override;
76 void event(ThreadContext *tc) override;
77
78 void pageFault(ThreadContext *tc);
79
80 struct SyscallABI64 :
82 {
84 };
85
86 struct SyscallABI32 :
88 {
90 };
91
92 private:
95};
96
97} // namespace X86ISA
98
99namespace guest_abi
100{
101
102template <typename Arg>
104 typename std::enable_if_t<std::is_integral_v<Arg> &&
105 X86ISA::EmuLinux::SyscallABI32::IsWideV<Arg>>>
106{
108
109 static Arg
111 {
112 panic_if(state + 1 >= ABI::ArgumentRegs.size(),
113 "Ran out of syscall argument registers.");
114 auto low = ABI::ArgumentRegs[state++];
115 auto high = ABI::ArgumentRegs[state++];
116 return (Arg)ABI::mergeRegs(tc, low, high);
117 }
118};
119
120} // namespace guest_abi
121} // namespace gem5
122
123#endif // __ARCH_X86_LINUX_SE_WORKLOAD_HH__
static BaseRemoteGDB * build(ListenSocketConfig listen_config, Args... args)
SEWorkloadParams Params
void setSystem(System *sys) override
ThreadContext is the external interface to all thread state for anything outside of the CPU.
BaseRemoteGDB * gdb
Definition workload.hh:77
ByteOrder byteOrder() const override
static SyscallDescTable< SyscallABI64 > syscallDescs64
void pageFault(ThreadContext *tc)
EmuLinux(const Params &p)
loader::Arch getArch() const override
static SyscallDescTable< SyscallABI32 > syscallDescs32
void setSystem(System *sys) override
void syscall(ThreadContext *tc) override
STL vector class.
Definition stl.hh:37
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition logging.hh:214
const Params & params() const
atomic_var_t state
Definition helpers.cc:211
Bitfield< 10, 5 > event
Bitfield< 15 > system
Definition misc.hh:1032
Bitfield< 0 > p
Definition pagetable.hh:151
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
static const std::vector< RegId > ArgumentRegs
static const std::vector< RegId > ArgumentRegs

Generated on Tue Jun 18 2024 16:23:57 for gem5 by doxygen 1.11.0