vtophys.cc (2680:246e7104f744) | vtophys.cc (3298:82469aa959fb) |
---|---|
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; --- 127 unchanged lines hidden (view full) --- 136 137 tc->delVirtPort(vp); 138} 139 140void 141AlphaISA::CopyStringOut(ThreadContext *tc, char *dst, Addr vaddr, size_t maxlen) 142{ 143 int len = 0; | 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; --- 127 unchanged lines hidden (view full) --- 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; |
|
144 VirtualPort *vp = tc->getVirtPort(tc); 145 146 do { 147 vp->readBlob(vaddr++, (uint8_t*)dst++, 1); | 145 VirtualPort *vp = tc->getVirtPort(tc); 146 147 do { 148 vp->readBlob(vaddr++, (uint8_t*)dst++, 1); |
148 len++; 149 } while (len < maxlen && dst[len] != 0 ); | 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} | 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} |