port_proxy.hh (9814:7ad2b0186a32) port_proxy.hh (9850:87d6b41749e9)
1/*
2 * Copyright (c) 2011-2013 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

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

55 * distributed memory and automatically adhere to the memory map of
56 * the system.
57 */
58
59#ifndef __MEM_PORT_PROXY_HH__
60#define __MEM_PORT_PROXY_HH__
61
62#include "config/the_isa.hh"
1/*
2 * Copyright (c) 2011-2013 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

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

55 * distributed memory and automatically adhere to the memory map of
56 * the system.
57 */
58
59#ifndef __MEM_PORT_PROXY_HH__
60#define __MEM_PORT_PROXY_HH__
61
62#include "config/the_isa.hh"
63#if THE_ISA != NO_ISA
63#if THE_ISA != NULL_ISA
64 #include "arch/isa_traits.hh"
65#endif
66
67#include "mem/port.hh"
68#include "sim/byteswap.hh"
69
70/**
71 * This object is a proxy for a structural port, to be used for debug

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

122 T read(Addr address) const;
123
124 /**
125 * Write object T to address. Writes sizeof(T) bytes.
126 */
127 template <typename T>
128 void write(Addr address, T data) const;
129
64 #include "arch/isa_traits.hh"
65#endif
66
67#include "mem/port.hh"
68#include "sim/byteswap.hh"
69
70/**
71 * This object is a proxy for a structural port, to be used for debug

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

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

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

156
157template <typename T>
158void
159PortProxy::write(Addr address, T data) const
160{
161 writeBlob(address, (uint8_t*)&data, sizeof(T));
162}
163
131 /**
132 * Read sizeof(T) bytes from address and return as object T.
133 * Performs Guest to Host endianness transform.
134 */
135 template <typename T>
136 T readGtoH(Addr address) const;
137
138 /**

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

156
157template <typename T>
158void
159PortProxy::write(Addr address, T data) const
160{
161 writeBlob(address, (uint8_t*)&data, sizeof(T));
162}
163
164#if THE_ISA != NO_ISA
164#if THE_ISA != NULL_ISA
165template <typename T>
166T
167PortProxy::readGtoH(Addr address) const
168{
169 T data;
170 readBlob(address, (uint8_t*)&data, sizeof(T));
171 return TheISA::gtoh(data);
172}
173
174template <typename T>
175void
176PortProxy::writeHtoG(Addr address, T data) const
177{
178 data = TheISA::htog(data);
179 writeBlob(address, (uint8_t*)&data, sizeof(T));
180}
181#endif
182
183#endif // __MEM_PORT_PROXY_HH__
165template <typename T>
166T
167PortProxy::readGtoH(Addr address) const
168{
169 T data;
170 readBlob(address, (uint8_t*)&data, sizeof(T));
171 return TheISA::gtoh(data);
172}
173
174template <typename T>
175void
176PortProxy::writeHtoG(Addr address, T data) const
177{
178 data = TheISA::htog(data);
179 writeBlob(address, (uint8_t*)&data, sizeof(T));
180}
181#endif
182
183#endif // __MEM_PORT_PROXY_HH__