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

📄 syscall_defs.h.svn-base

📁 我们自己开发的一个OSEK操作系统!不知道可不可以?
💻 SVN-BASE
📖 第 1 页 / 共 5 页
字号:
/* common syscall defines for all architectures *//* Note: although the syscall numbers change between architectures,   most of them stay the same, so we handle it by puting ifdefs if   necessary */#include "syscall_nr.h"#define SOCKOP_socket           1#define SOCKOP_bind             2#define SOCKOP_connect          3#define SOCKOP_listen           4#define SOCKOP_accept           5#define SOCKOP_getsockname      6#define SOCKOP_getpeername      7#define SOCKOP_socketpair       8#define SOCKOP_send             9#define SOCKOP_recv             10#define SOCKOP_sendto           11#define SOCKOP_recvfrom         12#define SOCKOP_shutdown         13#define SOCKOP_setsockopt       14#define SOCKOP_getsockopt       15#define SOCKOP_sendmsg          16#define SOCKOP_recvmsg          17#define IPCOP_semop		1#define IPCOP_semget		2#define IPCOP_semctl		3#define IPCOP_semtimedop	4#define IPCOP_msgsnd		11#define IPCOP_msgrcv		12#define IPCOP_msgget		13#define IPCOP_msgctl		14#define IPCOP_shmat		21#define IPCOP_shmdt		22#define IPCOP_shmget		23#define IPCOP_shmctl		24/* * The following is for compatibility across the various Linux * platforms.  The i386 ioctl numbering scheme doesn't really enforce * a type field.  De facto, however, the top 8 bits of the lower 16 * bits are indeed used as a type field, so we might just as well make * this explicit here.  Please be sure to use the decoding macros * below from now on. */#define TARGET_IOC_NRBITS	8#define TARGET_IOC_TYPEBITS	8#if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SH4) \    || defined(TARGET_M68K) || defined(TARGET_ALPHA) || defined(TARGET_CRIS)#define TARGET_IOC_SIZEBITS	14#define TARGET_IOC_DIRBITS	2#define TARGET_IOC_NONE	  0U#define TARGET_IOC_WRITE  1U#define TARGET_IOC_READ	  2U#elif defined(TARGET_PPC) || defined(TARGET_ALPHA) || \      defined(TARGET_SPARC) || defined(TARGET_MIPS)#define TARGET_IOC_SIZEBITS	13#define TARGET_IOC_DIRBITS	3#define TARGET_IOC_NONE	  1U#define TARGET_IOC_READ	  2U#define TARGET_IOC_WRITE  4U#else#error unsupported CPU#endif#define TARGET_IOC_NRMASK	((1 << TARGET_IOC_NRBITS)-1)#define TARGET_IOC_TYPEMASK	((1 << TARGET_IOC_TYPEBITS)-1)#define TARGET_IOC_SIZEMASK	((1 << TARGET_IOC_SIZEBITS)-1)#define TARGET_IOC_DIRMASK	((1 << TARGET_IOC_DIRBITS)-1)#define TARGET_IOC_NRSHIFT	0#define TARGET_IOC_TYPESHIFT	(TARGET_IOC_NRSHIFT+TARGET_IOC_NRBITS)#define TARGET_IOC_SIZESHIFT	(TARGET_IOC_TYPESHIFT+TARGET_IOC_TYPEBITS)#define TARGET_IOC_DIRSHIFT	(TARGET_IOC_SIZESHIFT+TARGET_IOC_SIZEBITS)#define TARGET_IOC(dir,type,nr,size) \	(((dir)  << TARGET_IOC_DIRSHIFT) | \	 ((type) << TARGET_IOC_TYPESHIFT) | \	 ((nr)   << TARGET_IOC_NRSHIFT) | \	 ((size) << TARGET_IOC_SIZESHIFT))/* used to create numbers */#define TARGET_IO(type,nr)		TARGET_IOC(TARGET_IOC_NONE,(type),(nr),0)#define TARGET_IOR(type,nr,size)	TARGET_IOC(TARGET_IOC_READ,(type),(nr),sizeof(size))#define TARGET_IOW(type,nr,size)	TARGET_IOC(TARGET_IOC_WRITE,(type),(nr),sizeof(size))#define TARGET_IOWR(type,nr,size)	TARGET_IOC(TARGET_IOC_READ|TARGET_IOC_WRITE,(type),(nr),sizeof(size))/* the size is automatically computed for these defines */#define TARGET_IORU(type,nr)	TARGET_IOC(TARGET_IOC_READ,(type),(nr),TARGET_IOC_SIZEMASK)#define TARGET_IOWU(type,nr)	TARGET_IOC(TARGET_IOC_WRITE,(type),(nr),TARGET_IOC_SIZEMASK)#define TARGET_IOWRU(type,nr)	TARGET_IOC(TARGET_IOC_READ|TARGET_IOC_WRITE,(type),(nr),TARGET_IOC_SIZEMASK)struct target_sockaddr {    uint16_t sa_family;    uint8_t sa_data[14];};struct target_timeval {    abi_long tv_sec;    abi_long tv_usec;};struct target_timespec {    abi_long tv_sec;    abi_long tv_nsec;};struct target_itimerval {    struct target_timeval it_interval;    struct target_timeval it_value;};typedef abi_long target_clock_t;#define TARGET_HZ 100struct target_tms {    target_clock_t tms_utime;    target_clock_t tms_stime;    target_clock_t tms_cutime;    target_clock_t tms_cstime;};struct target_utimbuf {    abi_long actime;    abi_long modtime;};struct target_sel_arg_struct {    abi_long n;    abi_long inp, outp, exp;    abi_long tvp;};struct target_iovec {    abi_long iov_base;   /* Starting address */    abi_long iov_len;   /* Number of bytes */};struct target_msghdr {    abi_long	 msg_name;	 /* Socket name			*/    int		 msg_namelen;	 /* Length of name		*/    abi_long	 msg_iov;	 /* Data blocks			*/    abi_long	 msg_iovlen;	 /* Number of blocks		*/    abi_long     msg_control;	 /* Per protocol magic (eg BSD file descriptor passing) */    abi_long	 msg_controllen; /* Length of cmsg list */    unsigned int msg_flags;};struct target_cmsghdr {    abi_long     cmsg_len;    int          cmsg_level;    int          cmsg_type;};#define TARGET_CMSG_DATA(cmsg) ((unsigned char *) ((struct target_cmsghdr *) (cmsg) + 1))#define TARGET_CMSG_NXTHDR(mhdr, cmsg) __target_cmsg_nxthdr (mhdr, cmsg)#define TARGET_CMSG_ALIGN(len) (((len) + sizeof (abi_long) - 1) \                               & (size_t) ~(sizeof (abi_long) - 1))#define TARGET_CMSG_SPACE(len) (TARGET_CMSG_ALIGN (len) \                               + TARGET_CMSG_ALIGN (sizeof (struct target_cmsghdr)))#define TARGET_CMSG_LEN(len)   (TARGET_CMSG_ALIGN (sizeof (struct target_cmsghdr)) + (len))static __inline__ struct target_cmsghdr *__target_cmsg_nxthdr (struct target_msghdr *__mhdr, struct target_cmsghdr *__cmsg){  struct target_cmsghdr *__ptr;  __ptr = (struct target_cmsghdr *)((unsigned char *) __cmsg                                    + TARGET_CMSG_ALIGN (tswapl(__cmsg->cmsg_len)));  if ((unsigned long)((char *)(__ptr+1) - (char *)(size_t)tswapl(__mhdr->msg_control))      > tswapl(__mhdr->msg_controllen))    /* No more entries.  */    return (struct target_cmsghdr *)0;  return __cmsg;}struct  target_rusage {        struct target_timeval ru_utime;        /* user time used */        struct target_timeval ru_stime;        /* system time used */        abi_long    ru_maxrss;                 /* maximum resident set size */        abi_long    ru_ixrss;                  /* integral shared memory size */        abi_long    ru_idrss;                  /* integral unshared data size */        abi_long    ru_isrss;                  /* integral unshared stack size */        abi_long    ru_minflt;                 /* page reclaims */        abi_long    ru_majflt;                 /* page faults */        abi_long    ru_nswap;                  /* swaps */        abi_long    ru_inblock;                /* block input operations */        abi_long    ru_oublock;                /* block output operations */        abi_long    ru_msgsnd;                 /* messages sent */        abi_long    ru_msgrcv;                 /* messages received */        abi_long    ru_nsignals;               /* signals received */        abi_long    ru_nvcsw;                  /* voluntary context switches */        abi_long    ru_nivcsw;                 /* involuntary " */};typedef struct {        int     val[2];} kernel_fsid_t;struct kernel_statfs {	int f_type;	int f_bsize;	int f_blocks;	int f_bfree;	int f_bavail;	int f_files;	int f_ffree;        kernel_fsid_t f_fsid;	int f_namelen;	int f_spare[6];};struct target_dirent {	abi_long	d_ino;	abi_long	d_off;	unsigned short	d_reclen;	char		d_name[256]; /* We must not include limits.h! */};struct target_dirent64 {	uint64_t	d_ino;	int64_t		d_off;	unsigned short	d_reclen;	unsigned char	d_type;	char		d_name[256];};/* mostly generic signal stuff */#define TARGET_SIG_DFL	((abi_long)0)	/* default signal handling */#define TARGET_SIG_IGN	((abi_long)1)	/* ignore signal */#define TARGET_SIG_ERR	((abi_long)-1)	/* error return from signal */#ifdef TARGET_MIPS#define TARGET_NSIG	   128#else#define TARGET_NSIG	   64#endif#define TARGET_NSIG_BPW	   TARGET_ABI_BITS#define TARGET_NSIG_WORDS  (TARGET_NSIG / TARGET_NSIG_BPW)typedef struct {    abi_ulong sig[TARGET_NSIG_WORDS];} target_sigset_t;#ifdef BSWAP_NEEDEDstatic inline void tswap_sigset(target_sigset_t *d, const target_sigset_t *s){    int i;    for(i = 0;i < TARGET_NSIG_WORDS; i++)        d->sig[i] = tswapl(s->sig[i]);}#elsestatic inline void tswap_sigset(target_sigset_t *d, const target_sigset_t *s){    *d = *s;}#endifstatic inline void target_siginitset(target_sigset_t *d, abi_ulong set){    int i;    d->sig[0] = set;    for(i = 1;i < TARGET_NSIG_WORDS; i++)        d->sig[i] = 0;}void host_to_target_sigset(target_sigset_t *d, const sigset_t *s);void target_to_host_sigset(sigset_t *d, const target_sigset_t *s);void host_to_target_old_sigset(abi_ulong *old_sigset,                               const sigset_t *sigset);void target_to_host_old_sigset(sigset_t *sigset,                               const abi_ulong *old_sigset);struct target_sigaction;int do_sigaction(int sig, const struct target_sigaction *act,                 struct target_sigaction *oact);#if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) || defined(TARGET_PPC) || defined(TARGET_MIPS) || defined (TARGET_SH4) || defined(TARGET_M68K) || defined(TARGET_ALPHA) || defined(TARGET_CRIS)#if defined(TARGET_SPARC)#define TARGET_SA_NOCLDSTOP    8u#define TARGET_SA_NOCLDWAIT    0x100u#define TARGET_SA_SIGINFO      0x200u#define TARGET_SA_ONSTACK      1u#define TARGET_SA_RESTART      2u#define TARGET_SA_NODEFER      0x20u#define TARGET_SA_RESETHAND    4u#elif defined(TARGET_MIPS)#define TARGET_SA_NOCLDSTOP	0x00000001#define TARGET_SA_NOCLDWAIT	0x00010000#define TARGET_SA_SIGINFO	0x00000008#define TARGET_SA_ONSTACK	0x08000000#define TARGET_SA_NODEFER	0x40000000#define TARGET_SA_RESTART	0x10000000#define TARGET_SA_RESETHAND	0x80000000#if !defined(TARGET_ABI_MIPSN32) && !defined(TARGET_ABI_MIPSN64)#define TARGET_SA_RESTORER	0x04000000	/* Only for O32 */#endif#else#define TARGET_SA_NOCLDSTOP	0x00000001#define TARGET_SA_NOCLDWAIT	0x00000002 /* not supported yet */#define TARGET_SA_SIGINFO	0x00000004#define TARGET_SA_ONSTACK	0x08000000#define TARGET_SA_RESTART	0x10000000#define TARGET_SA_NODEFER	0x40000000#define TARGET_SA_RESETHAND	0x80000000#define TARGET_SA_RESTORER	0x04000000#endif#if defined(TARGET_SPARC)#define TARGET_SIGHUP		 1#define TARGET_SIGINT		 2#define TARGET_SIGQUIT		 3#define TARGET_SIGILL		 4#define TARGET_SIGTRAP		 5#define TARGET_SIGABRT		 6#define TARGET_SIGIOT		 6#define TARGET_SIGSTKFLT	 7 /* actually EMT */#define TARGET_SIGFPE		 8#define TARGET_SIGKILL		 9#define TARGET_SIGBUS		10#define TARGET_SIGSEGV		11#define TARGET_SIGSYS		12#define TARGET_SIGPIPE		13#define TARGET_SIGALRM		14#define TARGET_SIGTERM		15#define TARGET_SIGURG		16#define TARGET_SIGSTOP		17#define TARGET_SIGTSTP		18#define TARGET_SIGCONT		19#define TARGET_SIGCHLD		20#define TARGET_SIGTTIN		21#define TARGET_SIGTTOU		22#define TARGET_SIGIO		23#define TARGET_SIGXCPU		24#define TARGET_SIGXFSZ		25#define TARGET_SIGVTALRM	26#define TARGET_SIGPROF		27#define TARGET_SIGWINCH	        28#define TARGET_SIGPWR		29#define TARGET_SIGUSR1		30#define TARGET_SIGUSR2		31#define TARGET_SIGRTMIN         32#define TARGET_SIG_BLOCK          0x01 /* for blocking signals */#define TARGET_SIG_UNBLOCK        0x02 /* for unblocking signals */#define TARGET_SIG_SETMASK        0x04 /* for setting the signal mask */#elif defined(TARGET_MIPS)#define TARGET_SIGHUP		 1	/* Hangup (POSIX).  */#define TARGET_SIGINT		 2	/* Interrupt (ANSI).  */#define TARGET_SIGQUIT		 3	/* Quit (POSIX).  */#define TARGET_SIGILL		 4	/* Illegal instruction (ANSI).  */#define TARGET_SIGTRAP		 5	/* Trace trap (POSIX).  */#define TARGET_SIGIOT		 6	/* IOT trap (4.2 BSD).  */#define TARGET_SIGABRT		 TARGET_SIGIOT	/* Abort (ANSI).  */#define TARGET_SIGEMT		 7#define TARGET_SIGSTKFLT	 7 /* XXX: incorrect */#define TARGET_SIGFPE		 8	/* Floating-point exception (ANSI).  */#define TARGET_SIGKILL		 9	/* Kill, unblockable (POSIX).  */#define TARGET_SIGBUS		10	/* BUS error (4.2 BSD).  */#define TARGET_SIGSEGV		11	/* Segmentation violation (ANSI).  */#define TARGET_SIGSYS		12#define TARGET_SIGPIPE		13	/* Broken pipe (POSIX).  */#define TARGET_SIGALRM		14	/* Alarm clock (POSIX).  */#define TARGET_SIGTERM		15	/* Termination (ANSI).  */#define TARGET_SIGUSR1		16	/* User-defined signal 1 (POSIX).  */#define TARGET_SIGUSR2		17	/* User-defined signal 2 (POSIX).  */#define TARGET_SIGCHLD		18	/* Child status has changed (POSIX).  */#define TARGET_SIGCLD		TARGET_SIGCHLD	/* Same as TARGET_SIGCHLD (System V).  */#define TARGET_SIGPWR		19	/* Power failure restart (System V).  */#define TARGET_SIGWINCH	20	/* Window size change (4.3 BSD, Sun).  */#define TARGET_SIGURG		21	/* Urgent condition on socket (4.2 BSD).  */#define TARGET_SIGIO		22	/* I/O now possible (4.2 BSD).  */

⌨️ 快捷键说明

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