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
69FSTranslatingPortProxy::~FSTranslatingPortProxy()
70{
71}
72
73void
74FSTranslatingPortProxy::readBlob(Addr addr, uint8_t *p, int size) const
75{
76 Addr paddr;
77 for (ChunkGenerator gen(addr, size, TheISA::PageBytes); !gen.done();
78 gen.next())
79 {
80 if (_tc)
81 paddr = TheISA::vtophys(_tc,gen.addr());
82 else
83 paddr = TheISA::vtophys(gen.addr());
84
85 PortProxy::readBlobPhys(paddr, 0, p, gen.size());
86 p += gen.size();
87 }
88}
89
90void
91FSTranslatingPortProxy::writeBlob(Addr addr, const uint8_t *p, int size) const
92{
93 Addr paddr;
94 for (ChunkGenerator gen(addr, size, TheISA::PageBytes); !gen.done();
95 gen.next())
96 {
97 if (_tc)
98 paddr = TheISA::vtophys(_tc,gen.addr());
99 else
100 paddr = TheISA::vtophys(gen.addr());
101
102 PortProxy::writeBlobPhys(paddr, 0, p, gen.size());
103 p += gen.size();
104 }
105}
106
107void
108FSTranslatingPortProxy::memsetBlob(Addr address, uint8_t v, int size) const
109{
110 Addr paddr;
111 for (ChunkGenerator gen(address, size, TheISA::PageBytes); !gen.done();
112 gen.next())
113 {
114 if (_tc)
115 paddr = TheISA::vtophys(_tc,gen.addr());
116 else
117 paddr = TheISA::vtophys(gen.addr());
118
119 PortProxy::memsetBlobPhys(paddr, 0, v, gen.size());
120 }
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 ---