Deleted Added
sdiff udiff text old ( 12637:bfc3cb9c7e6c ) new ( 14008:e36048ba1c2c )
full compact
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

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

61}
62
63FSTranslatingPortProxy::FSTranslatingPortProxy(MasterPort &port,
64 unsigned int cacheLineSize)
65 : PortProxy(port, cacheLineSize), _tc(NULL)
66{
67}
68
69bool
70FSTranslatingPortProxy::tryReadBlob(Addr addr, uint8_t *p, int size) const
71{
72 Addr paddr;
73 for (ChunkGenerator gen(addr, size, TheISA::PageBytes); !gen.done();
74 gen.next())
75 {
76 if (_tc)
77 paddr = TheISA::vtophys(_tc,gen.addr());
78 else
79 paddr = TheISA::vtophys(gen.addr());
80
81 PortProxy::readBlobPhys(paddr, 0, p, gen.size());
82 p += gen.size();
83 }
84 return true;
85}
86
87bool
88FSTranslatingPortProxy::tryWriteBlob(
89 Addr addr, const uint8_t *p, int size) const
90{
91 Addr paddr;
92 for (ChunkGenerator gen(addr, size, TheISA::PageBytes); !gen.done();
93 gen.next())
94 {
95 if (_tc)
96 paddr = TheISA::vtophys(_tc,gen.addr());
97 else
98 paddr = TheISA::vtophys(gen.addr());
99
100 PortProxy::writeBlobPhys(paddr, 0, p, gen.size());
101 p += gen.size();
102 }
103 return true;
104}
105
106bool
107FSTranslatingPortProxy::tryMemsetBlob(Addr address, uint8_t v, int size) const
108{
109 Addr paddr;
110 for (ChunkGenerator gen(address, size, TheISA::PageBytes); !gen.done();
111 gen.next())
112 {
113 if (_tc)
114 paddr = TheISA::vtophys(_tc,gen.addr());
115 else
116 paddr = TheISA::vtophys(gen.addr());
117
118 PortProxy::memsetBlobPhys(paddr, 0, v, gen.size());
119 }
120 return true;
121}
122
123void
124CopyOut(ThreadContext *tc, void *dest, Addr src, size_t cplen)
125{
126 uint8_t *dst = (uint8_t *)dest;
127 tc->getVirtProxy().readBlob(src, dst, cplen);
128}

--- 37 unchanged lines hidden ---