gem5
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
kern
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
* Authors: Gabe Black
29
*/
30
31
#ifndef __KERN_OPERATINGSYSTEM_HH__
32
#define __KERN_OPERATINGSYSTEM_HH__
33
34
#include "
base/types.hh
"
35
36
#include <string>
37
38
class
Process
;
39
class
ThreadContext
;
40
43
struct
SyscallFlagTransTable
{
44
int
tgtFlag
;
45
int
hostFlag
;
46
};
47
48
54
class
OperatingSystem
{
55
56
public
:
57
61
typedef
void
tgt_stat
;
62
63
// same for stat64
64
typedef
void
tgt_stat64
;
65
67
static
const
int
_SYS_NMLN
= 65;
68
70
typedef
struct
{
71
char
sysname[
_SYS_NMLN
];
72
char
nodename[
_SYS_NMLN
];
73
char
release[
_SYS_NMLN
];
74
char
version[
_SYS_NMLN
];
75
char
machine[
_SYS_NMLN
];
76
}
utsname
;
77
79
typedef
struct
{
80
uint64_t
rlim_cur
;
81
uint64_t
rlim_max
;
82
}
rlimit
;
83
85
typedef
struct
{
86
int64_t
tv_sec
;
87
int64_t
tv_usec
;
88
}
timeval
;
89
90
// For writev/readv
91
typedef
struct
{
92
uint64_t
iov_base
;
// void *
93
uint64_t
iov_len
;
94
}
tgt_iovec
;
95
96
98
typedef
struct
{
99
timeval
ru_utime
;
100
timeval
ru_stime
;
101
int64_t
ru_maxrss
;
102
int64_t
ru_ixrss
;
103
int64_t
ru_idrss
;
104
int64_t
ru_isrss
;
105
int64_t
ru_minflt
;
106
int64_t
ru_majflt
;
107
int64_t
ru_nswap
;
108
int64_t
ru_inblock
;
109
int64_t
ru_oublock
;
110
int64_t
ru_msgsnd
;
111
int64_t
ru_msgrcv
;
112
int64_t
ru_nsignals
;
113
int64_t
ru_nvcsw
;
114
int64_t
ru_nivcsw
;
115
}
rusage
;
116
117
static
int
openSpecialFile
(std::string path,
Process
*process,
118
ThreadContext
*tc);
119
120
};
// class OperatingSystem
121
122
#endif // __OPERATINGSYSTEM_HH__
OperatingSystem::rusage::ru_msgrcv
int64_t ru_msgrcv
messages received
Definition:
operatingsystem.hh:111
OperatingSystem::tgt_iovec::iov_base
uint64_t iov_base
Definition:
operatingsystem.hh:92
OperatingSystem::rlimit
Limit struct for getrlimit/setrlimit.
Definition:
operatingsystem.hh:79
OperatingSystem::rusage::ru_inblock
int64_t ru_inblock
block input operations
Definition:
operatingsystem.hh:108
OperatingSystem
This class encapsulates the types, structures, constants, functions, and syscall-number mappings spec...
Definition:
operatingsystem.hh:54
OperatingSystem::rusage
For getrusage().
Definition:
operatingsystem.hh:98
OperatingSystem::utsname
Interface struct for uname().
Definition:
operatingsystem.hh:70
OperatingSystem::rusage::ru_nsignals
int64_t ru_nsignals
signals received
Definition:
operatingsystem.hh:112
OperatingSystem::rusage::ru_msgsnd
int64_t ru_msgsnd
messages sent
Definition:
operatingsystem.hh:110
OperatingSystem::rusage::ru_ixrss
int64_t ru_ixrss
integral shared memory size
Definition:
operatingsystem.hh:102
OperatingSystem::rusage::ru_majflt
int64_t ru_majflt
page faults
Definition:
operatingsystem.hh:106
OperatingSystem::_SYS_NMLN
static const int _SYS_NMLN
Length of strings in struct utsname (plus 1 for null char).
Definition:
operatingsystem.hh:67
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Definition:
thread_context.hh:93
OperatingSystem::rusage::ru_maxrss
int64_t ru_maxrss
max rss
Definition:
operatingsystem.hh:101
OperatingSystem::timeval
For gettimeofday().
Definition:
operatingsystem.hh:85
OperatingSystem::openSpecialFile
static int openSpecialFile(std::string path, Process *process, ThreadContext *tc)
Definition:
operatingsystem.cc:37
OperatingSystem::rusage::ru_nivcsw
int64_t ru_nivcsw
involuntary "
Definition:
operatingsystem.hh:114
OperatingSystem::rusage::ru_oublock
int64_t ru_oublock
block output operations
Definition:
operatingsystem.hh:109
OperatingSystem::rusage::ru_nswap
int64_t ru_nswap
swaps
Definition:
operatingsystem.hh:107
OperatingSystem::tgt_stat
void tgt_stat
Stat buffer.
Definition:
operatingsystem.hh:61
OperatingSystem::rlimit::rlim_cur
uint64_t rlim_cur
soft limit
Definition:
operatingsystem.hh:80
OperatingSystem::rusage::ru_minflt
int64_t ru_minflt
page reclaims - total vmfaults
Definition:
operatingsystem.hh:105
OperatingSystem::rusage::ru_utime
timeval ru_utime
user time used
Definition:
operatingsystem.hh:99
types.hh
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
OperatingSystem::rusage::ru_nvcsw
int64_t ru_nvcsw
voluntary context switches
Definition:
operatingsystem.hh:113
OperatingSystem::rusage::ru_isrss
int64_t ru_isrss
integral unshared stack "
Definition:
operatingsystem.hh:104
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:43
SyscallFlagTransTable::hostFlag
int hostFlag
Corresponding host system flag value.
Definition:
operatingsystem.hh:45
OperatingSystem::tgt_iovec
Definition:
operatingsystem.hh:91
OperatingSystem::tgt_iovec::iov_len
uint64_t iov_len
Definition:
operatingsystem.hh:93
OperatingSystem::rusage::ru_idrss
int64_t ru_idrss
integral unshared data "
Definition:
operatingsystem.hh:103
OperatingSystem::tgt_stat64
void tgt_stat64
Definition:
operatingsystem.hh:64
OperatingSystem::timeval::tv_sec
int64_t tv_sec
seconds
Definition:
operatingsystem.hh:86
OperatingSystem::rusage::ru_stime
timeval ru_stime
system time used
Definition:
operatingsystem.hh:100
Process
Definition:
process.hh:63
SyscallFlagTransTable::tgtFlag
int tgtFlag
Target system flag value.
Definition:
operatingsystem.hh:44
OperatingSystem::rlimit::rlim_max
uint64_t rlim_max
hard limit
Definition:
operatingsystem.hh:81
OperatingSystem::timeval::tv_usec
int64_t tv_usec
microseconds
Definition:
operatingsystem.hh:87
Generated on Fri Jun 9 2017 13:03:48 for gem5 by
doxygen
1.8.6