gem5  v20.1.0.0
linux.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2006 The Regents of The University of Michigan
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met: redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef __ARCH_RISCV_LINUX_LINUX_HH__
30 #define __ARCH_RISCV_LINUX_LINUX_HH__
31 
32 #include "arch/riscv/utility.hh"
33 #include "kern/linux/linux.hh"
34 
35 class RiscvLinux : public Linux
36 {
37  public:
38  static const ByteOrder byteOrder = ByteOrder::little;
39 };
40 
41 class RiscvLinux64 : public RiscvLinux
42 {
43  public:
44  static const int TGT_SIGHUP = 1;
45  static const int TGT_SIGINT = 2;
46  static const int TGT_SIGQUIT = 3;
47  static const int TGT_SIGILL = 4;
48  static const int TGT_SIGTRAP = 5;
49  static const int TGT_SIGABRT = 6;
50  static const int TGT_SIGIOT = 6;
51  static const int TGT_SIGEMT = 7;
52  static const int TGT_SIGFPE = 8;
53  static const int TGT_SIGKILL = 9;
54  static const int TGT_SIGBUS = 10;
55  static const int TGT_SIGSEGV = 11;
56  static const int TGT_SIGSYS = 12;
57  static const int TGT_SIGPIPE = 13;
58  static const int TGT_SIGALRM = 14;
59  static const int TGT_SIGTERM = 15;
60  static const int TGT_SIGURG = 16;
61  static const int TGT_SIGSTOP = 17;
62  static const int TGT_SIGTSTP = 18;
63  static const int TGT_SIGCONT = 19;
64  static const int TGT_SIGCHLD = 20;
65  static const int TGT_SIGCLD = 20;
66  static const int TGT_SIGTTIN = 21;
67  static const int TGT_SIGTTOU = 22;
68  static const int TGT_SIGPOLL = 23;
69  static const int TGT_SIGIO = 23;
70  static const int TGT_SIGXCPU = 24;
71  static const int TGT_SIGXFSZ = 25;
72  static const int TGT_SIGVTALRM = 26;
73  static const int TGT_SIGPROF = 27;
74  static const int TGT_SIGWINCH = 28;
75  static const int TGT_SIGLOST = 29;
76  static const int TGT_SIGPWR = 29;
77  static const int TGT_SIGUSR1 = 30;
78  static const int TGT_SIGUSR2 = 31;
79 
83 
85  static const int NUM_OPEN_FLAGS;
86 
88  static const int TGT_O_RDONLY = 0x000000;
90  static const int TGT_O_WRONLY = 0x000001;
91  static const int TGT_O_RDWR = 0x000002;
92  static const int TGT_O_CREAT = 0x000040;
93  static const int TGT_O_EXCL = 0x000080;
94  static const int TGT_O_NOCTTY = 0x000100;
95  static const int TGT_O_TRUNC = 0x000200;
96  static const int TGT_O_APPEND = 0x000400;
97  static const int TGT_O_NONBLOCK = 0x000800;
98  static const int TGT_O_SYNC = 0x001000;
99  static const int TGT_FSYNC = 0x001000;
100  static const int TGT_FASYNC = 0x008000;
101  // The following are not present in riscv64-unknown-elf <fcntl.h>
102  static const int TGT_O_DSYNC = 0x010000;
103  static const int TGT_O_CLOEXEC = 0x040000;
104  static const int TGT_O_NOINHERIT = 0x040000;
105  static const int TGT_O_DIRECT = 0x080000;
106  static const int TGT_O_NOFOLLOW = 0x100000;
107  static const int TGT_O_DIRECTORY = 0x200000;
108  // The following are not defined by riscv64-unknown-elf
109  static const int TGT_O_LARGEFILE = 0x020000;
110  static const int TGT_O_NOATIME = 0x800000;
111  static const int TGT_O_PATH = 0x400000;
112 
113 
114  // Only defined in riscv-unknown-elf for proxy kernel and not linux kernel
115  static const unsigned TGT_MAP_SHARED = 0x0001;
116  static const unsigned TGT_MAP_PRIVATE = 0x0002;
117  static const unsigned TGT_MAP_FIXED = 0x0010;
118  static const unsigned TGT_MAP_ANONYMOUS = 0x0020;
119  static const unsigned TGT_MAP_POPULATE = 0x1000;
120  static const unsigned TGT_MREMAP_FIXED = 0x0020;
121 
122  static const unsigned NUM_MMAP_FLAGS;
123 
124  typedef int64_t time_t;
125  typedef uint64_t dev_t;
126  typedef uint64_t ino_t;
127  typedef uint32_t mode_t;
128  typedef uint32_t nlink_t;
129  typedef uint32_t uid_t;
130  typedef uint32_t gid_t;
131  typedef int64_t off_t;
132  typedef uint64_t blksize_t;
133  typedef uint64_t blkcnt_t;
134 
135  struct timespec {
137  int64_t tv_nsec;
138  };
139 
140  typedef struct {
152  uint64_t st_atimeX;
153  uint64_t st_atime_nsec;
154  uint64_t st_mtimeX;
155  uint64_t st_mtime_nsec;
156  uint64_t st_ctimeX;
157  uint64_t st_ctime_nsec;
158  int32_t ___glibc_reserved[2];
159  } tgt_stat64;
160 
161  typedef struct {
162  int32_t val[2];
163  } tgt_fsid_t;
164 
165  typedef struct {
166  uint64_t f_type;
167  uint64_t f_bsize;
168  uint64_t f_blocks;
169  uint64_t f_bfree;
170  uint64_t f_bavail;
171  uint64_t f_files;
172  uint64_t f_ffree;
174  uint64_t f_namelen;
175  uint64_t f_frsize;
176  uint64_t f_flags;
177  uint64_t f_spare[4];
178  } tgt_statfs;
179 
180  typedef struct {
181  int64_t uptime;
182  uint64_t loads[3];
183  uint64_t totalram;
184  uint64_t freeram;
185  uint64_t sharedram;
186  uint64_t bufferram;
187  uint64_t totalswap;
188  uint64_t freeswap;
189  uint16_t procs;
190  uint16_t pad;
191  uint64_t totalhigh;
192  uint64_t freehigh;
193  uint32_t mem_unit;
194  } tgt_sysinfo;
195 
196  static void
197  archClone(uint64_t flags,
198  Process *pp, Process *cp,
200  uint64_t stack, uint64_t tls)
201  {
202  RiscvISA::copyRegs(ptc, ctc);
203  if (flags & TGT_CLONE_SETTLS)
205  if (stack)
207  }
208 };
209 
210 class RiscvLinux32 : public RiscvLinux
211 {
212  public:
213  static const int TGT_SIGHUP = 1;
214  static const int TGT_SIGINT = 2;
215  static const int TGT_SIGQUIT = 3;
216  static const int TGT_SIGILL = 4;
217  static const int TGT_SIGTRAP = 5;
218  static const int TGT_SIGABRT = 6;
219  static const int TGT_SIGIOT = 6;
220  static const int TGT_SIGEMT = 7;
221  static const int TGT_SIGFPE = 8;
222  static const int TGT_SIGKILL = 9;
223  static const int TGT_SIGBUS = 10;
224  static const int TGT_SIGSEGV = 11;
225  static const int TGT_SIGSYS = 12;
226  static const int TGT_SIGPIPE = 13;
227  static const int TGT_SIGALRM = 14;
228  static const int TGT_SIGTERM = 15;
229  static const int TGT_SIGURG = 16;
230  static const int TGT_SIGSTOP = 17;
231  static const int TGT_SIGTSTP = 18;
232  static const int TGT_SIGCONT = 19;
233  static const int TGT_SIGCHLD = 20;
234  static const int TGT_SIGCLD = 20;
235  static const int TGT_SIGTTIN = 21;
236  static const int TGT_SIGTTOU = 22;
237  static const int TGT_SIGPOLL = 23;
238  static const int TGT_SIGIO = 23;
239  static const int TGT_SIGXCPU = 24;
240  static const int TGT_SIGXFSZ = 25;
241  static const int TGT_SIGVTALRM = 26;
242  static const int TGT_SIGPROF = 27;
243  static const int TGT_SIGWINCH = 28;
244  static const int TGT_SIGLOST = 29;
245  static const int TGT_SIGPWR = 29;
246  static const int TGT_SIGUSR1 = 30;
247  static const int TGT_SIGUSR2 = 31;
248 
252 
254  static const int NUM_OPEN_FLAGS;
255 
257  // The following values match newlib 3.0.0.
259  // Note that glibc has different values.
260  static const int TGT_O_RDONLY = 0x000000;
261  static const int TGT_O_WRONLY = 0x000001;
262  static const int TGT_O_RDWR = 0x000002;
263  static const int TGT_O_CREAT = 0x000200;
264  static const int TGT_O_EXCL = 0x000800;
265  static const int TGT_O_NOCTTY = 0x008000;
266  static const int TGT_O_TRUNC = 0x000400;
267  static const int TGT_O_APPEND = 0x000008;
268  static const int TGT_O_NONBLOCK = 0x004000;
269  static const int TGT_O_SYNC = 0x002000;
270  static const int TGT_FSYNC = 0x002000;
271  static const int TGT_FASYNC = 0x000040;
272  // The following are not present in riscv32-unknown-elf <fcntl.h>
273  static const int TGT_O_DSYNC = 0x010000;
274  static const int TGT_O_CLOEXEC = 0x040000;
275  static const int TGT_O_NOINHERIT = 0x040000;
276  static const int TGT_O_DIRECT = 0x080000;
277  static const int TGT_O_NOFOLLOW = 0x100000;
278  static const int TGT_O_DIRECTORY = 0x200000;
279  // The following are not defined by riscv32-unknown-elf
280  static const int TGT_O_LARGEFILE = 0x020000;
281  static const int TGT_O_NOATIME = 0x800000;
282  static const int TGT_O_PATH = 0x400000;
283 
284 
285  // Only defined in riscv-unknown-elf for proxy kernel and not linux kernel
286  static const unsigned TGT_MAP_SHARED = 0x0001;
287  static const unsigned TGT_MAP_PRIVATE = 0x0002;
288  static const unsigned TGT_MAP_FIXED = 0x0010;
289  static const unsigned TGT_MAP_ANONYMOUS = 0x0020;
290  static const unsigned TGT_MAP_POPULATE = 0x1000;
291  static const unsigned TGT_MREMAP_FIXED = 0x0020;
292 
293  static const unsigned NUM_MMAP_FLAGS;
294 
295  // Newlib 3.0.0 defaults to 64-bits for time_t.
296  // Currently time_t in glibc for riscv32 is 32-bits, but will be changed.
297  typedef int64_t time_t;
298 
300  struct rlimit {
301  uint32_t rlim_cur;
302  uint32_t rlim_max;
303  };
304 
305  struct timespec {
307  int32_t tv_nsec;
308  };
309 
310  typedef struct {
311  int32_t val[2];
312  } tgt_fsid_t;
313 
314  typedef struct {
315  uint64_t st_dev;
316  uint64_t st_ino;
317  uint32_t st_mode;
318  uint32_t st_nlink;
319  uint32_t st_uid;
320  uint32_t st_gid;
321  uint64_t st_rdev;
322  uint64_t __pad1;
323  int64_t st_size;
324  int32_t st_blksize;
325  int32_t __pad2;
326  int64_t st_blocks;
328  int32_t st_atime_nsec;
330  int32_t st_mtime_nsec;
332  int32_t st_ctime_nsec;
333  int32_t __unused4;
334  int32_t __unused5;
335  } tgt_stat;
336 
337  typedef struct {
338  uint32_t f_type;
339  uint32_t f_bsize;
340  uint32_t f_blocks;
341  uint32_t f_bfree;
342  uint32_t f_bavail;
343  uint32_t f_files;
344  uint32_t f_ffree;
346  uint32_t f_namelen;
347  uint32_t f_frsize;
348  uint32_t f_flags;
349  uint32_t f_spare[4];
350  } tgt_statfs;
351 
352  typedef struct {
353  int32_t uptime;
354  uint32_t loads[3];
355  uint32_t totalram;
356  uint32_t freeram;
357  uint32_t sharedram;
358  uint32_t bufferram;
359  uint32_t totalswap;
360  uint32_t freeswap;
361  uint16_t procs;
362  uint16_t pad;
363  uint32_t totalhigh;
364  uint32_t freehigh;
365  uint32_t mem_unit;
366  } tgt_sysinfo;
367 
368  static void
369  archClone(uint64_t flags,
370  Process *pp, Process *cp,
372  uint64_t stack, uint64_t tls)
373  {
374  RiscvISA::copyRegs(ptc, ctc);
375  if (stack)
377  }
378 };
379 
380 #endif
RiscvLinux64::TGT_MAP_PRIVATE
static const unsigned TGT_MAP_PRIVATE
Definition: linux.hh:116
RiscvLinux64::tgt_stat64::__pad1
dev_t __pad1
Definition: linux.hh:148
RiscvLinux32::tgt_statfs::f_frsize
uint32_t f_frsize
Definition: linux.hh:347
RiscvLinux64::TGT_O_NOATIME
static const int TGT_O_NOATIME
O_NOATIME.
Definition: linux.hh:110
RiscvLinux32::tgt_stat::st_size
int64_t st_size
Definition: linux.hh:323
RiscvLinux32::tgt_sysinfo::freeswap
uint32_t freeswap
Definition: linux.hh:360
RiscvLinux32::TGT_O_NOINHERIT
static const int TGT_O_NOINHERIT
O_NOINHERIT.
Definition: linux.hh:275
RiscvLinux64::tgt_stat64::st_gid
gid_t st_gid
Definition: linux.hh:146
RiscvLinux32::TGT_O_DIRECT
static const int TGT_O_DIRECT
O_DIRECT.
Definition: linux.hh:276
RiscvLinux64::tgt_sysinfo::procs
uint16_t procs
Definition: linux.hh:189
RiscvLinux32::tgt_sysinfo::totalswap
uint32_t totalswap
Definition: linux.hh:359
RiscvLinux32::tgt_stat::st_blocks
int64_t st_blocks
Definition: linux.hh:326
RiscvLinux32::TGT_SIGPOLL
static const int TGT_SIGPOLL
Definition: linux.hh:237
linux.hh
RiscvLinux32::tgt_sysinfo::totalram
uint32_t totalram
Definition: linux.hh:355
RiscvLinux64::tgt_sysinfo::totalram
uint64_t totalram
Definition: linux.hh:183
RiscvLinux64::openFlagTable
static SyscallFlagTransTable openFlagTable[]
This table maps the target open() flags to the corresponding host open() flags.
Definition: linux.hh:82
RiscvLinux64::tgt_stat64::st_size
off_t st_size
Definition: linux.hh:149
RiscvLinux64::TGT_MAP_ANONYMOUS
static const unsigned TGT_MAP_ANONYMOUS
Definition: linux.hh:118
RiscvLinux64::TGT_SIGTSTP
static const int TGT_SIGTSTP
Definition: linux.hh:62
RiscvLinux64::TGT_O_EXCL
static const int TGT_O_EXCL
O_EXCL.
Definition: linux.hh:93
RiscvLinux32::TGT_O_SYNC
static const int TGT_O_SYNC
O_SYNC.
Definition: linux.hh:269
RiscvLinux32::timespec::tv_nsec
int32_t tv_nsec
Definition: linux.hh:307
RiscvLinux64::tgt_stat64::st_mtimeX
uint64_t st_mtimeX
Definition: linux.hh:154
RiscvLinux64::TGT_SIGINT
static const int TGT_SIGINT
Definition: linux.hh:45
RiscvLinux32::NUM_OPEN_FLAGS
static const int NUM_OPEN_FLAGS
Number of entries in openFlagTable[].
Definition: linux.hh:254
RiscvLinux32::tgt_stat::st_gid
uint32_t st_gid
Definition: linux.hh:320
RiscvLinux32::TGT_SIGTERM
static const int TGT_SIGTERM
Definition: linux.hh:228
RiscvLinux32::tgt_stat::st_rdev
uint64_t st_rdev
Definition: linux.hh:321
RiscvLinux64::TGT_SIGILL
static const int TGT_SIGILL
Definition: linux.hh:47
RiscvLinux64::tgt_sysinfo::totalswap
uint64_t totalswap
Definition: linux.hh:187
RiscvLinux64::TGT_SIGPOLL
static const int TGT_SIGPOLL
Definition: linux.hh:68
RiscvLinux32::TGT_SIGBUS
static const int TGT_SIGBUS
Definition: linux.hh:223
RiscvLinux64::tgt_statfs::f_ffree
uint64_t f_ffree
Definition: linux.hh:172
RiscvLinux32::tgt_fsid_t
Definition: linux.hh:310
RiscvLinux64::TGT_O_DSYNC
static const int TGT_O_DSYNC
O_DSYNC.
Definition: linux.hh:102
Process
Definition: process.hh:65
RiscvLinux64::TGT_SIGQUIT
static const int TGT_SIGQUIT
Definition: linux.hh:46
RiscvLinux64::dev_t
uint64_t dev_t
Definition: linux.hh:125
RiscvLinux32::TGT_O_RDWR
static const int TGT_O_RDWR
O_RDWR.
Definition: linux.hh:262
RiscvLinux32::rlimit::rlim_cur
uint32_t rlim_cur
soft limit
Definition: linux.hh:301
RiscvLinux64::TGT_SIGXCPU
static const int TGT_SIGXCPU
Definition: linux.hh:70
RiscvLinux32::tgt_sysinfo::bufferram
uint32_t bufferram
Definition: linux.hh:358
RiscvLinux32::TGT_SIGQUIT
static const int TGT_SIGQUIT
Definition: linux.hh:215
RiscvLinux32::tgt_stat::st_mtime_nsec
int32_t st_mtime_nsec
Definition: linux.hh:330
RiscvLinux64::tgt_statfs::f_frsize
uint64_t f_frsize
Definition: linux.hh:175
RiscvLinux32::tgt_stat::__unused5
int32_t __unused5
Definition: linux.hh:334
RiscvLinux64::TGT_O_WRONLY
static const int TGT_O_WRONLY
O_WRONLY.
Definition: linux.hh:90
ThreadContext::setIntReg
virtual void setIntReg(RegIndex reg_idx, RegVal val)=0
RiscvLinux64::tgt_statfs::f_type
uint64_t f_type
Definition: linux.hh:166
RiscvLinux32::TGT_SIGWINCH
static const int TGT_SIGWINCH
Definition: linux.hh:243
RiscvLinux64::tgt_statfs
Definition: linux.hh:165
RiscvLinux64::TGT_SIGIOT
static const int TGT_SIGIOT
Definition: linux.hh:50
RiscvLinux64::tgt_statfs::f_blocks
uint64_t f_blocks
Definition: linux.hh:168
RiscvLinux32::TGT_MAP_FIXED
static const unsigned TGT_MAP_FIXED
Definition: linux.hh:288
RiscvLinux64::TGT_SIGTTIN
static const int TGT_SIGTTIN
Definition: linux.hh:66
RiscvLinux64::gid_t
uint32_t gid_t
Definition: linux.hh:130
RiscvLinux32::TGT_SIGFPE
static const int TGT_SIGFPE
Definition: linux.hh:221
RiscvLinux64::tgt_fsid_t
Definition: linux.hh:161
RiscvLinux64::tgt_stat64::st_mode
mode_t st_mode
Definition: linux.hh:143
OperatingSystem::tgt_stat64
void tgt_stat64
Definition: operatingsystem.hh:62
RiscvLinux64::tgt_sysinfo::freeswap
uint64_t freeswap
Definition: linux.hh:188
RiscvLinux64::TGT_O_DIRECTORY
static const int TGT_O_DIRECTORY
O_DIRECTORY.
Definition: linux.hh:107
RiscvLinux64::tgt_statfs::f_namelen
uint64_t f_namelen
Definition: linux.hh:174
RiscvLinux64::archClone
static void archClone(uint64_t flags, Process *pp, Process *cp, ThreadContext *ptc, ThreadContext *ctc, uint64_t stack, uint64_t tls)
Definition: linux.hh:197
RiscvLinux32::TGT_SIGSEGV
static const int TGT_SIGSEGV
Definition: linux.hh:224
RiscvISA::copyRegs
void copyRegs(ThreadContext *src, ThreadContext *dest)
Definition: utility.hh:124
RiscvLinux32::rlimit::rlim_max
uint32_t rlim_max
hard limit
Definition: linux.hh:302
RiscvLinux32::tgt_stat::st_ctimeX
time_t st_ctimeX
Definition: linux.hh:331
RiscvLinux64::TGT_SIGLOST
static const int TGT_SIGLOST
Definition: linux.hh:75
RiscvLinux32::TGT_SIGTTOU
static const int TGT_SIGTTOU
Definition: linux.hh:236
RiscvLinux64::TGT_SIGCONT
static const int TGT_SIGCONT
Definition: linux.hh:63
RiscvLinux32::TGT_O_NONBLOCK
static const int TGT_O_NONBLOCK
O_NONBLOCK.
Definition: linux.hh:268
RiscvLinux64::time_t
int64_t time_t
Definition: linux.hh:124
RiscvLinux64::TGT_MREMAP_FIXED
static const unsigned TGT_MREMAP_FIXED
Definition: linux.hh:120
RiscvLinux32::tgt_sysinfo::uptime
int32_t uptime
Definition: linux.hh:353
RiscvLinux32::TGT_O_NOATIME
static const int TGT_O_NOATIME
O_NOATIME.
Definition: linux.hh:281
RiscvLinux
Definition: linux.hh:35
RiscvLinux32::TGT_O_TRUNC
static const int TGT_O_TRUNC
O_TRUNC.
Definition: linux.hh:266
RiscvLinux64::TGT_SIGSTOP
static const int TGT_SIGSTOP
Definition: linux.hh:61
RiscvLinux32::tgt_statfs::f_bfree
uint32_t f_bfree
Definition: linux.hh:341
RiscvLinux64::TGT_SIGSEGV
static const int TGT_SIGSEGV
Definition: linux.hh:55
RiscvLinux64::tgt_stat64::st_ino
ino_t st_ino
Definition: linux.hh:142
RiscvLinux64::tgt_stat64::st_dev
dev_t st_dev
Definition: linux.hh:141
RiscvLinux32::tgt_stat::__unused4
int32_t __unused4
Definition: linux.hh:333
X86ISA::stack
Bitfield< 17, 16 > stack
Definition: misc.hh:587
RiscvLinux64::tgt_sysinfo::bufferram
uint64_t bufferram
Definition: linux.hh:186
RiscvLinux32::TGT_MAP_POPULATE
static const unsigned TGT_MAP_POPULATE
Definition: linux.hh:290
RiscvLinux32::TGT_SIGPIPE
static const int TGT_SIGPIPE
Definition: linux.hh:226
RiscvLinux64::tgt_sysinfo::mem_unit
uint32_t mem_unit
Definition: linux.hh:193
RiscvLinux32::openFlagTable
static SyscallFlagTransTable openFlagTable[]
This table maps the target open() flags to the corresponding host open() flags.
Definition: linux.hh:251
RiscvLinux64::ino_t
uint64_t ino_t
Definition: linux.hh:126
RiscvLinux64::tgt_stat64::st_rdev
dev_t st_rdev
Definition: linux.hh:147
RiscvLinux64::TGT_SIGXFSZ
static const int TGT_SIGXFSZ
Definition: linux.hh:71
RiscvLinux64::TGT_SIGWINCH
static const int TGT_SIGWINCH
Definition: linux.hh:74
RiscvLinux32::TGT_SIGILL
static const int TGT_SIGILL
Definition: linux.hh:216
Linux::TGT_CLONE_SETTLS
static const unsigned TGT_CLONE_SETTLS
Definition: linux.hh:289
RiscvLinux32::archClone
static void archClone(uint64_t flags, Process *pp, Process *cp, ThreadContext *ptc, ThreadContext *ctc, uint64_t stack, uint64_t tls)
Definition: linux.hh:369
RiscvLinux64::TGT_SIGTRAP
static const int TGT_SIGTRAP
Definition: linux.hh:48
RiscvLinux64::TGT_O_PATH
static const int TGT_O_PATH
O_PATH.
Definition: linux.hh:111
RiscvLinux32::TGT_SIGINT
static const int TGT_SIGINT
Definition: linux.hh:214
RiscvLinux32::TGT_SIGHUP
static const int TGT_SIGHUP
Definition: linux.hh:213
RiscvLinux32::time_t
int64_t time_t
Definition: linux.hh:297
RiscvLinux64::TGT_O_NOINHERIT
static const int TGT_O_NOINHERIT
O_NOINHERIT.
Definition: linux.hh:104
RiscvLinux64::tgt_stat64::st_atimeX
uint64_t st_atimeX
Definition: linux.hh:152
RiscvLinux64::tgt_stat64::st_ctime_nsec
uint64_t st_ctime_nsec
Definition: linux.hh:157
RiscvLinux32::TGT_O_CREAT
static const int TGT_O_CREAT
O_CREAT.
Definition: linux.hh:263
RiscvLinux32::TGT_MAP_ANONYMOUS
static const unsigned TGT_MAP_ANONYMOUS
Definition: linux.hh:289
cp
Definition: cprintf.cc:40
RiscvLinux32::TGT_SIGUSR1
static const int TGT_SIGUSR1
Definition: linux.hh:246
RiscvLinux64::tgt_stat64::st_mtime_nsec
uint64_t st_mtime_nsec
Definition: linux.hh:155
RiscvLinux32::tgt_sysinfo::totalhigh
uint32_t totalhigh
Definition: linux.hh:363
RiscvLinux64::tgt_statfs::f_fsid
tgt_fsid_t f_fsid
Definition: linux.hh:173
RiscvLinux64::tgt_stat64::st_ctimeX
uint64_t st_ctimeX
Definition: linux.hh:156
RiscvLinux32::tgt_statfs::f_bavail
uint32_t f_bavail
Definition: linux.hh:342
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
RiscvLinux32::TGT_O_DIRECTORY
static const int TGT_O_DIRECTORY
O_DIRECTORY.
Definition: linux.hh:278
RiscvLinux64::tgt_statfs::f_files
uint64_t f_files
Definition: linux.hh:171
RiscvLinux32::TGT_SIGSYS
static const int TGT_SIGSYS
Definition: linux.hh:225
RiscvLinux32::tgt_stat::st_mode
uint32_t st_mode
Definition: linux.hh:317
RiscvLinux32::TGT_SIGSTOP
static const int TGT_SIGSTOP
Definition: linux.hh:230
RiscvLinux32::tgt_statfs::f_bsize
uint32_t f_bsize
Definition: linux.hh:339
RiscvLinux32::TGT_SIGTRAP
static const int TGT_SIGTRAP
Definition: linux.hh:217
RiscvLinux32::tgt_stat::st_blksize
int32_t st_blksize
Definition: linux.hh:324
RiscvLinux64::blksize_t
uint64_t blksize_t
Definition: linux.hh:132
RiscvLinux64::TGT_MAP_FIXED
static const unsigned TGT_MAP_FIXED
Definition: linux.hh:117
RiscvLinux32::TGT_SIGURG
static const int TGT_SIGURG
Definition: linux.hh:229
RiscvLinux64::TGT_O_NONBLOCK
static const int TGT_O_NONBLOCK
O_NONBLOCK.
Definition: linux.hh:97
RiscvLinux64::TGT_SIGABRT
static const int TGT_SIGABRT
Definition: linux.hh:49
RiscvLinux64::TGT_MAP_POPULATE
static const unsigned TGT_MAP_POPULATE
Definition: linux.hh:119
RiscvLinux64::NUM_OPEN_FLAGS
static const int NUM_OPEN_FLAGS
Number of entries in openFlagTable[].
Definition: linux.hh:85
RiscvLinux32::TGT_SIGXCPU
static const int TGT_SIGXCPU
Definition: linux.hh:239
RiscvLinux64::TGT_O_LARGEFILE
static const int TGT_O_LARGEFILE
O_LARGEFILE.
Definition: linux.hh:109
RiscvLinux32::tgt_statfs::f_type
uint32_t f_type
Definition: linux.hh:338
RiscvLinux64::tgt_statfs::f_flags
uint64_t f_flags
Definition: linux.hh:176
RiscvLinux32::tgt_sysinfo::procs
uint16_t procs
Definition: linux.hh:361
RiscvLinux32::TGT_MAP_SHARED
static const unsigned TGT_MAP_SHARED
Definition: linux.hh:286
RiscvLinux32::TGT_SIGLOST
static const int TGT_SIGLOST
Definition: linux.hh:244
RiscvLinux32::tgt_stat::st_ctime_nsec
int32_t st_ctime_nsec
Definition: linux.hh:332
RiscvLinux32::TGT_O_PATH
static const int TGT_O_PATH
O_PATH.
Definition: linux.hh:282
RiscvLinux64::TGT_O_CLOEXEC
static const int TGT_O_CLOEXEC
O_CLOEXEC.
Definition: linux.hh:103
RiscvLinux32::TGT_SIGPWR
static const int TGT_SIGPWR
Definition: linux.hh:245
RiscvLinux32::tgt_stat::st_ino
uint64_t st_ino
Definition: linux.hh:316
RiscvLinux32::TGT_SIGEMT
static const int TGT_SIGEMT
Definition: linux.hh:220
RiscvLinux64::timespec::tv_nsec
int64_t tv_nsec
Definition: linux.hh:137
RiscvLinux64::mode_t
uint32_t mode_t
Definition: linux.hh:127
RiscvLinux64::uid_t
uint32_t uid_t
Definition: linux.hh:129
RiscvLinux64::TGT_SIGALRM
static const int TGT_SIGALRM
Definition: linux.hh:58
RiscvLinux64::nlink_t
uint32_t nlink_t
Definition: linux.hh:128
RiscvISA::ThreadPointerReg
const int ThreadPointerReg
Definition: registers.hh:96
RiscvLinux64::TGT_SIGPWR
static const int TGT_SIGPWR
Definition: linux.hh:76
RiscvLinux32::TGT_SIGTSTP
static const int TGT_SIGTSTP
Definition: linux.hh:231
RiscvLinux::byteOrder
static const ByteOrder byteOrder
Definition: linux.hh:38
RiscvLinux32::timespec
Definition: linux.hh:305
RiscvLinux32::TGT_O_CLOEXEC
static const int TGT_O_CLOEXEC
O_CLOEXEC.
Definition: linux.hh:274
RiscvLinux32::tgt_statfs::f_ffree
uint32_t f_ffree
Definition: linux.hh:344
RiscvLinux32::tgt_statfs
Definition: linux.hh:337
RiscvLinux32::tgt_stat::st_dev
uint64_t st_dev
Definition: linux.hh:315
RiscvLinux32::TGT_O_APPEND
static const int TGT_O_APPEND
O_APPEND.
Definition: linux.hh:267
RiscvLinux32::tgt_stat::st_atime_nsec
int32_t st_atime_nsec
Definition: linux.hh:328
SyscallFlagTransTable
This struct is used to build target-OS-dependent tables that map the target's flags to the host's fla...
Definition: operatingsystem.hh:41
RiscvLinux32::TGT_O_RDONLY
static const int TGT_O_RDONLY
open(2) flag values.
Definition: linux.hh:260
RiscvLinux64::tgt_stat64::st_blocks
blkcnt_t st_blocks
Definition: linux.hh:151
RiscvLinux32::TGT_SIGTTIN
static const int TGT_SIGTTIN
Definition: linux.hh:235
RiscvLinux32::TGT_O_LARGEFILE
static const int TGT_O_LARGEFILE
O_LARGEFILE.
Definition: linux.hh:280
X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:769
RiscvLinux64::TGT_SIGUSR1
static const int TGT_SIGUSR1
Definition: linux.hh:77
RiscvLinux64::tgt_sysinfo
Definition: linux.hh:180
RiscvLinux64::TGT_FSYNC
static const int TGT_FSYNC
FSYNC.
Definition: linux.hh:99
RiscvLinux64::tgt_statfs::f_bfree
uint64_t f_bfree
Definition: linux.hh:169
RiscvLinux64::tgt_statfs::f_bsize
uint64_t f_bsize
Definition: linux.hh:167
RiscvLinux32::TGT_SIGUSR2
static const int TGT_SIGUSR2
Definition: linux.hh:247
RiscvLinux64::timespec
Definition: linux.hh:135
RiscvLinux64::TGT_O_CREAT
static const int TGT_O_CREAT
O_CREAT.
Definition: linux.hh:92
RiscvLinux32::tgt_statfs::f_flags
uint32_t f_flags
Definition: linux.hh:348
RiscvLinux64::TGT_SIGTTOU
static const int TGT_SIGTTOU
Definition: linux.hh:67
RiscvLinux32::tgt_statfs::f_blocks
uint32_t f_blocks
Definition: linux.hh:340
RiscvLinux64::NUM_MMAP_FLAGS
static const unsigned NUM_MMAP_FLAGS
Definition: linux.hh:122
RiscvLinux64::tgt_stat64::st_atime_nsec
uint64_t st_atime_nsec
Definition: linux.hh:153
RiscvLinux64::TGT_SIGBUS
static const int TGT_SIGBUS
Definition: linux.hh:54
RiscvLinux64::TGT_O_NOCTTY
static const int TGT_O_NOCTTY
O_NOCTTY.
Definition: linux.hh:94
RiscvLinux64::TGT_MAP_SHARED
static const unsigned TGT_MAP_SHARED
Definition: linux.hh:115
RiscvLinux64::TGT_SIGTERM
static const int TGT_SIGTERM
Definition: linux.hh:59
MipsISA::ptc
Bitfield< 7, 0 > ptc
Definition: mt_constants.hh:53
RiscvLinux32::TGT_SIGCHLD
static const int TGT_SIGCHLD
Definition: linux.hh:233
RiscvLinux64::TGT_SIGVTALRM
static const int TGT_SIGVTALRM
Definition: linux.hh:72
RiscvLinux64::tgt_sysinfo::totalhigh
uint64_t totalhigh
Definition: linux.hh:191
RiscvLinux32::TGT_SIGALRM
static const int TGT_SIGALRM
Definition: linux.hh:227
RiscvLinux64::tgt_sysinfo::freehigh
uint64_t freehigh
Definition: linux.hh:192
RiscvLinux64::tgt_stat64::st_uid
uid_t st_uid
Definition: linux.hh:145
RiscvLinux64::TGT_SIGEMT
static const int TGT_SIGEMT
Definition: linux.hh:51
RiscvLinux32::TGT_MREMAP_FIXED
static const unsigned TGT_MREMAP_FIXED
Definition: linux.hh:291
RiscvLinux64::TGT_SIGURG
static const int TGT_SIGURG
Definition: linux.hh:60
RiscvLinux64::tgt_sysinfo::uptime
int64_t uptime
Definition: linux.hh:181
RiscvLinux32::TGT_FASYNC
static const int TGT_FASYNC
FASYNC.
Definition: linux.hh:271
RiscvLinux32::TGT_SIGCONT
static const int TGT_SIGCONT
Definition: linux.hh:232
RiscvLinux64::TGT_SIGPROF
static const int TGT_SIGPROF
Definition: linux.hh:73
RiscvLinux64::TGT_SIGKILL
static const int TGT_SIGKILL
Definition: linux.hh:53
RiscvLinux32::tgt_statfs::f_fsid
tgt_fsid_t f_fsid
Definition: linux.hh:345
RiscvLinux64
Definition: linux.hh:41
RiscvLinux64::tgt_sysinfo::pad
uint16_t pad
Definition: linux.hh:190
RiscvLinux64::tgt_sysinfo::freeram
uint64_t freeram
Definition: linux.hh:184
RiscvLinux32::TGT_O_WRONLY
static const int TGT_O_WRONLY
O_WRONLY.
Definition: linux.hh:261
RiscvLinux32::TGT_SIGIOT
static const int TGT_SIGIOT
Definition: linux.hh:219
RiscvLinux64::tgt_stat64::st_nlink
nlink_t st_nlink
Definition: linux.hh:144
RiscvLinux32::tgt_stat::st_nlink
uint32_t st_nlink
Definition: linux.hh:318
RiscvLinux32::TGT_SIGKILL
static const int TGT_SIGKILL
Definition: linux.hh:222
RiscvLinux32
Definition: linux.hh:210
RiscvLinux64::TGT_SIGFPE
static const int TGT_SIGFPE
Definition: linux.hh:52
RiscvLinux64::TGT_O_DIRECT
static const int TGT_O_DIRECT
O_DIRECT.
Definition: linux.hh:105
RiscvLinux64::TGT_O_RDWR
static const int TGT_O_RDWR
O_RDWR.
Definition: linux.hh:91
RiscvLinux32::TGT_MAP_PRIVATE
static const unsigned TGT_MAP_PRIVATE
Definition: linux.hh:287
RiscvLinux32::TGT_SIGXFSZ
static const int TGT_SIGXFSZ
Definition: linux.hh:240
OperatingSystem::tgt_stat
void tgt_stat
Stat buffer.
Definition: operatingsystem.hh:59
RiscvLinux64::off_t
int64_t off_t
Definition: linux.hh:131
RiscvLinux64::tgt_stat64::st_blksize
blksize_t st_blksize
Definition: linux.hh:150
utility.hh
RiscvLinux32::tgt_sysinfo
Definition: linux.hh:352
RiscvLinux64::tgt_sysinfo::sharedram
uint64_t sharedram
Definition: linux.hh:185
RiscvLinux32::TGT_SIGABRT
static const int TGT_SIGABRT
Definition: linux.hh:218
RiscvLinux32::NUM_MMAP_FLAGS
static const unsigned NUM_MMAP_FLAGS
Definition: linux.hh:293
RiscvLinux64::TGT_O_TRUNC
static const int TGT_O_TRUNC
O_TRUNC.
Definition: linux.hh:95
RiscvLinux64::TGT_O_NOFOLLOW
static const int TGT_O_NOFOLLOW
O_NOFOLLOW.
Definition: linux.hh:106
RiscvLinux32::tgt_stat::__pad1
uint64_t __pad1
Definition: linux.hh:322
RiscvLinux32::TGT_O_EXCL
static const int TGT_O_EXCL
O_EXCL.
Definition: linux.hh:264
RiscvLinux32::TGT_O_NOCTTY
static const int TGT_O_NOCTTY
O_NOCTTY.
Definition: linux.hh:265
RiscvLinux32::TGT_SIGCLD
static const int TGT_SIGCLD
Definition: linux.hh:234
RiscvLinux32::tgt_stat::__pad2
int32_t __pad2
Definition: linux.hh:325
RiscvLinux32::TGT_O_NOFOLLOW
static const int TGT_O_NOFOLLOW
O_NOFOLLOW.
Definition: linux.hh:277
RiscvLinux64::TGT_SIGIO
static const int TGT_SIGIO
Definition: linux.hh:69
RiscvLinux32::tgt_sysinfo::mem_unit
uint32_t mem_unit
Definition: linux.hh:365
RiscvLinux64::TGT_SIGSYS
static const int TGT_SIGSYS
Definition: linux.hh:56
RiscvLinux32::tgt_statfs::f_namelen
uint32_t f_namelen
Definition: linux.hh:346
Linux
Definition: threadinfo.hh:35
RiscvLinux64::TGT_O_RDONLY
static const int TGT_O_RDONLY
open(2) flag values.
Definition: linux.hh:89
RiscvLinux32::TGT_SIGPROF
static const int TGT_SIGPROF
Definition: linux.hh:242
RiscvLinux32::rlimit
Limit struct for getrlimit/setrlimit.
Definition: linux.hh:300
RiscvLinux32::tgt_stat::st_uid
uint32_t st_uid
Definition: linux.hh:319
RiscvLinux32::tgt_stat::st_mtimeX
time_t st_mtimeX
Definition: linux.hh:329
RiscvLinux32::tgt_sysinfo::sharedram
uint32_t sharedram
Definition: linux.hh:357
RiscvLinux64::TGT_SIGCHLD
static const int TGT_SIGCHLD
Definition: linux.hh:64
RiscvLinux64::blkcnt_t
uint64_t blkcnt_t
Definition: linux.hh:133
RiscvLinux64::TGT_SIGUSR2
static const int TGT_SIGUSR2
Definition: linux.hh:78
RiscvLinux64::TGT_SIGHUP
static const int TGT_SIGHUP
Definition: linux.hh:44
RiscvLinux32::TGT_SIGIO
static const int TGT_SIGIO
Definition: linux.hh:238
RiscvLinux32::tgt_stat::st_atimeX
time_t st_atimeX
Definition: linux.hh:327
RiscvLinux32::TGT_SIGVTALRM
static const int TGT_SIGVTALRM
Definition: linux.hh:241
RiscvLinux64::TGT_FASYNC
static const int TGT_FASYNC
FASYNC.
Definition: linux.hh:100
RiscvLinux32::tgt_statfs::f_files
uint32_t f_files
Definition: linux.hh:343
RiscvLinux64::timespec::tv_sec
time_t tv_sec
Definition: linux.hh:136
RiscvLinux32::TGT_O_DSYNC
static const int TGT_O_DSYNC
O_DSYNC.
Definition: linux.hh:273
RiscvLinux32::TGT_FSYNC
static const int TGT_FSYNC
FSYNC.
Definition: linux.hh:270
RiscvLinux64::TGT_O_SYNC
static const int TGT_O_SYNC
O_SYNC.
Definition: linux.hh:98
RiscvLinux64::tgt_statfs::f_bavail
uint64_t f_bavail
Definition: linux.hh:170
RiscvLinux64::TGT_SIGPIPE
static const int TGT_SIGPIPE
Definition: linux.hh:57
RiscvLinux32::timespec::tv_sec
time_t tv_sec
Definition: linux.hh:306
RiscvLinux64::TGT_O_APPEND
static const int TGT_O_APPEND
O_APPEND.
Definition: linux.hh:96
RiscvLinux32::tgt_sysinfo::freehigh
uint32_t freehigh
Definition: linux.hh:364
RiscvLinux32::tgt_sysinfo::freeram
uint32_t freeram
Definition: linux.hh:356
RiscvISA::StackPointerReg
const int StackPointerReg
Definition: registers.hh:94
RiscvLinux64::TGT_SIGCLD
static const int TGT_SIGCLD
Definition: linux.hh:65
RiscvLinux32::tgt_sysinfo::pad
uint16_t pad
Definition: linux.hh:362

Generated on Wed Sep 30 2020 14:02:00 for gem5 by doxygen 1.8.17