gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Static Public Member Functions | Static Public Attributes | List of all members
Linux Class Reference

This class encapsulates the types, structures, constants, functions, and syscall-number mappings specific to the Alpha Linux syscall interface. More...

#include <linux.hh>

Inheritance diagram for Linux:
OperatingSystem AlphaLinux ArmLinux32 ArmLinux64 MipsLinux PowerLinux RiscvLinux SparcLinux X86Linux32 X86Linux64

Classes

struct  rlimit
 Limit struct for getrlimit/setrlimit. More...
 
struct  rusage
 
struct  tgt_iovec
 
struct  tgt_stat
 Stat buffer. More...
 
struct  tgt_stat64
 
struct  timespec
 For clock_gettime(). More...
 
struct  timeval
 For gettimeofday(). More...
 
struct  tms
 For times(). More...
 
struct  utsname
 Interface struct for uname(). More...
 

Public Types

typedef uint64_t size_t
 Basic Linux types. More...
 
typedef uint64_t off_t
 
typedef int64_t time_t
 
typedef int64_t clock_t
 
typedef uint32_t uid_t
 
typedef uint32_t gid_t
 
- Public Types inherited from OperatingSystem
typedef void tgt_stat
 Stat buffer. More...
 
typedef void tgt_stat64
 

Static Public Member Functions

static bool isTtyReq (unsigned req)
 Return true for the ioctl codes for which we return ENOTTY without printing a warning, since we know that ENOTTY is the correct thing to return (and not just a sign that we don't recognize the ioctl code. More...
 
static int openSpecialFile (std::string path, Process *process, ThreadContext *tc)
 
static std::string procMeminfo (Process *process, ThreadContext *tc)
 
static std::string etcPasswd (Process *process, ThreadContext *tc)
 
- Static Public Member Functions inherited from OperatingSystem
static int openSpecialFile (std::string path, Process *process, ThreadContext *tc)
 

Static Public Attributes

static const int _SYS_NMLN = 65
 Length of strings in struct utsname (plus 1 for null char). More...
 
static const int M5_SC_CLK_TCK = 100
 Clock ticks per second, for times(). More...
 
static const unsigned TGT_RLIMIT_CPU = 0
 Resource constants for getrlimit(). More...
 
static const unsigned TGT_RLIMIT_FSIZE = 1
 
static const unsigned TGT_RLIMIT_DATA = 2
 
static const unsigned TGT_RLIMIT_STACK = 3
 
static const unsigned TGT_RLIMIT_CORE = 4
 
static const unsigned TGT_RLIMIT_RSS = 5
 
static const unsigned TGT_RLIMIT_NPROC = 6
 
static const unsigned TGT_RLIMIT_NOFILE = 7
 
static const unsigned TGT_RLIMIT_MEMLOCK = 8
 
static const unsigned TGT_RLIMIT_AS = 9
 
static const unsigned TGT_RLIMIT_LOCKS = 10
 
static const unsigned TGT_RLIMIT_SIGPENDING = 11
 
static const unsigned TGT_RLIMIT_MSGQUEUE = 12
 
static const unsigned TGT_RLIMIT_NICE = 13
 
static const unsigned TGT_RLIMIT_RTPRIO = 14
 
static const unsigned TGT_RLIMIT_RTTIME = 15
 
static const unsigned TGT_RLIM_NLIMITS = 16
 
static const int TGT_RUSAGE_SELF = 0
 For getrusage(). More...
 
static const int TGT_RUSAGE_CHILDREN = -1
 
static const int TGT_RUSAGE_BOTH = -2
 
static const unsigned TGT_FUTEX_WAIT = 0
 
static const unsigned TGT_FUTEX_WAKE = 1
 
static const unsigned TGT_EAGAIN = 11
 
static const unsigned TGT_EWOULDBLOCK = TGT_EAGAIN
 
static const unsigned TGT_FUTEX_PRIVATE_FLAG = 128
 
static const int TGT_AT_FDCWD = -100
 
static const unsigned TGT_MREMAP_MAYMOVE = 0x1
 
static const unsigned TGT_MREMAP_FIXED = 0x2
 
static const unsigned TGT_CLONE_VM = 0x00000100
 
static const unsigned TGT_CLONE_FS = 0x00000200
 
static const unsigned TGT_CLONE_FILES = 0x00000400
 
static const unsigned TGT_CLONE_SIGHAND = 0x00000800
 
static const unsigned TGT_CLONE_PTRACE = 0x00002000
 
static const unsigned TGT_CLONE_VFORK = 0x00004000
 
static const unsigned TGT_CLONE_PARENT = 0x00008000
 
static const unsigned TGT_CLONE_THREAD = 0x00010000
 
static const unsigned TGT_CLONE_NEWNS = 0x00020000
 
static const unsigned TGT_CLONE_SYSVSEM = 0x00040000
 
static const unsigned TGT_CLONE_SETTLS = 0x00080000
 
static const unsigned TGT_CLONE_PARENT_SETTID = 0x00100000
 
static const unsigned TGT_CLONE_CHILD_CLEARTID = 0x00200000
 
static const unsigned TGT_CLONE_DETACHED = 0x00400000
 
static const unsigned TGT_CLONE_UNTRACED = 0x00800000
 
static const unsigned TGT_CLONE_CHILD_SETTID = 0x01000000
 
static const unsigned TGT_CLONE_NEWUTS = 0x04000000
 
static const unsigned TGT_CLONE_NEWIPC = 0x08000000
 
static const unsigned TGT_CLONE_NEWUSER = 0x10000000
 
static const unsigned TGT_CLONE_NEWPID = 0x20000000
 
static const unsigned TGT_CLONE_NEWNET = 0x40000000
 
static const unsigned TGT_CLONE_IO = 0x80000000
 
static const unsigned TGT_TCGETS = 0x5401
 ioctl() command codes. More...
 
static const unsigned TGT_TCGETA = 0x5405
 
static const unsigned TGT_TCSETAW = 0x5407
 
static const unsigned TGT_FIONREAD = 0x541B
 
- Static Public Attributes inherited from OperatingSystem
static const int _SYS_NMLN = 65
 Length of strings in struct utsname (plus 1 for null char). More...
 

Detailed Description

This class encapsulates the types, structures, constants, functions, and syscall-number mappings specific to the Alpha Linux syscall interface.

Definition at line 48 of file linux.hh.

Member Typedef Documentation

typedef int64_t Linux::clock_t

Definition at line 58 of file linux.hh.

typedef uint32_t Linux::gid_t

Definition at line 60 of file linux.hh.

typedef uint64_t Linux::off_t

Definition at line 56 of file linux.hh.

typedef uint64_t Linux::size_t

Basic Linux types.

Definition at line 55 of file linux.hh.

typedef int64_t Linux::time_t

Definition at line 57 of file linux.hh.

typedef uint32_t Linux::uid_t

Definition at line 59 of file linux.hh.

Member Function Documentation

std::string Linux::etcPasswd ( Process process,
ThreadContext tc 
)
static

Definition at line 85 of file linux.cc.

References csprintf(), and Process::getcwd().

Referenced by openSpecialFile().

static bool Linux::isTtyReq ( unsigned  req)
inlinestatic

Return true for the ioctl codes for which we return ENOTTY without printing a warning, since we know that ENOTTY is the correct thing to return (and not just a sign that we don't recognize the ioctl code.

Definition at line 169 of file linux.hh.

References TGT_FIONREAD, TGT_TCGETA, TGT_TCGETS, and TGT_TCSETAW.

int Linux::openSpecialFile ( std::string  path,
Process process,
ThreadContext tc 
)
static
std::string Linux::procMeminfo ( Process process,
ThreadContext tc 
)
static

Definition at line 77 of file linux.cc.

References csprintf(), System::freeMemSize(), System::memSize(), and Process::system.

Referenced by openSpecialFile().

Member Data Documentation

const int Linux::_SYS_NMLN = 65
static

Length of strings in struct utsname (plus 1 for null char).

Definition at line 110 of file linux.hh.

const int Linux::M5_SC_CLK_TCK = 100
static

Clock ticks per second, for times().

Definition at line 140 of file linux.hh.

const int Linux::TGT_AT_FDCWD = -100
static

Definition at line 239 of file linux.hh.

const unsigned Linux::TGT_CLONE_CHILD_CLEARTID = 0x00200000
static

Definition at line 257 of file linux.hh.

const unsigned Linux::TGT_CLONE_CHILD_SETTID = 0x01000000
static

Definition at line 260 of file linux.hh.

const unsigned Linux::TGT_CLONE_DETACHED = 0x00400000
static

Definition at line 258 of file linux.hh.

const unsigned Linux::TGT_CLONE_FILES = 0x00000400
static

Definition at line 247 of file linux.hh.

const unsigned Linux::TGT_CLONE_FS = 0x00000200
static

Definition at line 246 of file linux.hh.

const unsigned Linux::TGT_CLONE_IO = 0x80000000
static

Definition at line 266 of file linux.hh.

const unsigned Linux::TGT_CLONE_NEWIPC = 0x08000000
static

Definition at line 262 of file linux.hh.

const unsigned Linux::TGT_CLONE_NEWNET = 0x40000000
static

Definition at line 265 of file linux.hh.

const unsigned Linux::TGT_CLONE_NEWNS = 0x00020000
static

Definition at line 253 of file linux.hh.

const unsigned Linux::TGT_CLONE_NEWPID = 0x20000000
static

Definition at line 264 of file linux.hh.

const unsigned Linux::TGT_CLONE_NEWUSER = 0x10000000
static

Definition at line 263 of file linux.hh.

const unsigned Linux::TGT_CLONE_NEWUTS = 0x04000000
static

Definition at line 261 of file linux.hh.

const unsigned Linux::TGT_CLONE_PARENT = 0x00008000
static

Definition at line 251 of file linux.hh.

const unsigned Linux::TGT_CLONE_PARENT_SETTID = 0x00100000
static

Definition at line 256 of file linux.hh.

const unsigned Linux::TGT_CLONE_PTRACE = 0x00002000
static

Definition at line 249 of file linux.hh.

const unsigned Linux::TGT_CLONE_SETTLS = 0x00080000
static

Definition at line 255 of file linux.hh.

const unsigned Linux::TGT_CLONE_SIGHAND = 0x00000800
static

Definition at line 248 of file linux.hh.

const unsigned Linux::TGT_CLONE_SYSVSEM = 0x00040000
static

Definition at line 254 of file linux.hh.

const unsigned Linux::TGT_CLONE_THREAD = 0x00010000
static

Definition at line 252 of file linux.hh.

const unsigned Linux::TGT_CLONE_UNTRACED = 0x00800000
static

Definition at line 259 of file linux.hh.

const unsigned Linux::TGT_CLONE_VFORK = 0x00004000
static

Definition at line 250 of file linux.hh.

const unsigned Linux::TGT_CLONE_VM = 0x00000100
static

Definition at line 245 of file linux.hh.

const unsigned Linux::TGT_EAGAIN = 11
static

Definition at line 234 of file linux.hh.

const unsigned Linux::TGT_EWOULDBLOCK = TGT_EAGAIN
static

Definition at line 235 of file linux.hh.

const unsigned Linux::TGT_FIONREAD = 0x541B
static

Definition at line 161 of file linux.hh.

Referenced by isTtyReq().

const unsigned Linux::TGT_FUTEX_PRIVATE_FLAG = 128
static

Definition at line 236 of file linux.hh.

const unsigned Linux::TGT_FUTEX_WAIT = 0
static

Definition at line 232 of file linux.hh.

const unsigned Linux::TGT_FUTEX_WAKE = 1
static

Definition at line 233 of file linux.hh.

const unsigned Linux::TGT_MREMAP_FIXED = 0x2
static

Definition at line 243 of file linux.hh.

const unsigned Linux::TGT_MREMAP_MAYMOVE = 0x1
static

Definition at line 242 of file linux.hh.

const unsigned Linux::TGT_RLIM_NLIMITS = 16
static

Definition at line 200 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_AS = 9
static

Definition at line 193 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_CORE = 4
static

Definition at line 188 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_CPU = 0
static

Resource constants for getrlimit().

Definition at line 184 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_DATA = 2
static

Definition at line 186 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_FSIZE = 1
static

Definition at line 185 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_LOCKS = 10
static

Definition at line 194 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_MEMLOCK = 8
static

Definition at line 192 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_MSGQUEUE = 12
static

Definition at line 196 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_NICE = 13
static

Definition at line 197 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_NOFILE = 7
static

Definition at line 191 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_NPROC = 6
static

Definition at line 190 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_RSS = 5
static

Definition at line 189 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_RTPRIO = 14
static

Definition at line 198 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_RTTIME = 15
static

Definition at line 199 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_SIGPENDING = 11
static

Definition at line 195 of file linux.hh.

const unsigned Linux::TGT_RLIMIT_STACK = 3
static

Definition at line 187 of file linux.hh.

const int Linux::TGT_RUSAGE_BOTH = -2
static

Definition at line 205 of file linux.hh.

const int Linux::TGT_RUSAGE_CHILDREN = -1
static

Definition at line 204 of file linux.hh.

const int Linux::TGT_RUSAGE_SELF = 0
static

For getrusage().

Definition at line 203 of file linux.hh.

const unsigned Linux::TGT_TCGETA = 0x5405
static

Definition at line 159 of file linux.hh.

Referenced by isTtyReq().

const unsigned Linux::TGT_TCGETS = 0x5401
static

ioctl() command codes.

Definition at line 158 of file linux.hh.

Referenced by isTtyReq().

const unsigned Linux::TGT_TCSETAW = 0x5407
static

Definition at line 160 of file linux.hh.

Referenced by isTtyReq().


The documentation for this class was generated from the following files:

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