1 /* 2 * Copyright (c) 1988 University of Utah. 3 * Copyright (c) 1990 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Systems Programming Group of the University of Utah Computer 8 * Science Department. 9 * 10 * %sccs.include.redist.c% 11 * 12 * from: Utah $Hdr: hpux.h 1.1 90/07/09$ 13 * 14 * @(#)hpux.h 7.3 (Berkeley) 12/16/90 15 */ 16 17 #include "hpux_exec.h" 18 19 /* HP-UX style UTSNAME struct used by uname syscall */ 20 21 struct hpuxutsname { 22 char sysname[9]; 23 char nodename[9]; 24 char release[9]; 25 char version[9]; 26 char machine[9]; 27 char idnumber[15]; 28 }; 29 30 /* HP-UX style "old" IOCTLs */ 31 32 struct hpuxsgttyb { 33 char sg_ispeed; 34 char sg_ospeed; 35 char sg_erase; 36 char sg_kill; 37 int sg_flags; /* only a short in BSD */ 38 }; 39 40 #define V7_HUPCL 00001 41 #define V7_XTABS 00002 42 #define V7_NOAL 04000 43 44 #define HPUXTIOCGETP _IOR('t', 8, struct hpuxsgttyb) 45 #define HPUXTIOCSETP _IOW('t', 9, struct hpuxsgttyb) 46 47 /* 6.5 job control related ioctls which need to be mapped */ 48 49 #define HPUXTIOCSLTC _IOW('T', 23, struct ltchars) 50 #define HPUXTIOCGLTC _IOR('T', 24, struct ltchars) 51 #define HPUXTIOCLBIS _IOW('T', 25, int) 52 #define HPUXTIOCLBIC _IOW('T', 26, int) 53 #define HPUXTIOCLSET _IOW('T', 27, int) 54 #define HPUXTIOCLGET _IOR('T', 28, int) 55 # define HPUXLTOSTOP 0000001 56 #define HPUXTIOCSPGRP _IOW('T', 29, int) 57 #define HPUXTIOCGPGRP _IOR('T', 30, int) 58 #define HPUXTIOCCONS _IO('t', 104) 59 60 /* HP-UX stat structure */ 61 62 #define bsdtohpuxdev(d) ((major(d) << 24) | minor(d)) 63 64 struct hpuxstat { 65 long hst_dev; 66 u_long hst_ino; 67 u_short hst_mode; 68 short hst_nlink; 69 u_short hst_uid; 70 u_short hst_gid; 71 long hst_rdev; 72 off_t hst_size; 73 time_t hst_atime; 74 int hst_spare1; 75 time_t hst_mtime; 76 int hst_spare2; 77 time_t hst_ctime; 78 int hst_spare3; 79 long hst_blksize; 80 long hst_blocks; 81 u_int hst_remote; 82 long hst_netdev; 83 u_long hst_netino; 84 long hst_spare4[9]; 85 }; 86 87 /* 88 * Skeletal 6.X HP-UX user structure info for ptrace() mapping. 89 * Yes, this is as bogus as it gets... 90 */ 91 92 /* 6.0/6.2 offsets */ 93 #define ooHU_AROFF 0x004 94 #define ooHU_TSOFF 0x092 95 #define ooHU_EDOFF 0x91E 96 #define ooHU_FPOFF 0xA66 97 98 /* 6.5 offsets */ 99 #define oHU_AROFF 0x004 100 #define oHU_TSOFF 0x0B2 101 #define oHU_EDOFF 0x93A 102 #define oHU_FPOFF 0xA86 103 104 /* 7.X offsets */ 105 #define HU_AROFF 0x004 106 #define HU_TSOFF 0x0B4 107 #define HU_EDOFF 0x8C8 108 #define HU_FPOFF 0xA28 109 110 #define HU_PAD1 (HU_AROFF) 111 #define HU_PAD2 (HU_TSOFF-HU_AROFF-4) 112 #define HU_PAD3 (HU_EDOFF-HU_TSOFF-12) 113 #define HU_PAD4 (HU_FPOFF-HU_EDOFF-sizeof(struct hpux_exec)) 114 115 struct hpuxuser { 116 u_char whocares1[HU_PAD1]; /* +0x000 */ 117 int *hpuxu_ar0; /* +0x004 */ 118 u_char whocares2[HU_PAD2]; /* +0x008 */ 119 int hpuxu_tsize; /* +0x0B2 */ 120 int hpuxu_dsize; /* +0x0B6 */ 121 int hpuxu_ssize; /* +0x0BA */ 122 u_char whocares3[HU_PAD3]; /* +0x0BE */ 123 struct hpux_exec hpuxu_exdata; /* +0x93A */ 124 u_char whocares4[HU_PAD4]; /* +0x95E */ 125 struct hpuxfp { /* +0xA66 */ 126 int hpfp_save[54]; 127 int hpfp_ctrl[3]; 128 int hpfp_reg[24]; 129 } hpuxu_fp; 130 short hpuxu_dragon; /* +0xBCA */ 131 }; 132 133 /* HP-UX compat file flags */ 134 #define HPUXFCREAT 00000400 135 #define HPUXFTRUNC 00001000 136 #define HPUXFEXCL 00002000 137 #define HPUXFSYNCIO 00100000 138 #define HPUXFREMOTE 01000000 139 #define FUSECACHE 04000000 140 141 /* HP-UX only sysV shmctl() commands */ 142 #define SHM_LOCK 3 /* Lock segment in core */ 143 #define SHM_UNLOCK 4 /* Unlock segment */ 144 145 /* HP-UX rtprio values */ 146 #define RTPRIO_MIN 0 147 #define RTPRIO_MAX 127 148 #define RTPRIO_NOCHG 1000 149 #define RTPRIO_RTOFF 1001 150 151 /* HP-UX only sigvec sv_flags values */ 152 #define HPUXSV_RESET 000000004 153 154 /* 155 * HP-UX returns SIGILL instead of SIGFPE for the CHK and TRAPV exceptions. 156 * It also returns different u_code values for certain illegal instruction 157 * and floating point exceptions. Here are the proper HP-UX u_code values 158 * (numbers from hpux 6.2 manual pages). 159 */ 160 161 /* SIGILL codes */ 162 #define HPUX_ILL_ILLINST_TRAP 0 /* T_ILLINST+USER */ 163 #define HPUX_ILL_CHK_TRAP 6 /* T_CHKINST+USER */ 164 #define HPUX_ILL_TRAPV_TRAP 7 /* T_TRAPVINST+USER */ 165 #define HPUX_ILL_PRIV_TRAP 8 /* T_PRIVINST+USER */ 166 167 /* SIGFPE codes */ 168 #define HPUX_FPE_INTDIV_TRAP 5 /* T_ZERODIV+USER */ 169 170 /* HP-UX POSIX signal stuff implementation */ 171 typedef struct __hpuxsigset_t { long sigset[8]; } hpuxsigset_t; 172 struct hpuxsigaction { 173 void (*sa_handler)(); 174 hpuxsigset_t sa_mask; 175 int sa_flags; 176 }; 177 #define HPUXSA_ONSTACK 1 178 #define HPUXSA_RESETHAND 4 179 #define HPUXSA_NOCLDSTOP 8 180 181 #define HPUXSIG_BLOCK 0 /* block specified signal set */ 182 #define HPUXSIG_UNBLOCK 1 /* unblock specified signal set */ 183 #define HPUXSIG_SETMASK 2 /* set specified signal set */ 184