⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syscalls.h.svn-base

📁 模拟多核状态下龙芯处理器的功能
💻 SVN-BASE
📖 第 1 页 / 共 2 页
字号:
#define	SS_SYS_fstat64			4215
#define	SS_SYS_pivot_root		4216
#define	SS_SYS_mincore			4217
#define	SS_SYS_madvise			4218
#define	SS_SYS_getdents64		4219
#define	SS_SYS_fcntl64			4220
#define	SS_SYS_ni_syscall18		4221
#define	SS_SYS_gettid			4222
#define	SS_SYS_readahead		4223

/* may not be used */
#define SS_SYS_getpagesize		4224
#define SS_SYS_getdtablesize	4225
#define SS_SYS_sigvec			4226
#define SS_SYS_sigblock			4227
#define SS_SYS_sigsetmask		4228
#define SS_SYS_utimes			4229

 /* linux-mips */
#define SS_IOCTL_TCGETA          0x5401
#define SS_IOCTL_TCSETA          0x5402  /* Clashes with SNDCTL_TMR_START sound ioctl */
#define SS_IOCTL_TCSETAW         0x5403
#define SS_IOCTL_TCSETAF         0x5404
#define SS_IOCTL_TCSBRK          0x5405
#define SS_IOCTL_TCXONC          0x5406
#define SS_IOCTL_TCFLSH          0x5407
#define SS_IOCTL_TCGETS          0x540d
#define SS_IOCTL_TCSETS          0x540e
#define SS_IOCTL_TCSETSW         0x540f
#define SS_IOCTL_TCSETSF         0x5410
#define SS_IOCTL_TIOCEXCL        0x740d          /* set exclusive use of tty */
#define SS_IOCTL_TIOCNXCL        0x740e          /* reset exclusive use of tty */
#define SS_IOCTL_TIOCOUTQ        0x7472          /* output queue size */
#define SS_IOCTL_TIOCSTI         0x5472          /* simulate terminal input */
#define SS_IOCTL_TIOCMGET        0x741d          /* get all modem bits */
#define SS_IOCTL_TIOCMBIS        0x741b          /* bis modem bits */
#define SS_IOCTL_TIOCMBIC        0x741c          /* bic modem bits */
#define SS_IOCTL_TIOCGLTC        0x7474                  /* get special local chars */
#define SS_IOCTL_TIOCSLTC        0x7475                  /* set special local chars */
#define SS_IOCTL_TIOCGETP        0x7408
#define SS_IOCTL_TIOCSETP        0x7409
#define SS_IOCTL_TIOCSETN        0x740a                  /* TIOCSETP wo flush */


/* internal system call buffer size, used primarily for file name arguments,
   argument larger than this will be truncated */
#define MAXBUFSIZE 		1024

/* total bytes to copy from a valid pointer argument for ioctl() calls,
   syscall.c does not decode ioctl() calls to determine the size of the
   arguments that reside in memory, instead, the ioctl() proxy simply copies
   NUM_IOCTL_BYTES bytes from the pointer argument to host memory */
#define NUM_IOCTL_BYTES		128

#ifndef __x86_64__
/* copy from /usr/include/bits/stat.h, it is not defined if _USE_LARGEFILE64
 * is not defined */
struct stat64
  {
    __dev_t st_dev;			/* Device.  */
    unsigned int __pad1;

    __ino_t __st_ino;			/* 32bit file serial number.	*/
    __mode_t st_mode;			/* File mode.  */
    __nlink_t st_nlink;			/* Link count.  */
    __uid_t st_uid;			/* User ID of the file's owner.	*/
    __gid_t st_gid;			/* Group ID of the file's group.*/
    __dev_t st_rdev;			/* Device number, if device.  */
    unsigned int __pad2;
    __off64_t st_size;			/* Size of file, in bytes.  */
    __blksize_t st_blksize;		/* Optimal block size for I/O.  */

    __blkcnt64_t st_blocks;		/* Number 512-byte blocks allocated. */
#ifdef __USE_MISC
    /* Nanosecond resolution timestamps are stored in a format
       equivalent to 'struct timespec'.  This is the type used
       whenever possible but the Unix namespace rules do not allow the
       identifier 'timespec' to appear in the <sys/stat.h> header.
       Therefore we have to handle the use of this header in strictly
       standard-compliant sources special.  */
    struct timespec st_atim;		/* Time of last access.  */
    struct timespec st_mtim;		/* Time of last modification.  */
    struct timespec st_ctim;		/* Time of last status change.  */
#else
    __time_t st_atime;			/* Time of last access.  */
    unsigned long int st_atimensec;	/* Nscecs of last access.  */
    __time_t st_mtime;			/* Time of last modification.  */
    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
    __time_t st_ctime;			/* Time of last status change.  */
    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
#endif
    __ino64_t st_ino;			/* File serial number.		*/
  };
#else

/* Note stat64 has the same shape as stat for x86-64.  */
struct stat64
  {
    __dev_t st_dev;		/* Device.  */
#if __WORDSIZE == 64
    __ino64_t st_ino;		/* File serial number.  */
    __nlink_t st_nlink;		/* Link count.  */
    __mode_t st_mode;		/* File mode.  */
#else
    unsigned int __pad1;
    __ino_t __st_ino;			/* 32bit file serial number.	*/
    __mode_t st_mode;			/* File mode.  */
    __nlink_t st_nlink;			/* Link count.  */
#endif
    __uid_t st_uid;		/* User ID of the file's owner.	*/
    __gid_t st_gid;		/* Group ID of the file's group.*/
#if __WORDSIZE == 64
    int pad0;
    __dev_t st_rdev;		/* Device number, if device.  */
    __off_t st_size;		/* Size of file, in bytes.  */
#else
    __dev_t st_rdev;			/* Device number, if device.  */
    unsigned int __pad2;
    __off64_t st_size;			/* Size of file, in bytes.  */
#endif
    __blksize_t st_blksize;	/* Optimal block size for I/O.  */
    __blkcnt64_t st_blocks;	/* Nr. 512-byte blocks allocated.  */
#ifdef __USE_MISC
    /* Nanosecond resolution timestamps are stored in a format
       equivalent to 'struct timespec'.  This is the type used
       whenever possible but the Unix namespace rules do not allow the
       identifier 'timespec' to appear in the <sys/stat.h> header.
       Therefore we have to handle the use of this header in strictly
       standard-compliant sources special.  */
    struct timespec st_atim;		/* Time of last access.  */
    struct timespec st_mtim;		/* Time of last modification.  */
    struct timespec st_ctim;		/* Time of last status change.  */
# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
# define st_mtime st_mtim.tv_sec
# define st_ctime st_ctim.tv_sec
#else
    __time_t st_atime;			/* Time of last access.  */
    unsigned long int st_atimensec;	/* Nscecs of last access.  */
    __time_t st_mtime;			/* Time of last modification.  */
    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
    __time_t st_ctime;			/* Time of last status change.  */
    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
#endif
#if __WORDSIZE == 64
    long int __unused[3];
#else
    __ino64_t st_ino;			/* File serial number.		*/
#endif
  };

#endif


/* used in SS_SYS_sched_setparam */

struct sched_param {
        int sched_priority;
};      


/* open(2) flags for SimpleScalar target, syscall.c automagically maps *
 * between these codes to/from host open(2) flags                 *
 *                                                            *
 * these flags are defined on mips platform                       */
#define SS_O_ACCMODE   0x0003	
#define SS_O_RDONLY	   0x0000
#define SS_O_WRONLY	   0x0001
#define SS_O_RDWR	   0x0002
#define SS_O_APPEND	   0x0008
#define SS_O_SYNC      0x0010
#define SS_O_NONBLOCK  0x0080
#define SS_O_CREAT	   0x0100
#define SS_O_TRUNC	   0x0200
#define SS_O_EXCL	   0x0400
#define SS_O_NOCTTY	   0x0800
#define SS_FASYNC      0x1000  /* fcntl, for BSD compatibility */ 	
#define SS_O_LARGEFILE 0x2000  /* allow large file opens */
#define SS_O_DIRECT    0x8000  /* direct disk access hint */
#define SS_O_DIRECTORY 0x10000 /* must be a directory */
#define SS_O_NOFOLLOW  0x20000 /* don't follow links */


/* open(2) flags translation table for SimpleScalar target */
struct {
  int ss_flag;
  int local_flag;
} ss_flag_table[] = {
  /* target flag */	/* host flag */
  { SS_O_RDONLY,	O_RDONLY },
  { SS_O_WRONLY,	O_WRONLY },
  { SS_O_RDWR,		O_RDWR },
  { SS_O_ACCMODE, O_ACCMODE}, 
  { SS_O_APPEND,	O_APPEND },
#ifdef O_SYNC
  { SS_O_SYNC,		O_SYNC },
#endif
  { SS_O_NONBLOCK,	O_NONBLOCK },
  { SS_O_CREAT,		O_CREAT },
  { SS_O_TRUNC,		O_TRUNC },
  { SS_O_EXCL,		O_EXCL },
  { SS_O_NOCTTY,	O_NOCTTY },
#ifdef FASYNC
  { SS_FASYNC,      FASYNC },
#endif
#ifdef O_LARGEFILE
  { SS_O_LARGEFILE, O_LARGEFILE },
#endif
#ifdef O_DIRECT
  { SS_O_DIRECT,   O_DIRECT },
#endif
#ifdef O_DIRECTORY
  { SS_O_DIRECTORY, O_DIRECTORY },
#endif
#ifdef O_NOFOLLOW
  { SS_O_NOFOLLOW, O_NOFOLLOW },
#endif
};
#define SS_NFLAGS	(sizeof(ss_flag_table)/sizeof(ss_flag_table[0]))

#endif /* __mips_syscalls_h__ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -