port_proxy.cc (14007:36f842f523c6) port_proxy.cc (14008:e36048ba1c2c)
1/*
2 * Copyright (c) 2012, 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

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

82 // quick and dirty...
83 uint8_t *buf = new uint8_t[size];
84
85 std::memset(buf, v, size);
86 PortProxy::writeBlobPhys(addr, flags, buf, size);
87
88 delete [] buf;
89}
1/*
2 * Copyright (c) 2012, 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

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

82 // quick and dirty...
83 uint8_t *buf = new uint8_t[size];
84
85 std::memset(buf, v, size);
86 PortProxy::writeBlobPhys(addr, flags, buf, size);
87
88 delete [] buf;
89}
90
91bool
92PortProxy::tryWriteString(Addr addr, const char *str) const
93{
94 do {
95 if (!tryWriteBlob(addr++, (uint8_t *)str, 1))
96 return false;
97 } while (*str++);
98 return true;
99}
100
101bool
102PortProxy::tryReadString(std::string &str, Addr addr) const
103{
104 while (true) {
105 uint8_t c;
106 if (!tryReadBlob(addr++, &c, 1))
107 return false;
108 if (!c)
109 return true;
110 str += c;
111 }
112}