linux.hh revision 2632
12553SN/A/* 22632Sstever@eecs.umich.edu * Copyright (c) 2006 The Regents of The University of Michigan 32553SN/A * All rights reserved. 42553SN/A * 52553SN/A * Redistribution and use in source and binary forms, with or without 62553SN/A * modification, are permitted provided that the following conditions are 72553SN/A * met: redistributions of source code must retain the above copyright 82553SN/A * notice, this list of conditions and the following disclaimer; 92553SN/A * redistributions in binary form must reproduce the above copyright 102553SN/A * notice, this list of conditions and the following disclaimer in the 112553SN/A * documentation and/or other materials provided with the distribution; 122553SN/A * neither the name of the copyright holders nor the names of its 132553SN/A * contributors may be used to endorse or promote products derived from 142553SN/A * this software without specific prior written permission. 152553SN/A * 162553SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172553SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182553SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192553SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202553SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212553SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222553SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232553SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242553SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252553SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262553SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272632Sstever@eecs.umich.edu * 282632Sstever@eecs.umich.edu * Authors: Korey Sewell 292553SN/A */ 302553SN/A 312599SN/A#ifndef __ARCH_MIPS_LINUX_LINUX_HH__ 322599SN/A#define __ARCH_MIPS_LINUX_LINUX_HH__ 332553SN/A 342553SN/A#include "kern/linux/linux.hh" 352553SN/A 362553SN/Aclass MipsLinux : public Linux 372553SN/A{ 382553SN/A public: 392553SN/A 402553SN/A /// This table maps the target open() flags to the corresponding 412553SN/A /// host open() flags. 422553SN/A static OpenFlagTransTable openFlagTable[]; 432553SN/A 442553SN/A /// Number of entries in openFlagTable[]. 452553SN/A static const int NUM_OPEN_FLAGS; 462553SN/A 472553SN/A //@{ 482553SN/A /// open(2) flag values. 492555SN/A static const int TGT_O_RDONLY = 0x00000000; //!< O_RDONLY 502555SN/A static const int TGT_O_WRONLY = 0x00000001; //!< O_WRONLY 512555SN/A static const int TGT_O_RDWR = 0x00000002; //!< O_RDWR 522555SN/A static const int TGT_O_NONBLOCK = 0x00000080; //!< O_NONBLOCK 532555SN/A static const int TGT_O_APPEND = 0x00000008; //!< O_APPEND 542555SN/A static const int TGT_O_CREAT = 0x00000100; //!< O_CREAT 552555SN/A static const int TGT_O_TRUNC = 0x00000200; //!< O_TRUNC 562555SN/A static const int TGT_O_EXCL = 0x00000400; //!< O_EXCL 572555SN/A static const int TGT_O_NOCTTY = 0x00000800; //!< O_NOCTTY 582555SN/A static const int TGT_O_SYNC = 0x00000010; //!< O_SYNC 592555SN/A static const int TGT_O_DRD = 0x00010000; //!< O_DRD 602555SN/A static const int TGT_O_DIRECTIO = 0x00020000; //!< O_DIRECTIO 612555SN/A static const int TGT_O_CACHE = 0x00002000; //!< O_CACHE 622555SN/A static const int TGT_O_DSYNC = 0x00008000; //!< O_DSYNC 632555SN/A static const int TGT_O_RSYNC = 0x00040000; //!< O_RSYNC 642553SN/A //@} 652553SN/A 662553SN/A /// For mmap(). 672555SN/A static const unsigned TGT_MAP_ANONYMOUS = 0x800; 682553SN/A 692553SN/A //@{ 702553SN/A /// For getsysinfo(). 712553SN/A static const unsigned GSI_PLATFORM_NAME = 103; //!< platform name as string 722553SN/A static const unsigned GSI_CPU_INFO = 59; //!< CPU information 732553SN/A static const unsigned GSI_PROC_TYPE = 60; //!< get proc_type 742553SN/A static const unsigned GSI_MAX_CPU = 30; //!< max # cpu's on this machine 752553SN/A static const unsigned GSI_CPUS_IN_BOX = 55; //!< number of CPUs in system 762553SN/A static const unsigned GSI_PHYSMEM = 19; //!< Physical memory in KB 772553SN/A static const unsigned GSI_CLK_TCK = 42; //!< clock freq in Hz 782553SN/A //@} 792553SN/A 802553SN/A //@{ 812553SN/A /// For getrusage(). 822553SN/A static const int TGT_RUSAGE_SELF = 0; 832553SN/A static const int TGT_RUSAGE_CHILDREN = -1; 842553SN/A static const int TGT_RUSAGE_BOTH = -2; 852553SN/A //@} 862553SN/A 872553SN/A //@{ 882553SN/A /// For setsysinfo(). 892553SN/A static const unsigned SSI_IEEE_FP_CONTROL = 14; //!< ieee_set_fp_control() 902553SN/A //@} 912553SN/A 922553SN/A //@{ 932553SN/A /// ioctl() command codes. 942555SN/A static const unsigned TIOCGETP = 0x7408; 952555SN/A static const unsigned TIOCSETP = 0x7409; 962555SN/A static const unsigned TIOCSETN = 0x740a; 972555SN/A static const unsigned TIOCSETC = 0x7411; 982555SN/A static const unsigned TIOCGETC = 0x7412; 992555SN/A static const unsigned FIONREAD = 0x467f; 1002555SN/A static const unsigned TIOCISATTY = 0x5480; 1012555SN/A static const unsigned TIOCGETS = 0x7413; 1022555SN/A static const unsigned TIOCGETA = 0x7417; 1032553SN/A //@} 1042553SN/A 1052553SN/A /// For table(). 1062553SN/A static const int TBL_SYSINFO = 12; 1072555SN/A 1082555SN/A /// Resource enumeration for getrlimit(). 1092555SN/A enum rlimit_resources { 1102555SN/A TGT_RLIMIT_CPU = 0, 1112555SN/A TGT_RLIMIT_FSIZE = 1, 1122555SN/A TGT_RLIMIT_DATA = 2, 1132555SN/A TGT_RLIMIT_STACK = 3, 1142555SN/A TGT_RLIMIT_CORE = 4, 1152555SN/A TGT_RLIMIT_NOFILE = 5, 1162555SN/A TGT_RLIMIT_AS = 6, 1172555SN/A TGT_RLIMIT_RSS = 7, 1182555SN/A TGT_RLIMIT_VMEM = 7, 1192555SN/A TGT_RLIMIT_NPROC = 8, 1202555SN/A TGT_RLIMIT_MEMLOCK = 9, 1212555SN/A TGT_RLIMIT_LOCKS = 10 1222555SN/A }; 1232555SN/A 1242553SN/A}; 1252553SN/A 1262553SN/A#endif 127