linux.hh revision 6019
11897Sstever@eecs.umich.edu/*
24130Ssaidi@eecs.umich.edu * Copyright (c) 2003-2005 The Regents of The University of Michigan
31897Sstever@eecs.umich.edu * Copyright (c) 2007-2008 The Florida State University
41897Sstever@eecs.umich.edu * All rights reserved.
51897Sstever@eecs.umich.edu *
61897Sstever@eecs.umich.edu * Redistribution and use in source and binary forms, with or without
71897Sstever@eecs.umich.edu * modification, are permitted provided that the following conditions are
81897Sstever@eecs.umich.edu * met: redistributions of source code must retain the above copyright
91897Sstever@eecs.umich.edu * notice, this list of conditions and the following disclaimer;
101897Sstever@eecs.umich.edu * redistributions in binary form must reproduce the above copyright
111897Sstever@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the
121897Sstever@eecs.umich.edu * documentation and/or other materials provided with the distribution;
131897Sstever@eecs.umich.edu * neither the name of the copyright holders nor the names of its
141897Sstever@eecs.umich.edu * contributors may be used to endorse or promote products derived from
151897Sstever@eecs.umich.edu * this software without specific prior written permission.
161897Sstever@eecs.umich.edu *
171897Sstever@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
181897Sstever@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
191897Sstever@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
201897Sstever@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
211897Sstever@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
221897Sstever@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
231897Sstever@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
241897Sstever@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
251897Sstever@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
261897Sstever@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
271897Sstever@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
281897Sstever@eecs.umich.edu *
291897Sstever@eecs.umich.edu * Authors: Stephen Hines
301897Sstever@eecs.umich.edu */
311897Sstever@eecs.umich.edu
321897Sstever@eecs.umich.edu#ifndef __ARCH_ARM_LINUX_LINUX_HH__
331897Sstever@eecs.umich.edu#define __ARCH_ARM_LINUX_LINUX_HH__
344961Ssaidi@eecs.umich.edu
351897Sstever@eecs.umich.edu#include "kern/linux/linux.hh"
361897Sstever@eecs.umich.edu
371897Sstever@eecs.umich.educlass ArmLinux : public Linux
381897Sstever@eecs.umich.edu{
397047Snate@binkert.org  public:
408319Ssteve.reinhardt@amd.com
417047Snate@binkert.org    /// This table maps the target open() flags to the corresponding
428319Ssteve.reinhardt@amd.com    /// host open() flags.
4311706Sandreas.hansson@arm.com    static OpenFlagTransTable openFlagTable[];
448811Sandreas.hansson@arm.com
459850Sandreas.hansson@arm.com    /// Number of entries in openFlagTable[].
4611706Sandreas.hansson@arm.com    static const int NUM_OPEN_FLAGS;
4711706Sandreas.hansson@arm.com
4811706Sandreas.hansson@arm.com    //@{
4911706Sandreas.hansson@arm.com    /// open(2) flag values.
508811Sandreas.hansson@arm.com    static const int TGT_O_RDONLY	= 0x00000000;	//!< O_RDONLY
518811Sandreas.hansson@arm.com    static const int TGT_O_WRONLY	= 0x00000001;	//!< O_WRONLY
5210007Snilay@cs.wisc.edu    static const int TGT_O_RDWR	        = 0x00000002;	//!< O_RDWR
5311308Santhony.gutierrez@amd.com    static const int TGT_O_CREAT	= 0x00000100;	//!< O_CREAT
5411308Santhony.gutierrez@amd.com    static const int TGT_O_EXCL	        = 0x00000200;	//!< O_EXCL
557047Snate@binkert.org    static const int TGT_O_NOCTTY	= 0x00000400;	//!< O_NOCTTY
568811Sandreas.hansson@arm.com    static const int TGT_O_TRUNC	= 0x00001000;	//!< O_TRUNC
578811Sandreas.hansson@arm.com    static const int TGT_O_APPEND	= 0x00002000;	//!< O_APPEND
588811Sandreas.hansson@arm.com    static const int TGT_O_NONBLOCK     = 0x00004000;	//!< O_NONBLOCK
598319Ssteve.reinhardt@amd.com    static const int TGT_O_SYNC	        = 0x00010000;	//!< O_SYNC
608319Ssteve.reinhardt@amd.com    static const int TGT_FASYNC		= 0x00020000;	//!< FASYNC
618319Ssteve.reinhardt@amd.com    static const int TGT_O_DIRECT	= 0x00040000;	//!< O_DIRECT
628319Ssteve.reinhardt@amd.com    static const int TGT_O_LARGEFILE	= 0x00100000;	//!< O_LARGEFILE
638319Ssteve.reinhardt@amd.com    static const int TGT_O_DIRECTORY	= 0x00200000;	//!< O_DIRECTORY
648319Ssteve.reinhardt@amd.com    static const int TGT_O_NOFOLLOW	= 0x00400000;	//!< O_NOFOLLOW
658319Ssteve.reinhardt@amd.com    static const int TGT_O_NOATIME	= 0x01000000;	//!< O_NOATIME
667047Snate@binkert.org    //@}
678319Ssteve.reinhardt@amd.com
688319Ssteve.reinhardt@amd.com    /// For mmap().
697047Snate@binkert.org    static const unsigned TGT_MAP_ANONYMOUS = 0x800;
707047Snate@binkert.org
718319Ssteve.reinhardt@amd.com    //@{
728319Ssteve.reinhardt@amd.com    /// For getsysinfo().
738319Ssteve.reinhardt@amd.com    static const unsigned GSI_PLATFORM_NAME = 103;  //!< platform name as string
747047Snate@binkert.org    static const unsigned GSI_CPU_INFO = 59;	//!< CPU information
757047Snate@binkert.org    static const unsigned GSI_PROC_TYPE = 60;	//!< get proc_type
767047Snate@binkert.org    static const unsigned GSI_MAX_CPU = 30;         //!< max # cpu's on this machine
771897Sstever@eecs.umich.edu    static const unsigned GSI_CPUS_IN_BOX = 55;	//!< number of CPUs in system
781897Sstever@eecs.umich.edu    static const unsigned GSI_PHYSMEM = 19;	        //!< Physical memory in KB
791897Sstever@eecs.umich.edu    static const unsigned GSI_CLK_TCK = 42;	        //!< clock freq in Hz
801897Sstever@eecs.umich.edu    //@}
818319Ssteve.reinhardt@amd.com
828319Ssteve.reinhardt@amd.com    //@{
838319Ssteve.reinhardt@amd.com    /// For getrusage().
848319Ssteve.reinhardt@amd.com    static const int TGT_RUSAGE_SELF = 0;
858319Ssteve.reinhardt@amd.com    static const int TGT_RUSAGE_CHILDREN = -1;
868319Ssteve.reinhardt@amd.com    static const int TGT_RUSAGE_BOTH = -2;
878319Ssteve.reinhardt@amd.com    //@}
881897Sstever@eecs.umich.edu
898319Ssteve.reinhardt@amd.com    //@{
908811Sandreas.hansson@arm.com    /// For setsysinfo().
918319Ssteve.reinhardt@amd.com    static const unsigned SSI_IEEE_FP_CONTROL = 14; //!< ieee_set_fp_control()
928319Ssteve.reinhardt@amd.com    //@}
931897Sstever@eecs.umich.edu
947047Snate@binkert.org    //@{
957047Snate@binkert.org    /// ioctl() command codes.
961897Sstever@eecs.umich.edu    static const unsigned TIOCGETP_   = 0x40067408;
971897Sstever@eecs.umich.edu    static const unsigned TIOCSETP_   = 0x80067409;
984961Ssaidi@eecs.umich.edu    static const unsigned TIOCSETN_   = 0x8006740a;
994961Ssaidi@eecs.umich.edu    static const unsigned TIOCSETC_   = 0x80067411;
1004961Ssaidi@eecs.umich.edu    static const unsigned TIOCGETC_   = 0x40067412;
1014961Ssaidi@eecs.umich.edu    static const unsigned FIONREAD_   = 0x4004667f;
1024961Ssaidi@eecs.umich.edu    static const unsigned TIOCISATTY_ = 0x2000745e;
1034961Ssaidi@eecs.umich.edu    static const unsigned TIOCGETS_   = 0x402c7413;
1044961Ssaidi@eecs.umich.edu    static const unsigned TIOCGETA_   = 0x40127417;
1054961Ssaidi@eecs.umich.edu    //@}
1064961Ssaidi@eecs.umich.edu
1074961Ssaidi@eecs.umich.edu    /// For table().
1084961Ssaidi@eecs.umich.edu    static const int TBL_SYSINFO = 12;
1094961Ssaidi@eecs.umich.edu
1104961Ssaidi@eecs.umich.edu    /// Resource enumeration for getrlimit().
1114961Ssaidi@eecs.umich.edu    enum rlimit_resources {
1121897Sstever@eecs.umich.edu        TGT_RLIMIT_CPU = 0,
1138319Ssteve.reinhardt@amd.com        TGT_RLIMIT_FSIZE = 1,
1141897Sstever@eecs.umich.edu        TGT_RLIMIT_DATA = 2,
1158319Ssteve.reinhardt@amd.com        TGT_RLIMIT_STACK = 3,
1168319Ssteve.reinhardt@amd.com        TGT_RLIMIT_CORE = 4,
1178816Sgblack@eecs.umich.edu        TGT_RLIMIT_NOFILE = 5,
1188319Ssteve.reinhardt@amd.com        TGT_RLIMIT_AS = 6,
1198319Ssteve.reinhardt@amd.com        TGT_RLIMIT_RSS = 7,
1208319Ssteve.reinhardt@amd.com        TGT_RLIMIT_VMEM = 7,
1218811Sandreas.hansson@arm.com        TGT_RLIMIT_NPROC = 8,
1224961Ssaidi@eecs.umich.edu        TGT_RLIMIT_MEMLOCK = 9,
1238319Ssteve.reinhardt@amd.com        TGT_RLIMIT_LOCKS = 10
1248811Sandreas.hansson@arm.com    };
1258814Sgblack@eecs.umich.edu
1268319Ssteve.reinhardt@amd.com};
1278811Sandreas.hansson@arm.com
1288811Sandreas.hansson@arm.com#endif
1298811Sandreas.hansson@arm.com