separated helpers from micro operations
[qemu] / syscall-i386.h
index a2fb03d..178b638 100644 (file)
@@ -330,7 +330,7 @@ struct target_stat64 {
        target_ulong    __pad7;         /* will be high 32 bits of ctime someday */
 
        unsigned long long      st_ino;
-};
+} __attribute__((packed));
 
 #define TARGET_SA_NOCLDSTOP    0x00000001
 #define TARGET_SA_NOCLDWAIT    0x00000002 /* not supported yet */
@@ -445,6 +445,18 @@ typedef struct target_siginfo {
 } target_siginfo_t;
 
 /*
+ * si_code values
+ * Digital reserves positive values for kernel-generated signals.
+ */
+#define TARGET_SI_USER         0       /* sent by kill, sigsend, raise */
+#define TARGET_SI_KERNEL       0x80    /* sent by the kernel from somewhere */
+#define TARGET_SI_QUEUE        -1              /* sent by sigqueue */
+#define TARGET_SI_TIMER -2              /* sent by timer expiration */
+#define TARGET_SI_MESGQ        -3              /* sent by real time mesq state change */
+#define TARGET_SI_ASYNCIO      -4      /* sent by AIO completion */
+#define TARGET_SI_SIGIO        -5              /* sent by queued SIGIO */
+
+/*
  * SIGILL si_codes
  */
 #define TARGET_ILL_ILLOPN      (2)     /* illegal operand */
@@ -462,6 +474,18 @@ typedef struct target_siginfo {
 #define TARGET_FPE_FLTSUB      (8)  /* subscript out of range */
 #define TARGET_NSIGFPE         8
 
+/*
+ * SIGSEGV si_codes
+ */
+#define TARGET_SEGV_MAPERR     (1)  /* address not mapped to object */
+#define TARGET_SEGV_ACCERR     (2)  /* invalid permissions for mapped object */
+
+/*
+ * SIGTRAP si_codes
+ */
+#define TARGET_TRAP_BRKPT      (1)     /* process breakpoint */
+#define TARGET_TRAP_TRACE      (2)     /* process trace trap */
+
 /* default linux values for the selectors */
 #define __USER_CS      (0x23)
 #define __USER_DS      (0x2B)
@@ -760,6 +784,13 @@ struct target_modify_ldt_ldt_s {
 
 #define TARGET_BIOSSEG         0x0f000
 
+#define TARGET_CPU_086         0
+#define TARGET_CPU_186         1
+#define TARGET_CPU_286         2
+#define TARGET_CPU_386         3
+#define TARGET_CPU_486         4
+#define TARGET_CPU_586         5
+
 #define TARGET_VM86_SIGNAL     0       /* return due to signal */
 #define TARGET_VM86_UNKNOWN    1       /* unhandled GP fault - IO-instruction or similar */
 #define TARGET_VM86_INTx       2       /* int3/int x instruction (ARG = x) */
@@ -936,6 +967,24 @@ union target_semun {
     unsigned int __pad;        /* really void* */
 };
 
+#define TARGET_F_DUPFD         0       /* dup */
+#define TARGET_F_GETFD         1       /* get close_on_exec */
+#define TARGET_F_SETFD         2       /* set/clear close_on_exec */
+#define TARGET_F_GETFL         3       /* get file->f_flags */
+#define TARGET_F_SETFL         4       /* set file->f_flags */
+#define TARGET_F_GETLK         5
+#define TARGET_F_SETLK         6
+#define TARGET_F_SETLKW        7
+
+#define TARGET_F_SETOWN        8       /*  for sockets. */
+#define TARGET_F_GETOWN        9       /*  for sockets. */
+#define TARGET_F_SETSIG        10      /*  for sockets. */
+#define TARGET_F_GETSIG        11      /*  for sockets. */
+
+#define TARGET_F_GETLK64       12      /*  using 'struct flock64' */
+#define TARGET_F_SETLK64       13
+#define TARGET_F_SETLKW64      14
+
 struct target_flock {
        short l_type;
        short l_whence;