Go to the documentation of this file.
52 strcpy(
name->sysname,
"Linux");
53 strcpy(
name->nodename,
"sim.gem5.org");
54 strcpy(
name->release, process->release.c_str());
55 strcpy(
name->version,
"#1 Mon Aug 18 11:32:15 EDT 2003");
56 strcpy(
name->machine,
"x86_64");
72 uint64_t fsBase, gsBase;
83 p.write(
addr, fsBase);
91 p.write(
addr, gsBase);
102 const int minTLSEntry = 6;
103 const int numTLSEntries = 3;
104 const int maxTLSEntry = minTLSEntry + numTLSEntries - 1;
111 assert((maxTLSEntry + 1) *
sizeof(uint64_t) <= x86p->
gdtSize());
114 gdt(x86p->
gdtStart() + minTLSEntry *
sizeof(uint64_t),
115 numTLSEntries *
sizeof(uint64_t));
118 panic(
"Failed to copy in GDT for %s.\n", desc->
name());
120 if (userDesc->entry_number == (uint32_t)(-1)) {
122 for (
int i = 0;
i < numTLSEntries;
i++) {
124 userDesc->entry_number =
i + minTLSEntry;
129 if (userDesc->entry_number == (uint32_t)(-1))
133 int index = userDesc->entry_number;
135 if (index < minTLSEntry || index > maxTLSEntry)
138 index -= minTLSEntry;
141 SegDescriptor segDesc = 0;
142 UserDescFlags flags = userDesc->flags;
144 segDesc.limitLow =
bits(userDesc->limit, 15, 0);
145 segDesc.baseLow =
bits(userDesc->base_addr, 23, 0);
147 if (!flags.read_exec_only)
149 if (
bits((uint8_t)flags.contents, 0))
151 if (
bits((uint8_t)flags.contents, 1))
152 segDesc.type.codeOrData = 1;
155 if (!flags.seg_not_present)
157 segDesc.limitHigh =
bits(userDesc->limit, 19, 16);
163 if (flags.limit_in_pages)
165 segDesc.baseHigh =
bits(userDesc->base_addr, 31, 24);
167 gdt[
index] = (uint64_t)segDesc;
170 panic(
"Failed to copy out GDT for %s.\n", desc->
name());
TypedBufferArg is a class template; instances of this template represent typed buffers in target user...
This class represents the return value from an emulated system call, including any errno setting.
SyscallReturn archPrctlFunc(SyscallDesc *desc, ThreadContext *tc, int code, uint64_t addr)
SyscallReturn unameFunc(SyscallDesc *desc, ThreadContext *tc, VPtr< Linux::utsname > name)
Target uname() handler.
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual PortProxy & getVirtProxy()=0
This object is a proxy for a port or other object which implements the functional response protocol,...
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
const std::string & name()
SyscallReturn setThreadArea32Func(SyscallDesc *desc, ThreadContext *tc, VPtr< UserDesc32 > userDesc)
bool copyIn(const PortProxy &memproxy)
copy data into simulator space (read from target memory)
virtual Process * getProcessPtr()=0
bool copyOut(const PortProxy &memproxy)
copy data out of simulator space (write to target memory)
This class provides the wrapper interface for the system call implementations which are defined in th...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
#define panic(...)
This implements a cprintf based panic() function.
virtual void setMiscRegNoEffect(RegIndex misc_reg, RegVal val)=0
Generated on Tue Sep 21 2021 12:24:51 for gem5 by doxygen 1.8.17