port_proxy.hh (12522:463b7803e8dd) | port_proxy.hh (12532:a86ce386add1) |
---|---|
1/* 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 --- 85 unchanged lines hidden (view full) --- 94 public: 95 PortProxy(MasterPort &port, unsigned int cacheLineSize) : 96 _port(port), _cacheLineSize(cacheLineSize) { } 97 virtual ~PortProxy() { } 98 99 /** 100 * Read size bytes memory at address and store in p. 101 */ | 1/* 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 --- 85 unchanged lines hidden (view full) --- 94 public: 95 PortProxy(MasterPort &port, unsigned int cacheLineSize) : 96 _port(port), _cacheLineSize(cacheLineSize) { } 97 virtual ~PortProxy() { } 98 99 /** 100 * Read size bytes memory at address and store in p. 101 */ |
102 virtual void readBlob(Addr addr, uint8_t* p, int size) const; | 102 virtual void readBlob(Addr addr, uint8_t* p, int size) const { 103 readBlobPhys(addr, 0, p, size); 104 } |
103 104 /** 105 * Write size bytes from p to address. 106 */ | 105 106 /** 107 * Write size bytes from p to address. 108 */ |
107 virtual void writeBlob(Addr addr, const uint8_t* p, int size) const; | 109 virtual void writeBlob(Addr addr, const uint8_t* p, int size) const { 110 writeBlobPhys(addr, 0, p, size); 111 } |
108 109 /** 110 * Fill size bytes starting at addr with byte value val. 111 */ | 112 113 /** 114 * Fill size bytes starting at addr with byte value val. 115 */ |
112 virtual void memsetBlob(Addr addr, uint8_t v, int size) const; | 116 virtual void memsetBlob(Addr addr, uint8_t v, int size) const { 117 memsetBlobPhys(addr, 0, v, size); 118 } |
113 114 /** | 119 120 /** |
121 * Read size bytes memory at physical address and store in p. 122 */ 123 void readBlobPhys(Addr addr, Request::Flags flags, 124 uint8_t* p, int size) const; 125 126 /** 127 * Write size bytes from p to physical address. 128 */ 129 void writeBlobPhys(Addr addr, Request::Flags flags, 130 const uint8_t* p, int size) const; 131 132 /** 133 * Fill size bytes starting at physical addr with byte value val. 134 */ 135 void memsetBlobPhys(Addr addr, Request::Flags flags, 136 uint8_t v, int size) const; 137 138 /** |
|
115 * Read sizeof(T) bytes from address and return as object T. 116 */ 117 template <typename T> 118 T read(Addr address) const; 119 120 /** 121 * Write object T to address. Writes sizeof(T) bytes. 122 */ --- 27 unchanged lines hidden (view full) --- 150 * Performs Host to Guest endianness transform. 151 */ 152 template <typename T> 153 void writeHtoG(Addr address, T data) const; 154#endif 155}; 156 157 | 139 * Read sizeof(T) bytes from address and return as object T. 140 */ 141 template <typename T> 142 T read(Addr address) const; 143 144 /** 145 * Write object T to address. Writes sizeof(T) bytes. 146 */ --- 27 unchanged lines hidden (view full) --- 174 * Performs Host to Guest endianness transform. 175 */ 176 template <typename T> 177 void writeHtoG(Addr address, T data) const; 178#endif 179}; 180 181 |
182/** 183 * This object is a proxy for a structural port, to be used for debug 184 * accesses to secure memory. 185 * 186 * The addresses are interpreted as physical addresses to secure memory. 187 */ 188class SecurePortProxy : public PortProxy 189{ 190 public: 191 SecurePortProxy(MasterPort &port, unsigned int cache_line_size) 192 : PortProxy(port, cache_line_size) {} 193 194 void readBlob(Addr addr, uint8_t *p, int size) const override; 195 void writeBlob(Addr addr, const uint8_t *p, int size) const override; 196 void memsetBlob(Addr addr, uint8_t val, int size) const override; 197}; 198 |
|
158template <typename T> 159T 160PortProxy::read(Addr address) const 161{ 162 T data; 163 readBlob(address, (uint8_t*)&data, sizeof(T)); 164 return data; 165} --- 45 unchanged lines hidden --- | 199template <typename T> 200T 201PortProxy::read(Addr address) const 202{ 203 T data; 204 readBlob(address, (uint8_t*)&data, sizeof(T)); 205 return data; 206} --- 45 unchanged lines hidden --- |