gem5  v20.0.0.3
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 
36 class Process;
37 class ThreadContext;
38 
42  int tgtFlag;
43  int hostFlag;
44 };
45 
46 
53 
54  public:
55 
59  typedef void tgt_stat;
60 
61  // same for stat64
62  typedef void tgt_stat64;
63 
65  static const int _SYS_NMLN = 65;
66 
68  typedef struct {
69  char sysname[_SYS_NMLN];
70  char nodename[_SYS_NMLN];
71  char release[_SYS_NMLN];
72  char version[_SYS_NMLN];
73  char machine[_SYS_NMLN];
74  } utsname;
75 
77  typedef struct {
78  uint64_t rlim_cur;
79  uint64_t rlim_max;
80  } rlimit;
81 
83  typedef struct {
84  int64_t tv_sec;
85  int64_t tv_usec;
86  } timeval;
87 
88  // For writev/readv
89  typedef struct {
90  uint64_t iov_base; // void *
91  uint64_t iov_len;
92  } tgt_iovec;
93 
94 
96  typedef struct {
99  int64_t ru_maxrss;
100  int64_t ru_ixrss;
101  int64_t ru_idrss;
102  int64_t ru_isrss;
103  int64_t ru_minflt;
104  int64_t ru_majflt;
105  int64_t ru_nswap;
106  int64_t ru_inblock;
107  int64_t ru_oublock;
108  int64_t ru_msgsnd;
109  int64_t ru_msgrcv;
110  int64_t ru_nsignals;
111  int64_t ru_nvcsw;
112  int64_t ru_nivcsw;
113  } rusage;
114 
115  static int openSpecialFile(std::string path, Process *process,
116  ThreadContext *tc);
117 
118 }; // class OperatingSystem
119 
120 #endif // __OPERATINGSYSTEM_HH__
int64_t ru_msgrcv
messages received
Limit struct for getrlimit/setrlimit.
int64_t ru_inblock
block input operations
This class encapsulates the types, structures, constants, functions, and syscall-number mappings spec...
Interface struct for uname().
int64_t ru_nsignals
signals received
int64_t ru_msgsnd
messages sent
int64_t ru_ixrss
integral shared memory size
int64_t ru_majflt
page faults
ThreadContext is the external interface to all thread state for anything outside of the CPU...
int64_t ru_maxrss
max rss
For gettimeofday().
int64_t ru_nivcsw
involuntary "
int64_t ru_oublock
block output operations
void tgt_stat
Stat buffer.
uint64_t rlim_cur
soft limit
int64_t ru_minflt
page reclaims - total vmfaults
timeval ru_utime
user time used
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
int64_t ru_nvcsw
voluntary context switches
int64_t ru_isrss
integral unshared stack "
This struct is used to build target-OS-dependent tables that map the target&#39;s flags to the host&#39;s fla...
int hostFlag
Corresponding host system flag value.
int64_t ru_idrss
integral unshared data "
timeval ru_stime
system time used
int tgtFlag
Target system flag value.
uint64_t rlim_max
hard limit
int64_t tv_usec
microseconds

Generated on Fri Jul 3 2020 15:53:03 for gem5 by doxygen 1.8.13