Deleted Added
sdiff udiff text old ( 8706:b1838faf3bcc ) new ( 8722:78b08f92c290 )
full compact
1/*
2 * Copyright (c) 2011 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

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

133 FSTranslatingPortProxy* vp = tc->getVirtProxy();
134
135 vp->writeBlob(dest, src, cplen);
136}
137
138void
139CopyStringOut(ThreadContext *tc, char *dst, Addr vaddr, size_t maxlen)
140{
141 int len = 0;
142 char *start = dst;
143 FSTranslatingPortProxy* vp = tc->getVirtProxy();
144
145 do {
146 vp->readBlob(vaddr++, (uint8_t*)dst++, 1);
147 } while (len < maxlen && start[len++] != 0 );
148
149 dst[len] = 0;
150}
151
152void
153CopyStringIn(ThreadContext *tc, char *src, Addr vaddr)
154{
155 FSTranslatingPortProxy* vp = tc->getVirtProxy();
156 for (ChunkGenerator gen(vaddr, strlen(src), TheISA::PageBytes); !gen.done();
157 gen.next())
158 {
159 vp->writeBlob(gen.addr(), (uint8_t*)src, gen.size());
160 src += gen.size();
161 }
162}