xref: /netbsd-src/sys/compat/sunos/sunos.h (revision 1fbab01a9353563bcc435f692ca5268e5626005a)
1*1fbab01aSdholland /*	$NetBSD: sunos.h,v 1.24 2015/09/06 06:00:59 dholland Exp $	*/
2157a31d7Smrg 
3157a31d7Smrg #ifndef _COMPAT_SUNOS_SUNOS_H_
4157a31d7Smrg #define _COMPAT_SUNOS_SUNOS_H_
5157a31d7Smrg 
6*1fbab01aSdholland #include <sys/ioccom.h>
7*1fbab01aSdholland 
8157a31d7Smrg /* used to ensure `struct sunos' types rename constantly sized. */
9157a31d7Smrg #ifdef __arch64__
10157a31d7Smrg typedef u_int32_t	sunos_charp;
11157a31d7Smrg #else
12157a31d7Smrg typedef char *		sunos_charp;
13157a31d7Smrg #endif
1409748596Scgd 
15461a86f9Schristos typedef long	sunos_time_t;
16461a86f9Schristos 
171784f275Sderaadt #define	SUNM_RDONLY	0x01	/* mount fs read-only */
181784f275Sderaadt #define	SUNM_NOSUID	0x02	/* mount fs with setuid disallowed */
191784f275Sderaadt #define	SUNM_NEWTYPE	0x04	/* type is string (char *), not int */
201784f275Sderaadt #define	SUNM_GRPID	0x08	/* (bsd semantics; ignored) */
211784f275Sderaadt #define	SUNM_REMOUNT	0x10	/* update existing mount */
221784f275Sderaadt #define	SUNM_NOSUB	0x20	/* prevent submounts (rejected) */
231784f275Sderaadt #define	SUNM_MULTI	0x40	/* (ignored) */
241784f275Sderaadt #define	SUNM_SYS5	0x80	/* Sys 5-specific semantics (rejected) */
251784f275Sderaadt 
261784f275Sderaadt struct sunos_nfs_args {
271784f275Sderaadt 	struct	sockaddr_in *addr;	/* file server address */
2853524e44Schristos 	void *	fh;			/* file handle to be mounted */
291784f275Sderaadt 	int	flags;			/* flags */
301784f275Sderaadt 	int	wsize;			/* write size in bytes */
311784f275Sderaadt 	int	rsize;			/* read size in bytes */
321784f275Sderaadt 	int	timeo;			/* initial timeout in .1 secs */
331784f275Sderaadt 	int	retrans;		/* times to retry send */
34157a31d7Smrg 	sunos_charp hostname;		/* server's hostname */
351784f275Sderaadt 	int	acregmin;		/* attr cache file min secs */
361784f275Sderaadt 	int	acregmax;		/* attr cache file max secs */
371784f275Sderaadt 	int	acdirmin;		/* attr cache dir min secs */
381784f275Sderaadt 	int	acdirmax;		/* attr cache dir max secs */
39157a31d7Smrg 	sunos_charp netname;		/* server's netname */
401784f275Sderaadt 	struct	pathcnf *pathconf;	/* static pathconf kludge */
411784f275Sderaadt };
429e2cbae0Spk /* SunOS nfs flag values: */
439e2cbae0Spk #define SUNNFS_SOFT	0x1
449e2cbae0Spk #define SUNNFS_WSIZE	0x2
459e2cbae0Spk #define SUNNFS_RSIZE	0x4
469e2cbae0Spk #define SUNNFS_TIMEO	0x8
479e2cbae0Spk #define SUNNFS_RETRANS	0x10
489e2cbae0Spk #define SUNNFS_HOSTNAME	0x20
499e2cbae0Spk #define SUNNFS_INT	0x40
509e2cbae0Spk #define SUNNFS_NOAC	0x80
519e2cbae0Spk #define SUNNFS_ACREGMIN	0x100
529e2cbae0Spk #define SUNNFS_ACREGMAX	0x200
539e2cbae0Spk #define SUNNFS_ACDIRMIN	0x400
549e2cbae0Spk #define SUNNFS_ACDIRMAX	0x800
559e2cbae0Spk #define SUNNFS_SECURE	0x1000
569e2cbae0Spk #define SUNNFS_NOCTO	0x2000
579e2cbae0Spk #define SUNNFS_POSIX	0x4000
581784f275Sderaadt 
591784f275Sderaadt 
601784f275Sderaadt struct sunos_ustat {
61a3ff3a30Sfvdl 	int32_t	f_tfree;	/* total free */
62758a209dSchristos 	uint32_t f_tinode;	/* total inodes free */
631784f275Sderaadt 	char	f_path[6];	/* filsys name */
641784f275Sderaadt 	char	f_fpack[6];	/* filsys pack name */
651784f275Sderaadt };
661784f275Sderaadt 
671784f275Sderaadt struct sunos_statfs {
680d673649Smrg 	int	f_type;		/* type of info, zero for now */
690d673649Smrg 	int	f_bsize;	/* fundamental file system block size */
700d673649Smrg 	int	f_blocks;	/* total blocks in file system */
710d673649Smrg 	int	f_bfree;	/* free blocks */
720d673649Smrg 	int	f_bavail;	/* free blocks available to non-super-user */
730d673649Smrg 	int	f_files;	/* total file nodes in file system */
740d673649Smrg 	int	f_ffree;	/* free file nodes in fs */
751784f275Sderaadt 	fsid_t	f_fsid;		/* file system id */
760d673649Smrg 	int	f_spare[7];	/* spare for later */
771784f275Sderaadt };
781784f275Sderaadt 
791784f275Sderaadt 
801784f275Sderaadt struct sunos_utsname {
811784f275Sderaadt 	char    sysname[9];
821784f275Sderaadt 	char    nodename[9];
831784f275Sderaadt 	char    nodeext[65-9];
841784f275Sderaadt 	char    release[9];
851784f275Sderaadt 	char    version[9];
861784f275Sderaadt 	char    machine[9];
871784f275Sderaadt };
881784f275Sderaadt 
891784f275Sderaadt 
901784f275Sderaadt struct sunos_ttysize {
911784f275Sderaadt 	int	ts_row;
921784f275Sderaadt 	int	ts_col;
931784f275Sderaadt };
941784f275Sderaadt 
951784f275Sderaadt struct sunos_termio {
961784f275Sderaadt 	u_short	c_iflag;
971784f275Sderaadt 	u_short	c_oflag;
981784f275Sderaadt 	u_short	c_cflag;
991784f275Sderaadt 	u_short	c_lflag;
1001784f275Sderaadt 	char	c_line;
1011784f275Sderaadt 	unsigned char c_cc[8];
1021784f275Sderaadt };
1031784f275Sderaadt #define SUNOS_TCGETA	_IOR('T', 1, struct sunos_termio)
1041784f275Sderaadt #define SUNOS_TCSETA	_IOW('T', 2, struct sunos_termio)
1051784f275Sderaadt #define SUNOS_TCSETAW	_IOW('T', 3, struct sunos_termio)
1061784f275Sderaadt #define SUNOS_TCSETAF	_IOW('T', 4, struct sunos_termio)
1071784f275Sderaadt #define SUNOS_TCSBRK	_IO('T', 5)
1081784f275Sderaadt 
1091784f275Sderaadt struct sunos_termios {
1100d673649Smrg 	u_int	c_iflag;
1110d673649Smrg 	u_int	c_oflag;
1120d673649Smrg 	u_int	c_cflag;
1130d673649Smrg 	u_int	c_lflag;
1141784f275Sderaadt 	char	c_line;
1151784f275Sderaadt 	u_char	c_cc[17];
1161784f275Sderaadt };
1171784f275Sderaadt #define SUNOS_TCXONC	_IO('T', 6)
1181784f275Sderaadt #define SUNOS_TCFLSH	_IO('T', 7)
1191784f275Sderaadt #define SUNOS_TCGETS	_IOR('T', 8, struct sunos_termios)
1201784f275Sderaadt #define SUNOS_TCSETS	_IOW('T', 9, struct sunos_termios)
1211784f275Sderaadt #define SUNOS_TCSETSW	_IOW('T', 10, struct sunos_termios)
1221784f275Sderaadt #define SUNOS_TCSETSF	_IOW('T', 11, struct sunos_termios)
1231784f275Sderaadt #define SUNOS_TCSNDBRK	_IO('T', 12)
1241784f275Sderaadt #define SUNOS_TCDRAIN	_IO('T', 13)
1251784f275Sderaadt 
126a1cfb5b3Spk /* Sun audio compatibility */
127a1cfb5b3Spk struct sunos_audio_prinfo {
128a1cfb5b3Spk 	u_int	sample_rate;
129a1cfb5b3Spk 	u_int	channels;
130a1cfb5b3Spk 	u_int	precision;
131a1cfb5b3Spk 	u_int	encoding;
132a1cfb5b3Spk 	u_int	gain;
133a1cfb5b3Spk 	u_int	port;
134a1cfb5b3Spk 	u_int	avail_ports;
135a1cfb5b3Spk 	u_int	reserved0[3];
136a1cfb5b3Spk 	u_int	samples;
137a1cfb5b3Spk 	u_int	eof;
138a1cfb5b3Spk 	u_char	pause;
139a1cfb5b3Spk 	u_char	error;
140a1cfb5b3Spk 	u_char	waiting;
141a1cfb5b3Spk 	u_char	balance;
142a1cfb5b3Spk 	u_short	minordev;
143a1cfb5b3Spk 	u_char	open;
144a1cfb5b3Spk 	u_char	active;
145a1cfb5b3Spk };
146a1cfb5b3Spk struct sunos_audio_info {
147a1cfb5b3Spk 	struct sunos_audio_prinfo play;
148a1cfb5b3Spk 	struct sunos_audio_prinfo record;
149a1cfb5b3Spk 	u_int monitor_gain;
150a1cfb5b3Spk 	u_int reserved[4];
151a1cfb5b3Spk };
152a1cfb5b3Spk 
153a1cfb5b3Spk /* Values for AUDIO_GETDEV ioctl: */
154a1cfb5b3Spk #define SUNOS_AUDIO_DEV_UNKNOWN			0
155a1cfb5b3Spk #define SUNOS_AUDIO_DEV_AMD			1
156a1cfb5b3Spk #define SUNOS_AUDIO_DEV_SPEAKERBOX		2
157a1cfb5b3Spk #define SUNOS_AUDIO_DEV_CODEC			3
158a1cfb5b3Spk 
1598b8a6fcfSbriggs __BEGIN_DECLS
16006612cb9Spk /* Defined in arch/<arch>/sunos_machdep.c */
161f2af9174Sdsl void	sunos_sendsig(const ksiginfo_t *, const sigset_t *);
1628b8a6fcfSbriggs __END_DECLS
163157a31d7Smrg 
164157a31d7Smrg #endif /* _COMPAT_SUNOS_SUNOS_H_ */
165