linux.hh revision 2665
12553SN/A/*
22553SN/A * Copyright (c) 2003-2005 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.
272665Ssaidi@eecs.umich.edu *
282665Ssaidi@eecs.umich.edu * Authors: Korey Sewell
292553SN/A */
302553SN/A
312553SN/A#ifndef __ALPHA_ALPHA_LINUX_HH
322553SN/A#define __ALPHA_ALPHA_LINUX_HH
332553SN/A
342553SN/A#include "kern/linux/linux.hh"
352553SN/A
362553SN/A/* AlphaLinux class contains static constants/definitions/misc.
372553SN/A * structures which are specific to the Linux OS AND the Alpha
382553SN/A * architecture
392553SN/A */
402553SN/Aclass AlphaLinux : public Linux
412553SN/A{
422553SN/A  public:
432553SN/A
442553SN/A    /// This table maps the target open() flags to the corresponding
452553SN/A    /// host open() flags.
462553SN/A    static OpenFlagTransTable openFlagTable[];
472553SN/A
482553SN/A    /// Number of entries in openFlagTable[].
492553SN/A    static const int NUM_OPEN_FLAGS;
502553SN/A
512553SN/A    //@{
522553SN/A    /// open(2) flag values.
532553SN/A    static const int TGT_O_RDONLY	= 00000000;	//!< O_RDONLY
542553SN/A    static const int TGT_O_WRONLY	= 00000001;	//!< O_WRONLY
552553SN/A    static const int TGT_O_RDWR	        = 00000002;	//!< O_RDWR
562553SN/A    static const int TGT_O_NONBLOCK     = 00000004;	//!< O_NONBLOCK
572553SN/A    static const int TGT_O_APPEND	= 00000010;	//!< O_APPEND
582553SN/A    static const int TGT_O_CREAT	= 00001000;	//!< O_CREAT
592553SN/A    static const int TGT_O_TRUNC	= 00002000;	//!< O_TRUNC
602553SN/A    static const int TGT_O_EXCL	        = 00004000;	//!< O_EXCL
612553SN/A    static const int TGT_O_NOCTTY	= 00010000;	//!< O_NOCTTY
622553SN/A    static const int TGT_O_SYNC	        = 00040000;	//!< O_SYNC
632553SN/A    static const int TGT_O_DRD	        = 00100000;	//!< O_DRD
642553SN/A    static const int TGT_O_DIRECTIO     = 00200000;	//!< O_DIRECTIO
652553SN/A    static const int TGT_O_CACHE	= 00400000;	//!< O_CACHE
662553SN/A    static const int TGT_O_DSYNC	= 02000000;	//!< O_DSYNC
672553SN/A    static const int TGT_O_RSYNC	= 04000000;	//!< O_RSYNC
682553SN/A    //@}
692553SN/A
702553SN/A    /// For mmap().
712553SN/A    static const unsigned TGT_MAP_ANONYMOUS = 0x10;
722553SN/A
732553SN/A    //@{
742553SN/A    /// For getsysinfo().
752553SN/A    static const unsigned GSI_PLATFORM_NAME = 103;  //!< platform name as string
762553SN/A    static const unsigned GSI_CPU_INFO      = 59;   //!< CPU information
772553SN/A    static const unsigned GSI_PROC_TYPE     = 60;   //!< get proc_type
782553SN/A    static const unsigned GSI_MAX_CPU       = 30;   //!< max # cpu's on this machine
792553SN/A    static const unsigned GSI_CPUS_IN_BOX   = 55;   //!< number of CPUs in system
802553SN/A    static const unsigned GSI_PHYSMEM       = 19;   //!< Physical memory in KB
812553SN/A    static const unsigned GSI_CLK_TCK       = 42;   //!< clock freq in Hz
822555SN/A    static const unsigned GSI_IEEE_FP_CONTROL = 45;
832553SN/A    //@}
842553SN/A
852553SN/A    //@{
862553SN/A    /// For getrusage().
872553SN/A    static const int TGT_RUSAGE_SELF     = 0;
882553SN/A    static const int TGT_RUSAGE_CHILDREN = -1;
892553SN/A    static const int TGT_RUSAGE_BOTH     = -2;
902553SN/A    //@}
912553SN/A
922553SN/A    //@{
932553SN/A    /// For setsysinfo().
942553SN/A    static const unsigned SSI_IEEE_FP_CONTROL = 14; //!< ieee_set_fp_control()
952553SN/A    //@}
962553SN/A
972553SN/A    //@{
982553SN/A    /// ioctl() command codes.
992553SN/A    static const unsigned TIOCGETP   = 0x40067408;
1002553SN/A    static const unsigned TIOCSETP   = 0x80067409;
1012553SN/A    static const unsigned TIOCSETN   = 0x8006740a;
1022553SN/A    static const unsigned TIOCSETC   = 0x80067411;
1032553SN/A    static const unsigned TIOCGETC   = 0x40067412;
1042553SN/A    static const unsigned FIONREAD   = 0x4004667f;
1052553SN/A    static const unsigned TIOCISATTY = 0x2000745e;
1062553SN/A    static const unsigned TIOCGETS   = 0x402c7413;
1072553SN/A    static const unsigned TIOCGETA   = 0x40127417;
1082553SN/A    //@}
1092553SN/A
1102553SN/A    /// For table().
1112553SN/A    static const int TBL_SYSINFO = 12;
1122555SN/A
1132555SN/A    /// Resource enumeration for getrlimit().
1142555SN/A    enum rlimit_resources {
1152555SN/A        TGT_RLIMIT_CPU = 0,
1162555SN/A        TGT_RLIMIT_FSIZE = 1,
1172555SN/A        TGT_RLIMIT_DATA = 2,
1182555SN/A        TGT_RLIMIT_STACK = 3,
1192555SN/A        TGT_RLIMIT_CORE = 4,
1202555SN/A        TGT_RLIMIT_RSS = 5,
1212555SN/A        TGT_RLIMIT_NOFILE = 6,
1222555SN/A        TGT_RLIMIT_AS = 7,
1232555SN/A        TGT_RLIMIT_VMEM = 7,
1242555SN/A        TGT_RLIMIT_NPROC = 8,
1252555SN/A        TGT_RLIMIT_MEMLOCK = 9,
1262555SN/A        TGT_RLIMIT_LOCKS = 10
1272555SN/A    };
1282553SN/A};
1292553SN/A
1302553SN/A#endif
131