syscall_emul_buf.hh (10497:73a59d5e0923) | syscall_emul_buf.hh (10498:91b05b34b074) |
---|---|
1/* 2 * Copyright (c) 2003-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; --- 56 unchanged lines hidden (view full) --- 65 : addr(_addr), size(_size), bufPtr(new uint8_t[size]) 66 { 67 // clear out buffer: in case we only partially populate this, 68 // and then do a copyOut(), we want to make sure we don't 69 // introduce any random junk into the simulated address space 70 memset(bufPtr, 0, size); 71 } 72 | 1/* 2 * Copyright (c) 2003-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; --- 56 unchanged lines hidden (view full) --- 65 : addr(_addr), size(_size), bufPtr(new uint8_t[size]) 66 { 67 // clear out buffer: in case we only partially populate this, 68 // and then do a copyOut(), we want to make sure we don't 69 // introduce any random junk into the simulated address space 70 memset(bufPtr, 0, size); 71 } 72 |
73 virtual ~BaseBufferArg() { delete [] bufPtr; } | 73 ~BaseBufferArg() { delete [] bufPtr; } |
74 75 /** 76 * copy data into simulator space (read from target memory) 77 */ | 74 75 /** 76 * copy data into simulator space (read from target memory) 77 */ |
78 virtual bool copyIn(SETranslatingPortProxy &memproxy) | 78 bool copyIn(SETranslatingPortProxy &memproxy) |
79 { 80 memproxy.readBlob(addr, bufPtr, size); 81 return true; // no EFAULT detection for now 82 } 83 84 /** 85 * copy data out of simulator space (write to target memory) 86 */ | 79 { 80 memproxy.readBlob(addr, bufPtr, size); 81 return true; // no EFAULT detection for now 82 } 83 84 /** 85 * copy data out of simulator space (write to target memory) 86 */ |
87 virtual bool copyOut(SETranslatingPortProxy &memproxy) | 87 bool copyOut(SETranslatingPortProxy &memproxy) |
88 { 89 memproxy.writeBlob(addr, bufPtr, size); 90 return true; // no EFAULT detection for now 91 } 92 93 protected: 94 const Addr addr; ///< address of buffer in target address space 95 const int size; ///< buffer size --- 73 unchanged lines hidden --- | 88 { 89 memproxy.writeBlob(addr, bufPtr, size); 90 return true; // no EFAULT detection for now 91 } 92 93 protected: 94 const Addr addr; ///< address of buffer in target address space 95 const int size; ///< buffer size --- 73 unchanged lines hidden --- |