gem5  v21.1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
aux_vector.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Advanced Micro Devices, Inc.
3  * All rights reserved.
4  *
5  * For use for simulation and test purposes only
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice,
11  * this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  *
17  * 3. Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived from this
19  * software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef __AUX_VECTOR_HH__
35 #define __AUX_VECTOR_HH__
36 
37 #include "base/compiler.hh"
38 
39 namespace gem5
40 {
41 
42 namespace auxv {
43 
44 template<class IntType>
45 class AuxVector
46 {
47  public:
48  AuxVector() = default;
49  AuxVector(IntType _type, IntType _val) : type(_type), val(_val) {}
50 
51  IntType type = 0;
52  IntType val = 0;
53 };
54 
55 // Ensure the global versions of swap_byte are visible.
56 using gem5::swap_byte;
57 
58 // Define swap_byte in this namespace, so argument dependent resolution can
59 // find it.
60 template <class IntType>
61 inline AuxVector<IntType>
63 {
65 }
66 
67 enum Type
68 {
69  Null = 0, // End of vector.
70  Ignore = 1, // Ignored.
71  Execfd = 2, // File descriptor of program if interpreter used.
72  Phdr = 3, // Address of program header tables in memory.
73  Phent = 4, // Size in bytes of one program header entry.
74  Phnum = 5, // Number of entries in program header table.
75  Pagesz = 6, // System page size.
76  Base = 7, // Base address of interpreter program in memory.
77  Flags = 8, // Unused.
78  Entry = 9, // Entry point of program after interpreter setup.
79  Notelf = 10, // Non-zero if format is different than ELF.
80  Uid = 11, // Address of real user ID of thread.
81  Euid = 12, // Address of effective user ID of thread.
82  Gid = 13, // Address of real group ID of thread.
83  Egid = 14, // Address of effective group ID of thread.
84  Platform = 15, // Platform string for the architecture.
85  Hwcap = 16, // Bits which describe the hardware capabilities.
86  Clktck = 17, // Frequency at which times() syscall increments.
87  Secure = 23, // Whether to enable "secure mode" in executable.
88  BasePlatform = 24, // Platform string (differs on PowerPC only).
89  Random = 25, // Pointer to 16 bytes of random data.
90  Hwcap2 = 26, // Extension of AT_HWCAP.
91  Execfn = 31, // Filename of the program.
93 };
94 
95 } // namespace auxv
96 
97 #define GEM5_DEPRECATE_AT(NAME, name) M5_AT_##NAME \
98  GEM5_DEPRECATED_ENUM_VAL(\
99  "Replace M5_AT_" #NAME " with gem5::auxv::" #name) = gem5::auxv::name
100 
102 {
104  GEM5_DEPRECATE_AT(IGNORE, Ignore),
105  GEM5_DEPRECATE_AT(EXECFD, Execfd),
106  GEM5_DEPRECATE_AT(PHDR, Phdr),
107  GEM5_DEPRECATE_AT(PHENT, Phent),
108  GEM5_DEPRECATE_AT(PHNUM, Phnum),
109  GEM5_DEPRECATE_AT(PAGESZ, Pagesz),
111  GEM5_DEPRECATE_AT(FLAGS, Flags),
112  GEM5_DEPRECATE_AT(ENTRY, Entry),
113  GEM5_DEPRECATE_AT(NOTELF, Notelf),
114  GEM5_DEPRECATE_AT(UID, Uid),
115  GEM5_DEPRECATE_AT(EUID, Euid),
116  GEM5_DEPRECATE_AT(GID, Gid),
117  GEM5_DEPRECATE_AT(EGID, Egid),
118  GEM5_DEPRECATE_AT(PLATFORM, Platform),
119  GEM5_DEPRECATE_AT(HWCAP, Hwcap),
120  GEM5_DEPRECATE_AT(CLKTCK, Clktck),
121  GEM5_DEPRECATE_AT(SECURE, Secure),
122  M5_BASE_PLATFORM GEM5_DEPRECATED_ENUM_VAL(
123  "Replace M5_BASE_PLATFORM with gem5::auxv::BasePlatform") =
125  GEM5_DEPRECATE_AT(RANDOM, Random),
126  GEM5_DEPRECATE_AT(HWCAP2, Hwcap2),
127  GEM5_DEPRECATE_AT(EXECFN, Execfn),
128  GEM5_DEPRECATE_AT(VECTOR_SIZE, VectorSize)
129 };
130 
131 #undef GEM5_DEPRECATE_AT
132 
133 template <class IntType>
134 using AuxVector GEM5_DEPRECATED(
135  "The AuxVector template is now in the gem5::auxv namespace.") =
137 
138 } // namespace gem5
139 
140 #endif // __AUX_VECTOR_HH__
gem5::scmi::Platform
Definition: scmi_platform.hh:264
gem5::auxv::Gid
@ Gid
Definition: aux_vector.hh:82
gem5::auxv::Null
@ Null
Definition: aux_vector.hh:69
gem5::auxv::Hwcap
@ Hwcap
Definition: aux_vector.hh:85
gem5::auxv::VectorSize
@ VectorSize
Definition: aux_vector.hh:92
gem5::auxv::BasePlatform
@ BasePlatform
Definition: aux_vector.hh:88
gem5::AuxiliaryVectorType
AuxiliaryVectorType
Definition: aux_vector.hh:101
gem5::GEM5_DEPRECATE_AT
@ GEM5_DEPRECATE_AT
Definition: aux_vector.hh:103
gem5::auxv::Phent
@ Phent
Definition: aux_vector.hh:73
gem5::auxv::AuxVector::AuxVector
AuxVector()=default
gem5::auxv::Type
Type
Definition: aux_vector.hh:67
gem5::auxv::Base
@ Base
Definition: aux_vector.hh:76
gem5::auxv::Pagesz
@ Pagesz
Definition: aux_vector.hh:75
gem5::Flags
Wrapper that groups a few flag bits under the same undelying container.
Definition: flags.hh:44
gem5::auxv::Secure
@ Secure
Definition: aux_vector.hh:87
gem5::auxv::Clktck
@ Clktck
Definition: aux_vector.hh:86
gem5::auxv::AuxVector
Definition: aux_vector.hh:45
gem5::auxv::Phdr
@ Phdr
Definition: aux_vector.hh:72
gem5::auxv::Notelf
@ Notelf
Definition: aux_vector.hh:79
gem5::swap_byte
std::enable_if_t< std::is_same< T, vring_used_elem >::value, T > swap_byte(T v)
Definition: base.hh:76
compiler.hh
gem5::auxv::Egid
@ Egid
Definition: aux_vector.hh:83
gem5::auxv::Entry
@ Entry
Definition: aux_vector.hh:78
gem5::auxv::Phnum
@ Phnum
Definition: aux_vector.hh:74
gem5::GEM5_DEPRECATED_ENUM_VAL
@ GEM5_DEPRECATED_ENUM_VAL
Definition: aux_vector.hh:122
gem5::Random
Definition: random.hh:61
gem5::auxv::Execfn
@ Execfn
Definition: aux_vector.hh:91
gem5::auxv::swap_byte
AuxVector< IntType > swap_byte(const AuxVector< IntType > &av)
Definition: aux_vector.hh:62
gem5::auxv::Hwcap2
@ Hwcap2
Definition: aux_vector.hh:90
gem5::auxv::AuxVector::val
IntType val
Definition: aux_vector.hh:52
gem5::auxv::Uid
@ Uid
Definition: aux_vector.hh:80
gem5::scmi::BASE
@ BASE
Definition: scmi_platform.hh:62
gem5::auxv::Euid
@ Euid
Definition: aux_vector.hh:81
gem5::auxv::AuxVector::AuxVector
AuxVector(IntType _type, IntType _val)
Definition: aux_vector.hh:49
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::auxv::Execfd
@ Execfd
Definition: aux_vector.hh:71
gem5::auxv::Ignore
@ Ignore
Definition: aux_vector.hh:70
gem5::auxv::AuxVector::type
IntType type
Definition: aux_vector.hh:51

Generated on Wed Jul 28 2021 12:10:29 for gem5 by doxygen 1.8.17