solaris.hh revision 5543:3af77710f397
111185Serfan.azarkhish@unibo.it/*
211185Serfan.azarkhish@unibo.it * Copyright (c) 2004-2005 The Regents of The University of Michigan
311185Serfan.azarkhish@unibo.it * All rights reserved.
411185Serfan.azarkhish@unibo.it *
511185Serfan.azarkhish@unibo.it * Redistribution and use in source and binary forms, with or without
611185Serfan.azarkhish@unibo.it * modification, are permitted provided that the following conditions are
711185Serfan.azarkhish@unibo.it * met: redistributions of source code must retain the above copyright
811185Serfan.azarkhish@unibo.it * notice, this list of conditions and the following disclaimer;
911185Serfan.azarkhish@unibo.it * redistributions in binary form must reproduce the above copyright
1011185Serfan.azarkhish@unibo.it * notice, this list of conditions and the following disclaimer in the
1111185Serfan.azarkhish@unibo.it * documentation and/or other materials provided with the distribution;
1211185Serfan.azarkhish@unibo.it * neither the name of the copyright holders nor the names of its
1311185Serfan.azarkhish@unibo.it * contributors may be used to endorse or promote products derived from
1411185Serfan.azarkhish@unibo.it * this software without specific prior written permission.
1511185Serfan.azarkhish@unibo.it *
1611185Serfan.azarkhish@unibo.it * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1711185Serfan.azarkhish@unibo.it * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1811185Serfan.azarkhish@unibo.it * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1911185Serfan.azarkhish@unibo.it * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2011185Serfan.azarkhish@unibo.it * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2111185Serfan.azarkhish@unibo.it * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2211185Serfan.azarkhish@unibo.it * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2311185Serfan.azarkhish@unibo.it * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2411185Serfan.azarkhish@unibo.it * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2511185Serfan.azarkhish@unibo.it * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2611185Serfan.azarkhish@unibo.it * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2711185Serfan.azarkhish@unibo.it *
2811185Serfan.azarkhish@unibo.it * Authors: Ali Saidi
2911185Serfan.azarkhish@unibo.it */
3011185Serfan.azarkhish@unibo.it
3111185Serfan.azarkhish@unibo.it#ifndef __SOLARIS_HH__
3211185Serfan.azarkhish@unibo.it#define __SOLARIS_HH__
3311185Serfan.azarkhish@unibo.it#include "config/full_system.hh"
3411185Serfan.azarkhish@unibo.it
3511185Serfan.azarkhish@unibo.it#if FULL_SYSTEM
3611185Serfan.azarkhish@unibo.it
3711185Serfan.azarkhish@unibo.itclass Solaris {};
3811185Serfan.azarkhish@unibo.it
3911185Serfan.azarkhish@unibo.it#else //!FULL_SYSTEM
4011185Serfan.azarkhish@unibo.it
4111185Serfan.azarkhish@unibo.it#include <inttypes.h>
4211185Serfan.azarkhish@unibo.it
4311185Serfan.azarkhish@unibo.it#include "kern/operatingsystem.hh"
4411185Serfan.azarkhish@unibo.it
4511185Serfan.azarkhish@unibo.itclass TranslatingPort;
4611185Serfan.azarkhish@unibo.it
4711185Serfan.azarkhish@unibo.it///
4811185Serfan.azarkhish@unibo.it/// This class encapsulates the types, structures, constants,
4911185Serfan.azarkhish@unibo.it/// functions, and syscall-number mappings specific to the Solaris
5011185Serfan.azarkhish@unibo.it/// syscall interface.
5111185Serfan.azarkhish@unibo.it///
5211185Serfan.azarkhish@unibo.itclass Solaris : public OperatingSystem
5311185Serfan.azarkhish@unibo.it{
5411185Serfan.azarkhish@unibo.it
5511185Serfan.azarkhish@unibo.it  public:
5611185Serfan.azarkhish@unibo.it
5711185Serfan.azarkhish@unibo.it    //@{
5811185Serfan.azarkhish@unibo.it    /// Basic Solaris types.
5911185Serfan.azarkhish@unibo.it    typedef uint64_t size_t;
6011185Serfan.azarkhish@unibo.it    typedef uint64_t off_t;
6111185Serfan.azarkhish@unibo.it    typedef int64_t time_t;
6211185Serfan.azarkhish@unibo.it    typedef int32_t uid_t;
6311185Serfan.azarkhish@unibo.it    typedef int32_t gid_t;
6411185Serfan.azarkhish@unibo.it    typedef uint64_t rlim_t;
6511185Serfan.azarkhish@unibo.it    typedef uint64_t ino_t;
6611185Serfan.azarkhish@unibo.it    typedef uint64_t dev_t;
6711185Serfan.azarkhish@unibo.it    typedef uint32_t mode_t;
6811185Serfan.azarkhish@unibo.it    typedef uint32_t nlink_t;
6911185Serfan.azarkhish@unibo.it    //@}
7011185Serfan.azarkhish@unibo.it
7111185Serfan.azarkhish@unibo.it    struct tgt_timespec {
7211185Serfan.azarkhish@unibo.it        int64_t tv_sec;
7311185Serfan.azarkhish@unibo.it        int64_t tv_nsec;
7411185Serfan.azarkhish@unibo.it    };
7511185Serfan.azarkhish@unibo.it
7611185Serfan.azarkhish@unibo.it    /// Stat buffer.  Note that we can't call it 'stat' since that
7711185Serfan.azarkhish@unibo.it    /// gets #defined to something else on some systems.
7811185Serfan.azarkhish@unibo.it    typedef struct {
7911185Serfan.azarkhish@unibo.it        uint64_t        st_dev;         //!< device
8011185Serfan.azarkhish@unibo.it        uint64_t        st_ino;         //!< inode
8111185Serfan.azarkhish@unibo.it        uint32_t        st_mode;        //!< mode
8211185Serfan.azarkhish@unibo.it        uint32_t        st_nlink;       //!< link count
8311185Serfan.azarkhish@unibo.it        int32_t         st_uid;         //!< owner's user ID
8411185Serfan.azarkhish@unibo.it        int32_t         st_gid;         //!< owner's group ID
8511185Serfan.azarkhish@unibo.it        uint64_t        st_rdev;        //!< device number
8611185Serfan.azarkhish@unibo.it        int64_t         st_size;        //!< file size in bytes
8711185Serfan.azarkhish@unibo.it        //struct tgt_timespec   st_atimeX;      //!< time of last access
8811185Serfan.azarkhish@unibo.it        //struct tgt_timespec   st_mtimeX;      //!< time of last modification
8911185Serfan.azarkhish@unibo.it        //struct tgt_timespec   st_ctimeX;      //!< time of last status change
9011185Serfan.azarkhish@unibo.it        int64_t st_atimeX, st_mtimeX, st_ctimeX;
9111185Serfan.azarkhish@unibo.it        int32_t         st_blksize;     //!< optimal I/O block size
9211185Serfan.azarkhish@unibo.it        int64_t         st_blocks;      //!< number of blocks allocated
9311185Serfan.azarkhish@unibo.it        char            st_fstype[16];
9411185Serfan.azarkhish@unibo.it    } tgt_stat;
9511185Serfan.azarkhish@unibo.it
9611185Serfan.azarkhish@unibo.it    // same for stat64
9711185Serfan.azarkhish@unibo.it    typedef struct {
9811185Serfan.azarkhish@unibo.it        uint64_t        st_dev;         //!< device
9911185Serfan.azarkhish@unibo.it        uint64_t        st_ino;         //!< inode
10011185Serfan.azarkhish@unibo.it        uint32_t        st_mode;        //!< mode
10111185Serfan.azarkhish@unibo.it        uint32_t        st_nlink;       //!< link count
10211185Serfan.azarkhish@unibo.it        int32_t         st_uid;         //!< owner's user ID
10311185Serfan.azarkhish@unibo.it        int32_t         st_gid;         //!< owner's group ID
10411185Serfan.azarkhish@unibo.it        uint64_t        st_rdev;        //!< device number
10511185Serfan.azarkhish@unibo.it        int64_t         st_size;        //!< file size in bytes
10611185Serfan.azarkhish@unibo.it        //struct tgt_timespec   st_atimeX;      //!< time of last access
10711185Serfan.azarkhish@unibo.it        //struct tgt_timespec   st_mtimeX;      //!< time of last modification
10811185Serfan.azarkhish@unibo.it        //struct tgt_timespec   st_ctimeX;      //!< time of last status change
10911185Serfan.azarkhish@unibo.it        int64_t st_atimeX, st_mtimeX, st_ctimeX;
11011185Serfan.azarkhish@unibo.it        int32_t         st_blksize;     //!< optimal I/O block size
11111185Serfan.azarkhish@unibo.it        int64_t         st_blocks;      //!< number of blocks allocated
11211185Serfan.azarkhish@unibo.it        char            st_fstype[16];
11311185Serfan.azarkhish@unibo.it    } tgt_stat64;
11411185Serfan.azarkhish@unibo.it
11511185Serfan.azarkhish@unibo.it    /// Length of strings in struct utsname (plus 1 for null char).
11611185Serfan.azarkhish@unibo.it    static const int _SYS_NMLN = 257;
11711185Serfan.azarkhish@unibo.it
11811185Serfan.azarkhish@unibo.it    /// Interface struct for uname().
11911185Serfan.azarkhish@unibo.it    typedef struct utsname {
12011185Serfan.azarkhish@unibo.it        char sysname[_SYS_NMLN];        //!< System name.
12111185Serfan.azarkhish@unibo.it        char nodename[_SYS_NMLN];       //!< Node name.
12211185Serfan.azarkhish@unibo.it        char release[_SYS_NMLN];        //!< OS release.
12311185Serfan.azarkhish@unibo.it        char version[_SYS_NMLN];        //!< OS version.
12411185Serfan.azarkhish@unibo.it        char machine[_SYS_NMLN];        //!< Machine type.
12511185Serfan.azarkhish@unibo.it    } utsname;
12611185Serfan.azarkhish@unibo.it
12711185Serfan.azarkhish@unibo.it};  // class Solaris
12811185Serfan.azarkhish@unibo.it
12911185Serfan.azarkhish@unibo.it
13011185Serfan.azarkhish@unibo.it#endif // FULL_SYSTEM
13111185Serfan.azarkhish@unibo.it
13211185Serfan.azarkhish@unibo.it#endif // __SOLARIS_HH__
13311185Serfan.azarkhish@unibo.it