process.cc revision 2207
18012Ssaidi@eecs.umich.edu/*
28029Snate@binkert.org * Copyright (c) 2003-2004 The Regents of The University of Michigan
38029Snate@binkert.org * All rights reserved.
48013Sbinkertn@umich.edu *
58029Snate@binkert.org * Redistribution and use in source and binary forms, with or without
68029Snate@binkert.org * modification, are permitted provided that the following conditions are
78029Snate@binkert.org * met: redistributions of source code must retain the above copyright
88029Snate@binkert.org * notice, this list of conditions and the following disclaimer;
98029Snate@binkert.org * redistributions in binary form must reproduce the above copyright
108029Snate@binkert.org * notice, this list of conditions and the following disclaimer in the
118029Snate@binkert.org * documentation and/or other materials provided with the distribution;
128029Snate@binkert.org * neither the name of the copyright holders nor the names of its
138029Snate@binkert.org * contributors may be used to endorse or promote products derived from
148029Snate@binkert.org * this software without specific prior written permission.
158013Sbinkertn@umich.edu *
168029Snate@binkert.org * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
178029Snate@binkert.org * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
188029Snate@binkert.org * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
198029Snate@binkert.org * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
208029Snate@binkert.org * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
218029Snate@binkert.org * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
228029Snate@binkert.org * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
238029Snate@binkert.org * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
248029Snate@binkert.org * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
258029Snate@binkert.org * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
268029Snate@binkert.org * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
278013Sbinkertn@umich.edu */
288012Ssaidi@eecs.umich.edu
297997Ssaidi@eecs.umich.edu#include "arch/alpha/process.hh"
307997Ssaidi@eecs.umich.edu
317997Ssaidi@eecs.umich.edunamespace AlphaISA
327997Ssaidi@eecs.umich.edu{
337997Ssaidi@eecs.umich.edu
347997Ssaidi@eecs.umich.eduLiveProcess *
358013Sbinkertn@umich.educreateProcess(const std::string &nm, ObjectFile * objFile,
368013Sbinkertn@umich.edu        int stdin_fd, int stdout_fd, int stderr_fd,
378013Sbinkertn@umich.edu        std::vector<std::string> &argv, std::vector<std::string> &envp)
388013Sbinkertn@umich.edu{
398013Sbinkertn@umich.edu    LiveProcess * process = NULL;
408013Sbinkertn@umich.edu    if (objFile->getArch() != ObjectFile::Alpha)
418013Sbinkertn@umich.edu        fatal("Object file does not match architecture.");
428013Sbinkertn@umich.edu    switch (objFile->getOpSys()) {
438013Sbinkertn@umich.edu      case ObjectFile::Tru64:
448013Sbinkertn@umich.edu        process = new AlphaTru64Process(nm, objFile,
458013Sbinkertn@umich.edu                                        stdin_fd, stdout_fd, stderr_fd,
468013Sbinkertn@umich.edu                                        argv, envp);
478013Sbinkertn@umich.edu        break;
487997Ssaidi@eecs.umich.edu
497997Ssaidi@eecs.umich.edu      case ObjectFile::Linux:
507997Ssaidi@eecs.umich.edu        process = new AlphaLinuxProcess(nm, objFile,
517997Ssaidi@eecs.umich.edu                                        stdin_fd, stdout_fd, stderr_fd,
527997Ssaidi@eecs.umich.edu                                        argv, envp);
537997Ssaidi@eecs.umich.edu        break;
547997Ssaidi@eecs.umich.edu
557997Ssaidi@eecs.umich.edu      default:
567997Ssaidi@eecs.umich.edu        fatal("Unknown/unsupported operating system.");
577997Ssaidi@eecs.umich.edu    }
587997Ssaidi@eecs.umich.edu    return process;
597997Ssaidi@eecs.umich.edu}
607997Ssaidi@eecs.umich.edu
617997Ssaidi@eecs.umich.edu} // namespace AlphaISA
627997Ssaidi@eecs.umich.edu