/[qemu]/qemu/linux-user/syscall_defs.h
ViewVC logotype

Diff of /qemu/linux-user/syscall_defs.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22 by bellard, Thu Sep 30 22:04:13 2004 UTC revision 1.23 by bellard, Sat Nov 26 18:47:20 2005 UTC
# Line 57  Line 57 
57  #define TARGET_IOC_WRITE  1U  #define TARGET_IOC_WRITE  1U
58  #define TARGET_IOC_READ   2U  #define TARGET_IOC_READ   2U
59    
60  #elif defined(TARGET_PPC) || defined(TARGET_ALPHA) || defined(TARGET_SPARC)  #elif defined(TARGET_PPC) || defined(TARGET_ALPHA) || \
61          defined(TARGET_SPARC) || defined(TARGET_MIPS)
62    
63  #define TARGET_IOC_SIZEBITS     13  #define TARGET_IOC_SIZEBITS     13
64  #define TARGET_IOC_DIRBITS      3  #define TARGET_IOC_DIRBITS      3
# Line 292  struct target_sigaction; Line 293  struct target_sigaction;
293  int do_sigaction(int sig, const struct target_sigaction *act,  int do_sigaction(int sig, const struct target_sigaction *act,
294                   struct target_sigaction *oact);                   struct target_sigaction *oact);
295    
296  #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) || defined(TARGET_PPC)  #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) || defined(TARGET_PPC) || defined(TARGET_MIPS)
297    
298  #if !defined(TARGET_SPARC)  #if defined(TARGET_SPARC)
299    #define TARGET_SA_NOCLDSTOP    8u
300    #define TARGET_SA_NOCLDWAIT    0x100u
301    #define TARGET_SA_SIGINFO      0x200u
302    #define TARGET_SA_ONSTACK      1u
303    #define TARGET_SA_RESTART      2u
304    #define TARGET_SA_NODEFER      0x20u
305    #define TARGET_SA_RESETHAND    4u
306    #elif defined(TARGET_MIPS)
307    #define TARGET_SA_NOCLDSTOP     0x00000001
308    #define TARGET_SA_NOCLDWAIT     0x00010000
309    #define TARGET_SA_SIGINFO       0x00000008
310    #define TARGET_SA_ONSTACK       0x08000000
311    #define TARGET_SA_NODEFER       0x40000000
312    #define TARGET_SA_RESTART       0x10000000
313    #define TARGET_SA_RESETHAND     0x80000000
314    #define TARGET_SA_RESTORER      0x04000000      /* Only for o32 */
315    #else
316  #define TARGET_SA_NOCLDSTOP     0x00000001  #define TARGET_SA_NOCLDSTOP     0x00000001
317  #define TARGET_SA_NOCLDWAIT     0x00000002 /* not supported yet */  #define TARGET_SA_NOCLDWAIT     0x00000002 /* not supported yet */
318  #define TARGET_SA_SIGINFO       0x00000004  #define TARGET_SA_SIGINFO       0x00000004
# Line 303  int do_sigaction(int sig, const struct t Line 321  int do_sigaction(int sig, const struct t
321  #define TARGET_SA_NODEFER       0x40000000  #define TARGET_SA_NODEFER       0x40000000
322  #define TARGET_SA_RESETHAND     0x80000000  #define TARGET_SA_RESETHAND     0x80000000
323  #define TARGET_SA_RESTORER      0x04000000  #define TARGET_SA_RESTORER      0x04000000
 #else /* 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  
324  #endif  #endif
325    
326  #if defined(TARGET_SPARC)  #if defined(TARGET_SPARC)
# Line 353  int do_sigaction(int sig, const struct t Line 363  int do_sigaction(int sig, const struct t
363  #define TARGET_SIG_UNBLOCK        0x02 /* for unblocking signals */  #define TARGET_SIG_UNBLOCK        0x02 /* for unblocking signals */
364  #define TARGET_SIG_SETMASK        0x04 /* for setting the signal mask */  #define TARGET_SIG_SETMASK        0x04 /* for setting the signal mask */
365    
366    #elif defined(TARGET_MIPS)
367    
368    #define TARGET_SIGHUP            1      /* Hangup (POSIX).  */
369    #define TARGET_SIGINT            2      /* Interrupt (ANSI).  */
370    #define TARGET_SIGQUIT           3      /* Quit (POSIX).  */
371    #define TARGET_SIGILL            4      /* Illegal instruction (ANSI).  */
372    #define TARGET_SIGTRAP           5      /* Trace trap (POSIX).  */
373    #define TARGET_SIGIOT            6      /* IOT trap (4.2 BSD).  */
374    #define TARGET_SIGABRT           TARGET_SIGIOT  /* Abort (ANSI).  */
375    #define TARGET_SIGEMT            7
376    #define TARGET_SIGSTKFLT         7 /* XXX: incorrect */
377    #define TARGET_SIGFPE            8      /* Floating-point exception (ANSI).  */
378    #define TARGET_SIGKILL           9      /* Kill, unblockable (POSIX).  */
379    #define TARGET_SIGBUS           10      /* BUS error (4.2 BSD).  */
380    #define TARGET_SIGSEGV          11      /* Segmentation violation (ANSI).  */
381    #define TARGET_SIGSYS           12
382    #define TARGET_SIGPIPE          13      /* Broken pipe (POSIX).  */
383    #define TARGET_SIGALRM          14      /* Alarm clock (POSIX).  */
384    #define TARGET_SIGTERM          15      /* Termination (ANSI).  */
385    #define TARGET_SIGUSR1          16      /* User-defined signal 1 (POSIX).  */
386    #define TARGET_SIGUSR2          17      /* User-defined signal 2 (POSIX).  */
387    #define TARGET_SIGCHLD          18      /* Child status has changed (POSIX).  */
388    #define TARGET_SIGCLD           TARGET_SIGCHLD  /* Same as TARGET_SIGCHLD (System V).  */
389    #define TARGET_SIGPWR           19      /* Power failure restart (System V).  */
390    #define TARGET_SIGWINCH 20      /* Window size change (4.3 BSD, Sun).  */
391    #define TARGET_SIGURG           21      /* Urgent condition on socket (4.2 BSD).  */
392    #define TARGET_SIGIO            22      /* I/O now possible (4.2 BSD).  */
393    #define TARGET_SIGPOLL          TARGET_SIGIO    /* Pollable event occurred (System V).  */
394    #define TARGET_SIGSTOP          23      /* Stop, unblockable (POSIX).  */
395    #define TARGET_SIGTSTP          24      /* Keyboard stop (POSIX).  */
396    #define TARGET_SIGCONT          25      /* Continue (POSIX).  */
397    #define TARGET_SIGTTIN          26      /* Background read from tty (POSIX).  */
398    #define TARGET_SIGTTOU          27      /* Background write to tty (POSIX).  */
399    #define TARGET_SIGVTALRM        28      /* Virtual alarm clock (4.2 BSD).  */
400    #define TARGET_SIGPROF          29      /* Profiling alarm clock (4.2 BSD).  */
401    #define TARGET_SIGXCPU          30      /* CPU limit exceeded (4.2 BSD).  */
402    #define TARGET_SIGXFSZ          31      /* File size limit exceeded (4.2 BSD).  */
403    #define TARGET_SIGRTMIN         32
404    
405    #define TARGET_SIG_BLOCK        1       /* for blocking signals */
406    #define TARGET_SIG_UNBLOCK      2       /* for unblocking signals */
407    #define TARGET_SIG_SETMASK      3       /* for setting the signal mask */
408    
409  #else  #else
410    
411  #define TARGET_SIGHUP            1  #define TARGET_SIGHUP            1
# Line 794  struct target_winsize { Line 847  struct target_winsize {
847  #define TARGET_MAP_PRIVATE      0x02            /* Changes are private */  #define TARGET_MAP_PRIVATE      0x02            /* Changes are private */
848  #define TARGET_MAP_TYPE 0x0f            /* Mask for type of mapping */  #define TARGET_MAP_TYPE 0x0f            /* Mask for type of mapping */
849  #define TARGET_MAP_FIXED        0x10            /* Interpret addr exactly */  #define TARGET_MAP_FIXED        0x10            /* Interpret addr exactly */
850    #if defined(TARGET_MIPS)
851    #define TARGET_MAP_ANONYMOUS    0x0800          /* don't use a file */
852    #define TARGET_MAP_GROWSDOWN    0x1000          /* stack-like segment */
853    #define TARGET_MAP_DENYWRITE    0x2000          /* ETXTBSY */
854    #define TARGET_MAP_EXECUTABLE   0x4000          /* mark it as an executable */
855    #define TARGET_MAP_LOCKED       0x8000          /* pages are locked */
856    #define TARGET_MAP_NORESERVE    0x0400          /* don't check for reservations */
857    #else
858  #define TARGET_MAP_ANONYMOUS    0x20            /* don't use a file */  #define TARGET_MAP_ANONYMOUS    0x20            /* don't use a file */
   
859  #define TARGET_MAP_GROWSDOWN    0x0100          /* stack-like segment */  #define TARGET_MAP_GROWSDOWN    0x0100          /* stack-like segment */
860  #define TARGET_MAP_DENYWRITE    0x0800          /* ETXTBSY */  #define TARGET_MAP_DENYWRITE    0x0800          /* ETXTBSY */
861  #define TARGET_MAP_EXECUTABLE   0x1000          /* mark it as an executable */  #define TARGET_MAP_EXECUTABLE   0x1000          /* mark it as an executable */
862  #define TARGET_MAP_LOCKED       0x2000          /* pages are locked */  #define TARGET_MAP_LOCKED       0x2000          /* pages are locked */
863  #define TARGET_MAP_NORESERVE    0x4000          /* don't check for reservations */  #define TARGET_MAP_NORESERVE    0x4000          /* don't check for reservations */
864    #endif
865    
866  #if defined(TARGET_I386) || defined(TARGET_ARM)  #if defined(TARGET_I386) || defined(TARGET_ARM)
867  struct target_stat {  struct target_stat {
# Line 967  struct target_stat64 { Line 1028  struct target_stat64 {
1028          target_ulong    __unused5;          target_ulong    __unused5;
1029  };  };
1030    
1031  #endif /* defined(TARGET_PPC) */  #elif defined(TARGET_MIPS)
1032    
1033    struct target_stat {
1034            unsigned        st_dev;
1035            target_long     st_pad1[3];             /* Reserved for network id */
1036            target_ulong    st_ino;
1037            unsigned int    st_mode;
1038            unsigned int    st_nlink;
1039            int             st_uid;
1040            int             st_gid;
1041            unsigned        st_rdev;
1042            target_long     st_pad2[2];
1043            target_long     st_size;
1044            target_long     st_pad3;
1045            /*
1046             * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
1047             * but we don't have it under Linux.
1048             */
1049            target_long             target_st_atime;
1050            target_long             target_st_atime_nsec;
1051            target_long             target_st_mtime;
1052            target_long             target_st_mtime_nsec;
1053            target_long             target_st_ctime;
1054            target_long             target_st_ctime_nsec;
1055            target_long             st_blksize;
1056            target_long             st_blocks;
1057            target_long             st_pad4[14];
1058    };
1059    
1060    /*
1061     * This matches struct stat64 in glibc2.1, hence the absolutely insane
1062     * amounts of padding around dev_t's.  The memory layout is the same as of
1063     * struct stat of the 64-bit kernel.
1064     */
1065    
1066    struct target_stat64 {
1067            target_ulong    st_dev;
1068            target_ulong    st_pad0[3];     /* Reserved for st_dev expansion  */
1069    
1070            uint64_t        st_ino;
1071    
1072            unsigned int    st_mode;
1073            unsigned int    st_nlink;
1074    
1075            int             st_uid;
1076            int             st_gid;
1077    
1078            target_ulong    st_rdev;
1079            target_ulong    st_pad1[3];     /* Reserved for st_rdev expansion  */
1080    
1081            int64_t         st_size;
1082    
1083            /*
1084             * Actually this should be timestruc_t st_atime, st_mtime and st_ctime
1085             * but we don't have it under Linux.
1086             */
1087            target_long     target_st_atime;
1088            target_ulong    target_st_atime_nsec;   /* Reserved for st_atime expansion  */
1089    
1090            target_long     target_st_mtime;
1091            target_ulong    target_st_mtime_nsec;   /* Reserved for st_mtime expansion  */
1092    
1093            target_long     target_st_ctime;
1094            target_ulong    target_st_ctime_nsec;   /* Reserved for st_ctime expansion  */
1095    
1096            target_ulong    st_blksize;
1097            target_ulong    st_pad2;
1098    
1099            int64_t         st_blocks;
1100    };
1101    #else
1102    #error unsupported CPU
1103    #endif
1104    
1105  #define TARGET_F_DUPFD         0       /* dup */  #define TARGET_F_DUPFD         0       /* dup */
1106  #define TARGET_F_GETFD         1       /* get close_on_exec */  #define TARGET_F_GETFD         1       /* get close_on_exec */
# Line 1007  struct target_stat64 { Line 1140  struct target_stat64 {
1140  #define TARGET_O_TRUNC           01000 /* not fcntl */  #define TARGET_O_TRUNC           01000 /* not fcntl */
1141  #define TARGET_O_APPEND          02000  #define TARGET_O_APPEND          02000
1142  #define TARGET_O_NONBLOCK        04000  #define TARGET_O_NONBLOCK        04000
1143  #define TARGET_O_NDELAY        O_NONBLOCK  #define TARGET_O_NDELAY        TARGET_O_NONBLOCK
1144  #define TARGET_O_SYNC           010000  #define TARGET_O_SYNC           010000
1145  #define TARGET_FASYNC           020000 /* fcntl, for BSD compatibility */  #define TARGET_FASYNC           020000 /* fcntl, for BSD compatibility */
1146  #define TARGET_O_DIRECTORY      040000 /* must be a directory */  #define TARGET_O_DIRECTORY      040000 /* must be a directory */
# Line 1025  struct target_stat64 { Line 1158  struct target_stat64 {
1158  #define TARGET_O_TRUNC           01000 /* not fcntl */  #define TARGET_O_TRUNC           01000 /* not fcntl */
1159  #define TARGET_O_APPEND          02000  #define TARGET_O_APPEND          02000
1160  #define TARGET_O_NONBLOCK        04000  #define TARGET_O_NONBLOCK        04000
1161  #define TARGET_O_NDELAY        O_NONBLOCK  #define TARGET_O_NDELAY        TARGET_O_NONBLOCK
1162  #define TARGET_O_SYNC           010000  #define TARGET_O_SYNC           010000
1163  #define TARGET_FASYNC           020000 /* fcntl, for BSD compatibility */  #define TARGET_FASYNC           020000 /* fcntl, for BSD compatibility */
1164  #define TARGET_O_DIRECTORY      040000 /* must be a directory */  #define TARGET_O_DIRECTORY      040000 /* must be a directory */
# Line 1044  struct target_stat64 { Line 1177  struct target_stat64 {
1177  #define TARGET_O_EXCL          0x0800  /* not fcntl */  #define TARGET_O_EXCL          0x0800  /* not fcntl */
1178  #define TARGET_O_SYNC          0x2000  #define TARGET_O_SYNC          0x2000
1179  #define TARGET_O_NONBLOCK      0x4000  #define TARGET_O_NONBLOCK      0x4000
1180  #define TARGET_O_NDELAY        (0x0004 | O_NONBLOCK)  #define TARGET_O_NDELAY        (0x0004 | TARGET_O_NONBLOCK)
1181  #define TARGET_O_NOCTTY        0x8000  /* not fcntl */  #define TARGET_O_NOCTTY        0x8000  /* not fcntl */
1182  #define TARGET_O_DIRECTORY     0x10000 /* must be a directory */  #define TARGET_O_DIRECTORY     0x10000 /* must be a directory */
1183  #define TARGET_O_NOFOLLOW      0x20000 /* don't follow links */  #define TARGET_O_NOFOLLOW      0x20000 /* don't follow links */
1184  #define TARGET_O_LARGEFILE     0x40000  #define TARGET_O_LARGEFILE     0x40000
1185  #define TARGET_O_DIRECT        0x100000 /* direct disk access hint */  #define TARGET_O_DIRECT        0x100000 /* direct disk access hint */
1186    #elif defined(TARGET_MIPS)
1187    #define TARGET_O_ACCMODE        0x0003
1188    #define TARGET_O_RDONLY 0x0000
1189    #define TARGET_O_WRONLY 0x0001
1190    #define TARGET_O_RDWR           0x0002
1191    #define TARGET_O_APPEND 0x0008
1192    #define TARGET_O_SYNC           0x0010
1193    #define TARGET_O_NONBLOCK       0x0080
1194    #define TARGET_O_CREAT         0x0100   /* not fcntl */
1195    #define TARGET_O_TRUNC          0x0200  /* not fcntl */
1196    #define TARGET_O_EXCL           0x0400  /* not fcntl */
1197    #define TARGET_O_NOCTTY 0x0800  /* not fcntl */
1198    #define TARGET_FASYNC           0x1000  /* fcntl, for BSD compatibility */
1199    #define TARGET_O_LARGEFILE      0x2000  /* allow large file opens */
1200    #define TARGET_O_DIRECT 0x8000  /* direct disk access hint */
1201    #define TARGET_O_DIRECTORY      0x10000 /* must be a directory */
1202    #define TARGET_O_NOFOLLOW       0x20000 /* don't follow links */
1203    #define TARGET_O_NOATIME        0x40000
1204    #define TARGET_O_NDELAY TARGET_O_NONBLOCK
1205  #else  #else
1206  #define TARGET_O_ACCMODE          0003  #define TARGET_O_ACCMODE          0003
1207  #define TARGET_O_RDONLY             00  #define TARGET_O_RDONLY             00
# Line 1061  struct target_stat64 { Line 1213  struct target_stat64 {
1213  #define TARGET_O_TRUNC           01000 /* not fcntl */  #define TARGET_O_TRUNC           01000 /* not fcntl */
1214  #define TARGET_O_APPEND          02000  #define TARGET_O_APPEND          02000
1215  #define TARGET_O_NONBLOCK        04000  #define TARGET_O_NONBLOCK        04000
1216  #define TARGET_O_NDELAY        O_NONBLOCK  #define TARGET_O_NDELAY        TARGET_O_NONBLOCK
1217  #define TARGET_O_SYNC           010000  #define TARGET_O_SYNC           010000
1218  #define TARGET_FASYNC           020000 /* fcntl, for BSD compatibility */  #define TARGET_FASYNC           020000 /* fcntl, for BSD compatibility */
1219  #define TARGET_O_DIRECT         040000 /* direct disk access hint */  #define TARGET_O_DIRECT         040000 /* direct disk access hint */

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26