gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  * Authors: Korey Sewell
29  */
30 
31 #ifndef __ARCH_RISCV_LINUX_LINUX_HH__
32 #define __ARCH_RISCV_LINUX_LINUX_HH__
33 
34 #include "kern/linux/linux.hh"
35 
36 class RiscvLinux : public Linux
37 {
38  public:
39  static const int TGT_SIGHUP = 1;
40  static const int TGT_SIGINT = 2;
41  static const int TGT_SIGQUIT = 3;
42  static const int TGT_SIGILL = 4;
43  static const int TGT_SIGTRAP = 5;
44  static const int TGT_SIGABRT = 6;
45  static const int TGT_SIGIOT = 6;
46  static const int TGT_SIGEMT = 7;
47  static const int TGT_SIGFPE = 8;
48  static const int TGT_SIGKILL = 9;
49  static const int TGT_SIGBUS = 10;
50  static const int TGT_SIGSEGV = 11;
51  static const int TGT_SIGSYS = 12;
52  static const int TGT_SIGPIPE = 13;
53  static const int TGT_SIGALRM = 14;
54  static const int TGT_SIGTERM = 15;
55  static const int TGT_SIGURG = 16;
56  static const int TGT_SIGSTOP = 17;
57  static const int TGT_SIGTSTP = 18;
58  static const int TGT_SIGCONT = 19;
59  static const int TGT_SIGCHLD = 20;
60  static const int TGT_SIGCLD = 20;
61  static const int TGT_SIGTTIN = 21;
62  static const int TGT_SIGTTOU = 22;
63  static const int TGT_SIGPOLL = 23;
64  static const int TGT_SIGIO = 23;
65  static const int TGT_SIGXCPU = 24;
66  static const int TGT_SIGXFSZ = 25;
67  static const int TGT_SIGVTALRM = 26;
68  static const int TGT_SIGPROF = 27;
69  static const int TGT_SIGWINCH = 28;
70  static const int TGT_SIGLOST = 29;
71  static const int TGT_SIGPWR = 29;
72  static const int TGT_SIGUSR1 = 30;
73  static const int TGT_SIGUSR2 = 31;
74 
78 
80  static const int NUM_OPEN_FLAGS;
81 
83  static const int TGT_O_RDONLY = 0x000000;
85  static const int TGT_O_WRONLY = 0x000001;
86  static const int TGT_O_RDWR = 0x000002;
87  static const int TGT_O_CREAT = 0x000040;
88  static const int TGT_O_EXCL = 0x000080;
89  static const int TGT_O_NOCTTY = 0x000100;
90  static const int TGT_O_TRUNC = 0x000200;
91  static const int TGT_O_APPEND = 0x000400;
92  static const int TGT_O_NONBLOCK = 0x000800;
93  static const int TGT_O_SYNC = 0x001000;
94  static const int TGT_FSYNC = 0x001000;
95  static const int TGT_FASYNC = 0x008000;
96  // The following are not present in riscv64-unknown-elf <fcntl.h>
97  static const int TGT_O_DSYNC = 0x010000;
98  static const int TGT_O_CLOEXEC = 0x040000;
99  static const int TGT_O_NOINHERIT = 0x040000;
100  static const int TGT_O_DIRECT = 0x080000;
101  static const int TGT_O_NOFOLLOW = 0x100000;
102  static const int TGT_O_DIRECTORY = 0x200000;
103  // The following are not defined by riscv64-unknown-elf
104  static const int TGT_O_LARGEFILE = 0x020000;
105  static const int TGT_O_NOATIME = 0x800000;
106  static const int TGT_O_PATH = 0x400000;
107 
108 
109  // Only defined in riscv-unknown-elf for proxy kernel and not linux kernel
110  static const unsigned TGT_MAP_SHARED = 0x0001;
111  static const unsigned TGT_MAP_PRIVATE = 0x0002;
112  static const unsigned TGT_MAP_FIXED = 0x0010;
113  static const unsigned TGT_MAP_ANONYMOUS = 0x0020;
114  static const unsigned TGT_MAP_POPULATE = 0x1000;
115  static const unsigned TGT_MREMAP_FIXED = 0x0020;
116 
117  static const unsigned NUM_MMAP_FLAGS;
118 
119  typedef int64_t time_t;
120  typedef uint64_t dev_t;
121  typedef uint64_t ino_t;
122  typedef uint32_t mode_t;
123  typedef uint32_t nlink_t;
124  typedef uint32_t uid_t;
125  typedef uint32_t gid_t;
126  typedef int64_t off_t;
127  typedef uint64_t blksize_t;
128  typedef uint64_t blkcnt_t;
129 
130  struct timespec {
132  int64_t tv_nsec;
133  };
134 
135  typedef struct {
147  uint64_t st_atimeX;
148  uint64_t st_atime_nsec;
149  uint64_t st_mtimeX;
150  uint64_t st_mtime_nsec;
151  uint64_t st_ctimeX;
152  uint64_t st_ctime_nsec;
153  int32_t ___glibc_reserved[2];
154  } tgt_stat64;
155 };
156 
157 #endif
static const int TGT_SIGPIPE
Definition: linux.hh:52
static const unsigned TGT_MAP_ANONYMOUS
Definition: linux.hh:113
static const int TGT_SIGQUIT
Definition: linux.hh:41
uint64_t ino_t
Definition: linux.hh:121
static const int TGT_SIGPROF
Definition: linux.hh:68
static const int TGT_O_WRONLY
O_WRONLY.
Definition: linux.hh:85
static const int TGT_O_NOATIME
O_NOATIME.
Definition: linux.hh:105
static const int TGT_SIGUSR1
Definition: linux.hh:72
static const int TGT_SIGCLD
Definition: linux.hh:60
static const int TGT_SIGPWR
Definition: linux.hh:71
uint32_t gid_t
Definition: linux.hh:125
static const int TGT_O_NOFOLLOW
O_NOFOLLOW.
Definition: linux.hh:101
static const int NUM_OPEN_FLAGS
Number of entries in openFlagTable[].
Definition: linux.hh:80
uint64_t st_ctimeX
Definition: linux.hh:151
static const int TGT_O_TRUNC
O_TRUNC.
Definition: linux.hh:90
static const int TGT_SIGURG
Definition: linux.hh:55
static const int TGT_SIGTSTP
Definition: linux.hh:57
static const int TGT_O_DIRECTORY
O_DIRECTORY.
Definition: linux.hh:102
uint64_t st_mtimeX
Definition: linux.hh:149
static const int TGT_SIGBUS
Definition: linux.hh:49
uint64_t blksize_t
Definition: linux.hh:127
static const int TGT_SIGUSR2
Definition: linux.hh:73
uint32_t uid_t
Definition: linux.hh:124
static const int TGT_SIGLOST
Definition: linux.hh:70
uint64_t st_atime_nsec
Definition: linux.hh:148
static const int TGT_O_NOINHERIT
O_NOINHERIT.
Definition: linux.hh:99
static const int TGT_SIGSTOP
Definition: linux.hh:56
static const int TGT_O_RDWR
O_RDWR.
Definition: linux.hh:86
static const int TGT_SIGTTIN
Definition: linux.hh:61
static const int TGT_O_CREAT
O_CREAT.
Definition: linux.hh:87
static const int TGT_O_CLOEXEC
O_CLOEXEC.
Definition: linux.hh:98
static const int TGT_SIGSEGV
Definition: linux.hh:50
static const int TGT_SIGABRT
Definition: linux.hh:44
static const int TGT_SIGTTOU
Definition: linux.hh:62
static const int TGT_SIGTRAP
Definition: linux.hh:43
static const int TGT_SIGTERM
Definition: linux.hh:54
static const int TGT_SIGIOT
Definition: linux.hh:45
static const int TGT_O_APPEND
O_APPEND.
Definition: linux.hh:91
static const int TGT_SIGPOLL
Definition: linux.hh:63
static const int TGT_FASYNC
FASYNC.
Definition: linux.hh:95
static const int TGT_SIGHUP
Definition: linux.hh:39
static const int TGT_SIGALRM
Definition: linux.hh:53
int64_t off_t
Definition: linux.hh:126
static const int TGT_O_RDONLY
open(2) flag values.
Definition: linux.hh:84
blkcnt_t st_blocks
Definition: linux.hh:146
This class encapsulates the types, structures, constants, functions, and syscall-number mappings spec...
Definition: linux.hh:48
static const int TGT_SIGWINCH
Definition: linux.hh:69
static const int TGT_SIGCONT
Definition: linux.hh:58
uint64_t st_ctime_nsec
Definition: linux.hh:152
uint64_t dev_t
Definition: linux.hh:120
static const int TGT_O_LARGEFILE
O_LARGEFILE.
Definition: linux.hh:104
uint64_t st_mtime_nsec
Definition: linux.hh:150
static const int TGT_O_PATH
O_PATH.
Definition: linux.hh:106
static const unsigned TGT_MREMAP_FIXED
Definition: linux.hh:115
static const int TGT_SIGINT
Definition: linux.hh:40
uint32_t nlink_t
Definition: linux.hh:123
static const int TGT_O_EXCL
O_EXCL.
Definition: linux.hh:88
static const unsigned TGT_MAP_FIXED
Definition: linux.hh:112
This struct is used to build target-OS-dependent tables that map the target's flags to the host's fla...
int64_t time_t
Definition: linux.hh:119
uint32_t mode_t
Definition: linux.hh:122
static const int TGT_SIGFPE
Definition: linux.hh:47
static const int TGT_SIGXFSZ
Definition: linux.hh:66
static const int TGT_SIGKILL
Definition: linux.hh:48
static SyscallFlagTransTable openFlagTable[]
This table maps the target open() flags to the corresponding host open() flags.
Definition: linux.hh:77
static const int TGT_SIGILL
Definition: linux.hh:42
static const unsigned TGT_MAP_POPULATE
Definition: linux.hh:114
static const unsigned TGT_MAP_PRIVATE
Definition: linux.hh:111
static const int TGT_O_DSYNC
O_DSYNC.
Definition: linux.hh:97
static const int TGT_SIGXCPU
Definition: linux.hh:65
uint64_t st_atimeX
Definition: linux.hh:147
static const int TGT_SIGCHLD
Definition: linux.hh:59
static const int TGT_SIGEMT
Definition: linux.hh:46
static const int TGT_SIGIO
Definition: linux.hh:64
blksize_t st_blksize
Definition: linux.hh:145
static const int TGT_O_NOCTTY
O_NOCTTY.
Definition: linux.hh:89
static const int TGT_SIGVTALRM
Definition: linux.hh:67
static const int TGT_O_SYNC
O_SYNC.
Definition: linux.hh:93
uint64_t blkcnt_t
Definition: linux.hh:128
static const unsigned NUM_MMAP_FLAGS
Definition: linux.hh:117
static const int TGT_O_DIRECT
O_DIRECT.
Definition: linux.hh:100
static const int TGT_SIGSYS
Definition: linux.hh:51
static const unsigned TGT_MAP_SHARED
Definition: linux.hh:110
static const int TGT_FSYNC
FSYNC.
Definition: linux.hh:94
static const int TGT_O_NONBLOCK
O_NONBLOCK.
Definition: linux.hh:92

Generated on Fri Jun 9 2017 13:03:35 for gem5 by doxygen 1.8.6