vtophys.cc (3298:82469aa959fb) | vtophys.cc (4070:74449a198a44) |
---|---|
1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 99 unchanged lines hidden (view full) --- 108 } 109 110 111 DPRINTF(VtoPhys, "vtophys(%#x) -> %#x\n", vaddr, paddr); 112 113 return paddr; 114} 115 | 1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 99 unchanged lines hidden (view full) --- 108 } 109 110 111 DPRINTF(VtoPhys, "vtophys(%#x) -> %#x\n", vaddr, paddr); 112 113 return paddr; 114} 115 |
116 117void 118AlphaISA::CopyOut(ThreadContext *tc, void *dest, Addr src, size_t cplen) 119{ 120 uint8_t *dst = (uint8_t *)dest; 121 VirtualPort *vp = tc->getVirtPort(tc); 122 123 vp->readBlob(src, dst, cplen); 124 125 tc->delVirtPort(vp); 126 127} 128 129void 130AlphaISA::CopyIn(ThreadContext *tc, Addr dest, void *source, size_t cplen) 131{ 132 uint8_t *src = (uint8_t *)source; 133 VirtualPort *vp = tc->getVirtPort(tc); 134 135 vp->writeBlob(dest, src, cplen); 136 137 tc->delVirtPort(vp); 138} 139 140void 141AlphaISA::CopyStringOut(ThreadContext *tc, char *dst, Addr vaddr, size_t maxlen) 142{ 143 int len = 0; 144 char *start = dst; 145 VirtualPort *vp = tc->getVirtPort(tc); 146 147 do { 148 vp->readBlob(vaddr++, (uint8_t*)dst++, 1); 149 } while (len < maxlen && start[len++] != 0 ); 150 151 tc->delVirtPort(vp); 152 dst[len] = 0; 153} 154 155void 156AlphaISA::CopyStringIn(ThreadContext *tc, char *src, Addr vaddr) 157{ 158 VirtualPort *vp = tc->getVirtPort(tc); 159 for (ChunkGenerator gen(vaddr, strlen(src), AlphaISA::PageBytes); !gen.done(); 160 gen.next()) 161 { 162 vp->writeBlob(gen.addr(), (uint8_t*)src, gen.size()); 163 src += gen.size(); 164 } 165 tc->delVirtPort(vp); 166} | |