port_proxy.hh (14011:faf0a568ba6b) port_proxy.hh (14012:1bdf42ed6add)
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

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

54 * CPU, e.g. for threads) and thus are transparent to a potentially
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
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

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

54 * CPU, e.g. for threads) and thus are transparent to a potentially
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 <limits>
63
62#include "mem/port.hh"
63#include "sim/byteswap.hh"
64
65/**
66 * This object is a proxy for a structural port, to be used for debug
67 * accesses.
68 *
69 * This proxy object is used when non structural entities

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

237 * Same as tryReadString, but insists on success.
238 */
239 void
240 readString(std::string &str, Addr addr) const
241 {
242 if (!tryReadString(str, addr))
243 fatal("readString(%#x, ...) failed", addr);
244 }
64#include "mem/port.hh"
65#include "sim/byteswap.hh"
66
67/**
68 * This object is a proxy for a structural port, to be used for debug
69 * accesses.
70 *
71 * This proxy object is used when non structural entities

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

239 * Same as tryReadString, but insists on success.
240 */
241 void
242 readString(std::string &str, Addr addr) const
243 {
244 if (!tryReadString(str, addr))
245 fatal("readString(%#x, ...) failed", addr);
246 }
247
248 /**
249 * Reads the string at guest address addr into the char * str, reading up
250 * to maxlen characters. The last character read is always a nul
251 * terminator. Returns true on success and false on failure.
252 */
253 bool tryReadString(char *str, Addr addr, size_t maxlen) const;
254
255 /**
256 * Same as tryReadString, but insists on success.
257 */
258 void
259 readString(char *str, Addr addr, size_t maxlen) const
260 {
261 if (!tryReadString(str, addr, maxlen))
262 fatal("readString(%#x, ...) failed", addr);
263 }
245};
246
247
248template <typename T>
249T
250PortProxy::read(Addr address) const
251{
252 T data;

--- 29 unchanged lines hidden ---
264};
265
266
267template <typename T>
268T
269PortProxy::read(Addr address) const
270{
271 T data;

--- 29 unchanged lines hidden ---