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