process.cc revision 2207
12632SN/A/*
22632SN/A * Copyright (c) 2003-2004 The Regents of The University of Michigan
32632SN/A * All rights reserved.
42632SN/A *
52632SN/A * Redistribution and use in source and binary forms, with or without
62632SN/A * modification, are permitted provided that the following conditions are
72632SN/A * met: redistributions of source code must retain the above copyright
82632SN/A * notice, this list of conditions and the following disclaimer;
92632SN/A * redistributions in binary form must reproduce the above copyright
102632SN/A * notice, this list of conditions and the following disclaimer in the
112632SN/A * documentation and/or other materials provided with the distribution;
122632SN/A * neither the name of the copyright holders nor the names of its
132632SN/A * contributors may be used to endorse or promote products derived from
142632SN/A * this software without specific prior written permission.
152632SN/A *
162632SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172632SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182632SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192632SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202632SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212632SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222632SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232632SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242632SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252632SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262632SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272632SN/A */
282632SN/A
292632SN/A#include "arch/mips/process.hh"
302632SN/A
312632SN/Anamespace MipsISA
322632SN/A{
332632SN/A
342632SN/ALiveProcess *
352632SN/AcreateProcess(const string &nm, ObjectFile * objFile,
362632SN/A        int stdin_fd, int stdout_fd, int stderr_fd,
372632SN/A        vector<string> &argv, vector<string> &envp)
382632SN/A{
392632SN/A    LiveProcess * process = NULL;
402632SN/A    if (objFile->getArch() != ObjectFile::MIPS)
412632SN/A        fatal("Object file does not match architecture.");
422632SN/A    switch (objFile->getOpSys()) {
432632SN/A      case ObjectFile::Linux:
442632SN/A        process = new MipsLinuxProcess(nm, objFile,
452632SN/A                                        stdin_fd, stdout_fd, stderr_fd,
462632SN/A                                        argv, envp);
472632SN/A        break;
482632SN/A
492632SN/A      default:
502632SN/A        fatal("Unknown/unsupported operating system.");
512632SN/A    }
522632SN/A    return process;
532632SN/A}
542632SN/A
552632SN/A} // namespace MipsISA
562632SN/A
572632SN/A