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

Generated on Thu Jul 28 2022 13:32:36 for gem5 by doxygen 1.8.17