linux.hh revision 2553
16242Sgblack@eecs.umich.edu/*
27093Sgblack@eecs.umich.edu * Copyright (c) 2003-2005 The Regents of The University of Michigan
37093Sgblack@eecs.umich.edu * All rights reserved.
47093Sgblack@eecs.umich.edu *
57093Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without
67093Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are
77093Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright
87093Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer;
97093Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright
107093Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the
117093Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution;
127093Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its
137093Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from
146242Sgblack@eecs.umich.edu * this software without specific prior written permission.
156242Sgblack@eecs.umich.edu *
166242Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
176242Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
186242Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
196242Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
206242Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
216242Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
226242Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
236242Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
246242Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
256242Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
266242Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
276242Sgblack@eecs.umich.edu */
286242Sgblack@eecs.umich.edu
296242Sgblack@eecs.umich.edu#ifndef __ALPHA_ALPHA_LINUX_HH
306242Sgblack@eecs.umich.edu#define __ALPHA_ALPHA_LINUX_HH
316242Sgblack@eecs.umich.edu
326242Sgblack@eecs.umich.edu#include "kern/linux/linux.hh"
336242Sgblack@eecs.umich.edu
346242Sgblack@eecs.umich.edu/* AlphaLinux class contains static constants/definitions/misc.
356242Sgblack@eecs.umich.edu * structures which are specific to the Linux OS AND the Alpha
366242Sgblack@eecs.umich.edu * architecture
376242Sgblack@eecs.umich.edu */
386242Sgblack@eecs.umich.educlass AlphaLinux : public Linux
396242Sgblack@eecs.umich.edu{
406242Sgblack@eecs.umich.edu  public:
416242Sgblack@eecs.umich.edu
426242Sgblack@eecs.umich.edu    /// This table maps the target open() flags to the corresponding
436242Sgblack@eecs.umich.edu    /// host open() flags.
446242Sgblack@eecs.umich.edu    static OpenFlagTransTable openFlagTable[];
456242Sgblack@eecs.umich.edu
466242Sgblack@eecs.umich.edu    /// Number of entries in openFlagTable[].
476242Sgblack@eecs.umich.edu    static const int NUM_OPEN_FLAGS;
486242Sgblack@eecs.umich.edu
496242Sgblack@eecs.umich.edu    //@{
506242Sgblack@eecs.umich.edu    /// open(2) flag values.
516242Sgblack@eecs.umich.edu    static const int TGT_O_RDONLY	= 00000000;	//!< O_RDONLY
526242Sgblack@eecs.umich.edu    static const int TGT_O_WRONLY	= 00000001;	//!< O_WRONLY
536242Sgblack@eecs.umich.edu    static const int TGT_O_RDWR	        = 00000002;	//!< O_RDWR
546242Sgblack@eecs.umich.edu    static const int TGT_O_NONBLOCK     = 00000004;	//!< O_NONBLOCK
556242Sgblack@eecs.umich.edu    static const int TGT_O_APPEND	= 00000010;	//!< O_APPEND
566242Sgblack@eecs.umich.edu    static const int TGT_O_CREAT	= 00001000;	//!< O_CREAT
576242Sgblack@eecs.umich.edu    static const int TGT_O_TRUNC	= 00002000;	//!< O_TRUNC
586242Sgblack@eecs.umich.edu    static const int TGT_O_EXCL	        = 00004000;	//!< O_EXCL
596242Sgblack@eecs.umich.edu    static const int TGT_O_NOCTTY	= 00010000;	//!< O_NOCTTY
606242Sgblack@eecs.umich.edu    static const int TGT_O_SYNC	        = 00040000;	//!< O_SYNC
616242Sgblack@eecs.umich.edu    static const int TGT_O_DRD	        = 00100000;	//!< O_DRD
626242Sgblack@eecs.umich.edu    static const int TGT_O_DIRECTIO     = 00200000;	//!< O_DIRECTIO
636242Sgblack@eecs.umich.edu    static const int TGT_O_CACHE	= 00400000;	//!< O_CACHE
646242Sgblack@eecs.umich.edu    static const int TGT_O_DSYNC	= 02000000;	//!< O_DSYNC
657111Sgblack@eecs.umich.edu    static const int TGT_O_RSYNC	= 04000000;	//!< O_RSYNC
666242Sgblack@eecs.umich.edu    //@}
676242Sgblack@eecs.umich.edu
686242Sgblack@eecs.umich.edu    /// For mmap().
696242Sgblack@eecs.umich.edu    static const unsigned TGT_MAP_ANONYMOUS = 0x10;
706735Sgblack@eecs.umich.edu
716242Sgblack@eecs.umich.edu    //@{
726242Sgblack@eecs.umich.edu    /// For getsysinfo().
736242Sgblack@eecs.umich.edu    static const unsigned GSI_PLATFORM_NAME = 103;  //!< platform name as string
746723Sgblack@eecs.umich.edu    static const unsigned GSI_CPU_INFO      = 59;   //!< CPU information
756242Sgblack@eecs.umich.edu    static const unsigned GSI_PROC_TYPE     = 60;   //!< get proc_type
766242Sgblack@eecs.umich.edu    static const unsigned GSI_MAX_CPU       = 30;   //!< max # cpu's on this machine
776261Sgblack@eecs.umich.edu    static const unsigned GSI_CPUS_IN_BOX   = 55;   //!< number of CPUs in system
786403Sgblack@eecs.umich.edu    static const unsigned GSI_PHYSMEM       = 19;   //!< Physical memory in KB
796403Sgblack@eecs.umich.edu    static const unsigned GSI_CLK_TCK       = 42;   //!< clock freq in Hz
806403Sgblack@eecs.umich.edu    //@}
817259Sgblack@eecs.umich.edu
827259Sgblack@eecs.umich.edu    //@{
837259Sgblack@eecs.umich.edu    /// For getrusage().
847259Sgblack@eecs.umich.edu    static const int TGT_RUSAGE_SELF     = 0;
857264Sgblack@eecs.umich.edu    static const int TGT_RUSAGE_CHILDREN = -1;
867267Sgblack@eecs.umich.edu    static const int TGT_RUSAGE_BOTH     = -2;
877265Sgblack@eecs.umich.edu    //@}
887266Sgblack@eecs.umich.edu
897266Sgblack@eecs.umich.edu    //@{
907266Sgblack@eecs.umich.edu    /// For setsysinfo().
917268Sgblack@eecs.umich.edu    static const unsigned SSI_IEEE_FP_CONTROL = 14; //!< ieee_set_fp_control()
927259Sgblack@eecs.umich.edu    //@}
937259Sgblack@eecs.umich.edu
947259Sgblack@eecs.umich.edu    //@{
957259Sgblack@eecs.umich.edu    /// ioctl() command codes.
967259Sgblack@eecs.umich.edu    static const unsigned TIOCGETP   = 0x40067408;
977259Sgblack@eecs.umich.edu    static const unsigned TIOCSETP   = 0x80067409;
987259Sgblack@eecs.umich.edu    static const unsigned TIOCSETN   = 0x8006740a;
997259Sgblack@eecs.umich.edu    static const unsigned TIOCSETC   = 0x80067411;
1007259Sgblack@eecs.umich.edu    static const unsigned TIOCGETC   = 0x40067412;
1017259Sgblack@eecs.umich.edu    static const unsigned FIONREAD   = 0x4004667f;
1027259Sgblack@eecs.umich.edu    static const unsigned TIOCISATTY = 0x2000745e;
1037259Sgblack@eecs.umich.edu    static const unsigned TIOCGETS   = 0x402c7413;
1047259Sgblack@eecs.umich.edu    static const unsigned TIOCGETA   = 0x40127417;
1057259Sgblack@eecs.umich.edu    //@}
1067259Sgblack@eecs.umich.edu
1077259Sgblack@eecs.umich.edu    /// For table().
1087259Sgblack@eecs.umich.edu    static const int TBL_SYSINFO = 12;
1097259Sgblack@eecs.umich.edu};
1107259Sgblack@eecs.umich.edu
1117259Sgblack@eecs.umich.edu#endif
1127259Sgblack@eecs.umich.edu