gem5  v22.1.0.0
solaris.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 Arm Limited
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
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Copyright (c) 2004-2005 The Regents of The University of Michigan
15  * All rights reserved.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions are
19  * met: redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer;
21  * redistributions in binary form must reproduce the above copyright
22  * notice, this list of conditions and the following disclaimer in the
23  * documentation and/or other materials provided with the distribution;
24  * neither the name of the copyright holders nor the names of its
25  * contributors may be used to endorse or promote products derived from
26  * this software without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  */
40 
41 #ifndef __SOLARIS_HH__
42 #define __SOLARIS_HH__
43 
44 #include "base/types.hh"
45 #include "kern/operatingsystem.hh"
46 
47 namespace gem5
48 {
49 
55 class Solaris : public OperatingSystem
56 {
57 
58  public:
59 
61  typedef uint64_t size_t;
63  typedef uint64_t off_t;
64  typedef int64_t time_t;
65  typedef int32_t uid_t;
66  typedef int32_t gid_t;
67  typedef uint64_t rlim_t;
68  typedef uint64_t ino_t;
69  typedef uint64_t dev_t;
70  typedef uint32_t mode_t;
71  typedef uint32_t nlink_t;
73 
74  struct tgt_timespec
75  {
76  int64_t tv_sec;
77  int64_t tv_nsec;
78  };
79 
82  struct tgt_stat
83  {
84  uint64_t st_dev;
85  uint64_t st_ino;
86  uint32_t st_mode;
87  uint32_t st_nlink;
88  int32_t st_uid;
89  int32_t st_gid;
90  uint64_t st_rdev;
91  int64_t st_size;
92  //struct tgt_timespec st_atimeX; //!< time of last access
93  //struct tgt_timespec st_mtimeX; //!< time of last modification
94  //struct tgt_timespec st_ctimeX; //!< time of last status change
96  int32_t st_blksize;
97  int64_t st_blocks;
98  char st_fstype[16];
99  };
100 
101  // same for stat64
102  struct tgt_stat64
103  {
104  uint64_t st_dev;
105  uint64_t st_ino;
106  uint32_t st_mode;
107  uint32_t st_nlink;
108  int32_t st_uid;
109  int32_t st_gid;
110  uint64_t st_rdev;
111  int64_t st_size;
112  //struct tgt_timespec st_atimeX; //!< time of last access
113  //struct tgt_timespec st_mtimeX; //!< time of last modification
114  //struct tgt_timespec st_ctimeX; //!< time of last status change
116  int32_t st_blksize;
117  int64_t st_blocks;
118  char st_fstype[16];
119  };
120 
122  static const int _SYS_NMLN = 257;
123 
125  struct utsname
126  {
132  };
133 
134  // for *at syscalls
135  static const int TGT_AT_FDCWD = -100;
136  static const int TGT_AT_REMOVEDIR = 0x800;
137 
138 }; // class Solaris
139 
140 } // namespace gem5
141 
142 #endif // __SOLARIS_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...
This class encapsulates the types, structures, constants, functions, and syscall-number mappings spec...
Definition: solaris.hh:56
uint64_t size_t
Basic Solaris types.
Definition: solaris.hh:62
int32_t uid_t
Definition: solaris.hh:65
uint64_t rlim_t
Definition: solaris.hh:67
static const int _SYS_NMLN
Length of strings in struct utsname (plus 1 for null char).
Definition: solaris.hh:122
uint32_t nlink_t
Definition: solaris.hh:71
uint64_t off_t
Definition: solaris.hh:63
static const int TGT_AT_REMOVEDIR
Definition: solaris.hh:136
uint64_t dev_t
Definition: solaris.hh:69
int64_t time_t
Definition: solaris.hh:64
uint64_t ino_t
Definition: solaris.hh:68
static const int TGT_AT_FDCWD
Definition: solaris.hh:135
int32_t gid_t
Definition: solaris.hh:66
uint32_t mode_t
Definition: solaris.hh:70
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
int32_t st_uid
owner's user ID
Definition: solaris.hh:108
uint32_t st_mode
mode
Definition: solaris.hh:106
int64_t st_size
file size in bytes
Definition: solaris.hh:111
uint64_t st_dev
device
Definition: solaris.hh:104
int32_t st_blksize
optimal I/O block size
Definition: solaris.hh:116
uint32_t st_nlink
link count
Definition: solaris.hh:107
uint64_t st_rdev
device number
Definition: solaris.hh:110
int64_t st_blocks
number of blocks allocated
Definition: solaris.hh:117
int32_t st_gid
owner's group ID
Definition: solaris.hh:109
uint64_t st_ino
inode
Definition: solaris.hh:105
Stat buffer.
Definition: solaris.hh:83
uint64_t st_ino
inode
Definition: solaris.hh:85
int64_t st_size
file size in bytes
Definition: solaris.hh:91
int64_t st_blocks
number of blocks allocated
Definition: solaris.hh:97
int32_t st_uid
owner's user ID
Definition: solaris.hh:88
uint32_t st_mode
mode
Definition: solaris.hh:86
int32_t st_blksize
optimal I/O block size
Definition: solaris.hh:96
int32_t st_gid
owner's group ID
Definition: solaris.hh:89
uint32_t st_nlink
link count
Definition: solaris.hh:87
uint64_t st_rdev
device number
Definition: solaris.hh:90
uint64_t st_dev
device
Definition: solaris.hh:84
Interface struct for uname().
Definition: solaris.hh:126
char machine[_SYS_NMLN]
Machine type.
Definition: solaris.hh:131
char release[_SYS_NMLN]
OS release.
Definition: solaris.hh:129
char sysname[_SYS_NMLN]
System name.
Definition: solaris.hh:127
char nodename[_SYS_NMLN]
Node name.
Definition: solaris.hh:128
char version[_SYS_NMLN]
OS version.
Definition: solaris.hh:130

Generated on Wed Dec 21 2022 10:22:27 for gem5 by doxygen 1.9.1