fs_translating_port_proxy.cc (12637:bfc3cb9c7e6c) fs_translating_port_proxy.cc (14008:e36048ba1c2c)
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
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()
69bool
70FSTranslatingPortProxy::tryReadBlob(Addr addr, uint8_t *p, int size) const
70{
71{
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 }
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;
88}
89
85}
86
90void
91FSTranslatingPortProxy::writeBlob(Addr addr, const uint8_t *p, int size) const
87bool
88FSTranslatingPortProxy::tryWriteBlob(
89 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 }
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;
105}
106
104}
105
107void
108FSTranslatingPortProxy::memsetBlob(Addr address, uint8_t v, int size) const
106bool
107FSTranslatingPortProxy::tryMemsetBlob(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 }
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 ---
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 ---