process.cc revision 9641
12SN/A/* 28852Sandreas.hansson@arm.com * Copyright (c) 2012 ARM Limited 38852Sandreas.hansson@arm.com * All rights reserved 48852Sandreas.hansson@arm.com * 58852Sandreas.hansson@arm.com * The license below extends only to copyright in the software and shall 68852Sandreas.hansson@arm.com * not be construed as granting a license to any other intellectual 78852Sandreas.hansson@arm.com * property including but not limited to intellectual property relating 88852Sandreas.hansson@arm.com * to a hardware implementation of the functionality of the software 98852Sandreas.hansson@arm.com * licensed hereunder. You may use the software subject to the license 108852Sandreas.hansson@arm.com * terms below provided that you ensure that this notice is replicated 118852Sandreas.hansson@arm.com * unmodified and in its entirety in all distributions of the software, 128852Sandreas.hansson@arm.com * modified or unmodified, in source code or in binary form. 138852Sandreas.hansson@arm.com * 141762SN/A * Copyright (c) 2001-2005 The Regents of The University of Michigan 152SN/A * All rights reserved. 162SN/A * 172SN/A * Redistribution and use in source and binary forms, with or without 182SN/A * modification, are permitted provided that the following conditions are 192SN/A * met: redistributions of source code must retain the above copyright 202SN/A * notice, this list of conditions and the following disclaimer; 212SN/A * redistributions in binary form must reproduce the above copyright 222SN/A * notice, this list of conditions and the following disclaimer in the 232SN/A * documentation and/or other materials provided with the distribution; 242SN/A * neither the name of the copyright holders nor the names of its 252SN/A * contributors may be used to endorse or promote products derived from 262SN/A * this software without specific prior written permission. 272SN/A * 282SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 292SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 302SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 312SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 322SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 332SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 342SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 352SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 362SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 372SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 382SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 392665Ssaidi@eecs.umich.edu * 402665Ssaidi@eecs.umich.edu * Authors: Nathan Binkert 412665Ssaidi@eecs.umich.edu * Steve Reinhardt 422665Ssaidi@eecs.umich.edu * Ali Saidi 432SN/A */ 442SN/A 458229Snate@binkert.org#include <fcntl.h> 462SN/A#include <unistd.h> 476712Snate@binkert.org 486712Snate@binkert.org#include <cstdio> 492SN/A#include <string> 502SN/A 5156SN/A#include "base/loader/object_file.hh" 521158SN/A#include "base/loader/symtab.hh" 538229Snate@binkert.org#include "base/intmath.hh" 54146SN/A#include "base/statistics.hh" 556658Snate@binkert.org#include "config/the_isa.hh" 562680Sktlim@umich.edu#include "cpu/thread_context.hh" 572378SN/A#include "mem/page_table.hh" 588706Sandreas.hansson@arm.com#include "mem/se_translating_port_proxy.hh" 598229Snate@binkert.org#include "params/LiveProcess.hh" 605154Sgblack@eecs.umich.edu#include "params/Process.hh" 615512SMichael.Adler@intel.com#include "sim/debug.hh" 62360SN/A#include "sim/process.hh" 634434Ssaidi@eecs.umich.edu#include "sim/process_impl.hh" 64695SN/A#include "sim/stats.hh" 652093SN/A#include "sim/syscall_emul.hh" 662378SN/A#include "sim/system.hh" 672SN/A 682715Sstever@eecs.umich.edu#if THE_ISA == ALPHA_ISA 692715Sstever@eecs.umich.edu#include "arch/alpha/linux/process.hh" 702715Sstever@eecs.umich.edu#include "arch/alpha/tru64/process.hh" 712715Sstever@eecs.umich.edu#elif THE_ISA == SPARC_ISA 722715Sstever@eecs.umich.edu#include "arch/sparc/linux/process.hh" 732715Sstever@eecs.umich.edu#include "arch/sparc/solaris/process.hh" 742715Sstever@eecs.umich.edu#elif THE_ISA == MIPS_ISA 752715Sstever@eecs.umich.edu#include "arch/mips/linux/process.hh" 765335Shines@cs.fsu.edu#elif THE_ISA == ARM_ISA 775335Shines@cs.fsu.edu#include "arch/arm/linux/process.hh" 784157Sgblack@eecs.umich.edu#elif THE_ISA == X86_ISA 794166Sgblack@eecs.umich.edu#include "arch/x86/linux/process.hh" 806691Stjones1@inf.ed.ac.uk#elif THE_ISA == POWER_ISA 816691Stjones1@inf.ed.ac.uk#include "arch/power/linux/process.hh" 822715Sstever@eecs.umich.edu#else 832715Sstever@eecs.umich.edu#error "THE_ISA not set" 842715Sstever@eecs.umich.edu#endif 852715Sstever@eecs.umich.edu 862715Sstever@eecs.umich.edu 872SN/Ausing namespace std; 882107SN/Ausing namespace TheISA; 892SN/A 902SN/A// current number of allocated processes 912SN/Aint num_processes = 0; 922SN/A 935758Shsul@eecs.umich.edutemplate<class IntType> 945771Shsul@eecs.umich.eduAuxVector<IntType>::AuxVector(IntType type, IntType val) 955758Shsul@eecs.umich.edu{ 965758Shsul@eecs.umich.edu a_type = TheISA::htog(type); 975758Shsul@eecs.umich.edu a_val = TheISA::htog(val); 985758Shsul@eecs.umich.edu} 995758Shsul@eecs.umich.edu 1008737Skoansin.tan@gmail.comtemplate struct AuxVector<uint32_t>; 1018737Skoansin.tan@gmail.comtemplate struct AuxVector<uint64_t>; 1025758Shsul@eecs.umich.edu 1035154Sgblack@eecs.umich.eduProcess::Process(ProcessParams * params) 1047532Ssteve.reinhardt@amd.com : SimObject(params), system(params->system), 1058852Sandreas.hansson@arm.com max_stack_size(params->max_stack_size), 1068852Sandreas.hansson@arm.com M5_pid(system->allocatePID()), 1078852Sandreas.hansson@arm.com pTable(new PageTable(name(), M5_pid)), 1088852Sandreas.hansson@arm.com initVirtMem(system->getSystemPort(), this, 1098852Sandreas.hansson@arm.com SETranslatingPortProxy::Always) 1102SN/A{ 1115154Sgblack@eecs.umich.edu string in = params->input; 1125154Sgblack@eecs.umich.edu string out = params->output; 1135514SMichael.Adler@intel.com string err = params->errout; 1145154Sgblack@eecs.umich.edu 1155154Sgblack@eecs.umich.edu // initialize file descriptors to default: same as simulator 1165154Sgblack@eecs.umich.edu int stdin_fd, stdout_fd, stderr_fd; 1175154Sgblack@eecs.umich.edu 1185154Sgblack@eecs.umich.edu if (in == "stdin" || in == "cin") 1195154Sgblack@eecs.umich.edu stdin_fd = STDIN_FILENO; 1205154Sgblack@eecs.umich.edu else if (in == "None") 1215154Sgblack@eecs.umich.edu stdin_fd = -1; 1225154Sgblack@eecs.umich.edu else 1235154Sgblack@eecs.umich.edu stdin_fd = Process::openInputFile(in); 1245154Sgblack@eecs.umich.edu 1255154Sgblack@eecs.umich.edu if (out == "stdout" || out == "cout") 1265154Sgblack@eecs.umich.edu stdout_fd = STDOUT_FILENO; 1275154Sgblack@eecs.umich.edu else if (out == "stderr" || out == "cerr") 1285154Sgblack@eecs.umich.edu stdout_fd = STDERR_FILENO; 1295154Sgblack@eecs.umich.edu else if (out == "None") 1305154Sgblack@eecs.umich.edu stdout_fd = -1; 1315154Sgblack@eecs.umich.edu else 1325154Sgblack@eecs.umich.edu stdout_fd = Process::openOutputFile(out); 1335154Sgblack@eecs.umich.edu 1345514SMichael.Adler@intel.com if (err == "stdout" || err == "cout") 1355514SMichael.Adler@intel.com stderr_fd = STDOUT_FILENO; 1365514SMichael.Adler@intel.com else if (err == "stderr" || err == "cerr") 1375514SMichael.Adler@intel.com stderr_fd = STDERR_FILENO; 1385514SMichael.Adler@intel.com else if (err == "None") 1395514SMichael.Adler@intel.com stderr_fd = -1; 1405514SMichael.Adler@intel.com else if (err == out) 1415514SMichael.Adler@intel.com stderr_fd = stdout_fd; 1425514SMichael.Adler@intel.com else 1435514SMichael.Adler@intel.com stderr_fd = Process::openOutputFile(err); 1445154Sgblack@eecs.umich.edu 1452SN/A // initialize first 3 fds (stdin, stdout, stderr) 1465282Srstrong@cs.ucsd.edu Process::FdMap *fdo = &fd_map[STDIN_FILENO]; 1475282Srstrong@cs.ucsd.edu fdo->fd = stdin_fd; 1485282Srstrong@cs.ucsd.edu fdo->filename = in; 1495282Srstrong@cs.ucsd.edu fdo->flags = O_RDONLY; 1505282Srstrong@cs.ucsd.edu fdo->mode = -1; 1515282Srstrong@cs.ucsd.edu fdo->fileOffset = 0; 1525282Srstrong@cs.ucsd.edu 1535282Srstrong@cs.ucsd.edu fdo = &fd_map[STDOUT_FILENO]; 1545282Srstrong@cs.ucsd.edu fdo->fd = stdout_fd; 1555282Srstrong@cs.ucsd.edu fdo->filename = out; 1565282Srstrong@cs.ucsd.edu fdo->flags = O_WRONLY | O_CREAT | O_TRUNC; 1575282Srstrong@cs.ucsd.edu fdo->mode = 0774; 1585282Srstrong@cs.ucsd.edu fdo->fileOffset = 0; 1595282Srstrong@cs.ucsd.edu 1605282Srstrong@cs.ucsd.edu fdo = &fd_map[STDERR_FILENO]; 1615282Srstrong@cs.ucsd.edu fdo->fd = stderr_fd; 1625514SMichael.Adler@intel.com fdo->filename = err; 1635282Srstrong@cs.ucsd.edu fdo->flags = O_WRONLY; 1645282Srstrong@cs.ucsd.edu fdo->mode = -1; 1655282Srstrong@cs.ucsd.edu fdo->fileOffset = 0; 1665282Srstrong@cs.ucsd.edu 1672SN/A 1682SN/A // mark remaining fds as free 1692SN/A for (int i = 3; i <= MAX_FD; ++i) { 1709550Sandreas.hansson@arm.com fdo = &fd_map[i]; 1715282Srstrong@cs.ucsd.edu fdo->fd = -1; 1722SN/A } 1732SN/A 1741450SN/A mmap_start = mmap_end = 0; 1751514SN/A nxm_start = nxm_end = 0; 1762SN/A // other parameters will be initialized when the program is loaded 1772SN/A} 1782SN/A 1792378SN/A 1802SN/Avoid 1812SN/AProcess::regStats() 1822SN/A{ 183729SN/A using namespace Stats; 1842SN/A 1852SN/A num_syscalls 1868240Snate@binkert.org .name(name() + ".num_syscalls") 1872SN/A .desc("Number of system calls") 1882SN/A ; 1892SN/A} 1902SN/A 1912SN/A// 1922SN/A// static helper functions 1932SN/A// 1942SN/Aint 1952SN/AProcess::openInputFile(const string &filename) 1962SN/A{ 1972SN/A int fd = open(filename.c_str(), O_RDONLY); 1982SN/A 1992SN/A if (fd == -1) { 2002SN/A perror(NULL); 2012SN/A cerr << "unable to open \"" << filename << "\" for reading\n"; 2022SN/A fatal("can't open input file"); 2032SN/A } 2042SN/A 2052SN/A return fd; 2062SN/A} 2072SN/A 2082SN/A 2092SN/Aint 2102SN/AProcess::openOutputFile(const string &filename) 2112SN/A{ 2125514SMichael.Adler@intel.com int fd = open(filename.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0664); 2132SN/A 2142SN/A if (fd == -1) { 2152SN/A perror(NULL); 2162SN/A cerr << "unable to open \"" << filename << "\" for writing\n"; 2172SN/A fatal("can't open output file"); 2182SN/A } 2192SN/A 2202SN/A return fd; 2212SN/A} 2222SN/A 2235713Shsul@eecs.umich.eduThreadContext * 2245713Shsul@eecs.umich.eduProcess::findFreeContext() 2252SN/A{ 2265713Shsul@eecs.umich.edu int size = contextIds.size(); 2275713Shsul@eecs.umich.edu ThreadContext *tc; 2285713Shsul@eecs.umich.edu for (int i = 0; i < size; ++i) { 2295713Shsul@eecs.umich.edu tc = system->getThreadContext(contextIds[i]); 2306029Ssteve.reinhardt@amd.com if (tc->status() == ThreadContext::Halted) { 2315713Shsul@eecs.umich.edu // inactive context, free to use 2325713Shsul@eecs.umich.edu return tc; 2335713Shsul@eecs.umich.edu } 2345512SMichael.Adler@intel.com } 2355713Shsul@eecs.umich.edu return NULL; 2362SN/A} 2372SN/A 2381395SN/Avoid 2397532Ssteve.reinhardt@amd.comProcess::initState() 2401395SN/A{ 2415713Shsul@eecs.umich.edu if (contextIds.empty()) 2425713Shsul@eecs.umich.edu fatal("Process %s is not associated with any HW contexts!\n", name()); 2432378SN/A 2442680Sktlim@umich.edu // first thread context for this process... initialize & enable 2455713Shsul@eecs.umich.edu ThreadContext *tc = system->getThreadContext(contextIds[0]); 2461395SN/A 2471634SN/A // mark this context as active so it will start ticking. 2489180Sandreas.hansson@arm.com tc->activate(Cycles(0)); 2491395SN/A} 2502SN/A 2512SN/A// map simulator fd sim_fd to target fd tgt_fd 2522SN/Avoid 2532SN/AProcess::dup_fd(int sim_fd, int tgt_fd) 2542SN/A{ 2552SN/A if (tgt_fd < 0 || tgt_fd > MAX_FD) 2562SN/A panic("Process::dup_fd tried to dup past MAX_FD (%d)", tgt_fd); 2572SN/A 2585282Srstrong@cs.ucsd.edu Process::FdMap *fdo = &fd_map[tgt_fd]; 2595282Srstrong@cs.ucsd.edu fdo->fd = sim_fd; 2602SN/A} 2612SN/A 2622SN/A 2632SN/A// generate new target fd for sim_fd 2642SN/Aint 2655282Srstrong@cs.ucsd.eduProcess::alloc_fd(int sim_fd, string filename, int flags, int mode, bool pipe) 2662SN/A{ 2672SN/A // in case open() returns an error, don't allocate a new fd 2682SN/A if (sim_fd == -1) 2692SN/A return -1; 2702SN/A 2712SN/A // find first free target fd 2725282Srstrong@cs.ucsd.edu for (int free_fd = 0; free_fd <= MAX_FD; ++free_fd) { 2735282Srstrong@cs.ucsd.edu Process::FdMap *fdo = &fd_map[free_fd]; 2745282Srstrong@cs.ucsd.edu if (fdo->fd == -1) { 2755282Srstrong@cs.ucsd.edu fdo->fd = sim_fd; 2765282Srstrong@cs.ucsd.edu fdo->filename = filename; 2775282Srstrong@cs.ucsd.edu fdo->mode = mode; 2785282Srstrong@cs.ucsd.edu fdo->fileOffset = 0; 2795282Srstrong@cs.ucsd.edu fdo->flags = flags; 2805282Srstrong@cs.ucsd.edu fdo->isPipe = pipe; 2815282Srstrong@cs.ucsd.edu fdo->readPipeSource = 0; 2821970SN/A return free_fd; 2831970SN/A } 2842SN/A } 2852SN/A 2861970SN/A panic("Process::alloc_fd: out of file descriptors!"); 2871970SN/A} 2882SN/A 2891970SN/A 2901970SN/A// free target fd (e.g., after close) 2911970SN/Avoid 2921970SN/AProcess::free_fd(int tgt_fd) 2931970SN/A{ 2945282Srstrong@cs.ucsd.edu Process::FdMap *fdo = &fd_map[tgt_fd]; 2955282Srstrong@cs.ucsd.edu if (fdo->fd == -1) 2961970SN/A warn("Process::free_fd: request to free unused fd %d", tgt_fd); 2971970SN/A 2985282Srstrong@cs.ucsd.edu fdo->fd = -1; 2995282Srstrong@cs.ucsd.edu fdo->filename = "NULL"; 3005282Srstrong@cs.ucsd.edu fdo->mode = 0; 3015282Srstrong@cs.ucsd.edu fdo->fileOffset = 0; 3025282Srstrong@cs.ucsd.edu fdo->flags = 0; 3035282Srstrong@cs.ucsd.edu fdo->isPipe = false; 3045282Srstrong@cs.ucsd.edu fdo->readPipeSource = 0; 3052SN/A} 3062SN/A 3072SN/A 3082SN/A// look up simulator fd for given target fd 3092SN/Aint 3102SN/AProcess::sim_fd(int tgt_fd) 3112SN/A{ 3128324Ssteve.reinhardt@amd.com if (tgt_fd < 0 || tgt_fd > MAX_FD) 3132SN/A return -1; 3142SN/A 3155282Srstrong@cs.ucsd.edu return fd_map[tgt_fd].fd; 3162SN/A} 3172SN/A 3185282Srstrong@cs.ucsd.eduProcess::FdMap * 3195282Srstrong@cs.ucsd.eduProcess::sim_fd_obj(int tgt_fd) 3205282Srstrong@cs.ucsd.edu{ 3218324Ssteve.reinhardt@amd.com if (tgt_fd < 0 || tgt_fd > MAX_FD) 3228324Ssteve.reinhardt@amd.com return NULL; 3235282Srstrong@cs.ucsd.edu 3245282Srstrong@cs.ucsd.edu return &fd_map[tgt_fd]; 3255282Srstrong@cs.ucsd.edu} 3267487Ssteve.reinhardt@amd.com 3278601Ssteve.reinhardt@amd.comvoid 3288601Ssteve.reinhardt@amd.comProcess::allocateMem(Addr vaddr, int64_t size, bool clobber) 3298601Ssteve.reinhardt@amd.com{ 3308601Ssteve.reinhardt@amd.com int npages = divCeil(size, (int64_t)VMPageSize); 3318601Ssteve.reinhardt@amd.com Addr paddr = system->allocPhysPages(npages); 3328601Ssteve.reinhardt@amd.com pTable->map(vaddr, paddr, size, clobber); 3338601Ssteve.reinhardt@amd.com} 3348601Ssteve.reinhardt@amd.com 3354434Ssaidi@eecs.umich.edubool 3368539Sgblack@eecs.umich.eduProcess::fixupStackFault(Addr vaddr) 3374434Ssaidi@eecs.umich.edu{ 3388539Sgblack@eecs.umich.edu // Check if this is already on the stack and there's just no page there 3398539Sgblack@eecs.umich.edu // yet. 3404434Ssaidi@eecs.umich.edu if (vaddr >= stack_min && vaddr < stack_base) { 3418601Ssteve.reinhardt@amd.com allocateMem(roundDown(vaddr, VMPageSize), VMPageSize); 3424434Ssaidi@eecs.umich.edu return true; 3434434Ssaidi@eecs.umich.edu } 3444434Ssaidi@eecs.umich.edu 3458539Sgblack@eecs.umich.edu // We've accessed the next page of the stack, so extend it to include 3468539Sgblack@eecs.umich.edu // this address. 3475154Sgblack@eecs.umich.edu if (vaddr < stack_min && vaddr >= stack_base - max_stack_size) { 3485154Sgblack@eecs.umich.edu while (vaddr < stack_min) { 3495154Sgblack@eecs.umich.edu stack_min -= TheISA::PageBytes; 3508539Sgblack@eecs.umich.edu if (stack_base - stack_min > max_stack_size) 3515154Sgblack@eecs.umich.edu fatal("Maximum stack size exceeded\n"); 3528601Ssteve.reinhardt@amd.com allocateMem(stack_min, TheISA::PageBytes); 3535823Ssaidi@eecs.umich.edu inform("Increasing stack size by one page."); 3545154Sgblack@eecs.umich.edu }; 3554434Ssaidi@eecs.umich.edu return true; 3564434Ssaidi@eecs.umich.edu } 3574434Ssaidi@eecs.umich.edu return false; 3584434Ssaidi@eecs.umich.edu} 3594434Ssaidi@eecs.umich.edu 3607487Ssteve.reinhardt@amd.com// find all offsets for currently open files and save them 3615282Srstrong@cs.ucsd.eduvoid 3627487Ssteve.reinhardt@amd.comProcess::fix_file_offsets() 3637487Ssteve.reinhardt@amd.com{ 3645282Srstrong@cs.ucsd.edu Process::FdMap *fdo_stdin = &fd_map[STDIN_FILENO]; 3655282Srstrong@cs.ucsd.edu Process::FdMap *fdo_stdout = &fd_map[STDOUT_FILENO]; 3665282Srstrong@cs.ucsd.edu Process::FdMap *fdo_stderr = &fd_map[STDERR_FILENO]; 3675282Srstrong@cs.ucsd.edu string in = fdo_stdin->filename; 3685282Srstrong@cs.ucsd.edu string out = fdo_stdout->filename; 3695514SMichael.Adler@intel.com string err = fdo_stderr->filename; 3705282Srstrong@cs.ucsd.edu 3715282Srstrong@cs.ucsd.edu // initialize file descriptors to default: same as simulator 3725282Srstrong@cs.ucsd.edu int stdin_fd, stdout_fd, stderr_fd; 3735282Srstrong@cs.ucsd.edu 3745282Srstrong@cs.ucsd.edu if (in == "stdin" || in == "cin") 3755282Srstrong@cs.ucsd.edu stdin_fd = STDIN_FILENO; 3765282Srstrong@cs.ucsd.edu else if (in == "None") 3775282Srstrong@cs.ucsd.edu stdin_fd = -1; 3787487Ssteve.reinhardt@amd.com else { 3797487Ssteve.reinhardt@amd.com // open standard in and seek to the right location 3805282Srstrong@cs.ucsd.edu stdin_fd = Process::openInputFile(in); 3815282Srstrong@cs.ucsd.edu if (lseek(stdin_fd, fdo_stdin->fileOffset, SEEK_SET) < 0) 3825282Srstrong@cs.ucsd.edu panic("Unable to seek to correct location in file: %s", in); 3835282Srstrong@cs.ucsd.edu } 3845282Srstrong@cs.ucsd.edu 3855282Srstrong@cs.ucsd.edu if (out == "stdout" || out == "cout") 3865282Srstrong@cs.ucsd.edu stdout_fd = STDOUT_FILENO; 3875282Srstrong@cs.ucsd.edu else if (out == "stderr" || out == "cerr") 3885282Srstrong@cs.ucsd.edu stdout_fd = STDERR_FILENO; 3895282Srstrong@cs.ucsd.edu else if (out == "None") 3905282Srstrong@cs.ucsd.edu stdout_fd = -1; 3917487Ssteve.reinhardt@amd.com else { 3925282Srstrong@cs.ucsd.edu stdout_fd = Process::openOutputFile(out); 3935514SMichael.Adler@intel.com if (lseek(stdout_fd, fdo_stdout->fileOffset, SEEK_SET) < 0) 3945514SMichael.Adler@intel.com panic("Unable to seek to correct location in file: %s", out); 3955282Srstrong@cs.ucsd.edu } 3965282Srstrong@cs.ucsd.edu 3975514SMichael.Adler@intel.com if (err == "stdout" || err == "cout") 3985514SMichael.Adler@intel.com stderr_fd = STDOUT_FILENO; 3995514SMichael.Adler@intel.com else if (err == "stderr" || err == "cerr") 4005514SMichael.Adler@intel.com stderr_fd = STDERR_FILENO; 4015514SMichael.Adler@intel.com else if (err == "None") 4025514SMichael.Adler@intel.com stderr_fd = -1; 4035514SMichael.Adler@intel.com else if (err == out) 4045514SMichael.Adler@intel.com stderr_fd = stdout_fd; 4055514SMichael.Adler@intel.com else { 4065514SMichael.Adler@intel.com stderr_fd = Process::openOutputFile(err); 4075514SMichael.Adler@intel.com if (lseek(stderr_fd, fdo_stderr->fileOffset, SEEK_SET) < 0) 4085514SMichael.Adler@intel.com panic("Unable to seek to correct location in file: %s", err); 4095514SMichael.Adler@intel.com } 4105282Srstrong@cs.ucsd.edu 4115282Srstrong@cs.ucsd.edu fdo_stdin->fd = stdin_fd; 4125282Srstrong@cs.ucsd.edu fdo_stdout->fd = stdout_fd; 4135282Srstrong@cs.ucsd.edu fdo_stderr->fd = stderr_fd; 4145282Srstrong@cs.ucsd.edu 4155282Srstrong@cs.ucsd.edu 4165282Srstrong@cs.ucsd.edu for (int free_fd = 3; free_fd <= MAX_FD; ++free_fd) { 4175282Srstrong@cs.ucsd.edu Process::FdMap *fdo = &fd_map[free_fd]; 4185282Srstrong@cs.ucsd.edu if (fdo->fd != -1) { 4195282Srstrong@cs.ucsd.edu if (fdo->isPipe){ 4205282Srstrong@cs.ucsd.edu if (fdo->filename == "PIPE-WRITE") 4215282Srstrong@cs.ucsd.edu continue; 4225282Srstrong@cs.ucsd.edu else { 4235282Srstrong@cs.ucsd.edu assert (fdo->filename == "PIPE-READ"); 4245282Srstrong@cs.ucsd.edu //create a new pipe 4255282Srstrong@cs.ucsd.edu int fds[2]; 4265282Srstrong@cs.ucsd.edu int pipe_retval = pipe(fds); 4275282Srstrong@cs.ucsd.edu 4285282Srstrong@cs.ucsd.edu if (pipe_retval < 0) { 4295282Srstrong@cs.ucsd.edu // error 4305282Srstrong@cs.ucsd.edu panic("Unable to create new pipe."); 4315282Srstrong@cs.ucsd.edu } 4325282Srstrong@cs.ucsd.edu fdo->fd = fds[0]; //set read pipe 4335282Srstrong@cs.ucsd.edu Process::FdMap *fdo_write = &fd_map[fdo->readPipeSource]; 4345282Srstrong@cs.ucsd.edu if (fdo_write->filename != "PIPE-WRITE") 4355282Srstrong@cs.ucsd.edu panic ("Couldn't find write end of the pipe"); 4365282Srstrong@cs.ucsd.edu 4375282Srstrong@cs.ucsd.edu fdo_write->fd = fds[1];//set write pipe 4385282Srstrong@cs.ucsd.edu } 4395282Srstrong@cs.ucsd.edu } else { 4405282Srstrong@cs.ucsd.edu //Open file 4415282Srstrong@cs.ucsd.edu int fd = open(fdo->filename.c_str(), fdo->flags, fdo->mode); 4425282Srstrong@cs.ucsd.edu 4435282Srstrong@cs.ucsd.edu if (fd == -1) 4445282Srstrong@cs.ucsd.edu panic("Unable to open file: %s", fdo->filename); 4455282Srstrong@cs.ucsd.edu fdo->fd = fd; 4465282Srstrong@cs.ucsd.edu 4475282Srstrong@cs.ucsd.edu //Seek to correct location before checkpoint 4485282Srstrong@cs.ucsd.edu if (lseek(fd,fdo->fileOffset, SEEK_SET) < 0) 4497487Ssteve.reinhardt@amd.com panic("Unable to seek to correct location in file: %s", 4507487Ssteve.reinhardt@amd.com fdo->filename); 4515282Srstrong@cs.ucsd.edu } 4525282Srstrong@cs.ucsd.edu } 4535282Srstrong@cs.ucsd.edu } 4545282Srstrong@cs.ucsd.edu} 4557487Ssteve.reinhardt@amd.com 4565282Srstrong@cs.ucsd.eduvoid 4577487Ssteve.reinhardt@amd.comProcess::find_file_offsets() 4587487Ssteve.reinhardt@amd.com{ 4595282Srstrong@cs.ucsd.edu for (int free_fd = 0; free_fd <= MAX_FD; ++free_fd) { 4605282Srstrong@cs.ucsd.edu Process::FdMap *fdo = &fd_map[free_fd]; 4615282Srstrong@cs.ucsd.edu if (fdo->fd != -1) { 4625282Srstrong@cs.ucsd.edu fdo->fileOffset = lseek(fdo->fd, 0, SEEK_CUR); 4637487Ssteve.reinhardt@amd.com } else { 4645282Srstrong@cs.ucsd.edu fdo->filename = "NULL"; 4655282Srstrong@cs.ucsd.edu fdo->fileOffset = 0; 4665282Srstrong@cs.ucsd.edu } 4675282Srstrong@cs.ucsd.edu } 4685282Srstrong@cs.ucsd.edu} 4695282Srstrong@cs.ucsd.edu 4705282Srstrong@cs.ucsd.eduvoid 4717487Ssteve.reinhardt@amd.comProcess::setReadPipeSource(int read_pipe_fd, int source_fd) 4727487Ssteve.reinhardt@amd.com{ 4735282Srstrong@cs.ucsd.edu Process::FdMap *fdo = &fd_map[read_pipe_fd]; 4745282Srstrong@cs.ucsd.edu fdo->readPipeSource = source_fd; 4755282Srstrong@cs.ucsd.edu} 4765282Srstrong@cs.ucsd.edu 4775282Srstrong@cs.ucsd.eduvoid 4785282Srstrong@cs.ucsd.eduProcess::FdMap::serialize(std::ostream &os) 4795282Srstrong@cs.ucsd.edu{ 4805282Srstrong@cs.ucsd.edu SERIALIZE_SCALAR(fd); 4815282Srstrong@cs.ucsd.edu SERIALIZE_SCALAR(isPipe); 4825282Srstrong@cs.ucsd.edu SERIALIZE_SCALAR(filename); 4835282Srstrong@cs.ucsd.edu SERIALIZE_SCALAR(flags); 4845282Srstrong@cs.ucsd.edu SERIALIZE_SCALAR(readPipeSource); 4855282Srstrong@cs.ucsd.edu SERIALIZE_SCALAR(fileOffset); 4865282Srstrong@cs.ucsd.edu} 4875282Srstrong@cs.ucsd.edu 4885282Srstrong@cs.ucsd.eduvoid 4895282Srstrong@cs.ucsd.eduProcess::FdMap::unserialize(Checkpoint *cp, const std::string §ion) 4905282Srstrong@cs.ucsd.edu{ 4915282Srstrong@cs.ucsd.edu UNSERIALIZE_SCALAR(fd); 4925282Srstrong@cs.ucsd.edu UNSERIALIZE_SCALAR(isPipe); 4935282Srstrong@cs.ucsd.edu UNSERIALIZE_SCALAR(filename); 4945282Srstrong@cs.ucsd.edu UNSERIALIZE_SCALAR(flags); 4955282Srstrong@cs.ucsd.edu UNSERIALIZE_SCALAR(readPipeSource); 4965282Srstrong@cs.ucsd.edu UNSERIALIZE_SCALAR(fileOffset); 4975282Srstrong@cs.ucsd.edu} 4985282Srstrong@cs.ucsd.edu 4993311Ssaidi@eecs.umich.eduvoid 5003311Ssaidi@eecs.umich.eduProcess::serialize(std::ostream &os) 5013311Ssaidi@eecs.umich.edu{ 5023311Ssaidi@eecs.umich.edu SERIALIZE_SCALAR(brk_point); 5033311Ssaidi@eecs.umich.edu SERIALIZE_SCALAR(stack_base); 5043311Ssaidi@eecs.umich.edu SERIALIZE_SCALAR(stack_size); 5053311Ssaidi@eecs.umich.edu SERIALIZE_SCALAR(stack_min); 5063311Ssaidi@eecs.umich.edu SERIALIZE_SCALAR(next_thread_stack_base); 5073311Ssaidi@eecs.umich.edu SERIALIZE_SCALAR(mmap_start); 5083311Ssaidi@eecs.umich.edu SERIALIZE_SCALAR(mmap_end); 5093311Ssaidi@eecs.umich.edu SERIALIZE_SCALAR(nxm_start); 5103311Ssaidi@eecs.umich.edu SERIALIZE_SCALAR(nxm_end); 5115282Srstrong@cs.ucsd.edu find_file_offsets(); 5125282Srstrong@cs.ucsd.edu pTable->serialize(os); 5135282Srstrong@cs.ucsd.edu for (int x = 0; x <= MAX_FD; x++) { 5145282Srstrong@cs.ucsd.edu nameOut(os, csprintf("%s.FdMap%d", name(), x)); 5155282Srstrong@cs.ucsd.edu fd_map[x].serialize(os); 5165282Srstrong@cs.ucsd.edu } 5176820SLisa.Hsu@amd.com SERIALIZE_SCALAR(M5_pid); 5183311Ssaidi@eecs.umich.edu 5193311Ssaidi@eecs.umich.edu} 5203311Ssaidi@eecs.umich.edu 5213311Ssaidi@eecs.umich.eduvoid 5223311Ssaidi@eecs.umich.eduProcess::unserialize(Checkpoint *cp, const std::string §ion) 5233311Ssaidi@eecs.umich.edu{ 5243311Ssaidi@eecs.umich.edu UNSERIALIZE_SCALAR(brk_point); 5253311Ssaidi@eecs.umich.edu UNSERIALIZE_SCALAR(stack_base); 5263311Ssaidi@eecs.umich.edu UNSERIALIZE_SCALAR(stack_size); 5273311Ssaidi@eecs.umich.edu UNSERIALIZE_SCALAR(stack_min); 5283311Ssaidi@eecs.umich.edu UNSERIALIZE_SCALAR(next_thread_stack_base); 5293311Ssaidi@eecs.umich.edu UNSERIALIZE_SCALAR(mmap_start); 5303311Ssaidi@eecs.umich.edu UNSERIALIZE_SCALAR(mmap_end); 5313311Ssaidi@eecs.umich.edu UNSERIALIZE_SCALAR(nxm_start); 5323311Ssaidi@eecs.umich.edu UNSERIALIZE_SCALAR(nxm_end); 5333311Ssaidi@eecs.umich.edu pTable->unserialize(cp, section); 5345282Srstrong@cs.ucsd.edu for (int x = 0; x <= MAX_FD; x++) { 5355282Srstrong@cs.ucsd.edu fd_map[x].unserialize(cp, csprintf("%s.FdMap%d", section, x)); 5367487Ssteve.reinhardt@amd.com } 5375282Srstrong@cs.ucsd.edu fix_file_offsets(); 5386820SLisa.Hsu@amd.com UNSERIALIZE_OPT_SCALAR(M5_pid); 5396820SLisa.Hsu@amd.com // The above returns a bool so that you could do something if you don't 5406820SLisa.Hsu@amd.com // find the param in the checkpoint if you wanted to, like set a default 5416820SLisa.Hsu@amd.com // but in this case we'll just stick with the instantianted value if not 5426820SLisa.Hsu@amd.com // found. 5433311Ssaidi@eecs.umich.edu} 5442SN/A 5452SN/A 5469110Ssteve.reinhardt@amd.combool 5479110Ssteve.reinhardt@amd.comProcess::map(Addr vaddr, Addr paddr, int size) 5489110Ssteve.reinhardt@amd.com{ 5499110Ssteve.reinhardt@amd.com pTable->map(vaddr, paddr, size); 5509110Ssteve.reinhardt@amd.com return true; 5519110Ssteve.reinhardt@amd.com} 5529110Ssteve.reinhardt@amd.com 5539110Ssteve.reinhardt@amd.com 5542SN/A//////////////////////////////////////////////////////////////////////// 5552SN/A// 5562SN/A// LiveProcess member definitions 5572SN/A// 5582SN/A//////////////////////////////////////////////////////////////////////// 5592SN/A 56012SN/A 5615154Sgblack@eecs.umich.eduLiveProcess::LiveProcess(LiveProcessParams * params, ObjectFile *_objFile) 5625154Sgblack@eecs.umich.edu : Process(params), objFile(_objFile), 5635154Sgblack@eecs.umich.edu argv(params->cmd), envp(params->env), cwd(params->cwd) 5642SN/A{ 5655154Sgblack@eecs.umich.edu __uid = params->uid; 5665154Sgblack@eecs.umich.edu __euid = params->euid; 5675154Sgblack@eecs.umich.edu __gid = params->gid; 5685154Sgblack@eecs.umich.edu __egid = params->egid; 5695154Sgblack@eecs.umich.edu __pid = params->pid; 5705154Sgblack@eecs.umich.edu __ppid = params->ppid; 5713114Sgblack@eecs.umich.edu 5721158SN/A // load up symbols, if any... these may be used for debugging or 5731158SN/A // profiling. 5741158SN/A if (!debugSymbolTable) { 5751158SN/A debugSymbolTable = new SymbolTable(); 5761158SN/A if (!objFile->loadGlobalSymbols(debugSymbolTable) || 5779641Sguodeyuan@tsinghua.org.cn !objFile->loadLocalSymbols(debugSymbolTable) || 5789641Sguodeyuan@tsinghua.org.cn !objFile->loadWeakSymbols(debugSymbolTable)) { 5791158SN/A // didn't load any symbols 5801158SN/A delete debugSymbolTable; 5811158SN/A debugSymbolTable = NULL; 5821158SN/A } 5831158SN/A } 5842378SN/A} 5851158SN/A 5862378SN/Avoid 5872680Sktlim@umich.eduLiveProcess::syscall(int64_t callnum, ThreadContext *tc) 5882093SN/A{ 5892093SN/A num_syscalls++; 5902093SN/A 5912093SN/A SyscallDesc *desc = getDesc(callnum); 5922093SN/A if (desc == NULL) 5932093SN/A fatal("Syscall %d out of range", callnum); 5942093SN/A 5952680Sktlim@umich.edu desc->doSyscall(callnum, this, tc); 5962093SN/A} 5972SN/A 5986701Sgblack@eecs.umich.eduIntReg 5996701Sgblack@eecs.umich.eduLiveProcess::getSyscallArg(ThreadContext *tc, int &i, int width) 6006701Sgblack@eecs.umich.edu{ 6016701Sgblack@eecs.umich.edu return getSyscallArg(tc, i); 6026701Sgblack@eecs.umich.edu} 6036701Sgblack@eecs.umich.edu 6042715Sstever@eecs.umich.eduLiveProcess * 6055154Sgblack@eecs.umich.eduLiveProcess::create(LiveProcessParams * params) 6062715Sstever@eecs.umich.edu{ 6072715Sstever@eecs.umich.edu LiveProcess *process = NULL; 6082715Sstever@eecs.umich.edu 6095154Sgblack@eecs.umich.edu string executable = 6105154Sgblack@eecs.umich.edu params->executable == "" ? params->cmd[0] : params->executable; 6112715Sstever@eecs.umich.edu ObjectFile *objFile = createObjectFile(executable); 6122715Sstever@eecs.umich.edu if (objFile == NULL) { 6132715Sstever@eecs.umich.edu fatal("Can't load object file %s", executable); 6142715Sstever@eecs.umich.edu } 6152715Sstever@eecs.umich.edu 6163917Ssaidi@eecs.umich.edu if (objFile->isDynamic()) 6173917Ssaidi@eecs.umich.edu fatal("Object file is a dynamic executable however only static " 6185070Ssaidi@eecs.umich.edu "executables are supported!\n Please recompile your " 6193917Ssaidi@eecs.umich.edu "executable as a static binary and try again.\n"); 6203917Ssaidi@eecs.umich.edu 6215089Sgblack@eecs.umich.edu#if THE_ISA == ALPHA_ISA 6225753Ssteve.reinhardt@amd.com if (objFile->getArch() != ObjectFile::Alpha) 6235753Ssteve.reinhardt@amd.com fatal("Object file architecture does not match compiled ISA (Alpha)."); 6245753Ssteve.reinhardt@amd.com 6252715Sstever@eecs.umich.edu switch (objFile->getOpSys()) { 6262715Sstever@eecs.umich.edu case ObjectFile::Tru64: 6275154Sgblack@eecs.umich.edu process = new AlphaTru64Process(params, objFile); 6282715Sstever@eecs.umich.edu break; 6292715Sstever@eecs.umich.edu 6305753Ssteve.reinhardt@amd.com case ObjectFile::UnknownOpSys: 6315753Ssteve.reinhardt@amd.com warn("Unknown operating system; assuming Linux."); 6325753Ssteve.reinhardt@amd.com // fall through 6332715Sstever@eecs.umich.edu case ObjectFile::Linux: 6345154Sgblack@eecs.umich.edu process = new AlphaLinuxProcess(params, objFile); 6352715Sstever@eecs.umich.edu break; 6362715Sstever@eecs.umich.edu 6372715Sstever@eecs.umich.edu default: 6382715Sstever@eecs.umich.edu fatal("Unknown/unsupported operating system."); 6392715Sstever@eecs.umich.edu } 6402715Sstever@eecs.umich.edu#elif THE_ISA == SPARC_ISA 6415753Ssteve.reinhardt@amd.com if (objFile->getArch() != ObjectFile::SPARC64 && 6425753Ssteve.reinhardt@amd.com objFile->getArch() != ObjectFile::SPARC32) 6432715Sstever@eecs.umich.edu fatal("Object file architecture does not match compiled ISA (SPARC)."); 6442715Sstever@eecs.umich.edu switch (objFile->getOpSys()) { 6455753Ssteve.reinhardt@amd.com case ObjectFile::UnknownOpSys: 6465753Ssteve.reinhardt@amd.com warn("Unknown operating system; assuming Linux."); 6475753Ssteve.reinhardt@amd.com // fall through 6482715Sstever@eecs.umich.edu case ObjectFile::Linux: 6494111Sgblack@eecs.umich.edu if (objFile->getArch() == ObjectFile::SPARC64) { 6505154Sgblack@eecs.umich.edu process = new Sparc64LinuxProcess(params, objFile); 6514111Sgblack@eecs.umich.edu } else { 6525154Sgblack@eecs.umich.edu process = new Sparc32LinuxProcess(params, objFile); 6534111Sgblack@eecs.umich.edu } 6542715Sstever@eecs.umich.edu break; 6552715Sstever@eecs.umich.edu 6562715Sstever@eecs.umich.edu 6572715Sstever@eecs.umich.edu case ObjectFile::Solaris: 6585154Sgblack@eecs.umich.edu process = new SparcSolarisProcess(params, objFile); 6592715Sstever@eecs.umich.edu break; 6605753Ssteve.reinhardt@amd.com 6612715Sstever@eecs.umich.edu default: 6622715Sstever@eecs.umich.edu fatal("Unknown/unsupported operating system."); 6632715Sstever@eecs.umich.edu } 6644157Sgblack@eecs.umich.edu#elif THE_ISA == X86_ISA 6655874Sgblack@eecs.umich.edu if (objFile->getArch() != ObjectFile::X86_64 && 6665874Sgblack@eecs.umich.edu objFile->getArch() != ObjectFile::I386) 6674166Sgblack@eecs.umich.edu fatal("Object file architecture does not match compiled ISA (x86)."); 6684157Sgblack@eecs.umich.edu switch (objFile->getOpSys()) { 6695753Ssteve.reinhardt@amd.com case ObjectFile::UnknownOpSys: 6705753Ssteve.reinhardt@amd.com warn("Unknown operating system; assuming Linux."); 6715753Ssteve.reinhardt@amd.com // fall through 6724166Sgblack@eecs.umich.edu case ObjectFile::Linux: 6735874Sgblack@eecs.umich.edu if (objFile->getArch() == ObjectFile::X86_64) { 6745955Sgblack@eecs.umich.edu process = new X86_64LinuxProcess(params, objFile); 6755874Sgblack@eecs.umich.edu } else { 6765955Sgblack@eecs.umich.edu process = new I386LinuxProcess(params, objFile); 6775874Sgblack@eecs.umich.edu } 6784166Sgblack@eecs.umich.edu break; 6795753Ssteve.reinhardt@amd.com 6804157Sgblack@eecs.umich.edu default: 6814157Sgblack@eecs.umich.edu fatal("Unknown/unsupported operating system."); 6824157Sgblack@eecs.umich.edu } 6832715Sstever@eecs.umich.edu#elif THE_ISA == MIPS_ISA 6842715Sstever@eecs.umich.edu if (objFile->getArch() != ObjectFile::Mips) 6852715Sstever@eecs.umich.edu fatal("Object file architecture does not match compiled ISA (MIPS)."); 6862715Sstever@eecs.umich.edu switch (objFile->getOpSys()) { 6875753Ssteve.reinhardt@amd.com case ObjectFile::UnknownOpSys: 6885753Ssteve.reinhardt@amd.com warn("Unknown operating system; assuming Linux."); 6895753Ssteve.reinhardt@amd.com // fall through 6902715Sstever@eecs.umich.edu case ObjectFile::Linux: 6915154Sgblack@eecs.umich.edu process = new MipsLinuxProcess(params, objFile); 6922715Sstever@eecs.umich.edu break; 6932715Sstever@eecs.umich.edu 6942715Sstever@eecs.umich.edu default: 6952715Sstever@eecs.umich.edu fatal("Unknown/unsupported operating system."); 6962715Sstever@eecs.umich.edu } 6975335Shines@cs.fsu.edu#elif THE_ISA == ARM_ISA 6987095Sgblack@eecs.umich.edu if (objFile->getArch() != ObjectFile::Arm && 6997095Sgblack@eecs.umich.edu objFile->getArch() != ObjectFile::Thumb) 7005335Shines@cs.fsu.edu fatal("Object file architecture does not match compiled ISA (ARM)."); 7015335Shines@cs.fsu.edu switch (objFile->getOpSys()) { 7025753Ssteve.reinhardt@amd.com case ObjectFile::UnknownOpSys: 7035753Ssteve.reinhardt@amd.com warn("Unknown operating system; assuming Linux."); 7045753Ssteve.reinhardt@amd.com // fall through 7055335Shines@cs.fsu.edu case ObjectFile::Linux: 7067096Sgblack@eecs.umich.edu process = new ArmLinuxProcess(params, objFile, objFile->getArch()); 7075335Shines@cs.fsu.edu break; 7086392Ssaidi@eecs.umich.edu case ObjectFile::LinuxArmOABI: 7096392Ssaidi@eecs.umich.edu fatal("M5 does not support ARM OABI binaries. Please recompile with an" 7106392Ssaidi@eecs.umich.edu " EABI compiler."); 7115335Shines@cs.fsu.edu default: 7125335Shines@cs.fsu.edu fatal("Unknown/unsupported operating system."); 7135335Shines@cs.fsu.edu } 7146691Stjones1@inf.ed.ac.uk#elif THE_ISA == POWER_ISA 7156691Stjones1@inf.ed.ac.uk if (objFile->getArch() != ObjectFile::Power) 7166691Stjones1@inf.ed.ac.uk fatal("Object file architecture does not match compiled ISA (Power)."); 7176691Stjones1@inf.ed.ac.uk switch (objFile->getOpSys()) { 7186691Stjones1@inf.ed.ac.uk case ObjectFile::UnknownOpSys: 7196691Stjones1@inf.ed.ac.uk warn("Unknown operating system; assuming Linux."); 7206691Stjones1@inf.ed.ac.uk // fall through 7216691Stjones1@inf.ed.ac.uk case ObjectFile::Linux: 7226691Stjones1@inf.ed.ac.uk process = new PowerLinuxProcess(params, objFile); 7236691Stjones1@inf.ed.ac.uk break; 7246691Stjones1@inf.ed.ac.uk 7256691Stjones1@inf.ed.ac.uk default: 7266691Stjones1@inf.ed.ac.uk fatal("Unknown/unsupported operating system."); 7276691Stjones1@inf.ed.ac.uk } 7282715Sstever@eecs.umich.edu#else 7292715Sstever@eecs.umich.edu#error "THE_ISA not set" 7302715Sstever@eecs.umich.edu#endif 7312715Sstever@eecs.umich.edu 7322715Sstever@eecs.umich.edu if (process == NULL) 7332715Sstever@eecs.umich.edu fatal("Unknown error creating process object."); 7342715Sstever@eecs.umich.edu return process; 7352715Sstever@eecs.umich.edu} 7362715Sstever@eecs.umich.edu 7374762Snate@binkert.orgLiveProcess * 7384762Snate@binkert.orgLiveProcessParams::create() 7392715Sstever@eecs.umich.edu{ 7405154Sgblack@eecs.umich.edu return LiveProcess::create(this); 7412715Sstever@eecs.umich.edu} 742