gem5 v24.0.0.0
Loading...
Searching...
No Matches
fs_workload.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010, 2012-2013, 2015-2019 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) 2002-2005 The Regents of The University of Michigan
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 __ARCH_ARM_FS_WORKLOAD_HH__
42#define __ARCH_ARM_FS_WORKLOAD_HH__
43
44#include <memory>
45#include <vector>
46
47#include "arch/arm/aapcs32.hh"
48#include "arch/arm/aapcs64.hh"
50#include "kern/linux/events.hh"
51#include "params/ArmFsWorkload.hh"
53#include "sim/sim_object.hh"
54
55namespace gem5
56{
57
58namespace ArmISA
59{
60
61class SkipFunc : public SkipFuncBase
62{
63 public:
65 void returnFromFuncIn(ThreadContext *tc) override;
66};
67
69{
70 protected:
73
78
85
94
95 template <template <class ABI, class Base> class FuncEvent,
96 typename... Args>
97 PCEvent *
98 addSkipFunc(Args... args)
99 {
100 if (getArch() == loader::Arm64) {
102 std::forward<Args>(args)...);
103 } else {
105 std::forward<Args>(args)...);
106 }
107 }
108
109 template <template <class ABI, class Base> class FuncEvent,
110 typename... Args>
111 PCEvent *
112 addSkipFuncOrPanic(Args... args)
113 {
114 if (getArch() == loader::Arm64) {
116 std::forward<Args>(args)...);
117 } else {
119 std::forward<Args>(args)...);
120 }
121 }
122
123 public:
124 PARAMS(ArmFsWorkload);
125
126 Addr
127 getEntry() const override
128 {
129 if (bootldr)
130 return bootldr->entryPoint();
131 else
132 return kernelEntry;
133 }
134
136 getArch() const override
137 {
138 if (bootldr)
139 return bootldr->getArch();
140 else if (kernelObj)
141 return kernelObj->getArch();
142 else
143 return loader::Arm64;
144 }
145
146 ByteOrder byteOrder() const override { return ByteOrder::little; }
147
148 FsWorkload(const Params &p);
149
150 void initState() override;
151
152 void
153 setSystem(System *sys) override
154 {
157 params().remote_gdb_port, system);
158 }
159
160 Addr
161 fixFuncEventAddr(Addr addr) const override
162 {
163 // Remove the low bit that thumb symbols have set
164 // but that aren't actually odd aligned
165 return addr & ~1;
166 }
167};
168
169} // namespace ArmISA
170} // namespace gem5
171
172#endif // __ARCH_ARM_FS_WORKLOAD_HH__
Addr fixFuncEventAddr(Addr addr) const override
loader::ObjectFile * getBootLoader(loader::ObjectFile *const obj)
Get a boot loader that matches the kernel.
PCEvent * addSkipFuncOrPanic(Args... args)
loader::ObjectFile * bootldr
Pointer to the bootloader object.
Addr getEntry() const override
void setSystem(System *sys) override
loader::Arch getArch() const override
ByteOrder byteOrder() const override
std::vector< std::unique_ptr< loader::ObjectFile > > bootLoaders
Bootloaders.
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
Addr kernelEntry
This differs from entry since it takes into account where the kernel is loaded in memory (with loadAd...
FsWorkload(const Params &p)
PCEvent * addSkipFunc(Args... args)
void returnFromFuncIn(ThreadContext *tc) override
static BaseRemoteGDB * build(ListenSocketConfig listen_config, Args... args)
loader::ObjectFile * kernelObj
T * addKernelFuncEventOrPanic(const char *lbl, Args... args)
T * addKernelFuncEvent(const char *lbl, Args... args)
Add a function-based event to a kernel symbol.
SimObjectParams Params
SkipFuncBase(PCEventScope *s, const std::string &desc, Addr addr)
ThreadContext is the external interface to all thread state for anything outside of the CPU.
BaseRemoteGDB * gdb
Definition workload.hh:77
virtual void setSystem(System *sys)
Definition workload.hh:88
System * system
Definition workload.hh:81
STL vector class.
Definition stl.hh:37
const Params & params() const
Bitfield< 0 > p
Bitfield< 3 > addr
Definition types.hh:84
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147

Generated on Tue Jun 18 2024 16:24:00 for gem5 by doxygen 1.11.0