gem5 v24.0.0.0
Loading...
Searching...
No Matches
operatingsystem.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2004-2005 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 __KERN_OPERATINGSYSTEM_HH__
30#define __KERN_OPERATINGSYSTEM_HH__
31
32#include "base/types.hh"
33
34#include <string>
35
36namespace gem5
37{
38
39class Process;
40class ThreadContext;
41
48{
49
50 public:
51
55 typedef void tgt_stat;
56
57 // same for stat64
58 typedef void tgt_stat64;
59
61 static const int _SYS_NMLN = 65;
62
72
74 struct rlimit
75 {
76 uint64_t rlim_cur;
77 uint64_t rlim_max;
78 };
79
81 struct timeval
82 {
83 int64_t tv_sec;
84 int64_t tv_usec;
85 };
86
87 // For writev/readv
88 struct tgt_iovec
89 {
90 uint64_t iov_base; // void *
91 uint64_t iov_len;
92 };
93
94
96 struct rusage
97 {
100 int64_t ru_maxrss;
101 int64_t ru_ixrss;
102 int64_t ru_idrss;
103 int64_t ru_isrss;
104 int64_t ru_minflt;
105 int64_t ru_majflt;
106 int64_t ru_nswap;
107 int64_t ru_inblock;
108 int64_t ru_oublock;
109 int64_t ru_msgsnd;
110 int64_t ru_msgrcv;
111 int64_t ru_nsignals;
112 int64_t ru_nvcsw;
113 int64_t ru_nivcsw;
114 };
115
116 static int openSpecialFile(std::string path, Process *process,
117 ThreadContext *tc);
118
119}; // class OperatingSystem
120
121} // namespace gem5
122
123#endif // __OPERATINGSYSTEM_HH__
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
This class encapsulates the types, structures, constants, functions, and syscall-number mappings spec...
static int openSpecialFile(std::string path, Process *process, ThreadContext *tc)
void tgt_stat
Stat buffer.
static const int _SYS_NMLN
Length of strings in struct utsname (plus 1 for null char).
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
Limit struct for getrlimit/setrlimit.
int64_t ru_minflt
page reclaims - total vmfaults
int64_t ru_isrss
integral unshared stack "
int64_t ru_oublock
block output operations
int64_t ru_msgrcv
messages received
timeval ru_stime
system time used
int64_t ru_nsignals
signals received
int64_t ru_idrss
integral unshared data "
int64_t ru_nvcsw
voluntary context switches
int64_t ru_inblock
block input operations
timeval ru_utime
user time used
int64_t ru_ixrss
integral shared memory size
Interface struct for uname().
char machine[_SYS_NMLN]
Machine type.
char nodename[_SYS_NMLN]
Node name.
char version[_SYS_NMLN]
OS version.
char sysname[_SYS_NMLN]
System name.
char release[_SYS_NMLN]
OS release.

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