16019Shines@cs.fsu.edu/*
210037SARM gem5 Developers* Copyright (c) 2011-2012 ARM Limited
310037SARM gem5 Developers * All rights reserved
410037SARM gem5 Developers *
510037SARM gem5 Developers * The license below extends only to copyright in the software and shall
610037SARM gem5 Developers * not be construed as granting a license to any other intellectual
710037SARM gem5 Developers * property including but not limited to intellectual property relating
810037SARM gem5 Developers * to a hardware implementation of the functionality of the software
910037SARM gem5 Developers * licensed hereunder.  You may use the software subject to the license
1010037SARM gem5 Developers * terms below provided that you ensure that this notice is replicated
1110037SARM gem5 Developers * unmodified and in its entirety in all distributions of the software,
1210037SARM gem5 Developers * modified or unmodified, in source code or in binary form.
1310037SARM gem5 Developers *
146019Shines@cs.fsu.edu * Copyright (c) 2007-2008 The Florida State University
156019Shines@cs.fsu.edu * All rights reserved.
166019Shines@cs.fsu.edu *
176019Shines@cs.fsu.edu * Redistribution and use in source and binary forms, with or without
186019Shines@cs.fsu.edu * modification, are permitted provided that the following conditions are
196019Shines@cs.fsu.edu * met: redistributions of source code must retain the above copyright
206019Shines@cs.fsu.edu * notice, this list of conditions and the following disclaimer;
216019Shines@cs.fsu.edu * redistributions in binary form must reproduce the above copyright
226019Shines@cs.fsu.edu * notice, this list of conditions and the following disclaimer in the
236019Shines@cs.fsu.edu * documentation and/or other materials provided with the distribution;
246019Shines@cs.fsu.edu * neither the name of the copyright holders nor the names of its
256019Shines@cs.fsu.edu * contributors may be used to endorse or promote products derived from
266019Shines@cs.fsu.edu * this software without specific prior written permission.
276019Shines@cs.fsu.edu *
286019Shines@cs.fsu.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
296019Shines@cs.fsu.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
306019Shines@cs.fsu.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
316019Shines@cs.fsu.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
326019Shines@cs.fsu.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
336019Shines@cs.fsu.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
346019Shines@cs.fsu.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
356019Shines@cs.fsu.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
366019Shines@cs.fsu.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
376019Shines@cs.fsu.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
386019Shines@cs.fsu.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
396019Shines@cs.fsu.edu *
406019Shines@cs.fsu.edu * Authors: Stephen Hines
416019Shines@cs.fsu.edu */
426019Shines@cs.fsu.edu
436019Shines@cs.fsu.edu#ifndef __ARM_LINUX_PROCESS_HH__
446019Shines@cs.fsu.edu#define __ARM_LINUX_PROCESS_HH__
456019Shines@cs.fsu.edu
4610037SARM gem5 Developers#include <vector>
4710037SARM gem5 Developers
486019Shines@cs.fsu.edu#include "arch/arm/process.hh"
496019Shines@cs.fsu.edu
5010037SARM gem5 Developersclass ArmLinuxProcessBits
5110037SARM gem5 Developers{
5210037SARM gem5 Developers  protected:
5310037SARM gem5 Developers    SyscallDesc* getLinuxDesc(int callnum);
5410037SARM gem5 Developers
5510037SARM gem5 Developers    struct SyscallTable
5610037SARM gem5 Developers    {
5710037SARM gem5 Developers        int base;
5810037SARM gem5 Developers        SyscallDesc *descs;
5910037SARM gem5 Developers        int size;
6010037SARM gem5 Developers
6110037SARM gem5 Developers        SyscallDesc *getDesc(int offset) const;
6210037SARM gem5 Developers    };
6310037SARM gem5 Developers
6410037SARM gem5 Developers    std::vector<SyscallTable> syscallTables;
6510037SARM gem5 Developers};
6610037SARM gem5 Developers
676019Shines@cs.fsu.edu/// A process with emulated Arm/Linux syscalls.
6811851Sbrandon.potter@amd.comclass ArmLinuxProcess32 : public ArmProcess32, public ArmLinuxProcessBits
696019Shines@cs.fsu.edu{
706019Shines@cs.fsu.edu  public:
7111851Sbrandon.potter@amd.com    ArmLinuxProcess32(ProcessParams * params, ObjectFile *objFile,
7210037SARM gem5 Developers                      ObjectFile::Arch _arch);
736019Shines@cs.fsu.edu
748216Ssaidi@eecs.umich.edu    void initState();
756233Sgblack@eecs.umich.edu
769552Sandreas.hansson@arm.com    /// Explicitly import the otherwise hidden getSyscallArg
7711851Sbrandon.potter@amd.com    using ArmProcess::getSyscallArg;
786019Shines@cs.fsu.edu
796233Sgblack@eecs.umich.edu    /// A page to hold "kernel" provided functions. The name might be wrong.
806233Sgblack@eecs.umich.edu    static const Addr commPage;
816233Sgblack@eecs.umich.edu
8210037SARM gem5 Developers    SyscallDesc* getDesc(int callnum);
8310037SARM gem5 Developers};
846019Shines@cs.fsu.edu
8510037SARM gem5 Developers/// A process with emulated Arm/Linux syscalls.
8611851Sbrandon.potter@amd.comclass ArmLinuxProcess64 : public ArmProcess64, public ArmLinuxProcessBits
8710037SARM gem5 Developers{
8810037SARM gem5 Developers  public:
8911851Sbrandon.potter@amd.com    ArmLinuxProcess64(ProcessParams * params, ObjectFile *objFile,
9010037SARM gem5 Developers                      ObjectFile::Arch _arch);
916232Sgblack@eecs.umich.edu
9210037SARM gem5 Developers    void initState();
9310037SARM gem5 Developers    SyscallDesc* getDesc(int callnum);
946019Shines@cs.fsu.edu};
956019Shines@cs.fsu.edu
966019Shines@cs.fsu.edu#endif // __ARM_LINUX_PROCESS_HH__
97