linux.hh revision 2599
112837Sgabeblack@google.com/*
212837Sgabeblack@google.com * Copyright (c) 2003-2005 The Regents of The University of Michigan
312837Sgabeblack@google.com * All rights reserved.
412837Sgabeblack@google.com *
512837Sgabeblack@google.com * Redistribution and use in source and binary forms, with or without
612837Sgabeblack@google.com * modification, are permitted provided that the following conditions are
712837Sgabeblack@google.com * met: redistributions of source code must retain the above copyright
812837Sgabeblack@google.com * notice, this list of conditions and the following disclaimer;
912837Sgabeblack@google.com * redistributions in binary form must reproduce the above copyright
1012837Sgabeblack@google.com * notice, this list of conditions and the following disclaimer in the
1112837Sgabeblack@google.com * documentation and/or other materials provided with the distribution;
1212837Sgabeblack@google.com * neither the name of the copyright holders nor the names of its
1312837Sgabeblack@google.com * contributors may be used to endorse or promote products derived from
1412837Sgabeblack@google.com * this software without specific prior written permission.
1512837Sgabeblack@google.com *
1612837Sgabeblack@google.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1712837Sgabeblack@google.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1812837Sgabeblack@google.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1912837Sgabeblack@google.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2012837Sgabeblack@google.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2112837Sgabeblack@google.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2212837Sgabeblack@google.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2312837Sgabeblack@google.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2412837Sgabeblack@google.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2512837Sgabeblack@google.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2612837Sgabeblack@google.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2712837Sgabeblack@google.com */
2812837Sgabeblack@google.com
2912837Sgabeblack@google.com#ifndef __ARCH_MIPS_LINUX_LINUX_HH__
3012837Sgabeblack@google.com#define __ARCH_MIPS_LINUX_LINUX_HH__
3112982Sgabeblack@google.com
3212982Sgabeblack@google.com#include "kern/linux/linux.hh"
3313059Sgabeblack@google.com
3412982Sgabeblack@google.comclass MipsLinux : public Linux
3512953Sgabeblack@google.com{
3612837Sgabeblack@google.com  public:
3712982Sgabeblack@google.com
3812837Sgabeblack@google.com    /// This table maps the target open() flags to the corresponding
3912837Sgabeblack@google.com    /// host open() flags.
4012990Sgabeblack@google.com    static OpenFlagTransTable openFlagTable[];
4112990Sgabeblack@google.com
4212990Sgabeblack@google.com    /// Number of entries in openFlagTable[].
4312990Sgabeblack@google.com    static const int NUM_OPEN_FLAGS;
4412990Sgabeblack@google.com
4512990Sgabeblack@google.com    //@{
4612990Sgabeblack@google.com    /// open(2) flag values.
4712990Sgabeblack@google.com    static const int TGT_O_RDONLY	= 0x00000000;	//!< O_RDONLY
4812990Sgabeblack@google.com    static const int TGT_O_WRONLY	= 0x00000001;	//!< O_WRONLY
4912990Sgabeblack@google.com    static const int TGT_O_RDWR	        = 0x00000002;	//!< O_RDWR
5012990Sgabeblack@google.com    static const int TGT_O_NONBLOCK     = 0x00000080;	//!< O_NONBLOCK
5112990Sgabeblack@google.com    static const int TGT_O_APPEND	= 0x00000008;	//!< O_APPEND
5212990Sgabeblack@google.com    static const int TGT_O_CREAT	= 0x00000100;	//!< O_CREAT
5312990Sgabeblack@google.com    static const int TGT_O_TRUNC	= 0x00000200;	//!< O_TRUNC
5412990Sgabeblack@google.com    static const int TGT_O_EXCL	        = 0x00000400;	//!< O_EXCL
5512990Sgabeblack@google.com    static const int TGT_O_NOCTTY	= 0x00000800;	//!< O_NOCTTY
5612990Sgabeblack@google.com    static const int TGT_O_SYNC	        = 0x00000010;	//!< O_SYNC
5712954Sgabeblack@google.com    static const int TGT_O_DRD	        = 0x00010000;	//!< O_DRD
5813042Sgabeblack@google.com    static const int TGT_O_DIRECTIO     = 0x00020000;	//!< O_DIRECTIO
5913042Sgabeblack@google.com    static const int TGT_O_CACHE	= 0x00002000;	//!< O_CACHE
6013042Sgabeblack@google.com    static const int TGT_O_DSYNC	= 0x00008000;	//!< O_DSYNC
6113042Sgabeblack@google.com    static const int TGT_O_RSYNC	= 0x00040000;	//!< O_RSYNC
6213042Sgabeblack@google.com    //@}
6312982Sgabeblack@google.com
6412982Sgabeblack@google.com    /// For mmap().
6512982Sgabeblack@google.com    static const unsigned TGT_MAP_ANONYMOUS = 0x800;
6612982Sgabeblack@google.com
6712990Sgabeblack@google.com    //@{
6813045Sgabeblack@google.com    /// For getsysinfo().
6913045Sgabeblack@google.com    static const unsigned GSI_PLATFORM_NAME = 103;  //!< platform name as string
7012982Sgabeblack@google.com    static const unsigned GSI_CPU_INFO = 59;	//!< CPU information
7113059Sgabeblack@google.com    static const unsigned GSI_PROC_TYPE = 60;	//!< get proc_type
7213059Sgabeblack@google.com    static const unsigned GSI_MAX_CPU = 30;         //!< max # cpu's on this machine
7313059Sgabeblack@google.com    static const unsigned GSI_CPUS_IN_BOX = 55;	//!< number of CPUs in system
7413059Sgabeblack@google.com    static const unsigned GSI_PHYSMEM = 19;	        //!< Physical memory in KB
7513045Sgabeblack@google.com    static const unsigned GSI_CLK_TCK = 42;	        //!< clock freq in Hz
7613045Sgabeblack@google.com    //@}
7713059Sgabeblack@google.com
7813059Sgabeblack@google.com    //@{
7912982Sgabeblack@google.com    /// For getrusage().
8012990Sgabeblack@google.com    static const int TGT_RUSAGE_SELF = 0;
8112982Sgabeblack@google.com    static const int TGT_RUSAGE_CHILDREN = -1;
8212982Sgabeblack@google.com    static const int TGT_RUSAGE_BOTH = -2;
8312982Sgabeblack@google.com    //@}
8412982Sgabeblack@google.com
8512982Sgabeblack@google.com    //@{
8612982Sgabeblack@google.com    /// For setsysinfo().
8713053Sgabeblack@google.com    static const unsigned SSI_IEEE_FP_CONTROL = 14; //!< ieee_set_fp_control()
8813053Sgabeblack@google.com    //@}
8913053Sgabeblack@google.com
9013053Sgabeblack@google.com    //@{
9112990Sgabeblack@google.com    /// ioctl() command codes.
9213059Sgabeblack@google.com    static const unsigned TIOCGETP   = 0x7408;
9312982Sgabeblack@google.com    static const unsigned TIOCSETP   = 0x7409;
9413059Sgabeblack@google.com    static const unsigned TIOCSETN   = 0x740a;
9513059Sgabeblack@google.com    static const unsigned TIOCSETC   = 0x7411;
9613059Sgabeblack@google.com    static const unsigned TIOCGETC   = 0x7412;
9713059Sgabeblack@google.com    static const unsigned FIONREAD   = 0x467f;
9813059Sgabeblack@google.com    static const unsigned TIOCISATTY = 0x5480;
9913059Sgabeblack@google.com    static const unsigned TIOCGETS   = 0x7413;
10013059Sgabeblack@google.com    static const unsigned TIOCGETA   = 0x7417;
10112982Sgabeblack@google.com    //@}
10212990Sgabeblack@google.com
10312982Sgabeblack@google.com    /// For table().
10412982Sgabeblack@google.com    static const int TBL_SYSINFO = 12;
10512953Sgabeblack@google.com
10612953Sgabeblack@google.com    /// Resource enumeration for getrlimit().
10712953Sgabeblack@google.com    enum rlimit_resources {
10812837Sgabeblack@google.com        TGT_RLIMIT_CPU = 0,
10912990Sgabeblack@google.com        TGT_RLIMIT_FSIZE = 1,
11013059Sgabeblack@google.com        TGT_RLIMIT_DATA = 2,
11112982Sgabeblack@google.com        TGT_RLIMIT_STACK = 3,
11213059Sgabeblack@google.com        TGT_RLIMIT_CORE = 4,
11313059Sgabeblack@google.com        TGT_RLIMIT_NOFILE = 5,
11413059Sgabeblack@google.com        TGT_RLIMIT_AS = 6,
11513059Sgabeblack@google.com        TGT_RLIMIT_RSS = 7,
11613059Sgabeblack@google.com        TGT_RLIMIT_VMEM = 7,
11713059Sgabeblack@google.com        TGT_RLIMIT_NPROC = 8,
11813059Sgabeblack@google.com        TGT_RLIMIT_MEMLOCK = 9,
11912982Sgabeblack@google.com        TGT_RLIMIT_LOCKS = 10
12012990Sgabeblack@google.com    };
12112982Sgabeblack@google.com
12212990Sgabeblack@google.com};
12312982Sgabeblack@google.com
12412982Sgabeblack@google.com#endif
12512982Sgabeblack@google.com