xref: /csrg-svn/sys/hp/hpux/hpux.h (revision 45753)
141486Smckusick /*
241486Smckusick  * Copyright (c) 1988 University of Utah.
341486Smckusick  * Copyright (c) 1990 The Regents of the University of California.
441486Smckusick  * All rights reserved.
541486Smckusick  *
641486Smckusick  * This code is derived from software contributed to Berkeley by
741486Smckusick  * the Systems Programming Group of the University of Utah Computer
841486Smckusick  * Science Department.
941486Smckusick  *
1041486Smckusick  * %sccs.include.redist.c%
1141486Smckusick  *
12*45753Smckusick  * from: Utah $Hdr: hpux.h 1.1 90/07/09$
1341486Smckusick  *
14*45753Smckusick  *	@(#)hpux.h	7.2 (Berkeley) 12/05/90
1541486Smckusick  */
1641486Smckusick 
1741486Smckusick #include "hpux_exec.h"
1841486Smckusick 
1941486Smckusick /* HP-UX style UTSNAME struct used by uname syscall */
2041486Smckusick 
2141486Smckusick struct hpuxutsname {
2241486Smckusick 	char	sysname[9];
2341486Smckusick 	char	nodename[9];
2441486Smckusick 	char	release[9];
2541486Smckusick 	char	version[9];
2641486Smckusick 	char	machine[9];
2741486Smckusick 	char	idnumber[15];
2841486Smckusick };
2941486Smckusick 
3041486Smckusick /* HP-UX style "old" IOCTLs */
3141486Smckusick 
3241486Smckusick struct hpuxsgttyb {
3341486Smckusick 	char	sg_ispeed;
3441486Smckusick 	char	sg_ospeed;
3541486Smckusick 	char	sg_erase;
3641486Smckusick 	char	sg_kill;
3741486Smckusick 	int	sg_flags;	/* only a short in BSD */
3841486Smckusick };
3941486Smckusick 
4041486Smckusick #define V7_HUPCL	00001
4141486Smckusick #define V7_XTABS	00002
4241486Smckusick #define V7_NOAL		04000
4341486Smckusick 
4441486Smckusick #define	HPUXTIOCGETP	_IOR('t', 8, struct hpuxsgttyb)
4541486Smckusick #define	HPUXTIOCSETP	_IOW('t', 9, struct hpuxsgttyb)
4641486Smckusick 
4741486Smckusick /* 6.5 job control related ioctls which need to be mapped */
4841486Smckusick 
4941486Smckusick #define	HPUXTIOCSLTC	_IOW('T', 23, struct ltchars)
5041486Smckusick #define	HPUXTIOCGLTC	_IOR('T', 24, struct ltchars)
5141486Smckusick #define	HPUXTIOCLBIS	_IOW('T', 25, int)
5241486Smckusick #define	HPUXTIOCLBIC	_IOW('T', 26, int)
5341486Smckusick #define	HPUXTIOCLSET	_IOW('T', 27, int)
5441486Smckusick #define	HPUXTIOCLGET	_IOR('T', 28, int)
5541486Smckusick #	define HPUXLTOSTOP	0000001
5641486Smckusick #define	HPUXTIOCSPGRP	_IOW('T', 29, int)
5741486Smckusick #define	HPUXTIOCGPGRP	_IOR('T', 30, int)
5841486Smckusick #define HPUXTIOCCONS	_IO('t', 104)
5941486Smckusick 
6041486Smckusick /* HP-UX stat structure */
6141486Smckusick 
6241486Smckusick #define bsdtohpuxdev(d)	((major(d) << 24) | minor(d))
6341486Smckusick 
6441486Smckusick struct	hpuxstat {
6541486Smckusick 	long	hst_dev;
6641486Smckusick 	u_long	hst_ino;
6741486Smckusick 	u_short	hst_mode;
6841486Smckusick 	short	hst_nlink;
6941486Smckusick 	u_short	hst_uid;
7041486Smckusick 	u_short	hst_gid;
7141486Smckusick 	long	hst_rdev;
7241486Smckusick 	off_t	hst_size;
7341486Smckusick 	time_t	hst_atime;
7441486Smckusick 	int	hst_spare1;
7541486Smckusick 	time_t	hst_mtime;
7641486Smckusick 	int	hst_spare2;
7741486Smckusick 	time_t	hst_ctime;
7841486Smckusick 	int	hst_spare3;
7941486Smckusick 	long	hst_blksize;
8041486Smckusick 	long	hst_blocks;
8141486Smckusick 	u_int	hst_remote;
8241486Smckusick 	long	hst_netdev;
8341486Smckusick 	u_long	hst_netino;
8441486Smckusick 	long	hst_spare4[9];
8541486Smckusick };
8641486Smckusick 
8741486Smckusick /*
8841486Smckusick  * Skeletal 6.X HP-UX user structure info for ptrace() mapping.
8941486Smckusick  * Yes, this is as bogus as it gets...
9041486Smckusick  */
9141486Smckusick 
9241486Smckusick /* 6.0/6.2 offsets */
93*45753Smckusick #define ooHU_AROFF	0x004
94*45753Smckusick #define ooHU_TSOFF	0x092
95*45753Smckusick #define ooHU_EDOFF	0x91E
96*45753Smckusick #define ooHU_FPOFF	0xA66
97*45753Smckusick 
98*45753Smckusick /* 6.5 offsets */
9941486Smckusick #define oHU_AROFF	0x004
100*45753Smckusick #define oHU_TSOFF	0x0B2
101*45753Smckusick #define oHU_EDOFF	0x93A
102*45753Smckusick #define oHU_FPOFF	0xA86
10341486Smckusick 
104*45753Smckusick /* 7.X offsets */
10541486Smckusick #define HU_AROFF	0x004
106*45753Smckusick #define HU_TSOFF	0x0B4
107*45753Smckusick #define HU_EDOFF	0x8C8
108*45753Smckusick #define HU_FPOFF	0xA28
10941486Smckusick 
11041486Smckusick #define HU_PAD1	(HU_AROFF)
11141486Smckusick #define HU_PAD2	(HU_TSOFF-HU_AROFF-4)
11241486Smckusick #define HU_PAD3	(HU_EDOFF-HU_TSOFF-12)
11341486Smckusick #define HU_PAD4	(HU_FPOFF-HU_EDOFF-sizeof(struct hpux_exec))
11441486Smckusick 
11541486Smckusick struct hpuxuser {
11641486Smckusick 	u_char	whocares1[HU_PAD1];	/* +0x000 */
11741486Smckusick 	int	*hpuxu_ar0;		/* +0x004 */
11841486Smckusick 	u_char	whocares2[HU_PAD2];	/* +0x008 */
11941486Smckusick 	int	hpuxu_tsize;		/* +0x0B2 */
12041486Smckusick 	int	hpuxu_dsize;		/* +0x0B6 */
12141486Smckusick 	int	hpuxu_ssize;		/* +0x0BA */
12241486Smckusick 	u_char	whocares3[HU_PAD3];	/* +0x0BE */
12341486Smckusick 	struct	hpux_exec hpuxu_exdata;	/* +0x93A */
12441486Smckusick 	u_char	whocares4[HU_PAD4];	/* +0x95E */
12541486Smckusick 	struct	hpuxfp {		/* +0xA66 */
12641486Smckusick 		int hpfp_save[54];
12741486Smckusick 		int hpfp_ctrl[3];
12841486Smckusick 		int hpfp_reg[24];
12941486Smckusick 	} hpuxu_fp;
13041486Smckusick 	short	hpuxu_dragon;		/* +0xBCA */
13141486Smckusick };
13241486Smckusick 
13341486Smckusick /* HP-UX compat file flags */
13441486Smckusick #define HPUXFCREAT	00000400
13541486Smckusick #define	HPUXFTRUNC	00001000
13641486Smckusick #define	HPUXFEXCL	00002000
13741486Smckusick #define HPUXFSYNCIO	00100000
13841486Smckusick #define HPUXFREMOTE	01000000
13941486Smckusick #define FUSECACHE	04000000
14041486Smckusick 
14141486Smckusick /* HP-UX only sysV shmctl() commands */
14241486Smckusick #define SHM_LOCK	3	/* Lock segment in core */
14341486Smckusick #define SHM_UNLOCK	4	/* Unlock segment */
14441486Smckusick 
14541486Smckusick /* HP-UX rtprio values */
14641486Smckusick #define RTPRIO_MIN	0
14741486Smckusick #define RTPRIO_MAX	127
14841486Smckusick #define RTPRIO_NOCHG	1000
14941486Smckusick #define RTPRIO_RTOFF	1001
15041486Smckusick 
15141486Smckusick /* HP-UX only sigvec sv_flags values */
15241486Smckusick #define HPUXSV_RESET	000000004
15341486Smckusick 
15441486Smckusick /*
15541486Smckusick  * HP-UX returns SIGILL instead of SIGFPE for the CHK and TRAPV exceptions.
15641486Smckusick  * It also returns different u_code values for certain illegal instruction
15741486Smckusick  * and floating point exceptions.  Here are the proper HP-UX u_code values
15841486Smckusick  * (numbers from hpux 6.2 manual pages).
15941486Smckusick  */
16041486Smckusick 
16141486Smckusick /* SIGILL codes */
16241486Smckusick #define	HPUX_ILL_ILLINST_TRAP	0	/* T_ILLINST+USER */
16341486Smckusick #define	HPUX_ILL_CHK_TRAP	6	/* T_CHKINST+USER */
16441486Smckusick #define	HPUX_ILL_TRAPV_TRAP	7	/* T_TRAPVINST+USER */
16541486Smckusick #define	HPUX_ILL_PRIV_TRAP	8	/* T_PRIVINST+USER */
16641486Smckusick 
16741486Smckusick /* SIGFPE codes */
16841486Smckusick #define	HPUX_FPE_INTDIV_TRAP	5	/* T_ZERODIV+USER */
169*45753Smckusick 
170*45753Smckusick /* HP-UX POSIX signal stuff implementation */
171*45753Smckusick typedef struct __hpuxsigset_t { long sigset[8]; } hpuxsigset_t;
172*45753Smckusick struct hpuxsigaction {
173*45753Smckusick 	void		(*sa_handler)();
174*45753Smckusick 	hpuxsigset_t	sa_mask;
175*45753Smckusick 	int		sa_flags;
176*45753Smckusick };
177*45753Smckusick #define HPUXSA_ONSTACK		1
178*45753Smckusick #define HPUXSA_RESETHAND	4
179*45753Smckusick #define HPUXSA_NOCLDSTOP	8
180*45753Smckusick 
181*45753Smckusick #define	HPUXSIG_BLOCK	0	/* block specified signal set */
182*45753Smckusick #define	HPUXSIG_UNBLOCK	1	/* unblock specified signal set */
183*45753Smckusick #define	HPUXSIG_SETMASK	2	/* set specified signal set */
184