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.19 92/01/20$ 13 * 14 * @(#)hpux.h 7.6 (Berkeley) 06/05/92 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 /* non-blocking IO--doesn't interfere with O_NDELAY */ 61 #define HPUXFIOSNBIO _IOW('f', 126, int) 62 63 /* HP-UX stat structure */ 64 65 #define bsdtohpuxdev(d) ((major(d) << 24) | minor(d)) 66 67 struct hpuxstat { 68 long hst_dev; 69 u_long hst_ino; 70 u_short hst_mode; 71 short hst_nlink; 72 u_short hst_uid; 73 u_short hst_gid; 74 long hst_rdev; 75 long hst_size; 76 time_t hst_atime; 77 int hst_spare1; 78 time_t hst_mtime; 79 int hst_spare2; 80 time_t hst_ctime; 81 int hst_spare3; 82 long hst_blksize; 83 long hst_blocks; 84 u_int hst_remote; 85 long hst_netdev; 86 u_long hst_netino; 87 long hst_spare4[9]; 88 }; 89 90 /* 91 * Skeletal 6.X HP-UX user structure info for ptrace() mapping. 92 * Yes, this is as bogus as it gets... 93 */ 94 95 /* 6.0/6.2 offsets */ 96 #define ooHU_AROFF 0x004 97 #define ooHU_TSOFF 0x092 98 #define ooHU_EDOFF 0x91E 99 #define ooHU_FPOFF 0xA66 100 101 /* 6.5 offsets */ 102 #define oHU_AROFF 0x004 103 #define oHU_TSOFF 0x0B2 104 #define oHU_EDOFF 0x93A 105 #define oHU_FPOFF 0xA86 106 107 /* 7.X offsets */ 108 #define HU_AROFF 0x004 109 #define HU_TSOFF 0x0B4 110 #define HU_EDOFF 0x8C8 111 #define HU_FPOFF 0xA28 112 113 #define HU_PAD1 (HU_AROFF) 114 #define HU_PAD2 (HU_TSOFF-HU_AROFF-4) 115 #define HU_PAD3 (HU_EDOFF-HU_TSOFF-12) 116 #define HU_PAD4 (HU_FPOFF-HU_EDOFF-sizeof(struct hpux_exec)) 117 118 struct hpuxuser { 119 u_char whocares1[HU_PAD1]; /* +0x000 */ 120 int *hpuxu_ar0; /* +0x004 */ 121 u_char whocares2[HU_PAD2]; /* +0x008 */ 122 int hpuxu_tsize; /* +0x0B2 */ 123 int hpuxu_dsize; /* +0x0B6 */ 124 int hpuxu_ssize; /* +0x0BA */ 125 u_char whocares3[HU_PAD3]; /* +0x0BE */ 126 struct hpux_exec hpuxu_exdata; /* +0x93A */ 127 u_char whocares4[HU_PAD4]; /* +0x95E */ 128 struct hpuxfp { /* +0xA66 */ 129 int hpfp_save[54]; 130 int hpfp_ctrl[3]; 131 int hpfp_reg[24]; 132 } hpuxu_fp; 133 short hpuxu_dragon; /* +0xBCA */ 134 }; 135 136 /* HP-UX compat file flags */ 137 #define HPUXFCREAT 00000400 138 #define HPUXFTRUNC 00001000 139 #define HPUXFEXCL 00002000 140 #define HPUXFSYNCIO 00100000 141 #define HPUXFREMOTE 01000000 142 #define FUSECACHE 04000000 143 144 /* HP-UX only sysV shmctl() commands */ 145 #define SHM_LOCK 3 /* Lock segment in core */ 146 #define SHM_UNLOCK 4 /* Unlock segment */ 147 148 /* HP-UX rtprio values */ 149 #define RTPRIO_MIN 0 150 #define RTPRIO_MAX 127 151 #define RTPRIO_NOCHG 1000 152 #define RTPRIO_RTOFF 1001 153 154 /* HP-UX only sigvec sv_flags values */ 155 #define HPUXSV_RESET 000000004 156 157 /* 158 * HP-UX returns SIGILL instead of SIGFPE for the CHK and TRAPV exceptions. 159 * It also returns different u_code values for certain illegal instruction 160 * and floating point exceptions. Here are the proper HP-UX u_code values 161 * (numbers from hpux 6.2 manual pages). 162 */ 163 164 /* SIGILL codes */ 165 #define HPUX_ILL_ILLINST_TRAP 0 /* T_ILLINST+USER */ 166 #define HPUX_ILL_CHK_TRAP 6 /* T_CHKINST+USER */ 167 #define HPUX_ILL_TRAPV_TRAP 7 /* T_TRAPVINST+USER */ 168 #define HPUX_ILL_PRIV_TRAP 8 /* T_PRIVINST+USER */ 169 170 /* SIGFPE codes */ 171 #define HPUX_FPE_INTDIV_TRAP 5 /* T_ZERODIV+USER */ 172 173 /* HP-UX POSIX signal stuff implementation */ 174 typedef struct __hpuxsigset_t { long sigset[8]; } hpuxsigset_t; 175 struct hpuxsigaction { 176 void (*sa_handler)(); 177 hpuxsigset_t sa_mask; 178 int sa_flags; 179 }; 180 #define HPUXSA_ONSTACK 1 181 #define HPUXSA_RESETHAND 4 182 #define HPUXSA_NOCLDSTOP 8 183 184 #define HPUXSIG_BLOCK 0 /* block specified signal set */ 185 #define HPUXSIG_UNBLOCK 1 /* unblock specified signal set */ 186 #define HPUXSIG_SETMASK 2 /* set specified signal set */ 187 188 /* sysconf stuff */ 189 #define HPUX_SYSCONF_OPENMAX 4 190 #define HPUX_SYSCONF_CPUTYPE 10001 191 #define HPUX_SYSCONF_CPUM020 0x20C 192 #define HPUX_SYSCONF_CPUM030 0x20D 193 #define HPUX_SYSCONF_CPUM040 0x20E 194 #define HPUX_SYSCONF_CPUPA10 0x20B 195 #define HPUX_SYSCONF_CPUPA11 0x210 196