pseudo_inst.cc (8666:97d873b8b13e) | pseudo_inst.cc (8734:79592b2b1d55) |
---|---|
1/* | 1/* |
2 * Copyright (c) 2010 ARM Limited | 2 * Copyright (c) 2010-2011 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 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 34 unchanged lines hidden (view full) --- 45#include <unistd.h> 46 47#include <cerrno> 48#include <fstream> 49#include <string> 50 51#include "arch/vtophys.hh" 52#include "base/debug.hh" | 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 9 * licensed hereunder. You may use the software subject to the license 10 * terms below provided that you ensure that this notice is replicated --- 34 unchanged lines hidden (view full) --- 45#include <unistd.h> 46 47#include <cerrno> 48#include <fstream> 49#include <string> 50 51#include "arch/vtophys.hh" 52#include "base/debug.hh" |
53#include "base/output.hh" |
|
53#include "config/full_system.hh" 54#include "config/the_isa.hh" 55#include "cpu/base.hh" 56#include "cpu/quiesce_event.hh" 57#include "cpu/thread_context.hh" 58#include "debug/Loader.hh" 59#include "debug/Quiesce.hh" 60#include "debug/WorkItems.hh" --- 292 unchanged lines hidden (view full) --- 353 } 354 355 close(fd); 356 CopyIn(tc, vaddr, buf, result); 357 delete [] buf; 358 return result; 359} 360 | 54#include "config/full_system.hh" 55#include "config/the_isa.hh" 56#include "cpu/base.hh" 57#include "cpu/quiesce_event.hh" 58#include "cpu/thread_context.hh" 59#include "debug/Loader.hh" 60#include "debug/Quiesce.hh" 61#include "debug/WorkItems.hh" --- 292 unchanged lines hidden (view full) --- 354 } 355 356 close(fd); 357 CopyIn(tc, vaddr, buf, result); 358 delete [] buf; 359 return result; 360} 361 |
362uint64_t 363writefile(ThreadContext *tc, Addr vaddr, uint64_t len, uint64_t offset, 364 Addr filename_addr) 365{ 366 ostream *os; 367 368 // copy out target filename 369 char fn[100]; 370 std::string filename; 371 CopyStringOut(tc, fn, filename_addr, 100); 372 filename = std::string(fn); 373 374 if (offset == 0) { 375 // create a new file (truncate) 376 os = simout.create(filename, true); 377 } else { 378 // do not truncate file if offset is non-zero 379 // (ios::in flag is required as well to keep the existing data 380 // intact, otherwise existing data will be zeroed out.) 381 os = simout.openFile(simout.directory() + filename, 382 ios::in | ios::out | ios::binary); 383 } 384 if (!os) 385 panic("could not open file %s\n", filename); 386 387 // seek to offset 388 os->seekp(offset); 389 390 // copy out data and write to file 391 char *buf = new char[len]; 392 CopyOut(tc, buf, vaddr, len); 393 os->write(buf, len); 394 if (os->fail() || os->bad()) 395 panic("Error while doing writefile!\n"); 396 397 simout.close(os); 398 399 delete [] buf; 400 401 return len; 402} 403 |
|
361#endif 362 363void 364debugbreak(ThreadContext *tc) 365{ 366 Debug::breakpoint(); 367} 368 --- 115 unchanged lines hidden --- | 404#endif 405 406void 407debugbreak(ThreadContext *tc) 408{ 409 Debug::breakpoint(); 410} 411 --- 115 unchanged lines hidden --- |