port_proxy.hh (10564:a8c16e2d466a) port_proxy.hh (12522:463b7803e8dd)
1/*
1/*
2 * Copyright (c) 2011-2013 ARM Limited
2 * Copyright (c) 2011-2013, 2018 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

--- 107 unchanged lines hidden (view full) ---

118 T read(Addr address) const;
119
120 /**
121 * Write object T to address. Writes sizeof(T) bytes.
122 */
123 template <typename T>
124 void write(Addr address, T data) const;
125
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

--- 107 unchanged lines hidden (view full) ---

118 T read(Addr address) const;
119
120 /**
121 * Write object T to address. Writes sizeof(T) bytes.
122 */
123 template <typename T>
124 void write(Addr address, T data) const;
125
126 /**
127 * Read sizeof(T) bytes from address and return as object T.
128 * Performs selected endianness transform.
129 */
130 template <typename T>
131 T readGtoH(Addr address, ByteOrder guest_byte_order) const;
132
133 /**
134 * Write object T to address. Writes sizeof(T) bytes.
135 * Performs selected endianness transform.
136 */
137 template <typename T>
138 void writeHtoG(Addr address, T data, ByteOrder guest_byte_order) const;
139
126#if THE_ISA != NULL_ISA
127 /**
128 * Read sizeof(T) bytes from address and return as object T.
129 * Performs Guest to Host endianness transform.
130 */
131 template <typename T>
132 T readGtoH(Addr address) const;
133

--- 18 unchanged lines hidden (view full) ---

152
153template <typename T>
154void
155PortProxy::write(Addr address, T data) const
156{
157 writeBlob(address, (uint8_t*)&data, sizeof(T));
158}
159
140#if THE_ISA != NULL_ISA
141 /**
142 * Read sizeof(T) bytes from address and return as object T.
143 * Performs Guest to Host endianness transform.
144 */
145 template <typename T>
146 T readGtoH(Addr address) const;
147

--- 18 unchanged lines hidden (view full) ---

166
167template <typename T>
168void
169PortProxy::write(Addr address, T data) const
170{
171 writeBlob(address, (uint8_t*)&data, sizeof(T));
172}
173
174template <typename T>
175T
176PortProxy::readGtoH(Addr address, ByteOrder byte_order) const
177{
178 T data;
179 readBlob(address, (uint8_t*)&data, sizeof(T));
180 return gtoh(data, byte_order);
181}
182
183template <typename T>
184void
185PortProxy::writeHtoG(Addr address, T data, ByteOrder byte_order) const
186{
187 data = htog(data, byte_order);
188 writeBlob(address, (uint8_t*)&data, sizeof(T));
189}
190
160#if THE_ISA != NULL_ISA
161template <typename T>
162T
163PortProxy::readGtoH(Addr address) const
164{
165 T data;
166 readBlob(address, (uint8_t*)&data, sizeof(T));
167 return TheISA::gtoh(data);

--- 12 unchanged lines hidden ---
191#if THE_ISA != NULL_ISA
192template <typename T>
193T
194PortProxy::readGtoH(Addr address) const
195{
196 T data;
197 readBlob(address, (uint8_t*)&data, sizeof(T));
198 return TheISA::gtoh(data);

--- 12 unchanged lines hidden ---