linux.hh (11382:654272b82e94) linux.hh (11383:5ac090acd180)
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
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

--- 112 unchanged lines hidden (view full) ---

121 static const int TGT_O_NOFOLLOW = 000400000;
122 static const int TGT_O_NOATIME = 001000000;
123 static const int TGT_O_CLOEXEC = 002000000;
124 static const int TGT_O_SYNC = 004010000; //!< O_SYNC
125 static const int TGT_O_PATH = 010000000;
126
127 static const int NUM_OPEN_FLAGS;
128
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
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

--- 112 unchanged lines hidden (view full) ---

121 static const int TGT_O_NOFOLLOW = 000400000;
122 static const int TGT_O_NOATIME = 001000000;
123 static const int TGT_O_CLOEXEC = 002000000;
124 static const int TGT_O_SYNC = 004010000; //!< O_SYNC
125 static const int TGT_O_PATH = 010000000;
126
127 static const int NUM_OPEN_FLAGS;
128
129 static const unsigned TGT_MAP_ANONYMOUS = 0x20;
130 static const unsigned TGT_MAP_FIXED = 0x10;
129 /// For mmap().
130 static SyscallFlagTransTable mmapFlagTable[];
131
131
132 static const unsigned TGT_MAP_SHARED = 0x00001;
133 static const unsigned TGT_MAP_PRIVATE = 0x00002;
134 static const unsigned TGT_MAP_32BIT = 0x00040;
135 static const unsigned TGT_MAP_ANON = 0x00020;
136 static const unsigned TGT_MAP_DENYWRITE = 0x00800;
137 static const unsigned TGT_MAP_EXECUTABLE = 0x01000;
138 static const unsigned TGT_MAP_FILE = 0x00000;
139 static const unsigned TGT_MAP_GROWSDOWN = 0x00100;
140 static const unsigned TGT_MAP_HUGETLB = 0x40000;
141 static const unsigned TGT_MAP_LOCKED = 0x02000;
142 static const unsigned TGT_MAP_NONBLOCK = 0x10000;
143 static const unsigned TGT_MAP_NORESERVE = 0x04000;
144 static const unsigned TGT_MAP_POPULATE = 0x08000;
145 static const unsigned TGT_MAP_STACK = 0x20000;
146 static const unsigned TGT_MAP_ANONYMOUS = 0x00020;
147 static const unsigned TGT_MAP_FIXED = 0x00010;
148
149 static const unsigned NUM_MMAP_FLAGS;
150
132 typedef struct {
133 uint64_t iov_base; // void *
134 uint64_t iov_len; // size_t
135 } tgt_iovec;
136
137 typedef struct {
138 int64_t uptime; /* Seconds since boot */
139 uint64_t loads[3]; /* 1, 5, and 15 minute load averages */
140 uint64_t totalram; /* Total usable main memory size */
141 uint64_t freeram; /* Available memory size */
142 uint64_t sharedram; /* Amount of shared memory */
143 uint64_t bufferram; /* Memory used by buffers */
144 uint64_t totalswap; /* Total swap space size */
145 uint64_t freeswap; /* swap space still available */
146 uint16_t procs; /* Number of current processes */
147 uint64_t totalhigh; /* Total high memory size */
148 uint64_t freehigh; /* Available high memory size */
149 uint64_t mem_unit; /* Memory unit size in bytes */
151 typedef struct {
152 uint64_t iov_base; // void *
153 uint64_t iov_len; // size_t
154 } tgt_iovec;
155
156 typedef struct {
157 int64_t uptime; /* Seconds since boot */
158 uint64_t loads[3]; /* 1, 5, and 15 minute load averages */
159 uint64_t totalram; /* Total usable main memory size */
160 uint64_t freeram; /* Available memory size */
161 uint64_t sharedram; /* Amount of shared memory */
162 uint64_t bufferram; /* Memory used by buffers */
163 uint64_t totalswap; /* Total swap space size */
164 uint64_t freeswap; /* swap space still available */
165 uint16_t procs; /* Number of current processes */
166 uint64_t totalhigh; /* Total high memory size */
167 uint64_t freehigh; /* Available high memory size */
168 uint64_t mem_unit; /* Memory unit size in bytes */
150 } tgt_sysinfo;
169 } tgt_sysinfo;
151
152};
153
154class X86Linux32 : public Linux
155{
156 public:
157
158 typedef struct {

--- 72 unchanged lines hidden (view full) ---

231 static const int TGT_O_NOFOLLOW = 000400000;
232 static const int TGT_O_NOATIME = 001000000;
233 static const int TGT_O_CLOEXEC = 002000000;
234 static const int TGT_O_SYNC = 004010000; //!< O_SYNC
235 static const int TGT_O_PATH = 010000000;
236
237 static const int NUM_OPEN_FLAGS;
238
170
171};
172
173class X86Linux32 : public Linux
174{
175 public:
176
177 typedef struct {

--- 72 unchanged lines hidden (view full) ---

250 static const int TGT_O_NOFOLLOW = 000400000;
251 static const int TGT_O_NOATIME = 001000000;
252 static const int TGT_O_CLOEXEC = 002000000;
253 static const int TGT_O_SYNC = 004010000; //!< O_SYNC
254 static const int TGT_O_PATH = 010000000;
255
256 static const int NUM_OPEN_FLAGS;
257
239 static const unsigned TGT_MAP_ANONYMOUS = 0x20;
240 static const unsigned TGT_MAP_FIXED = 0x10;
258 static SyscallFlagTransTable mmapFlagTable[];
241
259
260 static const unsigned TGT_MAP_SHARED = 0x00001;
261 static const unsigned TGT_MAP_PRIVATE = 0x00002;
262 static const unsigned TGT_MAP_32BIT = 0x00040;
263 static const unsigned TGT_MAP_ANON = 0x00020;
264 static const unsigned TGT_MAP_DENYWRITE = 0x00800;
265 static const unsigned TGT_MAP_EXECUTABLE = 0x01000;
266 static const unsigned TGT_MAP_FILE = 0x00000;
267 static const unsigned TGT_MAP_GROWSDOWN = 0x00100;
268 static const unsigned TGT_MAP_HUGETLB = 0x40000;
269 static const unsigned TGT_MAP_LOCKED = 0x02000;
270 static const unsigned TGT_MAP_NONBLOCK = 0x10000;
271 static const unsigned TGT_MAP_NORESERVE = 0x04000;
272 static const unsigned TGT_MAP_POPULATE = 0x08000;
273 static const unsigned TGT_MAP_STACK = 0x20000;
274 static const unsigned TGT_MAP_ANONYMOUS = 0x00020;
275 static const unsigned TGT_MAP_FIXED = 0x00010;
276
277 static const unsigned NUM_MMAP_FLAGS;
278
242 typedef struct {
243 int32_t uptime; /* Seconds since boot */
244 uint32_t loads[3]; /* 1, 5, and 15 minute load averages */
245 uint32_t totalram; /* Total usable main memory size */
246 uint32_t freeram; /* Available memory size */
247 uint32_t sharedram; /* Amount of shared memory */
248 uint32_t bufferram; /* Memory used by buffers */
249 uint32_t totalswap; /* Total swap space size */
250 uint32_t freeswap; /* swap space still available */
251 uint16_t procs; /* Number of current processes */
252 uint32_t totalhigh; /* Total high memory size */
253 uint32_t freehigh; /* Available high memory size */
254 uint32_t mem_unit; /* Memory unit size in bytes */
255 } tgt_sysinfo;
256
257 static bool mmapGrowsDown() { return true; }
258};
259
260#endif
279 typedef struct {
280 int32_t uptime; /* Seconds since boot */
281 uint32_t loads[3]; /* 1, 5, and 15 minute load averages */
282 uint32_t totalram; /* Total usable main memory size */
283 uint32_t freeram; /* Available memory size */
284 uint32_t sharedram; /* Amount of shared memory */
285 uint32_t bufferram; /* Memory used by buffers */
286 uint32_t totalswap; /* Total swap space size */
287 uint32_t freeswap; /* swap space still available */
288 uint16_t procs; /* Number of current processes */
289 uint32_t totalhigh; /* Total high memory size */
290 uint32_t freehigh; /* Available high memory size */
291 uint32_t mem_unit; /* Memory unit size in bytes */
292 } tgt_sysinfo;
293
294 static bool mmapGrowsDown() { return true; }
295};
296
297#endif