	 kêÊ  B±‰*B±‰* Ð by name         by name         root            d   
#       define FCIR_01 0x01                   /* RDAT doesn't need to be is*/

#       define ERFR_00 0x00                   /* CUAT  Invalid/Unsupported */
#       define ERFR_01 0x01                   /* CUFRV Invalid/Unsupported */
#       define ERFR_04 0x04                   /* CUSYN  Sync Error         */
#       define ERFR_07 0x07                   /* CULTAD invalid/unsupported*/

#       define FCDEF_00       0x00            /* Start print bit not set   */
#       define FCDEF_01       0x01            /* Start print bit set       */
#       define START_PRT_MASK 0X08            /* Start print data mask     */

/******************************************************************/
/****                                                          ****/
/****  Asynchronous Status Values - LITERALS                   ****/
/****                                                          ****/
/******************************************************************/

#       define AEEP 0x22                 /* Inbound Event Pending          */
#       define AEDV 0x28                 /* Device-CU Local Status         */
#       define AESTAT 0x34               /* Async Response to Start Op     */


#       define AEDV_01 0x01                   /* Put Device LT Online      */
#       define AEDV_02 0x02                   /* Take Device LT(s) Offline */
#       define AEDV_AD 0xff                   /* LT ON/OFF Line Address    */

#       define AESTAT_00 0x00                 /* Good Completion           */
#       define AESTAT_03 0x03                 /* Command Reject            */
#       define AESTAT_04 0x04                 /* Intervention Required     */
#       define AESTAT_06 0x06                 /* Op Check                  */

#       define ASC_Q TRUE                     /* Move parameters to Queue */
#       define ASC_T TRUE                     /* Move parmaeters to TCA */
#       define ASC_L TRUE                     /* Update logical term. addr. */
***kêV Ô  $        ã  [‰*#—ˆ*[‰*     Ëµã  	                  ./usr/include/sys/c3270/dftnsSubr.h h   #ifdef i386
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)dftnsSubr.h	16.4    AIX)    /* Modified 3/20/90 18:12:55 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
#endif /* i386 */
/*****************************************************************************/
/* Declarations of public functions in dftnsSubr.c                           */
/* This file should be included in dftnsCmd.c and dftnsOffl.c                */
/*****************************************************************************/

extern COMMON_AREA dftnsCommon;

extern void LockCommon ();

extern void UnlockCommon ();

extern void UnprotectedSetTimer ();

extern void SetTimer ();

extern void BuildAsyncReq ();

extern void InterruptDH ();

extern void BroadcastUnSol ();

extern void AckCmd ();

extern SEND_REQ_RESULT SendAS ();

extern void SendSS ();

extern void XmitData ();

extern void InitCard ();

extern void ShutDown ();
x22  kêTI Ó  $        #  [‰*$—ˆ*[‰*     I¹#  	              z·  ./usr/include/sys/c3270/io3270.h .h h   #ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)io3270.h	1.2	AIX)	/* Modified 10/28/88 11:51:41 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/*    static char sccsid [] = "@(#)io3270.h	16.3 ";*/

			/* definitions for ioctl */
#define WDC		('w' << 8)
#define WDC_INQ		(WDC | 1)	/* inquire io status */
#define WDC_SSTAT	(WDC | 2)	/* send status */
#define WDC_POR		(WDC | 3)	/* power on reset */
#define WDC_AUTO	(WDC | 4)	/* enable/disable auto ack for API */
#define WDC_WAITCLEAR	(WDC | 5)	/* wait for broadcast clear */

/*
** link address information structure
*/
struct nsddinfo {
	int	dev_addr;		/* link_address */
	int	length;			/* length of buffer for DDS */
	char	*ddsptr;		/* pointer to DDS buffer */
	char	type;			/* device type */
};

typedef struct nsddinfo	tcadinfo;

typedef struct iocinfo {
	int	chan;			/* logical terminal number */
	int	controller;		/* ebcdic rep. of controller type */
	int	attach_protocol;	/* controller attachment protocol */
} iocinfo;

/*
** io3270/iotca status
*/
struct io3270 {
	unsigned int 	io_flags;	/* information flags */
	unsigned int	io_status;	/* 5xx, 6xx, 7xx msg codes */
};

typedef struct io3270	iotca;

/*
** defines for use with io_flags
*/
#define WDI_DAVAIL	0x02  		/* data available */
#define WDI_CCHAIN	0x04		/* data chaining */
#define WDI_LOCKED	0x08		/* device locked */
#define WDI_FATAL	0x10		/* fatal err. on card */
#define WDI_COMM    	0x20		/* communication check */
#define WDI_PROG    	0x40 		/* program check */
#define WDI_MACH    	0x80 		/* machine check */
#define WDI_ALL_CHECK	(WDI_FATAL | WDI_COMM | WDI_PROG | WDI_MACH)
#define WDI_TRANSP_MODE	0x01		/* transparency write option 
					   (BSC mode) 11-10-88 LJM */
/*
** Communication Check Status Codes
*/
#define WEC_501		501	/* 5088 is operating but is set to offline */
#define WEC_503		503	/* selective reset seq. on chan. detected */
#define WEC_505		505	/* sys. reset seq. on chan. detected by 5088 */
#define WEC_513		513	/* link address is busy */
#define	WEC_551		551	/* bus out check detected by 5088 */
#define WEC_583		583	/* halt I/O sequence detected by 5088 */
#define WEC_584		584	/* streaming overrun detected by 5088 */
#define WEC_585		585	/* process has data to be read. */
				/* driver cannot issue current command */
				/* until data is read */

/*
** Machine Check Status Codes
*/
#define	WEM_TIMEOUT	670	/* hardware timed out		*/
#define WEM_BAD_INIT	671	/* device initialization error	*/
#define WEM_HARDWARE	674	/* hardware error		*/

/*
** Program Check Status Codes
*/
#define	WEP_DUP_NET	770	/* duplicate netID in table	*/
#define	WEP_INV_PARMS	771	/* invalid parameters		*/
#define	WEP_BAD_NET	772	/* netID not in table		*/
#define	WEP_CMD_OUT	773	/* command already outstanding	*/
#define	WEP_FULL_NET	774	/* netID table full		*/
#define	WEP_INV_Q	775	/* invalid queue element type	*/
#define	WEP_INV_CMD	776	/* invalid command		*/
#define	WEP_LA_ENB	777	/* link address already enabled	*/
#define	WEP_LA_AENB	778	/* link address not enabled	*/
#define	WEP_UNDER_SLIH	779	/* SLIH ring que underflow	*/
#define	WEP_BUFF_DEPL	780	/* buffer pool depleted		*/
#define	WEP_OVER_DEV	781	/* device ring que overflow	*/
#define	WEP_SSLA_BAD	782	/* SSLA rejected commands	*/
#define	WEP_SEL_RESET	783	/* selective reset issued	*/
#define	WEP_POWER_ON_RST  784   /* power on reset in progress 	*/
#define	WEP_5088_CMD_REJECT 785 /* command reject generated by 5088 for  */
				/* data recieved on channel */
#define	WEP_5088_OP_CHK	786	/* 5088 detected op check */
#define	WEP_HIA_DOWN	787	/* link is down */
#define WEP_CARD_DOWN	WEP_HIA_DOWN	/* link is down */

/*
** Broadcast w/no COMM, PROG or MACH check
*/
#define WEB_603		603	/* link to controller down, trying to restart */

/*
** Status Codes
*/
#define	STAT_ACK	0	/* zero status */
#define STAT_READ	1	/* read successful, write will follow */
#define STAT_SEL	107	/* device not selected */
#define	STAT_BERR	109	/* buffer error */
#define	STAT_BADC	110	/* bad command */
#define	STAT_UNSUP	111	/* unsupported command */
#define STAT_RESET	2	/* reset command */
#define	STAT_REST	STAT_RESET	/* reset command */
#define	STAT_PRTCMP	3	/* print complete (reset command) */

/*
** Acknowlegement Codes
*/
#define	ACK_ON		0x01	/* turn on auto acknowledgement */
#define	ACK_OFF		0x00	/* turn auto acknowledgement off */

/*
** Write Options 11-10-88 LJM
*/
#ifdef _RT
#define	TRANSP_MODE	0x80	/* Transparent option on write */
#endif 	/* _RT */
#ifdef i386
#define TRANSP_MODE	0x01	/* Transparent option on write, BSC mode */
#endif	/* i386 */
/
#dekê^) Ò  $        ¹	  [‰*$—ˆ*[‰*     Ý¿¹	  
                  ./usr/include/sys/c3270/tca3270.h h h   #ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)tca3270.h	1.2	AIX)	/* Modified 10/28/88 11:51:48 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/* static char sccsid[] = "@(#)tca3270.h	16.3 ";	*/
/* tca3270.h - tca/3270 constants and datatypes
*/
/* 3270 command codes */
#define cmdEWRT    0xF5 	 /* Erase/Write */
#define cmdEWRA    0x7E 	 /* Erase/Write Alternate */
#define cmdWRT	   0xF1 	 /* Write */
#define cmdEAU	   0x6F 	 /* Erase All Unprotected */
#define cmdWSF	   0xF3 	 /* Write Structured Field */
#define cmdRDBF    0xF2 	 /* Read Buffer */
#define cmdRDMD    0xF6 	 /* Read Modified */
#define cmdRDMA    0x6E 	 /* Read Modified all */
 
#define cmdCONT    0xFF 	 /* pseudo op - continuation */
/* The WCC byte */
#define wccRESET   0x40 	 /* Reset -
				    if don't support partitions and
				    command is EWRT or EWRA then reset
				    inbound reply mode to field
				    - otherwise see 3270 reference
				 */
#define wccALARM   0x04 	 /* sound the alarm */
#define wccKEYUN   0x02 	 /* unlock the keyboard */
#define wccREMDT   0x01 	 /* reset MDT bits */
 
/* 3270 orders */
#define ordSF	   0x1D 	/* Start Field */
#define ordSFE	   0x29 	/* Start Field Extended */
#define ordSBA	   0x11 	/* Set Buffer Address */
#define ordSA	   0x28 	/* Set Attribute */
#define ordMF	   0x2C 	/* Modify Field */
#define ordIC	   0x13 	/* Insert Cursor */
#define ordPT	   0x05 	/* Program Tab */
#define ordRA	   0x3C 	/* Repeat to Address */
#define ordEUA	   0x12 	/* Erase Unprotected to Address */
#define ordGE	   0x08 	/* Graphic Escape */
 
/* Field Attribute bits */
#define FAgc	0xC0	       /* Graphic Converter bits  */
#define FAprot	0x20	       /* protected */
#define FAnum	0x10	       /* numeric field */
#define FAautsk 0x30	       /* autoskip */
			  /* two bits control intensity/detectability */
#define FAnormi 0x00	       /* normal intensity     00xx */
#define FAlpd	0x04	       /* light pen detectable 01xx */
#define FAilpd	0x08	       /* intense and lpd      10xx */
#define FAinvis 0x0C	       /* invisible	       11xx */
#define FAresv	0x02	       /* reserved    */
#define FAmdt	0x01	       /* the MDT bit */
 
#define FAtlm	0x3C	       /*  prot,num,lpd,ilpd bit mask for table lkup*/
#define FAtls	2	       /*  shift for table lookup */
 
/* some 3270 Aid codes */
#define No327aid 0x60
#define AC327entr 0x7D		/* enter */
#define AC327clr  0x6D		/* clear */
BAD_INIkêv Ñ  $        y  [‰*$—ˆ*[‰*     Œy  	                  ./usr/include/sys/c3270/tcadecls.h  h   #ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)tcadecls.h	1.2	AIX)	/* Modified 10/28/88 11:51:57 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/* static char sccsid[] = "@(#)tcadecls.h	16.4 ";	*/

typedef struct dbList {
	struct Data_Buffer	*db_cur;
	struct Data_Buffer	*db_head;
	struct Data_Buffer	*db_tail;
} dbList;

/*
** link_addr:
**	Link address structure
*/
typedef struct link_addr {
	/* Flags */
	char	io_in_prog; 		/* global lock on link address */
	char	waiting_on_io_in_prog;	/* actual where sleep for io_in_prog */
	char	waiting_for_data;	/* sleep here when no data for read() */
	char	mlocked;		/* */
	char	waiting_for_unmlocked;	/* */
	char	la_waitForIntr;		/* sleep waiting for STAT, HALT intr */
	char	la_ackIncKeyun;		/* read ack. includes keyb. unlock */
	char	la_waitClear;		/* waiting for broadcast clear */
	char	la_autoAck;		/* if {TRUE}, then do fxfer autoack */
    
	/* I/O Processing Information */
	char	la_isPrinter;		/* if {TRUE}, then is printer */
	int	la_printerAddr;		/* if printer, this is printer addr */
	short	dd_corr_num;		/* link address correlation number */
	dbList	la_writeList;		/* write queue */
#ifdef _RT
	rqHeader	*la_devRqHeader;	/* device Ring Queue Header */
	union start_dev_ext {
		struct start_ext {
			unsigned short	ilev;
			unsigned char	rsvd;
			unsigned char	llc_ring_correl;
		} dev_ext;
		struct hdr_Dev_Ring_Que	*dev_ring_que;
	} cmd_ext;
	struct	wrt_ext{
			byte 	trp_opt;
			byte	reserved[3];
	}wrtext;				/* LJM 10-26-88 Transparency Option */
#endif /* _RT */
#ifdef i386
	dbList		la_readList;		/* outbound read queue */
	Data_Buffer	*la_recvDbP;
	/* APAR 3773, 10-2-89 */
	Data_Buffer	*writeBuffer;		/* inbound write buffer */
	int		read_mod;
	NETWORK_ID	la_netID;
	byte		BSC_mode;	/* Transparency Mode LJM 11-10-88 */
#endif /* i386 */
    
	/* Select Information */
	struct proc *dev_selr;		/* pid of proc. selecting on read */
	struct proc *dev_sele;		/* pid of proc. selecting on exception*/
	int	dev_flags;		/* variable holding collision flags */
    
	/* Process Information */
	int	num_processes;		/* # of procs that have opened link */
    
	/* Security */
	ushort la_euid;			/* euid of the 1st proc to open link */

	/* Status Of Last I/O */
	uint	io_flags;		/* link information flag for io_tca */
	uint	io_status;		/* 5xx, 6xx, 7xx msg codes    */

	/* Link State */
	uint	link_state;
} linkAddr;

typedef struct cmd_ext {
    uint 	ringq_addr;
    unsigned	char session;
    unsigned	char resvd;
    ushort	port_iodn;
    char	ce_sessionType;
    char	ce_sessionAddr;
    ushort	ce_reserved3;
} cmdExt;

/*
** errmsg:
**	error logger structure
*/
typedef struct errmsg {
	char	class;
	char	subclass;
	char	mask;
	char	type;
	int	data_len;
	int	retcode;
	int	mod_ID;
	short	address_num;
	short	reserved;
} errmsg;

/*
** tcad_ddi:
*/
typedef struct tcad_ddi {
	char	cnf_opt;	/* config option:0 == shutdown, 1 = startup. */
	char	dev_type;	/* appl. device type: '3' == tca, 'R' == RJE. */
	char	sess_base;	/* base session id (e.g. 0 for BSC). */
	char	sess_cnt;	/* session count (e.g. 32 for BSC). */
	int	llc_ddilen;	/* length of LLC initialization information. */
	char	llc_ddi[1];	/* LLC initialization information:
				** the line record for the IODN/Minor-Device
				** to initialize, and the corresponding
				** controller information.
				*/
} tcadDdi;

/*
** card_data:
*/
typedef struct card_data {
	char	waiting_to_open;
	char	open_link_address;
#ifdef _RT
	char	GBIOS_open_ok;
	short   ilev;
	int	Buffer_Pool_Seg_ID;
	int	Block_IO_Comm_Area;
	int	dev_vec;
	long	mgr_pathid;
	long	dev_pathid;
#endif /* _RT */
#ifdef i386
	DDS_DATA	*cd_ddsPtr;
#endif /* i386 */
	char	snoozer;
	char	open_first_time;
	char	lower_link_address;
	char	upper_link_address;
	char	INIT_COMPLETE;
	int	tca_card_status;
	int	num_times_init;
	linkAddr	*mlnk_ptrs[TCA_MAX_SESSIONS];
	cmdExt	cmdext;
} cardData;
SEL	107kê¨8 Ð  $        h  [‰*%—ˆ*[‰*     ø‹h  	              ~  ./usr/include/sys/c3270/tcadefs.h   h   #ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)tcadefs.h	1.3	AIX)	/* Modified 10/28/88 11:52:07 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/*    static char sccsid [] = "@(#)tcadefs.h	16.5 ";	*/
 /*************************************************************************
 **
 **
 **		Module Name		- ssladefs.h
 **		Version			- 1.2
 **		Date			- 10/20/86 10:19:47
 **		Latest Revision		- 10/13/86 18:03:27
 **
 *************************************************************************/

#ifdef i386
# include "dftnsDcl.h"
# ifdef FALSE
#  undef FALSE
# endif
# define FALSE		0
# ifdef TRUE
#  undef TRUE
# endif
# define TRUE		1
# define spl4		splhi
# define IOCTL_BEHAVED
# define BYTE_SWAP
# define trace1(a1,a2)			(0)
# define trace2(a1,a2,a3)		(0)
# define trace3(a1,a2,a3,a4)		(0)
# define trace4(a1,a2,a3,a4,a5)		(0)
# define trace5(a1,a2,a3,a4,a5,a6)	(0)
#endif /* i386 */

#define TCA_MAX_SESSIONS	17

/* Note: these function are defined in c327dd.h for the PS2 platform */
#ifdef _RT
#define MAX_ADAPTERS	4
#define	C327TRACE1(a1)			(0)
#define	C327TRACE2(a1,a2)		(0)
#define	C327TRACE3(a1,a2,a3)		(0)
#define	C327TRACE4(a1,a2,a3,a4)		(0)
#define	C327TRACE5(a1,a2,a3,a4,a5)	(0)
#endif /* _RT */


#define PRIORITY	(PZERO + 10 | PCATCH)
/*
#define PRIORITY	(PRI327 | PCATCH)
*/
#define MAXPROC		32
#define PANEL_20	0x10
#define CLEAR		0x00
#define SET		0x01
#define RCOL		010000000	/* select read collision flag */
#define WCOL		020000000	/* select write collision flag */
#define ECOL		040000000	/* select exception collision flag */
#define GBIOS_IODN	0x300		/* used to attach GBIOS */

/***** Defines for error logger subroutine *****/

/********* Module IDs ***************/

#define	Open			1
#define	Close			2
#define	Read			3
#define	Write			4
#define	Inquire_Ioctl		5			 
#define	Send_Stat_Ioctl		6 
#define	Power_On_Reset_Ioctl	7 
#define	Info_Ioctl		8
#define	Select			9	
#define	Unsol_Intr		10	
#define	Int_Hndlr_Open		11
#define	Int_Hndlr_Close		12
#define	Int_Hndlr_Write		13
#define	Int_Hndlr_Send_Stat	14
#define	Int_Hndlr		15
#define	Solict_Intr		16
#define	Close_GBIOS		17
#define	Open_GBIOS		18

/********  Error Types *************/

#define	PERM_ERROR		0x80
#define	TEMP_ERROR		0x40
#define	INFORM_ERROR		0x20
#define	THRESHLD_ERROR		0x10

/*******  Additional error codes for error logger these codes ***************/
/*******  along with the return codes in solres.h complete the set **********/
/*******  of return codes utilized by the AIX Driver error logger template  */
/*******  file																*/

#define UNSUPPORTED_SNA_CU	0x8303
#define	INVALID_CMD		0x8802
#define	BAD_STATUS		0x8806
#define ATTACH_GBIOS_FAILED	0x9D02
#define DETACH_GBIOS_FAILED	0x9d03
#define	SLEEP_NON_0		0x9E00
#define	SPURRIOUS_INTR		0xDC02
#define	INIT_INCOMPLETE		0xDC03
#define	LA_OUT_OF_RANGE		0xDC04
#define	LA_NOT_DEFINED		0xDC05
#define	SEND_CMD_REJ		0xDC06

/*
** MDEP return codes from machine dependent routines
*/
#define MDEP_SUCCESS		1	/* routine succeeded */
#define MDEP_FAILURE		0	/* routine failed */

/*
** Link State Defines
*/
#define LS_LINKDOWN		(uint)0x0000001	/* link is down */
#define LS_NORMAL		(uint)0x0000002	/* normal (home) state */
#define LS_DATA_AVAIL		(uint)0x0000004	/* data available */
#define LS_RD_OF_WRT_INPROG	(uint)0x0000008	/* read of write in progress */
#define LS_RD_OF_RD_INPROG	(uint)0x0000010	/* read of read in progress */
#define LS_WAIT_SYSWRITE	(uint)0x0000020	/* waiting for system write() */
#define LS_W_WAIT_READACK	(uint)0x0000040	/* write waiting for read ack */
#define LS_EA_WRITE		(uint)0x0000080	/* e.a. write initial state */
#define LS_EA_WAIT_SYSREAD	(uint)0x0000100	/* e.a. wait for AIX read */
#define LS_EA_WAIT_READACK	(uint)0x0000200	/* e.a. wait for remote ack. */
#define LS_DPE			(uint)0x0000400	/* data pending enter state */
#define LS_DPE_WRITE		(uint)0x0000800	/* d.p.e. write initial state */
#define LS_DPE_WAIT_SYSREAD	(uint)0x0001000	/* d.p.e. wait for AIX read */
#define LS_DPE_WAIT_READACK	(uint)0x0002000	/* d.p.e. wait for remote ack */
#define LS_RE			(uint)0x0004000	/* retry enter state */
#define LS_CLOSING		(uint)0x0008000	/* closing link */
#define LS_RESETTING		(uint)0x0010000	/* reseting link */
#define LS_AA_RD_OF_WRT_INPROG	(uint)0x0020000	/* autoack RD_OF_WRT_INPROG */
#define LS_AA_INPROG		(uint)0x0040000	/* autoack in progress */
#define LS_START_INPROG		(uint)0x0080000	/* start in progress */
#define LS_RM_WRITE		(uint)0x0100000 /* read modified executed */
#define LS_UNDEFINED		(uint)0xfffffff	/* undefined due to null laP */

/*
** Combination of usefull states
*/
/* READ_STATES - all states where a read can occur */
#define READ_STATES	(LS_DATA_AVAIL | LS_RD_OF_WRT_INPROG | \
			LS_RD_OF_RD_INPROG | LS_AA_RD_OF_WRT_INPROG)

/*
** macros to manipulate link state field in link address structure
** (getLinkState returns undefined link state when laP is null)
*/
#define getLinkState(laP)	((laP ? laP->link_state : LS_UNDEFINED))

#define emptyDbList(dbLP)		((dbLP)->db_head == 0)
#define atEndOfDbList(dbLP)		((dbLP)->db_cur == 0)

typedef unsigned int	state;

#define traceXADEV(_h, _a1, _a2, _a3)	trace3(_h, _a1, _a2, _a3)
#define traceXDDEV(_h, _a1, _a2, _a3)		trace3(_h, _a1, _a2, _a3)
#define traceQDEV(_h, _a1, _a2)			trace2(_h, _a1, _a2)
#define traceXSC(_h, _a1, _a2, _a3, _a4, _a5, _a6)	trace4(_h, _a1, \
				_a2, _a3, _a6); trace2(320, _a4, _a5);

#define isMinorCard(m)		((m) >= 0 && (m) <= 3)
#define isMinorControl(m)	((m) >= 4 && (m) <= 7)
#ifdef _RT
# define isMinorGood(m)		(isMinorCard((m)))
#endif
#ifdef i386
# define isMinorGood(m)		(isMinorCard((m)) || isMinorControl((m)))
#endif /* i386 */

#define isCardUp(_d)		(tca_data[(_d)].tca_card_status == TRUE)
#define isCardDown(_d)		(tca_data[(_d)].tca_card_status == FALSE)
#define setCardUp(_d)		(tca_data[(_d)].tca_card_status = TRUE)
#define setCardDown(_d)		(tca_data[(_d)].tca_card_status = FALSE)
kêx­ Ï  $        n  [‰*%—ˆ*[‰*     Bn  	                  ./usr/include/sys/c3270/tcaexterns.h    #ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)tcaexterns.h	1.2	AIX)	/* Modified 10/28/88 11:52:14 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/*    static char sccsid [] = "@(#)tcaexterns.h	16.3 ";	*/

/*************************************************************************
**
**
**		Module Name		- tcaexterns.h
**		Version			-
**		Date			-
**		Latest Revision		-
**
*************************************************************************/

extern struct card_data	tca_data[4];
extern int	tca_iodns[4];

#ifdef i386
extern int	_ddiLen;
extern char	*_ddiP;
#endif /* i386 */

extern Data_Buffer	*popDbList();
extern Data_Buffer	*nextDbList();
extern void	mfree_la_struct();
extern void	mlogerr();
extern void	mreset_link();
extern void	msend_status();
extern void	mtca_inquire_link();
extern void	mwrite_transfer();
extern void	tcaintr();
extern void	wakeup_mwait_for_io();
extern int	mcheck_open_errors();
extern int	mdepClosePort();
extern int	mdepHaltLA();
extern int	mdepOpenPort();
extern int	mdepSendStatus();
extern int	mdepStartLA();
extern int	mdepWriteBuffer();
extern int	mdepGetInfo();
extern int	mgetlnk();
extern int	mwait_for_io();
extern int	mtca_send_buff();
extern short	mget_lnk_addr_num();
extern short	mscan_link_ptrs();

#ifdef i386
extern struct user	u;
#endif /* i386 */
iskê¨ Î  $        ±  \‰*%—ˆ*\‰*     Y±  	                  ./usr/include/sys/c3270/tcagbios.h h    #ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)tcagbios.h	1.2	AIX)	/* Modified 10/28/88 11:52:21 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/* static char sccsid[] = "@(#)tcagbios.h	16.3 ";	*/
/*********************************************************************
**
**	Function Name:	tcagbios.h
**
**	Description:	This file contains the structure definitions
**					for the gbios buffer's.
**
*********************************************************************/

struct hdr_Dev_Ring_Que {
	unsigned long	Ring_In_Ptr;	/* LLC Path ID */
	unsigned long	Ring_Out_Ptr;	/* NetID Table Correlator */
	unsigned long	Ring_End_Ptr;	/* Received Completion Mask */
};

struct hdr_Buff_Scan_Directory {
	short int	directory_size;
	short int	num_bufs;
	short int	*last_free;
	short int	buff_size;
	short int	rsvd1;
};

typedef struct Data_Buffer {
	struct hdr_Buff_Scan_Directory	*addr_buf_pool;
	short int	*addr_direct_entry;
	unsigned short	buff_size;
	short int	flag_field;
	char	outbound_more_data;	/* 1 = more data in message from host */
					/* 0 = no more data ''             '' */
	char	inbound_more_data;	/* 1 = more data in message to host */
					/* 0 = no more data ''             '' */
	char	cmd_tca;		/* tca command ( not used by panel20 */
	char	pseudo_chaining;	/* psuedo-chaining flag for outbound */
					/* data */
	struct Data_Buffer	*next_ptr;	/* ptr to next elem. */
						/* in inbound msg. */
	int	inbound_processed;	/* flag indicating if the buffer has */
					/* been processed by VRM handler yet */
	char	user_control_area[52];
	unsigned short	data_len;	/* number of bytes in data area */
	unsigned short	data_offset;	/* number of bytes currently */
					/* processed from data area */
	char	buf_start;		/* start of the buffer */
} Data_Buffer;	

/*
** rqHeader:
**	Ring queue header.
**	Note that the fields bracketed by "NEWRQ" must be at the beginning
**	of the structure, because the structure is used variable length.
**	Additionally, these fields are not compatible with RT-PC/VRM
*/
typedef struct rqHeader {
#ifdef NEWRQ
	int			rqh_usedEntries;
	int			rqh_bufferSize;
	int			rqh_lowWaterMark;
	void		(*rqh_lowWaterFunct)();
#endif /* NEWRQ */
	Data_Buffer	**rqh_inPointer;
	Data_Buffer	**rqh_outPointer;
	Data_Buffer	**rqh_endPointer;
	Data_Buffer	*rqh_bufAdrs[1];
} rqHeader;


/*
** RQPUT_*
**	Return values for rqPut()
*/
#define RQPUT_EMPTY	-1	/* was empty when rqPut called */
#define RQPUT_NONEMPTY	0	/* was between empty & full when rqPut called */
#define RQPUT_FULL	1	/* was full when rqPut called */

/*
** RQFILL_*
**	Return values for rqFill()
*/
#define RQFILL_SUCCESS	0	/* completed successfully i.e. no failure */
#define RQFILL_PARTIAL	1	/* partially completed filling ring queue */
#define RQFILL_FAILURE	2	/* could not place any new buffers in r.q. */

extern Data_Buffer	*bufferAlloc();
extern Data_Buffer	*peekRecvData();
extern Data_Buffer	*getRecvData();
 from mkêÔE Í  $        ¸  \‰*&—ˆ*\‰*     Ðg¸  	              qY  ./usr/include/sys/c3270/tcasolres.h     #ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)tcasolres.h	1.2	AIX)	/* Modified 10/28/88 11:52:28 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/*    static char sccsid [] = "@(#)tcasolres.h	16.3 ";	*/

/*
** tcasolres.h
*/

/*
** Flag Codes
*/
#define SOL_SOFT_INT	0x80	/* software interrupt */
#define SOL_TIMER_INT	0x40	/* timer interrupt */
#define SOL_STARTIO_INT	0x20	/* startio interrupt */
#define SOL_SENDCMD_INT	0x10	/* send command interrupt */
#define SOL_VIRTUAL_INT	0x08	/* virtual terminal interrupt */
#define SOL_INT		0x04	/* solicited interrupt */
#define SOL_MSG		0x01	/* message from another virtual machine */

/*
** The following sections are Operation Result Values for solicited
** and unsolicited operations
*/

/*
** Solicited Interrupts Operation Results
*/
#define RC_LA_ENB	0x8302	/* link address already enabled */
#define RC_BAD_SNA_CU	0x8303	/* unsupported SNA control unit */
#define RC_BAD_CU_LINK	0x8304	/* No ctrl. unit session was established */
#define RC_BAD_HOST_LINK	0x8305	/* no host session was established */
#define RC_BAD_CU	0x8306	/* unsupported control unit */
#define RC_COLLISION	0x8307	/* inbound data collided w/outbound data */
#define RC_FULL_NET	0x8601	/* netID table full */
#define RC_INV_CORR	0x8802	/* invalid device driver correlator */
#define RC_DEV_NOT_OPEN	0x8803	/* device not opened */
  
/*
** Unsolicited Interrupt Operation Results
*/
#define RC_CK_STATUS	0x2000	/* mask to check status field */

#ifdef i386
#define RC_DATA_AVAIL	0x8100	/* data available */
#endif i386
#ifdef _RT
#define RC_DATA_AVAIL	0x0100	/* data available */
#endif /* _RT */

#define RC_UNDER_SLIH	0x8400	/* SLIH ring que underflow */
#define RC_UNDER_DEV	0x8500	/* Device ring que underflow */
#define RC_BUFF_DEPL	0x8700	/* buffer pool depleted */
#define RC_LOCK_DEV	0x0900	/* device selected, host has locked dev */
#define RC_UNLOCK_DEV	0x0a00	/* Selection complete, host has unlocked dev */
#define RC_PAST_MAX	0x8901	/* tried to open a dev already opened max # */
				/* times allowed */
#ifndef RC_ALREADY_OPEN
# define RC_ALREADY_OPEN	0x8903	/* this dev. already open by the LLC */
#endif
#ifndef RC_NOT_OPEN
# define RC_NOT_OPEN	0x8905	/* Tried to close when not opened */
#endif
#define RC_ATT_FAILED	0x8B00	/* attach to device driver failed */
#define RC_BAD_ENQ	0x8B01	/* enque of command to driver failed */
#define RC_INV_DDS2	0x8B02	/* invalid DDS */
#define RC_CANT_PIN	0x8B05	/* cant pin dev rinq que and buf pool for comm*/
#define RC_OVER_DEV	0x8b06	/* SLIH rinq que overflow, cant fill */
#define RC_CANT_ATT	0x8B07	/* unable to attach LLC to dev driver */
#define RC_CANT_UNPIN	0x8C00	/* unable to unpin buffer areas */
#define RC_TCA_DOWN	0x8905	/* unrecoverable error - must detach GBIOS */
				/* and RE-IPL the card */

/*
** Solicited or Unsolicited Interrupt Op Results
*/
#define RC_SUCC		0x0000	/* successful return code */
#define RC_TIMEOUT	0x8200	/* timeout */
#define RC_ADD_TCA	0x8300	/* the TCA adapter isn't present */
#define RC_INV_Q	0x8801	/* invalid que element type */
#define RC_INV_CMD	0x8802	/* invalid command */

/*
** The following are return codes from a write operator indicator command.
** all by/for the 5088
*/
#define RC_WOI_505	0x9A00	/* system reset sequence on channel detected */
				/* by 5088 */
#define RC_WOI_503	0x9A01	/* selective reset sequence on channel */
				/* detected by 5088 */
#define RC_WOI_583	0x9A02	/* halt I/O sequence detected by 5088 */
#define RC_WOI_40	0x9A03	/* command reject generated by 5088 on data */
				/* received on channel */
#define RC_WOI_551	0x9A04	/* bus out check detected by 5088 */
#define RC_WOI_584	0x9A05	/* streaming overrun detected by 5088 */
#define RC_WOI_501	0x9A06	/* 5088 is operating but is set to offline */
#define RC_WOI_406	0x9A07	/* 5088 detected op check */


/*
** Operation Result Values for handler to GBIOS
*/
#define RC_IPL_ADAPT	0x0001	/* IPL the adapter after successful open */

/*
** Status Flags
*/
#define SOL_GEN		0x14	/* solicited interrupt */
#define UNSOL_GEN	0x00	/* unsolicited interrupt */

/*
** I/O Commands From AIX Driver to VRM Handler
*/
#define AIX_WRITE	0x06	/* write */
#define AIX_START	0x07	/* start device */
#define AIX_HALT	0x08	/* halt device */
#define AIX_SEND_STAT	0x09	/* send status */

/*
** I/O Commands From GBIOS to VRM Handler
*/
#define GBIOS_OPEN	0x02	/* open */
#define GBIOS_CLOSE	0x03	/* close */
#define GBIOS_IPL	0x05	/* IPL */

/*
** I/O Commands From AIX Driver to GBIOS
*/
#define AIX_GOPEN	0x02	/* open */
#define AIX_GCLOSE	0x03	/* close */

/*
** I/O Commands Internal to the VRM handler
*/
#define ROMP_READ	0x0C	/* read data from SSLA into GBIOS buffers */
#define READ_MOD_EXP	0x10	/* read modified expected */
#define RD_RESP_TRANS_C	0x11	/* xfer complete expected for read response */
#define AIX_WR_EXP	0x12	/* a write is expected from the AIX driver */
#define WR_RESP_TRANS_C	0x13	/* xfer complete expected for write response */
#define RM_RETRY	0x14	/* read mod retry -- host wants you to resend */
				/* the last inbound message, by default you */
				/* go into this state every time you */
				/* successfully send an inbound data stream. */
				/* You come out of it when you get a non read */
				/* mod command from the host */
#define BUFF_RELEASE	0x0200  /* free buffer bit used in SVC for write */

/*
** Status Values
*/
#define SS_ACK		000	/* ack the previously received nsd message */
#define SS_ERROR	109	/* indicates that a bad buffer order or an */
				/* invalid buffer address was received */
#define SS_B_COMM	110	/* indicates that non-nsd cmd. was received */
#define SS_UNSUPPORT	111	/* unsupported command */

#define WRITE_QUE_COMPLETE 	0x0E0	/* used in aix write routine  */  
kê4Í   $        à
  2‰*O™ˆ*2‰*     ‘cà
  	                  ./usr/include/sys/callout.h olre/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)callout.h	16.4	LCC)	/* Modified: 18:03:18 9/22/89 */
/* SCCSIDPUFF(@(#) callout.h 4.1 LM 12:50:58 4/23/85 C 22:11:49 4/23/85); */

#ifndef _h_CALLOUT
#define _h_CALLOUT

#ifndef  _h_TYPES
#ifdef   KERNEL
#include <types.h>
#else   /* ~KERNEL */
#include <sys/types.h>
#endif  /* ~KERNEL */
#endif  /* ~_h_TYPES */

/*
 * The callout structure is for
 * a routine arranging
 * to be called by the clock interrupt
 * (clock.c) with a specified argument,
 * in a specified amount of time.
 * Used, for example, to time tab
 * delays on typewriters.
 */

/* LOCUS changes:
 * 1. The callout array of old has been made into a linked list so that
 *    entries can be cancelled.  Thus the fields c_forw and c_back have
 *    been added.  Also c_free and c_active have been defined to habe
 *    the list of free and active entries.
#ifdef S370
 * 2. Use malloc and mfree and the time of day clock.
#endif S370
#ifdef u370
 * 3. Add virtual timeout support.
#endif u370
 */

#ifdef RESSUP
/*
 *	Callouts under the SSS are on a per process basis.  Therefore
 *	They are linked off the user structure.  This may or may not
 *	be strictly necessary.  Callouts left pending when a process
 *	exits are discarded (to the best of my understanding greg t.).
 */
#endif /* RESSUP */
struct	callout {
#ifdef  RESSUP
	union {
		tod_t C_tod;	/* time of day, for real timeouts */
		time_t C_cpu;	/* time, for virtual timeouts, timeins */
	} C_UN;
#define c_tod		C_UN.C_tod
#define c_cpu		C_UN.C_cpu
#else  /* ~RESSUP */
	time_t	c_time;		/* incremental time */
#endif /* ~RESSUP */
	caddr_t	c_arg;		/* argument to routine */
	int	(*c_func)();	/* routine */
	char		c_flag;	/* cancellable, done flags */
	struct callout *c_forw;   /* pointer to following node */
	struct callout *c_back;   /* pointer to preceding node */
};

/* c_flag bits */
#define C_CANCELABLE	0x1	/* will be to_canceled, don't free */
#define	C_DONE		0x2	/* timeout has gone off */
#define	C_DELETED	0x4	/* timeout has been canceled and should */
				/* should be ignored.			*/

#ifdef KERNEL
extern	struct  callout  * ctimeout();
extern	int  timeout();
#ifdef  RESSUP
extern  void timein();		/* ATTOWNED? */
extern  struct  callout *ctimein();
extern  time_t  to_cancel();
#else  /* ~RESSUP */
extern 	void to_cancel();
extern  struct	callout  *callout;
extern  struct  callout c_free;    /* head of the free list */
extern  struct  callout c_active;  /* head of the active list */
#endif /* ~RESSUP */

#endif /* KERNEL */

#endif /* ~_h_CALLOUT */
kêœ   $        Q  2‰*O™ˆ*2‰*     [Q  	                  ./usr/include/sys/chownx.h  olre
/*
*	Copyright (C)	Locus Computing Corporation, 1987,  1989.
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)chownx.h	16.4	LCC)	/* Modified: 18:03:51 9/22/89 */
/* H_SCCSIDgen1(@(#)chownx.h	1.4	LCC) /* Modified: 16:12:09 11/30/88 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _h_CHOWNX
#define _h_CHOWNX


/* original file: /usr/src/aix212/include/sys/chownx.h */
/* original what string: chownx.h	6.1 87/06/11 01:43:19 */

/*
 * Values for the sva_tflag.
 * Specifies how the uid and gid values are to be set.
 */
#define	T_OWNER_RAW	01	/* sva.uid is unaltered			*/ 
#define	T_OWNER_TRAN	02	/* sva.gid is translated through the	*/
				/*   sending node's outbound tables	*/
				/*   and then through the receiving	*/
				/*   node's inbound tables		*/
#define	T_OWNER_AS_IS	04	/* the owner id in the inode is		*/
				/*   unaltered				*/
#define	T_GROUP_RAW	010	/* sva.gid is unaltered			*/
#define	T_GROUP_TRAN	020	/* sva.gid is translated through the	*/
				/*   sending node's outbound tables	*/
				/*   then through the receiving node's	*/
				/*   inbound tables			*/
#define	T_GROUP_AS_IS	040	/* the group id in the inode is		*/
				/*   unaltered				*/

#if 0
#define	T_SYNC_FLAG	0100	/* Not Currently Used			*/
#endif /* 0 */

#endif	/* _h_CHOWNX */
ser strkêšð   $        Î  3‰*R™ˆ*3‰*     ¶cÎ  	                  ./usr/include/sys/clist.h   olre/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)clist.h	16.4	LCC)	/* Modified: 12:42:05 3/15/90 */
/* SCCSIDPUFF(@(#) clist.h 4.1 LM 12:51:08 4/23/85 C 22:11:51 4/23/85); */

#ifndef	_h_CLIST
#define	_h_CLIST

/*
 * The structure of a clist block
 */
#define	CBSIZE	64
struct cblock {
	struct cblock *c_next;	/* next cblock in clist or on cfreelist */
	char	c_first;	/* index of first valid char in cblock */
	char	c_last;		/* (index of final valid char) + 1 */
	char	c_esccnt;	/* number of QESC's present in cblock. used
				   for speeding post-processing in ttout() */
	char	c_pad;		/* this space available for future use */
	unsigned char	c_data[CBSIZE];	/* payload */
};

struct chead {
	struct cblock *c_next;
	int	c_size;
	int	c_flag;
};

#define	CHR_MASK	0x00ff	/* mask for char value (the infamous 0177) */
#define	CHR_LIT		0x0100	/* literal flag for getc/putc */

#ifdef _MBCS
#define	MBCHR_MASK	0x0200	/* used by ttrub() to differentiate between
				 * a character and the length of a multibyte
				 * character.
				 */
#endif /* _MBCS */

#ifdef	KERNEL
extern struct cblock	*cfree;
extern struct cblock	*getcb();
extern struct cblock	*getcf();
extern int		nclist;
extern struct chead	cfreelist;
#endif	/* KERNEL */

#endif /* ~_h_CLIST */
o kê< É  ÿ¡             u‰*u‰*u‰*          	                  ./usr/include/sys/clnt.h    olre../rpc/clnt.h sykêdÜ   $        ž	  3‰*S™ˆ*3‰*     Rž	  
                  ./usr/include/sys/clock.h   olre/*
 *		AIX/370
 *		57-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#include <sccs.h>
H_SCCSID(@(#)clock.h	1.2    IBM AIX)    /* Modified: 20:01:52 7/15/92 */
/*H_SCCSIDgen1(@(#)clock.h	11.12	LCC)	/* Modified: 11:12:02 11/21/88 */

#ifndef _h_CLOCK
#define _h_CLOCK

#define SECMIN		((unsigned) 60)			/* seconds per min. */
#define	SECHR		((unsigned) (60 * 60))		/* seconds per hour */
#define	SECDAY		((unsigned)(24*60*60))		/* seconds per day */
#define	SECYR		((unsigned)(365*SECDAY))	/* per common year */
#define	YRREF		1970
#define	LEAPYEAR(year)	((year)%4==0)	/* good till time becomes negative */

#ifdef	vax
/*
 * VAX clock registers
 */

#define	ICCS_RUN	0x00000001
#define	ICCS_TRANS	0x00000010
#define	ICCS_SS		0x00000020
#define	ICCS_IE		0x00000040
#define	ICCS_INT	0x00000080
#define	ICCS_ERR	0x80000000
	
/*
 * TODRZERO is the what the TODR should contain when the ``year'' begins.
 * The TODR should always contain a number between 0 and SECYR+SECDAY.
 */
#define	TODRZERO	((unsigned)(1<<28))

#ifdef TIME_SYNC
/*
 * Start the clock.
 */
#define	clkstart() {\
	mtpr(NICR, -usec_per_tick);\
	mtpr(ICCS, (int) ICCS_RUN+ICCS_IE+ICCS_TRANS+ICCS_INT+ICCS_ERR);\
}
#else
/*
 * Start a 60 HZ clock.
 */
#define	clkstart() {\
	mtpr(NICR, -16667);	/* 16.667 milli-seconds */\
	mtpr(ICCS, (int) ICCS_RUN+ICCS_IE+ICCS_TRANS+ICCS_INT+ICCS_ERR);\
}
#endif /* TIME_SYNC */
 
#define	clkreld()	mtpr(ICCS, ICCS_RUN+ICCS_IE+ICCS_INT+ICCS_ERR)
#define	clkstop()	mtpr(ICCS, 0)
#define	clkwrap()	(((unsigned)mfpr(TODR) - TODRZERO)/100 > SECYR+SECDAY)

/*
 * Software clock is software interrupt level 8
 */
#define	setsoftclock()	mtpr(SIRR, 0x8)
#endif	/* vax */

#if	 defined(i386)
#define	setsoftclock()	schedrtcintr(clk_swintr)

#ifdef KERNEL
int clk_swintr;		/* handle for scheduling clock software interrupts */
#endif

#endif	 /* defined(i386) */


#if	defined(i386)
#define	clkreld() tclkreld()
#endif	/* i386 */

#ifdef	b370

extern int Softclock;
extern	int	start_clk;

#define	setsoftclock()	Softclock++

/* Use the CPU timer */
#define	TIMER_HZ	(1000000/hz)
#define	TIMER_LONG	0x7fffffff

#define	clkstart()	start_clk = 1, Clkstart(TIMER_HZ)
#define	clkstop()	start_clk = 0, Clkstart(TIMER_LONG)
#define	clkreld()	Clkreld(TIMER_HZ)
#define	clkwrap()	(0)
#define	clkset()

#endif	/* b370 */
#endif /* ~_h_CLOCK */
oukê®Å ¢  $        Î  4‰*S™ˆ*4‰*     QpÎ  	               Y  ./usr/include/sys/cmap.h    olre/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)cmap.h	16.3	LCC)	/* Modified: 17:17:52 9/16/89 */
/* SCCSIDPUFF(@(#) cmap.h 3.1 LM 17:55:58 4/14/85 C 18:02:15 4/14/85); */

#ifndef _h_CMAP
#define _h_CMAP
#if	defined(PAGING) || defined(SWAPPING)
/*
 * Maximum number of mounted file systems changed from 15 to 31 by
 * expanding "c_mdev" from 4 to 5 bits.  See also changes in "cmap.m"
 * and "param.h".
 */

/*
 * core map entry
 */
struct cmap
{
#ifdef	XA370
unsigned int	c_next,		/* index of next free list entry */
		c_prev,		/* index of previous free list entry */
		c_hlink,	/* hash link for <blkno,mdev> */
		c_page,		/* virtual page number in segment */
		c_blkno;	/* disk block this is a copy of */
unsigned short	c_ndx,		/* index of owner proc or text */
		c_mdev;		/* which mounted dev this is from */
unsigned int
		c_filler:23,	/* unused space */
		c_inoPage:1,	/* page from inode rather than dev */
		c_zerofill:1,	/* if on, page must be bzero'd before use*/
		c_lock:1,	/* locked for raw i/o or pagein */
		c_want:1,	/* wanted */
		c_intrans:1,	/* intransit bit */
		c_free:1,	/* on the free list */
		c_gone:1,	/* associated page has been released */
		c_type:2;	/* type CSYS or CTEXT or CSTACK or CDATA */
#else	/* ~XA370 */
#ifdef  vax
unsigned int
		c_next:13,	/* index of next free list entry */
		c_prev:13,	/* index of previous free list entry */
		c_inoPage:1,	/* page from inode rather than dev */
		c_zerofill:1,	/* if on, page must be zero'd before use */
		c_fill:9,	/* unused fill space for alignment */
		c_mdev:9,	/* which mounted dev this is from */
		c_lock:1,	/* locked for raw i/o or pagein */
		c_want:1,	/* wanted */
		c_page:16,	/* virtual page number in segment */
		c_hlink:13,	/* hash link for <blkno,mdev> */
		c_intrans:1,	/* intransit bit */
		c_free:1,	/* on the free list */
		c_gone:1,	/* associated page has been released */
		c_type:2,	/* type CSYS or CTEXT or CSTACK or CDATA */
		c_blkno:20,	/* disk block this is a copy of */
		c_ndx:10;	/* index of owner proc or text */
#else   /* ~vax */
#ifdef	M_XENIX
unsigned long
#else	/* !M_XENIX */
unsigned int
#endif	/* M_XENIX! */
		c_next:16,	/* index of next free list entry */
		c_prev:16,	/* index of previous free list entry */
		c_hlink:16,	/* hash link for <blkno,mdev> */
		c_page:16,	/* virtual page number in segment */
		c_gone:1,	/* associated page has been released */
		c_inoPage:1,	/* page from inode rather than dev */
		c_zerofill:1,	/* if on, page must be zero'd before use */
		c_mdev:9,	/* which mounted dev this is from */
		c_blkno:20,	/* disk block this is a copy of */
		c_type:2,	/* type CSYS or CTEXT or CSTACK or CDATA */
		c_lock:1,	/* locked for raw i/o or pagein */
		c_want:1,	/* wanted */
		c_intrans:1,	/* intransit bit */
		c_free:1,	/* on the free list */
		c_ndx:10;	/* index of owner proc or text */
#endif  /* !vax */
#endif	/* !XA370 */
};

#define	CMHEAD	0

/*
 * Shared text pages are not totally abandoned when a process
 * exits, but are remembered while in the free list hashed by <mdev,blkno>
 * off the cmhash structure so that they can be reattached
 * if another instance of the program runs again soon.
 */
#ifdef XA370
#define	CMHSIZ	1024	/* SHOULD BE DYNAMIC */
#else /* !XA370 */
#define	CMHSIZ	512	/* SHOULD BE DYNAMIC */
#endif /* !XA370 */
	
#define	CMHASH(bn)	((bn)&(CMHSIZ-1))

#ifdef	KERNEL
extern  struct	cmap *cmap;
extern  struct	cmap *ecmap;
extern  int	ncmap;
extern	struct	cmap *mfind();
extern  int	firstfree;
extern  int	maxfree;
extern  int	ecmx;			/* cmap index of ecmap */
#ifdef XA370
extern  int	cmhash[ /* CMHSIZ */ ];
#else /* !XA370 */
extern  short	cmhash[ /* CMHSIZ */ ];
#endif /* !XA370 */
#endif  /* KERNEL */

/* bits defined in c_type */

#define	CSYS		0		/* none of below */
#define	CTEXT		1		/* belongs to shared text segment */
#define	CDATA		2		/* belongs to data segment */
#define	CSTACK		3		/* belongs to stack segment */

#define	pgtocm(x)	((((x)-firstfree) / CLSIZE) + 1)
#define	cmtopg(x)	((((x)-1) * CLSIZE) + firstfree)

#endif  /* (PAGING || SWAPPING) */

#endif /* ~_h_CMAP */
 *kêô
 Ÿ  $        ´  4‰*S™ˆ*4‰*     ¨¹´  	                  ./usr/include/sys/comlist.h olre
/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)comlist.h	16.4	LCC)	/* Modified: 18:04:27 9/22/89 */

#ifndef _h_COMLIST
#define _h_COMLIST

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif /* ~_h_PARAM */

struct comlist {
	PADOPEN(CMTlongs)
	commitcnt_t	Cl_lwm;		/* low water mark */
	commitcnt_t	Cl_hwm;		/* high water mark */
	commitcnt_t	Cl_llst;	/* commit count of start of list */
	ino_t		Cl_cmtlst[NCMTLST];	/* commit count list */
	PADCLOSE(CMTlongs, xCMTlongs, xUCMTlongs)
#define	cl_lwm		xUCMTlongs.xCMTlongs.Cl_lwm
#define	cl_hwm		xUCMTlongs.xCMTlongs.Cl_hwm
#define	cl_llst		xUCMTlongs.xCMTlongs.Cl_llst
#define	cl_cmtlst	xUCMTlongs.xCMTlongs.Cl_cmtlst
#define	NCMTLONGS	(sizeof(struct CMTlongs) / sizeof(long))
};

#endif /* ~_h_COMLIST */
*/
	kêº ž  $        ï   5‰*T™ˆ*5‰*     ‹–ï   	              ñ   ./usr/include/sys/conf.h .h olre/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)conf.h	1.2    IBM AIX)    /* Modified: 20:02:04 7/15/92 */
/*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/

#ifndef	_h_CONF
#define	_h_CONF
#if	defined(KERNEL) &&  !defined(_h_TYPES)
#include <types.h>
#endif  /* (KERNEL && ~_h_TYPES) */

#if	defined(KERNEL) &&  !defined(_h_IOBUF)
#include <iobuf.h>
#endif  /* (KERNEL && ~_h_IOBUF) */

extern int nchrdev, nblkdev;	/* number of entries in bdevsw and cdevsw */

struct devsw
{
	int	(*d_init)();		/* called durring system init	*/
	int	(*d_reset)();		/* called at system shutdown	*/

	int	(*d_open)();		/* called on every open	syscall	*/
	int	(*d_close)();		/* called on final close call	*/
	int	(*d_read)();		/* called for read system call	*/
	int	(*d_write)();		/* called for write system call */
	int	(*d_ioctl)();		/* called for ioctl system call	*/
	int	(*d_select)();		/* called for select syscall	*/

	int	(*d_strategy)();	/* called for asynchronous I/O	*/
	int	(*d_dump)();		/* called for kernel coredump	*/

	int	(*d_intr)();		/* called for device interrupts	*/

	struct	iobuf  *d_tab;		/* block device queue header	*/
#ifdef CONFIG_PARTITIONS
	struct  iobuf  * d_dtabs;
#endif /* CONFIG_PARTITIONS */
	struct	tty *(*d_tty)();	/* called to find tty structure */

	int	d_flags;		/* device/driver flags		*/
};

/* Possible device flags: */
#define	ISNOTATTY	0
#define	ISATTY		0x0001	 /* Device driver is a tty type device */
#define ISMPX		0x0002	 /* Device driver supports a multiplex file */
#define DV_COMPATMODE   0x0004   /* Device driver compatibility indicator */
#define DV_ATDMA   	0x0008   /* Device may use AT style dma xfers */
#define DV_AUTOCONF   	0x0010   /* Device will attempt auto-configuration */
#define DV_MINBLK   	0x0020   /* MINimal BLocK device; no seeks or mounts */
#define DV_TAPE   	0x0040   /* This is a mag tape (no bdwrite) */

/*
 * Line discipline switch.	(Sys 5)
 */
struct linesw {
	int	(*l_init)();
	int	(*l_open)();
	int	(*l_close)();
	int	(*l_read)();
	int	(*l_write)();
	int	(*l_ioctl)();
	int	(*l_input)();
	int	(*l_output)();
	int	(*l_mdmint)();
	char	*l_name;
};

#ifdef KERNEL
extern struct	devsw devsw[];
extern int ndev;
extern struct	linesw linesw[];
extern int	linecnt;
#ifdef	MBSTRAT
extern	int	(*mbdevsw[])();
#endif

extern			nodev( ), nulldev( );

/*
 * These macros find the right multi-page strategy routine.
 */

#ifdef	MBSTRAT
#define	MBDEVSTRAT(majminor, bufp)					\
		(*mbdevsw[ major(majminor) ])(bufp)

#ifdef  NOHASMBSTRAT
#define HASMBSTRAT(majminor)    0       
#else  /* ~NOHASMBSTRAT */
#define HASMBSTRAT(majminor)                                            \
                  (mbdevsw[ major(majminor) ] != (int (*)() ) 0)  
#endif /* NOHASMBSTRAT */
#endif /* MBSTRAT */

/*
 * Initialze soft configured line disciplines
 */
#define	LDISCINIT( line )						\
		(*linesw[ line ].l_init)( line )

/*
 * These macros are used to access the device driver switch(s) and
 * handle some drivers' need for dev_t's as parameters rather than
 * minor device numbers.
 */
#define	BDEVOPEN( majminor, flag, ext )					\
		(*devsw[ major(majminor) ].d_open)( majminor, flag, ext )

#define	BDEVCLOSE( majminor, flag, ext )				\
		(*devsw[ major(majminor) ].d_close)( majminor, flag, ext )

#define	BDEVSTRAT( majminor, bufp )					\
		(*devsw[ major(majminor) ].d_strategy)(bufp)

#define	STRATOF(majminor)						\
		(*devsw[ major(majminor) ].d_strategy)

#define	BDEVDUMP( majminor, c, a, l, o )			\
		(*devsw[ major(majminor) ].d_dump)( majminor, c, a, l, o )

#ifdef b370
#define	 CDEVINIT(majminor, tbl, n)					\
		(*devsw[ major(majminor)].d_init)(tbl, n)
#else /* !b370 */
#define	CDEVINIT( majminor )						\
		(*devsw[ major(majminor) ].d_init)( majminor )
#endif /* !b370 */

#define	INITEXISTS(majminor) (devsw[ major(majminor) ].d_init != nulldev)

#define	CDEVDOWN( majminor )						\
		(*devsw[ major(majminor) ].d_reset)()

#define	CDEVOPEN( majminor, flag, ext )					\
		(*devsw[ major(majminor) ].d_open)( majminor, flag, ext )

#define	CDEVCLOSE( majminor, flag, ext )				\
		(*devsw[ major(majminor) ].d_close)( majminor, flag, ext )

#define	CDEVREAD( majminor, ext )					\
		(*devsw[ major(majminor) ].d_read)( majminor , ext )

#define	CDEVWRITE( majminor, ext )					\
		(*devsw[ major(majminor) ].d_write)( majminor , ext )

#define	CDEVIOCTL( majminor, cmd, cmdarg, mode, ext )			\
		(*devsw[ major(majminor) ].d_ioctl)			\
			( majminor, cmd, cmdarg, mode, ext )

#define	CDEVSELECT( majminor, flag )					\
		(*devsw[ major(majminor) ].d_select)( majminor, flag )

#define CDEVINTR( majminor, arg )					\
		(*devsw[ major(majminor) ].d_intr)( minor(majminor), arg )

#define	BDEVTABLE( majminor )						\
		(devsw[ major(majminor) ].d_tab)

#ifdef	CONFIG_PARTITIONS
#define	 DTABSOF(majminor)	(devsw[major(majminor)].d_dtabs)
#endif	/* CONFIG_PARTITIONS */

#define	BDEVFLAGS( majminor )						\
		(devsw[ major(majminor) ].d_flags)

#define	CDEVFLAGS( majminor )						\
		(devsw[ major(majminor) ].d_flags)

#define	CDEVTTY( majminor )						\
		(*devsw[ major(majminor) ].d_tty)( majminor )

/*
 * driver installation macros - used to add driver to dev_switch at init time
 *	DEV_INSTALL   - used for all device drivers
 *	CDEV_INSTALL  - used for character device drivers
 *	BDEV_INSTALL  - used for block device drivers
 *	LDISC_INSTALL - used for all soft-configurable line disciplines
 */
#define DEV_INSTALL( major, init, reset, open, close, intr, flag )	\
{	devsw[major].d_init = init;					\
	devsw[major].d_reset = reset;					\
	devsw[major].d_open = open;					\
	devsw[major].d_close = close;					\
	devsw[major].d_intr = intr;					\
	devsw[major].d_flags = flag;					\
}

#define CDEV_INSTALL( major, read, write, ioctl, select, tty )		\
{	devsw[major].d_read = read;					\
	devsw[major].d_write = write;					\
	devsw[major].d_ioctl = ioctl;					\
	devsw[major].d_select = select;					\
	devsw[major].d_tty = tty;					\
}

#define BDEV_INSTALL( major, strat, dump, tab )				\
{	devsw[major].d_strategy = strat;				\
	devsw[major].d_dump = dump;					\
	devsw[major].d_tab = tab;					\
}

#define LDISC_INSTALL( line, init, open, close, read, write, ioctl, input, 			       output, mdmint, name)			        \
{									\
	linesw[line].l_init = init;					\
	linesw[line].l_open = open;					\
	linesw[line].l_close = close;					\
	linesw[line].l_read = read;					\
	linesw[line].l_write = write;					\
	linesw[line].l_ioctl = ioctl;					\
	linesw[line].l_input = input;					\
	linesw[line].l_output = output;					\
	linesw[line].l_mdmint = mdmint;					\
	linesw[line].l_name = name;					\
}

#ifdef	CONFIG_PARTITIONS
#define CFTAB_INSTALL(major, dtabs) bdevsw[major].d_dtabs = dtabs;
#endif /* CONFIG_PARTITIONS */

#endif /* KERNEL */

#if	defined(PAGING) || defined(SWAPPING)
/*
 * Swap device information
 */
struct swdevt
{
	dev_t	sw_dev;
	bool_t	sw_freed;
};
#ifdef KERNEL
extern struct	swdevt swdevt[];
#endif /* KERNEL */

#endif  /* (PAGING || SWAPPING) */
/* 
 * Each configured device is described by a dev_unit table entry.
 * Each device driver is provided with an array of dev_units for its devices.
 */
struct dev_unit {
	char dvu_name[9];	/* configured name of this particular device */
	char dvu_type[9];	/* configured type of this particular device */
	int  dvu_units;		/* number of sub-units associated with device */
	char *dvu_feat;		/* configured features/options for device */
	long dvu_info[N_DVU_INF]; /* address information for this device */
};

/* meanings of the dvu_info fields are totally machine specific */
#ifdef b370
#define	dvu_vda dvu_info[0]	/* b370 needs only SDA as address */
#endif /* b370 */
/*
 * The pantheon of device drivers generated into the system is described
 * by the gen_sw table, which contains one entry for each block or
 * character device driver.
 */
struct	gen_sw {
	char	gen_name[9];	/* device name from master file */
	int	gen_bdev;	/* block major device number */
	int	gen_cdev;	/* major/min of cdev entry */
	int	gen_nminor;	/* number of configured units */
	struct	dev_unit *gen_tbl; /* specific info on these devices */
};
#ifdef KERNEL
extern struct gen_sw gensw[];
#endif /* KERNEL */

#endif /* ~_h_CONF */
rkê`   $          5‰*©™ˆ*5‰*     a)  	                  ./usr/include/sys/config.h  olre/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)config.h	16.3	LCC)	/* Modified: 17:20:30 9/16/89 */
/* SCCSIDPUFF(@(#) config.h 4.1 LM 12:51:29 4/23/85 C 22:11:56 4/23/85); */

#ifndef _h_CONFIG
#define _h_CONFIG

#define NKERNDATAMAP	20		/* sizeof kernel data space map */
#endif /* ~_h_CONFIG */
)			kê`‡ ›  $        ±  5‰*T™ˆ*5‰*     c)±  	                  ./usr/include/sys/conschar.h lre/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)conschar.h	16.4	LCC)	/* Modified: 18:04:58 9/22/89 */
/* SCCSIDPUFF(@(#) conschar.h 4.1 LM 12:51:33 4/23/85 C 22:12:02 4/23/85); */

#ifndef _h_CONSCHAR
#define _h_CONSCHAR

/* characters understood by procchar and rem_procchar for doing */
/* special functions on the operator's console. */

#define CH_PR_SWAPMAP	'\t'
#define CH_PANIC	'!'
/*	unused		'"'	*/
#define	CH_PR_TTY	'#'
#define CH_DUMPSYS	'$'
#define CH_CLOCK_ON	'%'
#define CH_REBOOT	'&'
/*	unused		'\''	*/
#define CH_DEBUG_ON	'('
#define CH_DEBUG_OFF	')'
#define CH_READAHEAD	'*'
/*	unused		'+'	*/
#define CH_TOGGLE_PANICME	','
#define CH_PR_OPHIST	'-'
#define CH_PR_MOUNT	'.'
/*	unused		'/'	*/
#define CH_PR_NETSTAT_BUFS	'0'
#define CH_OUTPUT_ON	'1'
#define CH_OUTPUT_OFF	'2'
#define CH_PR_INODES	'3'
#define CH_PRINTER_ON	'4'
#define CH_PRINTER_OFF	'5'
#define CH_PR_ALL	'6'
#define CH_PR_NETSTAT	'7'
#define CH_PR_BUFS	'8'
#define CH_PR_NMS	'9'
/*	unused		':'	*/
#define CH_PR_TOP	';'
#define CH_DECR_BAUD	'<'
#define CH_TG_FREEZE	'='
#define CH_INCR_BAUD	'>'
#define CH_IGNORE_ALL	'?'
#define CH_SLOW		'@'
/*	debug_bit_on	'A-Z'	*/
#define CH_PR_NETSWITCH	'['
/*	unused		'\\'	*/
#define CH_PR_SITETABLE	']'
#define CH_CLOCK_OFF	'^'
#define	CH_PR_LARP	'_'
#define CH_PR_PROC	'`'
/*	debug_bit_off	'a-z'	*/
#define CH_PR_MEM	'|'
#define CH_PR_SEGS	'~'
/*	unused		'{'	*/
/*	unused		'}'	*/
/*	unused		'\177'	*/

#define nm_conschar	nm_var[0]

#endif /* ~_h_CONSCHAR */
 open;	kêZ š  $        T  6‰*V™ˆ*6‰*     ])T  	                  ./usr/include/sys/consmode.h lre/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)consmode.h	16.4	LCC)	/* Modified: 18:05:31 9/22/89 */
/* SCCSIDPUFF(@(#) consmode.jb.h 4.1 LM 12:51:36 4/23/85 C 22:12:03 4/23/85); */

#ifndef	_h_CONSMODE
#define	_h_CONSMODE

#if	!defined(__UNDEF__) && !defined(i386)
#ifdef  vax
#define CTLMODECHAR	'\033'
#else  /* !vax */
#define CTLMODECHAR	'\037'
#endif /* !vax */
#endif	/* !defined(__UNDEF__) && !defined(i386) */

#ifdef	KERNEL
extern  int  CTLMODE;
extern  long  NOCONS;
extern  long  NOLP;
extern	char	*CTLMODEname[];
extern	int	NCTLMODE;
extern	char	CTLFMT[];
#endif	/* KERNEL */

#endif /* ~_h_CONSMODE */
CH_Tkê^É ™  $        T  6‰*V™ˆ*6‰*     \)T  	                  ./usr/include/sys/cpuinfo.h  lre/*
 *		IX/370
 *		5667-126
*	(c) Copyright 1987, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)cpuinfo.h	16.3	LCC)	/* Modified: 17:23:12 9/16/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _h_CPUINFO
#define _h_CPUINFO


/*
 * Data structures used to keep track of the various types of cpus,
 * including which can emulate which.
 */
typedef char cpu_t;	/* just enough to hold one of the XC_* cpu codes. */

#define MAXHCMPLEN	12	/* Max size of cpu_name including null */
#define	MAXCOMPAT	4	/* picked out of the blue.  (sizeof(long)) */
struct cpuinfo {
	char	cpu_name[MAXHCMPLEN];	/* Hidden dir component for this  */
					/* machine.			  */
	int	cpu_namlen;		/* Length of cpu_name, including null */
	cpu_t	cpu_compat[MAXCOMPAT];	/* List of cputypes with which cpu is */
					/* compatible.  These must be XC_NONE */
					/* terminated.			      */
};

#ifdef KERNEL
extern struct cpuinfo cpuinfo[];
#endif /* KERNEL */

#endif /* ~_h_CPUINFO */
 CH_kêZi Ç  ÿ¡             v‰*v‰*v‰*          	                  ./usr/include/sys/cred.h .h  lre../rpc/cred.h sykêL ˜  $        ©  6‰*šˆ*6‰*     ¨p©  	                  ./usr/include/sys/ctmp.h .h  lreH_SCCSID(@(#)ctmp.h	1.2	AIX)	/* Modified: 21:33:49 8/24/89 */
/* @(#)ctmp.h	7.1 - 87/06/15 - 18:44:15 */
/*
 *	connect time record (various intermediate files)
 */

/* This is original "aix 2.2.1" source code */

struct ctmp {
	char	*ct_tty;		/* device name */
	u_short	ct_uid;			/* userid */
	char	ct_name[8];		/* login name */
	long	ct_con[2];		/* connect time (p/np) secs */
	time_t	ct_start;		/* session start time */
};
the varkê^ô —  $        Ý  6‰*W™ˆ*6‰*     ©¹Ý  	                  ./usr/include/sys/dcache.h   lre/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)dcache.h	16.5	LCC)	/* Modified: 12:57:11 12/5/89 */
#ifndef _h_DCACHE
#define _h_DCACHE

#include <types.h>
#include <dir.h>

/*
 * Definitions of function codes used by dircache() routine:
 */
#define DIR_FIND	1	/* closed directory, cache find 	*/
#define DIR_ADD		2	/* directory cache add function		*/
#define DIR_DELETE	3	/* directory cache delete function	*/
#define DIR_SEARCH	4	/* open directory, cache find		*/
#define DIR_SHIFT	5	/* change offset of existig cache entry	*/

/*
 * definition of the fields for maintaining the doulbly linked lists
 */
struct dcptrs
{	struct dcentry	*dd_next;	/* forward pointer		*/
	struct dcentry	*dd_prev;	/* backward pointer		*/
};

/*
 * definition of a directory cache entry and the subpool headers:
 */
struct 	dcentry 
{	struct dcptrs dc_hlist;	/* main hash list			*/
	struct dcptrs dc_lrulist;/* lru list			 	*/
	struct dcptrs dc_seclist;/* secondary hash list			*/
	gfs_t	dc_gfs;		/* gfs number of parent directory	*/
	off_t	dc_offset;	/* offset of entry in parent directory	*/
	ino_t	dc_dino;	/* inode number of parent directory	*/
	struct  dc_direct dc_dent;	/* copy of the directory entry	    	*/
};
struct 	dchead 
{	struct dcptrs dc_hlist;	/* main hash list			*/
	struct dcptrs dc_lrulist;/* lru list			 	*/
	struct dcptrs dc_seclist;/* secondary hash list			*/
	long	dc_count;	/* number of searches on this subpool	*/
	long	dc_hits;	/* number of hits within this subpool	*/
};

#define dh_next 	dc_hlist.dd_next
#define dh_prev 	dc_hlist.dd_prev
#define dl_next		dc_lrulist.dd_next
#define dl_prev		dc_lrulist.dd_prev
#define ds_next		dc_seclist.dd_next
#define ds_prev		dc_seclist.dd_prev

#ifdef KERNEL
extern ino_t dircache();
#endif /* KERNEL */

#endif /* ~_h_DCACHE */
	dekêVv –  $        7<  7‰*W™ˆ*7‰*     ©p7<  	              K)  ./usr/include/sys/debugflag.h re/*
Copyright (c) 1984,  1989  Locus Computing Corporation
		All Rights Reserved
*/

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */

H_SCCSID(@(#)debugflag.h	1.2    IBM AIX)    /* Modified: 20:02:06 7/15/92 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _DEBUGFLAG_
#define _DEBUGFLAG_

/* turn a debug into a printf */
#define pdebug(x,y)  printf y

#ifdef  DEBUGVAR

extern	int debug_var;
#define debug(x,y)	if ((x)&debug_var) printf y
#define	debugcall(x,y)	if ((x)&debug_var) y

#define DONOTHING

	/* For readability this stuff is here twice.
	 * First it is sorted alphebetically and then
	 * sorted numerically by value.  When you change
	 * one please change the other and keep things
	 * in order.
	 */

#define ACCESS0DBG	0x00000400L
#define ADDSITEDBG	0x00000001L
#define ADRCHKSDBG	0x00000200L
#define ALLOCDBG	0x40000000L
#define ANYDBG		0xffffffffL
#define ATTACHDBG	0x00000010L
#define BAWRITEDBG	0x00000800L
#define BDWRITEDBG	0x00000800L
#define BFLUSHDBG	0x00000800L
#define BHASHDBG	0x00000800L
#define BLKIODBG	0x80000000L
#define BLREADADBG	0x00000800L
#define BLREADDBG	0x00000800L
#define BMAPDBG		0x00000100L
#define BREADDBG	0x00000800L
#define BRELSEDBG	0x00000800L
#define BWRITEDBG	0x00000800L
#define CALLDBG		0xffffffffL
#define CETIDBG		0x00002000L
#define CHECK_SLDBG	0x00000400L
#define CKDDBG		0x00000001L
#define CHKSITEDBG	0x00000001L
#define CLKDBG		0x00200000L
#define CLOCKDBG	0x01000000L
#define CLOSEDBG	0x00000400L
#define CLOSEFDBG	0x00008000L
#define CLRBUFDBG	0x00000800L
#define CMITDBG		0x01000000L
#define COMMITBITSDBG	0x00000040L
#ifdef	romp
#define CONFDBG		0x00800000L
#endif	/* romp */
#define CPDBG		0x80000000L
#define CREATDBG	0x00000400L
#define CSSPROPDBG	0x00000040L
#define CSS_LOCKDBG	0x00004000L
#define DIRMODDBG	0x00000400L
#define DIRSTDBG	0x00000001L
#define DORTIDBG	0x00000200L
#define DSORTDBG	0x04000000L
#define DSPDBG		0x00000008L		/* dynamic svrproc debug `d' */
#define DUMPDBG		0x00040000L
#define DUSTDBG		0x00000008L	/*dustatdebug.*/
#define ETHDBG		0x00002000L
#define ETHIPDBG	0x00000002L	
#define EXECDBG		0x00000200L
#define FBADBG		0x00000001L
#define FEPDBG		0x00020000L
#define FINDSSDBG	0x00004000L
#define FLPDBG		0x00080000L
#define	FORKDBG		0x40000000L
#define FREEDBG		0x40000000L
#define FREELOOPDBG	0x00000040L
#define GETBLKDBG	0x00000800L
#define GETCOMPDBG	0x00000080L
#define GETEBLKDBG	0x00000800L
#define GETITABDBG	0x00000001L
#define GETLBNLISTDBG	0x02000000L
#define GETMDEVDBG	0x00000004L
#define GETNBLKDBG	0x00000800L
#define GETNMSGDBG	0x00000800L
#define GETXFILEDBG	0x00000200L
#define GMDELETEDBG	0x00000004L
#define GMENTERDBG	0x00000004L
#define GROWDBG		0x00000040L
#define HDDBG		0x00000001L
#define HETDBG		0x00040000L
#define ICLEANUPDBG	0x00000001L
#define ICLOSEDBG	0x00010000L
#define ICSSDBG		0x00000001L
#define IEXPANDDBG	0x00004000L
#define IGETDBG		0x00004000L
#define INCOREDBG	0x00000800L
#define INCR_NDIR_VVDBG	0x00000400L
#define INCR_VVDBG	0x00004000L
#define INSTGMNTDBG	0x00000001L
#define IODBG		0x00000004L		/* ioreq and i/o traps */
#define IODONEDBG	0x00000800L
#define IOMAPDBG	0x08000000L
#define IOMOVEDBG	0x00000010L
#define IOPDBG		0x00000001L
#define IOPENDBG	0x00004000L
#define IOPEN_ULOCKDBG	0x00000080L
#define	IPCDBG		(1L << ('I'-'A'))	/* isn't it more intelligible */
#define ITRUNCDBG	0x00000040L

#define IUCVMAMTB       0x00000001L             /*  For IUCV message driver  */
#define IUCVMCLOSE      0x00000002L             /*            |              */
#define IUCVMGETMSGS    0x00000004L             /*            |              */
#define IUCVMINIT       0x00000008L             /*            |              */
#define IUCVMINTR       0x00000010L             /*            |              */
#define IUCVMIOCTL      0x00000020L             /*            |              */
#define IUCVMOPEN       0x00000040L             /*            |              */
#define IUCVMRCV        0x00000080L             /*            |              */
#define IUCVMREAD       0x00000100L             /*            |              */
#define IUCVMRMFB       0x00000200L             /*            |              */
#define IUCVMSMM        0x00000400L             /*            V              */

#define IUPDATDBG	0x00000040L
#define JRDBG		0x00040000L
#define	KALLOCDBG	(1L << ('K'-'A'))
#define KEXECDBG	0x00000001L
#define LCSDBG		0x00020000L
#define LINKDBG		0x00000400L
#define LNIINITDBG	0x00000008L
#define LOC_QUIETDBG	0x00000001L
#define LPDBG		0x80000000L
#define LSTAT0DBG	0x00000400L
#define MAINDBG		0x00001000L
#define MAKILISTDBG	0x00000001L
#define MALLOCDBG	0x01000000L
#define MCHDBG		0x20000000L
#define MEASDBG		0x00040000L
#define MEMDBG		0x00400000L
#define MESSAGEDBG	0x01000000L
#define MKNODDBG	0x00000400L
#define MKTPMNTDBG	0x00000001L
#define MOUNTDBG	0x00000004L
#define MTDBG		0x80000000L
#define NAMEIDBG	0x00000080L
#define NDCREATDBG	0x00000400L
#define NDLINKDBG	0x00000400L
#define NDLSTAT0DBG	0x00000400L
#define NDMKDIRDBG	0x00000400L
#define NDMKNODDBG	0x00000400L
#define NDOPEN1DBG	0x00000400L
#define NDOPENDBG	0x00000400L

#define NDREADDIR	0x00000400L
#define NDWRITEDIR	0x00000400L
#define NETDBG		0x00002000L
#define NETQUIETDBG	0x00000001L
#define NETSENDDBG	0x00002000L
#define NEWCONFIGDBG	0x00000001L
#define NEWCSSDBG	0x00000001L
#define NEWPROCDBG	0x00000200L
#define NIDBG		0x00002000L
#define NIGETDBG	0x00000020L
#define NMRELSEDBG	0x00002000L
#define NPROCDBG	0x00080000L
#define NTRESUMEDBG	0x00000001L
#define ONEOLDDBG	0x00004000L
#define OPEN1DBG	0x00000400L
#define OPENCVDBG	0x00000400L
#define OPENDBG		0x00000400L
#define OPENIDBG	0x00004000L
#define OPENSTDBG	0x00000400L
#define PAGEOVERDBG	0x00004000L
#define PAGINGDBG	0x00010000L
#define PCCADBG		0x00020000L
#define PHYSTRACDBG     0x00000001L			/* physio flags */
#define PHYSCASEDBG     0x00000002L
#define PHYSLOCKDBG     0x00000004L
#define PIPEDBG		0x00008000L
#define PKDBG		0x80000000L			/*tcapacketdumps*/
#define PLQUEUEDBG	0x00004000L
#define PLREMOVEDBG	0x00004000L
#define PROBEDBG	0x04000000L
#define PROCTRACKDBG	0x00008000L			/*processtrackingdebug`p'*/
#define PROFDBG		0x00800000L
#define PROPDBG		0x02000000L
#define PROPINDBG	0x00004000L
#define RCDDBG		0x00020000L
#define READIDBG	0x00000010L
#define RECOVENDDBG	0x00000001L
#define REQLBNLISTDBG	0x00004000L
#define RESTARTDBG	0x00000001L
#define RLOOPDBG	0x00000040L
#define ROLLBACKDBG	0x00000040L
#define SCHEDDBG	0x00100000L
#define SEEKDBG		0x00000400L
#define SENDPROPDBG	0x00000040L
#define SETPLPRIDBG	0x00004000L
#define SIGDBG		0x00100000L
#define SITEDOWNDBG	0x00000001L
#define SITMSGDBG	0x00000001L
#define SITQUIETDBG	0x00000001L
#define SLEEPDBG	0x00040000L
#define SMLDBG		0x00000100L			/*smallblockstuff*/
#define SNDBG		0x00400000L		/*signetdebugging`s'	*/
#define SOCKETDBG	0x00000001L			/*4.2ipcdebug.*/
#define SS_CLOSEDBG	0x00010000L
#define SS_COMMITDBG	0x00000040L
#define STATDBG		0x00000400L
#define SVCDBG		0x00001000L
#define SVRPROCDBG	0x00000020L
#define	SYS42DBG	0x00000008L
#define SWPDBG		0x10000000L
#define SWTDBG		0x08000000L
#define TCADBG 		0x00001000L		/* tca stuff--very noisy */
#define TCAXDBG		0x10000000L	/* tca extra attentions */
#define TODBG		0x00200000L
#define TOKENDBG	0x00080000L
#define TOPCHGDBG	0x00000001L
#define TP_TIMEDBG	0x00000001L
#define TRANSDBG	0x00e00000L
#define TRAPDBG		0x00000002L
#define TTYDBG		0x00100000L
#define TWOPCDBG	0x00200000L
#define UFALLOCDBG	0x00008000L
#ifdef	romp
#define	UNDBG		0x00200000L
#endif	/* romp */
#define UMOUNTDBG	0x00000004L
#define US_ABORTDBG	0x00000040L
#define US_COMMITDBG	0x00000040L
#define US_POLICYDBG	0x00000020L
#define VMDBG		0x00400000L
#ifdef MERGE386
#define VM86DBG		(1L << ('Q' - 'A'))
#endif /* MERGE386 */
#define	VECDBG		(1L << ('V'-'A'))
#define WAKEUPDBG	0x00040000L
#define WDIRDBG		0x00008000L
#define WRITEIDBG	0x00000010L
#define XALLOCDBG	0x00000200L
#define	XDBG	TCAXDBG		/* temporary */

#ifdef	__UNDEF__		/* This stuff is here as a COMMENT */
				/* This stuff is here as a COMMENT */
				/* This stuff is here as a COMMENT */
				/* This stuff is here as a COMMENT */
				/* This stuff is here as a COMMENT */
#define ADDSITEDBG	0x00000001L
#define CHKSITEDBG	0x00000001L
#define CKDDBG		0x00000001L
#define DIRSTDBG	0x00000001L
#define FBADBG		0x00000001L
#define GETITABDBG	0x00000001L
#define HDDBG		0x00000001L
#define ICLEANUPDBG	0x00000001L
#define ICSSDBG		0x00000001L
#define INSTGMNTDBG	0x00000001L
#define IOPDBG		0x00000001L
#define IUCVMAMTB       0x00000001L
#define KEXECDBG	0x00000001L
#define LOC_QUIETDBG	0x00000001L
#define MAKILISTDBG	0x00000001L
#define MKTPMNTDBG	0x00000001L
#define NETQUIETDBG	0x00000001L
#define NEWCONFIGDBG	0x00000001L
#define NEWCSSDBG	0x00000001L
#define NTRESUMEDBG	0x00000001L
#define RECOVENDDBG	0x00000001L
#define RESTARTDBG	0x00000001L
#define SITEDOWNDBG	0x00000001L
#define SITMSGDBG	0x00000001L
#define SITQUIETDBG	0x00000001L
#define TOPCHGDBG	0x00000001L
#define TP_TIMEDBG	0x00000001L
#define SOCKETDBG	0x00000001L			/*4.2ipcdebug.*/
#define PHYSTRACDBG     0x00000001L
#define IUCVMCLOSE      0x00000002L
#define TRAPDBG		0x00000002L
#define ETHIPDBG	0x00000002L	
#define PHYSCASEDBG     0x00000002L
#define GETMDEVDBG	0x00000004L
#define GMDELETEDBG	0x00000004L
#define GMENTERDBG	0x00000004L
#define IODBG		0x00000004L		/* ioreq and i/o traps */
#define IUCVMGETMSGS    0x00000004L
#define MOUNTDBG	0x00000004L
#define UMOUNTDBG	0x00000004L
#define PHYSLOCKDBG     0x00000004L
#define LNIINITDBG	0x00000008L
#define SYS42DBG	0x00000008L
#define DSPDBG		0x00000008L		/* dynamic svrproc debug `d' */
#define DUSTDBG		0x00000008L	/*dustatdebug.*/
#define IUCVMINIT       0x00000008L
#define ATTACHDBG	0x00000010L
#define IOMOVEDBG	0x00000010L
#define IUCVMINTR       0x00000010L
#define READIDBG	0x00000010L
#define WRITEIDBG	0x00000010L
#define IUCVMIOCTL      0x00000020L
#define NIGETDBG	0x00000020L
#define SVRPROCDBG	0x00000020L
#define US_POLICYDBG	0x00000020L
#define COMMITBITSDBG	0x00000040L
#define CSSPROPDBG	0x00000040L
#define FREELOOPDBG	0x00000040L
#define GROWDBG		0x00000040L
#define ITRUNCDBG	0x00000040L
#define IUCVMOPEN       0x00000040L
#define IUPDATDBG	0x00000040L
#define RLOOPDBG	0x00000040L
#define ROLLBACKDBG	0x00000040L
#define SENDPROPDBG	0x00000040L
#define SS_COMMITDBG	0x00000040L
#define US_ABORTDBG	0x00000040L
#define US_COMMITDBG	0x00000040L
#define GETCOMPDBG	0x00000080L
#define IOPEN_ULOCKDBG	0x00000080L
#define IUCVMRCV        0x00000080L
#define NAMEIDBG	0x00000080L
#define BMAPDBG		0x00000100L
#define IUCVMREAD       0x00000100L
#define SMLDBG		0x00000100L			/*smallblockstuff*/
#define ADRCHKSDBG	0x00000200L
#define DORTIDBG	0x00000200L
#define EXECDBG		0x00000200L
#define GETXFILEDBG	0x00000200L
#define IUCVMRMFB       0x00000200L
#define NEWPROCDBG	0x00000200L
#define XALLOCDBG	0x00000200L
#define ACCESS0DBG	0x00000400L
#define CHECK_SLDBG	0x00000400L
#define CLOSEDBG	0x00000400L
#define CREATDBG	0x00000400L
#define DIRMODDBG	0x00000400L
#define INCR_NDIR_VVDBG	0x00000400L
#define IUCVMSMM        0x00000400L
#define LINKDBG		0x00000400L
#define LSTAT0DBG	0x00000400L
#define MKNODDBG	0x00000400L
#define NDCREATDBG	0x00000400L
#define NDLINKDBG	0x00000400L
#define NDLSTAT0DBG	0x00000400L
#define NDMKDIRDBG	0x00000400L
#define NDMKNODDBG	0x00000400L
#define NDOPEN1DBG	0x00000400L
#define NDOPENDBG	0x00000400L
#define NDREADDIR	0x00000400L
#define NDWRITEDIR	0x00000400L
#define OPEN1DBG	0x00000400L
#define OPENCVDBG	0x00000400L
#define OPENDBG		0x00000400L
#define OPENSTDBG	0x00000400L
#define SEEKDBG		0x00000400L
#define STATDBG		0x00000400L
#define BAWRITEDBG	0x00000800L
#define BDWRITEDBG	0x00000800L
#define BFLUSHDBG	0x00000800L
#define BHASHDBG	0x00000800L
#define BLREADADBG	0x00000800L
#define BLREADDBG	0x00000800L
#define BREADDBG	0x00000800L
#define BRELSEDBG	0x00000800L
#define BWRITEDBG	0x00000800L
#define CLRBUFDBG	0x00000800L
#define GETBLKDBG	0x00000800L
#define GETEBLKDBG	0x00000800L
#define GETNBLKDBG	0x00000800L
#define GETNMSGDBG	0x00000800L
#define INCOREDBG	0x00000800L
#define IODONEDBG	0x00000800L
#define MAINDBG		0x00001000L
#define SVCDBG		0x00001000L
#define TCADBG 		0x00001000L
#define CETIDBG		0x00002000L
#define ETHDBG		0x00002000L
#define NETDBG		0x00002000L
#define NETSENDDBG	0x00002000L
#define NIDBG		0x00002000L
#define NMRELSEDBG	0x00002000L
#define CSS_LOCKDBG	0x00004000L
#define FINDSSDBG	0x00004000L
#define IEXPANDDBG	0x00004000L
#define IGETDBG		0x00004000L
#define INCR_VVDBG	0x00004000L
#define IOPENDBG	0x00004000L
#define ONEOLDDBG	0x00004000L
#define OPENIDBG	0x00004000L
#define PAGEOVERDBG	0x00004000L
#define PLQUEUEDBG	0x00004000L
#define PLREMOVEDBG	0x00004000L
#define PROPINDBG	0x00004000L
#define REQLBNLISTDBG	0x00004000L
#define SETPLPRIDBG	0x00004000L
#define CLOSEFDBG	0x00008000L
#define PIPEDBG		0x00008000L
#define UFALLOCDBG	0x00008000L
#define WDIRDBG		0x00008000L
#define PROCTRACKDBG	0x00008000L		/*processtrackingdebug`p'*/
#define ICLOSEDBG	0x00010000L
#define SS_CLOSEDBG	0x00010000L
#define PAGINGDBG	0x00010000L
#define FEPDBG		0x00020000L
#define LCSDBG		0x00020000L
#define PCCADBG		0x00020000L
#define RCDDBG		0x00020000L
#define DUMPDBG		0x00040000L
#define HETDBG		0x00040000L
#define JRDBG		0x00040000L
#define MEASDBG		0x00040000L
#define SLEEPDBG	0x00040000L
#define WAKEUPDBG	0x00040000L
#define FLPDBG		0x00080000L
#define NPROCDBG	0x00080000L
#define TOKENDBG	0x00080000L
#define SCHEDDBG	0x00100000L
#define SIGDBG		0x00100000L
#define TTYDBG		0x00100000L
#define CLKDBG		0x00200000L
#define TODBG		0x00200000L
#define TWOPCDBG	0x00200000L
#ifdef	romp
#define	UNDBG		0x00200000L
#endif	/* romp */
#define MEMDBG		0x00400000L
#define VMDBG		0x00400000L
#define SNDBG		0x00400000L		/*signetdebugging`s'	*/
#ifdef	romp
#define CONFDBG		0x00800000L
#endif	/* romp */
#define PROFDBG		0x00800000L
#define TRANSDBG	0x00e00000L
#define CLOCKDBG	0x01000000L
#define CMITDBG		0x01000000L
#define MALLOCDBG	0x01000000L
#define MESSAGEDBG	0x01000000L
#define GETLBNLISTDBG	0x02000000L
#define PROPDBG		0x02000000L
#define DSORTDBG	0x04000000L
#define PROBEDBG	0x04000000L
#define IOMAPDBG	0x08000000L
#define SWTDBG		0x08000000L
#define SWPDBG		0x10000000L
#define TCAXDBG		0x10000000L
#define MCHDBG		0x20000000L
#define ALLOCDBG	0x40000000L
#define	FORKDBG		0x40000000L
#define FREEDBG		0x40000000L
#define BLKIODBG	0x80000000L		/* b370 bulk i/o disks */
#define PKDBG		0x80000000L			/*tcapacketdumps*/
#define CPDBG		0x80000000L
#define LPDBG		0x80000000L
#define MTDBG		0x80000000L
#define ANYDBG		0xffffffffL
#define CALLDBG		0xffffffffL
				/* END OF COMMENT */
				/* END OF COMMENT */
				/* END OF COMMENT */
				/* END OF COMMENT */
				/* END OF COMMENT */
#endif	/* __UNDEF__ */

#ifdef RESSUP				/* Changed by Rozen */
#define CTCDBG  	0x2000L		/* channel to channel on 370 */
#define CTCDBGIO 	0x8000000L	/* very noisy - several for each */
#define ASIODBG		0x1000L		/* asio stuff */
#endif /* RESSUP */


#else /* ~DEBUGVAR */
#ifdef DEBUG

#define debug(x,y)	printf y
#define	debugcall(x,y)	y
#define DONOTHING

#else /* ~DEBUG */
/*
 * this file will eventually include the stuff to get debugs
 * but for now it will be empty.
 */
#define debug(x,y)
#define	debugcall(x,y)
#define DONOTHING

#endif /* ~DEBUG */
#endif /* ~DEBUGVAR */

#endif /* ~_DEBUGFLAG_ */
AkêÜn •  $        n  7‰*V™ˆ*7‰*     ÿRn  	                  ./usr/include/sys/decay.h g.h re
/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */

H_SCCSID(@(#)decay.h	16.4	LCC)	/* Modified: 17:25:56 9/16/89 */

#ifndef _h_DECAY
#define _h_DECAY

#ifndef NOFLOATINGPOINT

/* convert a float to a decimal integer */
#define	MAKEDEC(x)	(((x) * 100.0) + 0.5)

#else	/* NOFLOATINGPOINT */

/* convert a "float" to a decimal integer with two places of precision */
#define	NBSH	(sizeof(short) * NBBY)
#define	MAKEDEC(x)	(((x) * 100) >> NBSH)

#endif	/* NOFLOATINGPOINT */

#define DECAY(val, count, rate, base) (((count) / (base) + ((rate) - 1) * (val)) / (rate))

#ifdef RESSUP
/*
 * trick: avenrun has to be "double" as seen by applications, even though
 * all kernel calculations are done in integer.  Loadav.c takes care of
 * making the double precision value appear in avenrun as needed.
 */
extern double	avenrun[];
#else /* !RESSUP */
extern loadav_t	avenrun[];
#endif /* !RESSUP */

#endif /* ~_h_DECAY */
00kê< ”  $          7‰*©™ˆ*7‰*     õR  	              è¼  ./usr/include/sys/devinfo.h h re/*
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1987, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */


#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)devinfo.h	16.6.2.2 AIX)	/* Modified: 14:08:54 10/28/91 */

/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef	_h_DEVINFO
#define	_h_DEVINFO

#ifndef	IFNAMSIZ
#define	IFNAMSIZ	16
#endif

#ifndef	IFF_UP
#define	IFF_UP		0x1		/* interface is up */
#endif

#ifndef	IFF_RUNNING
#define	IFF_RUNNING	0x40		/* resources allocated */
#endif

#ifndef	IFF_PRIMARY
#define	IFF_PRIMARY	0x80
#endif

#ifndef	MAXIFS
#define	MAXIFS		8
#endif

/*
 * Device information
 */
struct devinfo
{       char    devtype;
	char    flags;
	union
	{   struct      /* for disks */
	    {   short   bytpsec;        /* bytes per sector */
		short   secptrk;        /* sectors per track */
		short   trkpcyl;        /* tracks per cylinder */
		long    numblks;        /* blocks this partition */
	    } dk;
	    struct      /* for memory mapped displays */
	    {   char    capab;          /* capabilities */
		char    mode;           /* current mode */
		short   hres;           /* horizontal resolution */
		short   vres;           /* vertical resolution */
	    } tt;
	    struct      /* for ethernet interfaces */
	    {   unsigned short capab;   /* capabilities */
		char           haddr[6];/* hardware address */
	    } en;
	    struct	/* for block i/o device */
	    {
	      struct
	       {
		char	type;		/* hardware type: ethernet or
						token ring */
		char    if_flags;	/* up/down:  1=ATTACHED
						     2=RUNNING
						     3=PRIMARY INTERFACE */
		char	haddr[6];	/* hardware address: ethernet or
						token ring */
		long	mymach;		/* local IP adress */
		long	subnet_mask;	/* subnet mask */
		int 	mtu;		/* maximum transmission unit */
		char	if_name[IFNAMSIZ]; /* name of interface		*/
	       } lan[MAXIFS];
            } bio;  
	    struct	/* for magnetic tapes */
	    {	short	type;		/* what flavor of tape */
					/* defined below */
	    } mt;
	    struct	/* for mous */
	    {   short	m_xres;		/* best x resolution (points/cm) */
		short	m_yres;		/* best y resolution (points/cm) */
		short	pad;		/* make it for both 286 & 386 procs */
	    } mo;
	} un;
};

/* device types */
#define DD_LP	'l'     /* line printer */
#define DD_PUN	'p'     /* card punch */
#define DD_RDR	'r'     /* card reader */
#define DD_TAPE	'M'     /* mag tape */
#define DD_TTY	'T'     /* terminal */
#define DD_DISK	'R'     /* disk */
#define DD_RTC	'c'     /* real-time (calendar) clock */
#define DD_PSEU	'Z'     /* pseudo-device */
#define DD_NET	'N'     /* networks */
#define DD_EN	'E'     /* Ethernet interface */
#define DD_EM78	'e'    /* 3278/79 emulator */
#define DD_TR	't'	/* token ring */
#define DD_BIO	'B'	/* block i/o device */
#define	DD_MOUS 'm'	/* mous */
#define DD_OSM	'o'	/* osm - operating system messages log */
#define DD_VM	'C'	/* virtual machine command interface */
#define DD_MEM	'k'	/* interface to kernel memory */
#define	DD_CDROM 'd'	/* CD-ROM device */
#define	DD_RWOPT 'w'	/* RW-OPT device */
#define DD_X25	'x'	/* X25 device */
 
/* Type of tape drive */
#define	DT_STREAM	1	/* Streaming tape drive */
#define	DT_STRTSTP	2	/* Start-stop tape drive */
 
/* flags */
#define DF_FIXED 01     /* non-removable */
#define DF_RAND  02     /* random access possible */
#define DF_FAST  04
#ifdef u370
	/* flags used to distinguish among different types of disks */
#define DF_FBA  0x80	/* fixed-block-architecture disk (3310/3370) */
#define DF_CKD	0x40	/* count-key-data disk (3330/3350/3375/3380) */
#define DF_BLKIO 0xc0	/* bulk-i/o disk */

#define DF_MASK	0xc0	/* mask for disk type */
#endif /* u370 */
#ifdef i386
	/* flags used to distinguish between ESDI and ST506 drives */
#define DF_ESDI		0x20	/* enhanced small device interface */
#define	DF_ST506 	0x10	/* Seagate Technology 506 interface */
#define	DF_SCSI		0x40	/* SCSI volume */
#define DF_I386_MASK	0x70	/* mask for disk type */
#endif /* i386 */

#endif	/* ! _h_DEVINFO */
*	LIkê”F “  $          7‰*Z™ˆ*7‰*     K$  	              ¡  ./usr/include/sys/dir.h /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef _POSIX_SOURCE
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)dir.h	16.10       LCC)    /* Modified: 21:31:19 10/25/90 */
#endif /* NOT _POSIX_SOURCE */

#ifndef _H_DIR
#define _H_DIR

#include <sys/types.h>

#include <limits.h>


/* The official way to look at directories is through the POSIX dirent
 * structure.  The directory access routine readdir() returns a pointer
 * to this type of structure.
 */

/* NAME_MAX is the maximum length of a directory entry.
 * PATH_MAX is the maximum length of an entire path name.
 * These constants are defined in <limits.h>, and neither length includes
 * the terminating null character in the string.
 * Note that the constant MAXPATHLEN in <sys/param.h> does include the
 * terminating null character.
 */ 

#ifndef _POSIX_SOURCE

#define MAXNAMLEN NAME_MAX
#define MAXDIRLEN NAME_MAX

#endif /* NOT _POSIX_SOURCE */


struct	dirent {
	ino_t     d_ino;		/* inode number of file to which
					   this entry points */
	u_short_t d_reclen;		/* offset to next dir entry or
					   offset past end of file */
	u_short_t d_namlen;		/* length of the name field */
	char      d_name[NAME_MAX + 1];	/* Null-terminated file name */
	/* typically shorter */
};


#ifndef _POSIX_SOURCE

/*
 * The NDIRSIZ macro gives the minimum record length which will hold
 * the directory entry.  This requires the amount of space in struct direct
 * without the d_name field, plus enough space for the name with a terminating
 * null byte (dp->d_namlen+1), rounded up to a 16 byte boundary.
 */
#define NDIRSIZ(dp) \
    (((sizeof(struct dirent) - (NAME_MAX+1)) + ((dp)->d_namlen+1 + 15)) &~ 15)


#ifdef _BSD
/* BSD applications expect readdir() to return a pointer to struct direct
 * and to use the macro DIRSIZ to determine the size of an entry */

#define direct dirent
#undef  DIRSIZ
#define DIRSIZ(dp) NDIRSIZ(dp)

#else /* ! BSD */
/* Kernel and other apps expect sys V struct direct for compatibility */

#undef   DIRSIZ
#define  DIRSIZ  14
struct	direct
{
	s_ino_t	d_ino;
	char	d_name[DIRSIZ];
};

/* directory cache requires long inodes - P19447 */
struct	dc_direct
{
	ino_t	d_ino;
	char	d_name[DIRSIZ];
};

#endif /* ! BSD */

/*
 * useful macros.
 */
/* NEXTDIRENT points at the entry following the current one.
 * NOTE: this macro should not be trusted without checking that d_reclen
 *	 is valid (i.e. non NULL, within reason ...)
 */
#define	NEXTDIRENT(dirp) (struct dirent *)((caddr_t)(dirp)+(dirp)->d_reclen)

/* NEEDROOM gives the record length needed for a name of the given length */
/* The length passed should be the string length of the name, not including */
/* the trailing null; for instance obtained from dirp->d_namlen. */
#define NEEDROOM(length) \
	roundup((int)(((struct dirent *)0)->d_name) + (length) + 1, 16)

/* SPACEUSED gives the amount of space actually used in a dir entry */
#define SPACEUSED(dirp) NEEDROOM((dirp)->d_namlen)

/* EMPTYSPACE gives the amount of empty space in a dir entry */
#define EMPTYSPACE(dirp) ((dirp)->d_reclen - SPACEUSED(dirp))

/* Old definitions -- kept around for 'temporary' compatibility */
#define ldirect		dirent
#define ld_ino		d_ino
#define ld_reclen	d_reclen
#define ld_namlen	d_namlen
#define ld_name		d_name

/*
 * Maximum length of a single symbolic link
 */
#define MAXSYMLKLEN 256

#endif /* NOT _POSIX_SOURCE */

#ifndef	NULL
#define NULL	0
#endif /* ~NULL */

#ifndef _POSIX_SOURCE
#define DIRBLKSIZ _DIRBLKSIZ
#define DIRBLKMSK (DIRBLKSIZ - 1)
#endif /* NOT _POSIX_SOURCE */

#define	_DIRBLKSIZ	1024

#ifndef  _KERNEL

/*
 * Directory access routine declarations; originally in xdir.h
 */

/*
 * Definitions for library routines operating on directories.
 */

typedef struct _dirdesc {
	int	dd_fd;
	long	dd_loc;
	long	dd_size;
	bool_t	dd_typef;
	struct  dirent dd_dir;
	char	dd_buf[_DIRBLKSIZ];
	int	dd_entno ;
	int	dd_bbase ;
} DIR;

extern	DIR *opendir();
extern	struct dirent *readdir();
extern	int closedir();
extern	void rewinddir();	/* Gil Beyda@IBM: removed macro & added func */

#ifndef _POSIX_SOURCE
extern	void seekdir();
extern	long telldir();
/* Old definition -- kept around for 'temporary' compatibility */
#define dd_ldir		dd_dir
#endif  /* NOT _POSIX_SOURCE */

#endif	/* NOT _KERNEL */

#endif  /* NOT _H_DIR */
IX_SOURkêX ‘  $        >
  8‰*Z™ˆ*8‰*     r^>
  	                  ./usr/include/sys/dirstat.h h re/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)dirstat.h	16.4	LCC)	/* Modified: 18:07:47 9/22/89 */

#ifndef _h_DIRSTAT
#define _h_DIRSTAT

#ifndef _h_STAT
#ifdef  KERNEL
#include <stat.h>
#else  /* ~KERNEL */
#include <sys/stat.h>
#endif /* ~KERNEL */
#endif  /* ! _h_STAT */

/*
 * This structure is transmitted through netmsg's;  it doesn't use
 * the PADOPEN, PADCLOSE macros because it is user-visible.  If it
 * changes, dirstat_flp() must be updated.
 */
struct  dirstat
{
/* Lengths come first, so that we can extend the structure later without
 * recompiling user programs.  See the access macros below.  */
	short	dir_nam_len;	/* Length of name. */
	short	dir_rec_len;	/* length of record. */
	struct  stat  dir_stat;

/* If we could not stat this inode for any reason, dir_ss will be -1
 * and we use st_css to hold the errno.  Only st_ino, 
 * dir_name_len, and dir_rec_len fields are valid in this case, all others 
 * are undefined.
 */
#define st_errno		st_css
};

/* dirstat -- stat multiple entries in a directory
 * int retcode = dirstat(fd, loc, length);
 *     int fd; 			/* file descriptor for open dir
 *     struct dirstat *loc;	/* buffer to be filled in
 *     int length;		/* size of buffer
 */

extern int dirstat();

/* 
 * Actual number of bytes needed for this particular entry.   The name
 * field is padded up to a 4-byte boundary, as in the 4.3 directory 
 * structure. 
 */
#define DIRST_SIZ(dirp) \
    (((dirp)->dir_rec_len + (dirp)->dir_nam_len + 3) & ~3)

/*
 * This is the ONLY proper way to advance through a list of dirstat
 * structures.  The structure may have more fields added (to the end)
 * at some future date, at which point the dir_rec_len field will be
 * returned with a new value.  This will allow old programs to continue
 * working without needing to be recompiled.
 */
#define DIRST_ADV(dirp) \
	((struct dirstat *)((char *)(dirp) + DIRST_SIZ(dirp)))
/* Fix the name, and change not to do the assignment */

#ifdef KERNEL
/* Avoid a needless pointer reference. */
#define DIRST_NAME(dirp) ((char *)((char *)dirp + sizeof(struct dirstat)))
#else
#define DIRST_NAME(dirp) ((char *)((char *)dirp + dirp->dir_rec_len))
#endif /* ! KERNEL */

/* Room needed for dirstat struct with name of length 'len' */
#ifdef KERNEL
#define DIRST_ROOM(len)  ((sizeof(struct dirstat) + (len) + 3) & ~3)
#endif /* KERNEL */
#endif  /* ! _h_DIRSTAT */
nekêæ   $          8‰*Z™ˆ*8‰*     «V  	                  ./usr/include/sys/dk.h a/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)dk.h	16.4	LCC)	/* Modified: 18:08:21 9/22/89 */
/* SCCSIDPUFF(@(#) dk.h 4.1 LM 12:34:25 4/23/85 C 21:59:54 4/23/85); */

/*
 * Instrumentation
 */
#define	CPUSTATES	4

#define	CP_USER		0
#define	CP_NICE		1
#define	CP_SYS		2
#define	CP_IDLE		3

#define	DK_NDRIVE	4

#ifdef  KERNEL
float	dk_mspw[DK_NDRIVE];
long	cp_time[CPUSTATES];
int	dk_busy;
long	dk_time[DK_NDRIVE];
long	dk_seek[DK_NDRIVE];
long	dk_xfer[DK_NDRIVE];
long	dk_wds[DK_NDRIVE];

long	tk_nin;
long	tk_nout;
#endif  KERNEL
cture lkê`   $        J	  8‰*S–ˆ*8‰*     (²J	  	                  ./usr/include/sys/dmap.h .h h re/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)dmap.h	16.3	LCC)	/* Modified: 20:01:28 9/15/89 */

#if	defined(PAGING) || defined(SWAPPING)

/*
 * Definitions for the mapping of vitual swap
 * space to the physical swap area - the disk map.
 */

/*
*
*	NDMAP + 1 = (log2(DMMAX) - log2(DMMIN) )
*	NDADX >= (MAXTSIZ/DMTEXT) (for vax)
*/

#if   defined(b370)
#ifdef XA370
#define        NDMAP           30      /* size of the swap area map XA machs */
#else /* ~XA370 */
#define        NDMAP           16      /* size of the swap area map 370 mach */
#endif /* ~XA370 */
#else /* ~b370 */
#define NDMAP           24      /* size of the swap area map */
#endif /* b370 */

#if	defined(vax)
#define	DMMIN 		32	/* the initial block size in disk pages */
#define DMMINLOG2	5	/* log base 2 of DMMIN */
#define	DMMAX		1024	/* max block size alloc on drum = .5M byte */
#define DMMAXLOG2	10	/* log base 2 of DMMAX */
#define	DMTEXT		1024	/* size of blocks of pure text = .5M byte */
#endif	/* vax */

#if    defined(b370)
#ifdef XA370
#define	DMMIN 		32	/* the initial block size in disk pages */
#define DMMINLOG2	5	/* log base 2 of DMMIN */
#define	DMMAX		8192	/* max block size alloc on drum = 32M byte */
#define DMMAXLOG2	13	/* log base 2 of DMMAX */
#define	DMTEXT		4096	/* size of blocks of pure text = 32M byte */
#else /* ~XA370 */
#define	DMMIN 		8	/* the initial block size in disk pages */
#define DMMINLOG2	3	/* log base 2 of DMMIN */
#define	DMMAX		1024	/* max block size alloc on disk = 4M (b370)*/
#define DMMAXLOG2	10	/* log base 2 of DMMAX */
#define	DMTEXT		1024	/* max block size alloc on disk = 4M (b370)*/
#endif /* ~XA370 */
#endif	/* b370 */

struct	dmap
{
	swblk_t	dm_size;	/* current size used by process */
	swblk_t	dm_alloc;	/* amount of physical swap space allocated */
	swblk_t	dm_map[NDMAP];	/* first disk block number in each chunk */
};
#ifdef KERNEL
extern  struct	dmap zdmap;
#endif

/*
 * The following structure is that ``returned''
 * from a call to vstodb().
 */
struct	dblock
{
	swblk_t	db_base;	/* base of physical contig drum block */
	swblk_t	db_size;	/* size of block */
};

#endif  /* (PAGING || SWAPPING) */
)dirp kêbÃ Ê  $        #  \‰*6–ˆ*\‰*     d#  	                  ./usr/include/sys/domain.h  h re/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)domain.h	16.4	LCC)	/* Modified: 19:45:35 9/15/89 */

/*
 * Copyright (c) 1982, 1986 Regents of the University of California.
 * All rights reserved.  The Berkeley software License Agreement
 * specifies the terms and conditions for redistribution.
 *
 *	@(#)domain.h	7.1 (Berkeley) 6/4/86
 */

#ifndef _DOMAIN_
#define _DOMAIN_
/*
 * Structure per communications domain.
 */
struct	domain {
	int	dom_family;		/* AF_xxx */
	char	*dom_name;
	int	(*dom_init)();		/* initialize domain data structures */
	int	(*dom_externalize)();	/* externalize access rights */
	int	(*dom_dispose)();	/* dispose of internalized rights */
	struct	protosw *dom_protosw, *dom_protoswNPROTOSW;
	struct	domain *dom_next;
};

#ifdef KERNEL
extern struct domain *domains;
#endif
#endif	/* _DOMAIN_ */
k sizkêÞè ‰  $        ¶  9‰*[™ˆ*9‰*     pµ¶  	                  ./usr/include/sys/dsnode.h  h re
H_SCCSID(@(#)dsnode.h	16.3	LCC)	/* Modified: 17:31:22 9/16/89 */
/* @(#)dsnode.h	7.1 87/06/15 23:46:18 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _h_DSNODE
#define _h_DSNODE
#include <sys/types.h>
#include <sys/param.h>

struct dsncb {
        unsigned long nid;
        int ncb_size;
	union {
		struct dsxlate *dtable;
		struct NLctab  *ctable;
		char  *gtable;
	} u_tbl;
};
 
/*
 *      The node table will contain pointers to the dsncb
 */
 
extern struct dsncb dsncb[];
extern struct dsncb dsocb[];
extern struct dsncb dswcb[];
extern struct dsncb dsipc[];

/*
 *      The node table will contain pointers to the dsncb
 */
 
struct node
{       unsigned long n_nid;
        int n_sna_ccb;
        int n_cuse_count;		/* Client use count		*/
        int n_ssuse_count;		/* Server special use count	*/
        int n_sruse_count;		/* Server regular use count	*/
        int n_cid;
        time_t n_timestamp;
        struct dsncb *n_dsncb;
        short n_lock;
        short n_want;
	ulong n_state;			/* Connection state		*/
	ulong n_srvrid;			/* Saved server id		*/
	ulong n_unqid;			/* Unique id for this on this node */
};
 
extern struct node node[];
extern ds_debug, ds_debug1; 
 
#define N_LOCK  0x1

/* Zero node struct     */
#define ZNODE(np)               \
        (((struct node *)(np))->n_nid = 0);\
        (((struct node *)(np))->n_sna_ccb = 0);\
        (((struct node *)(np))->n_cuse_count = 0);\
        (((struct node *)(np))->n_ssuse_count = 0);\
        (((struct node *)(np))->n_sruse_count = 0);\
        (((struct node *)(np))->n_cid = 0);\
        (((struct node *)(np))->n_timestamp = 0);\
        (((struct node *)(np))->n_dsncb = (struct dsncb *)0);\
        (((struct node *)(np))->n_lock = 0);\
        (((struct node *)(np))->n_srvrid = 0);\
        (((struct node *)(np))->n_want = 0)

/*
 * Macro to check critcal values
 */
#define DSASSERT(tst)   \
        if(!(tst))panic("DSASSERT(tst)")
/*
 * Macro to increment the node structure sequence number
 */
#define	dsseqinc(np)	(++((struct node *)np)->n_seq_cnt)

/* Macros to increment and decrement the node.use_count fields
 */

/* Client count increment
 */
#define dsinc_cuse(x)    (++((struct node *)x)->n_cuse_count)
#define dsdec_cuse(x)    (--((struct node *)x)->n_cuse_count)

/* TEMPORARY KLUDGE until conform.
 */
#define dsinc_use(x)    (++((struct node *)x)->n_ssuse_count)
#define dsdec_use(x)    (--((struct node *)x)->n_ssuse_count)

/* Server special count increment
 */
#define dsinc_ssuse(x)    (++((struct node *)x)->n_ssuse_count)
#define dsdec_ssuse(x)    if(!(--((struct node *)x)->n_ssuse_count) && \
				(x)->n_state==S_CLND_WS) (x)->n_state = S_CLND;

/* Server regular count increment
 */
#define dsinc_sruse(x)    (++((struct node *)x)->n_sruse_count)
#define dsdec_sruse(x)    (--((struct node *)x)->n_sruse_count)

/* ID defines for the n_*id fields
 */
#define	ID_ESTCON	-1
#define	ID_NOCON	0

/* State defines for n_state field
 */

#define S_AVAIL		0x0
#define S_GOOD		0x1
#define S_KNBAD		0x2
#define	S_BCLND		0x4
#define	S_CLND		0x8
#define	S_BUSY		0x10
#define	S_CLND_WS	0x20

#define S_MASK		(S_GOOD|S_KNBAD|S_BCLND|S_CLND|S_AVAIL|S_BUSY|S_CLND_WS)

#endif
dikêÜ! Š  $        ¯  9‰*\™ˆ*9‰*     tµ¯  	              uµ  ./usr/include/sys/dsrpc.h   h re
H_SCCSID(@(#)dsrpc.h	16.3	LCC)	/* Modified: 17:32:09 9/16/89 */
/* @(#)dsrpc.h	7.2 87/10/23 11:17:44 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _h_DSRPC
#define _h_DSRPC

#include <sys/types.h>
#include <sys/dsnode.h>
/*
 *      The structure passed to dsrpc for simulation of a remote
 *      procedure call.  The length field should be correct when passed
 *      in.  The rpc_id should be the index into the dsrprocs array for
 *      the remote procedure to be called.  The xlate structure will be
 *      filled in by the dsrpc routine.  Your data should start at msg.
 *      The routine specified by rpc_id will be called with the pointer
 *      to the dsrmsg as the only parameter.
 */
 
#define MAXCONGRPS 16    /* maximum number of concurrent groups */

struct xlate {
        long uid;
        long gid;
        long euid;
        long egid;
        int numcongrps;
        long congrp[MAXCONGRPS];
};
struct dsrmsg_s {
	unsigned short seq_cnt_save;	/* save for later comparison */
	short unused;
        char *ds_send_data; 		/* address of data to send */
	struct node *ds_savenp;		/* save the connection info */
        char ds_control[32];		/* network control info */

/* everything past this point is sent on the wire as the user header */

        unsigned short ds_seq_cnt;	/* numbering the rpc's */
        unsigned char ds_errno;		/* returned u.u_error */
        unsigned char ds_rpc_flags;	/* translate flags */
        int ds_rpc_id;			/* transaction routine id */
        unsigned int ds_send_len;	/* length of data to send */
        unsigned int ds_uctl_len;	/* length of user control area */
        unsigned int ds_xlate_len;	/* length of uid/gid translate area */
	unsigned int ds_srvrid;		/* Return server id check number    */
	unsigned int ds_request;	/* Return server id check request    */
	pid_t ds_pid;			/* pid of client process */
        union {				/* contains the connection pointer
					   on the server, the nid on wire */
                struct node *ds_node_ptr;
                unsigned long ds_nid;
        } ds_node;
};
 
struct dsrmsg {
	unsigned short seq_cnt_save;	/* save for later comparison */
	short unused;
        char *ds_send_data; 		/* address of data to send */
	struct node *ds_savenp;		/* save the connection info */
        char ds_control[32];		/* network control info */

/* everything past this point is sent on the wire as the user header */

        unsigned short ds_seq_cnt;	/* numbering the rpc's */
        unsigned char ds_errno;		/* returned u.u_error */
        unsigned char ds_rpc_flags;	/* translate flags */
        int ds_rpc_id;			/* transaction routine id */
        unsigned int ds_send_len;	/* length of data to send */
        unsigned int ds_uctl_len;	/* length of user control area */
        unsigned int ds_xlate_len;	/* length of uid/gid translate area */
	unsigned int ds_srvrid;		/* Return server id check number    */
	unsigned int ds_request;	/* Return server id check request    */
	pid_t ds_pid;			/* pid of client process */
        union {				/* contains the connection pointer
					   on the server, the nid on wire */
                struct node *ds_node_ptr;
                unsigned long ds_nid;
        } ds_node;
	char ds_user_ctl[200];		/* reserved, fixed length area for
					   control information. The data is
					   accessed directly. */
        struct xlate ds_xlate; 		/* uid/gid translate info */
};

/* Structure to contain /etc/master's id translation definitions */

struct netdefs
{
	unsigned long	netsomeone;
	unsigned long	netnoone;
};

extern struct netdefs netdefs;

/* Defines for d_bflag below.  Describes how a dfs routine reacts
 * to in/out-bound blocking
 */
#define	D_RFLAG		0x1			/* Block receive	*/
#define	D_SFLAG		0x2			/* Block send		*/

/* Structure for dfs operations control	
 */

struct ds_rpctl
{	int 	(*d_func)();			/* DFS operation	*/
	int 	(*d_cfunc)();			/* DFS cleanup function	*/
	ushort	d_bflag;			/* Block flags		*/
	ushort	d_perm;				/* Id permissions mode	*/
};

extern struct ds_rpctl ds_rpctl[];

/* The number of routines in the DSrprocs array. */
 
#define NUMRPC          0x22

/* Permission defines
 */
#define RQ_CHKID	0x00000001	/* Check id for this connection	*/
#define RQ_RTNID	0x00000002	/* Return id for this connection*/
#define RQ_HOLD		0x00000004	/* Hold this connection		*/
#define	RQ_IGNOR	0x00000008	/* Ignore translate errors	*/

#define RQ_MASK		(RQ_CHKID|RQ_RTNID)
 
/* Possible ds_srvrid values
 */
#define	ID_DEFUNCT	-1

/*      The indexes of the routines in the dsrprocs array */
 
#define DFS_NULL        0x0
#define	DFS_MOUNT	0x1
#define	DFS_LOOKUP	0x2
#define	DFS_OPEN	0x3
#define	DFS_CLOSE	0x4
#define	DFS_CREATE	0x5
#define	DFS_READ	0x6
#define	DFS_WRITE	0x7
#define	DFS_CHSYNC	0x8
#define	DFS_MNTCTL	0x9
#define	DFS_MSGGET	0xa
#define	DFS_MSGSND	0xb
#define	DFS_MSGRCV	0xc
#define	DFS_MSGCTL	0xd
#define	DFS_LINK	0xe
#define	DFS_REMOVE	0xf
#define	DFS_GETATTR	0x10
#define	DFS_ACCESS	0x11
#define	DFS_SETATTR	0x12
#define	DFS_STATFS	0x13
#define DFS_MKDIR	0x14
#define DFS_RMDIR	0x15
#define DFS_RENAME	0x16
#define READA_CLT       0x17
#define RBSYNC_CLT      0x18
#define DFS_ADVISE	0x19
#define DFS_MKNOD       0x1a
#define DFS_FLOCK	0x1b
#define DFS_LOADTBL	0x1c
#define	DFS_FCLEAR	0x1d
#define DFS_FSYNC	0x1e
#define	DFS_FTRUNC	0x1f
#define	DFS_FLUSH	0x20	
#define DFS_KCLNUP	0x21

/*
 * defines for trace hook id limits (NOT to be
 * counted in NUMRPC calculations).
 */
#define DFS_BASE	525
#define	DFS_TOP		599

extern (*dsrprocs[])();
 
/*      Defines for uid/gid xlateflag on dsrpc() */
/*	If on, don't do it, if off, do it */

#define XLATE_OFF	0x3f
#define XLATE_ON        1
#define XLATE_RUID      2
#define XLATE_RGID      4
#define XLATE_EUID      8
#define XLATE_EGID      16
#define XLATE_CGRP      32
#define MAXRETRIES 	2
#define RETRYTIME	60

/* Error definitions
 */
#define DSERR1	((struct node *)-1)
#define DSERR2	((struct node *)-2)
#define DSERR3	(-3)
#define DSERR4	(-4)

#endif
ckêvŸ ‹  $        Ë  8‰*\™ˆ*8‰*     }rË  	              —X  ./usr/include/sys/dstables.h  re
H_SCCSID(@(#)dstables.h	16.3	LCC)	/* Modified: 17:32:57 9/16/89 */
/* @(#)dstables.h	7.1 87/06/15 @(#)dstables.h	7.1 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
#ifndef _h_dstables
#define _h_dstables

struct ltable{
   char type;            /* Defines the type of table being managed. */
                         /* For first release of DFS the type must   */
                         /* be:                                      */
                         /*   DSNCB (Node Control Block)             */
                         /*   DSOCB (Outbound Control Block)         */
                         /*   DSWCB (Wildcard Control Block)         */
                         /*   DSIPC (IPC key table entries)          */
			 /*   USERTBL (NLS user tables)              */
 
   long id;              /* Identifies which table entry is being    */
			 /* loaded.  For DSNCB this is the nid, for  */
			 /* USERTBL it is the id, and for the others */
			 /* it is null.                              */
 
   char mode;            /* Mutually exclusive values defined below. */

   long nid;             /* The nid whose tables are to be queried.  */
 
   long reserved[4]; /* Reserved - contentents are zero.   */
};
 
extern struct ltable ltable;

/*  defines for dsgetid                                              */

#define UID  0
#define GID  1
#define WILDUID  0x01
#define WILDGID  0x02
 
/*  defines for control blocks                                       */
 
#define DSNCB   01                /*  DSNCB - Node Control Block     */
#define DSOCB   02                /*  DSOCB - Outbound Control Block */
#define DSWCB   04                /*  DSWCB - Wilcard Control Block  */
#define DSIPC   010               /*  DSIPC - IPC key table entries  */
#define USERTBL 020               /*  USERTBL - NLS user tables      */
 
/* defines for USERTBL id's                                          */

#define CTABTBL    01    /* Colate table                             */
/*#define SPARE      02                                                */
/*#define SPARE      04                                                */
/*#define SPARE      010                                               */
/*#define SPARE      020                                               */

/*  defines for mode                                                 */
 
#define L_REPLACE  01    /* The entry being loaded is either a new   */
                         /* one or a replacement for an existing one.*/
#define L_DELETE   02    /* The table information for loadtbl.id is  */
                         /* deleted.                                 */
#define L_QUERYT   04    /* Query id's.                              */
#define L_QUERYI   010   /* Query table.                             */
 
struct idrow {
   long  wireid;         /* The id that arrived with the request     */
   short localid;        /* The local id qhich is the result of a    */
                         /* translate.                               */
   short pad;            /* Dummy for alignment purposes             */
};
 
struct dsxlate {
   short rlv1;           /* Reserved - must be 0                     */
   short gid;            /* The local wildcard gid for this node.    */
   short uid;            /* The local wildcard uid for this node     */
   char  flag;           /* The 0x01 bit is set if there is a        */
                         /* wildcard uid for this node.              */
                         /* The 0x02 bit is set if there is a        */
                         /* wildcard gid for this node.              */
   char  pad1;           /* Dummy for alignment purposes.            */
   unsigned short numuids; /* The number of uid translate rows.      */
   unsigned short numgids; /* The number of gid translate rows.      */
   short pad2;           /* Dummy for alignment purposes.            */
   struct idrow idrow[1]; /* The first row of translate info.        */
                         /* Rest of translates follow.               */
			 /* The dsxlate structure, the idrow
			    structure, and all the rest of the of
			    translate rows are loaded as one table
			    by loadtbl.                              */
};
 
struct dsipc {
   long   inkey;         /* input key                                */
   long   nid;           /* nid - null if for the local node         */
   long   outkey;        /* result key                               */
};
 
#endif	/* _h_dstables */
     kêò\ Œ  $          8‰*\™ˆ*8‰*     ]M  	              ‚r  ./usr/include/sys/dstat.h .h  re/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)dstat.h	16.4	LCC)	/* Modified: 18:09:31 9/22/89 */

#ifndef _h_DSTAT
#define _h_DSTAT

#ifndef _h_STAT
#ifdef  KERNEL
#include <stat.h>
#else  /* ~KERNEL */
#include <sys/stat.h>
#endif /* ~KERNEL */
#endif  /* _h_STAT */

struct  dstat
{
	gfs_t	dst_gfs;	/* Global file system number */
	ino_t	dst_ino;	/* Inode number */
	off_t	dst_size;     	/* number of bytes in file */
	time_t	dst_atime;   	/* time last accessed */
	time_t	dst_mtime;   	/* time last modified */
	time_t	dst_ctime;   	/* time inode last changed */
	dev_t	dst_rdev;	/* (major_dev,minor_dev) -- devices only */
	commitcnt_t dst_cmtcnt;	/* gfs commit seq number */
	fstore_t dst_fstore;	/* file propogation attributes */
	long	dst_version;	/* Version number of file */
	daddr_t dst_blocks;	/* Total number of blocks used in file. */
	ino_uniqid_t dst_uniqid;/* unique identifier */ 
	siteno_t dst_css;	/* Current synchronization site */
	siteno_t dst_ss;	/* Current storage site (dfstat only) */
	short	dst_flags;	/* Flags (dstat only) -- see below */
	smode_t	dst_mode;	/* mode and type of file, see below */
	nlink_t	dst_nlink;    	/* number of links to file */
	suid_t	dst_uid;      	/* owner's user id */
	sgid_t	dst_gid;      	/* owner's group id */
	dflag_t	dst_dflag;	/* disk flags (see below )*/
	siteno_t dst_rdevsite;  /* rdev site (devices only) */
	short	dst_bsize;	/* File system block size */
};

/* Values for dst_flags field  (dstat only) */
#define DSF_HIDDEN	0x0001	/* Passed through hidden directory */
#define DSF_SYMLINK	0x0002	/* Passed through symbolic link */
#define DSF_MOUNTEDON	0x0004	/* Passed through mount indirection */
#define DSF_LOCAL	0x0004	/* Passed through <LOCAL> symlink */

/* flags in dst_dflag */
#define S_DIDEL	      0x1	/* file has been deleted */
#define S_DISTORE     0x2	/* file is stored locally */
#define S_DIALLOC     0x10	/* inode has been allocated to a file */
#define S_DIHIDDEN    0x20	/* this is a hidden directory */
#define S_DILONGDIR   0x40	/* this is a BSD 4.3 format, long directory */
#define S_DILINK      0x80	/* this is a symbolic link */
#define S_DISOCKET    0x800	/* this is a UNIX domain socket */  

#ifdef	VAX
#undef	S_DILONGDIR
#define S_DILONGDIR	0x4000 /* vax version of longdir */
#endif	/* VAX */

#ifndef KERNEL
/* dfstat -- gather information about an open file.
 * int retcode = dfstat(fd, loc, length);
 *     int fd; 			/* file descriptor for open file
 *     struct dstat *loc;	/* structure filled in by system call 
 *     int length;		/* sizeof (struct dstat)
 */
extern int dfstat();

/* dstat -- gather information about a named file.
 * int retcode = dstat(pathname, loc, length, options);
 *     char *pathname; 		/* path name of file
 *     struct dstat *loc;	/* structure filled in by system call 
 *     int length;		/* sizeof (struct dstat)
 *     int options;		/* options for locating file, see below
 */
extern int dstat();
#endif /* !KERNEL */

/* dstat options -- used in locating file via the specified pathname:
 *     If the final component of the pathname is a hidden directory.
 *         If DST_NOHIDDEN is specified, information on the hidden
 *             directory is returned.
 *         If DST_NOHIDDEN is not specified, information on the file
 *             within the hidden directory is returned -- and DSF_HIDDEN
 *             is returned in dst_flags.
 *     If the final component of the pathname is a symbolic link which
 *         refers to an existing file. 
 *         If DST_NOSYMLINK is specified, information on the symbolic
 *             link is returned.
 *         If DST_NOSYMLINK is not specified, information on the file
 *             referred to by the symbolic link is returned -- and
 *             DSF_SYMLINK is returned in dst_flags.
 *     If the final component of the pathname is for a mounted-on inode.
 *         If DST_NOMOUNT is specified, information on the mounted-on
 *             inode is returned.
 *         If DST_NOMOUNT is not specified, information on the root
 *             of the mounted file system is returned -- and DSF_MOUNTEDON
 *             is returned in dst_flags.
 */

#define DST_NOHIDDEN	0x0001	/* Don't pass through hidden directories */
#define DST_NOSYMLINK	0x0002	/* Don't follow symbolic link on final comp. */
#define DST_NOMOUNT	0x0004	/* Don't follow mount of final component */

#endif  /* ~_h_DSTAT */
lokêR ˆ  $        ù  9‰*\™ˆ*9‰*     qµù  	                  ./usr/include/sys/dustat.h h  re/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)dustat.h	16.4	LCC)	/* Modified: 18:10:01 9/22/89 */

#ifndef _h_DUSTAT
#define _h_DUSTAT

#ifndef _h_TYPES
#ifdef KERNEL
#include <types.h>
#else /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */

#ifndef _h_PARAM
#ifdef KERNEL
#include <param.h>
#else /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif /* ~_h_PARAM */

#define MAXPACKNO	32

/*  The arrangement of these fields is important for network flipping.
 *  DON'T change them without changing svrpacklst. */
struct dpacklst {
	fstore_t	dpk_fstore;

	unsigned short	dpk_flags;
	siteno_t 	dpk_site;
	pckno_t		dpk_pack;	
	short		dpk_dummy;	/* dummy used for padding/ future 
					   expansion. */
};

/* This is essentially a subset of the filsys struct. */
/* The attempt was to make the trailing field names the same. */
/* See also nmdustat.h. */
struct dustat {
	fstore_t	du_fstore;
	commitcnt_t	du_hwm;
	commitcnt_t	du_lwm;
	daddr_t		du_fsize;	/* size in blocks of entire volume. */
	union du_mix {
		daddr_t	dum_tfree;	/* number of free blocks. */
		dev_t	dum_majmin; 	/* major / minor */
	} DU_mix;
	ino_t		du_tinode;	/* # of free inodes. */
	ino_t		du_isize;	/* addr of first data block. */
	short		du_bsize;	/* size of BSIZE. */
	pckno_t		du_pckno;	
	siteno_t	du_site;
	unsigned short	du_flags;	/* from s_flags */

	char		du_inopb;	/* inodes per block. */
	char		du_version;
	char		du_packcnt;	/* number of valid entries in 
					   dust_dpacklst */
	char		du_dummy[5];	/* padding/expansion */
	char 		du_fsmnt[32];
	char		du_fpack[8];
	struct dpacklst du_dpacklst[MAXPACKNO]; 
};

#define du_majmin DU_mix.dum_majmin /* Major/minor returned when -1 spec. in dustat */
#define du_tfree DU_mix.dum_tfree /* Free blocks */

#endif /* ! _h_DUSTAT */
d */
#dkê`´ ±  $        º  ‰*e ˆ*‰*     v%º  	                  ./usr/include/sys/elog.h h h  re/* @(#)elog.h	4.1 - 86/06/27 - 04:25:22 */
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)elog.h	1.1	LCC)	/* Modified: 16:36:06 2/4/88 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/*
 * "True" major device numbers. These correspond
 * to standard positions in the configuration
 * table, but are used for error logging
 * purposes only.
 */

#define RK0	0
#define RP0	1
#define RF0	2
#define TM0	3
#define TC0	4
#define HP0	5
#define HT0	6
#define HS0	7
#define RL0	8
#define	HP1	9
#define	HP2	10
#define	HP3	11

/*
 * IO statistics are kept for each physical unit of each
 * block device (within the driver). Primary purpose is
 * to establish a guesstimate of error rates during
 * error logging.
 */

struct iostat {
	long	io_ops;		/* number of read/writes */
	long	io_misc;	/* number of "other" operations */
	ushort io_unlog;	/* number of unlogged errors */
};

/*
 * structure for system accounting
 */
struct iotime {
	struct iostat ios;
	long	io_bcnt;	/* total blocks transferred */
	time_t	io_act;		/* total controller active time */
	time_t	io_resp;	/* total block response time */
};
#define	io_cnt	ios.io_ops
wm;
	dkê ‡ „  $        Ê  e‰*]™ˆ*e‰*     mzÊ  	              ë½  ./usr/include/sys/erec.h h h  re/*
 * erec.h
 *	format of system error records
 */
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)erec.h	16.6	LCC)	/* Modified: 17:40:36 10/11/89 */
/* SCCSIDgen1(@(#)erec.h	1.8	AIX);	Modified 10/10/88 13:52:41 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _h_EREC
#define _h_EREC

/* ioctl opcodes to be used with error logging device driver */
#define	ERR_NV_OFF	(('R'<<8) + 0)		/* disable NVRAM logging */
#define	ERR_NV_ON	(('R'<<8) + 1)		/* enable NVRAM logging */

/* because ordinary users might include this file */
#ifndef time_t
#define time_t	long
#endif

/*
 * Every error record has a header as follows.
 */
struct errhdr {
	int	e_len;		/* bytes in record (with header) */
	time_t	e_time;		/* time of day */
	long	e_timex;	/* clock ticks */
	char	e_nid[8];	/* Node ID */
	char	e_vmid[8];	/* Virtual Machine ID / system name */
	union {
		struct {
			char	ex_class;	/* error class */
			char	ex_subclass[2];	/* error subclass */
			char	ex_type;	/* record type */
		} ex;
		int csmt;	/* a single handle for the whole type/class */
	} exx;
};
#define e_class		exx.ex.ex_class
#define e_subclass	exx.ex.ex_subclass
#define e_type		exx.ex.ex_type
#define e_csmt		exx.csmt

#define MAX_ELOG_TEXT	64	/* maximum legal additional information */

/*
 * this macro is used to construct a CSMT
 *	since it does it by treating a a structure of chars as a word,
 *	it is intrinsically word-order dependent and non-portable
 */
#if defined(i386)
#define MKWORD(a,b,c,d) (((((((d)<<8) | (c)) <<8) | (b)) <<8) | (a)) 
#else	/* ! defined(i386) */
#define MKWORD(a,b,c,d) (((((((a)<<8) | (b)) <<8) | (c)) <<8) | (d)) 
#endif	/* ! defined(i386) */

/*
 * bits in the type fields
 */
#define E_PERM	0x80
#define E_TMP	0x40
#define E_INFO	0x20
#define E_CNTR  0x10
#define E_ABR	0x08
#define E_ANAL	0x01

/*
 * Error classes
 */
#define E_HARDWARE	1
#define E_SOFTWARE	2
#define E_IPL		3
#define	E_GENERAL	4
#define	E_USER		6

/*
 * subclasses for each class
 */

/* HARDWARE ERRORS - subclasses */
#define E_PROCMC	01		/* Processor machine check */
#define	E_MP		01	/* main processor */
#define E_MM		02	/* main memory */

#define	E_DISK		02		/* Hard file and adaptor */
#define E_FLOP		03		/* diskette drive and adaptor */
#define E_TAPE		04		/* tape drive and adaptor */
#define E_DISPA		05 		/* display station and adaptor */
#define E_DISP		06		/* display station */
#define E_MOUSE		07		/* keyboard/mouse */
#define E_COMMA		0x08		/* communication adaptor */
#define	E_RS232a	 1	/* rs-232 multi port */
/*			 2	   reserved		*/
#define	E_SSP		 4	/* serial of serial/parallel */
#define	E_HPCNETWORK	 5
#define	E_RS422		 6	/* rs422 multi-port */
#define E_NSIO		 7	/* native serial io */
#define	E_MPASYNC	 8	/* multi protocol async */
#define	E_MPBISYNC	 9	/* multi protocol bisync */
#define	E_MPSDLC	10	/* multi protocol sdlc */
#define	E_MPHDLC	11	/* multi protocol hdlc */
#define	E_MPR366	12	/* RS366 */
#define	E_PPRINT	 9		/* parallel printer adaptor */
#define	E_PPA		01	/* parallel of serial/parallel */
#define	E_PPCM		0x02	/* parallel of PC monochrome */
#define	E_PRINTERS	10	/* other printers */
#define E_COPROC	11	/* Co-Processor */
#define	E_SCSI		12	/* SCSI device suite */

/* SOFTWARE ERRORS - subclasses */
#define E_PROCPC	01	/* Processor Program check */
#define E_ABEND         02     /* Abend */
#define	E_ADT		01	/* Dump Taken */
#define	E_ANDT		02	/* No dump Taken */
#define E_UNIX          03      /* UNIX */
#define E_KERN          03      /* Unix Kernel */
#define E_SYS           04      /* Unix System Application */
#define E_UNIXDD1       04      /* UNIX Device Drivers */
#define E_UNIXDD2       05      /* UNIX Device Drivers */
#define E_VRMBASE       06      /* VRM Base */
#define E_VRMCOMP       07      /* VRM COMP */
#define E_APPL          0x08      /* Applications */
#define E_EPD           01      /* Error Problem Determination */
#define E_IWS           02      /* Interactive Workstation */
#define E_VTRM          03      /* Virtual Terminal */

/* IPL RECORDS - subclasses */
#define E_MANIPL	01	/* Manual IPL */
#define E_SOFTIPL	02	/* Soft IPL */
#define E_SHUTDOWN	04	/* Shutdown */
#define E_MAINT   	05	/* Maintenance */

/* GENERAL ACTIVITY RECORDS- subclasses */
#define E_DEGRADE	01	/* Degraded Configuration */
#define E_CHGTIM	02	/* Set Time / date */

/* 
 * USER REPORTED EVENTS/ERRORS
 *	user defined:	01 - 255
 */

/*
 * the errsave function logs errors with a very specific format into the
 *	nvram error message saving area.
 */
struct e_drvrstat {	/* format of basic status info from driver */
	char	e_intlvl;	/* device interrupt level */
	char	e_dmalvl;	/* DMA arbitration level  */
	char	e_cardid[2];	/* adaptor ID number	  */
	char	e_diag[9];	/* device specific status information */
};

struct e_errsave {	/* format of buffer passed to errsave */
	long	es_csmt;	/* class, subclass, mask, type */
	long	es_stslen;	/* length of valid drvrstat data */
	struct	e_drvrstat es_drvrstat;	/* status info from driver */
};

struct e_nvram {	/* format of record logged into NVRAM */
	char	e_stslen;	/* length of valid e_drvrstat data */
	struct  e_drvrstat e_drvrstat;	/* status record from driver */
	char	e_t_sec;	/* time of event: seconds 0-59	*/
	char	e_t_min;	/* time of event: minutes 0-59	*/
	char	e_t_hr;		/* time of event: hours   0-23	*/
	char	e_t_day;	/* time of event: day 	  1-31	*/
	char	e_t_mon;	/* time of event: month   1-12	*/
	char	e_t_yr;		/* time of event: year    00-99	*/
};

/*
 * Additional information structure for E_SOFTWARE type records
 */
struct e_abend {
	unsigned long   len;    /* Length of entry */
	int     CAMP;   /* comp. ID, abend code, mach. status, pgm status */
	int     curid;  /* current ID @ abend time */
	int     IAR;
	union {
		int i;
		struct {
			short   ICS;
			char    a_type; /* 1=HW, 2=SW, 3=VM */
			char    UCS;
		} sc;
	} iac;
};


struct e_progerr {
	unsigned long   len;    /* Length of entry */
	unsigned char   amid[8]; /* Module identifier */
	unsigned long   rtcode;         /* return code */
	unsigned long   data[2];       /* data */
};


struct e_errprogsave {	/* format of buffer passed to errsave */
	long	es_csmt;	/* class, subclass, mask, type */
	struct	e_progerr es_progerr;	/* status info from driver */
};


struct e_hardware {
	unsigned short  e_iodn, e_iocn;
	unsigned long   e_baseioaddr;   /* Base I/O port address */
	unsigned long   e_devname;      /* device name */
	unsigned long   e_idevtype;     /* internal device type */
	unsigned long   e_length;       /* length of ddd */
	unsigned long   e_ddd[1];       /* device dependent data begins here */
};


/*
 * Additional information structure for IPL type records
 */
struct estart {
	long e_len;
	char e_state;
	char e_diag;		/* from nvram */
	char e_machtype;	/* Machine type */
	char e_nvram_valid;	/* nvram valid  */
	long e_iplaa;		/* ipl adaptor address */
	long e_time;		/* ipl time */
	struct  {	/* from uname */
		char e_sysname[8];
		char e_nodename[8];
		char e_release[8];
		char e_version[8];
		char e_machine[8];
	} e_id;
};

/* e_state bits */
#define D_MANIPL	0x80	/* Manual IPL */
#define D_SOFTIPL	0x40	/* Soft/auto IPL */
#define D_SHUTDOWN	0x10	/* Shutdown */

/*

/*
 * A time change record is sent to the daemon whenever
 * the system's time of day is changed.
 */
struct etimchg {
	long	e_len;
	time_t	e_otime;	/* old time */
	time_t	e_ntime;	/* new time */
};
/*
 * unix panic record, gotten from nvram
 */
struct epanic {
	int	e_len;
	long	e_panicstr[1];	/* first byte of panic string */
};
#endif /* _h_EREC */
#definkêd² †  $        \"  9‰*]™ˆ*9‰*     ôZ\"  	              [  ./usr/include/sys/errno.h  h  re/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef _POSIX_SOURCE
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)errno.h	16.12       LCC)    /* Modified: 15:12:59 1/16/90 */
#endif /* NOT _POSIX_SOURCE */

#ifndef _H_ERRNO
#define	_H_ERRNO

#ifndef _POSIX_SOURCE
#include <DOPTIONS.h>
#endif /* NOT _POSIX_SOURCE */

/*
 * Error codes
 */

#define	EPERM	1	/* Operation not permitted		*/
#define	ENOENT	2	/* No such file or directory		*/
#define	ESRCH	3	/* No such process			*/
#define	EINTR	4	/* Interrupted system call		*/
#define	EIO	5	/* Input/Output error			*/
#define	ENXIO	6	/* No such device or address		*/
#define	E2BIG	7	/* Arg list too long			*/
#define	ENOEXEC	8	/* Exec format error			*/
#define	EBADF	9	/* Bad file number			*/
#define	ECHILD	10	/* No child processes			*/
#define	EAGAIN	11	/* Resource temprarily unavailable	*/

#ifdef _BSD
#define	EWOULDBLOCK EAGAIN	/* for BSD compatibility	*/
#endif /* _BSD */

#define	ENOMEM	12	/* Not enough space			*/
#define	EACCES	13	/* Permission denied			*/
#define	EFAULT	14	/* Bad address				*/
#define	ENOTBLK	15	/* Block device required		*/
#define	EBUSY	16	/* Resource busy			*/
#define	EEXIST	17	/* File exists				*/
#define	EXDEV	18	/* Improper link			*/
#define	ENODEV	19	/* No such device			*/
#define	ENOTDIR	20	/* Not a directory			*/
#define	EISDIR	21	/* Is a directory			*/
#define	EINVAL	22	/* Invalid argument			*/
#define	ENFILE	23	/* Too many open files in system	*/
#define	EMFILE	24	/* Too many open files			*/
#define	ENOTTY	25	/* Inappropriate I/O control operation	*/
#define	ETXTBSY	26	/* Text file busy			*/
#define	EFBIG	27	/* File too large			*/
#define	ENOSPC	28	/* No space left on device		*/
#define	ESPIPE	29	/* Invalid seek				*/
#define	EROFS	30	/* Read only file system		*/
#define	EMLINK	31	/* Too many links			*/
#define	EPIPE	32	/* Broken pipe				*/

/* math software */
#define	EDOM	33	/* Domain error				*/
#define	ERANGE	34	/* Result too large			*/
#define	ENOMSG	35	/* No message of desired type		*/
#define	EIDRM	36	/* Identifier removed			*/
#define	ECHRNG	37	/* Channel number out of range		*/
#define	EL2NSYNC 38	/* Level 2 not synchronized		*/
#define	EL3HLT	39	/* Level 3 halted			*/
#define	EL3RST	40	/* Level 3 reset			*/
#define	ELNRNG	41	/* Link number out of range		*/
#define	EUNATCH 42	/* Protocol driver not attached		*/
#define	ENOCSI	43	/* No CSI structure available		*/
#define	EL2HLT	44	/* Level 2 halted			*/
#define EDEADLK 45	/* Record locking deadlock		*/

#define ENOTREADY	46	/* Device not ready		*/
#define EWRPROTECT	47	/* Write-protected media 	*/
#define EFORMAT		48	/* Unformatted or incompatible media */
#define ENOLCK		49	/* No locks available		*/
#define ENOCONNECT      50      /* Cannot establish connection  */
#define EBADCONNECT     51      /* Connection down     		*/
#define ESTALE          52      /* Missing file or filesystem   */
#define EDIST           53      /* Requests blocked by Administrator */

/* non-blocking and interrupt i/o */
#ifndef _BSD
#define EWOULDBLOCK	54	/* Operation would block	*/
#endif /* _BSD */
#define EINPROGRESS     55      /* Operation now in progress	*/
#define EALREADY        56      /* Operation already in progress */

/* ipc/network software */

	/* argument errors */
#define ENOTSOCK        57      /* Socket operation on non-socket	*/
#define EDESTADDRREQ    58      /* Destination address required		*/
#define EMSGSIZE        59      /* Message too long			*/
#define EPROTOTYPE      60      /* Protocol wrong type for socket	*/
#define ENOPROTOOPT     61      /* Protocol not available		*/
#define EPROTONOSUPPORT 62      /* Protocol not supported		*/
#define ESOCKTNOSUPPORT 63      /* Socket type not supported		*/
#define EOPNOTSUPP      64      /* Operation not supported on socket	*/
#define EPFNOSUPPORT    65      /* Protocol family not supported 	*/
#define EAFNOSUPPORT    66      /* Address family not supported by protocol */
#define EADDRINUSE      67      /* Address already in use		*/
#define EADDRNOTAVAIL   68      /* Cannot assign requested address 	*/

	/* operational errors */
#define ENETDOWN        69      /* Network is down			*/
#define ENETUNREACH     70      /* Network is unreachable		*/
#define ENETRESET       71      /* Network dropped connection on reset	*/
#define ECONNABORTED    72      /* Software caused connection abort	*/
#define ECONNRESET      73      /* Connection reset by peer		*/
#define ENOBUFS         74      /* No buffer space available		*/
#define EISCONN         75      /* Socket is already connected		*/
#define ENOTCONN        76      /* Socket is not connected		*/
#define ESHUTDOWN       77      /* Cannot send after socket shutdown	*/
#define ETIMEDOUT       78      /* Connection timed out			*/
#define ECONNREFUSED    79      /* Connection refused			*/

#define EHOSTDOWN       80      /* Host is down				*/
#define EHOSTUNREACH    81      /* No route to host			*/

#define ELOOP		85	/* Symbolic link loop			*/

#define ENAMETOOLONG	86	/* File name too long			*/
#ifdef _BSD
#define ENOTEMPTY	EEXIST
#else /* NOT _BSD */
#define	ENOTEMPTY	87	/* Directory not empty */
#endif /* NOT _BSD */

#define	EDQUOT		88	/* Disc quota exceeded			*/

/* errors for System V shared libraries. */
#define	ELIBACC		89	/* Shared library cannot be accessed	*/
#define	ELIBBAD		90	/* Shared library format is bad		*/
#define	ELIBSCN		91	/* .lib section in executable is corrupted */
#define	ELIBMAX		92	/* Too many shared libraries		*/


/* error codes for TCF code */
#define	ESITEDN1	94	/* Required site is not available	*/
#define	ESITEDN2	95	/* Operation terminated due to site failure */
#define	ENOSTORE	96	/* File or working directory is unavailable */
#define	ENLDEV		97	/* Not a local device.			*/
#define	EBADST		98	/* Bad site specification		*/
#define	ELDWRG		99	/* Load module not for this machine	*/
#define	ELOCALONLY	100	/* Operation restricted to local site	*/

#define	ELOCK		101	/* Lock conflict			*/
#define	ETABLE		102	/* Miscellaneous system table full	*/
#define	EXGFS		103	/* Improper mount operation requested	*/

#ifndef _POSIX_SOURCE
#define	EJOURNAL	105	/* Undefined journal operation		*/
#endif	/* NOT _POSIX_SOURCE */

#define	EPBUSY		106	/* Pack is busy				*/

#ifndef _POSIX_SOURCE
#define	ENSPEC		107	/*					*/
#define	EDLOCK		108	/*					*/
#endif	/* NOT _POSIX_SOURCE */

#define ENOSYS		109	/* Function not implemented		*/

#ifdef _KERNEL
/*
 *  The following codes are used only internally by the kernel as return
 *  codes, to be consistent with the fact that the return code in netmsg's
 *  is always the value of u.u_error.
 */

#define RQUOTA		113	/* soft quota limit reached */
#define	RIBUSY		114	/* inode busy (used for propagation in) */
#define	RNOCFLT		115	/* trying to open a specific version when
				 * there is no conflict */
#define	RILOCK		116	/* inode is ILOCKed, and although we have
				 * waited, it has not unlocked.  */
#define	RUNSTABLE	117	/* a configuration change has occurred, and
				 * the new CSS for this gfs is not yet ready
				 * to process opens */
#define	RNOTCSS		118	/* CSS request made at non-CSS site
				 * (for topchg) */
#define	RRMTFRK  	119	/* remote fork problem */
#define	RSLEEP	 	120	/* used for remote sleep wakeup */
#define	RRETRY		121	/* return after remote sleep indicating to 
				 * redo operation */
#define	RWCMIT		122	/* Not doing ss_commit because IWCOMMIT set */
#define	RNOTHERE	123	/* Pid you are looking for is not here and its
				 * whereabouts are unknown (cf. RTRYSITE) */
#define	RTRYSITE	124	/* Your pid's not here; try over yonder */
#define	RDELAYED	125	/* Delayed response will follow later	*/
#define	RPIPEMP		126	/* on fifo reads -- tells reader to sleep. */
#define RNFS		127	/* operation failed, NFS requires special att.*/
#define	RBNDELAY	128	/* operation w/NDELAY would have blocked */

#define RNFSFLOW	129     /* tcf retry nfs operation later */
#define MAXERR		129	/* Largest currently used error number */

	/* old names for temporary compatability */
#define	EUNSTABLE	RUNSTABLE
#define	ENOCFLT		RNOCFLT
#define	ENOTCSS		RNOTCSS
#define	EIBUSY		RIBUSY
#define	EILOCK		RILOCK

/* classify error numbers */
#define	ERR_NORM	1	/* can occur without any "real" error	*/
#define	ERR_PDEP	2	/* permanent, site dependent error	*/
#define	ERR_TDEP	3	/* temporary, site dependent error	*/
#define	ERR_TIND	4	/* temporary, site independent error	*/
#define	ERR_PIND	5	/* permanent, site independent error	*/
#define	ERR_DEFAULT	6	/* unexpected error, complain		*/
#define	ERR_RETRY	7	/* transient error, retry operation	*/

#endif	/* _KERNEL */

#endif	/* NOT _H_ERRNO */
cketkêÌ² …  $        „  9‰*^™ˆ*9‰*     ‡†„  	              US  ./usr/include/sys/eth.h /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)eth.h	16.3	LCC)	/* Modified: 17:37:28 9/16/89 */
/* SCCSIDPUFF(@(#) eth.h 4.3 LM 00:07:17 6/21/85 C 00:07:21 6/21/85); */

#ifndef _h_ETH
#define _h_ETH

/* NEEDSWORK: this is pretty stupid [ hjb 07/26/85 ] */
#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _h_TYPES */
#ifndef _h_NETWORK
#ifdef KERNEL
#include <network.h>
#else /* ! KERNEL */
#include <sys/network.h>
#endif /* ! KERNEL */
#endif /* _h_NETWORK */

#define ETH_ADDR_SIZE	6	/* ethernet addresses are 6 bytes (forever) */
/* Ethernet header structure */

/* Format of the standard ethernet header. */
/* Be careful about structure padding when using this
 * in another structure! (it isn't a multiple of sizeof(align_t) bytes). */
struct eth_header {
	u_char	eth_dest[ETH_ADDR_SIZE];
	u_char	eth_srce[ETH_ADDR_SIZE];
	u_char	eth_type[2];
};

/* Format of the extended ethernet header. */
/*    Includes the subchannel addressing fields. */
/* Be careful about structure padding when using this
 * in another structure! (it isn't a multiple of sizeof(align_t) bytes).
 */
struct xeth_header
{
	u_char	xeth_dest[ETH_ADDR_SIZE];
	u_char	xeth_srce[ETH_ADDR_SIZE];
	u_char	xeth_type[2];
	u_char	xeth_xdest;	/* subchannel demultiplexing fields */
	u_char	xeth_xsrce;	/* subchannel demultiplexing fields */
};

#define	ETH_MINLEN	60	/* smallest ethernet packet allowed */
#define	ETH_MAXLEN	1514	/* largest ethernet packet allowed */
#define	ETH_FCSSIZ	4	/* size of checksum at end of rcv'd packets */

#define	LOCUS_type_h	0x02	/* type field of Ethernet header - just needs */

/* The following should be distinct from that used by the Bridge
 * Etherplexers (they use 0x0600) to avoid interference
 */
#ifdef ALT_LOCUS_TYPE
#define	LOCUS_type_l	0x20
#else  /* -ALT_LOCUS_TYPE */
#define	LOCUS_type_l	0x19
#endif /* -ALT_LOCUS_TYPE */

/* #ifdef USER_ETH_ACCESS . Don't really ifdef, so user can see these */
struct lpstatus {
	short	rcvb_sz;	/* size of each input buffer */
	short	rcvq_sz;	/* total number of input buffers */
	short	type;		/* unused */
	short	t_error;	/* unused */
	u_char	netid[8];	/* return local eth addr in this */
	short	r_error;	/* unused */
	u_char	eptype[2];	/* expected packet type */
	short	lpoff;		/* offset in packet data of logical port num */
};

#define	LP_EXCLUSIVE_TYPE   -1	/* value of lpoff which indicates */
				/* that only one port can accept packets 
				 * of this type (and thus that no port field
				 * is necessary). */

#define	ETHSETPORTCONF	1	/* ioctl cmd to set the port configuration */
#define	ETHGETPORTCONF	2	/* ioctl cmd to set the port configuration */
#define	ETHGETSTATS	3	/* ioctl cmd to get status. not implemented */
#define	NIGETA		ETHGETPORTCONF	/* support sys5 interface */
#define	NISETA		ETHSETPORTCONF

/* #endif USER_ETH_ACCESS */

#ifdef USER_ETH_ACCESS
/* One struct eth_port per user ethernet port (/dev/ethport00, ethport01, ...)
 * This structure describes the current state of the port, and points to
 * the input and output buffer space allocated for the port. */
struct eth_port {
	short		ep_flags;
	struct ethpdev	*ep_epdp;	/* link to the device this port uses */
	/* output stuff */
	short		ep_olength;	/* length of current output packet */
	caddr_t		ep_obuf;	/* port's output packet address */
	struct eth_port *ep_onext;	/* next port ready to output */
	short		ep_error;	/* to return port errors to user */
	/* input stuff. */
	struct eth_port *ep_hnext;	/* chain for hash on ep_eptype */
	u_char		ep_eptype[2];	/* expected packet type */
	short		ep_lpoff;	/* per type offset in pkt of port no. */
	int		(*ep_inqf)();	/* func to call on input */
	int		(*ep_ointf)();	/* func to call on output complete */
	/* the following are only used if ep_inqf is ethp_nq() */
	int		ep_iqsiz;	/* input queue size (== top - bot) */
	int		ep_iqfree;	/* input queue free byte count */
	caddr_t		ep_iqbot;	/* input queue low address */
	caddr_t		ep_iqtop;	/* input queue highest address + 1 */
	caddr_t		ep_iqhead;	/* where to dequeue from */
	caddr_t		ep_iqtail;	/* where to enqueue */
	short		ep_rcvb_sz;	/* saved value from lpstatus ioctl */
	short		ep_rcvq_sz;	/* saved value from lpstatus ioctl */
#ifdef	IPC42
	struct arpcom	*ep_arpp;	/* common Ethernet structures */
#else
	/* used only if the port is used by IP */
	struct ifcb	*ep_ifcbp;	/* control block for this port */
#endif	/* IPC42 */
};

/* flags in ep_flags: */
#define	EP_CLOSED	0x00		/* closed pseudo flag */
#define EP_OPEN		0x01		/* has been opened */
#define EP_CONF		0x02		/* has been configured */
#define EP_OBUSY	0x04		/* obuf busy for output */
#define EP_OWANT	0x08		/* wanted for output */
#define EP_TCPIP	0x10		/* port owned by tcp/ip */

/* Open ports are kept linked into a hash table by expected eth_type
 * so when a packet comes in, the port it is intended for can be found
 * quickly... (see eth_rcv eth_3com.c). */
#define ETH_TYPE_HSIZE	17	/* not likely to be many types */
#define ETH_TYPE_HASH(type)	( ( ((u_char*)type)[0] ^ ((u_char*)type)[1] ) \
					% ETH_TYPE_HSIZE )

#endif /* USER_ETH_ACCESS */

/*
 * structure describing the relationship between a given ethernet
 * device and its ports.
 */
struct ethpdev
{
#ifdef USER_ETH_ACCESS
	struct eth_port	*epd_oq;	/* queue of ports ready to output */
	struct eth_port	**epd_oqnd;	/* end of this queue */
	struct eth_port	*epd_ports;	/* array of ports for this device */
	struct netsw	*epd_netp;	/* with which net is this associated? */
	short		epd_nports;	/* number of ports in epd_ports */
#endif /* USER_ETH_ACCESS */
	short		epd_flags;	/* device attributes */
#ifdef USER_ETH_ACCESS
	struct eth_port *epd_htab[ETH_TYPE_HSIZE]; /* input type hash table */
#endif /* USER_ETH_ACCESS */
	int		(*epd_ostart)();/* devices ostart routine */
	u_char		epd_eaddr[ETH_ADDR_SIZE]; /* this dev's eth address */
#ifdef u370
	/* ifdef should really be AUSCOM */
	u_char		epd_xeaddr;	/* address extension for Auscom */
#endif /* u370 */
};


/* flags bits in epd_flags */
#define	EPD_LOOPBACK	0x0001	/* the device receives messages it sends if they
				 * are broadcast or have its own address. */

#define PORTNO(portp)	((portp) - (portp)->ep_epdp->epd_ports)


#define eq_ethtype(t1, t2)	( (t1[0] == t2[0]) && (t1[1] == t2[1]) )
extern u_char LOCUS_type[2];
extern u_char eth_broadcast[ETH_ADDR_SIZE];

#define	ETHWORK_NULL	0
#define	ETHWORK_LOCUS	1
#define	ETHWORK_PORT	2
#define	ETHWORK_IPC	3

#define NETHS	1		/* number of physical ethernets */
#define NETH	2*NETHS		/* used to allocate pairs of buffers, etc., */

/* the following two defines are meant to be used as indexes
 * into pairs of input/output resources. */
#define	ETH_INPUT	0	/* input  index */
#define	ETH_OUTPUT	1	/* output index */

#endif  /* ~_h_ETH */
TS	3kê>^ „  $        Ø  9‰*^™ˆ*9‰*     ¥™Ø  	                  ./usr/include/sys/fblk.h   h  re/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)fblk.h	16.3	LCC)	/* Modified: 17:38:20 9/16/89 */
/* SCCSIDPUFF(@(#) fblk.h 4.1 LM 12:52:09 4/23/85 C 22:12:19 4/23/85); */

#ifndef _h_FBLK
#define _h_FBLK

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _h_TYPES */

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif  /* _h_PARAM */

#ifndef _h_FILSYS
#ifdef  KERNEL
#include <filsys.h>
#else  /* ~KERNEL */
#include <sys/filsys.h>
#endif /* ~KERNEL */
#endif  /* _h_FILSYS */

struct fblk
{
	long   	df_nfree;
	daddr_t	df_free[NICFREE];
};


typedef	struct  fblk  * FBLKP;

#endif  /* ~_h_FBLK */
kê²Ì ƒ  $        Æ  :‰*`™ˆ*:‰*     šÆ  	              á^  ./usr/include/sys/fcntl.h  h  re/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef _POSIX_SOURCE
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)fcntl.h	16.11       LCC)    /* Modified: 19:43:31 1/11/90 */
#endif /* NOT _POSIX_SOURCE */

#ifndef	_H_FCNTL
#define	_H_FCNTL

#include <sys/types.h>

/* WARNING: if you change FD_CLOEXEC be sure to change EXCLOSE in <sys/user.h>
 */
#define FD_CLOEXEC 01 	


/* Open Flags.  These may only be passed to open(2) */
#define	O_RDONLY        0
#define	O_WRONLY        1
#define	O_RDWR	        2
#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)

#ifndef _POSIX_SOURCE
#define	O_DEFERC       040	/* do deferred commits of changes */
#endif /* NOT _POSIX_SOURCE */

#define O_NOCTTY      0200	/* do not establish a controlling terminal */
#define	O_CREAT	      0400	/* open with file create (uses third open arg)*/
#define	O_TRUNC	     01000	/* open with truncation */
#define	O_EXCL	     02000	/* exclusive open */


/* Flag values accessible to open(2) and fcntl(2) */
#define	O_NONBLOCK	(_O_NDELAY|_O_EDELAY)	/* POSIX Non-blocking I/O */
#define	_O_NDELAY 	04	/* Non-blocking I/O, System V Flavor */
#define	O_APPEND       010	/* append (writes guaranteed at the end) */
#define _O_EDELAY     0100	/* with O_NDELAY, indicates BSD-flavor NDELAY */

#ifndef _POSIX_SOURCE
#ifdef _BSD		/* For Berkeley apps, emulate BSD behavior */
#define	O_NDELAY	O_NONBLOCK
#else
#define	O_NDELAY	_O_NDELAY
#endif /* _BSD */

#define O__NDELAY _O_NDELAY
#define O_EDELAY _O_EDELAY

#define	O_ASYNC	       020	/* signal pgrp when data ready */
#define	O_OPENDIR    04000	/* no longer used */
#define O_SYNC	   0200000	/* synchronous write */
#define O_REPLSYNC 0400000	/* syncronous replicated write */
#endif /* NOT _POSIX_SOURCE */


/* fcntl(2) requests */
#define	F_DUPFD	0	/* Duplicate fildes */
#define	F_GETFD	1	/* Get fildes flags */
#define	F_SETFD	2	/* Set fildes flags */
#define	F_GETFL	3	/* Get file flags */
#define	F_SETFL	4	/* Set file flags */
#define F_GETLK 5	/* Get first blocking lock */
#define F_SETLK 6	/* Non-blocking lock */
#define F_SETLKW 7	/* Blocking lock */


#ifndef _POSIX_SOURCE

#define F_OPENLOCK 8	/* Dos - file sharing options */
#define F_GETOWN 9	/* Get pgrp */
#define F_SETOWN 10 	/* Set pgrp for SIGIO */

/* F_SETFL/GETFL flags */

#if defined(_BSD) && !defined(_KERNEL)
#define FNDELAY		(O_NDELAY|_O_EDELAY) /* for BSD */
#else
#define FNDELAY		O_NDELAY /* enable non-blocking system calls	*/
#endif  /* defined(_BSD) && !defined(_KERNEL) */

#define	FAPPEND		O_APPEND /* enable write at end-of-file mode	*/
#define FASYNC		O_ASYNC	 /* send signal when I/O completes	*/
#define FDEFERC		O_DEFERC /* enable deferred commit		*/
#define FCOMMIT		O_DEFERC /* enable deferred commit		*/
#define FEDELAY		_O_EDELAY /* return EAGAIN when block condition	*/
#define FSYNC		O_SYNC	 /* synchronous write 			*/
#define FREPLSYNC	O_REPLSYNC /* synchronous replicated write	*/
#define	FCREAT		O_CREAT	/* open, creating if necessary		*/
#define	FTRUNC		O_TRUNC	/* open, truncating the file		*/
#define	FEXCL		O_EXCL	/* open for exclusive use		*/

#endif /* NOT _POSIX_SOURCE */


/* File locking modes used with F_GETLK, F_SETLK, F_SETLKW */
#define F_RDLCK 1
#define F_WRLCK 2
#define F_UNLCK 3

#ifndef _POSIX_SOURCE

#define F_DOSENFORCE   8
#define F_DOSRDLCK     (F_RDLCK|F_DOSENFORCE)	/* Not currently used */

/* used by PCI servers for DOS-locking emulation */
/* F_DOSWRLCK - should be specified as the lock type for DOS-locking */
#define F_DOSWRLCK     (F_WRLCK|F_DOSENFORCE)

/* the following definitions are used in the fcntl F_OPENLOCK option */
#define EXCLUDE_COMPAT  0 
#define EXCLUDE_READ	1
#define EXCLUDE_WRITE	2 
#define EXCLUDE_BOTH	3 
#define EXCLUDE_NONE	4 

#endif /* NOT _POSIX_SOURCE */


/* The following structure is used for fcntl().  It is not to be
 * confused with the BSD flock() routine. */

struct	flock {
		short      l_type;
		short      l_whence;
		off_t	   l_start;
		off_t      l_len;
		u_long_t   l_sysid;
		pid_t      l_pid;
};


#ifndef _KERNEL
extern int open(), creat(), fcntl();
#endif /* NOT _KERNEL */

#endif /* NOT _H_FCNTL */
s kê´ µ  $          ‰*¨ ˆ*‰*     u%  
                  ./usr/include/sys/ffpcontrol.h eC  LICENSED MATERIALS - PROPERTY OF IBM
C  (c) Copyright 1990 IBM Corporation
C  All Rights Reserved

C  SCCSID(@(#)ffpcontrol.h	1.3	AIX)	Modified 11/20/90 14:41:45
C  Define 80387 control word parts to be used with fpcontrol.s		
C  routines FFP_CONTROL(), FFP_EXMASK(), FFP_EXUNMASK(),			
C  FFP_ROUND(), FFP_PRECISION() and FFP_RESTORE().			

	INTEGER*2 FPM_INV_OP, FPM_DENORM,FPM_DIVIDE_0,
     *  FPM_OVERFLOW, FPM_UNDERFLOW, FPM_PRECISION,
     *  FPR_NEAR,FPR_DOWN, FPR_UP,FPR_CHOP,FPP_SINGLE,
     *  FPP_DOUBLE,FPP_EXTENDED

C This group is to be used with:					
C FFP_CONTROL(), FFP_EXMASK() and FFP_EXUNMASK()				

	DATA FPM_INV_OP/1/,FPM_DENORM/2/,
     *  FPM_DIVIDE_0/4/,FPM_OVERFLOW/8/,
     *  FPM_UNDERFLOW/16/,FPM_PRECISION/32/

C  This group is to be used with:
C  FFP_CONTROL() and FFP_ROUND()	

        DATA FPR_NEAR/0/,FPR_DOWN/1024/,
     *  FPR_UP/2048/,FPR_CHOP/3072/

C  This group is to be used with:		
C  FFP_CONTROL() and FFP_PRECISION()	

        DATA FPP_SINGLE/0/,FPP_DOUBLE/512/,
     *  FPP_EXTENDED/768/

	kêrÍ €  $        =  :‰*a™ˆ*:‰*     a=  	              ÖŒ  ./usr/include/sys/file.h rol.h e/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)file.h	16.7	AIX)	/* Modified: 18:11:43 9/22/89 */

#ifndef	_h_FILE
#define	_h_FILE

/* Certain constands (file access, and seek offsets) were moved to unistd.h
 * where AIX programs expect to find them. We included that header file here
 * for BSD programs which expect to find these contstants in file.h
 */
#ifndef _h_UNISTD
#include <unistd.h>
#endif

/* Certain constants (FNDELAY, etc) were moved from file.h to fcntl.h
 * because that is where BSD programs expect to find them.  We include
 * that header file here for those SYS V programs which expect to find
 * these constants in file.h
 */
#include <sys/fcntl.h>

/*
 * One file structure is allocated
 * for each open/creat/pipe call.
 * Main use is to hold the read/write
 * pointer associated with each open
 * file.
 */

/* LOCUS changes:
 * 1. set FNLR as 04, which FPIPE used to be.  Set FPIPE to 010 and
 *    moved FMPX, FMPY and FMP up appropritely (could be reused now).
 * 2. dynamic table allocation and free list of available blocks.
 */

struct	file
{
	long	f_flag;
	short	f_count;		/* reference count */
	short	f_tcbdes;		/* TCB descriptor */
	short	f_type;			/* descriptor type */
	siteno_t f_tmgrsite;		/* token manager site */
	char	f_wnttok;		/* token semaphore */
	char	f_tlckcnt;		/* token lock semaphore */
	union {
		struct inode *F_inode;	/* pointer to inode structure */
		caddr_t	F_data;		/* pointer to socket */
	} f_ISP;
#define f_inode	f_ISP.F_inode
#define f_data	f_ISP.F_data
	union {
		off_t	F_offset;	/* read/write char pointer */
		short F_msgcount;	/* references from msg queue */
#define f_msgcount	f_UN.F_msgcount
		struct  file *F_next;	/* pointer for free list */
#define f_next  f_UN.F_next
	} f_UN;
#define f_offset	f_UN.F_offset
};

#ifdef	KERNEL

/* these two definitions are not used */
#define	DTYPE_INODE	1	/* file */
#define	DTYPE_SOCKET	2	/* communications endpoint */

extern  struct	file *file;	/* the file table itself */

#define fileNFILE	v.ve_file	/* use the value in struct var */
#define nfile		v.v_file	/* use the value in struct var */
extern  struct  file * file_flist;	/* head of free list */
extern	struct	file *getf();
extern	struct	file *falloc();

extern  struct file *file_destoptr();

#endif  /* KERNEL */

/* flags */
#define	FOPEN		(-1)
#define	FREAD		0x01
#define	FWRITE		0x02
#define	FDEVHANDLE	0x80	/* flag passed to mpx device open routine */
#define FOWRITE		0x80	/* when closing, close for MOD */
#define	FMASK		0x300ff	/* only flags less the FMASK are protected
				 * by the token mechanism so far */
#define	FAUTOCONF	0x100	/* flag passed to auto conf open routines */

/***********************************************************
*	Defining FSHLOCK enables the kernel implementation of flock	
*	and overloads FDEFERA. Please excercise caution. Currently
*	affected modules are (lockf, tokens, sysent). Flock is now
*	available in libbsd.
*
*       #define	FSHLOCK	0x40	/ shared lock present    /
*       #define	FEXLOCK	0x100	/ exclusive lock present /
***********************************************************/

#define FSPCL		0x200  	/* this file block used in a non-standard way */
#define FSOCKET	FSPCL
#define FOPRCD		0x400	/* passed to open1 for remote RCD opens */
#define FPRESENT	0x0800	/* token has been acquired */

#define FMARK		0x0800	/* used by unp_gc and unp_mark */
#define FDEFER		0x1000	/* used by unp_gc and unp_mark */

#define FTLOCKED	0x1000	/* token is locked */
#define FTOKWNT		0x2000	/* token is wanted elsewhere */
#define FNETOPEN	0x4000	/* passed to open1/openp on netfork */
#define FDOSOPEN	0x8000	/* file opened using dos-semantics */

/* bits which cant be set with fcntl setfl - should be expanded */
#define	FCNTLCAN	(FNDELAY|FEDELAY|FAPPEND|FASYNC|FSYNC|FREPLSYNC)


/*
 * Flock call.
 */
#define	LOCK_SH		1	/* shared lock */
#define	LOCK_EX		2	/* exclusive lock */
#define	LOCK_NB		4	/* don't block when locking */
#define	LOCK_UN		8	/* unlock */

/*
 * Lseek call.
 */
#define	L_SET		SEEK_SET	/* absolute offset */
#define	L_INCR		SEEK_CUR	/* relative to current offset */
#define	L_XTND		SEEK_END	/* relative to end of file */

#endif /* ~_h_FILE */
1:4kê:Ä   $        ¡  :‰*a™ˆ*:‰*     ýN¡  	              ‘U  ./usr/include/sys/filehdr.h .h e/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

/*	@(#)filehdr.h	2.3 1/19/83 */
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)filehdr.h	16.5	LCC)	/* Modified: 15:55:37 7/13/90 */
/* SCCSIDPUFF(@(#) filehdr.h 4.3 LM 00:08:09 6/21/85 C 00:08:14 6/21/85); */

#ifndef	_h_FILEHDR
#define	_h_FILEHDR

struct filehdr {
	unsigned short	f_magic;	/* magic number */
	unsigned short	f_nscns;	/* number of sections */
	long		f_timdat;	/* time & date stamp */
	long		f_symptr;	/* file pointer to symtab */
	long		f_nsyms;	/* number of symtab entries */
	unsigned short	f_opthdr;	/* sizeof(optional hdr) */
	unsigned short	f_flags;	/* flags */
	};


/*
 *   Bits for f_flags:
 *
 *	F_RELFLG	relocation info stripped from file
 *	F_EXEC		file is executable  (i.e. no unresolved
 *				externel references)
 *	F_LNNO		line nunbers stripped from file
 *	F_LSYMS		local symbols stripped from file
 *	F_MINMAL	this is a minimal object file (".m") output of fextract
 *	F_UPDATE	this is a fully bound update file, output of ogen
 *	F_SWABD		this file has had its bytes swabbed (in names)
 *	F_AR16WR	this file created on AR16WR machine(e.g. 11/70)
 *	F_AR32WR	this file created on AR32WR machine(e.g. vax)
 *	F_AR32W		this file created on AR32W machine (e.g. 3b,maxi)
 *	F_PATCH		file contains "patch" list in optional header
 *	F_NODF		(minimal file only) no decision functions for
 *				replaced functions
 *	F_DEFERC	all files opened for write will be defer committed
 */

#define  F_RELFLG	0000001
#define  F_EXEC		0000002
#define  F_LNNO		0000004
#define  F_LSYMS	0000010
#define  F_MINMAL	0000020
#define  F_UPDATE	0000040
#define  F_SWABD	0000100
#define  F_AR16WR	0000200
#define  F_AR32WR	0000400
#define  F_AR32W	0001000
#define  F_PATCH	0002000
#define  F_NODF		0002000
#define  F_DEFERC	0004000
#define  F_COMMIT	0004000		/* NOT SUPPORTED */


/*
 *   Magic Numbers
 */

	/* Intel */
#define  IAPX16		0504
#define  IAPX16TV	0505
#define  IAPX20		0506
#define  IAPX20TV	0507

#define  IAPX16F	0x4401
#define  IAPX16TVF	0x4501
#define  IAPX20F	0x4601
#define  IAPX20TVF	0x4701

	/* Basic-16 */

#define  B16MAGIC	0502
#define  BTVMAGIC	0503
#define  B16MAGICF	0x4201
#define  BTVMAGICF	0x4301

	/* x86 */

#define  X86MAGIC	0510
#define  XTVMAGIC	0511
#define  X86MAGICF	0x4801
#define  XTVMAGICF	0x4901

	/* Intel 286 */
#define I286SMAGIC	0512
#define I286LMAGIC	0522	/* used by mc68000 (UNIX PC) and iAPX 286 */

#define I286SMAGICF	0x4a01
#define I286LMAGICF	0x5201

	/* Intel 386 */

#define  I386MAGIC	0565	/* Danbury AIX C compiler */
#define  I386SVMAGIC	0514	/* System V C Compiler */

#define  I386MAGICF	0x7501
#define  I386SVMAGICF	0x4c01

	/* 68000 */

#define  M68MAGIC	0210
#define  M68TVMAGIC	0211
#define  MC68MAGIC	0520
#define  MC68TVMAGIC	0521
#define  M68MAGICF	0x8800
#define  M68TVMAGICF	0x8900
#define  MC68MAGICF	0x5001
#define  MC68TVMAGICF	0x5101

	/* u370 */

#define  U370ROMAGIC	0530
#define  U370WRMAGIC	0535
#define  U370ROMAGICF	0x5801
#define  U370WRMAGICF	0x5D01

	/* pasc 370 */

#define P370ROMAGIC	0410
#define P370ROMAGICF	0x0801
#define P370WRMAGIC	0407
#define P370WRMAGICF	0x0701
#define P370PGMAGIC	0413
#define P370PGMAGICF	0x0B01

	/* xa370 */

#define  XA370ROMAGIC	0532
#define  XA370WRMAGIC	0537
#define  XA370ROMAGICF	0x5A01
#define  XA370WRMAGICF	0x5F01

	/* n3b */

/*
 *   NOTE:   For New 3B, the old values of magic numbers
 *		will be in the optional header in the structure
 *		"aouthdr" (identical to old 3B aouthdr).
 */
#define  N3BMAGIC	0550
#define  NTVMAGIC	0551
#define  N3BMAGICF	0x6801
#define  NTVMAGICF	0x6901

	/*  XL  */
#define	 XLMAGIC	0540

	/*  MAC-32   3b-5  */
#define  M80MAGIC	0560
#define  M80MAGICF	0x7001
#define  FBOMAGIC	0560
#define  RBOMAGIC	0562

#define  MTVMAGIC	0561
#define  MTVMAGICF	0x7101


	/* VAX 11/780 and VAX 11/750 */
			/* writeable text segments */
#define VAXWRMAGIC	0570
#define VAXWRMAGICF	0x7801
			/* readonly sharable text segments */
#define VAXROMAGIC	0575
#define VAXROMAGICF	0x7D01

#define	FILHDR	struct filehdr
#define	FILHSZ	sizeof(FILHDR)

#endif /* ~_h_FILEHDR */
 Computkêö¢ }  $        †  ;‰*a™ˆ*;‰*     ¤™†  	                  ./usr/include/sys/fixem.h h .h e/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)fixem.h	16.3	LCC)	/* Modified: 17:42:48 9/16/89 */

#ifndef _h_FIXEM
#define _h_FIXEM

/*
 * "fix 'em"...fix inconsistencies between Locus headers and IX/370 headers
 * so the same set of drivers can be used with both.  (This makes testing
 * them easier...they are intended to be IX/370 drivers.)
 *
 * This is the locus version -
 */
#define	spljh	spl6
#define	thread(addr)		/**/
#define	unthread(addr)		/**/
#define	dethread(addr)		0
#define	rethread(addr, val)	/**/

#if ! defined(b370)

#ifndef MA_INTERRUPTOK

/*
 * Can't use kmemalloc in these modules... fake it with kmalloc/kmfree
 * (from kmalloc.c).
 * (beware of the argument mismatch on mfree: kmfree needs to know the size
 * of the fragment).
 */
extern char *kmalloc();
#define	kmemalloc(size, flags)	kmalloc(size)
#define	mfree	kmfree

#endif /* ~MA_INTERRUPTOK */

#endif	/* ! b370 */

#endif /* _h_FIXEM */
fukê\} |  $        q  ;‰*a™ˆ*;‰*     ¢q  	              UŠ  ./usr/include/sys/flag.h  h .h e/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)flag.h	16.7	LCC)	/* Modified: 18:13:23 9/22/89 */

/************************************************************************
 *	The following flags are defined in this file, some of
 *	them have baroque definitions to deal with baroque compilers.
 *
 *	Flags for iopen/iclose.
 *	----- --- ------------
 *	Open modes.
 *	IG_STAT		open for "stat", just return information
 *	IG_READ		open for "read"
 *	IG_MOD		open for "mod"
 *	IG_NLR		open for no-lock-read, kernel internals only
 *	IG_PROPIN	open local inode to start a propagation
 *	IG_PROPOUT	open inode to propagte to a remote site
 *	IG_PROP		open for any kind of propagation
 *	IG_MODE		disjunction of open modes, masks off namei modes
 *	
 *	Specific version access.
 *	IG_SPECPACK	open a specific gfs pack
 *	IG_SPECVV	open a specific version of the file
 *	IG_SPECSITE	open at a specific site on the network
 *	IG_SPEC		conjunction of SPECVV and SPECSITE
 *	
 *	Mount table control.
 *	IG_NOMOUNT	ignore mount table
 *	
 *	Internal iopen/iclose flags.
 *	-------- ------------ -----
 *	IG_USELOCAL	Can open local copy.
 *	IG_LOCAL	Must use local copy.
 *	IG_DOWNGRADE	(iclose) changing from MOD to READ.
 *	IG_IONLY	Opening for inode-only change (not data).
 *	IG_TRUNC	Truncate the file on open.
 *	IG_REOPEN	File already open at this using site.
 *	IG_FIFO		Re-opening a FIFO.
 *	IG_IMMEDIATE	Tell iget to fail if it would have slept on ilock.
 *	IG_NDELAY	open with "FNDELAY" (meaningful for ttys and fifos)
 *	IG_DELAYCOMMIT  If possible, postpone committing the file.
 *	IG_NOTOKEN	Don't set up inode tokens
 *	IG_NDEALGI	Don't Deallocate the disk image of this generic
 *			device inode (ONLY valid with generic device inodes)
 *	
 *	Namei flags.
 *	----- -----
 *	IG_NEWOK	ok to create a new file
 *	IG_OLDOK	ok to open an existing file
 *	IG_DEL		delete a file (leave the parent open)
 *	IG_SHOWHIDDEN	don't interpret hidden directories
 *	IG_DONTFOLLOW	don't follow symbolic links
 *	IG_LINK		create link to remote file
 *	IG_RENAME	rename file to new file
 *	    IG_IONLY - can be used with IG_RENAME
 *	IG_PARENT	operate on parent of last component (specified in
 *				ni_nameimode only)
 *	IG_NFS		return all NFS filesystem activity to calling site
 *	IG_SYMLINK	operation on symbolic link (create, remove)
 *
 * NOTE:
 *	the only flags which are used in the nmnamei structure
 *	in the ni_nameimode field are:
 *
 *	IG_NOMOUNT 	used internally (within namei) only 
 *	IG_SHOWHIDDEN 	used internally (within namei) only
 *	IG_PARENT	specifies operation on parent of final component
 *	IG_NFS		return all NFS filesystem activity to calling site
 *
 *	Flag values for iclose commit flag.
 *	These names should more closely reflect their functions.
 *	COMMIT		commit file on last ss close for MOD.
 *	NOCOMMIT	abort file on last us close.
 *	NOABORT		abort file on last ss close.
 *
 * flags passed to us_commit and ss_commit
 *	CMT_FLUSH	flush the buffer pool before writing inode
 *	CMT_CLOSE	committing because of last close
 *	CMT_INODE	commit only the inode, not the data
 *	CMT_SAVEPAGES	preserve the old version of the file until closed
 *	CMT_DELETE	deleting the file, internal ss_commit only
 *	CMT_SETATIME	ignore the ss access time (for utime call)
 *	CMT_DELAY	postpone committing file as long as possible.
 *	CMT_WAIT	wait until all disk activity completes
 *
 ************************************************************************/

#ifndef _h_FLAG
#define _h_FLAG

#define IG_STATVALUE			0x1
#define IG_READVALUE			0x2
#define	IG_MODVALUE			0x4
#define IG_NLRVALUE			0x8
#define IG_PROPINVALUE			0x10
#define IG_PROPOUTVALUE			0x20
#define IG_SPECPACKVALUE		0x40
#define IG_DEL		((igflag_t)	0x80L)
#define IG_SPECVV 	((igflag_t)	0x100L)    
#define IG_SPECSITE	((igflag_t)	0x200L)   
#define IG_USELOCAL	((igflag_t)	0x400L)
#define IG_NOMOUNT	((igflag_t)	0x800L)
#define IG_NEWOK	((igflag_t)	0x1000L)
#define	IG_OLDOK	((igflag_t)	0x2000L)
#define	IG_DOWNGRADE	((igflag_t)	0x4000L)
#define IG_IONLY	((igflag_t)	0x8000L) 
#define	IG_TRUNC	((igflag_t)	0x10000L)
#define IG_NFS		((igflag_t)	0x10000L)
#define	IG_REOPEN	((igflag_t)	0x20000L)
#define	IG_FIFO		((igflag_t)	0x40000L)	
#define IG_PARENT	((igflag_t)	0x40000L)
#define	IG_SHOWHIDDEN	((igflag_t)	0x80000L)
#define IG_DONTFOLLOW	((igflag_t)	0x100000L)
#define	IG_LOCAL 	((igflag_t)	0x200000L)
#define	IG_LINK 	((igflag_t)	0x400000L)
#define IG_NOTOKEN	((igflag_t)	0x400000L)
#define	IG_IMMEDIATE 	((igflag_t)	0x800000L)
#define	IG_NDELAY 	((igflag_t)	0x1000000L)
#define IG_DELAYCOMMIT	((igflag_t)	0x2000000L)
#define IG_RENAME	((igflag_t)	0x4000000L)
#define IG_EXECVALUE			0x8000000L
#define IG_SYMLINK	((igflag_t)	0x10000000L)
#define IG_NDEALGI	((igflag_t)	0x20000000L)

#define IG_STAT 	((igflag_t)IG_STATVALUE)
#define IG_READ 	((igflag_t)IG_READVALUE)
#define IG_MOD 		((igflag_t)IG_MODVALUE)
#define IG_NLR 		((igflag_t)IG_NLRVALUE)
#define IG_PROPIN 	((igflag_t)IG_PROPINVALUE)
#define IG_PROPOUT 	((igflag_t)IG_PROPOUTVALUE)
#define IG_SPECPACK 	((igflag_t)IG_SPECPACKVALUE)
#define IG_EXEC		((igflag_t)IG_EXECVALUE)
#define IG_PROP 	(IG_PROPIN | IG_PROPOUT)
#define IG_MODE (IG_STAT|IG_READ|IG_MOD|IG_NLR|IG_PROP|IG_SPECPACK|IG_EXEC)
#define IG_SPEC		(IG_SPECSITE|IG_SPECVV)
#define IG_NODATA	IG_IONLY	/* temporary */

#define NOCOMMIT	0
#define COMMIT		1
#define NOABORT		2

#define CMT_FLUSH	0x1
#define CMT_CLOSE	0x2
#define CMT_INODE	0x4
#define CMT_SAVEPAGES	0x8
#define	CMT_DELETE	0x10
#define CMT_SETATIME	0x20
#define CMT_DELAY	0x40
#define CMT_WAIT	0x80
#define  CASE_IG_STAT		case  IG_STAT
#define  CASE_IG_READ		case  IG_READ
#define  CASE_IG_MOD		case  IG_MOD
#define  CASE_IG_EXEC		case  IG_EXEC
#define  CASE_IG_EXEC1		case  (IG_EXEC|IG_READ)
#define  CASE_IG_NLR		case  IG_NLR
#define  CASE_IG_PROPIN		case  IG_PROPIN
#define  CASE_IG_PROPOUT	case  IG_PROPOUT
#define  CASE_IG_SPECPACK	case  IG_SPECPACK
#define  CASE_IG_SPECPACKANDREAD	case  IG_SPECPACK|IG_READ
#define  CASE_IG_SPECPACKANDMOD		case  IG_SPECPACK|IG_MOD
#ifdef BRIDGE
/* iopen should accept an inode with IMOUNT and IBRIDGE */
#define IG_DOBRIDGE ((igflag_t)0x100000L)
/* in svrproc, NM_OPEN on remote file */
#define IG_BRIDGEF  ((igflag_t)0x200000L)
#endif /* BRIDGE */

#endif  /* ~_h_FLAG */

 *				kê6† {  $        ½  ;‰*ª™ˆ*;‰*     V½  	              Ñ‘  ./usr/include/sys/flip.h  h .h e/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)flip.h	16.4	LCC)	/* Modified: 18:13:59 9/22/89 */
/* SCCSIDPUFF(@(#) flip.jb.h 4.1 LM 12:52:34 4/23/85 C 22:12:24 4/23/85); */

#ifndef _h_FLIP
#define _h_FLIP

/*
   This file provides constants and macros used by the low level
   network code to restore byte and word orders of foreign sites
   to those of the local site.
*/

/*
   Each netmsg has a byte called "nm_order" which tells what the
   local byte order was on the machine which created the message.
   This, along with the local byte order, allows us to flip and understand
   messages from sites with different byte orders from ours.
   the value put in nm_order is, by convention, the flipping necessary
   to read an long int from a VAX.
   (This is arbitrary, but it has the interesting feature that this order
   value, using the below flags, is also the index of the least significant
   byte of a long: 0 on vax, 3 on 68000,...)
*/
extern int loc_order;	/* local byte order */

/*
   The following are constants for the `how' argument to the flipping
   macros and functions, telling how to flip the value passed to them.
*/
#define	NOFLIP	0x0			/* No flip necessary		*/
#define	SFLIP	0x1			/* Flip chars in shorts		*/
#define	LFLIP	0x2			/* Flip shorts in longs		*/
#define	LSFLIP	0x3			/* Flip both longs and shorts	*/
#define	SLFLIP	0x3			/* Convenience			*/

#ifdef KERNEL
extern short	sflipf();		/* Short flip func returns flip	*/
extern long	lflipf();		/* Long flip func returns flip	*/
#else
extern short	sflip();		/* Short flip func returns flip	*/
extern long	lflip();		/* Long flip func returns flip	*/
#endif
extern void	sflipa();		/* Flip short array in place	*/
extern void	lflipa();		/* Flip long array in place	*/

union lparts
{
	struct { char	lp_lc1, lp_lc2, lp_lc3, lp_lc4; }	lp_lc;
	struct { short	lp_ls1, lp_ls2; }			lp_ls;
	long							lp_ll;
};

union sparts
{
	struct { char	sp_sc1, sp_sc2; }	sp_sc;
	short					sp_ss;
};


/*
 NEEDSWORK: I believe the below macros could be made at least 15%
 faster by coding them 1) to flip bytes in place using a single register
 temporary, and by checking first for the flip both chars and shorts case
 explicitly, since this is the only case we are likely to run into in the
 near future.  (1) is probably even more true of lflipa and sflipa.
*/
/*
   dosflipm: Flip short in place unconditionally

   args:
	s	short to flip in place
	ts	temporary short

   The (union sparts *)(&s) notation allows the caller to pass a short
   instead of a `union sparts'.
*/
#define	dosflipm(s, ts)\
  ((union sparts *)(&ts))->sp_sc.sp_sc1 = ((union sparts *)(&s))->sp_sc.sp_sc2;\
  ((union sparts *)(&ts))->sp_sc.sp_sc2 = ((union sparts *)(&s))->sp_sc.sp_sc1;\
  s = ((union sparts *)(&ts))->sp_ss;

/*
   sflipm: Flip a short in place if necessary

   args:
	s	short to flip in place
	ts	temporary short
	how	how to flip it
*/
#define	sflipm(s, ts, how) \
	if ((how) & SFLIP) { \
		dosflipm(s, ts); \
	}

/*
   lflipm: long in place flip macro

   args:
	l	long to flip in place
	tl	temporary long
	how	how to flip it

   The (union lparts *)(&l) notation allows the caller to pass a long
   instead of a `union lparts'.
*/
#ifdef M_XENIX	/* no long macros */
#define lflipm(l, tl, how)	(l = lflipf(l, how))
#else /* !M_XENIX */

#ifndef KERNEL
/*
 * allow user programs access to all the possible flipping orders,
 * to maintain compatibility with existing software.
 */
#define	MIXEDENDIAN
#endif

#ifndef	MIXEDENDIAN
/*
 * Don't bother to check for byte orders which don't exist (i.e. assume
 * that all machines are either BIGENDIAN (370ish) or LITTLENDIAN (vaxish).
 * (note that the check is "how != NOFLIP" rather than "HOW == LSFLIP" since
 * checking for not-zero (NOFLIP is 0) is faster on most machines.
 */
#define	lflipm(l, tl, how)\
 if (how != NOFLIP) { \
  ((union lparts *)(&tl))->lp_lc.lp_lc1 = ((union lparts *)(&l))->lp_lc.lp_lc4;\
  ((union lparts *)(&tl))->lp_lc.lp_lc2 = ((union lparts *)(&l))->lp_lc.lp_lc3;\
  ((union lparts *)(&tl))->lp_lc.lp_lc3 = ((union lparts *)(&l))->lp_lc.lp_lc2;\
  ((union lparts *)(&tl))->lp_lc.lp_lc4 = ((union lparts *)(&l))->lp_lc.lp_lc1;\
  l = tl;\
 } else

#else /*MIXEDENDIAN*/
#define	lflipm(l, tl, how)\
 switch (how)\
 {\
 case NOFLIP: break;\
 case SFLIP:\
  ((union lparts *)(&tl))->lp_lc.lp_lc1 = ((union lparts *)(&l))->lp_lc.lp_lc2;\
  ((union lparts *)(&tl))->lp_lc.lp_lc2 = ((union lparts *)(&l))->lp_lc.lp_lc1;\
  ((union lparts *)(&tl))->lp_lc.lp_lc3 = ((union lparts *)(&l))->lp_lc.lp_lc4;\
  ((union lparts *)(&tl))->lp_lc.lp_lc4 = ((union lparts *)(&l))->lp_lc.lp_lc3;\
  l = tl;\
  break;\
 case LFLIP:\
  ((union lparts *)(&tl))->lp_ls.lp_ls1 = ((union lparts *)(&l))->lp_ls.lp_ls2;\
  ((union lparts *)(&tl))->lp_ls.lp_ls2 = ((union lparts *)(&l))->lp_ls.lp_ls1;\
  l = tl;\
  break;\
 case LSFLIP:\
  ((union lparts *)(&tl))->lp_lc.lp_lc1 = ((union lparts *)(&l))->lp_lc.lp_lc4;\
  ((union lparts *)(&tl))->lp_lc.lp_lc2 = ((union lparts *)(&l))->lp_lc.lp_lc3;\
  ((union lparts *)(&tl))->lp_lc.lp_lc3 = ((union lparts *)(&l))->lp_lc.lp_lc2;\
  ((union lparts *)(&tl))->lp_lc.lp_lc4 = ((union lparts *)(&l))->lp_lc.lp_lc1;\
  l = tl;\
  break;\
 }
#endif /*MIXEDENDIAN*/
#endif /* M_XENIX! */

/*
 * SPECIAL PURPOSE FLIP MACROS
 *	these may be more efficient and appropriate than the standard flip 
 *	macros because they save an assignment and do not change the value
 *	of the field being flipped
 */
#ifdef M_XENIX	/* no long macros */
#define asgnflps(s,ns,how)	(ns = sflipf(s, how))
#else /* !M_XENIX */
#define asgnflps(s,ns,how) if ((how)&SFLIP) {\
  ((union sparts *)(&ns))->sp_sc.sp_sc1 = ((union sparts *)(&s))->sp_sc.sp_sc2;\
  ((union sparts *)(&ns))->sp_sc.sp_sc2 = ((union sparts *)(&s))->sp_sc.sp_sc1;\
} else {ns = s;}
#endif /* M_XENIX! */

#ifdef M_XENIX	/* no long macros */
#define asgnflpl(l,nl,how)	(nl = lflipf(l, how))
#else /* !M_XENIX */
#ifndef MIXEDENDIAN
#define asgnflpl(l,nl,how)\
 if (how != NOFLIP) {\
  ((union lparts *)(&nl))->lp_lc.lp_lc1 = ((union lparts *)(&l))->lp_lc.lp_lc4;\
  ((union lparts *)(&nl))->lp_lc.lp_lc2 = ((union lparts *)(&l))->lp_lc.lp_lc3;\
  ((union lparts *)(&nl))->lp_lc.lp_lc3 = ((union lparts *)(&l))->lp_lc.lp_lc2;\
  ((union lparts *)(&nl))->lp_lc.lp_lc4 = ((union lparts *)(&l))->lp_lc.lp_lc1;\
} else nl = l

#else /*MIXEDENDIAN*/
#define asgnflpl(l,nl,how)\
 switch (how)\
 {\
 case NOFLIP:\
  nl = l;\
  break;\
 case SFLIP:\
  ((union lparts *)(&nl))->lp_lc.lp_lc1 = ((union lparts *)(&l))->lp_lc.lp_lc2;\
  ((union lparts *)(&nl))->lp_lc.lp_lc2 = ((union lparts *)(&l))->lp_lc.lp_lc1;\
  ((union lparts *)(&nl))->lp_lc.lp_lc3 = ((union lparts *)(&l))->lp_lc.lp_lc4;\
  ((union lparts *)(&nl))->lp_lc.lp_lc4 = ((union lparts *)(&l))->lp_lc.lp_lc3;\
  break;\
 case LFLIP:\
  ((union lparts *)(&nl))->lp_ls.lp_ls1 = ((union lparts *)(&l))->lp_ls.lp_ls2;\
  ((union lparts *)(&nl))->lp_ls.lp_ls2 = ((union lparts *)(&l))->lp_ls.lp_ls1;\
  break;\
 case LSFLIP:\
  ((union lparts *)(&nl))->lp_lc.lp_lc1 = ((union lparts *)(&l))->lp_lc.lp_lc4;\
  ((union lparts *)(&nl))->lp_lc.lp_lc2 = ((union lparts *)(&l))->lp_lc.lp_lc3;\
  ((union lparts *)(&nl))->lp_lc.lp_lc3 = ((union lparts *)(&l))->lp_lc.lp_lc2;\
  ((union lparts *)(&nl))->lp_lc.lp_lc4 = ((union lparts *)(&l))->lp_lc.lp_lc1;\
  break;\
 }
#endif /*MIXEDENDIAN*/
#endif /* M_XENIX! */

#endif  /* ~_h_FLIP */
* !kêìt ˜  $        ö  ‰*¸ ˆ*‰*     '†ö  
              On  ./usr/include/sys/font.h  h .h e#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)font.h	1.2	AIX)	/* Modified 9/17/89 00:26:20 */

/* @(#)font.h   2.4 87/07/22 12:29:42  */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/* Copyright International Business Machines Corporation 1987
 *
 * The following file describes a general purpose font format
 * for the IBM RT.
 *
 * Each font file contains the following data structures in the
 * following order:
 *
 *     FONT_HEAD  - Font Header
 *     CHAR_INDEX - Character Index
 *     CHAR_INDEX - Character Index Array which contains the offset for
 *              each glyph CHAR_GLYPH
 *     CHAR_GLYPH - Character Glyphs
 *
 * The Font Header contains information about the font in general.  The
 * Font Header also contains offsets to the Character Index Array and to
 * the Character Glyphs.
 *
 * The Character Index is an array of index modifiers and Character Glyph
 * offsets.  Index modifiers are used to modify the next index value used
 * to access the array.  Index modifiers have the high order bit (bit 0)
 * set while glyph offsets do not.  If the second high order bit (bit 1)
 * is set, then the index is not a code point.
 *
 * The Character Glyphs contain information unique to each character plus
 * the (possibly encoded) raster image.
 *
 */
 
/*
 * Character Bounds
 */
 
typedef struct {
    int  rbearing;      /* Origin to right edge of raster       */
    int  lbearing;      /* Origin to left edge of raster        */
    int  descent;       /* Baseline to bottom edge of raster    */
    int  ascent;        /* Baseline to top edge of raster       */
    int  width;         /* Advance to next char origin          */
} BOUNDS;
 
/*
 * Character Glyphs
 */
 

typedef struct {
    char      char_flag;        /* character flag   */
#define RUN_COUNT1 0x00000000   /*   dyn_f = 0      */
#define RUN_COUNT3 0x00001101   /*   dyn_f = 13     */
#define BIT_MAP    0x00001110   /*   dyn_f = 14     */
    char      resv[3];          /* reserved (all 0) */
    unsigned  tfm;              /* TeX Font Metric  */
    BOUNDS    char_bounds;      /* character bounds */
    char      char_bits[1];     /* character glyph  */
} CHAR_GLYPH, *CHAR_GLYPHPTR;
 
 
/*
 * Character Index Array
 *
 *    bit  31   : index modifier if set
 *    bit  30   : index is a code point if NOT set
 *    bit  29   : reserved (0)
 *    bit  28   : reserved (0)
 *    bits 27-0 : offset to glyph
 */
 
typedef int   CHAR_INDEX, *CHAR_INDEXPTR;
 
#define INDMOD  0x80000000      /* index is a modifier bit           */
#define INDCPT  0x40000000      /* index is not a code point bit     */
#define INDMASK 0xF0000000      /* index mask for control bits       */

/*
 * Font Header
 */
 
typedef struct {                                                                
   char       font_id[16];    /* Font ID                              */
   unsigned   off_to_index;   /* Offset to character index array      */        
   unsigned   off_to_glyphs;  /* Offset to character glyphs           */        
   unsigned   glyph_format;   /* Format of the glyph data.            */        
#define RASTER_DATA   0x00    /* All glyphs in raster format.         */
#define PK_DATA       0x01    /* All glyphs in PK format.             */
   unsigned   src_file_type;  /* Source file type.                    */        
#define RT_SRC_FILE     0x00  /* Source file was an "RT" font file    */
#define PK_SRC_FILE     0x01  /* Source file was an "PK" font file    */
#define X10_SRC_FILE    0x02  /* Source file was an "X10"  font file  */
#define X11_SRC_FILE    0x03  /* Source file was an "X11"  font file  */
   unsigned   design_size;    /* Design size in 1/2**16 points (Tex)  */        
   unsigned   check_sum;      /* Check Sum (TeX)                      */        
   unsigned   hppp;           /* Horizontal Pixels Per Point * 2**16  */        
   unsigned   vppp;           /* Vertical Pixels Per Point * 2**16    */        
   unsigned   fiFlags;        /* Flags field bits                     */        
   unsigned   firstCol;       /* reserved (set to 0)                  */
   unsigned   lastCol;        /* reserved (set to 0)                  */
   unsigned   firstRow;       /* reserved (set to 0)                  */
   unsigned   lastRow;        /* reserved (set to 0)                  */
   unsigned   nProps;         /* Number of Properties                 */        
   unsigned   chDefault;      /* Default Character                    */        
   unsigned   font_Descent;   /* Extent below baseline for spacing    */        
   unsigned   font_Ascent;    /* Extent above baseline for spacing    */        
   BOUNDS     minbounds;      /* Min glyph metrics over all chars     */        
   BOUNDS     maxbounds;      /* Max glyph metrics over all chars     */        
   unsigned   pixDepth;       /* Intensity bits per pixel             */        
   unsigned   glyphSets;      /* Number of sets of glyphs, for
                                 subpixel positioning                 */        
   unsigned   raster_align;   /* The scanline alignment for glyphs    */
                              /* that are in raster format. The first */        
                              /* scanline of a glyph in raster format */
                              /* always begins on a fullword. This    */
                              /* flag gives the boundary of subsequent*/
                              /* scanlines.                           */
#define NO_ALIGN      0x00    /* Scanlines packed end to beginning.   */
#define BYTE_ALIGN    0x07    /* Subsequent scanlines on byte bound.  */
#define HWD_ALIGN     0x0F    /* Subsequent scanlines on halfword bnd.*/
#define FWD_ALIGN     0x1F    /* Subsequent scanlines on fullword bnd.*/
   unsigned   index_width;    /* Width of Char Index Array Structure  */
   unsigned   char_width;     /* Width Constant if monospace          */
   unsigned   char_height;    /* Height Constant if monospace         */
   unsigned   last_index;     /* Last  character index in font        */
   unsigned   codepoints_less_1; /* Number of code points minus 1     */
   int        app_var[4];     /* For application use                  */
   char       pad[64];        /* reserved (set to 0)                  */
   } FONT_HEAD, *FONT_HEADPTR;
ndkêþJ ¶  $        ~  ‰*¨ ˆ*‰*     m%~  	                  ./usr/include/sys/fpcontrol.h  e#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)fpcontrol.h	1.4	AIX)	/* Modified 9/22/89 19:09:05 */
/* 
* Copyright (C)  1989, Locus Computing Corporation
 * All Rights Reserved
 */ 
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*  Define 80387 control word parts to be used with fpcontrol.s		*/
/*  routines fp_control(), fp_exmask(), fp_exunmask(),			*/
/*  fp_round(), fp_precision() and fp_restore().			*/

#ifndef h_fpcontrol
#define h_fpcontrol

/* This group is to be used with:					*/
/* fp_control(), fp_exmask() and fp_exunmask()				*/

#define FPM_INV_OP	0x0001
#define FPM_DENORM	0x0002
#define FPM_DIVIDE_0	0x0004
#define FPM_OVERFLOW	0x0008
#define FPM_UNDERFLOW	0x0010
#define FPM_PRECISION	0x0020

/* This group is to be used with:					*/
/* fp_control() and fp_round()						*/

#define FPR_NEAR	0x0000
#define FPR_DOWN	0x0400
#define FPR_UP		0x0800
#define FPR_CHOP	0x0c00

/* This group is to be used with:					*/
/* fp_control() and fp_precision()					*/

#define FPP_SINGLE	0x0000
#define FPP_DOUBLE	0x0200
#define FPP_EXTENDED	0x0300

#endif
 fkê6™ z  $        Ñ  ;‰*b™ˆ*;‰*     ”Ñ  	              ‚“  ./usr/include/sys/fstypes.h h  e/*
 *
 *      This file defines legal file system type codes, and includes macros
 *      that calculate blocksize-dependent file system parameters as a
 *      function of the type.
 */
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)fstypes.h	16.4	LCC)	/* Modified: 18:14:34 9/22/89 */
/* 
* Copyright (C)  1989, Locus Computing Corporation
 * All Rights Reserved
 */ 
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _h_FTYP
#define _h_FTYP

#include <sys/types.h>

/*
 *  File system type codes:
 *      These codes reside in the last byte f the file system type code
 *      (i.e, "s_type[3]").
 */

#define FsVar   0               /* Variable (or unknown) blocksize         */
#define Fs1b    1               /* 512-byte blocksize file system          */
#define Fs2b    2               /* 1024-byte blocksize                     */
#define Fs4b    3               /* 2048-byte blocksize                     */
#define Fs8b    4               /* 4096-byte blocksize                     */
#define Fs16b   5               /* 8192-byte blocksize                     */
#define Fs32b   6               /* 16384-byte blocksize                    */
#define Fs64b   7               /* 32768-byte blocksize                    */

/*
 *  File System Parameter Table Definitions:
 *
 *      The File System Parameter table provides blocksize-dependent
 *      file system information as a function of file system type.  The
 *      structure definition describes a single table entry, and the
 *      macros that follow can be used to extract data from the table.
 */

struct _FSpmap          /* Format of a file system parm table entry     */
{   ushort FS_typecd;   /* ... file system type code                    */
    ushort FS_blksize;  /* ... file system block size                   */
    ushort FS_bmask;    /* ... block offset mask                        */
    ushort FS_nmask;    /* ... mask to locate ptrs in indirect blocks   */
    ushort FS_inopb;    /* ... number of I-nodes per block              */
    ushort FS_nindir;   /* ... number of daddr_t's per indirect block   */
    ushort FS_inomask;  /* ... mask to get I-node within a block        */
    ushort FS_bshift;   /* ... log2(blocksize)                          */
    ushort FS_ishift;   /* ... log2(I-nodes per block)                  */
    ushort FS_nshift;   /* ... log2(daddr_t's per block)                */
    ushort FS_chnksize; /* ... blocksize/256                            */
};

#if !defined(lint) && defined(_FSpgen)

/*
 *  The file system parameter table.  If this file is included in a module
 *      that has the "_FSpgen" symbol defined, we compile the file system
 *      parameter table as a static variable.
 */

#define LOG2(x) ( ((x) <   2) ? 0 : (          \
		  ((x) <   4) ? 1 : (          \
		  ((x) <   8) ? 2 : (          \
		  ((x) <  16) ? 3 : (          \
		  ((x) <  32) ? 4 : (          \
		  ((x) <  64) ? 5 : (          \
		  ((x) < 128) ? 6 : (          \
		  ((x) < 256) ? 7 : (          \
		  ((x) < 512) ? 8 : 9))))))))  \
		)

#define BSmin   LOG2(UBSIZE)
#define ISmin   LOG2(UBSIZE/sizeof(struct dinode))
#define NSmin   LOG2(UBSIZE/sizeof(daddr_t))

#define FSPARM(t,b)  { (t),                             /* TYPE CODE    */ \
		       (b),                             /* BLKSIZE      */ \
		       ((b)-1),                         /* BMASK        */ \
		       (((b)/sizeof(daddr_t))-1),       /* NMASK        */ \
		       ((b)/sizeof(struct dinode)),     /* INOPB        */ \
		       ((b)/sizeof(daddr_t)),           /* NINDIR       */ \
		       (((b)/sizeof(struct dinode))-1), /* INOMASK      */ \
		       (BSmin + ((t)-1)),               /* BSHIFT       */ \
		       (ISmin + ((t)-1)),               /* ISHIFT       */ \
		       (NSmin + ((t)-1)),               /* NSHIFT       */ \
		       ((b)/256)                        /* CHNKSIZE     */ \
		     }


struct _FSpmap _FSparms[] = { FSPARM(Fs1b,   UBSIZE),
			      FSPARM(Fs2b,  (UBSIZE * 2)),
			      FSPARM(Fs4b,  (UBSIZE * 4)),
			      FSPARM(Fs8b,  (UBSIZE * 8)),
			      FSPARM(Fs16b, (UBSIZE * 16)),
			      FSPARM(Fs32b, (UBSIZE * 32)),
			      FSPARM(Fs64b, (UBSIZE * 64))
			    };

#else
extern struct _FSpmap _FSparms[];
#endif

/*
 *  Macros to extract parameters from FSparm table.  "t" is a file system
 *      type code (e.g, "s_type" field from superblock).
 */

#ifdef  BMASK
#undef  BMASK
#undef  NMASK
#undef  INOPB
#undef  NINDIR
#undef  INOMASK
#undef  BSHIFT
#undef  NSHIFT
#endif

#define BLKSIZE(t)      _FSparms[(t)-1].FS_blksize
#define BMASK(t)        _FSparms[(t)-1].FS_bmask
#define NMASK(t)        _FSparms[(t)-1].FS_nmask
#define INOPB(t)        _FSparms[(t)-1].FS_inopb
#define NINDIR(t)       _FSparms[(t)-1].FS_nindir
#define INOMASK(t)      _FSparms[(t)-1].FS_inomask
#define BSHIFT(t)       _FSparms[(t)-1].FS_bshift
#define ISHIFT(t)       _FSparms[(t)-1].FS_ishift
#define NSHIFT(t)       _FSparms[(t)-1].FS_nshift
#define CHNKSIZE(t)     _FSparms[(t)-1].FS_chnksize

/*
 *  Macros to convert I-node numbers to block numbers and visa versa.
 */

#ifdef  itod
#undef  itod
#undef  itoo
#endif

#define itod(x,t) (daddr_t)((((unsigned)(x)-1)>>ISHIFT(t))+2)
#define itoo(x,t) (int)(((x)-1)&INOMASK(t))

#endif
    */
kêœì y  $        E  ;‰*b™ˆ*;‰*     ç½E  	                  ./usr/include/sys/fullstat.h   e#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)fullstat.h	16.5	LCC)	/* Modified: 13:00:42 10/12/89 */
/* 
* Copyright (C)  1989, Locus Computing Corporation
 * All Rights Reserved
 */ 
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _h_FULLSTAT
#define _h_FULLSTAT

#ifndef _h_STAT
#ifdef KERNEL
#include <stat.h>
#else /* !KERNEL */
#include <sys/stat.h>
#endif /* !KERNEL */
#endif /* !_h_STAT */

struct fullstat
{
	dev_t	st_dev;
	ino_t	st_ino;
	mode_t  st_mode;
	nlink_t	st_nlink;
	ushort	st_spare0;
	uid_t	st_uid;
	gid_t	st_gid;
	dev_t	st_rdev;
	off_t	st_size;
	time_t	st_atime;
	ulong	st_spare1;
	time_t	st_mtime;
	ulong	st_spare2;
	time_t	st_ctime;
	ulong	st_spare3;
	ulong	st_blksize;
	ulong	st_blocks;
	ulong	fst_i_gen;
	ulong	fst_type;
	ulong	fst_vfs;
	ulong	fst_flag;
	ulong	st_cmtcnt;
	fstore_t st_fstore;
	ulong	st_version;
	siteno_t st_css;
	siteno_t st_ss;
	siteno_t st_rdevsite;
	short	st_spare4;
	long	fst_nid;
	uid_t	fst_uid_raw;
	gid_t	fst_gid_raw;
	ulong	fst_uid_rev_tag;
	ulong 	fst_gid_rev_tag;
};

/*
 * Defines for fullstat/ffullstat cmd argument
 */
#define	FL_STAT		STX_TRANS_NONE	/* Fullstat */
#define	FL_STAT_REV	STX_TRANS	/* Fullstat with uid/gid */
					/*   reverse mapping	 */
#define FL_STAT_OTHER	STX_TRANS_OTHER	/* Same as above, but "biased" */
					/*   toward another uid/gid    */

/*
 * Compatibility defines for fullstat users
 */
#define CALLER		IDTAG_CALLER
#define OTHER		IDTAG_OTHER
#define SOMEONE		IDTAG_SOMEONE
#define NO_ONE		IDTAG_NO_ONE

#endif	/* h_FULLSTAT */
w ckê¦ x  $        q  <‰*d™ˆ*<‰*     ‘“q  	                  ./usr/include/sys/glpdefs.h    e/*
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1988, 1989 IBM Corp.
*	(c) Copyright 1988, 1989 Locus Computing Corporation
 *	All Rights Reserved
 *
 * module:
 *	glpdefs.h
 *
 * purpose:
 *	definitions of state bits and type codes for generic printer
 *
 * major data structures:
 *	glp structure overlays t_cc array in the tty struture
 *
 */

#include <sccs.h>
H_SCCSID(@(#)glpdefs.h	16.3	LCC)	/* Modified: 17:47:25 9/16/89 */

/* states */
#define INITED  01              /* vecinit has suceeded before */
#define TIMERON 02              /* Timeout set */
#define NOBUFF  04              /* PLOT & LPRSYNC -> no buffering */
#define OPEN    010             /* device open */
#define CLOSING 020             /* drop through errcheck in close */
#define YESIO   040             /* io happened, so FF in close */
#define ASLP    0100            /* device sleeping */
#define LP_PAR  0200            /* fatal error flag */
#define RDERR   0400            /*  error flag for lpread routine */
#define WROTE   01000           /* issued a start io write svc */
#define NOHANG  02000           /* avoid sio hang in lpopen and lpclose */
#define READSVC 04000           /* just did a read svc */
#define SENTSIG 010000          /* sent signal to backend */
#define SCHANGE 020000          /* changed sync flag in close routine */
#define SPIN    040000          /* interrupted out of sleep */
#define LPTIMEO 0100000		/* timeout error pending */

#define LPHIWAT 2*1024 		/* 2K print buffer */
#define LPLOWAT 64
#define LPHOG	80		/* maximum unread input allowed */

#define FF 0x0C			/* character code for formfeed */

#define LPPARRELL	1	/* devtype code for parallel printers */


/* The Generic line discipline has several variables associated
 * with each unit. These variables are redefined from unused
 * fields in the tty struct.
 */

/* The ttychar struct in tty is not used by the drivers when the
 * generic line discipline is in use. We use this space with a
 * union defined in tty.h. But here we redefine it so it's easier
 * to use.
 */
#define glp_state t_glp.glpu_state		/* glp internal state */
#define glp_modes t_glp.glpu_modes		/* glp main modes */
#define glp_oprflags t_glp.glpu_oprflags	/* glp extra modes */
#define glp_timeout t_glp.glpu_timeout		/* timeout count */
#define glp_ccc t_glp.glpu_ccc			/* current column */
#define glp_mlc t_glp.glpu_mlc			/* lines on page */
#define glp_mcc	t_glp.glpu_mcc			/* chars on line */
#define glp_procp	t_glp.glpu_procp	/* process to signal */
#define glp_devtype	t_devtype		/* glp device type */


/* Some of the other fields in tty are not used by the drivers them self
 * when the generic line disc is in use. Below they are redefined
 * for our uses.
 */
#define glp_lflags t_bstate		/* gpa internal state */
#define glp_ind t_rocol			/* indent */	
#define glp_linesz t_lpos		/* maximum page length */
#define glp_col t_col			/* maximum line width */
) <  16kê€ Î  íA            ‰*s‰*s‰*       €  	                  ./usr/include/sys/hft efkêhÂ w  $        ªv  <‰*a˜ˆ*<‰*     £eªv  	              ­«  ./usr/include/sys/hft.h #ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)hft.h	16.4.1.3	LCC)	/* Modified: 15:38:45 8/13/91 */
/* H_SCCSIDgen1(@(#)hft.h	1.9	AIX);	Modified 1/19/89 12:32:53 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _h_HFT
#define _h_HFT
#include <sys/types.h>
/*              hft unique ioctls               */
#define HFIOC	('h'<<8)
#define HFGETID (HFIOC|1)   /* Get VT identification info */
#define HFQUERY (HFIOC|2)   /* Query VRM about terminal */
#define HFSKBD	(HFIOC|3)   /* Set Keybd map */
#define HFSECHO (HFIOC|4)   /* Set keybd echoing */
#define HFSMON  (HFIOC|5)   /* Request to set monitor mode */
#define HFCMON  (HFIOC|6)   /* Clear monitor mode */
#define HFGCHAN (HFIOC|7)   /* Get channel number */
#define HFQSMGR (HFIOC|8)   /* Query Screen Manager */
#define HFCSMGR (HFIOC|9)   /* Control Screen Manager */
#define HFRCONF (HFIOC|10)  /* reconfigure resource controller */
#define HFESOUND (HFIOC|11)  /* enable sound signals */
#define HFDSOUND (HFIOC|12)  /* disable sound signals */
#define HFQEIO   (HFIOC|13)   /* Query Terminal Error Value */
#define HFQDEV   (HFIOC|14)   /* Query Device Dependent data*/
#define HFSKEP   (HFIOC|15)	/* Set   "KEP" signal handling  */
#define HFCKEP   (HFIOC|16)	/* Clear "KEP" signal handling  */
#define HFMDMA   (HFIOC|17)   /* Move data via DMA controls */
#define HFSJKBD (HFIOC|18)   /* Set Japanese Keybd map */
#define HFGETVIDRAM (HFIOC|19)   /* used in console.c ioctl */
#define HFRELVIDRAM (HFIOC|20)   /* used in console.c ioctl */
#define GET_SCR_ACC (HFIOC|21)   /* used by vtt routines */
#define REL_SCR_ACC (HFIOC|22)   /* used by vtt routines */
#define HFTINIT_DISP  (HFIOC|23)   /* used by hftinit  */
#define HFTINIT_MAPS  (HFIOC|24)   /* used by hftinit  */ 
#define HFTINIT_ENTRY (HFIOC|25)   /* used by hftinit  */
#define HFTINIT_BOOT (HFIOC|26)    /* used by hftinit  */
#define	HFQSOUND     (HFIOC|27)    /* query sound */
#define HFTSMPROC    (HFIOC|28) /* Perform virtual terminal switching */

#define HFSRINGSELPTR	(HFIOC|99)	/* set MOM ring select pointer */


/* VTD introducer */
#define HFINTROESC      '\033'
#define HFINTROLBR      '['
#define HFINTROEX       'x'

struct hfintro
{
    char hf_esc;
    char hf_lbr;
    char hf_ex;
    char hf_len[4];                     /* length points to end of control */
    char hf_typehi;                     /* high byte of type */
    char hf_typelo;                     /* low byte of type */
};
#define HFINTROSZ       sizeof(struct hfintro)

/*      HFGETID  ioctl          */
struct hfgetid {
	unsigned hf_iodn;
	unsigned hf_pgrp;
	unsigned hf_chan;
};

/*      HFSTECHO, HFSKBD, HFQSMGR  ioctls */
struct hfbuf {
	char *hf_bufp;
	int   hf_buflen;
};

/* HFSKBD  ioctl      */
struct hfkeymap {
	char  hf_rsvd1;
	char  hf_nkeys;     /* # keys being mapped */
#ifndef HFNKEYS
#define HFNKEYS         1
#endif
	struct hfkey {
		char hf_kpos;   /* Key position # */
		char hf_kstate; /* Shift/Alt/Ctrl state, map type */
#define HFMAPMASK  0x0f         /* mask type field */
#define HFMAPCHAR  0x00         /* map single character */
#define HFMAPFUNC  0x01         /* map function ID */
#define HFMAPNONSP 0x02         /* map non-spacing character */
#define HFMAPSTR   0x04         /* map string */

#define HFSHFMASK  0x70         /* mask for shift field */
#define HFSHFNONE  0x00         /* base state */
#define HFSHFALTGR 0x10         /* alt graphic state */
#define HFSHFSHFT  0x20         /* shift state */
#define HFSHFCTRL  0x40         /* control state */
#define HFSHFALT   0x60         /* alt state */

#define HFCAPSL    0x80         /* caps lock applies */
		struct hfkeyasgn         /* assignment structure */
		{
		     /* for single character */
		     char hf_pagenum;      /* Code page  */
		     char hf_character;   /* Character to map  */
#define hf_page      hf_keyasn.hf_pagenum
#define hf_char      hf_keyasn.hf_character
		     /* for function id */
#define hf_keyidh    hf_pagenum          /* high byte of id */
#define hf_keyidl    hf_character        /* low byte of id */
		     /* for character string */
#define hf_kstrl     hf_character        /* length of string */

		}hf_keyasn;
	} hfkey[HFNKEYS];
};

/*
 * The HFSKEYMAP define defined below might be used like this:
 *
 * HFSKEYMAP(2, hidef)
 * hidef.hf_nkeys = 1;
 * hidef.hf_kpos = 1;         below ESC key
 * hidef.hf_kstate = HFMAPSTR + HFSHFNONE;
 * hidef.hf_pagenum = '<';    P0
 * hidef.hf_kstrl = 2;
 * hidef.hf_carray[0] = 'h';
 * hidef.hf_carray[1] = 'i';
 */
#define HFSKEYMAP(SLEN, SNAME) struct {                                 \
	char hf_rsvd1;                                                  \
	char hf_nkeys;          /* must be 1 */                         \
	char hf_kpos;           /* Key position # */                    \
	char hf_kstate;         /* Shift/Alt/Ctrl state, map type */    \
	char hf_pagenum;        /* Code page  */                        \
	char hf_kstrl;          /* must be SLEN */                      \
	char hf_carray[SLEN];   /* not a string (no trailing '\0') */   \
} SNAME;


/* HFQSMGR ioctl - query screen manager  */
#ifndef HFNUMVTS
#define HFNUMVTS 16
#endif

struct hfqstat
{
   short hf_numvts;
   struct hfvtinfo
   {
     unsigned short hf_vtiodn;            /* iodn of terminal */
     unsigned short hf_vtstate;           /* state of terminal */
   } hf_vtinfo[HFNUMVTS];                 /* element per terminal */
/* valid states */
#define HFVTHIDDEN  0x8000              /* hidden terminal */
#define HFVTACTIVE  0x4000              /* active terminal */
#define HFVTCOMMAND 0x2000              /* command terminal */
};

/*      HFCSMGR  ioctl -  Control Screen manager          */
struct hfsmgrcmd {
	int hf_cmd;
	int hf_vtid;
	int hf_vsid;
};
#define SMSCMD	 0
#define SMACT	 0x10
#define SMHIDE	 0x20
#define SMUNHIDE 0x30
#define SMCVTEN  0x40
#define SMCVTDI  0x50

#if !defined(_KERNEL) && !defined(MAX_MON_ADDRS)
#define MAX_MON_ADDRS  1
#endif


/*  HFSMON  , HFESOUND ioctl       */
struct hfsmon {
	int hf_momflags;			/* defined below */
	int hf_momscnt;				/* number of addresses available */
#ifdef _KERNEL
	caddr_t hf_momsaddrs[1];     /* user process virtual addrs of phys mem */
#else	/* ! _KERNEL */
	caddr_t hf_momsaddrs[MAX_MON_ADDRS];
#endif	/* ! _KERNEL */
};

/* hf_momflags values */
#define HFSINGLE  1     /* single process to receive monitor mode signals */
#define HFGROUP   2     /* tty group to receive monitor mode signals */

/* HFQDEV ioctl         */
struct hfqdev
{
   unsigned short hf_qdrsvd;
   unsigned short hf_qdopts;
   unsigned int hf_qdlen;
};

/* HFQDEV response structure */
struct hfqdresp
{
   ushort hf_vtrmiodn;
   ushort hf_vtrmiocn;
   ushort hf_rsvd1;
   ushort hf_devtype;
   char   hf_devname[4];
   char   hf_rsvd2[4];
   int    hf_hwoffset;
   int    hf_devoffset;
   int    hf_erroffset;
   char   hf_rsvd3;
   char   hf_newics;
   char   hf_statflags;
   char   hf_ovrncnt;
   ushort hf_opresult;
   ushort hf_deviodn;
   int    hf_dataword1;
   int    hf_dataword2;
   int    hf_dataword3;
   int    hf_ddilen;
   int    hf_rc;
   ushort hf_smiocn;
   ushort hf_vtmpiocn;
   ushort hf_rsvd4;
   ushort hf_keyiodn;
   ushort hf_lociodn;
   ushort hf_spkiodn;
   int    hf_numfont;
   ushort hf_fontiocn[32];
   int    hf_numdisp;
   struct hfphysd
   {
     uint   hf_devid;
     ushort hf_deviodn;
     ushort hf_deviocn;
   }hf_physd[4];
   ushort hf_keymapiocn;
   ushort hf_chrmapiocn;
   ushort hf_echomapiocn;
   ushort hf_initiocn;
   ushort hf_dialsiodn;
   ushort hf_lpfkiodn;
};

/*      HFRCONF ioctl           */
struct hfrconf
{
  unsigned hf_op;
  unsigned hf_obj;
  union
  {
    uint hf_infob;
    struct
    {
       ushort hf_iodn;
       ushort hf_iocn;
    } hf_info2;
  }hf_info;
  /* MSK added union to allow loading of various system maps */
  union
  {
    char *hf_cptr;
    struct hfbuf *hf_hfbufptr;
  } hf_mapinfo;
};
#define   hf_info1  hf_info.hf_infob

/* HFRCONF  operations */
#define HFADDLOC        0               /*  add locator */
#define HFADDSOUND      1               /*  add sound */
#define HFADDDISPLAY    2               /*  add display */
#define HFDELDISPLAY    3               /*  delete display */
#define HFADDFONT       4               /*  add font   */
#define HFCHGKBDRATE    5               /*  change keyboard rate */
#define HFCHGKBDDEL     6               /*  change keyboard delay */
#define HFCHGLOCRATE    7               /*  change locator rate */
#define HFCHGCLICK      8               /*  change keyboard click */
#define   HFCLICKON     1               /*    click on */
#define   HFCLICKOFF    0               /*    click off*/
#define HFCHGVOLUME     9               /*  change sound volume */
#define   HFVOLOFF      0               /*    volume off */
#define   HFVOLLOW      1               /*    low volume */
#define   HFVOLMED      2               /*    medium volume */
#define   HFVOLHIGH     3               /*    high volume */
#define HFKEYMAP        10              /*  replace key map */
#define HFDISPMAP       11              /*  replace display map */
#define HFECHOMAP       12              /*  replace echo map */
#define HFDEFAULT       13              /*  replace default values */
#define HFSETDD         14              /* set default real display */
#define HFADDDIALS      15              /* add dials                */
#define HFADDLPFK       16              /* add lighted programmable function keys */
#define HFCHNGDMA       18              /* change DMA start address and length */
/*      HFQUERY           */
struct hfquery {
	char *hf_cmd;
	int   hf_cmdlen;
	char *hf_resp;
	int   hf_resplen;
};
/*              HFQUERY VTD controls    */

/* HFQUERY query physical device command */
#define HFQPDEVCH      0x01             /* high type */
#define HFQPDEVCL      0x41             /* low type */
struct hfqphdevc
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_phdevid[4];                  /* device ID */
   char hf_rsvd[4];
};

/* HFQUERY query physical device response */
#define HFQPDEVRH      0x01             /* high type */
#define HFQPDEVRL      0xC1             /* low type */
struct hfqphdevr
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   /* locator  device */
   char hf_scale[4];                    /* scale factor */
   char hf_locattr[1];
#define HFLOCABS        0x80            /* 1 - absolute (tablet) */
					/* 0 - relative (mouse)  */
   char hf_rsvd[3];

   /* display device */
   char hf_attrib[4];                   /* attributes */

   /* for hf_attrib[0] */
#define HFISAPA         0x80            /* 1 - apa display */
#define HFHASBLINK      0x40            /* 1 - has blink */
   /* for hf_attrib[2] */
#define HFHASCOLOR      0x01            /* 1 - has color */
   /* for hf_attrib[3] */
#define HFCHGPALET      0x80            /* 1 - can change palette */

   char hf_pwidth[4];                   /* width in pels */
   char hf_pheight[4];                  /* height in pels */
   char hf_mwidth[4];                   /* width in mm */
   char hf_mheight[4];                  /* height in mm */
   char hf_bperpel[4];                  /* bits per pel */
   char hf_phdevid[4];                  /* display device id */
   /* display font */
   char hf_numfont[4];                  /* number of fonts */
   /* remainder is of variable length */
   char hf_fontstart;
   /* struct hfqfont hfqfont[N];  where N is value in hf_numfont */
   /* following is one color response */
   /* struct hfcolor hfcolor; */
};

struct hfqfont
{
   char hf_fontid[4];                   /* identifier  */
   char hf_fontstyle[4];                /* style */
   char hf_fontattr[4];                 /* attribute */
#define  HFFNTPLAIN     0
#define  HFFNTBOLD      1
#define  HFFNTITALIC    2
   char hf_fontwidth[4];                /* character cell width */
   char hf_fontheight[4];               /* character cell height*/
};

struct hfcolor
{
   char hf_numcolor[4];                 /* number of possible colors */
   char hf_numactive[4];                /* number of active colors */
   char hf_numfgrnd[4];                 /* number of foreground colors */
   char hf_numbgrnd[4];                 /* number of background colors */
   char hf_actcolor[4];                 /* active color, repeated
					   numcolor times */
};

/* HFQUERY query physical device ID command */
#define HFQDEVIDCH      0x01            /* high type */
#define HFQDEVIDCL      0x40            /* low type */
struct hfqdevidc
{
   char hf_intro[HFINTROSZ];            /* introducer */
};

/* HFQUERY query physical device ID response */
#define HFQDEVIDRH      0x01            /* high type */
#define HFQDEVIDRL      0xC0            /* low type */
struct hfqdevidr
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_numdev[2];                   /* number of devices */
   /* next fields repeated hf_numdev times */
   char hf_devid[4];                    /* device id */
   char hf_class[4];                    /* device class */
};

/* HFQUERY query presentation space command */
#define HFQPRESCH       0x02            /* high type */
#define HFQPRESCL       0x40            /* low type */
struct hfqpresc
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_xuleft;                      /* x upper left coord*/
   char hf_yuleft;                      /* y upper left coord */
   char hf_xlright;                     /* x lower right coord */
   char hf_ylright;                     /* y lower right coord */
};

/* HFQUERY query presentation space response */
#define HFQPRESRH       0x02            /* high type */
#define HFQPRESRL       0xc0            /* low type */
struct hfqpresr
{
   char hf_intro[HFINTROSZ];            /* introducer */
};

/*       WRITE  VTD controls         */

/* SET KEYBOARD LED  */
#define HFKLEDCH       0x01             /* high type */
#define HFKLEDCL       0x06             /* low type */
struct hfkled
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_ledselect;                   /* selector */
   char hf_ledvalue;                    /* values */
};
#define HFNUMLOCK       0x80
#define HFCAPSLOCK      0x40
#define HFSCROLLOCK     0x20

/* SET LOCATOR THRESHOLD  */
#define HFLOTHCH       0x01             /* high type */
#define HFLOTHCL       0x07             /* low type */
struct hfloth
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_hthresh[2];                  /* horizontal threshold */
   char hf_vthresh[2];                  /* vertical threshold */
};

/* SOUND  */
#define HFSOUNDCH      0x01             /* high type */
#define HFSOUNDCL      0x09             /* low type */
struct hfsound
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_mode;                        /* modes */
/* valid modes */
#define HFSIGSOUND      0x80            /* signal when done */
#define HFEXECALWAYS    0x01            /* execute even if not active */
   char hf_rsvd;
   char hf_dur[2];                      /* duration in 1/128 s */
   char hf_freq[2];                     /* frequency */
};

/* CANCEL SOUND   */
#define HFCANSNDCH     0x01             /* high type */
#define HFCANSNDCL     0x0a             /* low type */
struct hfcansnd
{
   char hf_intro[HFINTROSZ];            /* introducer */
};

/* CHANGE PHYSICAL DISPLAY   */
#define HFCHGDSPCH     0x01             /* high type */
#define HFCHGDSPCL     0x16             /* low type */
struct hfchgdsp
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_mode[2];                     /* modes */
#define HFNONDEF        0x20            /* non default */
   char hf_rsvd1[8];
   char hf_devid[4];                    /* device id */
   char hf_rsvd2[10];
};

/* KSR PROTOCOL MODE */
#define HFKSRPROH       0x02            /* high type */
#define HFKSRPROL       0x01            /* low type */
/* MONITOR  PROTOCOL MODE */
#define HFMOMPROH       0x05            /* high type */
#define HFMOMPROL       0x01            /* low type */
struct hfprotocol
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_select[2];                   /* selectors */
   char hf_value[2];                    /* values */
/* bit selectors for hf_select[0] */
#define HFHOSTS         0x10            /* return shift key status */
#define HFKEYPAGE       0x02            /* ignored! */
#define HFXLATKBD       0x01            /* perform ASCII xlat */
/* bit selectors for hf_select[1] */
#define HFINTR		0x01		/* send display status to host */
#define HFINTRONLY	0x02		/* only display status in MOM ring */
#define HFLOCATOR       0x80            /* enable locator reports */
#define HFWRAP          0x40            /* wrap cursor  */
#define HFLPFKS         0x20
#define HFDIALS         0x10
};

/* DEFINE CHARACTER SET */
#define HFCHARSETH      0x02            /* high type */
#define HFCHARSETL      0x02            /* low type */
struct hfcharset
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_setnum;                      /* which unique set */
#define HFUNIQ1         ':'             /* user definable set 1 */
#define HFUNIQ2         ';'             /* user definable set 2 */
   char hf_rsvd;
					/* repeat up to 256 times */
   char hf_code[2];                     /* 10 bit code to be defined */
};

/* SET COLOR PALETTE */
#define HFCOLORPALH     0x02            /* high type */
#define HFCOLORPALL     0x05            /* low type */
struct hfcolorpal
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_numcolor[2];                 /* number of colors to change */
   /* repeated hf_numcolor times */
   char hf_palet[4];                    /* color palette value */
};

/* CHANGE FONT */
#define HFFONTH         0x02            /* high type */
#define HFFONTL         0x06            /* low type */
struct hffont
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_primary[2];                  /* font ids to change */
   char hf_alt1[2];
   char hf_alt2[2];
   char hf_alt3[2];
   char hf_alt4[2];
   char hf_alt5[2];
   char hf_alt6[2];
   char hf_alt7[2];
};

/* CURSOR REPRESENTATION */
#define HFCURSORH       0x02            /* high type */
#define HFCURSORL       0x08            /* low type */
struct hfcursor
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_rsvd;
   char hf_shape;                       /* cursor shape */
#define HFNONE          0               /* no cursor */
#define HFSNGLUS        1               /* single underscore */
#define HFDBLUS         2               /* double underscore */
#define HFHALFBLOB      3               /* half blob */
#define HFMIDLINE       4               /* mid character line */
#define HFFULLBLOB      5               /* full blob */
};

/* MONITOR  MODE SCREEN REQUEST */
#define HFMOMREQH       0x05            /* high type */
#define HFMOMREQL       0x02            /* low type */
struct hfmomscreq
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_ringlen[2];                  /* ring buffer length */
   char hf_ringoffset[4];               /* offset from hf_ringlen */
};

#ifndef HFRDATA                         /* this define may be overridden */
#define HFRDATA         2
#endif


struct hfmomring
{
   char hf_rsvd[2];
   char hf_intreq;                      /* interrupt request indicator */
   char hf_ovflow;                      /* overflow indicator */
   unsigned hf_source;                  /* system uses this offset */
   unsigned hf_sink;                    /* user   uses this offset */
   int  hf_unused[5];
   char hf_rdata[HFRDATA];           /* PB momentary black-out data goes here */
};

#ifndef MINRNGSZ                         /* this define may be overridden */
#define MINRNGSZ 	(sizeof(struct hfmomscreq) + sizeof(struct hfmomring))
#endif

/* MONITOR  MODE SCREEN RELEASE */
#define HFMOMRELH       0x05            /* high type */
#define HFMOMRELL       0x03            /* low type */
struct hfmomscrel
{
   char hf_intro[HFINTROSZ];            /* introducer */
};


/*         READ  VTD controls       */

/*      Untranslated Key        */
#define HFINTROWW       'w'
struct hfunxlate
{
    char hf_esc;
    char hf_lbr;
    char hf_ww;
    char hf_keypos;
    char hf_scancode;
    char hf_status[2];
/*      hf_status[0]    */
#define  HFUXSHIFT      0x80            /* shift state */
#define  HFUXCTRL       0x40            /* control state */
#define  HFUXALT        0x20            /* alternate state */
#define  HFUXCAPS       0x08            /* caps lock state */
#define  HFUXNUM        0x04            /* num lock  state */
#define  HFUXINS        0x02            /* insert state */
#define  HFUXMAKE       0x01            /* made (depressed) state */
/*      hf_status[1]    */
#define  HFUXRPT        0x80            /* repeat (typamatic) state */
#define  HFUXLSH        0x40            /* left  shift        state */
#define  HFUXRSH        0x20            /* right shift        state */
#define  HFUXLALT       0x10            /* left  alternate    state */
#define  HFUXRALT       0x08            /* right alternate    state */
};

/*      Locator Report  */
#define HFINTROWHY      'y'
struct hflocator
{
    char hf_esc;
    char hf_lbr;
    char hf_why;
    unsigned char hf_deltax[2];
    unsigned char hf_deltay[2];
    char hf_seconds[3];                 /* time of report */
    char hf_sixtyths;                   /* time of report fractional sec */
    unsigned char hf_buttons;                    /* state of buttons */
    char hf_stype;                      /* sub type (0) */
#define HFBUTTON1       0x80            /* leftmost button */
#define HFBUTTON2       0x40            /* 2nd leftmost button */
};

/*
 * this is only used by the kernel
 */
struct kern_hflocator
{
    unsigned char hf_esc;
    unsigned char hf_lbr;
    unsigned char hf_why;
    short hf_deltax;
    short hf_deltay;
    unsigned int hf_seconds;                 /* time of report */
    unsigned char hf_sixtyths;                   /* time of report fractional sec */
    unsigned char hf_buttons;                    /* state of buttons */
    unsigned char hf_stype;                      /* sub type (0) */
#define HFT_MODE 0xff
};
/* HFQUERY query graphics devices command: Locator, LPFKs, Dials */

#define HFQLOCCH  0x01        /* Locator - high (major) type */
#define HFQLOCCL  0x42        /* low (minor) type            */

#define HFQLPFKSCH  0x01      /* LPFKs - high (major) type   */
#define HFQLPFKSCL  0x43      /* low (minor) type            */

#define HFQDIALSCH  0x01      /*  Dials - high (major) type  */
#define HFQDIALSCL  0x44      /*  low (minor)  type          */

struct hfqgraphdev
{
   char hf_intro[HFINTROSZ];        /* introducer */
};



/* query response and set structure for Dials and LPFKs */

#define HFLPFKSCH  0x01     /* LPFKs  set - high (major) type */
#define HFLPFKSCL  0x0c     /* low (minor) type               */
#define HFDIALSCH  0x01     /* Dials set - high (major) type  */
#define HFDIALSCL  0x0d     /* low (minor) type               */

#define HFQLPFKSRH  0x01     /* LPFKs response - high (major) type */
#define HFQLPFKSRL  0xc3     /* low (minor) type                   */
#define HFQDIALSRH  0x01     /* Dials response - high (major) type */
#define HFQDIALSRL  0xC4     /* low  (minor) type                  */


struct hfdial_lpfk
{
   char hf_intro[HFINTROSZ];     /* introducer */
   char hf_sublen;               /* sub header length */
   char hf_subtype;              /* sub header type   */

   union
   {
       char rsvd[4];             /* reserved for sets */
       char numlpfks[4];    /* query response - number of LPFKs */
       char numdials[4];    /* query response - number of dials */
   } hf_data1;

   union
   {
       char rsvd[4];           /* reserved in query response */
       char dials[4];          /* dial mask */
       char keys[4];           /* LPFK mask */
   } hf_mask;

   union
   {
       char granularity[16];       /* individual dial granularities */
       struct
       {
	 char flags[4];            /* LPFK flags */
	 char rsvd[12];            /* reserved in LPFK queries and sets */
       } lpfk;

   } hf_data2;

   char hf_rsvd[4];           /* reserved for all sets and queries */

};


/* SET TABLET DEAD ZONES */

#define HFTDZCH   0x01     /* high (major) type  */
#define HFTDZCL   0x08     /* low (minor)  type  */

struct hftdzone
{
 char hf_intro[HFINTROSZ];       /* introducer */
 char hf_sublen;                 /* sub header length */
 char hf_subtype;                /* sub header type   */
 char hf_horizontal[2];          /* horizontal dead zone */
 char hf_vertical[2];            /* vertical dead zone   */
};


/* HFQUERY query Locator response */

#define HFQLOCRH 0x01         /* high (major) type */
#define HFQLOCRL 0xC2         /* low (minor) type  */

struct hfqlocr
{
   char hf_intro[HFINTROSZ];         /* introducer */
   char hf_sublen;                   /* sub header length  */
   char hf_subtype;                  /* sub header type    */
   char hf_resolution[4];            /* locator resolution */
   char hf_devinfo[1];               /* hf_devinfo[0]: bit 0 - 0=relative */
				     /* 1=absolute; bits 1,2=sensor type  */
/* also can use HFLOCABS from above */
#define HFLOCUNKNOWN    0x00
#define HFLOCSTYLUS     0x20
#define HFLOCPUCK       0x40
   char hf_rsvd[3];
   char hf_horzmax_cnt[2];           /* horizontal max count */
   char hf_vertmax_cnt[2];           /* vertical max count   */
   char hf_horzdead_zone[2];         /* horizontal dead zone */
   char hf_vertdead_zone[2];         /* vertical dead zone   */
   char hf_rsvd1[8];
};

/* HFQUERY query hft command */
#define HFQHFTCH      0x01            /* high type */
#define HFQHFTCL      0x45            /* low type */
struct hfqhftc
{
   char hf_intro[HFINTROSZ];          /* introducer */
};

/* HFQUERY query hft response */
#define HFQHFTRH      0x01            /* high type */
#define HFQHFTRL      0xc5            /* low type */
struct hfqhftr
{
   char hf_intro[HFINTROSZ] ;
   char hf_sublen ;           /* = 3 */
   char hf_subtype ;          /* = 1 */
   char hf_align ;            /*!!!!!!! ALIGNMENT BYTE !!!!!!!!!!*/
   int  hf_phdevid ;
   int  hf_phrow ;
   int  hf_phcol ;
   int  hf_phcolor ;
   int  hf_phfont ;
   int  hf_phkbdid;		/* 0 = 101 keyboard, 1 = 102 keyboard */
   int  hf_reserve[2];
} ;

#define HFCTLREQCH  0x04
#define HFCTLREQCL  0x00

struct hfctlreq
{
   char hf_intro[HFINTROSZ] ;
   char hf_sublen ;
   char hf_subtype ;
   char hf_align ;
   int  hf_request ;
   int  hf_arg_len ;
   int  hf_rsp_len ;            /* response length             */
} ;

#define HFCTLACKCH  0x04
#define HFCTLACKCL  0x01

struct sound_seq
{
    unsigned  char  mode;    	     /* HFSIGSOUND, HFEXECALWAYS. */
    time_t  	  dur;               /* duration.  */
    unsigned char freq[2];           /* frequence. */
};

struct hfctlack
{
   char hf_intro[HFINTROSZ] ;
   char hf_sublen ;
   char hf_subtype ;
   char hf_align ;
   int  hf_request ;
   int  hf_retcode ;
   int  hf_arg_len ;
} ;

/* HFQUERY query dma command */
#define HFQDMACH      0x01            /* high type */
#define HFQDMACL      0x46            /* low type */
struct hfqdmac
{
   char hf_intro[HFINTROSZ];          /* introducer */
};

/* HFQUERY query dma response */
#define HFQDMARH      0x01            /* high type */
#define HFQDMARL      0xc6            /* low type */
struct hfqdmar
{
   char hf_intro[HFINTROSZ] ;
   char hf_sublen;            /* = 3 */
   char hf_subtype;           /* = 1 */
   char hf_align;             /* alignment byte */
   int  hf_dmaaddr;           /* starting address of DMA space */
   int  hf_dmalen;            /* length of DMA space */
} ;

/* HFMDMA dma move ioctl */
struct hfmdma
{
   uint   hf_srcaddr;           /* source address of DMA data */
   uint   hf_dmalen;            /* length of DMA data */
   uint   hf_destaddr;          /* destination address of DMA data */
} ;

#define VTD_MIN_LENGTH 6 
#define VTD_TYPHI 4
#define VTD_TYPLO 5
/*
#define  HFSEL0	10
#define  HFSEL1	11
#define  HFVAL0	12
#define  HFVAL1	13
#define  HFSEL0	8
#define  HFSEL1	9
#define  HFVAL0	10
#define  HFVAL1	11
*/
#define  HFSEL0	localbuf[6] + 6
#define  HFSEL1	localbuf[6] + 7
#define  HFVAL0	localbuf[6] + 8
#define  HFVAL1	localbuf[6] + 9
#define  HFSETN	localbuf[6] + 6 
#define  HFCHRS	localbuf[6] + 8

/* PB: added for MAPMEM ioctl   */
#define MAPMEM	0xff
#endif _h_HFT
  typekêº Ó  $        Õ  s‰*`˜ˆ*s‰*     1pÕ  	                  ./usr/include/sys/hft/aux.h    e#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)aux.h	16.3	LCC)	/* Modified: 16:14:09 9/16/89 */
/* H_SCCSID(@(#)aux.h	16.3	LCC)	/* Modified: 16:14:09 9/16/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/*
 *      Include file for HFT / Merge Mouse Interface
 */
 
/*
 *      PS2 Mouse Commands, must respond with an ACK at Port 60
 */
 
#define M_RESET         0xff
#define M_RESENF        0xfe
#define M_SETDFLT       0xf6
#define M_DISABLE       0xf5
#define M_ENABLE        0xf4
#define M_SETSMPL       0xf3
#define M_RDDTYPE       0xf2
#define M_SETRMODE      0xf0
#define M_SETWMODE      0xee
#define M_RSETWMODE     0xec
#define M_RDDATA        0xeb
#define M_SETSMODE      0xea
#define M_STATREQ       0xe9
#define M_SETRES        0xe8
#define M_SETSCAL       0xe7
#define M_RESSCAL       0xe6
 
#define AMAXCMD 	4
#define MAX_AUXQ 	25 
 
struct mse_state {
        unsigned char smp_rate;
        unsigned char res_rate;
        long mouse_state;       
        long old_state;
};
 
 
/*
**      auxflags defs
*/
 
#define AUXOPEN 0x01            /* Device is Open       */
#define ACMDFAIL 0x02           /* Last Command failed  */
#define ACMDPND 0x04            /* Aux Command pnding   */
#define ASNDRPLY 0x08
#define A_DO_RESET 0x10
#define MSE_CHANGE 0x20
 
 
/*
**      mouse_state BIts.
*/
 
#define MSE_DISABLD     0x01
#define REM_MODE        0x02
#define WRAP_MODE       0x04
#define STREAM_MODE     0x10
#define MS_SCALING      0x20
#define MSE_DEFAULT     0x40
#define MSE_RESET       0x80
 
#define M_MODE  (REM_MODE|WRAP_MODE|STREAM_MODE)
#define M_STATE (MSE_RESET|MSE_DEFAULT)
 
 
#define DO_DISABLE      0
#define NO_DISABLE      1
 
o[Hkê¯ Ò  $        ªv  s‰*a˜ˆ*s‰*     5rªv  	              ¨   ./usr/include/sys/hft/hft.h    e#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)hft.h	16.4.1.3	LCC)	/* Modified: 15:38:45 8/13/91 */
/* H_SCCSIDgen1(@(#)hft.h	1.9	AIX);	Modified 1/19/89 12:32:53 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _h_HFT
#define _h_HFT
#include <sys/types.h>
/*              hft unique ioctls               */
#define HFIOC	('h'<<8)
#define HFGETID (HFIOC|1)   /* Get VT identification info */
#define HFQUERY (HFIOC|2)   /* Query VRM about terminal */
#define HFSKBD	(HFIOC|3)   /* Set Keybd map */
#define HFSECHO (HFIOC|4)   /* Set keybd echoing */
#define HFSMON  (HFIOC|5)   /* Request to set monitor mode */
#define HFCMON  (HFIOC|6)   /* Clear monitor mode */
#define HFGCHAN (HFIOC|7)   /* Get channel number */
#define HFQSMGR (HFIOC|8)   /* Query Screen Manager */
#define HFCSMGR (HFIOC|9)   /* Control Screen Manager */
#define HFRCONF (HFIOC|10)  /* reconfigure resource controller */
#define HFESOUND (HFIOC|11)  /* enable sound signals */
#define HFDSOUND (HFIOC|12)  /* disable sound signals */
#define HFQEIO   (HFIOC|13)   /* Query Terminal Error Value */
#define HFQDEV   (HFIOC|14)   /* Query Device Dependent data*/
#define HFSKEP   (HFIOC|15)	/* Set   "KEP" signal handling  */
#define HFCKEP   (HFIOC|16)	/* Clear "KEP" signal handling  */
#define HFMDMA   (HFIOC|17)   /* Move data via DMA controls */
#define HFSJKBD (HFIOC|18)   /* Set Japanese Keybd map */
#define HFGETVIDRAM (HFIOC|19)   /* used in console.c ioctl */
#define HFRELVIDRAM (HFIOC|20)   /* used in console.c ioctl */
#define GET_SCR_ACC (HFIOC|21)   /* used by vtt routines */
#define REL_SCR_ACC (HFIOC|22)   /* used by vtt routines */
#define HFTINIT_DISP  (HFIOC|23)   /* used by hftinit  */
#define HFTINIT_MAPS  (HFIOC|24)   /* used by hftinit  */ 
#define HFTINIT_ENTRY (HFIOC|25)   /* used by hftinit  */
#define HFTINIT_BOOT (HFIOC|26)    /* used by hftinit  */
#define	HFQSOUND     (HFIOC|27)    /* query sound */
#define HFTSMPROC    (HFIOC|28) /* Perform virtual terminal switching */

#define HFSRINGSELPTR	(HFIOC|99)	/* set MOM ring select pointer */


/* VTD introducer */
#define HFINTROESC      '\033'
#define HFINTROLBR      '['
#define HFINTROEX       'x'

struct hfintro
{
    char hf_esc;
    char hf_lbr;
    char hf_ex;
    char hf_len[4];                     /* length points to end of control */
    char hf_typehi;                     /* high byte of type */
    char hf_typelo;                     /* low byte of type */
};
#define HFINTROSZ       sizeof(struct hfintro)

/*      HFGETID  ioctl          */
struct hfgetid {
	unsigned hf_iodn;
	unsigned hf_pgrp;
	unsigned hf_chan;
};

/*      HFSTECHO, HFSKBD, HFQSMGR  ioctls */
struct hfbuf {
	char *hf_bufp;
	int   hf_buflen;
};

/* HFSKBD  ioctl      */
struct hfkeymap {
	char  hf_rsvd1;
	char  hf_nkeys;     /* # keys being mapped */
#ifndef HFNKEYS
#define HFNKEYS         1
#endif
	struct hfkey {
		char hf_kpos;   /* Key position # */
		char hf_kstate; /* Shift/Alt/Ctrl state, map type */
#define HFMAPMASK  0x0f         /* mask type field */
#define HFMAPCHAR  0x00         /* map single character */
#define HFMAPFUNC  0x01         /* map function ID */
#define HFMAPNONSP 0x02         /* map non-spacing character */
#define HFMAPSTR   0x04         /* map string */

#define HFSHFMASK  0x70         /* mask for shift field */
#define HFSHFNONE  0x00         /* base state */
#define HFSHFALTGR 0x10         /* alt graphic state */
#define HFSHFSHFT  0x20         /* shift state */
#define HFSHFCTRL  0x40         /* control state */
#define HFSHFALT   0x60         /* alt state */

#define HFCAPSL    0x80         /* caps lock applies */
		struct hfkeyasgn         /* assignment structure */
		{
		     /* for single character */
		     char hf_pagenum;      /* Code page  */
		     char hf_character;   /* Character to map  */
#define hf_page      hf_keyasn.hf_pagenum
#define hf_char      hf_keyasn.hf_character
		     /* for function id */
#define hf_keyidh    hf_pagenum          /* high byte of id */
#define hf_keyidl    hf_character        /* low byte of id */
		     /* for character string */
#define hf_kstrl     hf_character        /* length of string */

		}hf_keyasn;
	} hfkey[HFNKEYS];
};

/*
 * The HFSKEYMAP define defined below might be used like this:
 *
 * HFSKEYMAP(2, hidef)
 * hidef.hf_nkeys = 1;
 * hidef.hf_kpos = 1;         below ESC key
 * hidef.hf_kstate = HFMAPSTR + HFSHFNONE;
 * hidef.hf_pagenum = '<';    P0
 * hidef.hf_kstrl = 2;
 * hidef.hf_carray[0] = 'h';
 * hidef.hf_carray[1] = 'i';
 */
#define HFSKEYMAP(SLEN, SNAME) struct {                                 \
	char hf_rsvd1;                                                  \
	char hf_nkeys;          /* must be 1 */                         \
	char hf_kpos;           /* Key position # */                    \
	char hf_kstate;         /* Shift/Alt/Ctrl state, map type */    \
	char hf_pagenum;        /* Code page  */                        \
	char hf_kstrl;          /* must be SLEN */                      \
	char hf_carray[SLEN];   /* not a string (no trailing '\0') */   \
} SNAME;


/* HFQSMGR ioctl - query screen manager  */
#ifndef HFNUMVTS
#define HFNUMVTS 16
#endif

struct hfqstat
{
   short hf_numvts;
   struct hfvtinfo
   {
     unsigned short hf_vtiodn;            /* iodn of terminal */
     unsigned short hf_vtstate;           /* state of terminal */
   } hf_vtinfo[HFNUMVTS];                 /* element per terminal */
/* valid states */
#define HFVTHIDDEN  0x8000              /* hidden terminal */
#define HFVTACTIVE  0x4000              /* active terminal */
#define HFVTCOMMAND 0x2000              /* command terminal */
};

/*      HFCSMGR  ioctl -  Control Screen manager          */
struct hfsmgrcmd {
	int hf_cmd;
	int hf_vtid;
	int hf_vsid;
};
#define SMSCMD	 0
#define SMACT	 0x10
#define SMHIDE	 0x20
#define SMUNHIDE 0x30
#define SMCVTEN  0x40
#define SMCVTDI  0x50

#if !defined(_KERNEL) && !defined(MAX_MON_ADDRS)
#define MAX_MON_ADDRS  1
#endif


/*  HFSMON  , HFESOUND ioctl       */
struct hfsmon {
	int hf_momflags;			/* defined below */
	int hf_momscnt;				/* number of addresses available */
#ifdef _KERNEL
	caddr_t hf_momsaddrs[1];     /* user process virtual addrs of phys mem */
#else	/* ! _KERNEL */
	caddr_t hf_momsaddrs[MAX_MON_ADDRS];
#endif	/* ! _KERNEL */
};

/* hf_momflags values */
#define HFSINGLE  1     /* single process to receive monitor mode signals */
#define HFGROUP   2     /* tty group to receive monitor mode signals */

/* HFQDEV ioctl         */
struct hfqdev
{
   unsigned short hf_qdrsvd;
   unsigned short hf_qdopts;
   unsigned int hf_qdlen;
};

/* HFQDEV response structure */
struct hfqdresp
{
   ushort hf_vtrmiodn;
   ushort hf_vtrmiocn;
   ushort hf_rsvd1;
   ushort hf_devtype;
   char   hf_devname[4];
   char   hf_rsvd2[4];
   int    hf_hwoffset;
   int    hf_devoffset;
   int    hf_erroffset;
   char   hf_rsvd3;
   char   hf_newics;
   char   hf_statflags;
   char   hf_ovrncnt;
   ushort hf_opresult;
   ushort hf_deviodn;
   int    hf_dataword1;
   int    hf_dataword2;
   int    hf_dataword3;
   int    hf_ddilen;
   int    hf_rc;
   ushort hf_smiocn;
   ushort hf_vtmpiocn;
   ushort hf_rsvd4;
   ushort hf_keyiodn;
   ushort hf_lociodn;
   ushort hf_spkiodn;
   int    hf_numfont;
   ushort hf_fontiocn[32];
   int    hf_numdisp;
   struct hfphysd
   {
     uint   hf_devid;
     ushort hf_deviodn;
     ushort hf_deviocn;
   }hf_physd[4];
   ushort hf_keymapiocn;
   ushort hf_chrmapiocn;
   ushort hf_echomapiocn;
   ushort hf_initiocn;
   ushort hf_dialsiodn;
   ushort hf_lpfkiodn;
};

/*      HFRCONF ioctl           */
struct hfrconf
{
  unsigned hf_op;
  unsigned hf_obj;
  union
  {
    uint hf_infob;
    struct
    {
       ushort hf_iodn;
       ushort hf_iocn;
    } hf_info2;
  }hf_info;
  /* MSK added union to allow loading of various system maps */
  union
  {
    char *hf_cptr;
    struct hfbuf *hf_hfbufptr;
  } hf_mapinfo;
};
#define   hf_info1  hf_info.hf_infob

/* HFRCONF  operations */
#define HFADDLOC        0               /*  add locator */
#define HFADDSOUND      1               /*  add sound */
#define HFADDDISPLAY    2               /*  add display */
#define HFDELDISPLAY    3               /*  delete display */
#define HFADDFONT       4               /*  add font   */
#define HFCHGKBDRATE    5               /*  change keyboard rate */
#define HFCHGKBDDEL     6               /*  change keyboard delay */
#define HFCHGLOCRATE    7               /*  change locator rate */
#define HFCHGCLICK      8               /*  change keyboard click */
#define   HFCLICKON     1               /*    click on */
#define   HFCLICKOFF    0               /*    click off*/
#define HFCHGVOLUME     9               /*  change sound volume */
#define   HFVOLOFF      0               /*    volume off */
#define   HFVOLLOW      1               /*    low volume */
#define   HFVOLMED      2               /*    medium volume */
#define   HFVOLHIGH     3               /*    high volume */
#define HFKEYMAP        10              /*  replace key map */
#define HFDISPMAP       11              /*  replace display map */
#define HFECHOMAP       12              /*  replace echo map */
#define HFDEFAULT       13              /*  replace default values */
#define HFSETDD         14              /* set default real display */
#define HFADDDIALS      15              /* add dials                */
#define HFADDLPFK       16              /* add lighted programmable function keys */
#define HFCHNGDMA       18              /* change DMA start address and length */
/*      HFQUERY           */
struct hfquery {
	char *hf_cmd;
	int   hf_cmdlen;
	char *hf_resp;
	int   hf_resplen;
};
/*              HFQUERY VTD controls    */

/* HFQUERY query physical device command */
#define HFQPDEVCH      0x01             /* high type */
#define HFQPDEVCL      0x41             /* low type */
struct hfqphdevc
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_phdevid[4];                  /* device ID */
   char hf_rsvd[4];
};

/* HFQUERY query physical device response */
#define HFQPDEVRH      0x01             /* high type */
#define HFQPDEVRL      0xC1             /* low type */
struct hfqphdevr
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   /* locator  device */
   char hf_scale[4];                    /* scale factor */
   char hf_locattr[1];
#define HFLOCABS        0x80            /* 1 - absolute (tablet) */
					/* 0 - relative (mouse)  */
   char hf_rsvd[3];

   /* display device */
   char hf_attrib[4];                   /* attributes */

   /* for hf_attrib[0] */
#define HFISAPA         0x80            /* 1 - apa display */
#define HFHASBLINK      0x40            /* 1 - has blink */
   /* for hf_attrib[2] */
#define HFHASCOLOR      0x01            /* 1 - has color */
   /* for hf_attrib[3] */
#define HFCHGPALET      0x80            /* 1 - can change palette */

   char hf_pwidth[4];                   /* width in pels */
   char hf_pheight[4];                  /* height in pels */
   char hf_mwidth[4];                   /* width in mm */
   char hf_mheight[4];                  /* height in mm */
   char hf_bperpel[4];                  /* bits per pel */
   char hf_phdevid[4];                  /* display device id */
   /* display font */
   char hf_numfont[4];                  /* number of fonts */
   /* remainder is of variable length */
   char hf_fontstart;
   /* struct hfqfont hfqfont[N];  where N is value in hf_numfont */
   /* following is one color response */
   /* struct hfcolor hfcolor; */
};

struct hfqfont
{
   char hf_fontid[4];                   /* identifier  */
   char hf_fontstyle[4];                /* style */
   char hf_fontattr[4];                 /* attribute */
#define  HFFNTPLAIN     0
#define  HFFNTBOLD      1
#define  HFFNTITALIC    2
   char hf_fontwidth[4];                /* character cell width */
   char hf_fontheight[4];               /* character cell height*/
};

struct hfcolor
{
   char hf_numcolor[4];                 /* number of possible colors */
   char hf_numactive[4];                /* number of active colors */
   char hf_numfgrnd[4];                 /* number of foreground colors */
   char hf_numbgrnd[4];                 /* number of background colors */
   char hf_actcolor[4];                 /* active color, repeated
					   numcolor times */
};

/* HFQUERY query physical device ID command */
#define HFQDEVIDCH      0x01            /* high type */
#define HFQDEVIDCL      0x40            /* low type */
struct hfqdevidc
{
   char hf_intro[HFINTROSZ];            /* introducer */
};

/* HFQUERY query physical device ID response */
#define HFQDEVIDRH      0x01            /* high type */
#define HFQDEVIDRL      0xC0            /* low type */
struct hfqdevidr
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_numdev[2];                   /* number of devices */
   /* next fields repeated hf_numdev times */
   char hf_devid[4];                    /* device id */
   char hf_class[4];                    /* device class */
};

/* HFQUERY query presentation space command */
#define HFQPRESCH       0x02            /* high type */
#define HFQPRESCL       0x40            /* low type */
struct hfqpresc
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_xuleft;                      /* x upper left coord*/
   char hf_yuleft;                      /* y upper left coord */
   char hf_xlright;                     /* x lower right coord */
   char hf_ylright;                     /* y lower right coord */
};

/* HFQUERY query presentation space response */
#define HFQPRESRH       0x02            /* high type */
#define HFQPRESRL       0xc0            /* low type */
struct hfqpresr
{
   char hf_intro[HFINTROSZ];            /* introducer */
};

/*       WRITE  VTD controls         */

/* SET KEYBOARD LED  */
#define HFKLEDCH       0x01             /* high type */
#define HFKLEDCL       0x06             /* low type */
struct hfkled
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_ledselect;                   /* selector */
   char hf_ledvalue;                    /* values */
};
#define HFNUMLOCK       0x80
#define HFCAPSLOCK      0x40
#define HFSCROLLOCK     0x20

/* SET LOCATOR THRESHOLD  */
#define HFLOTHCH       0x01             /* high type */
#define HFLOTHCL       0x07             /* low type */
struct hfloth
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_hthresh[2];                  /* horizontal threshold */
   char hf_vthresh[2];                  /* vertical threshold */
};

/* SOUND  */
#define HFSOUNDCH      0x01             /* high type */
#define HFSOUNDCL      0x09             /* low type */
struct hfsound
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_mode;                        /* modes */
/* valid modes */
#define HFSIGSOUND      0x80            /* signal when done */
#define HFEXECALWAYS    0x01            /* execute even if not active */
   char hf_rsvd;
   char hf_dur[2];                      /* duration in 1/128 s */
   char hf_freq[2];                     /* frequency */
};

/* CANCEL SOUND   */
#define HFCANSNDCH     0x01             /* high type */
#define HFCANSNDCL     0x0a             /* low type */
struct hfcansnd
{
   char hf_intro[HFINTROSZ];            /* introducer */
};

/* CHANGE PHYSICAL DISPLAY   */
#define HFCHGDSPCH     0x01             /* high type */
#define HFCHGDSPCL     0x16             /* low type */
struct hfchgdsp
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_mode[2];                     /* modes */
#define HFNONDEF        0x20            /* non default */
   char hf_rsvd1[8];
   char hf_devid[4];                    /* device id */
   char hf_rsvd2[10];
};

/* KSR PROTOCOL MODE */
#define HFKSRPROH       0x02            /* high type */
#define HFKSRPROL       0x01            /* low type */
/* MONITOR  PROTOCOL MODE */
#define HFMOMPROH       0x05            /* high type */
#define HFMOMPROL       0x01            /* low type */
struct hfprotocol
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_select[2];                   /* selectors */
   char hf_value[2];                    /* values */
/* bit selectors for hf_select[0] */
#define HFHOSTS         0x10            /* return shift key status */
#define HFKEYPAGE       0x02            /* ignored! */
#define HFXLATKBD       0x01            /* perform ASCII xlat */
/* bit selectors for hf_select[1] */
#define HFINTR		0x01		/* send display status to host */
#define HFINTRONLY	0x02		/* only display status in MOM ring */
#define HFLOCATOR       0x80            /* enable locator reports */
#define HFWRAP          0x40            /* wrap cursor  */
#define HFLPFKS         0x20
#define HFDIALS         0x10
};

/* DEFINE CHARACTER SET */
#define HFCHARSETH      0x02            /* high type */
#define HFCHARSETL      0x02            /* low type */
struct hfcharset
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_setnum;                      /* which unique set */
#define HFUNIQ1         ':'             /* user definable set 1 */
#define HFUNIQ2         ';'             /* user definable set 2 */
   char hf_rsvd;
					/* repeat up to 256 times */
   char hf_code[2];                     /* 10 bit code to be defined */
};

/* SET COLOR PALETTE */
#define HFCOLORPALH     0x02            /* high type */
#define HFCOLORPALL     0x05            /* low type */
struct hfcolorpal
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_numcolor[2];                 /* number of colors to change */
   /* repeated hf_numcolor times */
   char hf_palet[4];                    /* color palette value */
};

/* CHANGE FONT */
#define HFFONTH         0x02            /* high type */
#define HFFONTL         0x06            /* low type */
struct hffont
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_primary[2];                  /* font ids to change */
   char hf_alt1[2];
   char hf_alt2[2];
   char hf_alt3[2];
   char hf_alt4[2];
   char hf_alt5[2];
   char hf_alt6[2];
   char hf_alt7[2];
};

/* CURSOR REPRESENTATION */
#define HFCURSORH       0x02            /* high type */
#define HFCURSORL       0x08            /* low type */
struct hfcursor
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_rsvd;
   char hf_shape;                       /* cursor shape */
#define HFNONE          0               /* no cursor */
#define HFSNGLUS        1               /* single underscore */
#define HFDBLUS         2               /* double underscore */
#define HFHALFBLOB      3               /* half blob */
#define HFMIDLINE       4               /* mid character line */
#define HFFULLBLOB      5               /* full blob */
};

/* MONITOR  MODE SCREEN REQUEST */
#define HFMOMREQH       0x05            /* high type */
#define HFMOMREQL       0x02            /* low type */
struct hfmomscreq
{
   char hf_intro[HFINTROSZ];            /* introducer */
   char hf_sublen;                      /* sub header length */
   char hf_subtype;                     /* sub header type */
   char hf_ringlen[2];                  /* ring buffer length */
   char hf_ringoffset[4];               /* offset from hf_ringlen */
};

#ifndef HFRDATA                         /* this define may be overridden */
#define HFRDATA         2
#endif


struct hfmomring
{
   char hf_rsvd[2];
   char hf_intreq;                      /* interrupt request indicator */
   char hf_ovflow;                      /* overflow indicator */
   unsigned hf_source;                  /* system uses this offset */
   unsigned hf_sink;                    /* user   uses this offset */
   int  hf_unused[5];
   char hf_rdata[HFRDATA];           /* PB momentary black-out data goes here */
};

#ifndef MINRNGSZ                         /* this define may be overridden */
#define MINRNGSZ 	(sizeof(struct hfmomscreq) + sizeof(struct hfmomring))
#endif

/* MONITOR  MODE SCREEN RELEASE */
#define HFMOMRELH       0x05            /* high type */
#define HFMOMRELL       0x03            /* low type */
struct hfmomscrel
{
   char hf_intro[HFINTROSZ];            /* introducer */
};


/*         READ  VTD controls       */

/*      Untranslated Key        */
#define HFINTROWW       'w'
struct hfunxlate
{
    char hf_esc;
    char hf_lbr;
    char hf_ww;
    char hf_keypos;
    char hf_scancode;
    char hf_status[2];
/*      hf_status[0]    */
#define  HFUXSHIFT      0x80            /* shift state */
#define  HFUXCTRL       0x40            /* control state */
#define  HFUXALT        0x20            /* alternate state */
#define  HFUXCAPS       0x08            /* caps lock state */
#define  HFUXNUM        0x04            /* num lock  state */
#define  HFUXINS        0x02            /* insert state */
#define  HFUXMAKE       0x01            /* made (depressed) state */
/*      hf_status[1]    */
#define  HFUXRPT        0x80            /* repeat (typamatic) state */
#define  HFUXLSH        0x40            /* left  shift        state */
#define  HFUXRSH        0x20            /* right shift        state */
#define  HFUXLALT       0x10            /* left  alternate    state */
#define  HFUXRALT       0x08            /* right alternate    state */
};

/*      Locator Report  */
#define HFINTROWHY      'y'
struct hflocator
{
    char hf_esc;
    char hf_lbr;
    char hf_why;
    unsigned char hf_deltax[2];
    unsigned char hf_deltay[2];
    char hf_seconds[3];                 /* time of report */
    char hf_sixtyths;                   /* time of report fractional sec */
    unsigned char hf_buttons;                    /* state of buttons */
    char hf_stype;                      /* sub type (0) */
#define HFBUTTON1       0x80            /* leftmost button */
#define HFBUTTON2       0x40            /* 2nd leftmost button */
};

/*
 * this is only used by the kernel
 */
struct kern_hflocator
{
    unsigned char hf_esc;
    unsigned char hf_lbr;
    unsigned char hf_why;
    short hf_deltax;
    short hf_deltay;
    unsigned int hf_seconds;                 /* time of report */
    unsigned char hf_sixtyths;                   /* time of report fractional sec */
    unsigned char hf_buttons;                    /* state of buttons */
    unsigned char hf_stype;                      /* sub type (0) */
#define HFT_MODE 0xff
};
/* HFQUERY query graphics devices command: Locator, LPFKs, Dials */

#define HFQLOCCH  0x01        /* Locator - high (major) type */
#define HFQLOCCL  0x42        /* low (minor) type            */

#define HFQLPFKSCH  0x01      /* LPFKs - high (major) type   */
#define HFQLPFKSCL  0x43      /* low (minor) type            */

#define HFQDIALSCH  0x01      /*  Dials - high (major) type  */
#define HFQDIALSCL  0x44      /*  low (minor)  type          */

struct hfqgraphdev
{
   char hf_intro[HFINTROSZ];        /* introducer */
};



/* query response and set structure for Dials and LPFKs */

#define HFLPFKSCH  0x01     /* LPFKs  set - high (major) type */
#define HFLPFKSCL  0x0c     /* low (minor) type               */
#define HFDIALSCH  0x01     /* Dials set - high (major) type  */
#define HFDIALSCL  0x0d     /* low (minor) type               */

#define HFQLPFKSRH  0x01     /* LPFKs response - high (major) type */
#define HFQLPFKSRL  0xc3     /* low (minor) type                   */
#define HFQDIALSRH  0x01     /* Dials response - high (major) type */
#define HFQDIALSRL  0xC4     /* low  (minor) type                  */


struct hfdial_lpfk
{
   char hf_intro[HFINTROSZ];     /* introducer */
   char hf_sublen;               /* sub header length */
   char hf_subtype;              /* sub header type   */

   union
   {
       char rsvd[4];             /* reserved for sets */
       char numlpfks[4];    /* query response - number of LPFKs */
       char numdials[4];    /* query response - number of dials */
   } hf_data1;

   union
   {
       char rsvd[4];           /* reserved in query response */
       char dials[4];          /* dial mask */
       char keys[4];           /* LPFK mask */
   } hf_mask;

   union
   {
       char granularity[16];       /* individual dial granularities */
       struct
       {
	 char flags[4];            /* LPFK flags */
	 char rsvd[12];            /* reserved in LPFK queries and sets */
       } lpfk;

   } hf_data2;

   char hf_rsvd[4];           /* reserved for all sets and queries */

};


/* SET TABLET DEAD ZONES */

#define HFTDZCH   0x01     /* high (major) type  */
#define HFTDZCL   0x08     /* low (minor)  type  */

struct hftdzone
{
 char hf_intro[HFINTROSZ];       /* introducer */
 char hf_sublen;                 /* sub header length */
 char hf_subtype;                /* sub header type   */
 char hf_horizontal[2];          /* horizontal dead zone */
 char hf_vertical[2];            /* vertical dead zone   */
};


/* HFQUERY query Locator response */

#define HFQLOCRH 0x01         /* high (major) type */
#define HFQLOCRL 0xC2         /* low (minor) type  */

struct hfqlocr
{
   char hf_intro[HFINTROSZ];         /* introducer */
   char hf_sublen;                   /* sub header length  */
   char hf_subtype;                  /* sub header type    */
   char hf_resolution[4];            /* locator resolution */
   char hf_devinfo[1];               /* hf_devinfo[0]: bit 0 - 0=relative */
				     /* 1=absolute; bits 1,2=sensor type  */
/* also can use HFLOCABS from above */
#define HFLOCUNKNOWN    0x00
#define HFLOCSTYLUS     0x20
#define HFLOCPUCK       0x40
   char hf_rsvd[3];
   char hf_horzmax_cnt[2];           /* horizontal max count */
   char hf_vertmax_cnt[2];           /* vertical max count   */
   char hf_horzdead_zone[2];         /* horizontal dead zone */
   char hf_vertdead_zone[2];         /* vertical dead zone   */
   char hf_rsvd1[8];
};

/* HFQUERY query hft command */
#define HFQHFTCH      0x01            /* high type */
#define HFQHFTCL      0x45            /* low type */
struct hfqhftc
{
   char hf_intro[HFINTROSZ];          /* introducer */
};

/* HFQUERY query hft response */
#define HFQHFTRH      0x01            /* high type */
#define HFQHFTRL      0xc5            /* low type */
struct hfqhftr
{
   char hf_intro[HFINTROSZ] ;
   char hf_sublen ;           /* = 3 */
   char hf_subtype ;          /* = 1 */
   char hf_align ;            /*!!!!!!! ALIGNMENT BYTE !!!!!!!!!!*/
   int  hf_phdevid ;
   int  hf_phrow ;
   int  hf_phcol ;
   int  hf_phcolor ;
   int  hf_phfont ;
   int  hf_phkbdid;		/* 0 = 101 keyboard, 1 = 102 keyboard */
   int  hf_reserve[2];
} ;

#define HFCTLREQCH  0x04
#define HFCTLREQCL  0x00

struct hfctlreq
{
   char hf_intro[HFINTROSZ] ;
   char hf_sublen ;
   char hf_subtype ;
   char hf_align ;
   int  hf_request ;
   int  hf_arg_len ;
   int  hf_rsp_len ;            /* response length             */
} ;

#define HFCTLACKCH  0x04
#define HFCTLACKCL  0x01

struct sound_seq
{
    unsigned  char  mode;    	     /* HFSIGSOUND, HFEXECALWAYS. */
    time_t  	  dur;               /* duration.  */
    unsigned char freq[2];           /* frequence. */
};

struct hfctlack
{
   char hf_intro[HFINTROSZ] ;
   char hf_sublen ;
   char hf_subtype ;
   char hf_align ;
   int  hf_request ;
   int  hf_retcode ;
   int  hf_arg_len ;
} ;

/* HFQUERY query dma command */
#define HFQDMACH      0x01            /* high type */
#define HFQDMACL      0x46            /* low type */
struct hfqdmac
{
   char hf_intro[HFINTROSZ];          /* introducer */
};

/* HFQUERY query dma response */
#define HFQDMARH      0x01            /* high type */
#define HFQDMARL      0xc6            /* low type */
struct hfqdmar
{
   char hf_intro[HFINTROSZ] ;
   char hf_sublen;            /* = 3 */
   char hf_subtype;           /* = 1 */
   char hf_align;             /* alignment byte */
   int  hf_dmaaddr;           /* starting address of DMA space */
   int  hf_dmalen;            /* length of DMA space */
} ;

/* HFMDMA dma move ioctl */
struct hfmdma
{
   uint   hf_srcaddr;           /* source address of DMA data */
   uint   hf_dmalen;            /* length of DMA data */
   uint   hf_destaddr;          /* destination address of DMA data */
} ;

#define VTD_MIN_LENGTH 6 
#define VTD_TYPHI 4
#define VTD_TYPLO 5
/*
#define  HFSEL0	10
#define  HFSEL1	11
#define  HFVAL0	12
#define  HFVAL1	13
#define  HFSEL0	8
#define  HFSEL1	9
#define  HFVAL0	10
#define  HFVAL1	11
*/
#define  HFSEL0	localbuf[6] + 6
#define  HFSEL1	localbuf[6] + 7
#define  HFVAL0	localbuf[6] + 8
#define  HFVAL1	localbuf[6] + 9
#define  HFSETN	localbuf[6] + 6 
#define  HFCHRS	localbuf[6] + 8

/* PB: added for MAPMEM ioctl   */
#define MAPMEM	0xff
#endif _h_HFT
  typekêR s  $        ‘O  =‰*a˜ˆ*=‰*     ¾‘O  	              V™  ./usr/include/sys/hft/hftkeydat.h h     #ifndef H_HFTKEYDAT
#define H_HFTKEYDAT

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)hftkeydat.h	16.12	AIX)	/* Modified: 21:00:33 7/25/90 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/

char *file_name = "/etc/kbdtbls";	/* where the keyboard tables live */

static  struct  menu_sel 
{
   char   name_len;
   char  *lang;
   char  *cap_lang;
   char  *path;
}  menu_table[] = 
{
/*  0. Belgian-French/Dutch */  7, "belgian",    "BELGIAN",    "Belgian", 
/*  1. Canadian/French      */  8, "canadian",   "CANADIAN",   "Canadian",  
/*  2. Danish               */  6, "danish",     "DANISH",     "Danish",  
/*  3. Dutch                */  5, "dutch",      "DUTCH",      "Dutch",
/*  4. French               */  6, "french",	 "FRENCH",     "French",  
/*  5. German               */  6, "german",	 "GERMAN",     "German", 
/*  6. Italian              */  7, "italian",	 "ITALIAN",    "Italian",
/*  7. Latin American       */  9, "latinamer",  "LATINAMER",  "LatinAmer",
/*  8. Norwigian            */  9, "norwegian",  "NORWEGIAN",  "Norwegian",  
/*  9. Portuguese           */ 10, "portuguese", "PORTUGUESE", "Portuguese",  
/* 10. Spanish              */  7, "spanish",    "SPANISH",    "Spanish", 
/* 11. Finnish/Swedish      */  7, "swedish",    "SWEDISH",    "Swedish",  
/* 12. Swiss/French         */  9, "swissfren",  "SWISSFREN",  "SwissFren",
/* 13. Swiss/German         */  9, "swissgerm",  "SWISSGERM",  "SwissGerm",  
/* 14. UK English           */  2, "uk",	 "UK",	       "UK",  
/* 15. US English           */  2, "us",	 "US",	       "US", 
#ifdef _MBCS
/* 16. Icelandic            */  9, "icelandic",  "ICELANDIC",  "Icelandic",
/* 17. Japanese             */  8, "japanese",   "JAPANESE",    "Japanese",
#endif /* _MBCS */
/*                          */  0,   0,  	   0,   	0
}; 

/*-------------------------------------------------------------*/
/*  This struct is used as a CAPS LOCK map for each languages. */
/*-------------------------------------------------------------*/
struct caplock_map
{
    char   range[12];
    char   value[12];    /*  0: set CAP LOCK;  1: not set;  */
} cap_lock[] =
{
/*  0. Belgian     */  29,   2,  12,   2,  11,  78,   0,   0,   0,  0,0,0,
                        0,   1,   0,   1,   0,   1,   0,   0,   0,  0,0,0,
/*  1. Canadian    */  17,  10,   4,   9,   6,   7,   2,   1,  78,  0,0,0,
                        1,   0,   1,   0,   1,   0,   1,   0,   1,  0,0,0,
/*  2. Danish      */  17,  11,   3,  11,   4,   7,  81,   0,   0,  0,0,0,
                        1,   0,   1,   0,   1,   0,   1,   0,   0,  0,0,0,
/*  3. Dutch       */  17,  10,   4,   9,   6,   7,  81,   0,   0,  0,0,0,
                        1,   0,   1,   0,   1,   0,   1,   0,   0,  0,0,0,
/*  4. French      */  45,   1,  11,  78,   0,   0,   0,   0,   0,  0,0,0,
                        0,   1,   0,   1,   0,   0,   0,   0,   0,  0,0,0,
/*  5. German      */  45,   1,  11,  78,   0,   0,   0,   0,   0,  0,0,0,
                        0,   1,   0,   1,   0,   0,   0,   0,   0,  0,0,0,
/*  6. Italian     */  17,  10,   4,   9,   6,   7,  81,   0,   0,  0,0,0,
                        1,   0,   1,   0,   1,   0,   1,   0,   0,  0,0,0,
/*  7. Latin Ameri */  17,  10,   4,  10,   5,   7,  81,   0,   0,  0,0,0,
                        1,   0,   1,   0,   1,   0,   1,   0,   0,  0,0,0,
/*  8. Norway      */  17,  11,   3,  11,   4,   7,  81,   0,   0,  0,0,0,
                        1,   0,   1,   0,   1,   0,   1,   0,   0,  0,0,0,
/*  9. Portuguese  */  17,  10,   4,  10,   5,   7,  81,   0,   0,  0,0,0,
                        1,   0,   1,   0,   1,   0,   1,   0,   0,  0,0,0,
/* 10. spanish     */  17,  10,   4,  10,   1,   1,   3,   7,  81,  0,0,0,
                        1,   0,   1,   0,   1,   0,   1,   0,   1,  0,0,0,
/* 11. swedish     */  17,  11,   3,  11,   4,   7,  81,   0,   0,  0,0,0,
                        1,   0,   1,   0,   1,   0,   1,   0,   0,  0,0,0,
/* 12. Swissfrench */  17,  10,   4,   9,   6,   7,  81,   0,   0,  0,0,0,
                        1,   0,   1,   0,   1,   0,   1,   0,   0,  0,0,0,
/* 13. Swissgerm   */  17,  10,   4,   9,   6,   7,  81,   0,   0,  0,0,0,
                        1,   0,   1,   0,   1,   0,   1,   0,   0,  0,0,0,
/* 14. UK          */  17,  10,   4,   9,   6,   7,  81,   0,   0,  0,0,0,
                        1,   0,   1,   0,   1,   0,   1,   0,   0,  0,0,0, 
/* 15. US          */  17,  10,   4,   9,   6,   7,  81,   0,   0,  0,0,0,
                        1,   0,   1,   0,   1,   0,   1,   0,   0,  0,0,0, 
#ifdef _MBCS
/* 16. Icelandic   */  12,   1,   4,  11,   3,  10,   5,   7,   2,  1,78,0,
                        1,   0,   1,   0,   1,   0,   1,   0,   1,  0,1,0,
/* 17. Japanese    */  17,  10,   4,   9,   6,   7,  81,   0,   0,  0,0,0,
                        1,   0,   1,   0,   1,   0,   1,   0,   0,  0,0,0, 
#endif /* _MBCS */
/*                 */   0,   0,   0,   0,   0,   0,   0,   0,   0,  0,0,0,
                        0,   0,   0,   0,   0,   0,   0,   0,   0,  0,0,0
};

static struct  patrn_table {
    char     *sym;
    char      code;
};

static struct  patrn_range {
    short     bg_range;
    short     ed_range;
};

static struct  patrn_table pattern_g[] =  {
/*      0 */     0,           0,
/*  01  1 */    "#",        0x23,
/*      1 */    "$",        0x24,
/*      1 */    "@",        0x40,
/*      1 */    "_",        0x5f,
/*      1 */    "0",        0x30,
/*      1 */    "1",        0x31,
/*      1 */    "2",        0x32,
/*      1 */    "3",        0x33,
/*      1 */    "4",        0x34,
/*      1 */    "5",        0x35,
/*      1 */    "6",        0x36,
/*      1 */    "7",        0x37,
/*      1 */    "8",        0x38,
/*      1 */    "9",        0x39,
/*  15  2 */    "at",       0x40,     /* @ */
/*      2 */    "eq",       0x3d,     /* equals sign */
/*      2 */    "gt",       0x3e,     /* greater than sign */
/*      2 */    "lt",       0x3c,     /* less than sign */
/*      2 */    "or",       0x7c,     /* or symbol */
/*      2 */    "sp",       0x20,     /* space */
/*  21  3 */    "amp",      0x26,     /* ampersand */
/*      3 */    "and",      0x5e,     /* inverted v */
/*      3 */    "ast",      0x2a,     /* asterisk */
/*      3 */    "com",      0x2c,     /* comma */
/*      3 */    "del",      0x7f,     /* delete */
/*      3 */    "exc",      0x21,     /* exclamation mark */
/*      3 */    "lca",      0x61,
/*      3 */    "lcb",      0x62,
/*      3 */    "lcc",      0x63,
/*      3 */    "lcd",      0x64,
/*      3 */    "lce",      0x65,
/*      3 */    "lcf",      0x66,
/*      3 */    "lcg",      0x67,
/*      3 */    "lch",      0x68,
/*      3 */    "lci",      0x69,
/*      3 */    "lcj",      0x6a,
/*      3 */    "lck",      0x6b,
/*      3 */    "lcl",      0x6c,
/*      3 */    "lcm",      0x6d,
/*      3 */    "lcn",      0x6e,
/*      3 */    "lco",      0x6f,
/*      3 */    "lcp",      0x70,
/*      3 */    "lcq",      0x71,
/*      3 */    "lcr",      0x72,
/*      3 */    "lcs",      0x73,
/*      3 */    "lct",      0x74,
/*      3 */    "lcu",      0x75,
/*      3 */    "lcv",      0x76,
/*      3 */    "lcw",      0x77,
/*      3 */    "lcx",      0x78,
/*      3 */    "lcy",      0x79,
/*      3 */    "lcz",      0x7a,
/*      3 */    "lsb",      0x5b,     /* left square bracket */
/*      3 */    "rsb",      0x5d,     /* right square bracket */
/*      3 */    "tee",      0xc2,     /* upright tee */
/*      3 */    "UCa",      0x41, 
/*      3 */    "UCb",      0x42,
/*      3 */    "UCc",      0x43,
/*      3 */    "UCd",      0x44,
/*      3 */    "UCe",      0x45,
/*      3 */    "UCf",      0x46,
/*      3 */    "UCg",      0x47,
/*      3 */    "UCh",      0x48,
/*      3 */    "UCi",      0x49,
/*      3 */    "UCj",      0x4a,
/*      3 */    "UCk",      0x4b,
/*      3 */    "UCl",      0x4c,
/*      3 */    "UCm",      0x4d,
/*      3 */    "UCn",      0x4e,
/*      3 */    "UCo",      0x4f,
/*      3 */    "UCp",      0x50,
/*      3 */    "UCq",      0x51,
/*      3 */    "UCr",      0x52,
/*      3 */    "UCs",      0x53,
/*      3 */    "UCt",      0x54,
/*      3 */    "UCu",      0x55,
/*      3 */    "UCv",      0x56,
/*      3 */    "UCw",      0x57,
/*      3 */    "UCx",      0x58,
/*      3 */    "UCy",      0x59,
/*      3 */    "UCz",      0x5a,
/*      3 */    "uca",      0x41,     /* upper case a */
/*      3 */    "ucb",      0x42,
/*      3 */    "ucc",      0x43,
/*      3 */    "ucd",      0x44,
/*      3 */    "uce",      0x45,
/*      3 */    "ucf",      0x46,
/*      3 */    "ucg",      0x47,
/*      3 */    "uch",      0x48,
/*      3 */    "uci",      0x49,
/*      3 */    "ucj",      0x4a,
/*      3 */    "uck",      0x4b,
/*      3 */    "ucl",      0x4c,
/*      3 */    "ucm",      0x4d,
/*      3 */    "ucn",      0x4e,
/*      3 */    "uco",      0x4f,
/*      3 */    "ucp",      0x50,
/*      3 */    "ucq",      0x51,
/*      3 */    "ucr",      0x52,
/*      3 */    "ucs",      0x53,
/*      3 */    "uct",      0x54,
/*      3 */    "ucu",      0x55,
/*      3 */    "ucv",      0x56,
/*      3 */    "ucw",      0x57,
/*      3 */    "ucx",      0x58,
/*      3 */    "ucy",      0x59,
/*      3 */    "ucz",      0x5a,
/*      3 */    "yen",      0xbe,     /* yen symbol */
/* 109  4 */    "cent",     0xbd,     /* cent symbol */
/*      4 */    "dash",     0x2d,     /* dash */
/*      4 */    "half",     0xab,     /* one half */
/*      4 */    "larm",     0xb4,     /* vertical bar w/left arm */
/*      4 */    "lcae",     0x91,     /* lower case ae */
/*      4 */    "lcmu",     0xe6,     /* lower case mu */
/*      4 */    "lpar",     0x28,     /* left parenthesis */
/*      4 */    "para",     0xf4,     /* paragraph symbol */
/*      4 */    "plus",     0x2b,     /* plus sign */
/*      4 */    "ques",     0x3f,     /* question mark */
/*      4 */    "rarm",     0xc3,     /* vertical bar w/right arm */
/*      4 */    "rpar",     0x29,     /* right parenthesis */
/*      4 */    "sect",     0xf5,     /* section symbol */
/*      4 */    "semi",     0x3b,     /* semicolon */
/*      4 */    "ucae",     0x92,     /* upper case ae */
/* 124  5 */    "1quot",    0x27,     /* left single quote */
/*      5 */    "2quot",    0x22,     /* double quote */
/*      5 */    "acute",    0xef,     /* accute */
/*      5 */    "brite",    0xdb,     /* bright character cell */
/*      5 */    "colon",    0x3a,     /* colon */
/*      5 */    "cross",    0xc5,     /* crossed bars */
/*      5 */    "foxsp",    0xff,     /* space */
/*      5 */    "lquot",    0x60,
/*      5 */    "pound",    0x23,     /* # */
/*      5 */    "slash",    0x2f,     /* slash */
/*      5 */    "ssone",    0xfb,     /* superscript 1 */
/*      5 */    "sstwo",    0xfd,     /* superscript 2 */
/*      5 */    "undsc",    0x5f,     /* underscore */
/* 137  6 */    "3quart",   0xf3,     /* three quarters */
/*      6 */    "approx",   0x7e,     /* approximately */
/*      6 */    "bslash",   0x5c,     /* back slash */
/*      6 */    "copyrt",   0xb8,     /* copyright symbol */
/*      6 */    "dbless",   0xe1,     /* german double s; beta */
/*      6 */    "dblund",   0xf2,     /* double underscore */
/*      6 */    "degree",   0xf8,     /* degree symbol */
/*      6 */    "divide",   0xf6,     /* division symbol */
/*      6 */    "dollar",   0x24,     /* $ */
/*      6 */    "florin",   0x9f,     /* florin sign */
/*      6 */    "intlcu",   0xcf,     /* international currency */
/*      6 */    "invtee",   0xc1,     /* inverted tee */
/*      6 */    "lbrace",   0x7b,     /* left curly brace */
/*      6 */    "lcaacc",   0xa0,     /* lower case a acute */
/*      6 */    "lcacrf",   0x83,     /* lower case a circumflex */
/*      6 */    "lcagrv",   0x85,     /* lower case a grave */
/*      6 */    "lcaovc",   0x86,     /* lower case a overcircle */
/*      6 */    "lcatil",   0xc6,     /* lower case a tilde */
/*      6 */    "lcauml",   0x84,     /* lower case a umlaut */
/*      6 */    "lcaund",   0xa6,     /* lower case a underscore */
/*      6 */    "lccced",   0x87,     /* lower case c cedilla */
/*      6 */    "lceacc",   0x82,     /* lower case e accent (acute) */
/*      6 */    "lcecrf",   0x88,     /* lower case e circumflex */
/*      6 */    "lcegrv",   0x8a,     /* lower case e grave */
/*      6 */    "lceice",   0xd0,     /* lower case eth icelandic */
/*      6 */    "lceuml",   0x89,     /* lower case e umlaut */
/*      6 */    "lciacc",   0xa1,     /* lower case i acute */
/*      6 */    "lcicrf",   0x8c,     /* lower case i circumflex */
/*      6 */    "lcidtl",   0xd5,     /* lower case i dotless */
/*      6 */    "lcigrv",   0x8d,     /* lower case i grave */
/*      6 */    "lciuml",   0x8b,     /* lower case i umlaut */
/*      6 */    "lcntil",   0xa4,     /* lower case n tilde */
/*      6 */    "lcoacc",   0xa2,     /* lower case o acute */
/*      6 */    "lcocrf",   0x93,     /* lower case o circumflex */
/*      6 */    "lcogrv",   0x95,     /* lower case o grave */
/*      6 */    "lcosls",   0x9b,     /* lower case o slash */
/*      6 */    "lcotil",   0xe4,     /* lower case o tilde */
/*      6 */    "lcouml",   0x94,     /* lower case o umlaut */
/*      6 */    "lcound",   0xa7,     /* lower case o underscore */
/*      6 */    "lcsshp",   0xe1,     /* double s (s sharp)  -- german -- */
/*      6 */    "lctice",   0xe7,     /* lower case thorn icelandic */
/*      6 */    "lcuacc",   0xa3,     /* lower case u acute */
/*      6 */    "lcucrf",   0x96,     /* lower case u circumflex */
/*      6 */    "lcugrv",   0x97,     /* lower case u grave */
/*      6 */    "lcuuml",   0x81,     /* lower case u umlaut */
/*      6 */    "lcyacc",   0xec,     /* lower case y accute */
/*      6 */    "lcyuml",   0x98,     /* lower case y umlaut */
/*      6 */    "llcorn",   0xc0,     /* lower left corner */
/*      6 */    "lrcorn",   0xd9,     /* lower right corner */
/*      6 */    "mddotf",   0xfa,     /* filled middle dot */
/*      6 */    "multpl",   0x9e,     /* peseta sign */
/*      6 */    "ovrbar",   0xee,     /* overbar */
/*      6 */    "period",   0x2e,     /* period */
/*      6 */    "plsmns",   0xf1,     /* lower case sigma */
/*      6 */    "rbrace",   0x7d,     /* right curly brace */
/*      6 */    "regtrd",   0xa9,     /* registered trade mark */
/*      6 */    "ssthre",   0xfc,     /* superscript 3 */
/*      6 */    "strlng",   0x9c,     /* pounds sterling */
/*      6 */    "sylhyp",   0xf0,     /* syllable hyphen */
/*      6 */    "ucaacc",   0xb5,     /* upper case a accute */
/*      6 */    "ucacrf",   0xb6,     /* upper case a circumflex */
/*      6 */    "ucagrv",   0xb7,     /* upper case a grave */
/*      6 */    "ucaovc",   0x8f,     /* upper case o overcircle */
/*      6 */    "ucatil",   0xc7,     /* upper case a tilde */
/*      6 */    "ucauml",   0x8e,     /* upper case a umlaut */
/*      6 */    "uccced",   0x80,     /* upper case c cedilla */
/*      6 */    "uceacc",   0x90,     /* upper case e acute */
/*      6 */    "ucecrf",   0xd2,     /* upper case e circumflex */
/*      6 */    "ucegrv",   0xd4,     /* upper case e grave */
/*      6 */    "uceice",   0xd1,     /* upper case eth icelandic */
/*      6 */    "uceuml",   0xd3,     /* upper case e umlaut */
/*      6 */    "uciacc",   0xd6,     /* upper case i accute */
/*      6 */    "ucicrf",   0xd7,     /* upper case i circumflex */
/*      6 */    "ucigrv",   0xde,     /* upper case i grave */
/*      6 */    "uciuml",   0xd8,     /* upper case i umlaut */
/*      6 */    "ucntil",   0xa5,     /* upper case n tilde */
/*      6 */    "ucoacc",   0xe0,     /* upper case o accute */
/*      6 */    "ucocrf",   0xe2,     /* upper case o circumflex */
/*      6 */    "ucogrv",   0xe3,     /* upper case o grave */
/*      6 */    "ucosls",   0x9d,     /* upper case o slash */
/*      6 */    "ucotil",   0xe5,     /* upper case o tilde */
/*      6 */    "ucouml",   0x99,     /* upper case o umlaut */
/*      6 */    "uctice",   0xe8,     /* upper case thorn icelandic */
/*      6 */    "ucuacc",   0xe9,     /* upper case u accute */
/*      6 */    "ucucrf",   0xea,     /* upper case u circumflex */
/*      6 */    "ucugrv",   0xeb,     /* upper case u grave */
/*      6 */    "ucuuml",   0x9a,     /* upper case u umlaut */
/*      6 */    "ucyacc",   0xed,     /* upper case y accute */
/*      6 */    "ulcorn",   0xda,     /* upper left corner */
/*      6 */    "umlaut",   0xf9,     /* umlaut */
/*      6 */    "urcorn",   0xbf,     /* upper right corner */
/*      6 */    "vlbrok",   0xdd,     /* vertical line broken */
/*      6 */    "vtrecf",   0xfe,     /* filled vertical rectangle */
/* 230  7 */    "botbrit",  0xdc,     /* bottom bright character cell */
/*      7 */    "cedilla",  0xf7,     /* cedilla */
/*      7 */    "fulhash",  0xb2,     /* full hashed */
/*      7 */    "hafhash",  0xb1,     /* half hashed */
/*      7 */    "horzbar",  0xc4,     /* horizontal bar */
/*      7 */    "invexcl",  0xad,     /* inverted exclamation point */
/*      7 */    "invques",  0xa8,     /* inverted question mark */
/*      7 */    "langquo",  0xae,     /* left angle quotes */
/*      7 */    "notsign",  0xaa,     /* not sign */
/*      7 */    "percent",  0x25,     /* percent */
/*      7 */    "quahash",  0xb0,     /* quarter hashed */
/*      7 */    "quarter",  0xac,     /* one quarter */
/*      7 */    "rangquo",  0xaf,     /* right angle quotes */
/*      7 */    "topbrit",  0xdf,     /* top bright character cell */
/*      7 */    "vertbar",  0xb3,     /* vertical bar */
/* 245    */           0,       0
}; 

    
static struct  patrn_table  pattern_s[] = {
/*    */       0,       0, 
/* 01 */     "bs",    0x08,    /*  back space         */
/*    */     "cr",    0x0d,    /*  Carriage Return    */ 
/*    */     "em",    0x19,    /*  end of media       */ 
/*    */     "ff",    0x0c,    /*  ff                 */ 
/*    */     "ht",    0x09,    /*  horizontal tab     */ 
/*    */     "lf",    0x0a,    /*  lf                 */ 
/*    */     "si",    0x0f,    /*  shift in           */ 
/*    */     "so",    0x0e,    /*  shift out          */ 
/*    */     "vt",    0x0b,    /*  vertical tab       */ 
/* 10 */     "ack",   0x06,    /*  acknowledge        */     
/*    */     "bel",   0x07,    /*  bell               */ 
/*    */     "can",   0x18,    /*  cancel             */ 
/*    */     "dc1",   0x11,    /*  dc1                */ 
/*    */     "dc2",   0x12,    /*  device control 2   */ 
/*    */     "dc3",   0x13,    /*  Device Control 3   */ 
/*    */     "dc4",   0x14,    /*  device control 4   */ 
/*    */     "del",   0x7f,    /*  delete             */    
/*    */     "dle",   0x10,    /*  data link enable   */    
/*    */     "enq",   0x05,    /*  enquiry            */ 
/*    */     "eot",   0x04,    /*  end of trans       */ 
/*    */     "esc",   0x1b,    /*  Escape             */ 
/*    */     "etb",   0x17,    /*  end of blk         */ 
/*    */     "etx",   0x03,    /*  end of text        */ 
/*    */     "nak",   0x15,    /*  nak                */ 
/*    */     "nul",   0x00,    /*  Nul                */ 
/*    */     "soh",   0x01,    /*  start of header    */     
/*    */     "ss1",   0x1f,    /*  single shift 1     */ 
/*    */     "ss2",   0x1e,    /*  single shift 2     */ 
/*    */     "ss3",   0x1d,    /*  single shift 3     */ 
/*    */     "ss4",   0x1c,    /*  single shift 4     */ 
/*    */     "stx",   0x02,    /*  start of text      */ 
/*    */     "sub",   0x1a,    /*  sub                */ 
/*    */     "syn",   0x16,    /*  sync idle          */ 
/* 34 */        0,       0
};

static struct  patrn_range  range_g[] =  {
/* 0 */       0,         0,
/* 1 */       1,        15,
/* 2 */      15,        21,
/* 3 */      21,       109,
/* 4 */     109,       124,
/* 5 */     124,       137,
/* 6 */     137,       230,
/* 7 */     230,       245
};

static struct  patrn_range  range_s[] = { 
/* 0 */       0,         0,
/* 1 */       0,         0,
/* 2 */       1,        10,
/* 3 */      10,        34,
};

#endif		/* H_HFTKEYDAT */
er casekêæ- t  $        P  =‰*a˜ˆ*=‰*     §µP  	              ÔN  ./usr/include/sys/hft/hftkeydef.h h     #ifndef H_HFTKEYDEF
#define H_HFTKEYDEF

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)hftkeydef.h	16.7	AIX)	/* Modified: 21:01:01 7/25/90 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/

#define  READY
/***************************/
/*   key type declare      */
/***************************/

#define  GRAPHIC	 0
#define  SINGLE_CTL	 1
#define  ESC_FUNC 	 2
#define  CNTL_FUNC	 3
#define  CHAR_STR	 4

/***************************/
/*   key status  declare   */
/***************************/

#define  DEAD            1
#define  NORM		 2
#ifndef CURS			/*hftcons.c uses a different val from merge.h */
#define  CURS		 3
#endif
#define  CPFK		 4
#define  NONEK		 0xff

#define  CHARSET_P0	 0x3c
#define  CHARSET_P1	 0x3d
#define  CHARSET_P2	 0x3e
#define  KEY_STATES	 5
#define  FALSE           0
#define  TRUE		 1

#define  MAX_LANG_LEN      9 
#define  MAX_OPTION       16
#define  MAX_STRING      256

/*******************************************/
/*  Define the special key's key position. */                   
/*******************************************/
#ifndef SP			/* hftcons.c uses a different val from reg.h */
#define  SP	          15 
#endif
#define  HT	          16
#define  L_SHIFT          44
#define  R_SHIFT          57
#ifndef CONTROL			/*hftcons.c uses a different val from vtssm.h */
#define  CONTROL          58
#endif
#define  L_ALT            60
#define  R_ALT            62
#define  AUCTION          64
#define  CAP_LOC          30
#define  NUM_LOC          90

/***********************************************************/
/*  Define the pattern value which is used for  formating. */                   
/***********************************************************/
#define  CH_5		  buffer[5]
#define  CH_24	  	  buffer[24]
#define  CH_30	  	  buffer[30]
#define  CH_31	  	  buffer[31]
#define  CNTL_NONE_POS    47
#define  CNTL_CSFK_POS    49
#define  GRAPHIC_POS      53
#define  SNGL_NONE_POS    56
#define  SNGL_CURS_POS    58

#define  NULL		   0 
#define  O_RDWR            2

#define NUM_LANG	18
#define NUM_DISPLAY	3

#define DEF_LANG	15	/*  US English.  */
#ifdef _MBCS
#define JPN_LANG	17	/*  Japanese keyboard */
#endif /* _MBCS */

#define DEF_DISP	2	/* 8513 on vga */
#define NSTATES		5	/* Number of states for each key */
#define NKEYS		103	/* Number of keys on each map */
#define MAPSIZE		1030	/* Size of a keyboard map in bytes */
 
/* key down work bit defs */
#define LSHIFT	0x01	/* left shift key */
#define RSHIFT	0x02	/* right shift key */
#define CAPLCK	0x04	/* caps lock key */
#define NUMLCK	0x08	/* num lock key */
#define SCROLCK 0x10	/* scroll lock key */
 
 
/* 
 * Actual scan code values given by the keyboard
 * Needed for Dos so that only unmapped keystrokes will change state
 * information.
 */
#define CTL_KEY 0x1D		/* scan code for control key */
#define CAPSLOCK_KEY 0x3A	/* scan code for caps lock key */
#define LEFT_KEY 0x2A		/* scan code for left shift key */
#define RIGHT_KEY 0x36		/* scan code for right shift key */
#define ALT_KEY 0x38		/* scan code for alt key */
#define ALT_GRA_MK 0xe038          /* scan code for alt-gr key MAR - PB */
#define ALT_GRA_BR 0xe0b8          /* scan code for alt-gr key MAR - PB */
#define ALT_GR 0x80		   /* Alt gr state	       MAR - PB */
 
 
/*
 * control codes and synonyms
 */
#define	CTa	0x01
#define	CTb	0x02
#define	CTc	0x03
#define	CTd	0x04
#define	CTe	0x05
#define	CTf	0x06
#define	CTg	0x07
#define	CTh	0x08
#define	CTi	0x09
#define	CTj	0x0a
#define LF	0x0a
#define	CTk	0x0b
#define	CTl	0x0c
#define	CTm	0x0d
#define	CTn	0x0e
#define	CTo	0x0f
#define	CTp	0x10
#define	CTq	0x11
#define	CTr	0x12
#define	CTs	0x13
#define	CTt	0x14
#define	CTu	0x15
#define	CTv	0x16
#define	CTw	0x17
#define	CTx	0x18
#define	CTy	0x19
#define	CTz	0x1a
#define DEL	0x7f
#define	ESC	0x1b
#define	AFS	0x1c		/* AIX quit character */
#define AGS	0x1d
#define ARS	0x1e
#define AUS	0x1f
#define RTAB	0x84
 
/*
** keys that require special handling
**	codes all have high bit set
*/
#define SPECIAL		0x80
#define FIRST_SPECIAL 	0x85
#define RSH		0x85	/* right shift	*/
#define CTL		0x86	/* control	*/
#define CLK		0x87	/* caps lock	*/
#define LSH		0x88	/* left shift	*/
#define ALT		0x89	/* left or right alt */
#define NLK		0x8a	/* num lock	*/
#define SCRLK		0x8b	/* scroll lock  */
#define NUM_0		0x90	/* keypad 0	*/
#define NUM_1		0x91	/* keypad 1	*/
#define NUM_2		0x92	/* keypad 2	*/
#define NUM_3		0x93	/* keypad 3	*/
#define NUM_4		0x94	/* keypad 4	*/
#define NUM_5		0x95	/* keypad 5	*/
#define NUM_6		0x96	/* keypad 6	*/
#define NUM_7		0x97	/* keypad 7	*/
#define NUM_8		0x98	/* keypad 8	*/
#define NUM_9		0x99	/* keypad 9	*/
#define NUM_DOT		0xba	/* keypad '.'   */
#define F1		0xc0	/* function keys */
#define F2		0xc1
#define F3		0xc2
#define F4		0xc3
#define F5		0xc4
#define F6		0xc5
#define F7		0xc6
#define F8		0xc7
#define F9		0xc8
#define F10		0xc9
#define F11		0xca
#define F12		0xcb
#define F13		0xcc
#define F14		0xcd
#define F15		0xce
#define F16		0xcf
#define F17		0xd0
#define F18		0xd1
#define F19		0xd2
#define F20		0xd3
#define F21		0xd4
#define F22		0xd5
#define F23		0xd6
#define F24		0xd7
#define F25		0xd8
#define F26		0xd9
#define F27		0xda
#define F28		0xdb
#define F29		0xdc
#define F30		0xdd
#define F31		0xde
#define F32		0xdf
#define F33		0xe0
#define F34		0xe1
#define F35		0xe2
#define F36		0xe3
#define F37		0xe4
#define F38		0xe5
#define F39		0xe6
#define F40		0xe7
#define F41		0xe8
#define F42		0xe9
#define F43		0xea
#define F44		0xeb
#define F45		0xec
#define F46		0xed
#define F47		0xee
#define F48		0xef
#define NONE		0xff	/* keystroke produces no character */
#define NOTHING 	0xffff
 
/*********************************/
/*   default flag declarations   */
/*********************************/

#define KBD_DEF		0x01
#define DISP_DEF	0x02

/****************************************************/
/*  Define the index of error messages for hftinit. */                   
/****************************************************/
#define M_TERM		0
#define M_FILE		1
#define M_S_DISP	2
#define M_S_MAP		3
#define M_REBOOT	4
#define M_DEFKBD	5
#define M_DEFDISP	6
#define M_NODISP	7
#define M_SEEK		8
#define M_READ		9
#define M_UNPACK	10
#define M_NVRAM		11
#define M_BOOT		12

#ifdef _MBCS
#define M_S_JKBD	13
#define M_S_JDISP	14
#endif /* _MBCS */

#endif		/* H_HFTKEYDEF */
kêˆp u  $        ÀŸ  =‰*b˜ˆ*=‰*     J»ÀŸ  	              C»  ./usr/include/sys/hft/hftlang.h #ifndef H_HFTLANG
#define H_HFTLANG

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)hftlang.h	16.4	AIX)	/* Modified: 14:19:40 9/26/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/

static struct diacrentry diac[18] = {
{CHARSET_P0, ic_1quot,       ic_acutestart,  ic_acutestop }, /*acute    0 */
{CHARSET_P1, ic_acute_old,   ic_acutestart,  ic_acutestop }, /*acute    1 */
{CHARSET_P0, ic_acute,       ic_acutestart,  ic_acutestop }, /*acute    2 */
{CHARSET_P0, ic_lquot,       ic_gravestart,  ic_gravestop }, /*grave    3 */
{CHARSET_P0, ic_and,         ic_crflxstart,  ic_crflxstop }, /*crcflex  4 */
{CHARSET_P1, ic_umlaut_old,  ic_umlautstart, ic_umlautstop}, /*umlaut   5 */
{CHARSET_P0, ic_umlaut,      ic_umlautstart, ic_umlautstop}, /*umlaut   6 */
{CHARSET_P0, ic_approx,      ic_tildestart,  ic_tildestop},  /*tilde    7 */
{CHARSET_P1, ic_caron,       ic_caronstart,  ic_caronstop},  /*caron    8 */
{CHARSET_P1, ic_breve,       ic_brevestart,  ic_brevestop},  /*breve    9 */
{CHARSET_P1, ic_dblacu,      ic_dblacustart, ic_dblacustop}, /*dblacute 10*/
{CHARSET_P1, ic_ovrcrc,      ic_ovrcrcstart, ic_ovrcrcstop}, /*ovrcrcl  11*/
{CHARSET_P0, ic_degree,      ic_ovrcrcstart, ic_ovrcrcstop}, /*ovrcrcl  12*/
{CHARSET_P1, ic_ovrdot,      ic_ovrdotstart, ic_ovrdotstop}, /*overdot  13*/
{CHARSET_P1, ic_macron,      ic_macronstart, ic_macronstop}, /*macron   14*/
{CHARSET_P1, ic_cedilla_old, ic_cedilstart,  ic_cedilstop},  /*cedilla  15*/
{CHARSET_P0, ic_cedilla,     ic_cedilstart,  ic_cedilstop},  /*cedilla  16*/
{CHARSET_P1, ic_ogonek,      ic_ogonekstart, ic_ogonekstop}  /*ogonek   17*/
};
 
/* This is the default US keyboard map. */

struct keyb_map
  keytab [NKEYS][NSTATES] = {
/* code */ 
/*  0  base        */   ESC_FUNC,  NORM,     NONE,     NONE,        NONE,
/*  0  shift       */   ESC_FUNC,  NORM,     NONE,     NONE,        NONE,
/*  0  control     */   ESC_FUNC,  NORM,     NONE,     NONE,        NONE,
/*  0  alt         */   ESC_FUNC,  NORM,     NONE,     NONE,        NONE,
/*  0  alt         */   ESC_FUNC,  NORM,     NONE,     NONE,        NONE,
 
/* 110  base        */  SINGLE_CTL, NORM,       1,     CHARSET_P0,  ESC,
/* 110  shift       */   CNTL_FUNC, CPFK,       1,     CHARSET_P0,  F_120,
/* 110  control     */   CNTL_FUNC, CPFK,       0,     CHARSET_P0,  F_121,
/* 110  alt         */   CNTL_FUNC, CPFK,       0,     CHARSET_P0,  F_122,
/* 110  alt         */   CNTL_FUNC, CPFK,       0,     CHARSET_P0,  F_122,
 
/*  2  base        */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '1', 
/*  2  shift       */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '!', 
/*  2  control     */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_49,
/*  2  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_58,
/*  2  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_58,
 
/*  3  base        */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '2', 
/*  3  shift       */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '@', 
/*  3  control     */  SINGLE_CTL, NORM,        0,     CHARSET_P0,   0x00,
/*  3  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_59,
/*  3  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_59,
 
/*  4  base        */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '3', 
/*  4  shift       */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '#', 
/*  4  control     */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_50,
/*  4  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_60,
/*  4  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_60,
 
/*  5  base        */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '4', 
/*  5  shift       */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '$', 
/*  5  control     */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_51,
/*  5  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_61,
/*  5  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_61,
 
/*  6  base        */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '5', 
/*  6  shift       */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '%', 
/*  6  control     */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_52,
/*  6  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_62,
/*  6  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_62,
 
/*  7  base        */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '6', 
/*  7  shift       */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '^', 
/*  7  control     */  SINGLE_CTL, NORM,        0,     CHARSET_P0,   ARS, 
/*  7  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_63,
/*  7  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_63,
 
/*  8  base        */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '7', 
/*  8  shift       */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '&', 
/*  8  control     */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_53,
/*  8  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_64,
/*  8  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   F_64,
 
/*  9  base        */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '8', 
/*  9  shift       */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '*', 
/*  9  control     */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   54,
/*  9  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   65,
/*  9  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,   65,
 
/*  10  base        */   GRAPHIC,   NORM,       1,     CHARSET_P0,   '9', 
/*  10  shift       */   GRAPHIC,   NORM,       1,     CHARSET_P0,   '(', 
/*  10  control     */   CNTL_FUNC, CPFK,       0,     CHARSET_P0,   55,
/*  10  alt         */   CNTL_FUNC, CPFK,       0,     CHARSET_P0,   66,
/*  10  alt         */   CNTL_FUNC, CPFK,       0,     CHARSET_P0,   66,
 
/*  11  base        */   GRAPHIC,   NORM,       1,     CHARSET_P0,   '0', 
/*  11  shift       */   GRAPHIC,   NORM,       1,     CHARSET_P0,   ')', 
/*  11  control     */   CNTL_FUNC, CPFK,       0,     CHARSET_P0,   56, 
/*  11  alt         */   CNTL_FUNC, CPFK,       0,     CHARSET_P0,   67,
/*  11  alt         */   CNTL_FUNC, CPFK,       0,     CHARSET_P0,   67,
 
/*  12  base        */   GRAPHIC,   NORM,       1,     CHARSET_P0,   '-', 
/*  12  shift       */   GRAPHIC,   NORM,       1,     CHARSET_P0,   '_', 
/*  12  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,   AUS, 
/*  12  alt         */   CNTL_FUNC, CPFK,       0,     CHARSET_P0,   68,
/*  12  alt         */   CNTL_FUNC, CPFK,       0,     CHARSET_P0,   68,
 
/*  13  base        */   GRAPHIC,   NORM,       1,     CHARSET_P0,  '=', 
/*  13  shift       */   GRAPHIC,   NORM,       1,     CHARSET_P0,  '+', 
/*  13  control     */   CNTL_FUNC, CPFK,       0,     CHARSET_P0,  69,
/*  13  alt         */   CNTL_FUNC, CPFK,       0,     CHARSET_P0,  70,
/*  13  alt         */   CNTL_FUNC, CPFK,       0,     CHARSET_P0,  70,
 
/*  15  base        */  SINGLE_CTL, CURS,       1,     CHARSET_P0,  '\b',  
/*  15  shift       */  SINGLE_CTL, CURS,       1,     CHARSET_P0,  '\b',  
/*  15  control     */  SINGLE_CTL, CURS,       0,     CHARSET_P0,  DEL, 
/*  15  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  71,
/*  15  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  71,
 
/*  16  base        */  SINGLE_CTL, CURS,       1,     CHARSET_P0,  '\t',  
/*  16  shift       */  SINGLE_CTL, CURS,       1,     CHARSET_P0,  RTAB, 
/*  16  control     */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  72,
/*  16  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  73,
/*  16  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  73,
 
/*  17  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'q', 
/*  17  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'Q', 
/*  17  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTq,
/*  17  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  74,
/*  17  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  74,
 
/*  18  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'w', 
/*  18  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'W', 
/*  18  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTw,
/*  18  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  75,
/*  18  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  75,
 
/*  19  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'e', 
/*  19  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'E', 
/*  19  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTe,
/*  19  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  76, 
/*  19  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  76, 
 
/*  20  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'r', 
/*  20  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'R', 
/*  20  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTr,
/*  20  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  77, 
/*  20  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  77, 
 
/*  21  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  't', 
/*  21  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'T', 
/*  21  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTt,
/*  21  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  78, 
/*  21  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  78, 
 
/*  22  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'y', 
/*  22  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'Y', 
/*  22  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTy,
/*  22  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  79,
/*  22  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  79,
 
/*  23  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'u', 
/*  23  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'U', 
/*  23  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTu,
/*  23  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  80, 
/*  23  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  80, 
 
/*  24  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'i', 
/*  24  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'I', 
/*  24  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTi,
/*  24  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  81,
/*  24  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  81,
 
/*  25  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'o', 
/*  25  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'O', 
/*  25  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTo,
/*  25  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  82,
/*  25  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  82,
 
/*  26  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'p', 
/*  26  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'P', 
/*  26  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTp,
/*  26  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  83, 
/*  26  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  83, 
 
/*  27  base        */   GRAPHIC,   NORM,       1,     CHARSET_P0,  '[', 
/*  27  shift       */   GRAPHIC,   NORM,       1,     CHARSET_P0,  '{', 
/*  27  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  ESC,
/*  27  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  84, 
/*  27  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  84, 
 
/*  28  base        */   GRAPHIC,   NORM,       1,     CHARSET_P0,  ']', 
/*  28  shift       */   GRAPHIC,   NORM,       1,     CHARSET_P0,  '}', 
/*  28  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  AGS,
/*  28  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  85, 
/*  28  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  85, 
 
/*  43  base        */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  '\r',
/*  43  shift       */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  '\r', 
/*  43  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  '\r', 
/*  43  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  100,
/*  43  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  100,
 
/*  58, 64 */
/*  64  base        */   SINGLE_CTL ,  NORM,       0,     CHARSET_P0,   CTL,
/*  64  shift       */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,   CTL,
/*  64  control     */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,   CTL,
/*  64  alt         */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,   CTL,
/*  64  alt         */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,   CTL,
 
/*  31  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'a', 
/*  31  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'A', 
/*  31  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTa, 
/*  31  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  87, 
/*  31  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  87, 
 
/*  32  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  's', 
/*  32  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'S', 
/*  32  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTs,
/*  32  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  88,
/*  32  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  88,
 
/*  33  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'd', 
/*  33  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'D', 
/*  33  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTd,
/*  33  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  89,
/*  33  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  89,
 
/*  34  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'f', 
/*  34  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'F', 
/*  34  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTf,
/*  34  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  90,
/*  34  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  90,
 
/*  35  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'g', 
/*  35  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'G', 
/*  35  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTg,
/*  35  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  91,
/*  35  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  91,
 
/*  36  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'h', 
/*  36  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'H', 
/*  36  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTh,
/*  36  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  92,
/*  36  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  92,
 
/*  37  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'j', 
/*  37  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'J', 
/*  37  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTj,
/*  37  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  93,
/*  37  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  93,
 
/*  38  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'k', 
/*  38  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'K', 
/*  38  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTk, 
/*  38  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  94,
/*  38  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  94,
 
/*  39  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'l', 
/*  39  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'L', 
/*  39  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTl,
/*  39  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  95, 
/*  39  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  95, 
 
/*  40  base        */   GRAPHIC,   NORM,       1,     CHARSET_P0,  ';', 
/*  40  shift       */   GRAPHIC,   NORM,       1,     CHARSET_P0,  ':', 
/*  40  control     */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  96,
/*  40  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  97,
/*  40  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  97,
 
/*  41  base        */   GRAPHIC,   NORM,       1,     CHARSET_P0,  '\'', 
/*  41  shift       */   GRAPHIC,   NORM,       1,     CHARSET_P0,  '"', 
/*  41  control     */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  98,
/*  41  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  99,
/*  41  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  99,
 
/*  1  base        */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '`', 
/*  1  shift       */   GRAPHIC,   NORM,        1,     CHARSET_P0,   '~', 
/*  1  control     */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,  57,
/*  1  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,  115,
/*  1  alt         */   CNTL_FUNC, CPFK,        0,     CHARSET_P0,  115,
 
/*  44  base        */  SINGLE_CTL,  NONE,       0,     NONE,      LSH,
/*  44  shift       */  SINGLE_CTL,  NONE,       0,     NONE,      LSH,
/*  44  control     */  SINGLE_CTL,  NONE,       0,     NONE,      LSH, 
/*  44  alt         */  SINGLE_CTL,  NONE,       0,     NONE,      LSH, 
/*  44  alt         */  SINGLE_CTL,  NONE,       0,     NONE,      LSH, 
 
/*  29  base        */   GRAPHIC,   NORM,       1,     CHARSET_P0,  '\\', 
/*  29  shift       */   GRAPHIC,   NORM,       1,     CHARSET_P0,  '|', 
/*  29  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  AFS,
/*  29  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  86, 
/*  29  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  86, 
 
/*  46  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'z', 
/*  46  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'Z', 
/*  46  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTz, 
/*  46  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  101, 
/*  46  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  101, 
 
/*  47  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'x', 
/*  47  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'X', 
/*  47  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTx, 
/*  47  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  102, 
/*  47  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  102, 
 
/*  48  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'c', 
/*  48  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'C', 
/*  48  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTc, 
/*  48  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  103, 
/*  48  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  103, 
 
/*  49  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'v', 
/*  49  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'V', 
/*  49  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTv, 
/*  49  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  104, 
/*  49  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  104, 
 
/*  50  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'b', 
/*  50  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'B', 
/*  50  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTb, 
/*  50  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  105, 
/*  50  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  105, 
 
/*  51  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'n', 
/*  51  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'N', 
/*  51  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTn, 
/*  51  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  106, 
/*  51  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  106, 
 
/*  52  base        */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'm', 
/*  52  shift       */   GRAPHIC,   NORM,       0,     CHARSET_P0,  'M', 
/*  52  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  CTm, 
/*  52  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  107, 
/*  52  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  107, 
 
/*  53  base        */   GRAPHIC,   NORM,       1,     CHARSET_P0,  ',', 
/*  53  shift       */   GRAPHIC,   NORM,       1,     CHARSET_P0,  '<', 
/*  53  control     */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  108, 
/*  53  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  109, 
/*  53  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  109, 
 
/*  54  base        */   GRAPHIC,   NORM,       1,     CHARSET_P0,  '.', 
/*  54  shift       */   GRAPHIC,   NORM,       1,     CHARSET_P0,  '>', 
/*  54  control     */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  110, 
/*  54  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  111, 
/*  54  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  111, 
 
/*  55  base        */   GRAPHIC,   NORM,       1,     CHARSET_P0,  '/', 
/*  55  shift       */   GRAPHIC,   NORM,       1,     CHARSET_P0,  '?', 
/*  55  control     */  CNTL_FUNC,  CPFK,    NORM,     CHARSET_P0,  112, 
/*  55  alt         */  CNTL_FUNC,  CPFK,    NORM,     CHARSET_P0,  113,
/*  55  alt         */  CNTL_FUNC,  CPFK,    NORM,     CHARSET_P0,  113,
 
/*  57  base        */  SINGLE_CTL,  NORM,       1,        0,       RSH,
/*  57  shift       */  SINGLE_CTL,  NORM,       0,        0,       RSH,
/*  57  control     */  SINGLE_CTL,  NORM,       0,        0,       RSH,
/*  57  alt         */  SINGLE_CTL,  NORM,       0,        0,       RSH,
/*  57  alt         */  SINGLE_CTL,  NORM,       0,        0,       RSH,
 
/* 100  base        */   GRAPHIC,   NORM,       1,    CHARSET_P0,  '*', 
/* 100  shift       */   GRAPHIC,   NORM,       1,    CHARSET_P0,  '*', 
/* 100  control     */   CNTL_FUNC, CPFK,       0,    CHARSET_P0,  187,
/* 100  alt         */   CNTL_FUNC, CPFK,       0,    CHARSET_P0,  188,
/* 100  alt         */   CNTL_FUNC, CPFK,       0,    CHARSET_P0,  188,
 
/*  60, 62 */
/*  60  base        */   SINGLE_CTL,  NORM,       1,     NONE,   ALT,
/*  60  shift       */   SINGLE_CTL,  NORM,       0,     NONE,   ALT,
/*  60  control     */   SINGLE_CTL,  NORM,       0,     NONE,   ALT,
/*  60  alt         */   SINGLE_CTL,  NORM,       0,     NONE,   ALT,
/*  60  alt graphic */   SINGLE_CTL,  NORM,       0,     NONE,   ALT,
 
/*  61  base        */   GRAPHIC,   NORM,       1,    CHARSET_P0,   ' ', 
/*  61  shift       */   GRAPHIC,   NORM,       0,    CHARSET_P0,   ' ', 
/*  61  contro      */   GRAPHIC,   NORM,       0,    CHARSET_P0,   ' ', 
/*  61  alt         */   GRAPHIC,   NORM,       0,    CHARSET_P0,   ' ', 
/*  61  alt graphi  */   GRAPHIC,   NORM,       0,    CHARSET_P0,   ' ', 
 
/*  30  base        */   SINGLE_CTL,  NORM,       1,    NONE,        CLK,
/*  30  shift       */   SINGLE_CTL,  NORM,       0,       0,        CLK,
/*  30  control     */   SINGLE_CTL,  NORM,       0,       0,        CLK,
/*  30  alt         */   SINGLE_CTL,  NORM,       0,       0,        CLK,
/*  30  alt         */   SINGLE_CTL,  NORM,       0,       0,        CLK,
 
/* 112  base        */   SINGLE_CTL, CPFK,       1,    CHARSET_P0,  F1,   
/* 112  shift       */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F13, 
/* 112  control     */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F25,
/* 112  alt         */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F37,  
/* 112  alt         */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F37,  
 
/* 113  base        */   SINGLE_CTL, CPFK,       1,    CHARSET_P0,  F2,
/* 113  shift       */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F14,
/* 113  control     */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F26,
/* 113  alt         */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F38,
/* 113  alt         */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F38,
 
/* 114  base        */   SINGLE_CTL, CPFK,       1,    CHARSET_P0,  F3,
/* 114  shift       */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F15,
/* 114  control     */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F27,
/* 114  alt         */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F39,
/* 114  alt         */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F39,
 
/* 115  base        */   SINGLE_CTL, CPFK,       1,    CHARSET_P0,  F4,
/* 115  shift       */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F16,
/* 115  control     */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F28,
/* 115  alt         */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F40,
/* 115  alt         */   SINGLE_CTL, CPFK,       0,    CHARSET_P0,  F40,
 
/* 116  base        */   SINGLE_CTL, CPFK,       1,     CHARSET_P0,  F5,
/* 116  shift       */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F17,
/* 116  control     */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F29,
/* 116  alt         */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F41,
/* 116  alt         */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F41,
 
/* 117  base        */   SINGLE_CTL, CPFK,       1,     CHARSET_P0,  F6,
/* 117  shift       */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F18,
/* 117  control     */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F30,
/* 117  alt         */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F42,
/* 117  alt         */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F42,
 
/* 118  base        */   SINGLE_CTL, CPFK,       1,     CHARSET_P0,  F7,
/* 125  shift       */   CNTL_FUNC,  CPFK,    NORM,     CHARSET_P0,  19, 
/* 118  control     */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F31,
/* 118  alt         */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F43,
/* 118  alt         */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F43,
 
/* 119  base        */   SINGLE_CTL, CPFK,       1,     CHARSET_P0,  F8,
/* 119  shift       */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F20,
/* 119  control     */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F32,
/* 119  alt         */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F44,
/* 119  alt         */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F44,
 
/* 120  base        */   SINGLE_CTL, CPFK,       1,     CHARSET_P0,  F9,
/* 120  shift       */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F21,
/* 120  control     */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F33,
/* 120  alt         */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F45,
/* 120  alt         */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F45,
 
/* 121  base        */   SINGLE_CTL, CPFK,       1,     CHARSET_P0,  F10,
/* 121  shift       */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F22,
/* 121  control     */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F34,
/* 121  alt         */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F46,
/* 121  alt         */   SINGLE_CTL, CPFK,       0,     CHARSET_P0,  F46,
 
/* 90  base        */   SINGLE_CTL, CPFK,       1,      CHARSET_P0,  NLK,
/* 90  shift       */   SINGLE_CTL, CPFK,       0,      CHARSET_P0,  NLK,
/* 90  control     */   SINGLE_CTL, CPFK,       0,      CHARSET_P0,  NLK,
/* 90  alt         */   CNTL_FUNC,  CPFK,       0,      CHARSET_P0,  170,
/* 90  alt         */   CNTL_FUNC,  CPFK,       0,      CHARSET_P0,  170,
 
/* 125  base        */  CNTL_FUNC,     CPFK,       1,     CHARSET_P0,  213, 
/* 125  shift       */  CNTL_FUNC,     CPFK,    NORM,     CHARSET_P0,  214, 
/* 125  control     */  CNTL_FUNC,     CPFK,    NORM,     CHARSET_P0,  215, 
/* 125  alt         */  CNTL_FUNC,     CPFK,    NORM,     CHARSET_P0,  216,
/* 125  alt         */  CNTL_FUNC,     CPFK,    NORM,     CHARSET_P0,  216,
 
/*  91  base        */   GRAPHIC,   NORM,          1,     CHARSET_P0,  0xda,  
/*  91  shift       */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_7,  
/*  91  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  172,  
/*  91  alt         */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_7,  
/*  91  alt-graph   */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_7,  
 
/*  96  base        */   GRAPHIC,   NORM,          1,     CHARSET_P0,  0xc2,  
/*  96  shift       */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_8,  
/*  96  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  182,  
/*  96  alt         */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_8,  
/*  96  alt-graph   */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_8,  
 
/* 101  base        */   GRAPHIC,   NORM,          1,     CHARSET_P0,  0xbf,  
/* 101  shift       */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_9,  
/* 101  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  190,
/* 101  alt         */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_9,  
/* 101  alt graphic */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_9, 
 
/* 105  base        */   GRAPHIC,      NORM,       1,     CHARSET_P0,  '-', 
/* 105  shift       */   GRAPHIC,      NORM,       0,     CHARSET_P0,  '-', 
/* 105  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  198,
/* 105  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  199,
/* 105  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  199,
 
/*  92  base        */   GRAPHIC,   NORM,          1,     CHARSET_P0,  0xc3,
/*  92  shift       */   SINGLE_CTL,   CPFK,       0,     CHARSET_P0,  NUM_4,
/*  92  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  174,
/*  92  alt         */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_4,  
/*  92  alt graphic */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_4,
 
/*  97  base        */   GRAPHIC,   NORM,          1,     CHARSET_P0,  0xc5,
/*  97  shift       */   SINGLE_CTL,   CPFK,       0,     CHARSET_P0,  NUM_5,
/*  97  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  184,
/*  97  alt         */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_5,  
/*  97  alt graphic */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_5,
 
/* 102  base        */   GRAPHIC,      NORM,       1,     CHARSET_P0,  0xb4,  
/* 102  shift       */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_6,  
/* 102  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  192,
/* 102  alt         */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_6,  
/* 102  alt graphic */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_6, 
 
/* 107  base        */   GRAPHIC,      NORM,       1,     CHARSET_P0,  '+', 
/* 107  shift       */   GRAPHIC,      NORM,       0,     CHARSET_P0,  '+', 
/* 107  control     */   CNTL_FUNC,    CPFK,       0,     NONE,        200, 
/* 107  alt         */   CNTL_FUNC,    CPFK,       0,     NONE,        201, 
/* 107  alt         */   CNTL_FUNC,    CPFK,       0,     NONE,        201, 
 
/*  93  base        */   GRAPHIC,      NORM,       1,     CHARSET_P0,  0xc0,  
/*  93  shift       */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_1,  
/*  93  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  176,
/*  93  alt         */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_1,  
/*  93  alt graphic */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_1, 
 
/*  98  base        */   GRAPHIC,      NORM,       1,     CHARSET_P0,  0xc1,  
/*  98  shift       */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_2,  
/*  98  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  186,
/*  98  alt         */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_2,  
/*  98  alt graphic */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_2,
 
/* 103  base        */   GRAPHIC,      NORM,       1,     CHARSET_P0,  0xd9,  
/* 103  shift       */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_3,  
/* 103  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  194,
/* 103  alt         */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_3,  
/* 103  alt graphic */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_3, 
 
/*  99  base        */   GRAPHIC,      NORM,       1,     CHARSET_P0,  0xb3,  
/*  99  shift       */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_0,  
/*  99  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  178,
/*  99  alt         */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_0,  
/*  99  alt graphic */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,  NUM_0, 
 
/* 104  base        */   GRAPHIC,      NORM,       1,    CHARSET_P0,     0xc4,  
/* 104  shift       */   SINGLE_CTL,   NORM,       0,    CHARSET_P0,  NUM_DOT,  
/* 104  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  196,
/* 104  alt         */   ESC_FUNC,     CPFK,       0,     CHARSET_P0,  197,  
/* 104  alt         */   ESC_FUNC,     CPFK,       0,     CHARSET_P0,  197,  
 
/* 84  base        */   SINGLE_CTL,    CPFK,       1,      CHARSET_P0,  NONE,
/* 84  shift       */   SINGLE_CTL,    CPFK,       0,      CHARSET_P0,  NONE,
/* 84  control     */   SINGLE_CTL,    CPFK,       0,      CHARSET_P0,  SYSREQ_SCANCODE,
/* 84  alt         */   SINGLE_CTL,    CPFK,       0, CHARSET_P0,  SYSREQ_SCANCODE,
/* 84  alt         */   SINGLE_CTL,    CPFK,       0, CHARSET_P0,  SYSREQ_SCANCODE,
 
/* 122  base        */   SINGLE_CTL,   CPFK,       1,     CHARSET_P0,  F11,
/* 122  shift       */   SINGLE_CTL,   CPFK,       0,     CHARSET_P0,  F23,
/* 122  control     */   SINGLE_CTL,   CPFK,       0,     CHARSET_P0,  F35,
/* 122  alt         */   SINGLE_CTL,   CPFK,       0,     CHARSET_P0,  F47,
/* 122  alt         */   SINGLE_CTL,   CPFK,       0,     CHARSET_P0,  F47,
 
/* 123  base        */   SINGLE_CTL,   CPFK,       1,     CHARSET_P0,  F12,
/* 123  shift       */   SINGLE_CTL,   CPFK,       0,     CHARSET_P0,  F24,
/* 123  control     */   SINGLE_CTL,   CPFK,       0,     CHARSET_P0,  F36,
/* 123  alt         */   SINGLE_CTL,   CPFK,       0,     CHARSET_P0,  F48, 
/* 123  alt         */   SINGLE_CTL,   CPFK,       0,     CHARSET_P0,  F48, 
			/* 0x57 */
/*  75  base        */   CNTL_FUNC,    CPFK,       1,     CHARSET_P0,  139,
/*  75  shift       */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  139,
/*  75  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  140,
/*  75  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  141, 
/*  75  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  141, 
			/* 0x58 */
/*  76  base        */   CNTL_FUNC,    NORM,       1,     0x51,      0x01,
/*  76  shift       */   CNTL_FUNC,    NORM,       0,     0x51,      0x01,
/*  76  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  142,
/*  76  alt         */   CNTL_FUNC,    NORM,       0,     0x53,      0x01, 
/*  76  alt         */   CNTL_FUNC,    NORM,       0,     0x53,      0x01, 
			/* 0x59 */
/*  79  base        */   CNTL_FUNC,    NORM,       1,     0x04,         0x01,
/*  79  shift       */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  158,
/*  79  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  159,
/*  79  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  160, 
/*  79  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  160, 
			/* 0x5a */
/*  80  base        */   CNTL_FUNC,    NORM,       1,     0x08,        0x01,
/*  80  shift       */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  143,
/*  80  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  144,
/*  80  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  145, 
/*  80  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  145, 
			/* 0x5b */
/*  81  base        */   CNTL_FUNC,    CPFK,       1,     CHARSET_P0,  146,
/*  81  shift       */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  147,
/*  81  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  148,
/*  81  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  149, 
/*  81  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  149, 
			/* 0x5c */
/*  83  base        */   CNTL_FUNC,    NORM,       1,     0x01,        0x01,
/*  83  shift       */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  161,
/*  83  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  162,
/*  83  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  163, 
/*  83  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  163, 
			/* 0x5d */
/*  84  base        */   CNTL_FUNC,    NORM,       1,     0x02,       0x01,
/*  84  shift       */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0, 164,
/*  84  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  165,
/*  84  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  166, 
/*  84  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  166, 
			/* 0x5e */
/*  85  base        */   CNTL_FUNC,    CPFK,       1,     CHARSET_P0,  150,
/*  85  shift       */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  151,
/*  85  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  152,
/*  85  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  153, 
/*  85  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  153, 
			/* 0x5f */
/*  86  base        */   CNTL_FUNC,    CPFK,       1,     CHARSET_P0,  154,
/*  86  shift       */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  155,
/*  86  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  156,
/*  86  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  157, 
/*  86  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  157, 
			/* 0x60 */
/*  89  base        */   CNTL_FUNC,    NORM,       1,     0x03,        0x01,
/*  89  shift       */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  167,
/*  89  control     */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  168,
/*  89  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  169, 
/*  89  alt         */   CNTL_FUNC,    CPFK,       0,     CHARSET_P0,  169, 
			/* 0x61 */
/*  95  base        */   GRAPHIC,      NORM,       1,     CHARSET_P0,  '/', 
/*  95  shift       */   GRAPHIC,      NORM,    NORM,     CHARSET_P0,  '/', 
/*  95  control     */  CNTL_FUNC,     CPFK,    NORM,     CHARSET_P0,  179, 
/*  95  alt         */  CNTL_FUNC,     CPFK,    NORM,     CHARSET_P0,  180,
/*  95  alt         */  CNTL_FUNC,     CPFK,    NORM,     CHARSET_P0,  180,
			/* 0x62 */
/* 124  base        */  CNTL_FUNC,     CPFK,       1,     CHARSET_P0,  209, 
/* 124  shift       */  CNTL_FUNC,     CPFK,    NORM,     CHARSET_P0,  210, 
/* 124  control     */  CNTL_FUNC,     CPFK,    NORM,     CHARSET_P0,  211, 
/* 124  alt         */  CNTL_FUNC,     CPFK,    NORM,     CHARSET_P0,  212,
/* 124  alt         */  CNTL_FUNC,     CPFK,    NORM,     CHARSET_P0,  212,
			/* 0x63 */
/* 126  base        */  CNTL_FUNC,     CPFK,       1,     CHARSET_P0,  217, 
/* 126  shift       */  CNTL_FUNC,     CPFK,    NORM,     CHARSET_P0,  218, 
/* 126  control     */  SINGLE_CTL,    CURS,    NONE,    CHARSET_P0,  DEL, 
/* 126      alt     */  SINGLE_CTL,    CURS,    NONE,    CHARSET_P0,  DEL, 
/* 126      alt     */  SINGLE_CTL,    CURS,    NONE,    CHARSET_P0,  DEL, 
			/* 0x64 */
/*  64  base        */  CNTL_FUNC,     CPFK,       1,     CHARSET_P0,  114, 
/*  64  shift       */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,   CTL,
/*  64  control     */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,   CTL,
/*  64  alt         */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,   CTL,
/*  64  alt         */   SINGLE_CTL,   NORM,       0,     CHARSET_P0,   CTL,
			/* 0x65 Special 102 key */
/*  45  base        */   GRAPHIC,      NORM,       1,     CHARSET_P0,  '>', 
/*  45  shift       */   GRAPHIC,      NORM,       1,     CHARSET_P0,  '<', 
/*  45  control     */  CNTL_FUNC,     CPFK,    NORM,     CHARSET_P0,  179, 
/*  45  alt         */  CNTL_FUNC,     CPFK,    NORM,     CHARSET_P0,  180,
/*  45  alt         */  CNTL_FUNC,     CPFK,    NORM,     CHARSET_P0,  180,
			/* 0x66 */
/*  43  base        */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  '\r',
/*  43  shift       */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  '\r', 
/*  43  control     */  SINGLE_CTL, NORM,       0,     CHARSET_P0,  '\r', 
/*  43  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  100,
/*  43  alt         */  CNTL_FUNC,  CPFK,       0,     CHARSET_P0,  100,
};

#endif		/* H_HFTLANG */
kêº‡ v  $        L  <‰*h˜ˆ*<‰*     :»L  	              ô»  ./usr/include/sys/hft/physdisp.h  h     #ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)physdisp.h	1.3    IBM AIX)    /* Modified: 20:02:37 7/15/92 */
/* H_SCCSIDgen1(@(#)physdisp.h	1.6	AIX);	Modified 12/9/88 13:21:38 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef              MAX_MON_ADDRS
#define              MAX_MON_ADDRS 10
#endif

#ifndef              MAX_MON_IO_PORTS
#define              MAX_MON_IO_PORTS 50
#endif

#ifdef _MBCS
#define NUM_DISPLAYS (58)
#else
#define NUM_DISPLAYS (49)
#endif /* _MBCS */

/*  Added 15 new device ID's  */
/*  Corresponding changes in physdisp.c must be made here  */
/* 
 * Physical device ID returned by HFQUERY ioctl.
 */
#define VGA7544        0x0413          /* they're the same, that's the way */
#define BRECON7544     0x0413          /* it was */  
#define VGA7554        0x0415          /* same here */
#define BRECON7554     0x0415
#define VGA8503        0x0411
#define BRECON8503     0x0418
#define VGA8515        0x0410
#define VGA8512        0x0412
#define VGA8513        0x0413
#define VGA8514        0x0414
#define BRECON8503     0x0418
#define BRECON8512     0x0419
#define BRECON8513     0x041a
#define BRECON8514     0x041b
#define BRECON8507     0x041c
#define BRECON8604     0x041d
#define VGA8604        0x0416
#define VGA8507        0x0415
#define PLASMA         0x0421
#define BRECON8515     0x0417
#define IBM5574_M06    0x0415
#define IBM5574_W06    0x0415
#define IBM5574_C06    0x0412
#define IBM5574_C07    0x0414
#define IBM5574_C09    0x0414
#define XGA8507	       0x0422
#define XGA8514        0x0423
#define XGA8515        0x0424
#define XGA8604        0x0425
#define VGA8518        0x0428
#define BRECON8518     0x0429
#define VGA8504        0x0430
#define BRECON8504     0x0443
#define VGA8517        0x0444
#define BRECON8517     0x0445
#define XGA8517        0x0446
#define VGA8516        0x0447
#define BRECON8516     0x0436
#define XGA8516        0x0437
#define XGA8503        0x0438
#define XGA8504        0x0439
#define XGA8512        0x0440
#define XGA8513        0x0441
#define XGA8518        0x0442

#define VGA8511        0x0428
#define BRECON8511     0x0429
#define XGA8511        0x0442
#define XGATWO8517     0x0450

 /**********************************************************************/
 /*                                                                    */
 /* Device Characteristics                                             */
 /*                                                                    */
 /**********************************************************************/
 
struct dev_char_struc
{
	u_int	rdev_id; 	/* device id used to identify this device */
	u_char	devname[20]; 	/* name of the device, null terminated    */
	u_short	vdd_iocn;	/* IOCN of the dev module (garbage??)     */
	int	monitor;	/* the unique id of the monitor           */
	u_short	font_class;	/* the class of font used with this device*/
				/* i.e. bit patterns or command strings   */
				/* some devices are driven by draw cmds   */
				/* #######################################*/
				/* the following 2 entries determine the  */
				/* # of rows/cols for a device that uses  */
				/* fixed hardware character generators    */
				/* (Like the VGA in mode 3)  they specify */
				/* the number of rows/cols in this fixed  */
				/* mode of operation                      */
	int	font_width;	/* width in characters  (i.e.80)          */
	int	font_height;	/* height in character lines (i.e.25)     */
				/* #######################################*/

	u_short	avt_format;	/* the format of External Raster Arrays   */
	int	bits_per_pel;	/* total number of bits in each pel value */
				/* i.e. 1, 2 , 4                          */
	u_char	monitor_type;	/* set if we have a color monitor         */
	u_char	vlt_modify;	/* set if the adapter VLT is modifiable   */
				/* i.e. change color pallete is available */
	u_char	adapter_status;	/* set if the adapter is working properly */
	u_char	alpha;		/* set if a hardware character gen is     */
				/* available for this device              */
	u_char 	apa;		/* set if it can use the software fonts   */
	u_char	blink;		/* set = blink supported                  */
	u_short	width_pel;	/* width of the screen in pels            */
	u_short	height_pel;	/* height of the screen in pels           */
	u_short	width_mm;	/* width of the screen in millimeters     */
	u_short	height_mm;	/* height of the screen in millimeters    */
	u_int	color_total;	/* # of colors that can be displayed      */
	u_short	color_active;	/* # of colors displayed simultaneously   */
	u_short	color_fg;	/* # of fg colors displayed simultaneously*/
	u_short	color_bg;	/* # of bg colors displayed simultaneously*/

	struct dev_color_table
	{ u_int value[16];	/* colors displayed by the adapter        */
	} color_table;
				/* ###################################### */
	short	num_io_ports;   /* # of i/o ports to that this adapter    */
				/* and display configuration will need    */
				/* Up to 20 non-contigous port ranges     */
				/* are supported                          */
				/* ###################################### */
				/* Following entries describe the RANGE   */
				/* of I/O ports used by this device       */
				/* These values are used by monitor mode  */
				/* application enable routines to give the*/
				/* user access to the hardware I/O ports  */
	struct	range_io_ports 	/* structure that defines i/o port ranges */
	{ u_int low_io_port;    /* the lowest i/o port used by this device*/
	  u_int	high_io_port;	/* the highest i/o port used by this dev  */
        }io_ports[MAX_MON_IO_PORTS];
				/* ###################################### */
	short	num_mem_segments;/* # of memory segments to follow,       */
				/* physical memory used by the adapter    */
				/* up to 10 non-contigous segments        */
				/* of memory are supported, null memory   */
	struct phys_mem_segments/* address or length terminates the list) */
	{ u_long base_memory;	/* the physical address of the adapter    */
	  int	base_length;	/* # bytes in the adapter refresh buffer  */
	}phys_mem[MAX_MON_ADDRS];/* array of memory segments              */
};
    kê^î Ž  $        }  c‰*2˜ˆ*c‰*     ´e}  	                  ./usr/include/sys/i386/aixinfo.h  h     #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)aixinfo.h	16.8	AIX)	/* Modified: 15:46:28 9/16/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/*
 *
 *	Format of the AIX control block in NVRAM.
 *	
 *	this block contains machine identification/description information
 *	that is needed during system initialization or should remain 
 *	constant across system installations.
 */
/*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/
#ifndef	_h_AIXINFO
#define _h_AIXINFO
#include <sys/in.h>

struct aixinfo {
	/* Machine configuration information */
	char	langtype;	/* keyboard language code	*/
	char	montype;	/* monitor type code		*/

	/* timezone name(s) and description			*/
	char	timezone;	/* hours from GMT <0 -> east	*/
	char	daylight;	/* 0 -> dst not observed	*/
				/* + -> in effect, - -> not now	*/
	char	tzname[4];	/* normal time zone name	*/
	char	dstname[4];	/* time zone name durring DST	*/

	/* site identification information			*/
	short	sitenum;	/* TCF site number		*/
	char	sitename[16];	/* site/local name		*/

	short	pad0;		/* pad to word boundry		*/

	/* additional information				*/
	struct in_addr netaddr;	/* our network address		*/
	short	nlslang;	/* nls language code		*/

	/* Reboot parameters/information (may go away) 		*/
	char	bootctlr;	/* controller to boot from	*/
	char	bootunit;	/* sub-unit to boot from	*/
	short	bootflags;	/* additional boot parameters	*/
	char	bootname[16];	/* altername boot kernel	*/
	char	pad[6];		/* room for growth, pad to 64	*/
};

#define AI_BOOTOTHER	0x01
#endif	/* _h_AIXINFO */
 ofkê(ç e  $        a  k‰*ä™ˆ*k‰*     #¾a  
              åV  ./usr/include/sys/i386/aixos.h h#ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)aixos.h	1.16	AIX)	/* Modified: 14:02:12 10/28/91 */

/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * aixos.h
 *
 * This is the OS.H file for AIX/386.  See ../common/os.h for a description
 * of all of the items that are defined in this file.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	-------	-----	----------------------------------------------
 * 0.00		8/23/88	GGS	Original Code Entry
 *
 */
#include <sys/types.h>
#include <sys/param.h>
#include <sys/vmalloc.h>
#include <sys/i386/page.h>
#include <sys/buf.h>
#include <sys/uio.h>
#include <stdio.h>
#include <cfgcom.h>

#define	USE_MINI_DISKS

#ifdef	USE_MINI_DISKS
#include <sys/minidisk.h>
#include <sys/mdisk.h>
#endif

/*
 * Tunable Driver Parameters
 */
#define	MAX_CHAIN_LEN	10		/* Seems like a good number	*/
#define	MAX_DEV_RETRIES	5
#define	ASGN_RETRIES	5
#define	MAX_RESETS	5

#define	MAX_REGIONS	10		/* 1 region / structure + 1	*/
#define	MAX_ALLOC	0x7fffffff

#define	GLOBAL_SCSI_TIMEOUT	(1 * 60)/* set SCSI timeout to 1 minute	*/

#define	MAX_SCSI_TIMERS	32		/* MAX # of SCSI timers		*/

/*
 * Defines the maximum number of devices that we can have per card.
 * This is limited by the SCSI architecture of 7 PUNs * 8 LUNs/PUN.
 */
#define	MAX_DEVS	56

/*
 * The following defines the number of devices that we think will be
 * active at once.  This will probably be only a fraction of the total
 * possible SCSI devices.  What we're going to do here is to allow some
 * number more than the 7 PUNs.
 */
#define	ACTIVE_DEVS	(7 + 5)

/*
 * The following are probably a whole lot bigger than they need to be but
 * we'll get better guesses as time goes by.
 */
#define	NUM_SCBS	ACTIVE_DEVS * (MAX_CHAIN_LEN/2)
#define	NUM_REQS	4 * NUM_SCBS
#define	NUM_TBUFS	ACTIVE_DEVS + 4
#define	NUM_WAITS	3 * MAX_DEVS
#define	NUM_SCSI_CMDS	MAX_DEVS

#define	DEFAULT_TIMEOUT	60		/* default timeout is 60 seconds */

/*
 * The following are for the target mode buffer queues.
 */
#define	BUFFER_SIZE	4096
#define	NUM_BUFF_REGIONS	10

/*
 * The following are defines that define how the device driver will use AIX
 * services and interface to them.
 */

#define	OS_REQ		struct	buf	/* OS request block definition	*/
#define	mask_ints	splblkio	/* dis-ables interrupts		*/
#define	no_ints		splhigh		/* dis-ables ALL interrupts	*/
#define	enable_ints	splx		/* enables interrupts		*/
#define	mask_net_ints	splimp		/* dis-ables network interrupts	*/

#define	signal_io_complete(x)	(*scsi_iodone)(x)

#define	scsi_error		ncprintf

#define	block(x)		sleep(x, PRIBIO)
#define	mark_runnable(x)	wakeup(x)

#define	i386_io_fix()		kludge_flush()

extern	int	clkspd;
#define	loops_per_us()		clkspd

extern	time_t	hz;

extern	paddr_t	kvtophys();
#define	virt(x)	PTOKV(x)
#define	phys(x) kvtophys(x)

extern	caddr_t		kmemalloc();
extern			mfree();

#define	dasd_read(drv,buf,rba,nbytes)	hddoread(drv,rba,buf,nbytes)
#define	dasd_write(drv,buf,rba,nbytes)	hddowrite(drv,rba,buf,nbytes)

#define	alloc(size)	kmemalloc(size, MA_PAGE | MA_LONGTERM | MA_OK2SLEEP)
#define	free(ptr,size)	mfree(ptr)

#define	small_alloc(s)	kmemalloc(s, MA_DBLWD | MA_LONGTERM)

#define	alloc_part()	kmemalloc(sizeof(struct hdpart)*MAX_PARTS,       \
				  MA_DBLWD | MA_LONGTERM | MA_OK2SLEEP)

#define	NEEDS_WORK(x)	printf("%s Needs Work, Function Not Complete\n",x)

#define	INIT_ALL_DEVS

typedef	unsigned char	uchar;
typedef	unsigned short	ushort;
typedef	unsigned int	uint;
typedef unsigned long	ulong;

/*
 * AIX doesn't have these so just cause 'em to generate nothing.
 */
#define	FAR				/* AIX has flat addressing	*/
#define	yield()				/* AIX doesn't yield		*/
#define	TCyield()			/* AIX doesn't yield		*/
#define	YIELD_COUNT	0
#define	TC_YIELD_COUNT	0
#define	pic_eoi()			/* Not done by device driver	*/


/*
 * The following defines are for mapping the device number to the various
 * things that the driver needs.
 */
#define	SCSI_CONFIG_SIZE	512
#define	SCSI_CONF_SEC		1L	/* puts it on sector 2		*/
#ifdef DOUBLEDEFINED
#define	MAX_SCSI_DEVICES	( ( SCSI_CONFIG_SIZE - sizeof(SCSI_CONFIG_HDR) )/ (sizeof(SCSI_CONF_REC) ) )
#endif

#define	get_cardno(d,class)	((class)->map_table[(*((class)->get_devno))(d)].dev.cardno)
#define	get_scsi_id(d,class)	((class)->map_table[(*((class)->get_devno))(d)].dev.scsi_id)
#define get_lun(d,class)	((class)->map_table[(*((class)->get_devno))(d)].dev.lun)


#define	os_card(bp,class)	get_cardno(bp->b_dev,class)
#define	os_scsi_id(bp,class)	get_scsi_id(bp->b_dev,class)
#define	os_lu(bp,class)		get_lun(bp->b_dev,class)
#define	os_part(bp)		get_part(bp->b_dev)

#define	get_block_no(bp)	bp->b_blkno
#define	get_num_bytes(bp)	bp->b_bcount
#define	get_buffer(bp)		bp->b_physaddr
#define	get_num_blocks(bp)	((bp->b_bcount + SECSIZE - 1) / SECSIZE)
#define	get_command(bp)		((bp->b_flags & B_READ) ? REQ_READ : REQ_WRITE)

/*
 * The following is somewhat hardware dependent but should be OK for most
 */
#define	MAX_SCSI_IOVEC	16		/* # of IOVEC entries for scatter/gather */
#define	get_sgbase(sgbuf, sginx)	(paddr_t)((struct uio *)(sgbuf))->uio_iov[(sginx)].iov_base
#define get_sglen(sgbuf, sginx)		((struct uio *)(sgbuf))->uio_iov[(sginx)].iov_len
#define get_sgnents(sgbuf)		((struct uio *)sgbuf)->uio_iovcnt
#define	get_sglist(bp)			(bp->b_un.b_addr)
#define	has_sglist(bp)			(bp->b_flags & B_YYY)

#ifdef MBSTRAT
#define	get_next_request(bp)	bp->av_forw
#else
#define get_next_request(bp)	NULL
#endif

#include <sys/i386/scsi_dasd.h>			/* DASD is pervasive in these includes*/

ction okêœ   $        h  c‰*2˜ˆ*c‰*     ¾h  	                  ./usr/include/sys/i386/ansicrt.h  h     /*
 *	IBM Personal System/2
 *
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1984, 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Microsoft Corporation
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef _h_ACRT
#define _h_ACRT

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)ansicrt.h	16.3	LCC)	/* Modified: 21:30:57 9/15/89 */

#define NPARMS	3	/* maximum legal number of parameters for a command */
#define NFKEYS  48	/* max number of function key definitions */

/* definitions of Set Graphics Rendition sub-codes */
#define PRIMARY	0		/* primary font and rendition	*/
#define BOLD	1		/* embolden all characters	*/
#define USCORE	4		/* underscore all characters	*/
#define BLINK	5		/* blink all characters		*/
#define REVERSE	7		/* display dark on light	*/
#define NDISP	8		/* invisible display		*/
#define FONT0	10		/* 96 character ASCII		*/
#define FONT1	11		/* 128 character ASCII		*/
#define FONT2	12		/* alternate graphics set	*/
#define NOREVERSE 21		/* display light on dark (ext)	*/

#endif	/* _h_ACRT */
kêb¿ Œ  $        ¸  c‰*3˜ˆ*c‰*     [ˆ¸  	              ƒy  ./usr/include/sys/i386/boot386.h  h     #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)boot386.h	1.2    IBM AIX)    /* Modified: 19:59:31 7/15/92 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/
#ifndef	_h_BOOT386
#define _h_BOOT386
#include <sys/i386/aixinfo.h>
#include <sys/i386/pos.h>
#ifndef KBXMAG
#include <sys/i386/nvrcfg.h>
#endif

#define DEVDATA_SIG 0x5350
#define SLOT_DATA_FILE "isadevcfg.info" /* filename for ISA adapter data */

/*
 * This is the map that is returned by BIOS to tell us how memory is layed out.
 * It is only valid when the appropriate bit in the boot parameter area is set.
 *
 * When lengths are specified they represent 1K blocks (so 2**20 bytes would be
 * represented in one of the following fields as 2**10 or 1024).
 *
 * The following are some definitions:
 *
 *  local		memory that is *not* on the microchannel
 *			(ie on the planar) it usually implies faster
 *			access times than non-local memory.
 *  system		memory that is available for use by the 
 *			planar processor (local memory is considered
 *			to be system memory).
 *  cacheable		memory that can be cached by the planar
 *			processor.
 *  non-system		memory that cannot be used for general storage
 *			of information (ie adapter buffers that appear
 *			in the planar processor address space).
 */
struct	BIOS_MemMap
             {
	     /*
	      * BIOS really does return this value.  But since it would cause this
	      * structure not to be aligned between 16 & 32 bit versions, the low
	      * level routine that returns this structure will not return it and
	      * therefore, we won't define it here in this structure.
	      */
#ifdef	NEVER
	     ushort	MapLen;		/* # of significant bytes of data	*/
#endif
	     ulong	MapLenLocal1M;	/* Length of Local memory above 1M	*/
	     ulong	MapLenLocal16M;	/* Length of Local memory above 16M	*/
	     ulong	MapLenSys1M;	/* Length of System memory above 1M	*/
	     ulong	MapLenSys16M;	/* Length of System memory above 16M	*/
	     ulong	MapLenCache1M;	/* Length of Cacheable memory above 1M	*/
	     ulong	MapLenCache16M;	/* Length of Cacheable memory above 16M	*/
	     ulong	MapPosNonSys1M;	/* # K's to start of Non-System memory above 1M */
	     ulong	MapPosNonSys16M;/* # K's to start of Non-System memory above 16M */
	     ushort	MapSegFreeCD;	/* segment # of free area in 0xC0000 - 0xDFFFF */
	     ushort	MapLenFreeCD;	/* # K's free in area from 0xC0000 - 0xDFFFF */
	     ulong	MapReserved[7];	/* Reserved Areas			*/
	     };


/*
 * The structure defines the parameters which the boot program passes
 * to the kernel.  NOTE: Do NOT use "int"s in this structure.  Also
 * make sure it stays PROPERLY ALIGNED, so that it comes out the same
 * size when compiled with a 286 compiler and a 386 compiler.  This is
 * critical since the boots are 286 load modules.
 */
struct bootparams {
	ushort	bt_bootflag;	/* bootflags */
	ushort 	bt_realmemk;	/* real Mem in K */
	ushort	bt_extmemk;	/* extended Mem in K */
	ushort	bt_pad1avail;	/* available, needed for alignment */
	ulong	bt_realstart;	/* 1st real mem addr where kernel was loaded */
	ulong	bt_realend;	/* last real mem addr where kernel was loaded */
	ulong	bt_extstart;	/* 1st ext mem addr where kernel was loaded */
	ulong	bt_extend;	/* last ext mem addr where kernel was loaded */
	ushort	bt_machtype;	/* machine type (Int 15 function C0) */
	ushort	bt_vidstate;	/* video state (Int 10, function 1B) */

/* Disk parameters as reported by the BIOS */
	ushort  bt_drv0ncpd;	/* Disk drive 0 number of cylinders per drive */
	ushort  bt_drv0ntpc;	/* Disk drive 0 number of tracks per cylinder */
	ushort  bt_drv0nspt;	/* Disk drive 0 number of sectors per track */
	ushort  bt_drv1ncpd;	/* Disk drive 1 number of cylinders per drive */
	ushort  bt_drv1ntpc;	/* Disk drive 1 number of tracks per cylinder */
	ushort  bt_drv1nspt;	/* Disk drive 1 number of sectors per track */

	struct aixinfo bt_ai;	/* NVRAM aixinfo structure (64 bytes) */

	/* POS information */
	ushort devsig;		/* flag that devdata is correct */
	ushort cpulevel;	/* CPU revision level */
	ushort numslots;	/* number of I/O slots on planar */
	struct devdata planardata; /* planar POS data */
	struct devdata devdata[MAX_IO_SLOTS];	/* io cards */

	/* NL information */
	ushort kbxmagic;
	struct kbxlang kbxlang;
	struct kbxmon kbxmon;
	struct kbxnls kbxnls;
	struct kbxtz kbxtz;
	ulong	bt_devaddr;	/* 1st address for use by devices	*/
	struct	BIOS_MemMap	bt_MemMap;	/* BIOS Memory Map		*/
	struct devdata planarvideo; /* planar video subsystem POS data */
};

struct isa_bootparams {
	ushort	btisa_devsig;
	ushort  btisa_pad;
	ulong	btisa_devdata[MAX_IO_SLOTS][ISA_DEVSZ];
};

/* Definitions for bt_bootflags */
#define BTF_AUTOBOOT	0x0001	/* Autoboot into initdefault level */

#ifndef NOGENERIC_SYSTEM
#define BTF_GENERIC	0x0002	/* Set generic_system flag */
#endif

#define BTF_STANDALONE	0x0004	/* Set standalone system flag */
#define BTF_USEFLOPPY	0x0008	/* if STANDALONE use floppy for root? */

/* Definitions for bt_machtype field */
#define MACHTYPE_GEARBOX 0x05f8
#define MACHTYPE_MOD95	 0x16f8

#define	BTF_MEMMAP	0x0100	/* indicates that memory map is filled in */

/*
 * Here's the GDT used for the BIOS "Enter Protected Mode" function
 * and for transferring control to the kernel.
 */
#define NPGDTELTS	 13
#define PGDTLIM ((NPGDTELTS * sizeof(struct descr)) - 1)


#define BG_GDTSEL	0x8		/* GDT alias selector */
#define BG_IDTSEL	0x10		/* IDT selector for BIOS call */
#define BG_DSSEL	0x18		/* DS for BIOS call */
#define BG_ESSEL	0x20		/* ES for BIOS call */
#define BG_SSSEL	0x28		/* SS for BIOS call */
#define BG_CSSEL	0x30		/* CS for BIOS call */
#define BG_BIOSCS	0x38		/* BIOS work selector for BIOS call */
#define BG_KERNCS	0x40		/* Kernel's CS */
#define BG_KERNDS	0x48		/* Kernel's DS */
#define BG_BOOTPARAMS	0x50		/* Selector mapping bootparams struct */
#define BG_KWORKSEL	0x58		/* Selector mapping bootparams struct */
#define BG_ISA_BOOTPARAMS	0x60	/* Selector mapping isa_bootparams struct */


#ifdef BOOTDATA
struct descr protgdt[NPGDTELTS] = 
{
/*------------------------------------------*/		
/* limit1 base1  base2   type limit2  base3 */
/*   2      2       1     1      1      1   */
/*------------------------------------------*/		
{    0,     0,      0,    0,     0,     0},  /* 0 Empty slot  */
{ PGDTLIM,  0, 	    0, DT_KRWDATA, 0,     0},  /* 8 GDT alias */
{ 0,        0,      0, DT_KRWDATA, 0,     0},  /* 10 IDT alias */
{ 0xffff,   0,      0, DT_KRWDATA, 0,     0},  /* 18 DS */
{ 0xffff,   0,      0, DT_KRWDATA, 0,     0},  /* 20 ES */
{ 0xffff,   0,      0, DT_KRWDATA, 0,     0},  /* 28 SS */
{ 0xffff,   0,      0, DT_KTEXT, 0,     0},  /* 30 CS */
{ 0,        0,      0,    0,     0,     0},  /* 38 Bios work selec (code seg) */
{ 0,        0,      0,    0,     0,     0},  /* 40 Kernel code selector */
{ 0,        0,      0,    0,     0,     0},  /* 48 Kernel data selector */
{ 0xffff,   0,      0, DT_KRWDATA, 0,     0},  /* 50 Boot to Kernel parameters */
{ 0xffff,   0,      0, DT_KRWDATA, 0,     0},  /* 58 Kernel work selector */
{ 0xffff,   0,      0, DT_KRWDATA, 0,     0}   /* 60 ISA Boot to Kernel */
};

#endif /* BOOTDATA */
#endif /* _h_BOOT386 */
kê¶¯ â  $        è  n‰*ø™ˆ*n‰*     LWè  	                  ./usr/include/sys/i386/cardclass.h      #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)cardclass.h	1.2	AIX)	/* Modified: 14:22:21 2/9/90 */



/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * cardconf.h
 *
 * This module contains the definitions for the structure that defines a
 * card's configuration entry.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	------	-----	---------------------------------------------
 * 0.00		8/19/89	GGS	Original code entry
 *
 */

/*
 * This structure will define what a configuration entry looks like for
 * the CARD class.  Since the configuration structures have to reside in
 * a very restricted place on disk, we will try to make them as small as
 * possible.
 */
struct	card_config
	     {
	     ushort	allocated :  1;	/* 1=record is in use		*/
	     ushort	scsi_id	  :  3;	/* SCSI ID of the card		*/
	     ushort	slot	  :  4;	/* slot # card is in		*/
	     ushort	irq_level :  4;	/* interrupt level of the card	*/
	     ushort	arb_level :  4;	/* arbitration level of card	*/
	     ushort	brk_panic :  1;	/* panics when card breaks	*/
	     ushort	rsr_panic :  1;	/* panics when resource unavail	*/
	     ushort	ini_panic :  1;	/* panics on initialization err	*/
	     ushort	cfg_panic :  1;	/* panics on configuration err	*/
	     ushort	reserved  : 12;	/* reserved bits		*/
	     ushort	pos_id;		/* POS ID of the card		*/
	     ushort	io_addr;	/* I/O address of the card	*/
	     ulong	mem_addr;	/* Memory mapped for card	*/
	     };

typedef	struct	card_config	CARD_CONFIG;

#define	CARD_CONFIG_LEN		sizeof( CARD_CONFIG )

#define	CARD_CONFIG_VER		1

/*
 * Maximum number of cards in a system.  Eventhough there are no systems
 * with more than 8 slots, there are some "strech" systems being considered.
 * This allows us to deal with that with no problem.
 */
#define	MAX_CARDS		16
kêØ d  $        ½  k‰*ä™ˆ*k‰*     „½  
                  ./usr/include/sys/i386/cdrom.h s#ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)cdrom.h	1.5	AIX)	/* Modified: 14:13:35 2/9/90 */



/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * cdrom.h
 *
 * This file contains the defines that are specific to the CD-ROM device driver.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	-------	-----	----------------------------------------------
 * 0.00		1/9/89	GGS	Original Code Entry
 *
 */

#define	MAX_CDROM		16	/* max number of CD-ROM's in system */
#define	MAX_CDROM_CONFIG	32

#define	CDROMIOC	('c' << 8)
#define	CDPLAY_START	(CDROMIOC | 1)	/* start playing an audio CD	*/
#define	CDPLAY_DEF_END	(CDROMIOC | 2)	/* indicate when to stop playing*/
#define	CDPLAY_PAUSE	(CDROMIOC | 3)	/* pause playing		*/
#define	CDPLAY_OPEN	(CDROMIOC | 4)	/* open CD tray			*/
#define	CDPLAY_CLOSE	(CDROMIOC | 5)	/* close CD tray		*/
#define	CDPLAY_STATUS	(CDROMIOC | 6)	/* get playing status		*/
#define	CDPLAY_TRACKS	(CDROMIOC | 7)	/* get min/max tracks		*/
#define	CDPLAY_LENGTH	(CDROMIOC | 8)	/* get length (in time) of CD	*/
#define	CDPLAY_TRKTIME	(CDROMIOC | 9)	/* get starting time of a track	*/

/*
 * The following is the structure used to specify the format of an address on
 * the CD.
 */
struct	cdiocaddr
	     {
	     int		addr_fmt;
	     union	
		  {
		  int		lba;
		  struct
		       {
		       char	min;
		       char	sec;
		       char	frame;
		       }	time;
		  int		track;
		  }		addr;
	     };

#define	CDIOC_LBA_ADDR		0
#define	CDIOC_TIME_ADDR		1
#define	CDIOC_TRACK_ADDR	2
ARDkêÎ ä  $        =  n‰*)šˆ*n‰*     º¥=  	                  ./usr/include/sys/i386/cdrom_atla.h     #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)cdrom_atla.h	1.6	AIX)	/* Modified: 12:50:52 8/4/90 */

/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */


/*
 * cdrom_atla.h
 *
 * This file contains the defines for the structures and other values needed
 * to run the device specific code for the ATLANTIS CD-ROM.
 *
 * Author:
 *   Sanjay Jindal
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-4638
 *
 * Maintanence Log:
 *
 * Revision	Date	 Who	Description
 * --------	------	 -----	---------------------------------------------
 * 0.00		3/16/92  sanjay	Original code entry
 *
 */

/*
 * Atlantis Table Of Contents (TOC) structure
 */
struct	atla_TOC {
	uchar		TOC_len_msb;	/* TOC Data Length MSB */
	uchar		TOC_len_lsb;	/* TOC Data Length LSB */
	uchar		first_track;
	uchar		last_track;
	struct {
		uchar	resrvd1;	/* Reserved */
		uchar	adr_control;	/* ADR (msb 4 bits) and Control */
		uchar	track;		/* Track Number */
		uchar	resrvd2;	/* Reserved */
		union {
		      struct {
				uchar 	resrvd;	/* Reserved */
				uchar	min;	/* Minute */
				uchar	sec;	/* Second */
				uchar	frame; 	/* 1/75th Second */
		     } time;
	       	     struct {
				uchar lba[4];	/* Logical Block Address */
		     } lba;
		} track_addr;
	} track_desc;
};

typedef	struct atla_TOC ATLA_TOC;

/*
 * LoEj flag for start/stop SCSI command
 */
#define	EJECT_ON 0x02
#define	EJECT_OFF 0x00

/*
 * SUBQ bit set to one requests the drive return the Q sub-channel data.
 * No data is returned if this bit is set zero.
 */
#define	SUBQ_ON		0x40
#define	SUBQ_OFF	0x00

/*
 * Sub Channel Data Format codes
 */
#define SC_DATA 	0x00	/* Sub-Q Channel Data */
#define CDROM_POSI	0x01	/* CD-ROM Current Position */
#define	CATALOG_NO	0x02	/* Media Catalog Number (UPC/Bar Code) */
#define	TRACK_ISRC	0x03	/* Track International Standard Recording Code*/

/*
 * CD-ROM Current Position Data Format
 * Read Sub-Channel command returns this status block.
 */
struct	atla_play_status {
	uchar	resrvd;		/* Reserved */
	uchar	audio_stat;	/* Audio Status */
	uchar	sc_len_msb;	/* Sub-Channel Data Length (MSB) */
	uchar	sc_len_lsb;	/* Sub-Channel Data Length (LSB) */
	struct {
		uchar	sc_code;	/* Sub-Channel Data Format Code (0x01)*/
		uchar	adr_control;	/* ADR and Control field */
		uchar	track;		/* Track Number */
		uchar	index;		/* Index Number */
		union {
		      struct {
			uchar 	resrvd_a;/* Reserved */
			uchar	min_a;	/* Minute Absolute */
			uchar	sec_a;	/* Second Absolute */
			uchar	frame_a;/* 1/75th Second Absolute */
			uchar 	resrvd_r;/* Reserved */
			uchar	min_r;	/* Minute Relative */
			uchar	sec_r;	/* Second Relative */
			uchar	frame_r;/* 1/75th Second Relative */
		     } time;
	       	     struct {
			uchar lba_a[4];	/* Logical Block Address Absolute*/
			uchar lba_r[4];	/* Logical Block Address Relative */
		     } lba;
		} track_addr;
	} sc_data;
};

typedef struct atla_play_status	ATLA_PLSB;

/*
 * Audio Status Codes 
 */

#define	PLAYING		0x11
#define	PLAY_PAUSE	0x12
#define	PLAY_COMPLETE	0x13
#define	PLAY_ERROR	0x14
#define	NOSTATUS	0x15

0xfkêˆš å  $          n‰*ù™ˆ*n‰*     T•  	              ”  ./usr/include/sys/i386/cdrom_toshiba.h  #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)cdrom_tsh.h	1.6	AIX)	/* Modified: 12:50:52 8/4/90 */

/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */


/*
 * cdrom_toshiba.h
 *
 * This file contains the defines for the structures and other values needed
 * to run the device specific code for the TOSHIBA CD-ROM.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	------	-----	---------------------------------------------
 * 0.00		12/23/88 GGS	Original code entry
 *
 */

/*
 * The following define the vendor unique commands for the Toshiba CD-ROM.
 */
#define	VUCMD_AUDIO_SEARCH	0xC0	/* audio track search		*/
#define	VUCMD_PLAY_AUDIO	0xC1	/* play audio			*/
#define	VUCMD_STILL		0xC2	/* pause play			*/
#define	VUCMD_SET_STOP_TIME	0xC3	/* set time before CD stops	*/
#define	VUCMD_TRAY_OPEN		0xC4	/* open the CD tray		*/
#define	VUCMD_TRAY_CLOSE	0xC5	/* close the CD tray		*/
#define	VUCMD_PLAY_STATUS	0xC6	/* get playing status		*/
#define	VUCMD_DISC_INFO		0xC7	/* read disc information	*/
#define	VUCMD_CD_MODE		0xC8	/* get CD-ROM mode		*/

/*
 * The following union defines the different address types
 */
union	cdrom_address
	     {
	     struct
		  {
		  uchar		lba[4];	/* logical block addr (binary)	*/
		  }	lba;
	     struct
		  {
		  uchar		min;	/* minute (BCD)			*/
		  uchar		sec;	/* second (BCD)			*/
		  uchar		frame;	/* 1/75 second (BCD)		*/
		  uchar		resvd;
		  }	time;
	     struct
		  {
		  uchar		track;	/* track # (BCD)		*/
		  uchar		resvd[3];
		  }	track;
	     };

typedef	union	cdrom_address	CDROM_ADDR;

/*
 * The following are encoded for the types of addresses.
 */
#define	ADDR_LBA	0x00		/* address is an LBA		*/
#define	ADDR_TIME	0x40		/* address is time		*/
#define	ADDR_TRACK	0x80		/* address is a track #		*/

/*
 * The following are the structures for commands.
 */
struct	cdrom_vucmds
	     {
	     uchar	cmd;
	     uchar	lun;
	     CDROM_ADDR	addr;
	     uchar	resvd[3];
	     uchar	control;
	     };

typedef	struct	cdrom_vucmds	CDROM_VUCMDS;

/*
 * The following are the defines that indicate what the playing modes are
 */
#define	PLAY_MUTE	0	/* play with muting on			*/
#define	PLAY_LEFT	1	/* play left channel			*/
#define	PLAY_RIGHT	2	/* play right channel			*/
#define	PLAY_STEREO	3	/* play left/right channels in stereo	*/
#define	PLAY_NOCHNG	4	/* play with previous mode		*/

/*
 * The following is the structure which defines the playing status data
 * block.
 */
struct	cdrom_plsb
	     {
	     uchar	status;
	     uchar	control;
	     uchar	track;
	     uchar	chapter;
	     uchar	min;
	     uchar	sec;
	     uchar	frame;
	     uchar	amin;
	     uchar	asec;
	     uchar	aframe;
	     };

typedef	struct	cdrom_plsb	CDROM_PLSB;

#define	PLS_PLAYING	0
#define	PLS_STILL	1
#define	PLS_PAUSE	2
#define	PLS_COMPLETE	3

/*
 * The following are the definitions in the control field.
 */
#define	PLC_2ACH_NOPRE	0	/* 2 audio channels, no pre-emphasis	*/
#define	PLC_2ACH_PRE	1	/* 2 audio channels, with pre-emphasis	*/
#define	PLC_4ACH_NOPRE	8	/* 4 audio channels, no pre-emphasis	*/
#define	PLC_4ACH_PRE	9	/* 4 audio channels, with pre-emphasis	*/
#define	PLC_DATA	4	/* data track				*/
#define	PLC_NOCOPY	0x00	/* digital copy prohibited		*/
#define	PLC_COPY	0x02	/* digital copy permitted		*/

/*
 * The following defines the data block that is returned as part of the 
 * disc info command.
 */
union	disc_info
	     {
	     struct
		  {
		  uchar		min_track;
		  uchar		max_track;
		  uchar		reserved[2];
		  }	tracks;
	     struct
		  {
		  uchar		min;
		  uchar		sec;
		  uchar		frame;
		  uchar		reserved;
		  }	leadout;
	     struct
		  {
		  uchar		min;
		  uchar		sec;
		  uchar		frame;
		  uchar		control;
		  }	track;
	     };

typedef	union	disc_info	DISC_INFO;

#define	DIT_NUMTRACKS	0	/* return min/max tracks on disc	*/
#define	DIT_LEADOUT	1	/* return leadout information		*/
#define	DIT_TRACK_INFO	2	/* return track information		*/

#define	DIC_DATA	4	/* set in control field if data track	*/
#define	DIC_AUDIO	0	/* set in control field if audio track	*/
kêìó ã  $        t  n‰*ü™ˆ*n‰*     5¢t  	                  ./usr/include/sys/i386/cdromclass.h .h  #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)cdromclass.h	1.3	AIX)	/* Modified: 12:54:19 8/4/90 */

/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */


/*
 * cdromclass.h
 *
 * This file contains the defines that are specific to the CD-ROM class of
 * devices.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	-------	-----	----------------------------------------------
 * 0.00		9/04/89	GGS	Original Code Entry
 *
 */


/*
 * This structure will define what a configuration entry looks like for the
 * CD-ROM class.  Since the configuration structures have to reside in a very
 * restricted place on disk, we will try to make them as small as possible.
 */
struct	cdrom_config
	     {
	     GEN_CONFIG		gen;	/* generic configuration	*/
	     ulong	reserved;	/* reserved bits		*/
	     };

typedef	struct	cdrom_config	CDROM_CONFIG;

#define	CDROM_CONFIG_LEN	sizeof( CDROM_CONFIG )

#define	CDROM_CONFIG_VER	1


/*
 * This structure defines the vendor unique routines that are common to all
 * CD-ROM's.  Each CD-ROM will provide its own set of these routines to be
 * pointed to by a vendor unique structure.
 */
struct	cdrom_vuar
             {
	     int	(*audio_search)();
	     int	(*play_audio)();
	     int	(*stop_audio)();
	     int	(*set_play_end)();
	     int	(*open_tray)();
	     int	(*close_tray)();
	     int	(*get_play_status)();
	     int	(*get_cdrom_info)();
	     };

typedef	struct	cdrom_vuar	CDROM_VUAR;
;	/*kê¶‹ ‹  $        A  c‰*3˜ˆ*c‰*     jA  	                  ./usr/include/sys/i386/cmos.h as/*
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1984, 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Microsoft Corporation
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */
/*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/

#include <sccs.h>
H_SCCSID(@(#)cmos.h	1.2    IBM AIX)    /* Modified: 19:59:33 7/15/92 */

/*
** cmos.h
**	#defines for the cmos configuration database
*/

#define CMOSADDR	0x70	/* write the address here */
#define CMOSDATA	0x71	/* read or write data here */
#define CDBMAX		64	/* number of bytes of CMOS ram */

#ifdef	i386
/* some PS/2s have an extra 2K bytes of NVRAM */
#define	NVR_ADDR_LO	0x74	/* write low order address byte here */
#define	NVR_ADDR_HI	0x75	/* write high order address byte here */
#define NVR_DATA	0x76	/* read or write data here */
#define	NVRMAX		2048	/* number of bytes of NVRAM */

#define	NVR_E_BASE	0x38a	/* base address in NVRAM of error slots */
#define NVR_E_SIZE	20	/* number of bytes per NRAM error slot  */
#define NVR_E_SLOTS	6	/* number of NVRAM error slots */
#endif	/* i386 */

/* device types in the standard 64 bytes of nvram */
#define	CMOSFDT		0x10	/* floppy types */
#define CMOSHDT		0x12	/* winchester types */
#define CMOSEB		0x14	/* equipment byte */
#define	CMOSHD0		0x19	/* extended winchester drive 0 type */
#define	CMOSHD1		0x1a	/* extended winchester drive 1 type */
#define ISACMOSHD0	0x11	/* winchester drive 0 type on ISAbus PS2s */
#define ISACMOSHD1	0x12	/* winchester drive 1 type on ISAbus PS2s */
);
	   kêŠ f  $        i  k‰*3˜ˆ*k‰*     R‰i  
                  ./usr/include/sys/i386/com232.h /*
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1988, 1989 IBM Corp.
*	(c) Copyright 1988, 1989 Locus Computing Corporation
 *	All Rights Reserved
 *
 * com232.h	define data structures used in the interface between
 *		the AIX rictty device driver and the com232 task on the
 *		cyclone card.
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)com232.h	16.4.1.5	LCC)	/* Modified: 16:36:01 11/22/91 */

/*
 * Primary status bit definitions
 */
#define INBUSY		0x04
#define OUTBUSY		0x40
#define TASKBUSY	0x80

/* Task command codes from SU */
#define WAKEUP_CMD	0x01		/* Look at data structures for work */

/*
 * rtsdtr argument defines
 * int rtsdtr(unsigned char port, unsigned char select, unsigned char request)
 */
#define SEL_DTR		0x2		/* if set, write DTR request bit */ 
#define SEL_RTS		0x1		/* if set, write RTS request bit */
#define REQ_DTR		0x2		/* DTR request bit; on or off */
#define REQ_RTS		0x1		/* RTS request bit; on or off */

/*
 * linestatus defines
 */
#define NOPORT		0x80		/* could not allocate port */
#define STAT_REC	0x01		/* read date availabe */
#define STAT_XMIT	0x02		/* transmit done */
#define STAT_EXT	0x04		/* external status changed */
#define STAT_CMD	0x08		/* adapter command complete */

/*
 * statinfo defines
 */
#define STAT_XOFF	0x01		/* hold transmission */
#define SEND_BRK	0x02		/* send break while on */
#define NO_MODEM	0x04		/* ignore external status, set DCD on*/
#define CTS_FLOW	0x08		/* use CTS as FLOW control */
#define SI_DTR		0x10		/* turn on DTR	*/
#define SI_RTS		0x40		/* turn on RTS */

/*
 * extstat defines
 */
#define RI		0x1		/* ring ind */
#define DCD		0x8		/* data carr det. */
#define DSR		0x10		/* date set ready */
#define CTS		0x20		/* clear to send */
#define BREAKDET	0x80		/* break cond */

/*
 * These command defines are provided for cases when the AIX device driver
 * needs to deliver a command to the ARTIC task.  The interface is generalized
 * and allows for the definition of other command types.  See rtycint() in
 * com232.c
 */
#define CMD_DONE	0		/* adapter command now complete */
#define CMD_UPD_EXTSTAT	1		/* set extstat to current values */

/*
 * input character error flags
 */
#define PARFLG		0x100		/* charater had a parity error */
#define BRKFLG		0x200		/* charater was a break */

#define NPORTS		8		/* number of ports supported by this
					   driver */

#define SETCFLAG	0x8000		/* flag to indicate a new cflag value */

struct ricinbuf {
	short head;
	short tail;
	unsigned short msg[CBSIZE];
};

struct ricoutbuf {
	unsigned short count;
	unsigned char msg[CBSIZE];
	unsigned char immdata;		/* out of band data to be sent */
	unsigned char outpad;		/* keep structure word aligned */
};

struct ricstatbuf {
	unsigned short linestat[NPORTS];
	struct {
		unsigned short cflag;
		unsigned char statinfo;
		unsigned char extstat;
	} lineinfo[NPORTS];
	unsigned char command[NPORTS];
};
ING	0
#kê¤¥ ¡  $        8
  4‰*3˜ˆ*4‰*     ¶Y8
  	                  ./usr/include/sys/i386/comcrt.h /*
 *	IBM Personal Computer IX/AT
 *		Version 1.00
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1984, 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Microsoft Corporation
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */


/*	SCCSID(@(#)comcrt.h	16.5	LCC)	/* Modified: 19:52:54 7/3/90 */




/*
** Definitions used by crt driver and by stty() ioctls
*/


/* mode definitions */
#define M_B40x25	0	/* black & white 40 columns */
#define M_C40x25	1	/* color 40 columns */
#define M_B80x25	2	/* black & white 80 columns */
#define M_C80x25	3	/* color 80 columns */
#define M_BG320		4	/* black & white graphics 320x200 */
#define M_CG320		5	/* color graphics 320x200 */
#define M_BG640		6	/* black & white graphics 640x200 hi-res */
#define M_EGAMONO80x25  7       /* ega-mono 80x25 */
#define M_CG320_D	13	/* ega mode D */
#define M_CG640_E	14	/* ega mode E */
#define M_EGAMONOAPA	15	/* ega mode F */
#define M_CG640x350	16	/* ega mode 10 */
#define M_ENHMONOAPA2	17	/* ega mode F with extended memory */
#define M_ENH_CG640	18	/* ega mode 10* */
#define M_ENH_B40x25    19      /* ega enhanced black & white 40 columns */
#define M_ENH_C40x25    20      /* ega enhanced color 40 columns */
#define M_ENH_B80x25    21      /* ega enhanced black & white 80 columns */
#define M_ENH_C80x25    22      /* ega enhanced color 80 columns */
#define M_VGA_C40x25	23	/* vga color, 40 columns */
#define M_VGA_C80x25	24	/* vga color, 80 columns */
#define M_VGA_M80x25	25	/* vga monochrome, 80 columns */
#define M_VGA_M640x480	26	/* vga monochrome, hi-res graphics */
#define M_VGA_C640x480	27	/* vga color, hi-res graphics */
#define M_VGA_C320x200	28	/* vga color, lo-res graphics */
#define M_VGA_C80x28	29	/* vga color, 80 columns, 28 lines */
#define M_VGA_C80x30	30	/* vga color, 80 columns, 30 lines */
#define M_VGA_C80x32	31	/* vga color, 80 columns, 32 lines */
#define M_VGA_C80x34	32	/* vga color, 80 columns, 34 lines */
#define M_VGA_C80x40	33	/* vga color, 80 columns, 40 lines */
#define M_VGA_C80x48	34	/* vga color, 80 columns, 48 lines */
#define M_VGA_C80x50	35	/* vga color, 80 columns, 50 lines */
#define M_VGA_C80x60	36	/* vga color, 80 columns, 60 lines */
#define M_PS55		55	/* used by internal routines */
#define M_MCA_MODE	0xff	/* monochrome adapter mode */

/* display/adapter defines */
#define MONO	1
#define CGA	2
#define PGA	3
#define EGA	4
#define VGA	5
#define EGAREG  6	/* not a real adaptor type */
#define EGAENH  7	/* not a real adaptor type */

/* function key max definition length */
#define	MAXFK	30

kê³ Š  $        ³  d‰*4˜ˆ*d‰*     !r³  	              ø   ./usr/include/sys/i386/coredump.h h .h  #ifndef _h_SCCS
#include <sccs.h>
#endif	/* _h_SCCS */
H_SCCSID(@(#)coredump.h	16.4	LCC)	/* Modified: 15:46:43 9/16/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * coredump.h
 *
 *	this file describes the format of a user core dump
 */

#ifndef	_h_COREDUMP
#define _h_COREDUMP

#ifdef	KERNEL

#ifndef	_h_PARAM
#include	<param.h>
#endif	/* _h_PARAM */
#ifndef	_h_TYPES
#include	<types.h>
#endif	/* _h_TYPES */
#ifndef	_h_USER
#include	<user.h>
#endif	/* _h_USER */
#ifndef	_h_SIGNAL
#include	<signal.h>
#endif	/* _h_SIGNAL */
#ifndef	_h_REG
#include	<reg.h>
#endif	/* _h_REG */

#else	/* ! KERNEL */

#ifndef	_h_PARAM
#include	<sys/param.h>
#endif	/* _h_PARAM */
#ifndef	_h_TYPES
#include	<sys/types.h>
#endif	/* _h_TYPES */
#ifndef	_h_USER
#include	<sys/user.h>
#endif	/* _h_USER */
#ifndef	_h_SIGNAL
#include	<sys/signal.h>
#endif	/* _h_SIGNAL */
#ifndef	_h_REG
#include	<sys/reg.h>
#endif	/* _h_REG */

#endif	/* ! KERNEL */

#define	CD_NAMELEN 16	/* length of most names in this header		*/

#if	defined(i386) || defined(x286)
#define	CORHDRSIZ	2048	/* size to which header is padded out	*/
#define	MAX_CORE_SEGS	32	/* maximum segments in a core dump	*/
#define NUM_FREGS	1			/* # of saved FP regs	*/

/*
 * These are defined such that 286 and 386 kernels can produce
 * compatible dumps.
 */
#define CD_AX	0
#define CD_BX	1
#define CD_CX	2
#define CD_DX	3
#define CD_SI	4
#define CD_DI	5
#define CD_BP	6
#define CD_SP	7
#define CD_FL	8
#define CD_IP	9
#define CD_CS	10
#define CD_DS	11
#define CD_ES	12
#define CD_FS	13
#define CD_GS	14
#define CD_SS	15
#define NUM_REGS	16

#endif	/* i386  */

struct corehdr
{
	char	cd_magic[4];		/* COR_MAGIC = "core"		*/

	/* general information about the dump itself */
	struct dumpseg {		/* table of contents for dump	*/
		long	cs_type;	/* seg. type; see below		*/
		long	cs_len;		/* length (in bytes) of segment	*/
		long	cs_offset;	/* offset (in dump) of segment	*/
		long	cs_address;	/* address segment had in mem	*/
	} cd_segs[MAX_CORE_SEGS];

	/* general information about the process */
	char	cd_comm[CD_NAMELEN];	/* command being run		*/
	char	cd_mach[CD_NAMELEN];	/* type of machine it ran on	*/
	char	cd_site[CD_NAMELEN];	/* name of site it ran on	*/
	long	cd_ldtype;		/* type of load module running	*/
	char	cd_intsize;		/* sizeof(int)			*/
	char	cd_dptrsize;		/* sizeof(char *)		*/
	char	cd_tptrsize;		/* sizeof(int (*)())		*/
	char	cd_unused;

	/* user-mode program state */
	long	cd_regs[NUM_REGS];	/* user-mode general registers	*/
	struct fp87state cd_fpregs;	/* user-mode floating-point state */

	/* kernel-mode program state */
	int	(*cd_sig[NSIG])();	/* disposition of signals	*/
	ksigmask_t cd_sigmask;		/* signals to be blocked	*/
	ksigmask_t cd_sigpend;		/* signals currently pending	*/
	long	cd_cursig;		/* signal that caused the dump	*/

	pid_t	cd_pid;			/* process ID of the corpse	*/
	pid_t	cd_ppid;		/* parent process ID of corpse	*/
	short	cd_uid;			/* process effective user ID	*/
	short	cd_ruid;		/* process real user ID		*/
	short	cd_gid;			/* process effective group ID	*/
	short	cd_rgid;		/* process real group ID	*/

	uinfo_t	cd_uinfo;		/* buffer of user information	*/
	char	cd_locname[32];		/* name of /local		*/
	char	cd_uvers[CD_NAMELEN];	/* user version string		*/
	sitepath_t cd_spath[SPATHLEN];	/* sitepath			*/
};

#ifndef NOCHECKS
/* this will generate an error if sizeof(struct corehdr) > CORHDRSIZ */
struct { char xxcdxx[CORHDRSIZ+1-sizeof(struct corehdr)]; };
#endif	/* ! NOCHECKS */

/*
 * segment types (in cs_type)
 *	each segment in the address space appears here, whether or not it
 *	is actually dumped.  Read/only segments will not actually be dumped.
 *	A segment that is not in the dump will have a cs_offset of zero.
 */
#define	COR_TYPE_CODE		'x'	/* process code - NOT IN DUMP	*/
#define	COR_TYPE_DATA		'd'	/* process data segment		*/
#define	COR_TYPE_STACK		's'	/* process stack segment	*/
#define COR_TYPE_LIBCODE	'X'	/* shared lib code - NOT IN DUMP*/
#define COR_TYPE_LIBDATA	'D'	/* shared lib data		*/
#define COR_TYPE_READ		'r'	/* other read/only - NOT IN DUMP*/
#define COR_TYPE_WRITE		'w'	/* other writeable		*/
#define	COR_TYPE_MSC		'?'	/* other, mapped in segment	*/

#endif	/* !_h_COREDUMP */
ed 
 kêvÓ ‰  $          d‰*4˜ˆ*d‰*     ùV  	              #Ž  ./usr/include/sys/i386/crtioctl.h h .h  /*
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1988 IBM Corp.
*	(c) Copyright 1985, 1989 IBM Microsoft Corp.
*	(c) Copyright 1988, 1989 Locus Computing Corporation
 *	All Rights Reserved
 *
 * module:
 *	crtioctl.h
 *
 * purpose:
 *	definitions for ioctl op codes and argument structures for operations
 *	on the console crt
 */
/*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/
#ifndef	_h_CRTIOCTL		/* to prevent multiple-inclusion */
#define	_h_CRTIOCTL

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)crtioctl.h	16.6	AIX)	/* Modified: 20:05:35 7/3/90 */

/* display/adapter defines (indices into vcrtsw)	*/
#define MONO	1	/* monochrome adaptor		*/
#define CGA	2	/* color graphics adaptor	*/
#define PGA	3	/* professional graphics adaptor*/
#define EGA	4	/* enhanced graphics adaptor	*/
#define VGA	5	/* video gate array		*/
#define EGAREG  6	/* not a real adaptor type	*/
#define EGAENH  7	/* not a real adaptor type	*/

/* adaptor independent console ioctl functions		*/
#define CONSIOC		('c' << 8)
#define CONS_CURRENT 	(CONSIOC|1)	/* return current adaptor type */
#define CONS_GET	(CONSIOC|2)	/* get current mode	       */

/* PC/AT Mca adapter control - not supported in AIX/386	*/
#define MCAIOC	('M' << 8)
#define MCAMODE	(MCAIOC | 1)		/* change mca mode */
#define MCAIO	(MCAIOC | 2)		/* do inb/outb on mca port */
#define MCA_GET (MCAIOC | 3)		/* get mca mode setting */

/* PC/AT Cga adapter control - not supported in AIX/386	*/
#define	CGAIOC	('C' << 8)	
#define	CGAMODE (CGAIOC | 1)		/* change cga mode */
#define CGAIO	(CGAIOC | 2)		/* do inb/outb on cga port */
#define CGA_GET (CGAIOC | 3)		/* get cga mode setting */

/* PC/AT Pga adapter control - not supported in AIX/386	*/
#define PGAIOC	('P' << 8)
#define PGAMODE (PGAIOC | 1)		/* change pga mode */
#define PGAIO	(PGAIOC | 2)		/* do inb/outb on pga port */
#define PGA_GET (PGAIOC | 3)		/* get pga mode setting */

/* PC/AT Ega adapter control */
#define EGAIOC	('E' << 8)
#define EGAMODE (EGAIOC | 1)		/* change ega mode */
#define EGAIO	(EGAIOC | 2)		/* do inb/outb on ega port */
#define EGA_GET (EGAIOC | 3)		/* get ega mode setting */

/* PS/2 VGA adapter control */
#define	VGAIOC	('V' << 8)
#define	VGA_GET_LUT	(VGAIOC | 1)	/* get the color look up table	*/
#define	VGA_SET_LUT	(VGAIOC | 2)	/* set the color look up table	*/
#define	VGA_GET_PAL	(VGAIOC	| 3)	/* get the palette registers	*/
#define	VGA_SET_PAL	(VGAIOC | 4)	/* set the palette registers	*/
#define	VGA_PLOT	(VGAIOC | 5)	/* VGA plot functions		*/

/* 
 * definitions for mode numbers for mode set/get operations
 * based on BIOS mode numbers, extended to include some modes not in BIOS
 */
#define M_B40x25	0	/* black & white 40 columns */
#define M_C40x25	1	/* color 40 columns */
#define M_B80x25	2	/* black & white 80 columns */
#define M_C80x25	3	/* color 80 columns */
#define M_BG320		4	/* black & white graphics 320x200 */
#define M_CG320		5	/* color graphics 320x200 */
#define M_BG640		6	/* black & white graphics 640x200 hi-res */
#define M_EGAMONO80x25  7       /* ega-mono 80x25 */
#define M_CG320_D	13	/* ega mode D */
#define M_CG640_E	14	/* ega mode E */
#define M_EGAMONOAPA	15	/* ega mode F */
#define M_CG640x350	16	/* ega mode 10 */
#define M_ENHMONOAPA2	17	/* ega mode F with extended memory */
#define M_ENH_CG640	18	/* ega mode 10* */
#define M_ENH_B40x25    19      /* ega enhanced black & white 40 columns */
#define M_ENH_C40x25    20      /* ega enhanced color 40 columns */
#define M_ENH_B80x25    21      /* ega enhanced black & white 80 columns */
#define M_ENH_C80x25    22      /* ega enhanced color 80 columns */
#define M_VGA_C40x25	23	/* vga color, 40 columns */
#define M_VGA_C80x25	24	/* vga color, 80 columns */
#define M_VGA_M80x25	25	/* vga monochrome, 80 columns */
#define M_VGA_M640x480	26	/* vga monochrome, hi-res graphics */
#define M_VGA_C640x480	27	/* vga color, hi-res graphics */
#define M_VGA_C320x200	28	/* vga color, lo-res graphics */
#define M_VGA_C80x28	29	/* vga color, 80 columns, 28 lines */
#define M_VGA_C80x30	30	/* vga color, 80 columns, 30 lines */
#define M_VGA_C80x32	31	/* vga color, 80 columns, 32 lines */
#define M_VGA_C80x34	32	/* vga color, 80 columns, 34 lines */
#define M_VGA_C80x40	33	/* vga color, 80 columns, 40 lines */
#define M_VGA_C80x48	34	/* vga color, 80 columns, 48 lines */
#define M_VGA_C80x50	35	/* vga color, 80 columns, 50 lines */
#define M_VGA_C80x60	36	/* vga color, 80 columns, 60 lines */
#define M_PS55		55	/* used by internal routines */
#define M_MCA_MODE	0xff	/* monochrome adapter mode */

/* definitions for port I/O ioctls */
#define IN_ON_PORT	1
#define OUT_ON_PORT	0

/* structure used for inb/outb ioctls for graphics adapter ports */
struct port_io_struct {
	char	dir;	/* direction flag (in vs. out) */
	unsigned int port;
	char	data;
};
struct port_io_arg {
	struct port_io_struct args[4];
};	

/*
 * Structure for reading or writing the VGA color look up table
 */
struct	lut_el
{	char	red; 
	char	green;
	char	blue;
};

struct	lut_arg
{	struct	lut_el	lut[256];
};

/*
 * Structure for reading or writing the palette registers
 */
struct	pal_arg
{	char	pal[64];
};

/* defines for display memory mapping/unmapping ioctl		*/
#define MAPADAPTER	('m' << 8)
#define MAPCONS 	(MAPADAPTER)  
#define MAPEGA 		(MAPADAPTER | EGA)

#define	UMAPADAPTER	('u' << 8)
#define	UMAPCONS	(UMAPADAPTER)
#define	UMAPEGA		(UMAPADAPTER | EGA)

/* defines for ibm keyboard ioctls */
#define FKEYIOC   ('k' << 8)
#define GETFKEY   (FKEYIOC |0)		/* get function key definition	*/
#define SETFKEY   (FKEYIOC |1)		/* set function key definition	*/
#define TIOCKBON  (TIOC	   |8)		/* enable extended codes	*/
#define TIOCKBOF  (TIOC    |9)		/* disable extended codes	*/
#define KBENABLED (TIOC    |10)		/* return kb extended code sts	*/

#define	MAXFK		30	/* longest function key definition	*/
#define NFKEYS  	48	/* max number of function key definitions */

/* structure used for SETFKEY and GETFKEY ioctls */
struct fkeyarg {	
	unsigned int	keynum;
	char	 	keydef[MAXFK];
	char		flen;			
};

/*
 * adaptor-type independent ioctls for mode changes and adaptor switches
 */
/* definitions are in comcrt.h  				  */	
#define SWAPCONS ('s' << 8)
#define SWAPMONO (SWAPCONS | MONO)
#define SWAPCGA  (SWAPCONS | CGA)
#define SWAPPGA  (SWAPCONS | PGA)
#define SWAPEGA  (SWAPCONS | EGA)

/* defines for mode-switching ioctl -- modes are defined in comcrt.h */
#define MODESWITCH ('S' << 8)
#define SW_B40x25  (MODESWITCH | M_B40x25)
#define SW_C40x25  (MODESWITCH | M_C40x25)
#define SW_B80x25  (MODESWITCH | M_B80x25)
#define SW_C80x25  (MODESWITCH | M_C80x25)
#define SW_BG320   (MODESWITCH | M_BG320)
#define SW_CG320   (MODESWITCH | M_CG320)
#define SW_BG640   (MODESWITCH | M_BG640)
#define SW_EGAMONO80x25 (MODESWITCH | M_EGAMONO80x25)
#define SW_CG320_D    (MODESWITCH | M_CG320_D)
#define SW_CG640_E    (MODESWITCH | M_CG640_E)
#define SW_EGAMONOAPA (MODESWITCH | M_EGAMONOAPA)
#define SW_CG640x350  (MODESWITCH | M_CG640x350)
#define SW_ENH_MONOAPA2 (MODESWITCH | M_ENHMONOAPA2)
#define SW_ENH_CG640  (MODESWITCH | M_ENH_CG640)
#define SW_ENHB40x25  (MODESWITCH | M_ENH_B40x25)
#define SW_ENHC40x25  (MODESWITCH | M_ENH_C40x25)
#define SW_ENHB80x25  (MODESWITCH | M_ENH_B80x25)
#define SW_ENHC80x25  (MODESWITCH | M_ENH_C80x25)
#define SW_PS55	      (MODESWITCH | M_PS55)
#define SW_MCAMODE    (MODESWITCH | M_MCA_MODE)

#endif	/* _h_CRTIOCTL */
18	/kêó c  $        h  k‰*ä™ˆ*k‰*     î¿h  
                  ./usr/include/sys/i386/dasd.h l.#ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)dasd.h	1.6	AIX)	/* Modified: 14:13:56 2/9/90 */


/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * dasd.h
 *
 * This file is used for all of the definitions that are specific to DASD
 * for the SCSI device driver.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	-------	-----	----------------------------------------------
 * 0.00		1/9/89	GGS	Original Code Entry
 *
 */

#define	FIXED_BLOCK			/* AIX uses fixed disk blocks	*/
#define	SECSIZE		512		/* size of a sector		*/
#define	TBUFSIZE	SECSIZE		/* size of internal temp buffers*/
#define	NSPB		(DEV_BSIZE/SECSIZE)	/* # secs / disk block	*/
#define	FMT_BUFF_SIZE	4096		/* size of the format buffer	*/

#define	MAX_NON_SCSI_DRIVES	2
#define	MIN_SCSI_LOCKS		8
#define	MAX_SCSI_LOCKS		40

#ifndef	USE_MINI_DISKS
#define	get_part(dev,map)	(minor(dev) & 0x007)

#else
#define	MAX_DASD		64
#define	MAX_DASD_CONFIG		2 * MAX_DASD
#define	scsi_make_drive(cn,id,lu,rtns)	(scsi_make_dev(cn,id,lu,(rtns)->map_table,(rtns)->map_len) + xhd_scsi.drive_offset)
#define	get_part(dev)			(minortopart(dev, scsidasdmajor))
#endif

/*
 * The following are defines that we need for dealing with the partition
 * table that exists on the disk.  It also helps in defining some of the
 * stuff for the in-core partition table.
 */
#define	PARTITIONS

#ifndef	USE_MINI_DISKS
#define	NDPARTS		4		/* # of on-disk partitions	*/
#define	PART_BASE	1		/* partition 0 == whole disk	*/
#define	ACT_PART	(PART_BASE+NDPARTS+0)	/* Active partition	*/
#define	DOS_PART	(PART_BASE+NDPARTS+1)	/* PC DOS partition	*/
#define	NPARTS		(PART_BASE+NDPARTS+2)	/* # in-core partitions	*/

#define	BOOTRSVDSECS	(17*3)		/* # secs reserved for boot pgm	*/
#define	BIOS_MAXNCYL	1023
#define	BIOS_NTPC	64
#define	BIOS_NSPT	32

#define	MAP(p)		(NDPARTS - (p + 1))

#ifdef	LSBINDEX == 0
#define	wswap(x)	(x)
#else
#define	wswap(x)	(((x & 0xffffL) << 16) | ((x >> 16) & 0xffffL))
#endif
/*
 * On disk Partition Table
 */
struct partab
	     {
	     struct
		  {
		  struct
		       {
		       char	ind;	/* Indicator			*/
		       char	head;	/* Head				*/
		       char	sec;	/* Sector			*/
		       char	cyl;	/* Cylinder			*/
		       }
		       boot,
		       syst;
		  long	startsec;
		  long	numsec;
		  }
		  tab[NDPARTS];
	     unsigned	short	signature;
	     };
#define PSIGN	0xaa55
#define	POFFSET	0x1be

/*
 * The following are the different kinds of partitions that can exist
 * on the disk.
 */
#define	NO_PART		0x00		/* no partition			*/
#define	DOS_FAT12_PART	0x01		/* DOS 12 bit FAT partition	*/
#define	XENIX2_PART	0x02		/* Xenix type 2 partition	*/
#define	XENIX3_PART	0x03		/* Xenix type 3 partition	*/
#define	DOS_FAT16_PART	0x04		/* DOS 16 bit FAT partition	*/
#define	DOS_EXT_PART	0x05		/* DOS extended partition	*/
#define	DOS_LGFAT_PART	0x06		/* DOS (4.0) large FAT partition*/
#define	AT_LOCUS_PART	0x09		/* AT Locus partition		*/
#define	AIX386_PART	0x0A		/* AIX/386 partition		*/

#else

#define	PART_BASE	0		/* no offset			*/
#define	NPARTS		MAX_PARTS

#define	BOOTRSVDSECS	(17*3)		/* # secs reserved for boot pgm	*/
#define	BIOS_MAXNCYL	1023
#define	BIOS_NTPC	64
#define	BIOS_NSPT	32

typedef	struct	hdpart	PARTENTS;

#endif
kêö# á  $        X  n‰*šˆ*n‰*     `WX  	                  ./usr/include/sys/i386/dasd_lock.h  .h  #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)dasd_lock.h	1.2	AIX)	/* Modified: 14:39:15 2/9/90 */


/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */


/*
 * dasd_lock.h
 *
 * This file defines the structure that goes in sector 2 of the hardfile to be
 * locked.  Each disk that is controlled by the device driver will have one of
 * these structures on it.  The structure contains information that allows
 * parts of the disk to be "reserved" or locked by a particular system.  This
 * allows multiple initiators to share parts of disks on the SCSI bus.
 *
 * It would be nice to be able to use the reserve/release extents facility of
 * the SCSI devices there are several problems with that.  The first is that
 * there are few devices which support extent reservation.  The second is that
 * we then have to deal with alot of Unit Attentions to make sure that the
 * locked sections of the disk are re-locked.
 *
 * There are problems with this approach also.  The most important is that if
 * a system crashes with some areas of a disk locked, then there must be some
 * recovery mechanism to permit unlocking those areas by other systems.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	------	-----	---------------------------------------------
 * 0.00		3/16/89 GGS	Original code entry
 *
 */

/*
 * The following are a set of defines that are in os.h.  This is because the
 * location of the lock record and the number of sectors that it occupies is
 * really OS dependent.
 *
 * The defines to be found in os.h are:
 *
 *	SCSI_CONF_SEC		sector where the SCSI configuration is located
 *	NUM_SCSI_CONF_SECS	number of sectors that the SCSI configuration
 *				may occupy.
 *	MAX_SCSI_LOCKS		maximum number of locks permitted on one 
 *				device.
 *
 */

/*
 * The following is the name of the lock table.  Note that this WILL have a
 * trailing 0 and that is to be included in the record on disk.
 */
#define	SCSI_LOCK_NAME	"IBM SCSI Lock  "

/*
 * The following is the signature indicating that the record is valid.
 */
#define	SCSI_LOCK_SIG	((ushort)0x9966)

/*
 * The following is the current version of the lock record.  It is conceivable
 * that there could be multiple valid formats for the lock record.  This will
 * allow the driver to determine which one of several formats it should read
 * if it ever needs to.
 */
#define	SCSI_LOCK_VER	0x0001

/*
 * The following is the layout of the SCSI lock table.
 *
 * Note:  reserved fields will contain 0's for upward compatibility if that
 *	  becomes necessary.
 */
struct	scsi_lock
	     {
	     uchar	flags;
	     uchar	reserved;
	     ushort	lock_id;
	     ulong	lock_start;
	     ulong	lock_len;
	     };

typedef	struct	scsi_lock	SCSI_LOCK;

#define	SL_IN_USE	0x01	/* lock entry in use			*/
#define	SL_ENTONDISK	0x80	/* entry is in table on disk		*/

struct	scsi_lock_table
	     {
	     ushort	lock_id;
	     ushort	lock_flags;
	     ushort	num_locks;
	     SCSI_LOCK	lock_table[MAX_SCSI_LOCKS];
	     };

typedef	struct	scsi_lock_table	SLT;

/*
 * The following define the bits used in the lock table flag field.
 */
#define	SL_AREA_LOCKED	0x0001	/* entire lock table is locked		*/
#define	SL_SINGLE_SYS	0x0002	/* only allow a single system to lock	*/

/*
 * The following macros are used to create lock id's and also to extract
 * information from them.  A lock id is composed of the system's SCSI id
 * and a lock number.  The lock number allows locks to be removed without
 * having to know the original size of the lock.  The lock id for the lock
 * table has a 0 as the lock number.
 */
#define	mk_scsi_lock(id, num)	(((id) << 8) | (num))
#define	get_lock_id( l )	(((l) >> 8) & 0x07)
#define	get_lock_num( l )	((l) & 0xff)
kêÈ ˆ  $        •  d‰*5˜ˆ*d‰*     «“•  	                  ./usr/include/sys/i386/dmaralloc.h  .h  H_SCCSID(@(#)dmaralloc.h	16.6	LCC)	/* Modified: 13:18:49 4/24/92 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef	_h_DMARALLOC
#define	_h_DMARALLOC

/* This file contains the structures/definitions which are use by
 * device drivers to allocate dma resources.
 */
struct dmaralloc {
	/* Driver initialized elements */
	char *dma_devicename; 	/* Name of the device (as an ASCIZ string) */
	int (*dma_availfunc)();	/* Function to call when resource available */
	short dma_priority;	/* Relative priority */
	short dma_arblevel;	/* Requested arbitration level */

	/* dma.c initialized elements, except for some flags, see below */
	short dma_channel;	/* Channel assigned by dmachanalloc() */
	short dma_flags;	/* Flags (see below) */
	struct dmaralloc *dma_next;	/* Next pointer of linked list */
};

struct sg_blk			/* scatter/gather SCB element list*/
{
	caddr_t paddr;  /* Pointer to physical location of sub-buffer */
	int     cnt;    /* number of bytes in sub-buffer              */
}; 

#define NODATACHAIN	-1	/* sg_blk.cnt is -1 if no data chain  */

/* Priority levels for dma_priority.  Lower numbers mean higher priority. */
#define DMA_GOODPRI	0
#define DMA_AVEPRI	5
#define DMA_BADPRI	9

/* dma.c initialized flags */
#define DMA_CHANWAIT	0x0001	/* Waiting for a channel                   */
#define DMA_HAVECHAN	0x0002	/* Channel currently allocated             */

/* Driver initialized flags, default condition is 0                        */ 
#define DMA_SRF         0x0010  /* 1 = Internal arbitration request        */
#define DMA_SSF         0x0020  /* 1 = scatter/scatter list active         */
#define DMA_SGF         0x0040  /* 1 = scatter/gather list active          */
#define DMA_MTOM        0x0080  /* 1 = Memory to Memory transfer           */
#define DMA_EOT_TC      0x0100  /* Mantaray 1=interrupt on EOT             */
#define DMA_DFF         0x0200  /* Disable FULL FIFO, default is full FIFO */

#define DMA_SCB_RQ	0x8000  /* physio Subsystem Control Block request */

extern bool_t dmachanalloc();
extern unsigned short dmaresid();
/*extern unsigned long dmaresid();*/

#endif /* ! _h_DMARALLOC */
ingkêbÛ ‡  $        ¨  d‰*5˜ˆ*d‰*     ¦y¨  	                  ./usr/include/sys/i386/dump286.h h  .h  /*
 *	IBM Personal Computer IX/AT
 *		Version 1.00
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1984, 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Microsoft Corporation
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

H_SCCSID(@(#)dump286.h	16.3	LCC)	/* Modified: 21:37:28 9/15/89 */
/* kernel core dump  structures and defines for 286 */
struct dumphdr {
	long	dh_magic;		/* magic number			*/
	unsigned short dh_dumpversion;	/* dump header version number	*/
	char	dh_version[128];	/* kernel version string	*/
	unsigned short dh_dmaplen;	/* # of entries in dump map	*/
	paddr_t	dh_gdtaddr;		/* physical address of gdt	*/
	paddr_t	dh_ldtaddr;		/* physical address of ldt	*/
	time_t	dh_dumptime;		/* time dump taken		*/
	unsigned short dh_hdrsize;	/* total size of dump header	*/
	off_t	dh_dumpsize;		/* total size of dump		*/
#ifdef i386
	paddr_t	dh_pagedir;		/* physical address of pagedir	*/
#endif
};

#define	DUMPMAGIC	0x04150d10	/* ^D^U^M^P */
#define	DUMPVERSION	1
#define	DUMPBUFSIZ	BSIZE

struct dumpmap {
	paddr_t	dm_start;
	long	dm_len;
};

#ifdef	KERNEL
/* codes passed to hardware-dependent dump routine */
#define	DUMP_INIT	0	/* init (no data); offset gives total size */
#define	DUMP_DATA	1	/* data blocks */
#define	DUMP_END	2	/* end of dump (no data) */

extern char dumpbuf[];	/* NEEDSWORK:  eventually dynamically allocate */
#endif	/* KERNEL */
kêT« †  $        ·I  d‰*6˜ˆ*d‰*     ^“·I  	                ./usr/include/sys/i386/e80387.h #ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)e80387.h	16.4	LCC)	/* Modified: 15:46:55 9/16/89 */
/    ===============================================================
/               intel corporation proprietary information
/    this software  is  supplied  under  the  terms  of  a  license
/    agreement  or non-disclosure agreement  with intel corporation
/    and  may not be copied  or disclosed except in accordance with
/    the terms of that agreement.                                  
/    ===============================================================
 
/*#ident	"@(#)e80387.h	1.3"*/
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
#include <DOPTIONS.h>
#include <assyms.h>

/* ...definition of global reentrant data segment      */

/* global_record_1         struc */

#define	mem_operand_pointer     	0	/* dp */
#define	instruction_pointer     	6	/* dp */
#define	operation_type          	12	/* .byte */
#define	reg_num                 	13	/* .byte */

#define	op1_format              	14	/* .byte */
#define	op1_location            	15	/* .byte */
#define	op1_use_up              	16	/* .byte */

#define	op2_format              	17	/* .byte */
#define	op2_location            	18	/* .byte */
#define	op2_use_up              	19	/* .byte */

#define	result_format           	20	/* .byte */
#define	result_location         	21	/* .byte */

#define	result2_format          	22	/* .byte */
#define	result2_location        	23	/* .byte */

#define	dword_frac1             	24	/* 3 dup(_) */
#define	sign1                   	36	/* .byte */
#define	sign1_ext               	37	/* .byte */
#define	tag1                    	38	/* .byte */
#define	tag1_ext                	39	/* .byte */
#define	expon1                  	40	/* .value */
#define	expon1_ext              	42	/* .value */

#define	dword_frac2             	44	/* 3 dup(_) */
#define	sign2                   	56	/* .byte */
#define	sign2_ext               	57	/* .byte */
#define	tag2                    	58	/* .byte */
#define	tag2_ext                	59	/* .byte */
#define	expon2                  	60	/* .value */
#define	expon2_ext              	62	/* .value */

#define	before_error_signals		64	/* .long  */
#define	extra_dword_reg         	68	/* 3 dup(_) */
#define	result_dword_frac       	80	/* 3 dup(_) */
#define	result_sign             	92	/* .byte */
#define	result_sign_ext         	93	/* .byte */
#define	result_tag              	94	/* .byte */
#define	result_tag_ext          	95	/* .byte */
#define	result_expon            	96	/* .value */
#define	result_expon_ext        	98	/* .value */

#define	result2_dword_frac      	100	/* 3 dup(_) */
#define	result2_sign            	112	/* .byte */
#define	result2_sign_ext        	113	/* .byte */
#define	result2_tag             	114	/* .byte */
#define	result2_tag_ext         	115	/* .byte */
#define	result2_expon           	116	/* .value */
#define	result2_expon_ext       	118	/* .value */
/  global_record_1         ends

/  global_record_2         struc

#define	dword_cop               	120	/* 3 dup(_) */
#define	dword_dop               	132	/* 3 dup(_) */

#define	oprnd_siz32             	144	/* .byte */
#define	addrs_siz32             	145	/* .byte */
#define	correct_ss              	146	/* .value */
#define	correct_esp             	148	/* dd */

#define	saved_gs                	152	/* .value */
#define	fill_1                  	154	/* .value */
#define	saved_fs                	156	/* .value */
#define	fill_2                  	158	/* .value */
#define	saved_es                	160	/* .value */
#define	fill_3                  	162	/* .value */
#define	saved_ds                	164	/* .value */
#define	fill_4                  	166	/* .value */
#define	saved_edi               	168	/* dd */
#define	saved_esi               	172	/* dd */
#define	saved_ebp               	176	/* dd */
#define	saved_esp               	180	/* dd */
#define	saved_ebx               	184	/* dd */
#define	saved_edx               	188	/* dd */
#define	saved_ecx               	192	/* dd */
#define	saved_eax               	196	/* dd */
#define	saved_eip               	200	/* dd */
#define	saved_cs                	204	/* .value */
#define	fill_5                  	206	/* .value */
#define	saved_flags             	208	/* dd */
#define	old_esp                 	212	/* dd */
#define	old_ss                  	216	/* .value */
#define	fill_6                  	218	/* .value */
/  global_record_2         ends

#define	global_reent_seg_length	$220
/*	r0ptr is the ptr to the beginning of the register save area on the
	kernel stack for the caller of the emulator code.  fpsave  is the
	longjump address for returning from an incorrectable error.  The 
	offset of these values on the stack are figured from ebp.    */

#define		offset_r0ptr	13\*4 + 220  /* global_reent_seg_length */
#define		offset_fpsave	14\*4 + 220  /* global_reent_seg_length  */

/*     convenience definitions     */
/*  new ones -387     */

#define         word_frac1                      [dword_frac1+2](%ebp)
#define         word_frac2                      [dword_frac2+2](%ebp)
#define         result_word_frac                [result_dword_frac+2](%ebp)
#define         result2_word_frac               [result2_dword_frac+2](%ebp)

#define		dword_expon1			[expon1](%ebp)
#define		dword_expon2			[expon2](%ebp)
#define		dword_result_expon		[result_expon](%ebp)
#define		dword_result2_expon		[result2_expon](%ebp)

#define         dop                             [dword_dop+2](%ebp)
#define         cop                             [dword_cop+2](%ebp)
#define         extra_word_reg                  [extra_dword_reg+2](%ebp)
#define		signal_i_error_			[before_error_signals](%ebp)
#define		signal_z_error_			[before_error_signals+1](%ebp)
#define		signal_d_error_			[before_error_signals+2](%ebp)

#define         offset_op1_rec                  $op1_format
#define         offset_op2_rec                  $op2_format
#define         offset_result_rec               $result_format
#define         offset_result2_rec              $result2_format
#define         offset_operand1                 dword_frac1
#define         lsb_frac1                       word_frac1
#define         msb_frac1                       9+word_frac1
#define         offset_operand2                 dword_frac2
#define         lsb_frac2                       word_frac2
#define         msb_frac2                       9+word_frac2
#define         offset_result                   result_dword_frac
#define         lsb_result                      result_word_frac
#define         msb_result                      9+result_word_frac
#define         offset_result2                  result2_dword_frac
#define         lsb_result2                     result2_word_frac
#define         msb_result2                     9+result2_word_frac
#define         offset_cop                      dword_cop
#define         lsb_cop                         cop
#define         msb_cop                         9+lsb_cop
#define         offset_dop                      dword_dop
#define         lsb_dop                         dop
#define         msb_dop                         9+lsb_dop
#define         q                               [mem_operand_pointer](%ebp)
#define         hi_q                            [mem_operand_pointer+1](%ebp)
#define         exp_tmp                         [mem_operand_pointer](%ebp)
#define         siso                            [mem_operand_pointer+4](%ebp)
#define         loop_ct                         [mem_operand_pointer+2](%ebp)
#define		log_loop_ct			[mem_operand_pointer](%ebp)
#define         bit_ct                          [instruction_pointer](%ebp)
#define         added_one                       [instruction_pointer+1](%ebp)
#define         rnd_history                     [instruction_pointer+2](%ebp)
#define         rnd1_inexact                    [instruction_pointer+2](%ebp)
#define         rnd2_inexact                    [instruction_pointer+3](%ebp)

#define		dword_exp_tmp			[before_error_signals](%ebp)
#define		trans_info			[extra_dword_reg](%ebp)
#define		op_type				[extra_dword_reg](%ebp)
#define		sin_sign			[extra_dword_reg+1](%ebp)
#define		cos_sign			[extra_dword_reg+2](%ebp)
#define		cofunc_flag			[extra_dword_reg+3](%ebp)
#define		res_signs			[extra_dword_reg+1](%ebp)
/* ...define structure of operand info and result info structures...     */

#define         format          0
#define         location        1
#define         use_up          2

/* ...define format codes...     */

#define         single_real     0
#define         double_real     1
#define         int16           2
#define         int32           3
#define         int64           4
#define         extended_fp     5
#define         null            7
#define         bcd             8
#define         op_no_result    9
#define         no_op_result    10
#define         op2_pop         11
#define         op2_no_pop      12
#define         result2         13
#define         op1_top_op2     14

/* ...define operation type codes...     */

#define         save_ptrs       0x80
#define         load_op         0
#define         store_op        1
#define         chsign_op       2
#define         compar_op       3
#define         error_op        4+save_ptrs
#define         add_op          5
#define         sub_op          6
#define         mul_op          7
#define         div_op          8
#define         ldcw_op         9+save_ptrs
#define         save_op         10+save_ptrs
#define         restore_op      11+save_ptrs
#define         null_op         12+save_ptrs
#define         abs_op          13
#define         init_op         14+save_ptrs
#define         fxtrac_op       15
#define         log_op          16
#define         splog_op        17
#define         exp_op          18
#define         tan_op          19
#define         arctan_op       20
#define         sqrt_op         21
#define         remr_op         22
#define         intpt_op        23
#define         scale_op        24
#define         exchange_op     25
#define         free_op         26
#define         ldenv_op        27+save_ptrs
#define         stenv_op        28+save_ptrs
#define         stcw_op         29+save_ptrs
#define         stsw_op         30+save_ptrs
#define         load_1_op       31
#define         load_l2t_op     32
#define         load_l2e_op     33
#define         load_pi_op      34
#define         load_lg2_op     35
#define         load_ln2_op     36
#define         load_0_op       37
#define         decstp_op       38
#define         incstp_op       39
#define         cler_op         40+save_ptrs
#define         test_op         41
#define         exam_op         42
#define         sin_op          43
#define         cos_op          44
#define         sincos_op       45
#define         rem1_op         46
#define         ucom_op         47
#define         compar_pop      48
#define         subr_op         49
#define         divr_op         50
#define         store_pop       51
#define         ucom_pop        52

/* ...definition of register tag codes...     */

#define         valid                    $0
#define         VALID                    0
#define         special                  $1
#define		SPECIAL			 1
#define         inv                      $2
#define         empty                    3
#define         denormd                  $6
#define         infinty                  $0x0a
#define		INFINITY		 0x0a
#define         unsupp                   $0x12 

/* ...infinity_control settings...     */

#define         projective              $0
#define         affine                  $1

/* ...define location codes...     */

#define         memory_opnd             0
#define         stack_top               1
#define         stack_top_minus_1       2
#define         stack_top_plus_1        3
#define         reg                     4

/* ...define use_up codes...     */

#define         free            $0
#define         pop_stack       $1
#define         do_nothing      2

/* ...definition of operand and result records in global reent seg...     */

#define         frac80  2
#define         frac64  4
#define         frac32  8
#define         msb     11
#define         sign    12
#define         tag     14
#define         expon   16

/* ...definition of precision codes...     */

#define         prec24                   $0
#define         prec32                   $1
#define         prec53                   $2
#define         prec64                   $3
#define         prec16                   $4

/* ...define round control codes...     */

#define         rnd_to_even                      $0x0000
#define         rnd_down                         $0x0004
#define         rnd_up                           $0x0008
#define         rnd_to_zero                      $0x000c

/* ...define positive and negative...     */

#define         positive                        $0x0000
#define		POSITIVE			 0x0000
#define         negative                        $0x00ff
#define         NEGATIVE                         0x00ff

/* ...definition of true and false...     */

#define         true                    $0x00ff
#define         false                   $0x0000

#define         wrap_around_constant            $0x6000
#define         no_change                       $0x00f0
#define         exponent_bias                   0x3fff

#define         single_exp_offset               $0x3f80
#define         double_exp_offset               $0x3c00

#define         zero_mask                       0x40
#define         sign_mask                       0x01
#define         a_mask                          0x02
#define         c_mask                          0x04
#define         inexact_mask                    0x20
#define         underflow_mask                  $0x10
#define         overflow_mask                   $0x08
#define         zero_divide_mask                $0x04
#define         invalid_mask                    $0x01
#define         denorm_mask                     $0x02
#define         top_mask                        0x38
#define         precision_mask                  0x03
#define         rnd_control_mask                0x0c
#define         infinity_control_mask           $0x10
#define         high_extended_expon_for_single  $0x407e
#define         low_extended_expon_for_single   $0x3f81
#define         high_extended_expon_for_double  $0x43fe
#define         low_extended_expon_for_double   $0x3c01
#define         high_int16_exponent     $0x400e
#define         max_int16_shift         $17
#define         high_int32_exponent     $0x401e
#define         max_int32_shift         $33
#define         high_int64_exponent     $0x403e
#define         max_int64_shift         $65
/*	the least scale term for which extreme overflow is certain */
#define		least_sf_xtrm_ovfl	$0x0000e03d
/*	the greatest scale term for which extreme underflow is certain */
#define		grtst_sf_xtrm_unfl	$0xffff2002

/*	These values set up for referencing the status registers in u_block */

/*
/       The following structure depicts the Status Register structure
/       for the 80387 emulator.
/
/               +-----------------------------------------------+
/            0  |       sr_masks        |       sr_controls     |
/               +-----------------------------------------------+
/            2  |               sr_reserved1                    |
/               +-----------------------------------------------+
/            4  |       sr_errors       |       sr_flags        |
/               +-----------------------------------------------+
/            6  |               sr_reserved2                    |
/               +-----------------------------------------------+
/            8  |                    sr_tags                    |
/               +-----------------------------------------------+
/           10  |               sr_reserved3                    |
/               +-----------------------------------------------+
/           12  |               sr_instr_offset                 |
/               +                                               +
/           14  |                                               |
/               +-----------------------------------------------+
/           16  |               sr_instr_base                   |
/               +-----------------------------------------------+
/           18  |               sr_reserved4                    |
/               +-----------------------------------------------+
/           20  |               sr_mem_offset                   |
/               +                                               +
/           22  |                                               |
/               +-----------------------------------------------+
/           24  |               sr_mem_base                     |
/               +-----------------------------------------------+
/           26  |               sr_reserved5                    |
/               +-----------------------------------------------+
/           28  |               sr_regstack                     |
/               +-----------------------------------------------+
/           30  |                                               |
/               +-----------------------------------------------+
/                                       .
/
/                                       .
/
/                                       .
/               +-----------------------------------------------+
/           106 |                                               |
/               +-----------------------------------------------+
/
/
/
/
/	The status register memory allocation for the emulator is found at
/	offset u_fpstate into the user's u block structure.
/
/
/...define the 80387 status register...
/								*/
#define sr_masks 	u + u_fpstate + 0 	
#define sr_controls	u + u_fpstate + 1 
#define sr_reserved1 	u + u_fpstate + 2 	
#define sr_errors 	u + u_fpstate + 4 	
#define sr_flags 	u + u_fpstate + 5 	
#define sr_reserved2 	u + u_fpstate + 6 	
#define sr_tags 	u + u_fpstate + 8 	
#define sr_reserved3 	u + u_fpstate + 10 	
#define sr_instr_offset u + u_fpstate + 12
#define sr_instr_base 	u + u_fpstate + 16
#define sr_reserved4 	u + u_fpstate + 18
#define sr_mem_offset 	u + u_fpstate + 20	
#define sr_mem_base 	u + u_fpstate + 24	
#define sr_reserved5 	u + u_fpstate + 26	
#define sr_regstack 	u + u_fpstate + 28	
/

	.globl	u
/	.globl	sr_mem_offset
/	.globl	sr_mem_base
/	.globl	a_msr_data
/	.globl	sr_regstack
/	.globl	sr_masks
/	.globl	sr_errors
/	.globl	sr_instr_offset
/	.globl	sr_instr_base

#if defined(SVPAGING) || defined(PAGING) /* || any other paging */
/* Enable Copy On Write checking for ALL paging systems! */
#define	C_O_W_CHECK
#endif /*SVPAGING||PAGING*/
 kêÒû …  $        x  e‰*6˜ˆ*e‰*     ¢ex  	              “  ./usr/include/sys/i386/egaregs.h h  .h  /*
 *	IBM Personal Computer IX/AT
 *		Version 1.00
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1984, 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Microsoft Corporation
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 *
 *	this include file defines the port and register numbers on the EGA
 *	and VGA, and the format of the BIOS mode parameters in the adaptor ROM
 *
 *	we define all of the ports, but only the most interesting registers
 */
/*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/
/* SCCSID(@(#)egaregs.h	16.4	AIX)	Modified: 21:39:10 9/15/89 */

/* numbers of registers assocaited with the various video controllers	*/
#define NCRT_REGS	0x19	/* Number of crt controller registers 	*/
#define NATT_REGS       0x15	/* Number of attribute registers 	*/
#define NSEQ_REGS       0x05    /* Number of sequencer registers 	*/
#define NGRX_REGS       0x09    /* Number of graphics registers 	*/
#define	NEGA_MAPS	   4	/* number of memory banks in an EGA/VGA	*/

/*
 * EGA/VGA Register Addresses
 */
#define	MISC_OUT_W	0x03c2	/* Miscellaneous Output Reg - Write     */
#define	MISC_OUT_R	0x03cc	/* Miscellaneous Output Reg - Read      */
#define	INPUT_STAT0	0x03c2	/* Input Status Register 0  - Read Only */
#define	INPUT_STAT1_C	0x03da	/* Input Status Register 1  - Color     */
#define	INPUT_STAT1_M	0x03ba	/* Input Status Register 1  - Mono      */
#define	FTR_CTRL_W_C	0x03da	/* Feature Control - Write  - Color     */
#define	FTR_CTRL_W_M	0x03ba	/* Feature Control - Write  - Mono      */
#define	FTR_CTRL_R	0x03ca	/* Feature Control - Read  		*/
#define	VGA_ENABLE	0x03c3	/* VGA Enable Register - Read/Write	*/

#define	SEQ_INDX	0x03c4	/* Sequencer Address Register		*/
#define	SEQ_DATA	0x03c5	/* Sequencer Data Register Port Address */
#define	  SEQ_RESET	  0x00	/* Index of Sequencer Reset Register	*/
#define	  SEQ_CLK_MODE	  0x01	/* Index of Sequencer Clock Mode Reg	*/
#define	  SEQ_WR_MAP_MASK 0x02	/* Index of Sequencer Map Mask Register	*/
#define	  SEQ_CHR_MAP_SEL 0x03	/* Index of Sequencer Char Map Select   */
#define	  SEQ_MEM_MODE	  0x04	/* Index of Sequencer Mem Mode Register */

#define	CRT_INDX_C	0x03d4	/* CRT Controller Address Reg	- Color */
#define	CRT_INDX_M	0x03b4	/* CRT Controller Address Reg	- Mono  */
#define	CRT_DATA_C	0x03d5	/* CRT Controller Data Register	- Color */
#define	CRT_DATA_M	0x03b5	/* CRT Controller Data Register	- Mono  */
#define	  CRT_CUR_ST	  0x0a	/* Index of Cursor Start Register	*/
#define	  CRT_CUR_END	  0x0b	/* Index of Cursor End   Register	*/
#define	  CRT_START_HI	  0x0c	/* Index of crt regen start address hi	*/
#define	  CRT_START_LO	  0x0d	/* Index of crt regen start address low	*/
#define   CRT_CUR_HI	  0x0e	/* Index of Cursor Location High	*/
#define   CRT_CUR_LO	  0x0f	/* Index of Cursor Location Low		*/
#define   CRT_UL_LOC	  0x14	/* Index of underline location register	*/

#define	GRX_INDX	0x03ce	/* Graphic Controller Address Register	*/
#define	GRX_DATA	0x03cf	/* Graphic Controller Data Register	*/
#define	  GRX_SR_ENB	  0x01	/* Index of enable set/rst register	*/
#define	  GRX_ROT	  0x03 	/* Index of data rotate register	*/
#define	  GRX_RD_MAP_SEL  0x04	/* Index of Read Map Select Register	*/
#define	  GRX_MODE	  0x05	/* Index of graphics mode register	*/
#define	  GRX_MISC	  0x06 	/* Index of Miscellaneous Register	*/
#define	  GRX_MASK	  0x08 	/* Index of bit mask register		*/

#define	ATT_INDX	0x03c0	/* Attribute Controller Address Reg	*/
#define	ATT_READ	0x03c1	/* Attribute Controller Input Port 	*/
#define	  ATT_PAL	  0x00	/* first attribute pallette register	*/
#define	  ATT_MODE	  0x10	/* attribute mode control register	*/
#define	  ATT_OSCAN	  0x11	/* overscan color register		*/
#define	  ATT_PLANE	  0x12	/* color plane enable			*/
#define	  ATT_COLOR	  0x14	/* attribute color select register	*/

#define	PEL_INDX_W	0x03c8	/* PEL Index Register - Write		*/
#define	PEL_INDX_R	0x03c7	/* PEL Index Register - Read		*/
#define	PEL_DATA	0x03c9	/* PEL Data Register 			*/
#define	PEL_MASK	0x03c6	/* PEL Mask Register 			*/
#define	DAC_STATE	0x03c7	/* DAC State Register			*/

#define	MONO_BASE	0x03b0	/* base address for mono adaptor	*/
#define	COLOR_BASE	0x03d0	/* base address for color adaptor	*/

/*
 * format of entries in the video parameter array in the EGA/VGA ROM BIOS
 */
struct egaparams {
    char    cols;			/* Columns per screen 		*/
    char    rows;			/* Rows per screen 		*/
    char    pels;	 		/* Pixels per character (width)	*/
    char    pagelen[2];	 		/* Length of a display screen 	*/
    char    seq_p[NSEQ_REGS-1]; 	/* Values for the sequence regs	*/
    char    misc_out;	 		/* Value for misc output reg	*/
    char    crtc_p[NCRT_REGS];		/* Values for CRTC registers	*/
    char    attr_p[NATT_REGS-1];	/* Values for the attribute reg	*/
    char    graphics_p[NGRX_REGS];	/* Values for the graphics regs	*/
};

/*
 * these are the BIOS parameter table indices
 */
#define	EGA_POWERUP	21		/* EGA power-up parameter set	*/
#define EGA_MAXMODE	22		/* maximum valid table index	*/
#define VGA_POWERUP	24		/* VGA power-up parameter set	*/
#define VGA_MAXMODE	31		/* maximum valid table index	*/
kêS ƒ  $        Þ  e‰*7˜ˆ*e‰*     ÿ™Þ  	              äµ  ./usr/include/sys/i386/eth_un_reg.h .h  /*
 *	IBM Personal Computer IX/AT
 *		Version 1.00
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1984, 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Microsoft Corporation
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

/* $Header: if_unreg.h,v 4.1 85/08/29 10:23:35 kris Exp $ */
/* $Source: /ibm/acis/usr/sys_ca/caif/RCS/if_unreg.h,v $ */

/*	SCCSID(@(#)eth_un_reg.h	16.3	LCC)	/* Modified: 21:40:01 9/15/89 */

#if !defined(lint) && !defined(LOCORE)  && defined(RCS_HDRS)
static char *rcsidif_unreg = "$Header: if_unreg.h,v 4.1 85/08/29 10:23:35 kris Exp $";
#endif

/*
 * Ungermann-Bass PC-NIC Ethernet adapter memory map.
 */

#define UN_NUMRBUFS	96
#define UN_LASTRBUF	(UN_NUMRBUFS - 1)
#define UN_RBUFSIZE	128
#define UN_XBSIZE	2048

struct undevice {
	char un_eprom[8192];	/* Ethernet hardware address hidden here */
	char un_hole1[128];
	char un_xsar[2];	/* Transmit starting address register */
	char un_csr;		/* Control/status reg */
	char un_fppepp;		/* Receive buffer pointer regs */
	char un_hole2[124];
	char un_pram[UN_NUMRBUFS]; /* Page ram (status of receive buffers) */
	char un_hole3[32];
	struct {		/* Fujitsu EDLC regs */
		char xstat;		/* Transmitter status */
		char xmask;		/* Transmit interrupt mask */
		char rstat;		/* Receive status */
		char rmask;		/* Receive interrupt mask */
		char tmode;		/* Transmit mode */
		char rmode;		/* Receive mode */
		char reset;		/* Reset latch */
		char tdr1;		/* Time domain reflectometer reg LSB */
		char nodeID[ETH_ADDR_SIZE];	/* Ethernet address (W/O) */
		char res;		/* Reserved */
		char tdr2;		/* T.D.R. register MSB */
	} un_edlc;
	char un_hole4[7792];
	char un_rcvbuf[UN_NUMRBUFS][UN_RBUFSIZE]; /* Receive buffers */
	char un_xmtbuf[2][UN_XBSIZE]; /* Transmit buffers */
};

/*
 *  EPROM locations of interest
 */

/*  wired-in default ethernet address */

#define UN_EADDROFF	0x10

/*
 *  Transmit starting address register (xsar)
 */
#define UN_XMIT(xbuf,addr) {\
	register int dummy;\
	un_addr->un_xsar[1] = (addr) & 0xFF;\
	un_addr->un_xsar[0] = ((addr)>>8 &0x7)|((xbuf)<<3);\
	dummy = un_addr->un_xsar[0];\
}

/*  The following macro clears the "Packet Available" flag */
#define UN_CLRPAV() {register int dummy; dummy = un_addr->un_xsar[1];}
	
/*
 *  Control and status reg (csr)
 */
	/* On writes - it's the control register */
#define UN_TXRIENB	0x80	/* Allow Tx Rdy interrupts */
#define UN_PAVIENB	0x40	/* Allow PAV bit to generate an interrupt */
#define UN_GSFTINT	0x20	/* Generate software interrupt */
#define UN_TIMIENB	0x10	/* Alllow Timer interrupts */
/* bits 0 - 3 ignored */

#define UN_IENABLE	(UN_TXRIENB+UN_PAVIENB)

	/*
	 *  On reads - it's the status register
	 *
	 *  N.B. -- INTERRUPT BITS ARE COMPLEMENTED!
	 *  (i.e. (undevice.csr & UN_TXRINT) == 0 for a Tx Rdy interrupt
	 */

#define UN_TXRINT	0x80	/* Tx Rdy interrupt */
#define UN_PAVINT	0x40	/* PAV (page available) interrupt */
#define UN_SFTINT	0x20	/* software interrupt */
#define UN_TIMINT	0x10	/* timer interrupt */
#define UN_RCVINT	0x08	/* EDLC receiver interrupt */
#define UN_XMTINT	0x04	/* EDLC transmitter interrupt */
#define UN_TPOK		0x02	/* Transmitted packet OK */
#define UN_TXDONE	0x01	/* Transmitter done transmitting */
#define UN_XMITDONE (UN_TPOK+UN_TXDONE)

#define UN_CSRBITS "\20\10TXRDY\7PAV\6SFT\5TIM\4RCV\3XMT\2TPOK\1TXDONE"

/*
 *  Page RAM (status of receive pages)
 */

#define UN_LAST_PAGE	0x80
#define UN_PAGE_LENGTH_MASK	0x7f

/*
 *  Full Page Pointer / Empty Page Pointer (fppepp)
 *
 *  These are the two registers that the driver and the board use
 *  to maintain a circular buffer of received packets.  The driver
 *  writes the FPP to let the board know where the "full" pages start
 *  (so that the board doesn't re-fill them before the driver empties
 *  them).  The driver reads the EPP to determine where the empty
 *  pages start (so that it doesn't read them before the board fills
 *  them).  Since the FPP is write-only and the EPP is read-only, the
 *  2 registers share the same address.
 */

	/* On writes, this register is the FPP */
/*  It should be written with values between 0 and 95 */

	/*
	 *  The most significant bit is the "global interrupt" (re)enable.
	 *  The bit is wiggled off then on to re-enable interrupts.
	 */
#define UN_GLBIENB	(1 << 7)
#define UN_GLOBIENB(p)	un_addr->un_fppepp = p;  /* clears MSB */\
			un_addr->un_fppepp = p | UN_GLBIENB /* sets it */

	/* On reads, it's the EPP */
/*  Should contain values between 0 and 95 */
#define UN_PAGE_MASK	0x7f

	/*  The most significant bit is the Packet Available flag */
#define UN_PAV() (un_addr->un_fppepp & 0x80)

/*
 *  Fujitsu Ethernet Data Link Controller (EDLC) registers
 *
 */

/*  The following constants apply to the xstat and xmask fields: */
	/*	char xstat;		/* Transmitter status */
	/*	char xmask;		/* Transmit interrupt mask */
#define XS_RDY	0x80		/* Transmitter ready for packet */
#define XS_NB	0x40		/* Net busy */
#define XS_XRCV	0x20		/* Transmission received */
#define XS_SHRT	0x10		/* Ethernet is shorted */
#define XS_UFLW 0x08		/* Underflow error occurred */
#define XS_COLL	0x04		/* Collision occurred */
#define XS_16CL	0x02		/* 16 consecutive collisions occurred */
#define XS_EPAR 0x01		/* Parity error occurred */
#define XS_CLEAR (XS_UFLW+XS_COLL+XS_16CL+XS_EPAR)
#define XS_BITS "\20\10XRDY\7NB\6XRCV\5SHRT\4UFLW\3COLL\2CL16\1EPAR"

/*  The next few constants apply to the rstat and rmask fields */
	/*	char rstat;		/* Receive status */
	/*	char rmask;		/* Receive interrupt mask */
#define RS_RPOK 0x80		/* Packet received OK */
#define RS_SHRT 0x08		/* Received short packet */
#define RS_ALGN 0x04		/* Alignment error detected */
#define RS_ECRC 0x02		/* CRC error detected */
#define RS_OFLW 0x01		/* Receive buffer overflow occurred */
#define RS_CLEAR (RS_RPOK+RS_SHRT+RS_ALGN+RS_ECRC+RS_OFLW)
#define RS_ERR  (RS_SHRT+RS_ALGN+RS_ECRC+RS_OFLW)
#define RS_BITS "\20\10RPOK\4SHRT\3ALGN\2ECRC\1OFLW"

	/*	char tmode;		/* Transmit mode */
#define UN_NCOLL() ((un_addr->un_edlc.tmode >>4)&15)
#define TM_IGNP 0x08		/* Ignore parity errors */
#define TM_LBC	0x02		/* Loopback control  - set => no loopback */
#define TM_NORMAL (TM_IGNP+TM_LBC)

	/*	char rmode;		/* Receive mode */
#define RM_NONE	0x00		/* Disable receiver */
#define RM_OURS 0x01		/* Accept ours and broadcast (and some multi)*/
#define RM_MULT 0x02		/* Accept ours and all multicast */
#define RM_ALL	0x03		/* Promiscuous mode -- accept all packets */
#define RM_NORMAL (RM_OURS)
	/*	char reset;		/* Reset latch */
#define RESET_ON 0x80
#define RESET_OFF 0
SFkê6 ‚  $          e‰*7˜ˆ*e‰*     õÁ  	                  ./usr/include/sys/i386/hostconf.h h .h  /*
 *	IBM Personal Computer IX/AT
 *		Version 1.00
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1984, 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Microsoft Corporation
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

/*
 *
 *
 * device driver configuration header file for hostess.c
 *
 * This module is included by conf.c and is responsible for allocating
 * all data structures required by the device driver.  Three device
 * specific pre-processor defined symbols are available for our use:
 *
 *	B_xyz		block major device number (if any)
 *	C_xyz		character major device number (if any)
 *	N_xyz		number of configured controllers
 *	U_xyz		number of configured sub-units
 *
 * (where "xyz" is the device driver prefix)
 *
 */
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)hostconf.h	16.3	LCC)	/* Modified: 21:40:51 9/15/89 */

#include <tty.h>

#define N_HOST 2

struct tty	near host_tty[U_host] = {0};

unsigned char	near hostier[U_host] = {0};
unsigned char	near hostlcr[U_host] = {0};
unsigned char	near hostbaud[U_host] = {0};

int		near hostbase[N_HOST]={	0x500, 0x580	};
int		near hostvecs[N_HOST]={	4, 3	};

		/* flag bits for hard-wired lines */
char		near hostsoftCAR[N_HOST];
\5SkêJ   $        $  e‰*7˜ˆ*e‰*     ²e$  	                  ./usr/include/sys/i386/hostessreg.h .h  /*
 *	IBM Personal Computer IX/AT
 *		Version 1.00
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1984, 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Microsoft Corporation
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */


/*	SCCSID(@(#)hostessreg.h	16.3	LCC)	/* Modified: 21:41:42 9/15/89 */

/* Registers, DLAB=0 */
#define	HOST_RBR	0	/* Rx Buffer Register			*/
#define	HOST_THR	0	/* Tx Holding Register			*/
#define	HOST_IER	1	/* Interrupt Enable Register		*/
#define	HOST_IIR	2	/* Interrupt Identification Register	*/
#define	HOST_LCR	3	/* Line Control Register		*/
#define	HOST_MCR	4	/* Modem Control Register		*/
#define	HOST_LSR	5	/* Line Status Register			*/
#define	HOST_MSR	6	/* Modem Status Register		*/

/* global registers */
#define	HOST_POLL	7	/* Interrupts pending			*/
#define	HOST_MASK	7	/* Interrupts masked			*/

/* Registers, DLAB=1 */
#define	HOST_DLL	0	/* Divisor Latch LSB			*/
#define	HOST_DLM	1	/* Divisor Latch MSB			*/

/* Interrupt Enable Register */
#define	HOST_EDAI	0x01	/* Data Available			*/
#define	HOST_ETHRSI	0x02	/* Tx Holding Register Status		*/
#define	HOST_ERLSI	0x04	/* Rx Line Status			*/
#define	HOST_EMSI	0x08	/* Modem Status				*/

/* Interrupt Identification Register */
#define	HOST_PEND	0x01	/* Interrupt Pending			*/
#define	HOST_IID	0x06	/* Interrupt ID				*/
#define	HOST_MSI	0x00	/* Modem Status Interrupt		*/
#define	HOST_THREI	0x02	/* Tx Holding Register Empty Interrupt	*/
#define	HOST_RDAI	0x04	/* Receiver Data Available Interrupt	*/
#define	HOST_RLSI	0x06	/* Receiver Line Status Interrupt	*/

/* Line Control Register */
#define	HOST_WLS0	0x01	/* Word Length Select Bit 0		*/
#define	HOST_WLS1	0x02	/* Word Length Select Bit 1		*/
#define	HOST_STB	0x04	/* Number of Stop Bits			*/
#define	HOST_PEN	0x08	/* Parity Enable			*/
#define	HOST_EPS	0x10	/* Even Parity Select			*/
#define	HOST_SP		0x20	/* Stick Parity				*/
#define	HOST_BRK	0x40	/* Set Break				*/
#define	HOST_DLAB	0x80	/* Divisor Latch Access Bit		*/

/* Modem Control Register */
#define	HOST_DTR	0x01	/* Data Terminal Ready			*/
#define	HOST_RTS	0x02	/* Request to Send			*/
#define	HOST_ON		(HOST_DTR|HOST_RTS)	/* General "on"		*/

/* Line Status Register */
#define	HOST_DR		0x01	/* Data Ready				*/
#define	HOST_OR		0x02	/* Overrun Error			*/
#define	HOST_PE		0x04	/* Parity Error				*/
#define	HOST_FE		0x08	/* Framing Error			*/
#define	HOST_BI		0x10	/* Break Interrupt			*/
#define	HOST_THRE	0x20	/* Tx Holding Register Empty		*/
#define	HOST_TSRE	0x40	/* Tx Shift Register Empty		*/

#define	HOST_LSR_BITS	"\20\1DR\2OR\3PE\4FE\5BI\6THRE\7TSRE\10???"

/* Modem Status Register */
#define	HOST_DCTS	0x01	/* Delta Clear to Send			*/
#define	HOST_DDSR	0x02	/* Delta Data Set Ready			*/
#define	HOST_TERI	0x04	/* Trailing Edge Ring Indicator		*/
#define	HOST_DRLSD	0x08	/* Delta Rx Line Signal Detector	*/
#define	HOST_CTS	0x10	/* Clear to Send			*/
#define	HOST_DSR	0x20	/* Data Set Ready			*/
#define	HOST_RI		0x40	/* Ring Indicator			*/
#define	HOST_RLSD	0x80	/* Rx Line Signal Detector		*/

#define	HOST_MSR_BITS	"\20\1DCTS\2DDSR\3TERI\4DRLSD\5CTS\6DSR\7RI\10RLSD"

#define	DMSET		0		/* set all modem bits */
#define	DMBIS		1		/* set certain modem bits */
#define	DMBIC		2		/* clear certain modem bits */
#define	DMGET		3		/* get current modem bits */
TIM\kêà à  $        =  o‰*šˆ*o‰*     [K=  	              ¾p  ./usr/include/sys/i386/ibmscsi.h .h .h  #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)ibmscsi.h	1.2    IBM AIX)    /* Modified: 20:02:10 7/15/92 */


/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * ibmscsi.h
 *
 * This file defines all of the various registers, bits and structures for
 * the SPOCK/TRIBBLE card.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	------	-----	---------------------------------------------
 * 0.00		8/20/89	GGS	Moved from scsi.h
 * 0.01		8/14/91 TSB	Model 57SX changes
 *
 */

/*
 * The following is the maximum number of micro-seconds that the card
 * should be busy.
 */
#define	MAX_BUSY_DELAY	400

/*
 * Address Ranges for cards.
 */
#define	MAX_IBM_CARDS	8		/* maximum number of cards	*/
#define	MAX_IBM_DEVS	16		/* maximum number of card devs	*/
#define	CARD_DEV	0x0F
#define	CARD_LUN	7		/* used only by driver		*/
#define	IBM_SCSI_INT	14

#ifdef	DEF_GLOBALS
int	ibm_io_addr[MAX_IBM_CARDS] =
	     {
	     0x3540,
	     0x3548,
	     0x3550,
	     0x3558,
	     0x3560,
	     0x3568,
	     0x3570,
	     0x3578
	     };

#else
extern	int	ibm_io_addr[];
#endif

/*
 * Register Ports
 */
#define	CMDR_LO		0	/* low 8 bits of command register	*/
#define	CMDR_MEDL	1	/* middle low 8 bits of command register*/
#define	CMDR_MEDH	2	/* middle high 8 bits of command reg	*/
#define	CMDR_HI		3	/* high 8 bits of command register	*/
#define	ATTNR		4	/* attention register			*/
#define	BCR		5	/* basic control register		*/
#define	ISR		6	/* interrupt status register		*/
#define BSR		7	/* basic status register		*/

/*
 * Definitions for Attention register (ATTNR)
 */
#define	SIC		(0x01 << 4)	/* start immediate command	*/
#define	SSCBC		(0x03 << 4)	/* start SCB command		*/
#define	EOI		(0x0E << 4)	/* end of interrupt		*/
#define	SLSCBC		(0x0F << 4)	/* start of long SCB command	*/

/*
 * Definitions for Basic Control register (BCR)
 */
#define	AHR		0x80	/* attachment hardware reset		*/
#define	EADMA		0x02	/* enable attachment DMA		*/
#define	ENSI		0x01	/* enable system interrupts		*/

/*
 * Definitions for Interrupt Status register (ISR)
 */
#define	ESCBCC_OK	(0x01 << 4)	/* SCB command complete success	*/
#define	ESCBCC_RETRY	(0x05 << 4)	/* SCB cmd cmplt w/retries	*/
#define	EAHF		(0x07 << 4)	/* Attachment hardware failure	*/
#define	EICC		(0x0A << 4)	/* Immediate Command Complete	*/
#define	ECC_FAIL	(0x0C << 4)	/* Command Complete w/ failure	*/
#define	ECE		(0x0E << 4)	/* Command Error		*/
#define	ESSE		(0x0F << 4)	/* Software Sequencing Error	*/

/*
 * Definitions for Basic Status register (BSR)
 */
#define	CIRF		0x08	/* command interface registers full	*/
#define	CIRE		0x04	/* command interface registers empty	*/
#define	IREQ		0x02	/* interrupt request			*/
#define	BUSY		0x01	/* attachment busy			*/

/*
 * SCSI Command Word Defintions (GEN)
 */
#define	GEN_ND		0x00000080	/* No disconnect		*/
#define	GEN_NS		0x00000040	/* Use async protocol		*/
#define	GEN_RD		0x80000000	/* read from device to system	*/
#define	GEN_WR		0x00000000	/* write from system to device	*/
#define	GEN_ES		0x40000000	/* report TSB status on error only*/
#define	GEN_RE		0x20000000	/* retry enable			*/
#define	GEN_LIST	0x10000000	/* use scatter/gether		*/
#define	GEN_SES		0x04000000	/* suppress exception short	*/
#define	GEN_CACHE	0x00000000	/* allow caching		*/
#define	GEN_NOCACHE	0x02000000	/* disable caching		*/

#define	GEN_NOCHAIN	0x00000000	/* no chaining			*/
#define	GEN_CHAIN	0x00010000	/* permit command chaining	*/

#define	GEN_READ	(GEN_RD | GEN_ES | GEN_RE)
#define	GEN_WRITE	(GEN_WR | GEN_ES | GEN_RE)

/*
 * SCB Commands
 */
#define	SCB_IR		0x00	/* Immediate Reset			*/
#define	SCB_RD		0x01	/* Read Data				*/
#define	SCB_WR		0x02	/* Write Data				*/
#define	SCB_RDVER	0x03	/* Read Verify				*/
#define	SCB_WRVER	0x04	/* Write with Verify			*/
#define	SCB_GCCS	0x07	/* Get command complete status		*/
#define	SCB_RSCSIS	0x08	/* Request SCSI sense			*/
#define	SCB_RDC		0x09	/* Read Device Capacity			*/
#define	SCB_GPOS	0x0A	/* Get POS and Adapter Information	*/
#define	SCB_DINQ	0x0B	/* Device Inquiry			*/
#define	SCB_IFC		0x0C	/* Immediate Feature Control		*/
#define	SCB_PACE	0x0D	/* Immediate DMA Pacing Control		*/
#define	SCB_ASG		0x0E	/* Immediate assign			*/
#define	SCB_ABORT	0x0F	/* Immediate abort			*/
#define	SCB_WABT	0x10	/* write attachment buffer test		*/
#define	SCB_RABT	0x11	/* read attachment buffer test		*/
#define	SCB_IRDT	0x12	/* immediate run diagnostic test	*/
#define	SCB_IRSST	0x13	/* immediate run selected self test	*/
#define	SCB_GDSB	0x14	/* get diagnostic status block		*/
#define	SCB_FU		0x16	/* format unit				*/
#define	SCB_IFP		0x17	/* immediate format prepare		*/
#define	SCB_RAB		0x18	/* re-assign block			*/
#define	SCB_COPY	0x19	/* copy data				*/
#define	SCB_MLBA	0x1A	/* specify max LBA command		*/
#define	SCB_RALRAM	0x1C	/* read attachment local ram		*/
#define	SCB_WALRAM	0x1D	/* write attachment local ram		*/
#define	SCB_OTHER	0x1F	/* send other SCSI command		*/
#define	SCB_TARGET	0x20	/* enable/end target mode		*/

#define	CMD_IMMED	0x0400
#define	CMD_SCB		0x1C00
#define	CMD_CP		0x1E00
#define CMD_OTH		0x2400

#define	CMD_ASSGN_TM	0x80000000	/* indicates assign for target mode */
#define	CMD_UNASSIGN	0x00800000	/* reset the assignment		*/

/*
 * Immediate Commands
 */
#define	CMD_RESET	(SCB_IR | CMD_IMMED)
#define	CMD_ABORT	(SCB_ABORT | CMD_IMMED)
#define	CMD_ASSIGN	(SCB_ASG | CMD_IMMED)
#define	CMD_PACE	(SCB_PACE | CMD_IMMED)
#define	CMD_IFC		(SCB_IFC | CMD_IMMED)
#define	CMD_IFP		(SCB_IFP | CMD_IMMED | 0x55AA0000)
#define	CMD_IRDT	(SCB_IRDT | CMD_IMMED)
#define	CMD_IRSST	(SCB_IRSST | CMD_IMMED)

#define	asgparms(lun,pun,dev)	(((lun << 8) | (pun << 4) | dev) << 16)
#define	pacefctr(x)	(x << 16)
#define	ftrctl(drate,gtimeout)	(((drate << 13) | gtimeout) << 16)

/*
 * SCSI Data Rates
 */
#define	DR_400MB	0x01	/* 4.00 MB/s				*/
#define	DR_333MB	0x02	/* 3.33 MB/s				*/
#define	DR_286MB	0x03	/* 2.86 MB/s				*/
#define	DR_250MB	0x04	/* 2.50 MB/s				*/
#define	DR_222MB	0x05	/* 2.22 MB/s				*/
#define	DR_200MB	0x06	/* 2.00 MB/s				*/
#define	DR_182MB	0x07	/* 1.82 MB/s				*/

/*
 * SCB Commands
 */
#define	CMD_READ	(SCB_RD | CMD_SCB | GEN_READ)
#define	CMD_RDVER	(SCB_RDVER | CMD_SCB | GEN_READ | GEN_NOCACHE)
#define	CMD_WRITE	(SCB_WR | CMD_SCB | GEN_WRITE)
#define	CMD_WRVER	(SCB_WRVER | CMD_SCB | GEN_WRITE)
#define	CMD_COPY	(SCB_COPY | CMD_CP | GEN_ES | GEN_RE | GEN_NOCACHE)
#define	CMD_FU		(SCB_FU | CMD_SCB | GEN_ES | GEN_RE | GEN_NOCACHE)
#define	CMD_RABLK	(SCB_RAB | CMD_SCB | GEN_ES | GEN_RE | GEN_NOCACHE)
#define	CMD_MAXLBA	(SCB_MLBA | CMD_SCB | GEN_ES | GEN_RE | GEN_NOCACHE)
#define	CMD_OTHER	(SCB_OTHER | CMD_OTH | GEN_NOCACHE)
#define	CMD_GCCS	(SCB_GCCS | CMD_SCB | GEN_READ | GEN_NOCACHE)
#define	CMD_SENSE	(SCB_RSCSIS | CMD_SCB | GEN_READ | GEN_NOCACHE)
#define	CMD_GPOS	(SCB_GPOS | CMD_SCB | GEN_READ | GEN_NOCACHE)
#define	CMD_GCAP	(SCB_RDC | CMD_SCB | GEN_READ | GEN_NOCACHE)
#define	CMD_INQ		(SCB_DINQ | CMD_SCB | GEN_READ | GEN_NOCACHE)

#define	CMD_RABT	(SCB_RABT | CMD_SCB | GEN_READ | GEN_NOCACHE)
#define	CMD_WABT	(SCB_WABT | CMD_SCB | GEN_WRITE | GEN_NOCACHE)
#define	CMD_RALRAM	(SCB_RALRAM | CMD_SCB | GEN_READ | GEN_NOCACHE)
#define	CMD_WALRAM	(SCB_WALRAM | CMD_SCB | GEN_WRITE | GEN_NOCACHE)
#define	CMD_GDSB	(SCB_GDSB | CMD_SCB | GEN_READ | GEN_NOCACHE)
#define	CMD_TARGET	((SCB_TARGET | CMD_SCB | GEN_READ | GEN_NOCACHE) & ~GEN_ES)

/*
 * Values / Masks for status/mode field in the target SCB command.
 */
#define	SCB_TARG_EC	0x80	/* end of command			*/
#define	SCB_TARG_RO	0x40	/* report over-runs			*/
#define	SCB_TM_AUTO	0x01	/* Automatic mode			*/
#define	SCB_TM_NON_INT	0x03	/* Non-Interactive mode			*/
#define	SCB_TM_TRANS	0x02	/* Transparent mode			*/
#define	SCB_TM_DISABLE	0x00	/* Disable target mode			*/

struct	scb_args
	     {
	     ushort	blk_count;
	     ushort	blk_length;
	     };

/*
 * SCB
 */
struct	scb
	     {
	     ulong	cmd;
	     daddr_t	lba;
	     paddr_t	buff_adr;
	     ulong	bufflen;
	     paddr_t	tsb_adr;
	     paddr_t	scb_chain;
	     union
		  {
		  struct scb_args	cmd_args;
		  struct scsi_0		cmd_other0;
		  struct scsi_1		cmd_other1;
		  struct scsi_5		cmd_other5;
		  struct scsi_6		cmd_other6;
		  }	scb_args;
	     };

typedef	struct	scb	SCB;

/*
 * Scatter/Gather block definition
 */
#define	MAX_SCAT_GATH_ENTS	16	/* max len of scatter/gather list */

struct	scat_gath_ent
	     {
	     paddr_t	buff_adr;
	     ulong	buff_len;
	     };

typedef	struct	scat_gath_ent	SCAT_GATH_ENT;

/*
 * Termination Status Block
 */
struct	tsb
	     {
	     ushort	scb_status;
	     ushort	retry_counts;
	     ulong	res_byte_count;
	     paddr_t	scat_gath_offset;
	     ushort	rem_len;	/* this value == 12		*/
	     uchar	scsi_status;
	     uchar	cmd_status;
	     uchar	dev_error;
	     uchar	cmd_error;
	     uchar	diag_err_mod;
	     ushort	cache_info;
	     paddr_t	last_scb_adr;	/* addr of last SCB processed	*/
	     };

typedef	struct	tsb	TSB;

/*
 * SCB Status Bit definitions
 */
#define	SCBS_END	0x0001	/* SCB ended (no error)			*/
#define	SCBS_SHORT	0x0002	/* Short record exception		*/
#define	SCBS_CREJ	0x0004	/* Invalid command rejected		*/
#define	SCBS_SREJ	0x0008	/* SCB rejected				*/
#define	SCBS_SCHK	0x0010	/* SCB Specification check		*/
#define	SCBS_LONG	0x0020	/* Long record exception		*/
#define	SCBS_HALT	0x0040	/* SCB Halted (Error/End chain)		*/
#define	SCBS_INTQ	0x0080	/* SCB Interrupt queued			*/
#define	SCBS_ASTAT	0x0100	/* Additional Status available		*/
#define	SCBS_DDSA	0x0200	/* Device dependent status available	*/
#define	SCBS_DNI	0x0800	/* Device not initialized		*/
#define	SCBS_MJEXCP	0x1000	/* Major exception occured		*/

/*
 * Retry count definitions
 */
#define	RETRY_ARI	0x8000	/* attachment retry invoked		*/
#define	RETRY_ABCR	0x0040	/* attachment buffer check retry	*/
#define	RETRY_SICR	0x0020	/* system interface check retry		*/
#define	RETRY_DFALT	0x0010	/* device fault retry			*/

#define	get_num_retries(x)	((x)->retry_counts & 0x0007)

#define	get_scsi_status(x)	(((x)->scsi_status & 0x001E) >> 1)

/*
 * SCSI status codes
 */
#define	SCSI_OK		0x00	/* good status (no error)		*/
#define	SCSI_CHK	0x01	/* check condition (error)		*/
#define	SCSI_BUSY	0x04	/* busy (command rejected)		*/
#define	SCSI_INTOK	0x08	/* intermediate good (no error)		*/
#define	SCSI_INTOK2	0x0A	/* intermediate condition met (no error)*/
#define	SCSI_RESCFLT	0x0C	/* reservation conflict			*/

/*
 * SCSI command status codes
 */
#define	CMDS_CCOK	0x01	/* command completed with success	*/
#define	CMDS_CCOKR	0x05	/* command completed with retries	*/
#define	CMDS_CPART	0x06	/* command partially complete		*/
#define	CMDS_ADF	0x07	/* attachment diagnostic failure	*/
#define	CMDS_ARCE	0x08	/* attention request code error		*/
#define	CMDS_ABORTED	0x09	/* abort complete			*/
#define	CMDS_DRC	0x0A	/* device reset complete		*/
#define	CMDS_EOIE	0x0B	/* End of Interrupt Error		*/
#define	CMDS_CCERR	0x0C	/* Command completed with failure	*/
#define	CMDS_DMAE	0x0D	/* DMA error				*/
#define	CMDS_SCBE	0x0E	/* SCB Error				*/
#define	CMDS_SEQ	0x0F	/* command sequence error		*/

/*
 * Device Error Codes
 */
#define	DEVE_OK		0x00	/* no error				*/
#define	DEVE_RESET	0x01	/* SCSI bus reset			*/
#define	DEVE_IFAULT	0x02	/* SCSI interface fault			*/
#define	DEVE_SELTO	0x10	/* selection timeout			*/
#define	DEVE_UBF	0x11	/* unexpected bus free			*/
#define	DEVE_MMR	0x12	/* mandatory message rejected		*/
#define	DEVE_INV_PHASE	0x13	/* Invalid SCSI Phase sequence		*/
#define	DEVE_SLRE	0x20	/* Short Length Record Error		*/

/*
 * Command Error Codes
 */
#define	CMDE_OK		0x00	/* no error				*/
#define	CMDE_ISCBP	0x01	/* invalid SCB parameter		*/
#define	CMDE_CNSUP	0x03	/* command not supported		*/
#define	CMDE_CABTS	0x04	/* command aborted by system		*/
#define	CMDE_CRJBT	0x05	/* command rejected - buffer test	*/
#define	CMDE_CRJADF	0x06	/* command rejected - attch diag failed	*/
#define	CMDE_FRMTRJ	0x07	/* format rejected - sequence error	*/
#define	CMDE_ARJCIP	0x08	/* assign rejected - command in progress*/
#define	CMDE_ARJDAA	0x09	/* assign rejected - device assigned	*/
#define	CMDE_CRJNA	0x0A	/* cmd rejected - dev not assigned	*/
#define	CMDE_CRJMXLBA	0x0B	/* cmd rejected - Max LBA exceeded	*/
#define	CMDE_CRJADREX	0x0C	/* cmd rejected - address range exceeded*/
#define	CMDE_INVDEV	0x13	/* invalid device for command		*/
#define	CMDE_AHWE	0x20	/* attachment hardware error		*/
#define	CMDE_GLBLTO	0x21	/* global command timeout detected	*/
#define	CMDE_DMAERR	0x22	/* DMA Error				*/
#define	CMDE_BADBUFF	0x23	/* Attachment buffer failure		*/
#define	CMDE_CABTC	0x24	/* command aborted by card		*/

/*
 * POS Information Status Block
 */
struct	posisb
	     {
	     ushort	card_id;
	     uchar	pos_reg3;
	     uchar	pos_reg2;
	     uchar	int_level;
	     uchar	pos_reg4;
	     ushort	rev_level;
	     uchar	luns_pdev;
	     uchar	max_devs;
	     uchar	pace_factr;
	     uchar	max_ldevs;
	     uchar	max_eoi2noi;
	     uchar	max_busy;
	     ushort	cache_status;
	     ushort	retry_status;
	     };

#define	SPOCK_ID	0x8EFF		/* ID of SPOCK attachment	*/
#define	TRIBBLE_ID	0x8EFE		/* ID of TRIBBLE attachment	*/
#define MSP_SCSI_ID	0x8EFD		/* ID of MSP's version of SPOCK	*/
#define MIDWAY_ID	0xFEE2		/* ID of Model 57SX planar	*/
#define CATCAY_ID	0xFEE6		/* ID of Model 56SX planar	*/
#define CANARY2_ID	0xFEE0		/* ID of Model 57 planar	*/
#define CANARY1_ID	0xFEE1		/* ID of Model 56 planar	*/
#define BERMUDA2_ID	0xFEDE		/* ID of Model 77 planar	*/
#define BERMUDA1_ID	0xFEDF		/* ID of Model 76 planar	*/

/*
 * Definitions for POS reg 2
 */
#define	pos_romaddr(x)	(((x) & 0xF0) >> 4)
#define	get_romaddr(x)	pos_romaddr((x)->pos_reg2)
#define	ROM_C000	0x00
#define	ROM_C200	0x01
#define	ROM_C400	0x02
#define	ROM_C600	0x03
#define	ROM_C800	0x04
#define	ROM_CA00	0x05
#define	ROM_CC00	0x06
#define	ROM_CE00	0x07
#define	ROM_D000	0x08
#define	ROM_D200	0x09
#define	ROM_D400	0x0A
#define	ROM_D600	0x0B
#define	ROM_D800	0x0C
#define	ROM_DA00	0x0D
#define	ROM_DC00	0x0E

#define	pos_ioaddr(x)	(((x) & 0x0E) >> 1)
#define	get_ioaddr(x)	pos_ioaddr((x)->pos_reg2)
#define	AIO_3540	0x00
#define	AIO_3548	0x01
#define	AIO_3550	0x02
#define	AIO_3558	0x03
#define	AIO_3560	0x04
#define	AIO_3568	0x05
#define	AIO_3570	0x06
#define	AIO_3578	0x07

#define	pos_carden(x)	((x) & 0x01)
#define	get_carden(x)	pos_carden((x)->pos_reg2)

#define	pos_scsiid(x)	(((x) & 0xE0) >> 5)
#define	get_scsiid(x)	pos_scsi_id((x)->pos_reg3)
#define	pos_is_fair(x)	((x) & 0x10)
#define	get_is_fair(x)	pos_is_fair((x)->pos_reg3)
#define	pos_arblev(x)	((x) & 0x0F)
#define	get_arblev(x)	pos_arblev((x)->pos_reg3)
#define	pos_romen(x)	((x) & 0x02)
#define	get_is_romen(x)	pos_romen((x)->pos_reg4)

/*
 * Definitions for revision level
 */
#define	slot_size(x)		(((x)->rev_level & 0xf000) >> 12)
#define	ucode_rev_level(x)	((x)->rev_level & 0x0fff)

/*
 * Definitions for slot size.
 */
#define	SCSI_IN_32	0	/* card is in a 32 bit slot		*/
#define	SCSI_IN_16	1	/* card is in a 16 bit slot		*/

/*
 * uCode revision levels when Target mode is supported.
 */
#define	SPOCK_TARGET_OK		6	/* level when target mode works	*/
#define	TRIBBLE_TARGET_OK	0x10	/* level when target mode works */

/*
 * Format Unit Defect list block
 */
struct	fudl
	     {
	     uchar	reserved;
	     uchar	bck_ctl;
	     uchar	msb_list_len;
	     uchar	lsb_list_len;
	     };

#define	FU_BCKFMT	0x02		/* enables background formatting */

#define	FU_SCB_FD	0x0010		/* defect list supplied		*/
#define	FU_SCB_CL	0x0008		/* complete list supplied	*/

#define	set_interleave(x)	((x) << 16)
I Phasekêf g  $        «G  j‰*8˜ˆ*j‰*     ‰«G  
              “  ./usr/include/sys/i386/initab.h 
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)initab.h	16.4	LCC)	/* Modified: 18:51:07 12/6/89 */

/*
* Copyright (C) 1988, 1989, Locus Computing Corporation
 * All Rights Reserved
 */

/*
*******************************************************************************
**      Reproduction or utilization of this source in whole or in part
**      is forbidden without the written consent of TITN Inc.
****************************************************************************
**      static char SccsId[] = "@(#)initab.h    3.0     08/24/87";
*******************************************************************************
**                      (c) Copyright TITN,Inc  1986
**                          All Rights Reserved
*******************************************************************************
**
**      FILE NAME               : INITAB.H
**
**      FUNCTION LIST           :
**
**      OPERATION               : contains the definitions for the
**                                      initialization table for X.25
**
*/
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
 
 
/*
**
**      The initialization table consists of 6 sections, three of which
**      form one complete table per line.  The design is such that a default
**      start up table for 1 line (usuallly line 0) and is to be compiled into
**      the code.
**      Once X.25 is running, new table information for frame and packet can be
**      downloaded for any line in the system includeing the line 0, the
**      default line.  The tables for the switch and the monitor sections
**      are not modifiable, however.
**      For multi-line systems, an array of the structures ini_struct is
**      devised, the size of which is declared by the macro "MAXLINES".
**      A reasonable size for each table (one per line) is < 512bytes,
**      which will include a buffer for the link area.
**
**      The link area is an empty array , designed to allow for flexibility
**      in the initialization table.  In the case of the monitor, it could
**      be configured to hold the priority table.  For packet, it can hold
**      the pvc subtable, and thus be an array of structrues.
**      This section is refered to by an offset from the start of the
**      lnk_tabl element.
*/
 
 
/*
**      This is an example of how the table should layout in memory.
**      Since it is declared as an array of structures, all blocks should
**      be contiguous, but this is not a requirement.
**
**                      |-----------------------|
**                      |     monitor section   |
**                      |-----------------------|
**                      |     switch/adaptor    |
**                      |-----------------------|
**                      |     lms section       |
**                      |-----------------------|
**                      |      link area        |
**                      |-----------------------|
**----> LINE 0          |                       |
**                      |     frame section     |
**                      |-----------------------|
**                      |     packet section    |
**                      |                       |---|
**                      |-----------------------|   |
**                      |             data|data |<--|
**                      |    link area          |
**                      |-----------------------|
**----> LINE 1          |                       |
**                      |     frame section     |
**                      |-----------------------|
**                      |     packet section    |
**                      |                       |---|
**                      |-----------------------|   |
**                      |             data|data |<--|
**                      |    link area          |
**                      |-----------------------|
*/
 
#ifndef MAXLINES
#define MAXLINES 2                     /* the number of lines in the system */
                                        /* a SYSTEM wide global!! */
#endif
 
#define FILL    52                     /* link table area for packet/frame */
#define FILLM   128                    /* link table area for monitor/switch */
 
#define UBYTE	unsigned char
#define UWORD 	unsigned short
#define ULONG	unsigned long

/* these two macros should be altered to either
** accomidate the size of the area needed,
** or to fill out the table to some multiple
**    of 128
*/
 
/*      These two structs make up the inviolate region of the table */
struct mon_struc {                     /* these pertain to monitor
                                          initialization */
    UWORD buff_offset;                 /* offset into the fill area for pool
                                          buffer info */
    UWORD prior_offset;                /* order of priority of processes */
    UBYTE num_pools;                   /* number of pools to generate */
    UBYTE padding_1;                   /* word allignment padding */
    UWORD num_eventcells;              /* number of event cells to gernerat */
    UBYTE shrt_tmouts;                 /* number of short timeouts */
    UBYTE padding_2;                   /* word allignment padding */
    UWORD lng_tmouts;                  /* number of long timeouts */
    UBYTE reserved_1;                  /* reserved. must be 0 */
    UBYTE plm_0;                       /* Physical to logical mapping line 0 */
    UBYTE plm_1;                       /* Physical to logical mapping line 1 */
    UBYTE u_mn1_def;                   /* user defined variables */
};
 
struct swit_struc {                    /* this contains switch&adaptor values */
 
    UBYTE glun;                        /*  level 3(packet) server lun number */
    UBYTE g2lun;                       /*  level 2 (frame) server lun number */
    UBYTE lo_vc;                       /*  Lowest lun for virtual circuits */
    UBYTE totl_lun;                    /*  total num of luns/virtual circuts */
    UBYTE incall_num;                  /*  num of incomming calls */
    UBYTE adapt_df;                    /*  default adapter number */
    UBYTE lin_df;                      /* default line number to use */
    UBYTE reserved_1;                  /*  reserved byte. Must be 0 */
    UBYTE hdr_buf;                     /*  YES to allow open if server closed */
    UBYTE reserved_2;                  /*  reserved byte. must be 0. */
    UBYTE tmout_buf;                   /*  time out, buff allocation */
    UBYTE eol_adapt;                   /*  end of line char for adaptor */
    UBYTE eoh_adapt;                   /*  end of host char for adaptor */
    UBYTE eon_adapt;                   /*  end of net char for adaptor */
    UBYTE crmod;                       /* x29 carriage return mode*/
    UBYTE xraw;                        /* x29 raw io */
    UBYTE nb_flag;                     /* number of x29 flags */
    UBYTE io_parm_len;                 /* x29 length of the io param table */
    UBYTE io_parm;                     /* x29 offset to the io param table */
    UBYTE io_getc_len;                 /* x29 length of the getc table */
    UBYTE io_getc;                     /* x29 offset to the getc table */
    UBYTE term_off;                    /* offset to terminal characteristics */
    UBYTE maxid_sz;
    UBYTE u_1swit;
    UWORD max_sna;
    UBYTE num_uucp;                     /* number of lun used for uucp */
    UBYTE offset_uucp;                  /* offset to fill area    */
    UBYTE u_2swit;                      /* user definable parameter */
    UBYTE u_3swit;                      /* user definable parameter */
    UBYTE pad_break;                    /* PAD break character */
    UBYTE pad_recall;                   /* PAD recal character */
};
 
#ifdef LMS
struct lms_g_struc {
/*
**  Inviolate part of LMS intialization table
*/
 
        UWORD   max_hex;                /* Maximum data to display */
        UBYTE   type_lms;               /* Host or port */
        UBYTE   lms_validation;         /* LMS used or not (g_lms_used) */
        UBYTE   lms_fvd ;               /* Default frame validation */
        UBYTE   lms_pvd ;               /* Default packet validation */
        UWORD   lms_fmd ;               /* Default frame mask */
        UWORD   lms_pmd ;               /* Default packet mask */
        UBYTE   trans_spd;              /* async transmission speed */
        UBYTE   parity;                 /* async parity */
        UBYTE   wrd_size;               /* async word size */
        UBYTE   u_lms1;                 /* user defined variables */
        UBYTE   u_lms2;                 /* user defined variables */
        UBYTE   u_lms3;                 /* user defined variables */
};
#endif

struct fram_struc {                    /* frame initialization (downloadable)
                                       */
    UWORD window;                      /* window size of the frame */
    UBYTE max_recvbuf;                 /* max number of receive bufs */
    UBYTE min_recvbuf;                 /* min number of receive bufs */
    UBYTE trans_spd;                   /* transmission speed on the line */
    UBYTE fram_pad_1;
    UWORD t1_tmout;                    /* t1 time out value */
    UBYTE t4_tmout ;                   /* t4 time out value (ISO) */
    UBYTE n2_rep;                      /* n2 repatition rate */
    UBYTE connect_md;                  /* connection mode */
    UBYTE retry_counter;
    UBYTE dcd_p_tm ;                   /* DCD polling timer */
    UBYTE dcd_p_nb ;                   /* retry counter of DCD polling */
    UBYTE acu_mode ;                   /* ACU operation mode */
    UBYTE acu_timer ;                  /* the ACU operation timer */
 
    UBYTE term_md;                     /* terminal mode */
    UBYTE t3_tmout;                    /* SABM repeat rate after n2 */
    UBYTE clk_md;                      /* internal or external clock */
    UBYTE lap_md;                      /* LAP or LAPB */
    UBYTE modulo_f;                    /* frame level modulo number */
    UBYTE xid_p1;                      /* xid p1 time out */
    UBYTE xid_c2;                      /* xid c2 rep rate */
    UBYTE min_freebuf;                 /* RNR minimum number of free buffers */
    UBYTE to_busy;                     /* RNR short of buffers, busy timeout value */
    UBYTE frame_fifo_len;              /* Frame fifo length */
    UBYTE acu_xioup_timeout;           /* user definable frame parameter */
    UBYTE frame_feature;               /* frame feature control */
    UBYTE frame_pad2[16];              /* padding */
};
 
struct pak_struc {                     /* packet initialization */
    UWORD line_type;                   /* type of line */
    UWORD pak_siz;                     /* max size of packet to receive */
    UWORD hi_chan;                     /* highest channel number + 1     */
    UWORD lo_pvc_chan;                 /* lowest pvc channel number */
    UWORD num_pvc;                     /* number of pvc's */
    UWORD lo_insvc;                    /* lowest incomming svc channel */
    UWORD in_num_svc;                  /* number of incomming svc's */
    UWORD lo_svc2;                     /* lowest 2 way svc channel */
    UWORD num_svc2;                    /* number of 2 way svc's */
    UWORD lo_outsvc;                   /* lowest outgoing svc channel */
    UWORD out_num_svc;                 /* number of outgoing svc's */
    UWORD rx_pkt_size;                 /* default length of input data pak
                                          (SVC) */
    UWORD tx_pkt_size;                 /* default length of output data (SVC)
                                       */
    UWORD rx_n_pkt;                    /* max input length of data packet (SVC)
                                          */
    UWORD tx_n_pkt;                    /* max output lenght of data packet
                                          (SVC) */
    UWORD rx_win_size;                 /* default len of in window (SVC) */
    UWORD tx_win_size;                 /* default len of out window (SVC) */
    UWORD rx_n_win;                    /* max in window size (SVC) */
    UWORD tx_n_win;                    /* max out window size (SVC) */
    UWORD pdn_code;                    /* code for public data network (0x3110
                                          for telenet) */
    UWORD t20_tmout;                   /* duration of t20 timer */
    UWORD t21_tmout;                   /* duration of t21 timer */
    UWORD t22_tmout;                   /* duration of t22 timer */
    UWORD t23_tmout;                   /* duration of t23 timer */
    UWORD t28_tmout;                   /* duration of t28 timer */
    UWORD t24_tmout;                   /* duration of t24 timer */
    UWORD t25_tmout;                   /* duration of t25 timer */
    UWORD t26_tmout;                   /* duration of t26 timer */
    UWORD pvc_offset;                  /* flow control for  pvc use (PVC) */
    UBYTE pkt_feat1;
    UBYTE pkt_feat2;
    UBYTE pkt_feat3;
    UBYTE modulo;                      /* mod 8 = 0, mod 128=1 */
    UBYTE ccitt_suport;
    UBYTE negotiation;                 /* throughput et flow ctrl nego */
    UBYTE call_forbid;                 /* forbid incoming calls */
    UBYTE out_call_bar;                /* forbid outgoing calls */
    UBYTE fast_select;                 /* authorize fast select */
    UBYTE flow_ctrl;                   /* authorize flow control */
    UBYTE d_bit;                       /* authorize d bit usage (SVC) */
    UBYTE max_reset;                   /* max number of reset packets */
    UBYTE max_clear;                   /* max number of clear packets */
    UBYTE max_regist;                  /* max number of registration packet */
    UBYTE max_restart;                 /* max restart pkts to send til VC fail */
    UBYTE rx_def_thru;                 /* rx def throughput */
    UBYTE tx_def_thru;                 /* tx def throughput */
    UBYTE rx_max_thru;                 /* rx max throughput for negotiation */
    UBYTE tx_max_thru;                 /* tx throughput for negotiation */
    UBYTE sndrest;                     /* indicates restart sent on line up */
    UBYTE pvc_lcn_mode;                /* user definable packet parameters */
    UBYTE line_protocol;               /* user definable packet parameters */
    UBYTE u_pak1_def;                  /* user definable packet parameters */
    UBYTE u_pak2_def;                  /* user definable packet parameters */
    UBYTE cug;                          /* closed user group selection */
    UBYTE bcug;                         /* Bilateral cug selection */
    UBYTE rev_charging;                 /* reverse charging acceptance */
    UBYTE datapac ;
    UBYTE registration ;                /* on line registration facility */
    UBYTE local_charg_prev ;            /* local charging prevention */
    UBYTE min_through;
    UBYTE max_through;
    ULONG facs_map;
    UBYTE min_pkt_sz;
    UBYTE max_pkt_sz;
    UBYTE packet_pad[14];
};
 
/*
**      this structure is overlayed on the fill area for pvc use
**      (the pvc subtable referenced by packet (pak_struc.pvc_offset).
*/
 
struct pvc_struc {
    UWORD process;                     /* process number for the pvc */
    UWORD lun;                         /* lun number that is a pvc */
    UWORD rec_max;                     /* maximum receive packet length */
    UWORD send_max;                    /* maximum send packet length */
    UWORD rec_win;                     /* maximum window size for receiving */
    UWORD send_win;                    /* maximum window size for sending */
    UWORD d_bit;                       /* d bit authorized for this pvc (1|0)
                                       */
    UWORD flow_cntrl;                  /* flow control authorized for this pvc
                                          (1|0) */
};
 
 
/*
**      this structure is overlayed on the monitor fill area for pool buffer
**      use.  The index into the fill area is equal to the pool number being
**      initialized.
*/
 
struct pool_buf {
    UWORD size_buf;                    /* size of each buffer in the pool */
    UWORD buf_num;                     /* number of buffers to allocat for that
                                          pool */
    UWORD size_buf_1;
    UWORD num_in_pool_1;
    UWORD size_buf_2;
    UWORD num_in_pool_2;
    UWORD size_buf_3;
    UWORD num_in_pool_3;
    UWORD size_buf_4;
    UWORD num_in_pool_4;
    UWORD size_buf_5;
    UWORD num_in_pool_5;
    UWORD size_buf_6;
    UWORD num_in_pool_6;
    UWORD size_buf_7;
    UWORD num_in_pool_7;
    UWORD size_buf_8;
    UWORD num_in_pool_8;
};
 
 
 
/*
**      the two structures templates declared here are used by initab.c
**      and all the init processes.  They define the two segments of the
**      initialization area, the monitor/switch section, (inviolate) and the
**      packet/frame/lms area (dynamic).
*/
 
struct monswt {
    struct mon_struc    mon_tabl;      /* monitor info */
    struct swit_struc   swit_tabl;     /* switch info */
#ifdef LMS
    struct lms_g_struc  lms_g_tabl;    /* lms global info */
#endif
    UWORD               mlnk_tabl[FILLM];/* link area */
};
 
 
struct ini_struct {
    struct fram_struc   frm_tabl;      /* frame info */
    struct pak_struc    pak_tabl;      /* packet info */
    UWORD               lnk_tabl[FILL];/* link area */
};
 
 
/*
**      These define SOME of the network types
**      They basically relate to the manner in which REJ packets are
**      replied to.  In the USA, (Telenet to a large part), a SABM
**      is sent.  In Europe (TRANSPAC) an FRMR and then a SABM is sent.
*/
 
#define         TYPE_TRANSPAC           0x01
#define         TYPE_X25                0x02
#define         TYPE_TELENET            0x83
#define         TYPE_DDN                0x84
#define         TYPE_PSS                0x05
 
#define         USA_MSK                 0x80

/*
****************************************************************************
**      Reproduction or utilization of this source in whole or in part
**      is forbidden without the written consent of TITN Inc.
****************************************************************************
*/
es rekêl €  $        À  f‰*8˜ˆ*f‰*     ÔÁÀ  	                  ./usr/include/sys/i386/intr86.h /*
 *	IBM Personal Computer AIX/PS2
 *		Version 1.00
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1988, 1989 IBM Corp.
 *	All Rights Reserved
 */

#ifndef	_h_INTR86
#define	_h_INTR86

H_SCCSID(@(#)intr86.h	16.4	LCC)	/* Modified: 14:44:40 7/27/90 */

#define NUM_SPLLEVELS	8	/* 8 Priority levels 0-7 */

/* Priority levels for various events/resources */
#define PLVL_HIGH	7	/* No interupts at this level */
#define PLVL_CLKONLY	6	/* Mask out all but the clock */
#define PLVL_IMP	6	/* Mask out network devices */
#define PLVL_BLKIO	6	/* Mask out devices which use the buffer pool */
#define PLVL_CLIST	5	/* Mask out devices which mess with clists */
#define PLVL_KEYBRD	3	/* Mask out the console keyboard */
#define PLVL_MISC	2	/* Mask out miscellaneous devices */
#define PLVL_SWINTR	2	/* Mask out VAX simulated Software Interrupts */
#define PLVL_ZERO	0	/* Allow all interrupts */

/* intrattach() level request masks */
#define SPL_HIGH	(1 << PLVL_HIGH)
#define SPL_CLKONLY	(1 << PLVL_CLKONLY)
#define SPL_IMP		(1 << PLVL_IMP)
#define SPL_BLKIO	(1 << PLVL_BLKIO)
#define SPL_CLIST	(1 << PLVL_CLIST)
#define SPL_KEYBRD	(1 << PLVL_KEYBRD)
#define SPL_MISC	(1 << PLVL_MISC)
#define SPL_SWINTR	(1 << PLVL_SWINTR)


struct intrshare {
	int (*intr_handler)();		/* The interrupt handler */
	struct intrshare *intr_next;	/* Pointer to the next handler */
					/*   for this interrupt level. */
	int intr_plevel;		/* Requested spl level */
};

#endif /* _h_INTR86 */
kêºØ   $        “  f‰*C˜ˆ*f‰*     h“                    ./usr/include/sys/i386/itio.h h /*
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright IBM Corp. 1989, 1990 
 *	All Rights Reserved
 *
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif
H_SCCSID(@(#)itio.h	1.1.1.1	AIX)	/* Modified: 3/4/91 12:32:04 */

#ifndef	_h_ITIO
#define	_h_ITIO

/*
 * definitions for internal tape backup unit io control commands
 *
 * note:  the internal tape backup unit device driver also supports some
 * of the mtio.h and stio.h io control commands.
 */

/* internal tape backup unit specific io control commands */
#define ITGETTYPE	(('i'<<8)|1)	/* return the tape/drive type code */
#define ITGETHEADER	(('i'<<8)|2)	/* return the tape header */
#define ITPUTHEADER	(('i'<<8)|3)	/* write the tape header */
#define ITGETFMK	(('i'<<8)|4)	/* return the tape filemark map */
#define ITPUTFMK	(('i'<<8)|5)	/* write the tape filemark map */
#define ITFMTON		(('i'<<8)|6)	/* enable servoing and formatting */
#define ITFMTOFF	(('i'<<8)|7)	/* disable servoing and formatting */
#define ITSERVO		(('i'<<8)|8)	/* write servo tracks */
#define ITFORMAT	(('i'<<8)|9)	/* format tape */
#define ITCERTIFY	(('i'<<8)|10)	/* certify tape */
#define ITGETPHYSBLK	(('i'<<8)|11)	/* get physical block */

/* Structure for ITGETPHYSBLK ioctl() */
struct itphysio {
	long it_blkno;			/* Number of physical block to read */
	char *it_buf;			/* Pointer to user data buffer */
	unsigned int it_bufsize;	/* Size of the user buffer */
};

#endif _h_ITIO

sted kêžì ~  $        Ø	  f‰*9˜ˆ*f‰*     ÀµØ	  
                  ./usr/include/sys/i386/macro386.h h .h  /* H_SCCSID(@(#)macro386.h	16.5	LCC)	/* Modified: 18:25:19 11/6/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/* Macros for 386 assembler code */

/* Create a unary NOT operator using the binary ! operator */
#define	NOT		-1!

/* Flush the prefetch queue so as not to overrun slow IO devices */
/* WARNING: Reiser preprocessor dependent macro */
#define	IODELAY	  jmp	.IO//**/**/__LINE__ ; .IO//**/**/__LINE__/**/:

/*	push regs upon kernel entry				*/
#define PUSHREGS						\
	push	%ds;	 /* push segment registers */		\
	push	%es; 						\
	push	%fs; 						\
	push	%gs; 						\
	pusha		/* push the rest of the registers */

/* 	initialize seg selector regs in preperation for a switch  */
#define SETSEL							\
	mov $GDT_KDS, %esi;	/* note kernel data seg */	\
	movw %si,%ds;						\
	movw %si,%es;						\
	sub  %esi,%esi;						\
	movw %si,%fs;						\
	movw %si,%gs						

/* Poke a byte into screen memory.  'base' gives address of screen
** memory,  use KSCRBASE in kernel mode, PSCRBASE in protected mode and
** SCRBASE in real mode.
** 'num' is both what is printed and where.  Use '0'-'9' then 'A'-'Z'.
** Set DEBUGVAR as well.
*/
#ifdef DEBUGVAR
KSCRBASE = 0xf00b8000
PSCRBASE = 0xf80b8000
SCRBASE = 0xb8000
SCRMSG	= 0x0430

#define debug2scr(num,base) 					\
	movl	$SCRMSG+num,[base+[num\*2]]; /* screen base */	\
	movl	$0x80000,%ecx;		/* pause */		\
dbg/**/num: ;							\
	nop;							\
	loop	dbg/**/num
	
#else	/* ! DEBUGVAR */
#define debug2scr(num,base)	/
#endif	/* ! DEBUGVAR */

/* Assembler routine profiling macro */
#ifdef KPROF
/*
 * The set of macros necessary to generate a unique label for the call
 * to be passed in %edx to mcount.
 * The problems these macros solve are
 *   1) Getting a unique token each time the macro PROFILE is invoked.
 *   2) Getting __LINE__ evaluated despite its being adjacent to other tokens.
 *   3) Concatenating tokens.
 * The funny looking sequence repeated 3 times in the concat macro is magic:
 * when the vacuous comments are elided from it, it becomes another
 * vacuous comment.  Please don't tell my mother!
 */

#define	_CONCAT(a,b)	//**/**/**//a//**/**/**//b//**/**/**//
/** NEEDSWORK : PROFILE needs its name changed to MCOUNT everywhere **/
#define	PROFILE 	_Mcount(__LINE__)
#define	MCOUNT	 	_Mcount(__LINE__)
#define	_Mcount(uniq) \
	.data; \
	.align 4; \
	_CONCAT(.PP,uniq): .long 0; \
	.text; \
	movl $_CONCAT(.PP,uniq),%eax; \
	call mcount
#else
#define PROFILE
#define MCOUNT	
#endif
kêàß }  $        £;  f‰*9˜ˆ*f‰*     Ëg£;                ch  ./usr/include/sys/i386/mmu386.h /*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/
/* SCCSID(@(#)mmu386.h	16.5	AIX)	Modified: 18:31:48 3/20/90 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef	_h_MMU386
#define	_h_MMU386

#ifndef	_h_PARAM
#ifdef	KERNEL
#include <param.h>
#else	/* ! KERNEL */
#include <sys/param.h>
#endif	/* ! KERNEL */
#endif	/* _h_PARAM */

/*
 * Bit and field definitions for Page tables and Page directories.
 * (Page tables and page directories are indentical, except that
 * page directories point at page tables whereas page tables point
 * at pages.)
 *
 * (see 80386 Programmer's Reference Manual, Figures 5-10 and 6-10).
 */

typedef unsigned long pte_t;		/* Page table entry */
typedef pte_t pde_t;			/* Page directory entry */

/* So the real mode boot code can include this file */
#if defined(i386) && !defined(SA_386)
/*
 * Defines for Page Table and Directory Entries
 */
struct pt_entry {
	unsigned int
		pg_v : 1,	/* Valid (also called "Present") */
		pg_prot : 2,	/* Protection			*/
			: 2,	/* must be zero			*/
		pg_ref : 1,	/* reference bit		*/
		pg_m : 1,	/* Modified bit			*/
			: 2,	/* must be zero			*/
		pg_ndref : 1,	/* need reference		*/
			: 1,	/* for future software use	*/
		pg_cw : 1,	/* copy on write page		*/
		pg_pfnum : 20;	/* Page frame number		*/
};
#endif /* defined(i386) && !defined(SA_386) */

#define PT_PRESENT	0x00000001L	/* Page present */
#define PT_WRITEABLE	0x00000002L	/* Page is writeable */
#define PT_USER		0x00000004L	/* Page is USER accessible */
#define PT_PROT		(PT_WRITEABLE|PT_USER)
#define PT_RESVD1	0x00000008L	/* Bit reserved by intel */
#define PT_RESVD2	0x00000010L	/* Bit reserved by intel */
#define PT_REF		0x00000020L	/* Page has been accessed */
#define PT_DIRTY	0x00000040L	/* Page has been written */
#define PT_RESVD3	0x00000080L	/* Bit reserved by intel */
#define PT_RESVD4	0x00000100L	/* Bit reserved by intel */
#define PT_AGE		0x00000200L	/* Software: second ref bit */
#define PT_SRESVD	0x00000400L	/* Software: Unused */
#define PT_CW		0x00000800L	/* Software: page is protected
					   for copy-on-write */
#define PT_FRAMEMASK	0xfffff000L	/* Page frame bits in a page table */

#define PT_FRAMESHIFT	12L		/* Shift to get page frame */

#define PT_NOENT	0L		/* Empty PT entry */

/* Bits to turn on when a page is made valid */
#define PT_VALIDATE	(PT_PRESENT | PT_REF | PT_AGE)

/*
 * values for the PT_PROT field
 */
#define	PT_KW		0
#define	PT_UW		(PT_WRITEABLE | PT_USER)
#define PT_URKW		PT_USER
/* The following modes are not defined by the harware on the 386.
 * We'll substitute the most restrictive allowed mode. */
/* #define	PT_NOACC	    0 */
#define	PT_KR		PT_KW
#define	PT_URKR		PT_URKW

/* SVR2 has two names for the same thing */
#define	PT_UR		PT_URKR

#define	MAXVADDR	0xffffffffL	/* Maximum 32 bit virtual address */

/* Definitions of error code passed to the page fault handler */
#define	PFLT_VALID	PT_PRESENT
#define	PFLT_WRITE	PT_WRITEABLE
#define	PFLT_USER	PT_USER


/*
 * Macros used to access the page frame number in a
 * page {table,directory} entry.
 */
#define SETPFN(pte,pfn)	(pte) = (((pte) & ~PT_FRAMEMASK) | \
				 ((pfn) << PT_FRAMESHIFT))

#define PFN(pte)	((pte) >> PT_FRAMESHIFT)

#define invsatb(r,v)	flushptc()
#define clratb(v)	flushptc()


#define	PTEPPT	(NBPG/sizeof(pte_t))		/* PTEs Per Page Table */
#define	PDEPPT	(NBPG/sizeof(pde_t))		/* PDEs Per Page Table */

/* Structure of the page directory and page table pages. */
struct pagedir
{
	pde_t	pd_pde[PDEPPT];
};

struct pagetable
{
	pte_t	pt_pte[PTEPPT];
};

#ifdef KERNEL
/*
 * The physical address of the prototype of all page directories.
 * Since all process's start with a copy of this page, they all share the
 * same view of kernel virtual space.
 */
extern paddr_t globalpd;

/*
 * Defines to mask interrupts during a critical window in vsdetach().  This
 * is necessary do to a problem in the 386 B1 stepping chip.  See calls to
 * kludgeflush() for more info.
 */
#define kludgeintr_off()  Cli
#define kludgeintr_on()   Sti

#endif /* KERNEL */

/*
 * Macros for decomposing an address the way the paging hardware does.
 *    |31.......22|21.......12|11..........0|
 *    | Directory |  Table    |   Offset    |
 */
#define PDESHIFT	22	/* Amount to shift to get PDE */
#define	ADDRTOPDE(addr) ((ulong)(addr) >> 22)		 /* PDE in page dir */
#define	ADDRTOPTE(addr)	(((ulong)(addr)>>12)&(PTEPPT-1)) /* PTE in page table */
#define	ADDRTOOFF(addr)	((ulong)(addr) & (NBPG - 1))	 /* offset in page */
#define	ADDRTOPFN(addr)	((ulong)(addr)>>12)	/* physical Page Frame Num. */
#define	PFNTOADDR(pfn)	((ulong)(pfn)<<12)	/* physical address */

#define	NBPPDE	((ulong)1L << 22)	/* Bytes mapped by one page dir entry */
#define	NBPPTE	NBPG			/* and ... by one page table entry. */
/* Number of Page {Directory,Table} Entries needed to map size bytes. */
#define	SIZETOPDE(size) ( ((ulong)(size)+NBPPDE-1) >> 22 )
#define	SIZETOPTE(size)	( ((ulong)(size)+NBPPTE-1) >> 12 )

/* Bits in control register 0 (cr0) */
#define	CR0_PE	0x00000001L		/* Protection Enable */
#define	CR0_MP	0x00000002L		/* Monitor coProcessor */
#define	CR0_EM	0x00000004L		/* EMulate coprocessor */
#define	CR0_TS	0x00000008L		/* Task Switched */
#define	CR0_ET	0x00000010L		/* processor Extension Type */
#define CR0_PG	0x80000000L		/* Enable Paging */


/* First Kernel PDE */
#define FIRSTKPDE	((unsigned short) ADDRTOPDE(KERNVBASE))

/*
 * I'm not sure where these macros belong.
 *
 * All physical memory is mapped into the 386 kernel's address space.
 * These macros convert between physical and kernel virtual address.
 */
#define	PTOKV( PhysAddr )	( (caddr_t) ((long)(PhysAddr) | PHYSVBASE) )
#define	KVTOP( VirtAddr )	( (paddr_t) ((long)(VirtAddr) &~ PHYSVBASE) )

/* get a physical address for the page pointed to by a pte or pde */
#define PTETOP(pte)		(pte & PT_FRAMEMASK)
/* get a virtual address for the page pointed to by a pte or pde */
#define PTETOKV(pte)		PTOKV(PTETOP(pte))

#ifdef MERGE386
#define	KVBASE	KERNVBASE
#endif


/*
 * 386 segmentation definitions with relevant tables
 */
struct descr {
	ushort d_limit01;		/* Bytes 0 and 1 of the limit */
	ushort d_base01;		/* Bytes 0 and 1 of the base addr */
	u_char d_base2;			/* Byte 2 of the base address */
	u_char d_type;			/* Descriptor type */
	u_char d_limit2;		/* High nibble of limit, & [GBD]Bits */
	u_char d_base3;			/* Byte 3 of the base address */
};

/* Bit definitions for the d_type field */
#define DT_PRESENT	0x80		/* Segment present */
#define DT_PRIVLEVEL	0x60		/* Priviledge level mask */
#define    DT_PRIVUSER	DT_PRIVLEVEL	/* a user descriptor ("ring3"). */
#define    DT_PRIVKERN	0x00		/* a kernel descriptor. */
#define DT_SEGDESCR	0x10		/* Seg descriptor (0 => Table descr) */
#define DT_EXECUTABLE	0x08		/* Executable */
#define DT_CONFORMING	0x04		/* Conforming (if DT_EXECUTABLE) */
#define DT_READABLE	0x02		/* Readable (if DT_EXECUTABLE) */
#define DT_EXPANDDOWN	0x04		/* Expand down (if ! DT_EXECUTABLE) */
#define DT_WRITEABLE	0x02		/* Writeable (if ! DT_EXECUTABLE) */
#define DT_ACCESSED	0x01		/* Segment has been accessed */

#define	DT_KRWDATA \
	(DT_PRESENT|DT_SEGDESCR|DT_WRITEABLE)  /* Kernel RW Data */
#define	DT_KRWSTACK \
	(DT_PRESENT|DT_SEGDESCR|DT_WRITEABLE|DT_EXPANDDOWN)  /* Kernel Stack */
#define	DT_KTEXT \
	(DT_PRESENT|DT_SEGDESCR|DT_EXECUTABLE|DT_READABLE) /* Kernel Text */
/*
 * d_type values for User R/W Data and R/O Text. 
 */
#define	DT_URWDATA	(DT_KRWDATA|DT_PRIVUSER)
#define	DT_UTEXT	(DT_KTEXT|DT_PRIVUSER)

/* Bits for high order nibble of d_limit2 */
#define	DSCR_GBIT	0x80	/* Granularity bit: 1 => 4K */
#define	DSCR_DBIT	0x40	/* Dbit: 1 => USE32 code segment */
#define	DSCR_BBIT	0x40	/* Bbit: 1 => 32bit stack ops */

/* Table descriptor types (including the present bit) */
#define DT_TSS286	0x81		/* Available 286 TSS */
#define DT_LDT		0x82		/* LDT */
#define DT_286CALL	0x84		/* 286 Call Gate */
#define DT_TASKGATE	0x85		/* Task Gate */
#define DT_286INTR	0x86		/* 286 Interrupt Gate */
#define DT_286TRAP	0x87		/* 286 Trap Gate */
#define DT_TSS386	0x89		/* Available 386 TSS */
#define DT_386CALL	0x8c		/* 386 Call Gate */
#define DT_386INTR	0x8e		/* 386 Interrupt Gate */
#define DT_386TRAP	0x8f		/* 386 Trap Gate */

/*
 * Macro's for manipulating d_limit and d_base, which are can't be
 * accessed directly since they aren't contiguous.
 * Note that the limit macros don't take the Granularity bit into account.
 */
#define D_LIMIT(dp)	( (((dp)->d_limit2 & 0x0f) << 16) | (dp)->d_limit01 )
#define SET_D_LIMIT(dp, lim) \
		( \
			(dp)->d_limit2 &= ~0x0f, \
			(dp)->d_limit2 |= ((lim) >> 16) & 0x0f, \
			(dp)->d_limit01 = (lim) \
		)

#define D_BASE(dp) 	\
		(((dp)->d_base3 << 24) | ((dp)->d_base2 << 16) | (dp)->d_base01)
#define SET_D_BASE(dp, base) \
		( \
			(dp)->d_base3 = ((base) >> 24), \
			(dp)->d_base2 = ((base) >> 16), \
			(dp)->d_base01 = (base) \
		)


/*
 * Format of a 386 selector (same as 80286):
 * 	+----------------+
 *	|                |	a selector register like ds, cs, ss, ...
 * 	+----------------+
 *	 ^...index...^		bits 3-15 are the index into a desciptor table
 *	              ^		bit 2: table indicator bit: 1 => LDT, 0 => GDT.
 *	               ^^	bits 0-1 are the privilege level (rpl).
 *
 * Macros for decomposing a selector:
 */
#define	SELINDEX	0xfff8	/* mask for index bits in selector. */
#define	SELINDEX_SHIFT	3	/* bit-distance of index from bit 0 */
#define	SELTABLE	0x0004	/* table indicator bit. */
#define		SELLDT	0x0004	/* sel & SELTABLE == SELLDT => LDT. */
#define		SELGDT	0x0000	/* sel & SELTABLE == SELGDT => GDT. */
#define	SELRPL		0x0003	/* Mask for Privilege Level of selector */
#define		SELKERN	0x0000	/* rpl == SELKERN => kernel selector */
#define		SELUSER	0x0003	/* rpl == SELUSER => user selector */
#define	SEL_TO_INDEX(sel)	((unsigned)(sel) >> SELINDEX_SHIFT)
#define SELINCR		0x0008	/* Increment to get to next selector */

#define	NULLSEL	0xffff		/* a bad (or non-existant) selector */

/*
 * Structure defining the 48-bit argument required by the lgdt
 * and lidt instructions.
 */
struct igdtload {
	ushort ig_pad;		/* avoid alignment problems */
	ushort ig_limit;	/* start of 48 bit value */
	vaddr_t ig_linaddr;
};

/*
 * Structure for call/trap gates
 */
struct gatedescr {
	u_short gd_offlo;		/* Low word of handler offset */
	u_short gd_selector;		/* Code Selector for handler */
	u_char gd_paramcnt;		/* # of params to copy for call gate */
	u_char gd_type;			/* Segment type */
	u_short gd_offhi;		/* High word of handler offset */
};



/* 386 LDT definitions */
#define LDTSIZE		(32 * sizeof(struct descr))
#define	SCALL_SEL	0x07	/* 386 system call gate */
#define	SSIG_SEL	0x0F	/* 386 signal call gate */
#define UCS_SEL		0x17	/* User CS SEL */		
#define UDS_SEL		0x1F	/* User DS,ES,SS selector */
#define	UBLOCK_SEL	0x24	/* Pointer to process's Ublock */
#define	LWORK_SEL	0x2C	/* Work selector (used by exec, et al) */
#define	LLDT_SEL	0x34	/* Work LDT sel used by exec of 286 programs */

/* 286 LDT definitions */
#define	FIRSTU_SEL	0x3f	/* First legal user ldt selector. */


/* 386 GDT definitions */
#define NUMGDT		8
#define	GDT_KCS		0x08		/* Kernel CS */
#define	GDT_KDS		0x10		/* Kernel DS, ES */
#define GDT_LDTSEL	0x18		/* LDT table selector */
#define GDT_GTSS	0x20		/* Global TSS */
#define GDT_KENTRY	0x28		/* Kernel Entry Call Gate */
					/*   for 286 processes */
#define GDT_DFLTTSS	0x30		/* Double fault TSS */
#define GDT_KSS		0x38		/* Kernel SS */

#ifdef KERNEL

#ifdef CONFC

#define KTEXTLIM2	(0x0f | DSCR_DBIT | DSCR_GBIT)
#define KDATALIM2	(0x0f | DSCR_BBIT | DSCR_GBIT)

struct descr gdt[NUMGDT] = {
  { 0, 0, 0, 0, 0 },			/* 0 Empty slot  */
  { 0xffff, 0, 0, DT_KTEXT,   KTEXTLIM2, 0}, 	/* 8  Kernel CS */
  { 0xffff, 0, 0, DT_KRWDATA, KDATALIM2, 0 },	/* 10 Kernel DS & ES */
  { LDTSIZE-1, 0, 0, DT_LDT, 0, 0 },	/* 18 LDT table sel */
  { 0, 0, 0, DT_TSS386, 0, 0 },		/* 20 TSS for current process */
  { 0, 0, 0, DT_386CALL, 0, 0 },	/* 28 Kernel Entry */
  { 0, 0, 0, DT_TSS386, 0, 0 },		/* 30 TSS for Double fault */
  { 0, 0, 0, DT_KRWSTACK, 0, 0 },	/* 38 Kernel SS */
};

struct igdtload gdtload = { 0, sizeof(gdt) - 1, (vaddr_t) gdt};

struct descr proto386ldt[] = {
	{0, 0, 0, 0, 0, 0},		/* 386 system call gate */
	{0, 0, 0, 0, 0, 0},		/* 386 signal call gate */
	{0, 0, 0, 0, 0, 0},		/* User CS sel */
	{0, 0, 0, 0, 0, 0},		/* User DS sel */
	{0, 0, 0, 0, 0, 0},		/* Ublock alias */
	{0, 0, 0, 0, 0, 0},		/* Lwork sel */
	{0, 0, 0, 0, 0, 0}		/* Lldt sel */
};
unsigned int size386ldt = sizeof(proto386ldt);


#else  /* ! CONFC */
extern struct descr gdt[NUMGDT];
extern struct descr proto386ldt[];
extern unsigned int size386ldt;
#endif /* ! CONFC */
extern struct descr *ldt;


/*
 * Macros used to make physical (usually device) memory addressable to
 * the kernel.
 *
 * MAPINIT(): initialize a map pointer.  Should only be called once for
 *	for a given map pointer.  It is a nop for the 386 implementation.
 *
 * MAPIN(): provide a kernel address which gives access to a given region
 *	of physical memory.  Used primarily by device drivers to access
 *	device memory.
 *
 * MAPIN_RO(): does the same thing, though only reads of the memory
 *	(no writes) should be permitted.   Unfortunately, the 80386 has
 *	a limitation which makes it nearly impossible to enforce a read
 *	map in kernel mode so MAPIN and	MAPIN_RO are the same.
 *
 * MAPOUT(): frees any map resources (e.g. page table entries) which may
 * 	have been allocated for vaddr.  The vaddr parameter must have
 *	been obtained via a call to MAPIN or MAPIN_RO.
 */
#define MAPINIT(vaddr) 	 /* this is a nop on the 386 */

#define MAPIN(vaddr, paddr, bcnt)		\
		(vaddr) = (void *) mapin((paddr), (bcnt))

#define MAPIN_RO(vaddr, paddr, bcnt) 		\
		(vaddr) = (void *) mapin((paddr), (bcnt))

#define MAPOUT(vaddr)	mapout(vaddr)

/*
 * Macros used to allocate and free physical memory and swap space. 
 *
 * When freeing or trying to get a specific piece of core,
 * round the address UP when converting it to a "page", so we don't
 * try to "rm{get,free}" a page which is still in use.
 *
 * To try to get the unit conversions right when calling rm{alloc,free,get},
 * always use these macros.
 */

extern struct map *swapmap;

#endif /* KERNEL */

#ifndef NOCHECKS
/* Keep the coremap pagealigned. */
#define	ALIGNCHECK(x) \
	((x) & (NBPG-1)? printf("ALIGNCHECK: %s, %d\n", __FILE__, __LINE__):0),
#else /*NOCHECKS*/
#define	ALIGNCHECK(x)
#endif /*NOCHECKS*/

#define	COREROUND(size)	(((size) + NBPG-1) & ~(NBPG-1))
#define	ADDRROUND(addr)	(((addr) + NBPG-1) & ~(NBPG-1))

#ifdef	SVPAGING

extern caddr_t sptalloc();

#define	COREALLOC(size) \
	(	ALIGNCHECK((int)size) \
		KVTOP(sptalloc(btop(size))) \
	)
#define COREFREE(size, addr) \
	(	ALIGNCHECK((int)size|(int)addr) \
		sptfree(PTOKV(addr), btop(size)) \
	)
#endif	/* SVPAGING */

/*
 * in the future: I think this is really what btod should be, but I'm afraid
 * something else would break.
 */
#define	btoswap(bytes)	(((bytes)+BSIZE-1)/BSIZE)

#define	SWAPALLOC(size) \
		(daddr_t)rmalloc(swapmap, (rmap_t)btoswap(size))
#define SWAPFREE(size, addr) \
		rmfree(swapmap, (rmap_t)btoswap(size), (rmap_t)(addr))


#endif /* _h_MMU386 */
s */
kê¤ |  $        !  f‰*:˜ˆ*f‰*     uu!  
              e  ./usr/include/sys/i386/mtstream.h h .h  H_SCCSID(@(#)mtstream.h	1.2    IBM AIX)    /* Modified: 20:01:07 7/15/92 */

/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/* 
 * io/mtPS2.h
 *
 * This file contains the include definitions for the 6157 streaming
 * tape adapter on the PS/2.
 *
 */

/*
 * Offsets into the io_bus_addrs array.  It will contain the I/O space
 * addresses of the adapter's registers; either the MCA values, listed
 * immediately below, or the ISA values which follow.
 */
#define	MTCR	0	/* control register */
#define MTDCR	1	/* diagnostic control register */
#define	MTDDPR	2	/* drive data port register */
#define	MTFBP1R	3	/* feedback port 1 register */
#define	MTFBP2R	4	/* feedback port 2 register */

/* 
 * I/O addresses for MCA bus
 */
#define	MCA_MTCR	0x3123	/* control register */
#define MCA_MTDCR	0x3124	/* diagnostic control register */
#define	MCA_MTDDPR	0x3125	/* drive data port register */
#define	MCA_MTFBP1R	0x3126	/* feedback port 1 register */
#define	MCA_MTFBP2R	0x3127	/* feedback port 2 register */

/* 
 * I/O addresses for ISA bus
 */
#define	ISA_MTCR	0x4219	/* control register */
#define ISA_MTDCR	0x4619	/* diagnostic control register */
#define	ISA_MTDDPR	0x5219	/* drive data port register */
#define	ISA_MTFBP1R	0x4A19	/* feedback port 1 register */
#define	ISA_MTFBP2R	0x4E19	/* feedback port 2 register */

#define NUM_IO_ADDRS	5

/*
 * The MCA version provides the DMA channel via a POS register while the
 * ISA version is "hard-wired" and is not available for software to read;
 * therefore, we define it here.
*/
#define ISA_DMA_CHAN	2

#define MT_INTLEV	6

/*
 * MTCR bits
 */
#define RESET	0x01	/* reset (+) */
#define ONLINE	0x02	/* online (+) */
#define REQUEST	0x04	/* request (+) */
#define INTENB	0x08	/* interrupt and DMA request enable (+) */
#define DACK	0x10	/* DACK (DMA Acknowledge) enable (+) */
#define TC	0x20	/* TC (Terminal count) enable (+) */
#define RPCL	0x40	/* Reset Parity Check Latch (+) */
#define	RIL	0x80	/* Reset Interrupt Latch (+) */

/* 
 * Diagnostic Control Register Bits
 */
#define	DIRECT	0x01	/* direction (+) */
#define DRDY	0x02	/* ready (+) */
#define ACK	0x04	/* acknowledge (+) */
#define DEXCEPT	0x08	/* exception (+) */
#define DSETTRA	0x10	/* set teransfer active (+) */
#define DEXTWRP	0x20	/* external wrap (+) */
#define DDMODE	0x40	/* diagnostic mode */
#define CLEARRL	0x80	/* clear ready latch */

/*
 * Feedback Port 1 Register Bits
 */
#define READYL	0x01	/* Ready Latch (+) */
#define SETTRA	0x02	/* Set transfer active (+) */
#define EXTWRP	0x04	/* External Wrap (+) */
#define TCENA	0x08	/* Terminal Count enable (+) */
#define DMAREQ	0x10	/* DMA request (-) */
#define INTTR	0x20	/* Interrupt (-) */
#define TRANSFR	0x40	/* Transfer (-) */
#define DMODE	0x80	/* diagnostic mode (+) */

/*
 * feedback port 2 register bits 
 */
#define	DIRECT	0x01	/* direction (-) */
#define READY	0x02	/* ready (-) */
#define ACK	0x04	/* acknowledge (-) */
#define EXCEPT	0x08	/* exception (-) */
#define READL	0x10	/* read latch (+) */
#define WRITEL	0x20	/* write latch (+) */
#define READSL	0x40	/* read status latch (+) */
#define PCHKL	0x80	/* parity check latch (+) */

/*
 * Controller Commands
 */
#define SELECTR	0x01	/* select regular */
#define SELECTL 0x11	/* select & lock */
#define BOT	0x21	/* rewind */
#define	RET	0x24	/* retention */
#define ERASE	0x22	/* erase */
#define	WRITED	0x40	/* write data */
#define	WRITEM	0x60	/* write file mark */
#define	WRITEMF	0x62	/* write file mark on the fly */
#define READD	0x80	/* read data */
#define	READDF	0x82	/* read data on the fly */
#define	SPACER	0x89	/* space reverse */
#define	READFM	0xa0	/* read file mark */
#define	READST	0xc0	/* read status */
#define READEST	0xc4	/* read extended status */
#define TEST1	0xc2	/* self-test 1 */
#define	TEST2	0xca	/* self-test 2 */
#define	TEST3	0xcb	/* self-test 3 */

/*
 * Status Bits (status commmand)
 */
#define ST0	0x0080	/* some bit is on in status byte 0 */
#define CNI	0x0040	/* cartridge not in place */
#define DFF	0x0020	/* device fault flag - catastrophic error */
#define	WRP	0x0010	/* write protected */
#define EOM	0x0008	/* end of media */
#define UDA	0x0004	/* unrecoverable data- hard error(status read resets) */
#define BNL	0x0002	/* block in error not located (read status resets) */
#define FIL	0x0001	/* file mark detected (read status resets) */

#define	ST1	0x8000	/* some bit is on in status byte 1 */
#define ILL	0x4000	/* illegal command (read status resets) */
#define NDT	0x2000	/* no data detected (read status resets) */
#define MBD	0x1000	/* marginal block detected (read status resets) */
#define BOM	0x0800	/* beginning of tape */
#define	BPE	0x0400	/* bus parity error (read status resets) */
#define ERM	0x0200	/* end of recorded media (read status resets) */
#define	POR	0x0100	/* power on/reset occurred (read status resets) */
R	0x312kêªw z  $        I  g‰*:˜ˆ*g‰*     ·eI  
                  ./usr/include/sys/i386/nvrcfg.h #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)nvrcfg.h	16.4	LCC)	/* Modified: 15:57:23 9/16/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/*
 *
 *	this file descibes the format of the file /etc/nvramcfg.info, which
 *	is used by the bootstrap in order to construct the menus for the 
 *	configuration information that is recorded in the AIXINFO structure 
 *	in NVRAM
 */

/*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/

#define KBXMAG	0x0A58424B		/* KBX\n			*/
/*
 * the file begins with a kbxhead record, which defines the contents of
 * the rest of the file
 */
struct kbxhead
{	long	magic;			/* KBXMAG			*/
	short	numkbds;		/* number of keyboard records	*/
	short	defkbd;			/* default keyboard language	*/
	short	nummons;		/* number of monitor records	*/
	short	defmon;			/* default monitor type		*/
	short	numtzone;		/* number of timezones		*/
	short	defzone;		/* default time zone		*/
	short	numlangs;		/* number of nls languages	*/
	short	deflang;		/* default nls language		*/
	short	padding[6];		/* pad out to 16 shorts		*/
};

/* this is followed by <numkbds> kbxlang records, one for each kbd type	*/
struct kbxlang
{	char	langname[16];		/* name of this kbd/language	*/
	short	langcode;		/* code for this language	*/
	char	pad[14];		/*				*/
	char	asciimap[128];		/* map for 128 ascii chars	*/
	char	spclmap[144];		/* map for non-ascii chars	*/
};

/* this is followed by <nummons> kbxmon records, one for each monitor type */
struct kbxmon
{	char	mondescr[48];		/* monitor description		*/
	unsigned short reqadpt;		/* card ID of required adaptor	*/
	unsigned short reqcpu;		/* CPU type for required mach	*/
	char	moncode;		/* code for this monitor type	*/
	char	pad[11];		/* I'll think of something	*/
};

/* this is followed by <numzone> kbxtz records, one for each time zone	*/
struct kbxtz
{	char	tzname[32];		/* name of this time zone	*/
	short	tzdelta;		/* hours +/- from gmt		*/
	char	tzshort[4];		/* short name for this zone	*/
	char	dstshort[4];		/* short name for DST in zone	*/
	char	pad[22];		/* I'll think of something	*/
};

/* this is followed by <numlangs> kbxnls records 			*/
struct kbxnls
{	char	langname[16];		/* name of this language	*/
	short	langcode;		/* code to record for it	*/
	char	pad[14];		/* I'll think of something	*/
};

/*
 * the KBXLT macro is used to make sense out of the translate tables in the
 * kbxlang structure.  It uses the kbxlang tables to map a two-byte return
 * value from a call to INT 16H subcode 10H into a display code.  
 *
 * the other macros are used to build up the KBXLT macro
 */
#define KBKEY45(hibyte,lobyte)	((hibyte == 0x56) && ((lobyte&0xDF) == 0x5C))
#define KBCROCK(lobyte)		((lobyte == 0x5c) ? 0x38 : 0x39)
#define KBASCII(lp,lobyte)	(lp->asciimap[(lobyte)&0x7f])
#define KBSPCL(lp,hibyte)	((hibyte < 0x90) ? lp->spclmap[hibyte] : 0)

/* this is the one that actually BIOS char/scan codes into display codes */	
#define	KBXLT(lp,hi,lo)						\
	( KBKEY45(hi,lo)  ? KBSPCL(lp,KBCROCK(lo))		\
			  : ((lo) ? KBASCII(lp,lo) : KBSPCL(lp,hi)))
*/
#defkêêû ß  $        ˜8  o‰*šˆ*o‰*     Ÿr˜8  	              _  ./usr/include/sys/i386/os.h g.h #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)os.h	1.5.1.2	AIX)	/* Modeified: 14:06:39 10/28/91 */

 

/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * This file will include the correct OS dependency file for compilation to
 * a specific OS.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision     Date    Who     Description
 * --------     ------  -----   ---------------------------------------------
 * 0.00         5/21/88 GGS     Original code entry
 */

/*
 * Here is a description of what needs to be declared by this file.
 *
 *
 *
 *      TBUFSIZE        This is the size of a temporary buffer.  It should
 *                      probably be fixed at 512 bytes, but we'll include
 *                      it here for now so that it is atleast visable.
 *
 *      MAX_ALLOC       This is the maximum number of bytes that can be
 *                      allocated by alloc() (see below) in one call.  This
 *                      number is treated as an unsigned long so -1 can be
 *                      used as 2^32 - 1 (assuming that a long is 32 bits).
 *
 *      PARTITIONS      This flag indicates that there will be partions on
 *                      the disk and requests are made relative to the start
 *                      of partitions.
 *
 *      PART_BASE       This flag indicates the starting offset of the
 *                      "in-core" partition table.  This is intended to allow
 *                      things like partition 0 to indicate the entire disk
 *                      without any partitioning.
 *
 *      NPARTS          The number of partitions (starting at PART_BASE) in
 *                      the "in-core" partition table.
 *
 *      PARTENTS        This is the structure of an "in-core" partition table
 *                      entry.  This is defined in this file and is common to
 *                      all OS' that have PARTITIONS.  It is upto the specific
 *                      OS code to map the contents of what is on disk (or
 *                      where ever it is) into this structure.
 *
 *      NSPB            This indicates the number of sectors per block if the
 *                      block size is fixed in the OS.
 *
 *      FIXED_BLOCK     This indicates that the size of a disk block is fixed.
 *
 *      CACHE           This flag will enable the DASD cache code in the
 *                      compilation of the driver.
 *
 *      CACHE_ENABLED   This is a RUN-TIME constant that indicates if the
 *                      cache code present in the driver is to be enabled.
 *
 *      STRAT_BLOCK     This flag indicates if the strategy routine should
 *                      "block" waiting for the I/O it requested to complete.
 *                      If this flag is not set, it is the responsibility of
 *                      the caller of the device driver to perform the wait(s)
 *                      necessary for the I/O to complete and to check for
 *                      completion.
 *
 *      MAX_CACHE_REQ   This is a RUN-TIME constant that indicates the largest
 *                      request (in bytes) that will be cached.
 *
 *      PAGE_SIZE       This is a RUN-TIME constant that indicates the number
 *                      of bytes in a cache page.  This value must be a power
 *                      of 2 times 512.
 *
 *      YIELD_COUNT     This is a RUN-TIME constant that indicates the number
 *                      of bytes that can be copied to or from the cache
 *                      without doing a YIELD to let other (potentially higher
 *                      priority) tasks run.  A value of 0 for this constant
 *                      indicates that NO yields are to be done during the
 *                      copy.
 *
 *      TC_YIELD_COUNT  This is a RUN-TIME constant that indicates the number
 *                      of bytes that can be copied to or from the cache
 *                      without doing a TCYIELD to let a time critical process
 *                      to run if one is waiting.  A value of 0 for this
 *                      constant indicates that NO yields are to be done during
 *                      the copy.
 *
 *      ASYNC_WRITE     This flag will allow writes to progress asyncronously
 *                      and allow the strategy routine to return once a write
 *                      is queued, and not to wait for it to complete.
 *
 *      MAX_BUSY        This is a time value used to determine the MAXIMUM
 *                      amount of time that the SPOCK/TRIBBLE should be
 *                      busy.  SPOCK/TRIBBLE's spec indicates that the card
 *                      will not be busy for more than 400 us, so the value
 *                      for this constant should allow for a loop in C to
 *                      go for AT LEAST 400 us.
 *
 *      FAR             This value is used to indicate pointers that are
 *                      outside of the standard data area.  This should be
 *                      defined for OS's that use segmentation.
 *
 *      OS_REQ          This is the structure definition for the OS's request
 *                      to the device driver.  This structure is considered
 *                      FAR by the device driver.
 *
 *      MAX_CHAIN_LEN   This value is used to indicate the maximum length of
 *                      an SCB chain.
 *
 *      MAX_DEV_RETRIES This is the number of times that an operation is to
 *                      be retried before an error is to be reported.
 *
 *      ASGN_RETRIES    This is the number of times an assign is to be
 *                      attempted before an error is to be reported.
 *
 *      MAX_RESETS      This is the number of resets that can occur between
 *                      "real" I/O operations and still have the card work.
 *                      If this value reaches 0 while processing a single
 *                      request, the card will be completely disabled and all
 *                      pending work on the card will be failed.
 *
 *      INIT_ALL_DEVS   This is defined if all SCSI devices on a card are to
 *                      be initialized when the card is initialized.
 *
 *      inb(ioaddr)     This routine inputs a byte (uchar) from the I/O port
 *                      whose address (a ushort) is ioaddr.
 *
 *      outb(ioaddr,val)        This routine outputs a byte (uchar) to the
 *                      I/O port whose address (a ushort) is ioaddr.
 *
 *      mask_ints()     This routine returns an int.  It masks interrupts so
 *                      that the driver will not be called.  This does not
 *                      necessarily imply that ALL interrupts have to be masked
 *                      just those that would cause any routine in the device
 *                      driver to be called (ie if in interrupt time, will 
 *                      prevent a process from calling the driver).  The value
 *                      that it returns is the interrupt state that was in
 *                      effect before the routine was called.
 *
 *      enable_ints(mask)       This routine takes the value returned from
 *                      the 'mask_ints()' routine and sets the interrupt state
 *                      to that value.
 *
 *      pic_eio()       This routine signals the interrupt controller that
 *                      the interrupt has been processed sufficiently to allow
 *                      other interrupts to enter the controller.  This routine
 *                      DOES NOT imply that interrupts are enabled.
 *
 *      virt@(physadr)  This routine takes a physical address (a paddr_t) and
 *                      creates an address that is suitable for use by the
 *                      device driver as a char FAR *.  The pointer produced
 *                      by this routine can be considered temporary.  That is
 *                      the next call to this routine COULD return an
 *                      identical value with a different physical address.
 *
 *      phys@(virtadr)  This routine takes a virtual address (a char FAR *) and
 *                      returns a paddr_t that represents the physical address
 *                      of the memory pointed to by the virtual address.
 *
 *      mark_runnable(ptr)      This routine marks the address (a char FAR *)
 *                      (belonging to a blocked process) as runnable.
 *
 *      block(ptr)      This routine blocks on the address (a char FAR *) until
 *                      a call is made by mark_runnable with the same address.
 *
 *      signal_io_complete(os_req)      This routine is used when the strategy
 *                      routine does not block.  It marks the OS' request as
 *                      complete and does whatever is necessary to get the 
 *                      process that was waiting for the OS request block to
 *                      be started again.
 *
 *      yield()         This will yield the process to a (potentially higher
 *                      priority) process.
 *
 *      TCyield()       This will yield to a time critical process if one is
 *                      waiting.  This is a sub-set of yield().
 *
 *      os_card(os_req) This macro extracts the card number from the OS'
 *                      request.
 *
 *      os_scsi_id(os_req)      This macro extracts the scsi ID number from the OS'
 *                      request.
 *
 *      os_lu(os_req)   This macro extracts the logical unit number from the
 *                      OS' request.
 *
 *      os_part(os_req) This macro extracts the partition number from the OS'
 *                      request.
 *
 *      get_block_no(os_req)    This macro extracts the starting block number
 *                      from the OS' request.
 *
 *      get_num_blocks(os_req)  This macro extracts the number of blocks that
 *                      are covered by the OS' request.
 *
 *      get_num_bytes(os_req)   This macro extracts the number of bytes that
 *                      are to be transfered by the OS' request.
 *
 *      get_buffer(os_req)      This macro extracts the physical address of the
 *                      destination buffer pointed to by the OS' request.
 *
 *      get_next_request(os_req)        This macro returns a pointer to the next
 *                      OS request block if the OS passed more than one
 *                      request to the stratagy routine.  If an OS cannot
 *                      pass more than one request per call to the stratagy
 *                      routine, then this macro should evaluate to NULL.
 *
 *      map_results(req,os_req) This routine will copy the appropriate fields
 *                      from the request block back into the OS' request block.
 *                      It will also mark the OS' request as being complete
 *                      but it will not start any "blocked" processes.
 *
 *      alloc(num_bytes)        This routine will allocate the indicated
 *                      number of bytes and return a pointer to the first
 *                      byte of the block.  The type of this routine should
 *                      be char FAR *.
 *
 *      free(ptr, num_bytes)    This routine will free the indicated number
 *                      of bytes starting at ptr (it will be of type char FAR *)
 *                      The use of this routine will always be to free the
 *                      total amount that was originally allocated rather than
 *                      to just reduce the amount of space that is allocated to
 *                      a particular pointer.
 *
 *      get_part_info( cardno, reqp, cbufp, dbufp)
 *                      This routine will get the partition table information
 *                      from the drive specified by cardno and reqp and place
 *                      it in the logical unit's state table.  reqp is a FAR 
 *                      pointer to a request block.  cbufp & dbufp are FAR
 *                      pointers to TBUF structures that can be used for
 *                      processing the commands.
 *
 *      i386_io_flush() This routine causes the 386's TLB to be flushed.  This
 *                      is done because some 386 chips (pre-C stepping) have a
 *                      bug which causes the I/O to (incorrectly) go through
 *                      the page tables thus causing the incorrect I/O address
 *                      to be generated on the bus if the I/O port was above
 *                      4K (0x1000).  This routine should detect the stepping
 *                      level of the 386 and will not cause the page tables to
 *                      be flushed if the stepping level is C or later.  On 
 *                      systems that do not use the 386 this can be a null
 *                      macro.
 *
 *      cmpare(s1,s2,len)       This routine compares two strings upto a length
 *                      of len.  If they are equal for the indicated length,
 *                      this routine will return 0.  If they are not equal for
 *                      the indicated length, this routine will return a 1.
 *
 */

#ifdef  OS2
#include <os2os.h>
#endif

#ifdef  AIX
#include <sys/i386/aixos.h>
#endif

#ifdef  XENIX
#include <xenixos.h>
#endif

#ifdef  PCDOS
#include <pcdosos.h>
#endif

/*
 * We define partitions here because we want all drivers that use partitions
 * to have the same IN-CORE structure.  This will make the code handling 
 * partitions easier.  It still allows the partition structure on the disk
 * to be different between different systems.
 */
#ifdef  PARTITIONS
#ifdef  DEFINE_PART_STRUCT
struct  partents
             {
             daddr_t    length;         /* length of partion in sectors */
             daddr_t    start;          /* starting sector of partition */
             uchar      type;           /* type of partition            */
             uchar      status;         /* open//closed status          */
#ifndef FIXED_BLOCK
             ushort     nspb;           /* # sectors per block          */
#endif
             };

typedef struct  partents        PARTENTS;

#define OPNALIAS        0x80    /* alias partition has been opened      */
#define OPNPAR          0x40    /* real partition has been opened       */
#endif
#endif
kê„t y  $        Þ  g‰*A˜ˆ*g‰*     žeÞ  
                  ./usr/include/sys/i386/page.h h #ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)page.h	16.3	LCC)	/* Modified: 15:58:09 9/16/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _h_PAGE
#define _h_PAGE

#ifdef	i386
#ifndef	_h_MMU386	/* need definition of pte_t */
#include <sys/i386/mmu386.h>
#endif	/* _h_MMU386 */
#endif	/* i386 */

/*	The page table entries are followed by a list of disk block
 *	descriptors which give the location on disk where a
 *	copy of the corresponding page is found.
 */

typedef struct dbd {
	uint	dbd_type  :  4;	/* The values for this field are given	*/
				/* below.				*/
	uint	dbd_swpi  :  4;	/* The index into swaptab for the	*/
				/* device this page is on if dbd_type	*/
				/* is DBD_SWAP.				*/
#	define	dbd_adjunct	dbd_swpi
				/* The swpi field is used with DBD_FILE */
				/* entries to record even more info	*/
	uint	dbd_blkno : 24;	/* The block number or i_map index.	*/
} dbd_t;

#define	DBD_NONE	0	/* There is no copy of this page on 	*/
				/* disk.				*/
#define	DBD_SWAP	1	/* A copy of this page is on block nbr	*/
				/* dbd_blkno of the swap file		*/
				/* swptbl[dbd_swpi].			*/
#define DBD_DEVPG	2	/* This is a physical device page.	*/
#define	DBD_DZERO	3	/* This is a demand zero page.  No	*/
				/* space is allocated now.  When a 	*/
				/* fault occurs, allocate a page and	*/
				/* initialize it to all zeros.		*/
#define	DBD_DFILL	4	/* This is a demand fill page.  No	*/
				/* space is allocated now.  When a	*/
				/* fault occurs, allocate a page and	*/
				/* do not initialize it at all.  It	*/
				/* will be initialized by reading in 	*/
				/* data from disk.			*/
#define DBD_FILE	5	/* This page matches a block on the	*/
				/* file system				*/
#define DBD_REMFILE	6	/* This page matches a block on a	*/
				/* remote file system			*/

#ifdef MERGE386
#define DBD_WINDOW	7	/* Special type used for EMS and wrap	*/
				/* pages. Signifies multiple mapping    */
				/* to same physical page.  dbd_blkno	*/
				/* points at corresponding page with	*/
				/* valid dbd				*/
#endif /* MERGE386 */

/*
 *	ADJUNCT  FIELDS
 *	These are intended to be or'd into the adjunct field for
 *	file mapped pages
 */
#define DBD_FP		0x1	/* marks the first page from a file	*/
				/* system block				*/
				/* DBD_FP set => page matches first	*/
				/* half of a 1024 byte block		*/
				/* DBD_FP clear => second half		*/
#define DBD_LAST	0x2	/* marks the last page of a file mapped */
				/* region				*/
#define	DBD_FIRST	0x4	/* marks the first page of a file 	*/
				/* mapped region			*/
#define DBD_INO2	0x8	/* use v_ipa[1]				*/

typedef struct pfdat {
	unsigned	pf_blkno : 24,	/* Disk block number.	*/
			pf_flags : 8;	/* page flags		*/
	dev_t		pf_dev;		/* Disk device code.	*/
	short		pf_use;		/* share use count	*/
	char		pf_swpi;	/* Index into swaptab.	*/
	char		pf_lockcnt;	/* Lock in core		*/
	struct pfdat	*pf_next;	/* Next free pfdat.	*/
	struct pfdat	*pf_prev;	/* Previous free pfdat.	*/
	struct pfdat	*pf_hchain;	/* Hash chain link.	*/
} pfd_t;

#define	P_QUEUE		0x01	/* Page on free queue		*/
#define	P_BAD		0x02	/* Bad page (ECC error, etc.)	*/
#define	P_HASH		0x04	/* Page on hash queue		*/
#define	P_DONE		0x08	/* IO done on page		*/
#define	P_WANT		0x10	/* page needed			*/
#define	P_KERNSHARE	0x20	/* shared user/kernel buf page	*/

#ifdef	KERNEL
extern pfd_t phead;
extern pfd_t pbad;
extern pfd_t *pfdat;
extern pfd_t *pfdatend;
extern pfd_t *phash;
extern pfd_t ptfree;
extern int phashmask;

extern pfd_t	*pffind();
extern pte_t	*ltopte();
extern dbd_t	*ltodbd();

extern long freemem;	/* currently free physical memory */
extern bool_t pgall_locked;

#ifdef	NOCHECKS
#define	lockpgall()	(pgall_locked = TRUE)
#endif	/* NOCHECKS */
#define unlockpgall()	(pgall_locked = FALSE)

#endif	/* KERNEL */

/* bytes to pages (rounded up) */
#define btop(b)		(((unsigned int) (b) + (NBPG-1)) >> PGSHIFT)
/* pages to bytes */
#define ptob(p)		((p) << PGSHIFT)

#define BLKNULL		0	/* pf_blkno null value		*/

#endif /* _h_PAGE */
eskê|Í x  $        ‚  g‰*:˜ˆ*g‰*     Ût‚  
              ñt  ./usr/include/sys/i386/pic8259.h  h .h  /*
 *	IBM Personal Computer AIX/PS2
 *		Version 1.00
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1988, 1989 IBM Corp.
*	(c) Copyright 1987,1988, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

H_SCCSID(@(#)pic8259.h	16.3	LCC)	/* Modified: 15:59:00 9/16/89 */

/*
 * Intel 8259 Programmable Interrupt Controller (PIC)
 */
#define PIC_LEVELS	8	/* Each 8259 supports 8 intr levels */


/*
 * Initialization command words:
 *	ICW1 uses bits as defined below.
 *	ICW2 contains bits 3 through 7 of the Interrupt Vector Byte
 *	     that will be provided to the host CPU (i.e. the 80[23]86)
 *	     on an interrupt.  In other words, it provides the base of
 *	     the index into the IDT for the interrupts generated by this
 *	     PIC (master or slave).
 *		    +------------------------+--------------+
 *		    | B7 | B6 | B5 | B4 | B3 | I2 | I1 | I0 |
 *		    +------------------------+--------------+
 *
 *	ICW3 differs based on whenter this is the MASTER PIC or a slave.
 *	     For a Master, ICW3 is a bit mask indicating which levels
 *	     contain a slave PIC.
 *		    +---------------------------------------+
 *		    | S7 | S6 | S5 | S4 | S3 | S2 | S1 | S0 |
 *		    +---------------------------------------+
 *	For a SLAVE PIC, ICW3 identifies the LEVEL to which this SLAVE
 *	     attached to the master.
 *		    +---------------------------------------+
 *		    |  0 |  0 |  0 |  0 |  0 | S2 | S1 | S0 |
 *		    +---------------------------------------+
 *
 *	ICW4 uses bits as defined below.
 */

/* ICW1 BITS */
#define ICW1_NEEDICW4	0x01	/* Need an ICW4 specified */
#define ICW1_NOICW4	0x00	/* Don't need an ICW4 specified */
#define ICW1_SNGL	0x02	/* Single PIC Mode */
#define ICW1_CASCADE	0x00	/* Cascaded PIC mode */
#define ICW1_ADDR4	0x04	/* Address interval of 4 */
#define ICW1_ADDR8	0x00	/* Address interval of 8 */
#define ICW1_LEVEL	0x08	/* Level triggered */
#define ICW1_EDGE	0x00	/* Edge triggered */
#define ICW1_SETICW1	0x10	/* This bit must be on to set ICW1 */

/* ICW4 BITS */
#define ICW4_8086	0x01	/* 8086 (also 80286 and 80386) Mode */
#define ICW4_MCS80	0x00	/* MCS 80/85 Mode */
#define ICW4_AUTOEOI	0x02	/* AUTO EOI */
#define ICW4_NOAUTOEOI	0x00	/* NO AUTO EOI */
#define ICW4_MASTER	0x04	/* This is the MASTER PIC */
#define ICW4_SLAVE	0x00	/* This is a SLAVE PIC */
#define ICW4_BUFFERED	0x08	/* Buffered Mode */
#define ICW4_NONBUF	0x00	/* Non-Buffered Mode */
#define ICW4_SFNM	0x10	/* Special Fully Nested Mode */
#define ICW4_NOSFNM	0x00	/* Non-Special Fully Nested Mode */


/*
 * Operation command words:
 *	OCW1 is the Interrupt Mask Register (IMR).  It is a bit mask
 *	     indicating which interrupt levels the PIC should mask out.
 *	OCW2 uses bits as defined below.
 *	OCW3 uses bits as defined below.
 */

/* OCW2 bits */
#define OCW2_CMDMASK	0xE0	/* Command part of OCW2 */
#define OCW2_LEVELMASK	0x07	/* Interrupt Level part of OCW2 */

#define OCW2_NSEOI	0x20	/* Non-Specific EOI */
#define OCW2_SEOI	0x60	/* Specific EOI */
#define OCW2_NOP	0x40	/* No Operation */
#define OCW2_SETROTAEOI	0x80	/* SET Rotate in Automatic EOI */
#define OCW2_CLRROTAEOI	0x00	/* CLEAR Rotate in Automatic EOI */
#define OCW2_ROTNSEOI	0xA0	/* Rotate on Non-Specific EOI */
#define OCW2_ROTSEOI	0xE0	/* Rotate on Specific EOI */
#define OCW2_SETPRI	0xC0	/* Set Priority */


/* OCW3 bits */
#define OCW3_ISREG	0x01	/* Command refers to the Intr Stat Reg */
#define OCW3_IRREG	0x00	/* Command refers to the Intr Req Reg */
#define OCW3_RREG	0x02	/* Command is IS or IR read */
#define OCW3_POLL	0x04	/* Poll command */
#define OCW3_RESVD1	0x08	/* This bit must be on in all commands */
#define OCW3_SMMON	0x20	/* Special Mask Mode On */
#define OCW3_SMMOFF	0x00	/* Special Mask Mode Off */
#define OCW3_SMMOP	0x40	/* Command is a Special Mask Mode Set/Clr */

/* Command to Read the Interrupt Status Register (ISR) */
#define OCW3_READISR	(OCW3_ISREG | OCW3_RREG | OCW3_RESVD1)

/* Command to Read the Interrupt Request Register (IRR) */
#define OCW3_READIRR	(OCW3_IRREG | OCW3_RREG | OCW3_RESVD1)

/* Command to CLEAR Special Mask Mode */
#define OCW3_CLRSMM	(OCW3_SMMOFF | OCW3_SMMOP | OCW3_RESVD1)


/*
 * Implementation Dependent Constants:
 * 	PIC_MASTERBASE refers to the Vector number into the IDT for
 *	the MASTER PIC.  PIC_SLAVEBASE refers to the Vector number
 *	into the IDT for the SLAVE PIC.
 */
#define PIC_MASTERBASE	32
#define PIC_SLAVEBASE	(PIC_MASTERBASE + PIC_LEVELS)

#define NUM_INTVECS	16	/* Number of interrupt vectors */
#define PIC_SLAVELEVEL	2	/* Level on Master at which Slave is attached */

#define MASTERPIC_CMD	0x20	/* Port address for Master PIC CMD reg */
#define MASTERPIC_IMR	0x21	/* Port address for Master PIC IMR */

#define SLAVEPIC_CMD	0xA0	/* Port address for Slave PIC CMD reg */
#define SLAVEPIC_IMR	0xA1	/* Port address for Slave PIC IMR */


#ifdef MERGE_TRAP_IOINT
/** values for the existing pic interupt levels **/
/** master **/
#define PIC_INTR0	PIC_MASTERBASE + 0
#define PIC_INTR1	PIC_MASTERBASE + 1
#define PIC_INTR2	PIC_MASTERBASE + 2
#define PIC_INTR3	PIC_MASTERBASE + 3
#define PIC_INTR4	PIC_MASTERBASE + 4
#define PIC_INTR5	PIC_MASTERBASE + 5
#define PIC_INTR6	PIC_MASTERBASE + 6
#define PIC_INTR7	PIC_MASTERBASE + 7
/** slave **/
#define PIC_INTR8	PIC_SLAVEBASE + 0
#define PIC_INTR9	PIC_SLAVEBASE + 1
#define PIC_INTR10	PIC_SLAVEBASE + 2
#define PIC_INTR11	PIC_SLAVEBASE + 3
#define PIC_INTR12	PIC_SLAVEBASE + 4
#define PIC_INTR13	PIC_SLAVEBASE + 5
#define PIC_INTR14	PIC_SLAVEBASE + 6
#define PIC_INTR15	PIC_SLAVEBASE + 7
#else /* ~MERGE_TRAP_IOINT */
/** values for the existing pic interupt levels **/
/** master **/
#define PIC_INTR0	0
#define PIC_INTR1	1
#define PIC_INTR2	2
#define PIC_INTR3	3
#define PIC_INTR4	4
#define PIC_INTR5	5
#define PIC_INTR6	6
#define PIC_INTR7	7
/** slave **/
#define PIC_INTR8	8
#define PIC_INTR9	9
#define PIC_INTR10	10
#define PIC_INTR11	11
#define PIC_INTR12	12
#define PIC_INTR13	13
#define PIC_INTR14	14
#define PIC_INTR15	15
#endif /* ~MERGE_TRAP_IOINT */

DGE	0xkêØ9 w  $        f	  g‰*:˜ˆ*g‰*     ÙÁf	  
                  ./usr/include/sys/i386/pos.h 9.h/*
 * POS data for the PS/2
 */

#include <sccs.h>

#ifndef _h_MACHINFO
#include <sys/machinfo.h>
#endif

H_SCCSID(@(#)pos.h	1.2    IBM AIX)    /* Modified: 20:01:05 7/15/92 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _h_POS
#define _h_POS

#define	MAX_IO_SLOTS	10		/* max number of slots in a PS/2 */
#define ISA_DEVSZ	12		/* buffer for ISA adapter data   */
#define MAX_DRV_TAG	 8		/* max length of ISA adapter id  */

struct devdata {
	unsigned char	pd_pos0;	/* Card ID low */
	unsigned char	pd_pos1;	/* Card ID high */
	unsigned char	pd_pos2;	/* option select data byte 1 */
	unsigned char	pd_pos3;	/* option select data byte 2 */
	unsigned char	pd_pos4;	/* option select data byte 3 */
	unsigned char	pd_pos5;	/* option select data byte 4 */
	unsigned char	pd_pos6;	/* subaddress extention LSB */
	unsigned char	pd_pos7;	/* subaddress extention MSB */
	unsigned short	pd_major;	/* major dev */
	unsigned short	pd_flags;	/* flags */
};

/*
 * POS constants in the 2k NVRAM
 */

#define	NV_NUMSLOTS		0x018E
#define	NV_POS_SLOT_SIZE	0x0023
#define	NV_POS_BASE		0x0000
#define	NV_PLANAR_POS		0x0369

/*
 * PS/2 System Board POS register defines
 */

#define SYS_ENAB	0x94		/* System board enable / setup   */
#define ADAP_ENAB	0x96		/* Adaptor board enable / setup  */
#define POS_0		0x100		/* POS reg 0 - adaptor ID lsb    */
#define POS_1		0x101		/* POS reg 1 - adaptor ID msb    */
#define POS_2		0x102		/* Option Select Data byte 1     */
#define POS_3		0x103		/* Option Select Data byte 2     */
#define POS_4		0x104		/* Option Select Data byte 3     */
#define POS_5		0x105		/* Option Select Data byte 4     */
#define POS_6		0x106		/* Subaddress extension lsb      */
#define POS_7		0x107		/* Subaddress extension msb      */

#define SYS_ENABLE_SYSSETUP 0x80	/* system board setup enable bit    */
#define SYS_ENABLE_VIDSETUP 0x20	/* video subsystem setup enable bit */

#define POS_2_EXT_PAR_ENAB  0x80	/* POS 2, extended parallel enable  */
#define POS_2_PAR_ENAB      0x10	/* POS 2, parallel port enable      */
#define POS_2_SERIAL_SEL    0x08	/* POS 2, serial port select        */
#define POS_2_SERIAL_ENAB   0x04	/* POS 2, serial port enable        */
#define POS_2_DISKETTE_ENAB 0x02	/* POS 2, diskette drive enable     */
#define POS_2_SYS_BRD_ENAB  0x01	/* POS 2, system board enable       */
#endif /* _h_POS */
NokêO v  $        É  g‰*;˜ˆ*g‰*     ˆÉ  
                  ./usr/include/sys/i386/ps2mous.h  h .h  #include	<sccs.h>
H_SCCSID(@(#)ps2mous.h	16.4	AIX)	/* Modified: 16:01:24 9/16/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/

#include	<ioctlcmd.h>

#define	REGDATA	0x60
#define	RSTATUS	0x64
#define	SOBF	0x01
#define	SIBF	0x02
#define	AOBF	0x20

#define	LDOWN	0x01
#define	RDOWN	0x02
#define	XSIGN	0x10
#define YSIGN	0x20

#define ABS(a)	(a >= 0 ? a : -a)

#define	MOUSOPEN	0x0001
#define ACKEXPECT	0x0002
#define SLEEPING	0x0004
#define	BUTTONWAKE	0x0008
#define MOUSKBOPEN	0x0010
#define	BROKEN		0x8000
#define K8042_DISBL	0x10000

struct mous_r_data
{
	unsigned long	m_timestamp;
	unsigned short	m_hz;
	short		m_delta_x;
	short		m_delta_y;
	unsigned short	m_down_r;
	unsigned short	m_down_l;
	unsigned short	m_up_r;
	unsigned short	m_up_l;
	short		curly_tail;	/* needed to align 286/386 procs */
};

struct mous_r_params
{
	unsigned short	m_x_min;
	unsigned short	m_y_min;
};

	/* IOCTLS */

#define	MSPARAMS	_IOW(m, 0, struct mous_r_params)
#define	MGPARAMS	_IOR(m, 1, struct mous_r_params)
#define MSETCHAR	_IOW(m, 2, struct mous_chars)
#define MGETCHAR	_IOR(m, 3, struct mous_chars)

	/* Default strings for keyboard mode */

#define	MCRSRUP		"k"		/* Move Up */
#define MCRSRDN		"j"		/* Move Down */
#define	MCRSRRT		"l"		/* Move Right */
#define MCRSRLT		"h"		/* Move Left */
#define MCRSBRT		" "		/* Right Button */
#define MCRSBLT		"i"		/* Left Button */

#define	MAXSEQL		8		/* longest string sent */

struct mous_chars
{
	char ltstring[MAXSEQL];
	char rtstring[MAXSEQL];
	char upstring[MAXSEQL];
	char dnstring[MAXSEQL];
	char brstring[MAXSEQL];
	char blstring[MAXSEQL];
};
 lsb   kêÎ¡ Þ  $        Á  o‰*$šˆ*o‰*     nOÁ  	                  ./usr/include/sys/i386/region.h #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)region.h	1.5	AIX)	/* Modified: 14:18:41 2/9/90 */



/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * region.h
 *
 * This file contains the definitions for the region structures.  This is
 * used mostly by initialization routines that may want to allocate data
 * areas in a manner that does not limit them to < 64KB in segmented memory
 * systems.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	------	-----	---------------------------------------------
 * 0.00		2/02/89	GGS	Original code entry
 *
 */

/*
 * The following is to allow all allocated space to be freed in case of
 * an error during initialization.
 */
struct	region
	     {
	     char FAR	*addr;		/* address of start of region	*/
	     ulong	len;		/* length of the region		*/
	     };

typedef	struct region	REGION;

struct	region_ctl
	     {
	     REGION	FAR	*regions;
	     int		num_regions;
	     int		max_regions;
	     };

typedef	struct	region_ctl	REGION_CTL;
, 3, stkê8“ Ý  $        à  o‰*	šˆ*o‰*     _Oà  	              —  ./usr/include/sys/i386/request.h  h .h  #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)request.h	1.2    IBM AIX)    /* Modified: 20:02:11 7/15/92 */



/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * request.h
 *
 * This file defines the request block structure that is passed to the channel
 * manager from the individual device drivers.  It also contains all the
 * various kinds of requests and error conditions.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	------	-----	---------------------------------------------
 * 0.00		6/1/89	GGS	Split from state.h
 *
 */

/*
 * The following is the structure that defines a request queue entry.
 */
struct	req_q
	     {
	     ulong	command;	/* type of operation		*/
	     ulong	flags;		/* flags about operation	*/
	     ushort	error;		/* error code from the request	*/
	     ushort	num_blocks;	/* number of blocks to move	*/
	     char	scsi_info[256];	/* additional SCSI information	*/
	     daddr_t	block_no;	/* starting block number	*/
	     ulong	num_bytes;	/* number of bytes to move	*/
	     ulong	resid_bytes;	/* residual byte count		*/
	     ulong	immed_cmnd;	/* immediate command to card	*/
	     int	cardno;		/* card that has this request	*/
	     int	scsi_id;	/* SCSI dev that has this rqst	*/
	     int	lun;		/* LU that has this request	*/
#ifdef	PARTITIONS
	     int	part_no;	/* partition number 		*/
#endif
	     char  FAR	*buff;		/* temp system buffer		*/
	     char  FAR	*cmd_buff;	/* SCSI command buffer		*/
	     char  FAR	*data_buff;	/* user's logical buffer addr	*/
	     paddr_t	ubuff_adr;	/* user's physical buffer addr	*/
	     SCB   FAR	*rq_scb;	/* scb associated with request	*/
	     OS_REQ FAR	*os_reqp;	/* OS's request packet		*/
	     struct scat_gath_list FAR *sglist;/* scatter/gather list	*/
	     struct req_q FAR *req_next;/* next request in the chain	*/
	     struct req_q FAR *req_prev;/* previous request in the chain*/
	     struct req_q FAR *orig_next;/* next request in original req*/
	     struct req_q FAR *orig_prev;/* prev request in original req*/
	     ulong	req_pid;	/* process ID - originated req	*/
	     ulong	req_time;	/* time when req was made	*/
	     int	devnum;		/* sometimes filled in by driver*/
	     };

typedef	struct	req_q	REQ_Q;

#define	REQ_BUSY	0x00000001	/* request is busy		*/
#define	REQ_ERROR	0x00000002	/* request had an error		*/
#define	REQ_DONE	0x00000004	/* request is done		*/
#define	REQ_SAV_SCB	0x00000008	/* save SCB after request cmplts*/
#define	REQ_HAS_SCB	0x00000010	/* request uses an SCB		*/
#define	REQ_IMMED	0x00000020	/* request is an immediate cmd	*/
#define	REQ_NOCHAIN	0x00000040	/* request is not to be chained	*/
#define	REQ_FREE_BUFF	0x00000080	/* request is to free temp buff	*/
#define	REQ_LAST_ORIG	0x00000100	/* request is last one in queue	*/
#define	REQ_POST_OS	0x00000200	/* post the OS rather than req	*/
#define	REQ_HALT_CHAIN	0x00000400	/* idles device after request	*/
#define	REQ_PRIORITY	0x00000800	/* this is a priority request	*/
#define	REQ_IN_PROCESS	0x00001000	/* the request is being processd*/
#define	REQ_NO_SORT	0x00002000	/* don't sort this request	*/
#define	REQ_FREE_CMND	0x00004000	/* frees scsi cmd block when done */
#define	REQ_NO_DISC	0x00008000	/* don't allow disconnects	*/
#define	REQ_NO_POST	0x00010000	/* don't post anyone when done	*/
#define	REQ_NO_SYNC	0x00020000	/* don't use syncronous mode	*/
#define	REQ_ADR_SCATTER	0x00040000	/* buff adr is a scatter/gather list */
#define	REQ_SCAT_GATH	0x00080000	/* scatter/gather addr is valid	*/
#define	REQ_NO_CACHE	0x00100000	/* don't cache the data on card	*/
#define	REQ_HAS_ADINFO	0x00200000	/* additional info bytes valid	*/
#define	REQ_SHORT_DATA	0x00400000	/* don't report an error for short data */

/*
 * Request commands to the device.
 */
#define	REQ_SOFT	0x8000		/* "soft defined" request	*/
#define	REQ_READ	1		/* read data from the device	*/
#define	REQ_WRITE	2		/* write data to the device	*/
#define	REQ_SRESET	3		/* do a "soft" reset on the card*/
#define	REQ_GET_POS	4		/* get the card's POS info.	*/
#define	REQ_INQ		5		/* do an inquiry command	*/
#define	REQ_GET_CAP	6		/* get a drive's capacity	*/
#define	REQ_SCSI0	7		/* do a SCSI type 0 command	*/
#define	REQ_FORMAT	9		/* format a device		*/
#define	REQ_SCSI_RD	10		/* do a "generic" SCSI command	*/
#define	REQ_SCSI_WR	11		/* do a "generic" SCSI command	*/
#define	REQ_SCSI6_RD	REQ_SCSI_RD	/* do a SCSI vendor uniq command*/
#define	REQ_SCSI6_WR	REQ_SCSI_WR	/* do a SCSI vendor uniq command*/
#define	REQ_HRESET	12		/* do a "hard" reset on the card*/
#define	REQ_SET_TIMEOUT	13		/* set device command timeout	*/
#define	REQ_DRESET	14		/* reset a device		*/

/*
 * Request Error Codes
 */
#define	RE_NO_ERROR	0		/* no error			*/
#define	RE_FILE_MARK	1		/* read a "file mark"		*/
#define	RE_END_MEDIUM	2		/* at end of medium		*/
#define	RE_BAD_BLK_LEN	3		/* block len incorrect for dev	*/
#define	RE_NO_SENSE	4		/* no sense available		*/
#define	RE_NOT_READY	5		/* device was not ready		*/
#define	RE_MEDIA	6		/* media error			*/
#define	RE_HARDWARE	7		/* hardware error		*/
#define	RE_ILL_REQ	8		/* illegal request		*/
#define	RE_DATA_PROT	9		/* data was protected		*/
#define	RE_BLANK	10		/* tried to access "blank" data	*/
#define	RE_GEN_ERROR	11		/* general catch-all error	*/
#define	RE_CMD_ABORT	12		/* command was aborted		*/
#define	RE_EQUAL	13		/* data compared as "equal"	*/
#define	RE_NOT_EQUAL	14		/* data compared as "not-equal"	*/
#define	RE_MAX_RETRIES	15		/* failed due to max retries	*/
#define	RE_SCB_ERROR	16		/* error in SCB			*/
#define	RE_DEV_BUSY	17		/* device is busy		*/
#define	RE_SCSI_CHECK	18		/* received a SCSI check	*/
#define	RE_RES_CNFLCT	19		/* reservation conflict		*/
#define	RE_NOT_PRESENT	20		/* device is not present	*/
#define	RE_MEDIA_CHANGE	21		/* media was changed		*/
#define	RE_BAD_BLOCK	22		/* bad block number requested	*/
#define	RE_NO_SCB	23		/* no SCBs were available	*/
#define	RE_NO_TBUFF	24		/* no temp buffers were availabl*/
#define	RE_UNKNWN_REQ	25		/* unknow request type		*/
#define	RE_MMREJ	26		/* mandatory message reject	*/
#define	RE_IFAULT	27		/* SCSI interface fault		*/
#define	RE_SELECT_TO	28		/* Selection Timeout		*/
#define	RE_UBF		29		/* Unexpected Bus Free		*/
#define	RE_INV_PHASE	30		/* Invalid Phase		*/
#define	RE_UNIT_ATTN	31		/* Unit Attention		*/
#define	RE_NO_SPACE	32		/* No space in buffer for data	*/
#define	RE_NO_MEM	33		/* No memory available		*/
kê"Ö j  $        k  j‰*;˜ˆ*j‰*     þÀk  
              i  ./usr/include/sys/i386/ric.h t.h/*
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1988, 1989 IBM Corp.
 *	(c) Copyright 1988, 1989 Locus Computing Corporation
 *	All Rights Reserved
 *
 * ricreg.h	define constants and structures used in the cyclone
 *		device driver.
 * History:
 *   5/90  add write_ext structure, and constants	
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)ric.h	16.2	LCC)	/* Modified: 16:02:15 9/16/89 */

/*
 * Defines for task 0 (RCM) commands.
 */
#define RCM_INIT	 0	/* Initialize the coprocessor */
#define RCM_REQLD	 1	/* Request task load space */
#define RCM_FREEBUF	 2	/* Free RCM's input buffer from system unit */
#define RCM_REQLDBDRY	 3	/* Request task load space with boundry */
#define RCM_QUERYSTOR	 4	/* Request size of largest free storage block*/
#define RCM_STARTTASK	 5	/* Start the specified task */
#define RCM_STOPTASK	 6	/* Stop the specified task */
#define RCM_UNLOAD	 7	/* Unload the specified task */
#define RCM_SETDOGLEN	 8	/* Set watchdog timer duration */
#define RCM_ENABLEDOG	 9	/* Enable watchdog timer */
#define RCM_DISABLEDOG	10	/* Disable watchdog timer */
#define RCM_READDOG	11	/* Read watchdog timer duration */
#define RCM_REQLDLOW	12	/* Request task load in low memory */

/*
 * Macros to work arround unalligned elements in the BCB stucture.
 */
#define BCB_CMD(bp)	(*((unsigned char *)bp))
#define BCB_STATLNG(bp)	(*((unsigned short *)(bp+1)))
#define BCB_STATOFF(bp)	(*((unsigned short *)(bp+3)))
#define BCB_STATPAG(bp)	(*((unsigned char *)(bp+5)))
#define BCB_INLNG(bp)	(*((unsigned short *)(bp+6)))
#define BCB_INOFF(bp)	(*((unsigned short *)(bp+8)))
#define BCB_INPAG(bp)	(*((unsigned char *)(bp+10)))
#define BCB_OUTLNG(bp)	(*((unsigned short *)(bp+11)))
#define BCB_OUTOFF(bp)	(*((unsigned short *)(bp+13)))
#define BCB_OUTPAG(bp)	(*((unsigned char *)(bp+15)))

/*
 * flag for task number to an application interupt routine that
 * the rictask that it was attached to has been reloaded.
 */
#define TASK_RELOAD	0x8000

/*
 * NEEDSWORK
 * These parameters should be settable when RCM is loaded.
 */
#define MAXTASK		16	/* Maximum number of tasks on RIC */
#define MAXPRI		32	/* Up to 32 priority levels */
#define MAXQUEUE	16	/* We don't use user queues, got 16 though */
#define MAXTIME		16	/* Number of software timers */

/*
 * Primary status bit definitions.
 */
#define STAT_LOAD	1	/* process is loaded */
#define STAT_INIT	2	/* process is initialized */
#define STAT_INPUT	4	/* process is has input for system */
#define STAT_REBOOT	4	/* RCM only, RCM requests system reboot */
#define STAT_OUTPUT	010	/* proces is ready for output */
#define STAT_WATCHDOG	010	/* RCM only, watchdog timer active */
#define STAT_ERROR	020	/* process detected error */
#define STAT_SECSTAT	040	/* process has secondary status */
#define STAT_OUTBUSY	0100	/* process's output buffer is busy */
#define STAT_BUSY	0200	/* process is busy */

/*
 * ioctl command defines
 */
#define ICACMD		1
#define ICARESET	2
#define ICAINIT		3
#define ICACMDNOWAIT	4
#define ANOUNCETASK	5

/*
 * ioctl argument definition.
 */
#define MAXARG 30

struct riccmd {
	unsigned char task;
	unsigned char cmd;
	unsigned short arglen;
	unsigned char arg[MAXARG];
};

/*
 * structure to hold bcb information in a 386 convienent format.
 */
struct bcbptrs {
	long	statbuf;
	long	inbuf;
	long	outbuf;
};
/* ======== Date: 5/14/90  ======== */

/* Commands to ioctl()  */

#define ICA_STAT1	6
#define ICA_STAT2	7
#define ICA_ASYNC	8
#define ICA_NOASYNC	9
#define ICA_CHKSIG	10
#define ICA_QURIC	11

#define MAX2NDSTATBYTES	5   /* secondary status bytes are 5 bytes long */

/* since the real character special file associated with  */
/* ric is owned by root, application program can't        */
/* directly open this file.  To allow application         */
/* program to transfer data between tasks on ric and      */
/* tasks on system unit without exposing the entire       */ 
/* address space, one dummy special file will be          */
/* create for each ric.  This is done so that appl.       */
/* can open this dummy special file and perform i/o.      */
/* When the application program does a read/write/ioctl   */ 
/* on this this dummy device, it will be trapped to the   */ 
/* kernel and eventually the ric device driver (ric.c)    */ 
/* will service the system call.  The convention is to    */
/* associate a differnt minor number to each of the       */
/* dummy special file by adding 128 (that is to turn on   */
/* bit the 8th bit of the minor number) to the real minor */
/* numbers 0,1,2,3 (one for each card).  The major number */
/* will be kept the same as the one assigned for ric in   */ 
/* /etc/master.  In order to find out if a regular user   */ 
/* has opened a special file associated with a ric card,  */
/* the 8th bit will be tested.  The last 2 bits will      */
/* identify the card the user wants to i/o.               */  
/*                                                        */
/* Therefore: 128 ------> 10000000  (card 0)              */
/*            129         10000001  (card 1)              */
/*            130         10000010  (card 2)              */
/*            131         10000011  (card 3)              */

#define IS_DUMMY_MINOR    128 /* used as a test for dummy minor numbers */
                               /* The last 2 bit tells which card to seletct */

struct write_ext {
	unsigned char task, opcode;
};

/*
 * constants return by ioctl ICA_QURIC command
 */

#define PORTMASTER	0x10     /* Real Time Co-Proc. Portmaster adapter/A */
#define MULTIPORT2	0x15     /* Real Time Co-Proc. Multiport/2          */
#define X25	        0x20     /* X.25 Interface Co-Processor             */ 	
#define RIC		0x25     /* Real Time Co-Processor                  */
#define MULTIPORT       0x30	 /* Real Time Co-Processor Multiport        */
#define MULTIPORTM2    	0x35	 /* Real Time Co-Processor Multiport Model 2*/
#define UNKNOWNCARD    	0x40	 /* ioctl (ICA_QURIC) can't id. card's type */

routikê¦£ u  $        &  h‰*;˜ˆ*h‰*     °]&                    ./usr/include/sys/i386/rom.h t.h/*
 *	IBM Personal Computer IX/AT
 *		Version 1.00
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1984, 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Microsoft Corporation
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */


/*	SCCSID(@(#)rom.h	16.3	LCC)	/* Modified: 16:03:06 9/16/89 */


/*
 * THIS FILE CONTAINS CODE SPECIFIC TO THE PC/AT
 * COMPUTER. IT MAY REQUIRE MODIFICATION WHEN MOVING
 * XENIX TO DIFFERENT MACHINE ARCHITECTURES OR CONFIGURATIONS.
 */

/*
 *	Various PC/AT ROM bios dependent things
 */

struct hdpblk{			/* hard disk parameter block */
	char	ncpd[2];	/* (as organized in rom bios) */
	char	ntpc;
	char	notused[2];
	char	prcmp[2];
	char	superflous[5];
	char	lazone[2];
	char	nspt;
	char	reserved;
};

 
kê2º t  $        ö  h‰*<˜ˆ*h‰*     ’Yö  
                  ./usr/include/sys/i386/sa.h  t.h/*
 *	IBM Personal Computer IX/AT
 *		Version 1.00
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1984, 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Microsoft Corporation
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */


/*	SCCSID(@(#)sa.h	16.3	LCC)	/* Modified: 16:03:57 9/16/89 */


/*
 * THIS FILE CONTAINS CODE SPECIFIC TO THE PC/AT
 * COMPUTER. IT MAY REQUIRE MODIFICATION WHEN MOVING
 * XENIX TO DIFFERENT MACHINE ARCHITECTURES OR CONFIGURATIONS.
 */


/*
 * sa.h - defines for the 8250 ACE used in the ibm serial adapter.
 */


/*	Device layout	*/
#define RRBR	0	/* Reciever buffer register (ro) */
#define RTHR	0	/* transmitter holding register (wo) */
#define RIER	1	/* interrupt enable register */
#define RIIR	2	/* interrupt identification register */
#define RLCR	3	/* line control register */
#define RMCR	4	/* modem control register */
#define RLSR	5	/* line status register */
#define RMSR	6	/* modem status register */
#define RDLL	0	/* divisor latch low */
#define RDLH	1	/* divisor latch high */

/* interrupt enable register values */
#define ERBFI	0x01	/* reciever buffer full */
#define ETBEI	0x02	/* transmitter buffer empty */
#define ELSI	0x04	/* line status change */
#define EMSI	0x08	/* modem status change */

/* interrupt ident register values */
#define INPEND	0x01	/* interrupt not pending */
#define IRLS	0x06	/* reciever line status */
#define IRDA	0x04	/* recieved data available */
#define ITHR	0x02	/* transmitter holding register empty */
#define IMDMS	0x00	/* modem status- NOTE ZERO VALUE */

/* line control register */
#define LBITS5	0x00	/* five bit chars */
#define LBITS6	0x01	/* six bit chars */
#define LBITS7	0x02	/* seven bit chars */
#define LBITS8	0x03	/* eight bit chars */
#define LSTOP2	0x04	/* two stop bits instead of one */
#define LPARTY	0x08	/* parity on */
#define LEVEN	0x10	/* even parity */
#define LSTICK	0x20	/* stick parity */
#define LBREAK	0x40	/* set transmitter to space */
#define LDLAB	0x80	/* divisor latch access bit */

/* line status register */
#define LSDR	0x01	/* data ready */
#define LSOERR	0x02	/* overrun error */
#define LSPERR	0x04	/* parity error */
#define LSFERR	0x08	/* framing error */
#define LSBI	0x10	/* break interrupt */
#define LSTHRE	0x20	/* transmitter holding register empty */
#define LSTSRE	0x40	/* transmitter shift register empty */

/* modem status register */
#define MSDCTS	0x01	/* Delta Clear to send */
#define MSDDSR	0x02	/* Data set ready toggled */
#define MSTERI	0x04	/* trailing edge of ring indicator */
#define MSDRLSD	0x08	/* recieved line signal detect toggled */
#define MSCTS	0x10	/* Clear to send */
#define	MSDSR	0x20	/* Data set ready */
#define MSRI	0x40	/* Ring indicator */
#define MSRLSD	0x80	/* Recieved line signal detect */

/* modem control register */
#define MCDTR	0x01	/* data terminal ready */
#define MCRTS	0x02	/* request to send */
#define MCOUT1	0x04	/* output 1 */
#define MCOUT2	0x08	/* output 2 */
#define MCLOOP	0x10	/* loopback mode */

t kêÚÀ   $        ë  M‰*<˜ˆ*M‰*     î½ë  	                  ./usr/include/sys/i386/scalls.h #ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)scalls.h	16.6	AIX)	/* Modified: 20:30:32 3/6/90 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#define ACCEPT 174
#define ACCESS 33
#define ACCT 51
#define ADJTIME 211
#define ASYNC_DAEMON 236
#define BRK 17
#define CHDIR 12
#define CHFSTORE 110
#define CHHIDDEN 111
#define CHLWM 143
#define CHMOD 15
#define CHOWNX 203
#define CHROOT 61
#define CLOSE 6
#define CLOSEX 106
#define CONNECT 176
#define CREAT 8
#define DIRSTAT 200
#define DISCLAIM 201
#define DUP 41
#define DUSTAT 115
#define ESNREG 99
#define ESNV 100
#define EXEC 11
#define EXECE 59
#define EXIT 1
#define FABORT 134
#define FCHMOD 212
#define FCHOWNX 205
#define FCLEAR 202
#define FCNTL 62
#define FCOMMIT 112
#define FORK 2
#define FSTATX 249
#define FSYNC 206
#define FTRUNCATE 207
#define GETDOMAINNAME 237
#define GETDTABLESIZE 215
#define GETGID 47
#define GETGROUPS 229
#define GETHOSTID 177
#define GETHOSTNAME 178
#define GETITIMER 216
#define GETLOCAL 117
#ifdef _MBCS
#define	GETCHARTBL 171
#endif /* _MBCS */
#define GETPAGESIZE 217
#define GETPEERNAME 179
#define GETPID 20
#define GETPRIORITY 218
#define GETRLIMIT 219
#define GETRUSAGE 220
#define GETSITES 118
#define GETSOCKNAME 180
#define GETSOCKOPT 181
#define GETSPATH 119
#define GETTIMEOFDAY 182
#define GETUID 24
#define GETXPERM 121
#define GETXVERS 120
#define GTTY 32
#define HFT_FSCREEN 103
#define IOCTL 54
#define IOCTLX 109
#define JOURNAL 124
#define KILL 37
#define KILL3 122
#define LINK 9
#define LISTEN 183
#define LMKNOD 123
#define LOADTBL 233
#define LOCK 45
#define LOCKF 149
#define MIGRATE 125
#define MKDIR 80
#define MKESN 101
#define MKNOD 14
#define MOUNT 21
#define MSGSYS 49
#define NETCTRL 126
#define NETTIME 145
#define NFSSVC 210
#define NFS_LOCKF 234
#define NFS_MOUNT 235
#define NICE 34
#define OPEN 5
#define OPENX 105
#define PAUSE 29
#define PIPE 42
#define PROBE 129
#define PROFIL 44
#define PTRACE 26
#define QUOTA 221
#define RACCEPT 146
#define READ 3
#define READLINK 147
#define READV 184
#define READX 107
#define REBOOT 239
#define RECV 185
#define RECVFROM 186
#define RECVMSG 187
#define RENAME 222
#define REXECE 130
#define RFORK 131
#define RMDIR 79
#define RMSLINK 132
#define RUNE 133
#define SEEK 19
#define SELECT 188
#define SEMCTL 102
#define SEMSYS 53
#define SEND 189
#define SENDMSG 190
#define SENDTO 191
#define SETDOMAINNAME 238
#define SETGID 46
#define SETGROUPS 230
#define SETHOSTID 192
#define SETHOSTNAME 193
#define SETITIMER 223
#define SETLOCAL 136
#ifdef _MBCS
#define	SETCHARTBL 170
#endif /* _MBCS */
#define SETPGID 148
#define SETPGRP 39
#define SETPRIORITY 224
#define SETQUOTA 226
#define SETREGID 209
#define SETREUID 208
#define SETRLIMIT 225
#define SETSITES 137
#define SETSID 35
#define SETSOCKOPT 194
#define SETSPATH 138
#define SETTIMEOFDAY 195
#define SETUID 23
#define SETXPERM 140
#define SETXUID 141
#define SETXVERS 139
#define SHMSYS 52
#define SIGACTION 244
#define SIGPENDING 246
#define SIGPROCMASK 245
#define SIGRETURN 166
#define SIGSTACK 168
#define SIGSUSPEND 247
#define SITEPID 142
#define SOCKET 197
#define SOCKETBIND 175
#define SOCKETPAIR 198
#define SOCKETSHUTDOWN 196
#define SPROPIN 150
#define STATX 248
#define STIME 25
#define STTY 31
#define	SWAPCTL	58
#define SUPLPID 104
#define SYMLINK 152
#define SYNC 36
#define SYSCONF 250
#define SYSSTART 40
#define TIME 13
#define TIMES 43
#define TRUNCATE 227
#define ULIMIT 63
#define UMASK 60
#define UMOUNT 22
#define UNLINK 10
#define USRINFO 204
#define UTIME 30
#define UTIMES 228
#define UTSSYS 57
#define VHANGUP 153
#define VLIMIT 154
#define VM86 88
#define VTIMES 155
#define WAIT 7
#define WAIT3 156
#define WAITPID	135
#define WRITE 4
#define WRITEV 199
#define WRITEX 108
r datkêdI Ü  $        3  p‰*šˆ*p‰*     1r3  	              *U  ./usr/include/sys/i386/scsi.h h #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)scsi.h	1.7	AIX)	/* Modified: 17:52:14 4/8/92 */



/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * scsi.h
 *
 * This file defines the various structurs, bits, and stuff for general SCSI
 * as used by this device driver.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	------	-----	---------------------------------------------
 * 0.00		5/1/88	GGS	Original code entry
 * 0.10		8/20/89	GGS	Split card structures into ibmscsi.h
 * 0.20		3/16/92	sanjay	Added class 2 and 5 structure and commands
 *
 */

#define	MAX_SCSI	8		/* max scsi id's		*/
#define	MAX_LUN		8		/* max logical units		*/

struct	scsi_0				/* Class 0 SCSI command block	*/
	     {
	     uchar	cmd;
	     uchar	lun;
	     uchar	cmd_spec[3];
	     uchar	flags;
	     };

/*
 * Class 0 SCSI Commands
 */
#define	SC0_TUR		0x00		/* Test Unit Ready		*/
#define	SC0_RZU		0x01		/* Re-Zero Unit			*/
#define	SC0_RS		0x03		/* Request Sense		*/
#define	SC0_FU		0x04		/* Format Unit			*/
#define	SC0_RBL		0x05		/* Read Block Limits		*/
#define	SC0_RAB		0x07		/* Re-Assign Blocks		*/
#define	SC0_RD		0x08		/* Read				*/
#define	SC0_WR		0x0A		/* Write			*/
#define	SC0_SK		0x0B		/* Seek				*/
#define	SC0_RRV		0x0F		/* Read Reverse			*/
#define	SC0_WFM		0x10		/* Write File Marks		*/
#define	SC0_SPC		0x11		/* Space			*/
#define	SC0_INQ		0x12		/* Inquiry			*/
#define	SC0_VER		0x13		/* Verify			*/
#define	SC0_RBD		0x14		/* Recover Buffered Data	*/
#define	SC0_MSL		0x15		/* Mode Select			*/
#define	SC0_RES		0x16		/* Reserve Unit			*/
#define	SC0_REL		0x17		/* Release Unit			*/
#define	SC0_CPY		0x18		/* Copy				*/
#define	SC0_ERS		0x19		/* Erase			*/
#define	SC0_MSN		0x1A		/* Mode Sense			*/
#define	SC0_SSU		0x1B		/* Start/Stop Unit		*/
#define	SC0_RDR		0x1C		/* Receive Diagnostic Results	*/
#define	SC0_SD		0x1D		/* Send Diagnostic		*/
#define	SC0_PAR		0x1E		/* Prevent/Allow Media Removal	*/

/*
 * Class 0 SCSI Commands
 *	Direct Access Devices
 */
#define	SC0_DA_TUR	0x0100		/* Test Unit Ready		*/
#define	SC0_DA_RZU	0x0101		/* Re-Zero Unit			*/
#define	SC0_DA_RS	0x0103		/* Request Sense		*/
#define	SC0_DA_FU	0x0104		/* Format Unit			*/
#define	SC0_DA_RAB	0x0107		/* Re-Assign Blocks		*/
#define	SC0_DA_RD	0x0108		/* Read				*/
#define	SC0_DA_WR	0x010A		/* Write			*/
#define	SC0_DA_SK	0x010B		/* Seek				*/
#define	SC0_DA_INQ	0x0112		/* Inquiry			*/
#define	SC0_DA_MSL	0x0115		/* Mode Select			*/
#define	SC0_DA_RES	0x0116		/* Reserve Unit			*/
#define	SC0_DA_REL	0x0117		/* Release Unit			*/
#define	SC0_DA_CPY	0x0118		/* Copy				*/
#define	SC0_DA_MSN	0x011A		/* Mode Sense			*/
#define	SC0_DA_SSU	0x011B		/* Start/Stop Unit		*/
#define	SC0_DA_RDR	0x011C		/* Receive Diagnostic Results	*/
#define	SC0_DA_SD	0x011D		/* Send Diagnostic		*/
#define	SC0_DA_PAR	0x011E		/* Prevent/Allow Media Removal	*/

/*
 * Class 0 SCSI Commands
 *	Sequential Access Devices
 */
#define	SC0_SA_TUR	0x0200		/* Test Unit Ready		*/
#define	SC0_SA_REW	0x0201		/* Rewind			*/
#define	SC0_SA_RS	0x0203		/* Request Sense		*/
#define	SC0_SA_RBL	0x0205		/* Read Block Limits		*/
#define	SC0_SA_RD	0x0208		/* Read				*/
#define	SC0_SA_WR	0x020A		/* Write			*/
#define	SC0_SA_TSL	0x020B		/* Track Select			*/
#define	SC0_SA_RRV	0x020F		/* Read Reverse			*/
#define	SC0_SA_WFM	0x0210		/* Write File Marks		*/
#define	SC0_SA_SPC	0x0211		/* Space			*/
#define	SC0_SA_INQ	0x0212		/* Inquiry			*/
#define	SC0_SA_VER	0x0213		/* Verify			*/
#define	SC0_SA_RBD	0x0214		/* Recover Buffered Data	*/
#define	SC0_SA_MSL	0x0215		/* Mode Select			*/
#define	SC0_SA_RES	0x0216		/* Reserve Unit			*/
#define	SC0_SA_REL	0x0217		/* Release Unit			*/
#define	SC0_SA_CPY	0x0218		/* Copy				*/
#define	SC0_SA_ERS	0x0219		/* Erase			*/
#define	SC0_SA_MSN	0x021A		/* Mode Sense			*/
#define	SC0_SA_LUL	0x021B		/* Load/Unload			*/
#define	SC0_SA_RDR	0x021C		/* Receive Diagnostic Results	*/
#define	SC0_SA_SD	0x021D		/* Send Diagnostic		*/
#define	SC0_SA_PAR	0x021E		/* Prevent/Allow Media Removal	*/

/*
 * Class 0 SCSI Commands
 *	Printer Devices
 */
#define	SC0_PR_TUR	0x0300		/* Test Unit Ready		*/
#define	SC0_PR_RS	0x0303		/* Request Sense		*/
#define	SC0_PR_FMT	0x0304		/* Format			*/
#define	SC0_PR_PRT	0x030A		/* Print			*/
#define	SC0_PR_SLP	0x030B		/* Slew and Print		*/
#define	SC0_PR_FLH	0x0310		/* Flush Buffer			*/
#define	SC0_PR_INQ	0x0312		/* Inquiry			*/
#define	SC0_PR_RBD	0x0314		/* Recover Buffered Data	*/
#define	SC0_PR_MSL	0x0315		/* Mode Select			*/
#define	SC0_PR_RES	0x0316		/* Reserve Unit			*/
#define	SC0_PR_REL	0x0317		/* Release Unit			*/
#define	SC0_PR_CPY	0x0318		/* Copy				*/
#define	SC0_PR_MSN	0x031A		/* Mode Sense			*/
#define	SC0_PR_STP	0x031B		/* Stop Print			*/
#define	SC0_PR_RDR	0x031C		/* Receive Diagnostic Results	*/
#define	SC0_PR_SD	0x031D		/* Send Diagnostic		*/

/*
 * Class 0 SCSI Commands
 *	Processor Devices
 */
#define	SC0_PU_TUR	0x0400		/* Test Unit Ready		*/
#define	SC0_PU_RS	0x0403		/* Request Sense		*/
#define	SC0_PU_RCV	0x0408		/* Receive			*/
#define	SC0_PU_SND	0x040A		/* Send				*/
#define	SC0_PU_INQ	0x0412		/* Inquiry			*/
#define	SC0_PU_CPY	0x0418		/* Copy				*/
#define	SC0_PU_RDR	0x041C		/* Receive Diagnostic Results	*/
#define	SC0_PU_SD	0x041D		/* Send Diagnostic		*/

/*
 * Class 0 SCSI Commands
 *	Direct Access Read Only Devices
 */
#define	SC0_RO_TUR	0x0500		/* Test Unit Ready		*/
#define	SC0_RO_RZU	0x0501		/* Re-Zero Unit			*/
#define	SC0_RO_RS	0x0503		/* Request Sense		*/
#define	SC0_RO_RD	0x0508		/* Read				*/
#define	SC0_RO_SK	0x050B		/* Seek				*/
#define	SC0_RO_INQ	0x0512		/* Inquiry			*/
#define	SC0_RO_MSL	0x0515		/* Mode Select			*/
#define	SC0_RO_RES	0x0516		/* Reserve Unit			*/
#define	SC0_RO_REL	0x0517		/* Release Unit			*/
#define	SC0_RO_CPY	0x0518		/* Copy				*/
#define	SC0_RO_MSN	0x051A		/* Mode Sense			*/
#define	SC0_RO_SSU	0x051B		/* Start/Stop Unit		*/
#define	SC0_RO_RDR	0x051C		/* Receive Diagnostic Results	*/
#define	SC0_RO_SD	0x051D		/* Send Diagnostic		*/
#define	SC0_RO_PAR	0x051E		/* Prevent/Allow Media Removal	*/

/*
 * Class 0 SCSI Commands
 *	Communications Devices
 */
#define	SC0_CM_TUR	0x0900		/* Test Unit Ready		*/
#define	SC0_CM_RS	0x0903		/* Request Sense		*/
#define	SC0_CM_SMSGA	0x0905		/* Send Message (ALTERNATE)	*/
#define	SC0_CM_GMSG	0x0908		/* Get Message			*/
#define	SC0_CM_SMSG	0x090A		/* Send Message			*/
#define	SC0_CM_INQ	0x0912		/* Inquiry			*/
#define	SC0_CM_MSL	0x0915		/* Mode Select			*/
#define	SC0_CM_MSN	0x091A		/* Mode Sense			*/
#define	SC0_CM_SD	0x091D		/* Send Diagnostic		*/
#define	SC0_CM_RLOG	0x091F		/* Read Log			*/

/*
 * Class 1 SCSI Command Block
 */
struct	scsi_1
	     {
	     uchar	cmd;
	     uchar	lun;
	     uchar	cmd_spec[7];
	     uchar	flags;
	     };

/*
 * Class 1 Commands
 */
#define	SC1_RC		0x25		/* Read Capacity		*/
#define	SC1_RD		0x28		/* Read				*/
#define	SC1_WR		0x2A		/* Write			*/
#define	SC1_SK		0x2B		/* Seek				*/
#define	SC1_WRV		0x2E		/* Write and Verify		*/
#define	SC1_VER		0x2F		/* Verify			*/
#define	SC1_SDH		0x30		/* Search Data High		*/
#define	SC1_SDE		0x31		/* Search Data Equal		*/
#define	SC1_SDL		0x32		/* Search Data Low		*/
#define	SC1_SLM		0x33		/* Set Limits			*/
#define	SC1_CMP		0x39		/* Compare			*/
#define	SC1_CPV		0x3A		/* Copy and Verify		*/


/*
 * Class 2 SCSI Command Block
 */
struct	scsi_2
	     {
	     uchar	cmd;
	     uchar	lun;
	     uchar	cmd_spec[7];
	     uchar	flags;
	     };

/*
 * Class 2 SCSI Commands
 */
#define	SC2_RSC		0x42		/* Read Sub-Channel		*/
#define	SC2_RTOC	0x43		/* Read TOC			*/
#define	SC2_RHDR	0x44		/* Read Header			*/
#define	SC2_PA		0x45		/* Play Audio 			*/
#define	SC2_PAM		0x47		/* Play Audio MSF		*/
#define	SC2_PAT		0x48		/* Play Audio Track/Index 	*/
#define	SC2_PATR	0x49		/* Play Audio Trk Relative 	*/
#define	SC2_PAR		0x4b		/* Pause/Resume			*/

/*
 * Class 2 Commands
 *	Direct Access Read Only Devices
 */
#define	SC2_RO_RSC	0x0542		/* Read Sub-Channel		*/
#define	SC2_RO_RTOC	0x0543		/* Read TOC			*/
#define	SC2_RO_RHDR	0x0544		/* Read Header			*/
#define	SC2_RO_PA	0x0545		/* Play Audio 			*/
#define	SC2_RO_PAM	0x0547		/* Play Audio MSF		*/
#define	SC2_RO_PAT	0x0548		/* Play Audio Track/Index 	*/
#define	SC2_RO_PATR	0x0549		/* Play Audio Trk Relative 	*/
#define	SC2_RO_PAR	0x054b		/* Pause/Resume			*/

/*
 * MSF flag bit. MSF bit in the SCSI command indicates if the address
 * is in MSF format or is a Logical Block Address
 */
#define MSF_OFF 0x00
#define MSF_ON	0x02

/*
 * Class 5 SCSI Command Block
 */
struct	scsi_5
	     {
	     uchar	cmd;
	     uchar	lun;
	     uchar	cmd_spec[9];
	     uchar	flags;
	     };

/*
 * Class 5 SCSI Commands
 *	Direct Access Read Only Devices
 */

#define	SC5_RO_PA	0x05a5		/* Play audio( 12 bytes) */

/*
 * Class 6 SCSI Commands
 */
struct	scsi_6
	     {
	     uchar	cmd;
	     uchar	lun;
	     uchar	data[8];
	     };

/*
 * SCSI Sense Data Block
 */
struct	sdb
	     {
	     uchar	err_class;
	     uchar	lba[3];
	     };

#define	SDB_ADV		0x80	/* sense data block address valid	*/
#define	get_sdb_class(x)	(((x)->err_class & 0x70) >> 4)
#define	get_sdb_ercode(x)	((x)->err_class & 0x0F)
#define	get_sdb_lba(x)		((((x)->lba[0] & 0x1F) << 16)\
				| ((x)->lba[1] << 8)\
				| (x)->lba[2])
#define	get_sdb_vlba(x)		((x)->err_class & SDB_ADV) ? get_sdb_lba(x)\
							   : -1 )

/*
 * SCSI Extended Sense Data Block
 */
struct	esdb
	     {
	     uchar	err_class;
	     uchar	seg_num;
	     uchar	sense_key;
	     uchar	info[4];
	     uchar	addtnl_len;
	     uchar	addtnl_sense[1];
	     };

typedef	struct	esdb	ESDB;

#define	EXT_SENSE	0x07	/* data block is an extended data block	*/

#define	EXT_STDFMT	0x00	/* data block is standard format	*/
#define	EXT_VUQFMT	0x0F	/* data block is vendor unique format	*/

#define	EXT_FM		0x80	/* filemark was reached on seq device	*/
#define	EXT_EM		0x40	/* end of medium was reached on seq dev	*/
#define	EXT_IL		0x20	/* logical block len did not match dev	*/

#define	EXT_SNS_NONE	0x00	/* no sense				*/
#define	EXT_SNS_RCOV	0x01	/* recovered error			*/
#define	EXT_SNS_NRDY	0x02	/* not ready				*/
#define	EXT_SNS_MDME	0x03	/* medium error				*/
#define	EXT_SNS_HWER	0x04	/* hardware error			*/
#define	EXT_SNS_ILRQ	0x05	/* illegal request			*/
#define	EXT_SNS_UATN	0x06	/* unit attention			*/
#define	EXT_SNS_DPROT	0x07	/* data protect				*/
#define	EXT_SNS_BLCHK	0x08	/* blank check				*/
#define	EXT_SNS_VUQ	0x09	/* vendor unique			*/
#define	EXT_SNS_CPABT	0x0A	/* copy aborted				*/
#define	EXT_SNS_ABTCMD	0x0B	/* aborted command			*/
#define	EXT_SNS_EQL	0x0C	/* equal				*/
#define	EXT_SNS_VOFL	0x0D	/* volume overflow			*/
#define	EXT_SNS_MCMP	0x0E	/* miscompare				*/

#define	get_ext_sense(x)	((x)->sense_key & 0x0F)
#define	at_file_mark(x)		((x)->sense_key & EXT_FM)
#define at_end_medium(x)	((x)->sense_key & EXT_EM)
#define bad_block_len(x)	((x)->sense_key & EXT_IL)

/*
 * The following are definitions of the bytes 12 & 13 in the extended sense
 * data.  They correspond to addtnl_sense[4] & addtnl_sense[5].
 */
#define	AS_NOW_READY	0x0028	/* not ready to ready transition	*/
#define	AS_RESET	0x0029	/* reset occurred			*/

/*
 * Read Device Capacity Status Block
 */
struct	devcapsb
	     {
	     uchar	llba[4];
	     uchar	block_len[4];
	     };

#define	get_llba(x)	( (((daddr_t)(x)->llba[0]) << 24)\
			| (((daddr_t)(x)->llba[1]) << 16)\
			| (((daddr_t)(x)->llba[2]) << 8)\
			| (daddr_t)(x)->llba[3])

#define	get_blklen(x)	( (((daddr_t)(x)->block_len[0]) << 24)\
			| (((daddr_t)(x)->block_len[1]) << 16)\
			| (((daddr_t)(x)->block_len[2]) << 8)\
			| (daddr_t)(x)->block_len[3])

/*
 * Device Inquiry Data Block
 */
struct	didb
	     {
	     uchar	major_type;
	     uchar	minor_type;
	     uchar	standards;
	     uchar	rsvd1;
	     uchar	addtnl_len;
	     uchar	rsvd2;
	     ushort	rsvd3;
	     uchar	vend_id[8];
	     uchar	prod_id[16];
	     uchar	rev_lvl[4];
	     uchar	date[8];
	     };

#define	DID_RMB		0x80	/* removable media bit			*/
#define	get_perfq(x)	(((x)->major_type & 0xe0) >> 5)
#define	get_perfdev(x)	(x)->major_type & 0x1f)
#define	get_typeq(x)	((x)->minor_type & ~DID_RMB)
#define get_rmb(x)	((x)->minor_type & DID_RMB)
#define	get_ISO(x)	(((x)->standards & 0xC0) >> 6)
#define get_ECMA(x)	(((x)->standards & 0x38) >> 3)
#define	get_ANSI(x)	((x)->standards & 0x07)

#define	SCSI_DEV_TYPES	32	/* number of SCSI device types		*/
#define	DEV_DA		0x00	/* direct access device			*/
#define	DEV_SA		0x01	/* sequential access device		*/
#define	DEV_PRT		0x02	/* printer device			*/
#define	DEV_CPU		0x03	/* processor device			*/
#define	DEV_WORM	0x04	/* write once read multiple		*/
#define	DEV_RODA	0x05	/* read only direct access device	*/
#define	DEV_SCAN	0x06	/* scanner device type			*/
#define	DEV_OPT		0x07	/* optical memory device		*/
#define	DEV_JUKE	0x08	/* Changer devices (ie a jukebox)	*/
#define	DEV_COMM	0x09	/* communications device		*/
#define	DEV_NOTPRES	0x7F	/* device not present			*/
kê, Û  $        ¦  p‰*šˆ*p‰*     Û¡¦  	                  ./usr/include/sys/i386/scsi_comm.h  .h  #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)scsi_comm.h	1.3	AIX)	/* Modified: 14:38:00 2/9/90 */


/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * scsi_comm.h
 *
 * This file contains the definitions for structures and such that are useful
 * for communications devices that may be attached to the SCSI bus.  Most of
 * these definitions came from other files but are now being consolidated here.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	------	-----	---------------------------------------------
 * 0.00		11/24/89 GGS	Original code entry
 *
 */

#ifndef	_scsi_comm
#define	_scsi_comm
/*
 * The following structure is the means of communcitcation between the 
 * interrupt routine and the rest of a communications device driver.  It is
 * indended that these buffers be strung together to form a queue that can
 * be processed by higher level routines.
 */
struct	buffer_queue
	     {
	     struct buffer_queue	*next;
	     int			flags;
	     long			data_len;
	     char	FAR		*cbufp;
	     char	FAR		*buff;
	     };

typedef	struct	buffer_queue	BUF_Q;

#define	BUFQ_FILLED	0x0001	/* buffer was filled by interrupt rtn	*/
#define	BUFQ_ERROR	0x0002	/* error received while working on buff	*/
#endif

ddkê¬ƒ Ú  $        º  p‰*šˆ*p‰*     Ø¡º  	                  ./usr/include/sys/i386/scsi_cpu.h   .h  #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)scsi_cpu.h	1.6	AIX)	/* Modified: 14:20:19 2/9/90 */


/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * scsi_cpu.h
 *
 * This file contains the defines that define the requests for the sample 
 * CPU device driver.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	-------	-----	----------------------------------------------
 * 0.00		3/19/89	GGS	Original Code Entry
 *
 */
#include <scsicpu.h>		/* OS specific parts of sample driver	*/
#include <scsi_comm.h>		/* defines communctions buffer		*/

/*
 * The following are the defines for the generic routines to make them
 * specific to the CPU routine.
 */
extern	BUF_Q	FAR	*get_free_buffer();
#define	get_free_buff()	get_free_buffer( &buff_freep, max_target_buff_len )

/*
 * The following are the driver specific requests supported by the sample
 * CPU device driver.
 */
#define	REQ_TARGET_RD		(REQ_SOFT | 0)
#define	REQ_TARGET_CLOSE	(REQ_SOFT | 1)

/*
 * The following are the driver specific states supported by the sample CPU
 * device driver.
 */
#define	TARGET_READ		(DSOFT_STATE | 0)

/*
 * The following is the structure that defines the device's specific state.
 */
struct	scsi_cpu_state
	     {
	     BUF_Q FAR	*procd_qh;	/* processed buffer queue head	*/
	     BUF_Q FAR	*procd_qt;	/* processed buffer queue tail	*/
	     WAITP FAR	*wait_qh;	/* buffer wait queue head	*/
	     WAITP FAR	*wait_qt;	/* buffer wait queue tail	*/
	     };

typedef	struct	scsi_cpu_state	SCSI_CPU_STATE;


/*
 * This structure will define what a configuration entry looks like for the
 * CPU class.  Since the configuration structures have to reside in a very
 * restricted place on disk, we will try to make them as small as possible.
 */
struct	scsi_cpu_config
	     {
	     GEN_CONFIG		gen;	/* generic configuration	*/
	     ulong	reserved;	/* reserved bits		*/
	     };

typedef	struct	scsi_cpu_config	SCSI_CPU_CONFIG;

#define	SCSI_CPU_CONFIG_LEN	sizeof( SCSI_CPU_CONFIG )

#define	SCSI_CPU_CONFIG_VER	1
n			*/kêè Ù  $        ¸  p‰*šˆ*p‰*     4r¸  	                  ./usr/include/sys/i386/scsi_dasd.h  .h  #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)scsi_dasd.h	1.5.1.2	AIX)	/* Modeified: 14:06:47 10/28/91 */



/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * scsi_dasd.h
 *
 * This file contains the defines that are specific to the DASD device driver
 * but are not specific to a particular OS.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	-------	-----	----------------------------------------------
 * 0.00		3/07/89	GGS	Original Code Entry
 *
 */
#include <sys/i386/dasd.h>

/*
 * The following are requests that are specific to the DASD device driver.
 */
#define	DASD_CLOSE_REQ	(REQ_SOFT | 0)

/*
 * The following are sub-states that are required to move through the
 * close request.
 */
#define	DASD_CLOSE_STOP		(REQ_STAGED | 1)
#define	DASD_CLOSE_REMOVE	(REQ_STAGED | 2)
#define	DASD_CLOSE_COMPLETE	(REQ_STAGED | 3)
#define	DASD_CLOSE_RESERVE	(REQ_STAGED | 4)
#define	DASD_CLOSE_RELEASE	(REQ_STAGED | 5)

/*
 * The following structure defines the DASD specific device state.
 */
struct	dasd_state
	     {
	     daddr_t	capacity;	/* capacity of the drive	*/
	     ulong	block_size;	/* size of a block on the drive	*/
	     PARTENTS	FAR	*parts[1];	/* partition table	*/
	     };

typedef	struct	dasd_state	DASD_STATE;

/*
 * This structure defines a generic configuration entry that should be used
 * as part of all of the individual configuration structures.
 */
struct	gen_config
	     {
	     ulong	allocated :  1;	/* 1=record is in use		*/
	     ulong	ignore    :  1; /* ignore this record		*/
	     ulong      empty     :  1; /* can be re-used		*/
	     ulong	shared    :  1; /* shared device		*/
	     ulong	no_delete :  1;	/* don't delete if not found	*/
	     ulong	no_reasgn :  1;	/* don't re-assign device	*/
	     ulong	lun       :  3;	/* lun of the device		*/
	     ulong	scsi_id	  :  3;	/* SCSI ID of the device	*/
	     ulong	cardno	  :  4;	/* card number of the device	*/
	     ulong	external  :  1; /* 1=device is external		*/
	     ulong	reserved  : 15;	/* reserved bits		*/
	     };

typedef	struct	gen_config	GEN_CONFIG;

/*
 * This structure will define what a configuration entry looks like for the
 * DASD class.  Since the configuration structures have to reside in a very
 * restricted place on disk, we will try to make them as small as possible.
 */
struct	dasd_config
	     {
	     GEN_CONFIG		gen;	/* generic configuration	*/
	     ulong	mini_disk :  1;	/* use mini-disks on device	*/
	     ulong	rec_type  :  5;	/* type of record		*/
#define	DASD_CNF_NVLD	0		/* invalid record type			*/
#define	DASD_CNF_DISK	1		/* record describes a single disk	*/
	     ulong	reserved  : 26;	/* reserved bits		*/
	     };

typedef	struct	dasd_config	DASD_CONFIG;

#define	DASD_CONFIG_LEN		sizeof( DASD_CONFIG )

#define	DASD_CONFIG_VER		1
kê¦ß Ø  $        š5  q‰*šˆ*q‰*     X£š5  	              Z£  ./usr/include/sys/i386/scsi_dd_rtns.h   #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)scddrtns.h	1.6	AIX)	/* Modified: 09:39:21 8/2/91 */

/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */


/*
 * scsi_dd_rtns.h
 *
 * This file defines the structures that are used by the channel manager which
 * allows a device driver to place some device knowledge into the channel
 * manager.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	------	-----	---------------------------------------------
 * 0.00		6/1/89	GGS	Split structures and defines out of state.h
 *
 */

/*
 * The following macro is used to convert a device number into a device
 * mask.
 */
#define	dev_to_mask( d )	(1 << (d))

/*
 * The following is an entry into a table that maps the device number to a
 * triplet of card #, SCSI ID, and LUN.  
 */
union	dev_num_map
	     {
	     struct
	          {
	          int	cardno;		/* index into card map		*/
	          int	scsi_id;	/* SCSI ID of the device	*/
	          int	lun;		/* Logical Unit Number of dev	*/
		  char	ignore;		/* flag to ignore entry		*/
		  }	dev;		/* device entry			*/
	     struct
		  {
		  int	card_index;	/* index into state info	*/
		  char	present;	/* card is present		*/
		  }	card;		/* card entry			*/
	     };

typedef	union	dev_num_map	DEV_NUM_MAP;

/*
 * The following is a switch table entry for use with different device
 * types.  The device driver has an array of these entries that is used
 * to support the various devices.  A device type is used as an index
 * into the array and the appropriate routine is called to support the
 * specifics of the device.
 * 
 * Note:  There can be more than one entry for a device type.  The entry
 *        is pointed to by the device's state entry.  The dev_init routine
 *        is called for each set of routines in a chain for a particular
 *        device type.  The first dev_init routine that can initialize the
 *        device sets the pointer in the device's state entry to point to
 *        the switch table entry.
 *
 *        This mechanism allows multiple routines to service one device
 *        type AND allows the selection of which routine called to be very
 *        fast.  The only time when the list is scanned is when the device
 *        is initialized, which needs to be fast but does is not repeatedly
 *        called as are the other routines.
 *
 *        At this point it is unclear if the pointer in the device's state
 *        entry should be set to NULL at the final close.  If it is, then
 *        the generic open routine should check for NULL (it will anyway)
 *        and if it is, will call the dev_init routines to try to set the
 *        pointer in the device's state entry.
 */

/*
 * The following structure allows vendor unique routines to be added to 
 * support the vendor unique commands for a particular device type.  The
 * first field is used when there are multiple sets of vendor unique
 * commands that need to be supported under the same device driver.  It 
 * points to other vendor unique routine command blocks.
 *
 * The next set of fields are what are returned from a device inquiry
 * command.  If the first byte of the ASCII field (in this structure) is
 * the NUL character, then that field will not be used to determine the
 * match for the record.  The fields are compared with what is in the 
 * device inquiry command and if there is a suitable match then these
 * routines will be installed in the device's state table.
 *
 * The table of routines, is accessed by an index.  It is assumed that the
 * same table ordering will hold for each device type (ie all devices of the
 * same type will have the same set of routines).  If a device does not
 * support a particular command, then that table entry should be set to NULL.
 *
 * This structure allows the higher level device driver to use the vendor
 * unique functions that are not part of the general SCSI standard but are
 * useful to the device driver and/or the user without having to know the
 * specifics of the individual vendor unique command blocks which will 
 * probably be different from vendor to vendor.
 */
struct	vend_uniq_rtns
	     {
	     struct vend_uniq_rtns	*next;
	     uchar		dev_type;	/* device type		*/
	     uchar		dev_type_qual;	/* type qualifier	*/
	     int		num_lus;	/* # of LU_DEF structs needed */
	     int		vu_dev_flags;	/* vendor uniq dev flags*/
	     int		vu_time_out;	/* vendor uniq time out	*/
	     time_t		close_delay;	/* delay before close	*/
	     uchar		vendor[9];	/* vendor name		*/
	     uchar		product[17];	/* product name		*/
	     uchar		revision[5];	/* revision level	*/
	     uchar		firmware_date[9]; /* firmware date	*/
	     int		vurtn_len;	/* # of entries in tbl	*/
	     int		(**vurtn_table)();/* table of vu rtns	*/
	     };

typedef	struct	vend_uniq_rtns	VEND_UNIQ_RTNS;

/*
 * The following are bits used in the vendor unique device flags.
 */
#define	VUDEVF_SKIP_LUS		0x0001	/* skip lus when lun <> 0	*/
#define	VUDEVF_NOSYNC		0x0002	/* don't use syncronous comm	*/
#define	VUDEVF_NODISC		0x0004	/* don't let device disconnect	*/
#define	VUDEVF_NRSU		0x0008	/* Start Unit can return !READY	*/
#define	VUDEVF_NOMINIT		0x0010	/* device doesn't support Multi-Initiator */
#define	VUDEVF_NORESERVE	0x0020	/* don't try to reserve device	*/

/*
 * The following structure defines what timeout to use when a device busy
 * is encountered.
 */
struct	busy_list
	     {
	     int		flags;		/* flags for BUSY	*/
	     int		max_repeats;	/* max # times to repeat*/
	     int		length;		/* # of timeouts	*/
	     int		*timeouts;	/* timeout values	*/
	     };

typedef	struct	busy_list	BUSY_LIST;

/*
 * The following defines are used in the flags field of the BUSY_LIST structure.
 */
#define	BUSY_REPEAT	0x0001	/* repeat through array until not busy	*/

/*
 * The following structure defines a device "class".  A device class is usually associated
 * with a higher level device driver (ie a single MAJOR number in AIX terminology).
 */
struct	dev_class
	     {
	     struct dev_class	FAR	*next_class;	/* ptr to next class structure	*/
	     char		FAR	*class_name;	/* ptr to name of class		*/
	     int			class_flags;	/* flags about the class	*/
	     DEV_NUM_MAP	FAR	*map_table;	/* ptr to mapping table		*/
	     int			map_len;	/* length of mapping table	*/
	     char		FAR	*config_data;	/* ptr to config data		*/
	     CLASS_REC		FAR	*config_hdr;	/* ptr to config header		*/
	     char		FAR	*iconfig_data;	/* ptr to init config data	*/
	     CLASS_REC		FAR	*iconfig_hdr;	/* ptr to init config header	*/
	     int			drvr_num;	/* major number of driver	*/
	     int			(*get_devno)();	/* get dev # from OS device #	*/
	     int			(*cl_clear_conf)();/* clear's the config table	*/
	     int			(*cl_fill_map)();/* fills in map table		*/
	     int			(*cl_iconfig)();/* creates config table		*/
	     int			(*cl_resolve)();/* resolves config table	*/
	     union
		  {
		  struct dev_routines FAR	*dev_rtn;/* ptr to start of dev rtns	*/
		  struct card_routines FAR	*card_rtn;/* ptr to card routines	*/
		  }			anchor;
	     };

#define	dev_rtn_anchor	anchor.dev_rtn
#define	card_rtn_anchor	anchor.card_rtn

typedef	struct	dev_class	DEV_CLASS;

#define	CLASS_DEV	0x0001		/* class is a device class			*/
#define	CLASS_CARD	0x0002		/* class is a card class			*/
#define	CLASS_INIT_ASAP	0x0004		/* initialize devices in class ASAP		*/

struct	device_routines
	     {
	     /*
	      * The following fields are OS independent.  They can be
	      * expected to be the same from one OS implementation to
	      * another.  This means that the common routines can call
	      * them and not have any problems.
	      */
	     struct device_routines	*next;	/* points to next entry	*/
	     DEV_CLASS			*class;	/* ptr to dev's class	*/
	     int	dev_flags;		/* device flags		*/
	     int	(*dev_init)();		/* initializes a device	*/
	     int	(*dev_start)();		/* starts a device	*/
	     int	(*dev_stop)();		/* stops a device	*/
	     int	(*dev_rw)();		/* routine to start R/W	*/
	     int	(*dev_reserve)();	/* reserves device	*/
	     int	(*dev_release)();	/* releases device	*/
	     int	(*restart_io)();	/* restarts I/O		*/
	     int	(*abort_io)();		/* aborts I/O		*/
	     int	(*proc_req_sns)();	/* process request sense*/
	     int	(*proc_tsb)();		/* process TSB		*/
	     int	(*report_err)();	/* report an error	*/
	     int	(*scat_gath_rtn)();	/* scatter/gather routine */
	     int	(*dev_format)();	/* formats some media	*/
	     int	(*dev_unit_attn)();	/* called for a unit attn */
	     int	(*dev_close)();		/* routine for delayed close */
	     int	(*next_sub_state)();	/* moves to next sub state */
	     int	(*en_queue)();		/* routine to en-queue requests */
	     int	(*de_queue)();		/* routine to de-queue requests */
	     int	(*free_buff)();		/* routine to free data buffer	*/
	     int	(*io_done)();		/* routine to mark I/O complete */
	     int	(*map_io)();		/* routine to map results back	*/
	     time_t	close_delay;		/* delay before a close	*/
	     int	dev_time_out;		/* device time out	*/
	     BUSY_LIST	*busy_times;		/* timeouts for device BUSY */
	     int	num_soft_req_rtns;	/* number of soft req rtns */
	     int	(**soft_req_rtns)();	/* table of soft req rtns */
	     int	num_soft_state_rtns;	/* num of soft state rtns */
	     int	(**soft_state_rtns)();	/* table of soft state rtns */
	     VEND_UNIQ_RTNS *vend_unique_rtns;	/* table of vendor uniq rtns */
	     };

typedef	struct	device_routines	DEV_RTNS;

/*
 * The following are bits used in the device flags.
 */
#define	DEVF_NOLIGHT		0x0001	/* don't turn on the LED	*/
#define	DEVF_INIT_ASAP		0x0002	/* init device ASAP		*/
#define	DEVF_FILTER_MAP		0x0003	/* filter map table		*/

/*
 * The following states get passed to some of the routines that a driver can
 * replace the standard ones.
 */
#define	CARD_RESTART	0	/* A card reset was just performed	*/
#define	DEV_RESET	1	/* The device was just reset		*/
#define	BUS_RESET	2	/* The SCSI bus was just reset		*/
#define	DEV_ABORT	3	/* An Abort was just performed on a dev	*/
#define	REQ_SNS		4	/* Data passed is from a request sense	*/
#define	TSB_DATA	5	/* Data passed is the TSB		*/
#define	DEV_BUSY	6	/* Device Busy error			*/
#define	UNIT_ATTN	7	/* Unit attention error			*/

/*
 * The following defines a standard set of card routines that (we hope)
 * allow a card to be used without having to know the specifics of the
 * card.
 */
struct	card_routines
	     {
	     struct card_routines FAR	*next;	/* next struct in list	*/
	     int			num_ids;/* number of POS ID's	*/
	     int			*pos_ids;/* POS ID's		*/
	     int			flags;	/* card's flags		*/
	     int			irq_level;
	     int			num_cards;
	     struct waitp     * FAR	*cmd_wqh;
	     struct waitp     * FAR	*cmd_wqt;
	     int			(*pres_test)();
	     int			(*init_card_data)();
	     int			(*init_card)();
	     int			(*irq_rtn)();
	     int			(*out_cmd)();
	     int			(*out_icmd)();
	     int			(*card_reset)();
	     int			(*bus_reset)();
	     int			(*dev_reset)();
	     SCB 	FAR		*(*get_cmd_block)();
	     int			(*free_cmd_block)();
	     SCB        FAR		*(*build_rw_cmd)();
	     int			(*build_scsi_cmd)();
	     int			(*build_reserve_cmd)();
	     int			(*build_inquiry_cmd)();
	     int			(*build_capacity_cmd)();
	     int			(*build_getpos_cmd)();
	     int			(*build_sense_cmd)();
	     int			(*build_target_cmd)();
	     int			(*set_timeout)();
	     int			(*proc_card_workq)();
	     int			(*get_tsb_info)();
	     int			(*proc_cmd_error)();
	     int			(*restart_all_io)();
	     int			(*restart_assigns)();
	     int			(*modify_cmd_block)();
	     int			(*build_chain)();
	     int			(*build_scat_gath)();
	     int			(*report_err)();
	     };

typedef	struct	card_routines	CARD_RTNS;

/*
 * The following indicate what type of information is to be returned
 * when the get_tsb_info routine is called.
 */
#define	TSB_RESIDUAL		1	/* return any residual count	*/
#define	TSB_ADDR		2	/* return address of TSB	*/
#define	TSB_OK			3	/* indicate if command was OK	*/
#define	TSB_SCSI_STATUS		4	/* return SCSI status of oper	*/
#define	TSB_DEV_STATUS_AVAIL	5	/* TRUE if device status avail	*/
#define	TSB_DEV_STATUS		6	/* returns device status	*/
#define	TSB_CMD_OK		7	/* FALSE if error in cmnd block	*/
#define	TSB_CMD_ERROR		8	/* returns cmnd block error code*/
#define	TSB_CLEAR_RESIDUAL	9	/* clear the residual count	*/

/*
 * The following define the command block modifiers
 */
#define	CMD_MOD_CACHE		1	/* turn cache on/off		*/
#define	CMD_MOD_DISC		2	/* enable/disable disconnect	*/
#define	CMD_MOD_SYNC		3	/* enable/disable syncronous md	*/
#define	CMD_MOD_SCAT_GATH	4	/* indicate scat/gath is used	*/
#define	CMD_MOD_SHORT_DATA	5	/* no error on short data	*/

/*
 * The following defines the type of target mode that we're doing
 */
#define	TARGET_START		1	/* starts target mode		*/
#define	TARGET_RESTART		2	/* completes tm & restarts it	*/
#define	TARGET_END		3	/* terminates target mode	*/
#define	TARGET_START_EMULATE	4	/* starts target mode emulation	*/
#define	TARGET_RESTART_EMULATE	5	/* completes tm & restarts it	*/

/*
 * The following describe some things about the card.
 */
#define	CARDF_CAN_CHAIN		0x0001	/* supports command chaining	*/
#define	CARDF_CAN_SCAT_GATH	0x0002	/* supports scatter/gather	*/
#define	CARDF_TARGET		0x0004	/* card can be a target		*/
#define	CARDF_PHYS_CMD_ADR	0x0008	/* card needs phys cmd addrs	*/
#define	CARDF_PHYS_DATA_ADR	0x0010	/* card needs phys data addrs	*/
#define	CARDF_DATA_INIT		0x1000	/* turned on when data init'd	*/
;

typkêü ×  $          q‰*šˆ*q‰*     f£                €r  ./usr/include/sys/i386/scsi_ether.h h   #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)scsi_ether.h	1.4	AIX)	/* Modified: 14:38:51 2/9/90 */


/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * scsi_ether.h
 *
 * This file contains the definitions of structures required for the SCSI
 * ethernet driver.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	------	-----	---------------------------------------------
 * 0.00		7/12/89 GGS	Original code entry
 *
 */

#include <scsi_os_ether.h>
#include <scsi_comm.h>

/*
 * The following are the defines for the generic routines to make them
 * specific to the CPU routine.
 */
extern	BUF_Q	FAR	*get_free_ether_buff();
extern	int		free_ether_buff();
extern	int		max_ether_buff_len;
extern	int		num_scsi_ether_buffs;
extern	WAITP	FAR	*ether_susp_waitph;
extern	WAITP	FAR	*ether_susp_waitpt;

/*
 * Defines the state structure for the ethernet device that is over and above
 * the generic state mantained by the standard SCSI device structures.
 */
struct	scsi_ether_state
	     {
	     BUF_Q FAR	*procd_qh;	/* processed buffer queue head	*/
	     BUF_Q FAR	*procd_qt;	/* processed buffer queue tail	*/
	     char	ether_addr[ ETHER_ADDR_SIZE ];	/* network addr	*/
	     int	ether_unit;	/* ethernet unit number		*/
	     int	ether_flags;	/* ethernet driver flags	*/
	     int	restart_state;	/* restart state of device	*/
	     char   FAR	*restart_scb;	/* SCB for restarting of device	*/
	     SCSICB	scsi_cb;	/* control block for restart	*/
	     char  	data_buff[10];	/* data buffer for restarting	*/
	     char	header_len;	/* header length		*/
	     char	trailer_len;	/* trailer length		*/
	     ulong	xmit_frames;	/* frames sent with no errors	*/
	     ulong	recv_frames;	/* frames received with no errs	*/
	     ulong	xcollisions;	/* aborted w/excessive collisions */
	     ulong	crc_errors;	/* frames w/ CRC errors		*/
	     ulong	align_errors;	/* frames w/ alignment errors	*/
	     ulong	late_collisions;/* frames w/late collisions	*/
	     };

typedef	struct	scsi_ether_state	SCSI_ETHER_STATE;

/*
 * The following are the flags that can appear in the ethernet driver flags.
 */
#define	SE_USE_TARGET	0x0001		/* use target mode 		*/
#define	SE_RESTART_DEV	0x0002		/* restart device on reset	*/
#define	SE_USE_ALT_SMSG	0x0004		/* use alternate send message	*/
#define	SE_HAS_HEADER	0x0008		/* has header before packet	*/
#define	SE_HAS_TRAILER	0x0010		/* has trailer after packet	*/
#define SE_SUSPENDED    0x0020          /* output Q suspended		*/

/*
 * The following are the driver specific requests supported by the sample
 * CPU device driver.
 */
#define	REQ_ETHER_RD		(REQ_SOFT | 0)
#define	REQ_ETHER_WR		(REQ_SOFT | 1)
#define	REQ_ETHER_CLOSE		(REQ_SOFT | 2)
#define	REQ_ETHER_START		(REQ_SOFT | 3)

/*
 * The following are the driver specific states supported by the
 * ethernet device driver.
 */
#define	ETHER_READ		(DSOFT_STATE | 0)
#define	ETHER_WRITE		(DSOFT_STATE | 1)
#define	ETHER_ABORT		(DSOFT_STATE | 2)
#define	ETHER_START		(DSOFT_STATE | 3)

/*
 * The following are sub-states for the ETHER_START state.
 */
#define	ETH_ST_SUBSTATE		(ETHER_START << 8)
#define	ETH_ST_GETSCB		(ETH_ST_SUBSTATE | 0)
#define	ETH_ST_MDSNS_1		(ETH_ST_SUBSTATE | 1)
#define	ETH_ST_MDSEL_1		(ETH_ST_SUBSTATE | 2)
#define	ETH_ST_MDSNS_2		(ETH_ST_SUBSTATE | 3)
#define	ETH_ST_MDSEL_2		(ETH_ST_SUBSTATE | 4)
#define	ETH_ST_POLL		(ETH_ST_SUBSTATE | 5)

/*
 * The following structure defines an ethernet packet.
 */
struct	eth_buff
	     {
	     struct	ether_header	hdr;
	     char			data[1518];
	     };

/*
 * The following structure defines NIC header that is returned with the
 * packet for a Compatible Systems ETHER+ device.
 */
struct	ether_plus_NICheader
	     {
	     uchar	receivestatus;	/* NIC receive status		*/
	     uchar	reserved;	/* reserved byte		*/
	     uchar	pktlen_lsb;	/* LSB of packet length		*/
	     uchar	pktlen_msb;	/* MSB of packet length		*/
	     };

/*
 * This structure will define what a configuration entry looks like for the
 * Ethernet class.  Since the configuration structures have to reside in a very
 * restricted place on disk, we will try to make them as small as possible.
 */
struct	scsi_ether_config
	     {
	     GEN_CONFIG		gen;	/* generic configuration	*/
	     ulong	reserved;	/* reserved bits		*/
	     };

typedef	struct	scsi_ether_config	SCSI_ETHER_CONFIG;

#define	SCSI_ETHER_CONFIG_LEN	sizeof( SCSI_ETHER_CONFIG )

#define	SCSI_ETHER_CONFIG_VER	1
--kêŽC b  $        "  k‰*ê™ˆ*k‰*     €"  
                ./usr/include/sys/i386/scsi_ioctl.h h   #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)scsi_ioctl.h	1.2    IBM AIX)    /* Modified: 20:02:26 7/15/92 */

/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */


/*
 * scsi_ioctl.h
 *
 * This file contains the IOCTLs that are specific to the SCSI device driver.
 * The invidual device drivers may support other IOCTL calls which are not
 * necessarily SCSI specific.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	-------	-----	----------------------------------------------
 * 0.00		12/21/88 GGS	Original Code Entry
 * 0.10		5/4/92	 Sanjay	Added ioctls SCSIGEN_CMD, ENABLE_WFM and
 *				DISABLE_WFM. Added structure scsigen_cmd.
 *
 */

/*
 * The following are the IOCTL commands.
 */
#define	SCSIIOC		('S' << 8)
#define	SCSIGCTS	(SCSIIOC | 1)	/* get configuration table size	*/
#define	SCSIGCCT	(SCSIIOC | 2)	/* get current config table	*/
#define	SCSIUDCT	(SCSIIOC | 3)	/* update disk config table	*/
#define	SCSIGDT		(SCSIIOC | 4)	/* get device type		*/
#define	SCSILOCK	(SCSIIOC | 5)	/* lock scsi config for update	*/
#define	SCSIULOCK	(SCSIIOC | 6)	/* un-lock scsi config		*/
#define	SCSIGDCT	(SCSIIOC | 7)	/* get config tabel from disk	*/
#define	SCSIINFO	(SCSIIOC | 8)	/* get driver map for devices	*/
#define	SCSIHDFMT	(SCSIIOC | 9)	/* format the a disk drive	*/
#define	SCSIGDTS	(SCSIIOC | 10)	/* get configuration table size	*/
#define	SCSICLMAJ	(SCSIIOC | 11)	/* returns major # for class	*/
#define	SCSIRD_CMD	(SCSIIOC | 12)	/* SCSI command data from device*/
#define	SCSIWR_CMD	(SCSIIOC | 13)	/* SCSI command data to device	*/

#define	SCSIGEN_CMD	(SCSIIOC | 14)	/* SCSI Generic command 	*/
#define	SCSIEWFM	(SCSIIOC | 15)	/* Enable Write File Marker	*/
#define	SCSIDWFM	(SCSIIOC | 16)	/* Disable Write File Marker	*/

/*
 * The way that the above IOCTLs work is as follows.  One should do a SCSIGCTS
 * IOCTL to get the number of entries in the configuration table and the version
 * of the table (ie what format is the table in).  With the number of entries
 * one can then allocate the memory required fo the scsict structure.  Once
 * the memory was allocated, a program can then call the SCSIGCT IOCTL to get
 * the current configuration table.  It will have a length field in it as well.
 * This is primarily so that the same structure can be used by both the SCSIGCT
 * IOCTL and SCSIUCT IOCTL as the latter must indicate to the driver how many
 * entries are being written.  Note that the SCSIUCT IOCTL replaces the entire
 * configuration table, so the length is important.
 */

/*
 * The following is the structure that is filled in by the SCSIGCTS IOCTL.
 */
struct	scsigcts
	     {
	     int	ct_len;		/* # of entries in config table	*/
	     int	ct_ver;		/* version of config table	*/
	     int	ct_minor;	/* minor # of disk where table is */
	     };

/*
 * The following is the structure that is filled in by the SCSIGCT IOCTL and
 * expected by the SCSIUCT IOCTL.
 */
struct	scsict
	     {
	     int		ct_len;	/* # of entries in config table	*/
	     char 		conf_table[1];
	     };

/*
 * The following is the structure that is filled in by the SCSIGDT IOCTL.
 * The dev_num field is filled in by the caller to indicate which device
 * data will be returned for.
 */
struct	scsidt
	     {
	     int	dev_num;	/* device # 			*/
	     uchar	dev_type_major;	/* SCSI major device type	*/
	     uchar	dev_type_minor;	/* SCSI minor device type	*/
	     uchar	standards;	/* SCSI standards that apply	*/
	     uchar	vendor_id[8];	/* name of vendor of device	*/
	     uchar	product_id[16];	/* name of product		*/
	     uchar	rev_level[4];	/* revision level		*/
	     uchar	data[8];	/* date of last uCode update	*/
	     };

/*
 * The following structure is used by configuration utilities that need to
 * know the mapping that the device driver is using to map from minor numbers
 * to specific devices.  Note that the structure returned is only for a 
 * particular device driver.  This allows one to figure out for example what
 * is ment by "disk drive # 3".
 */
struct	scsi_info
	     {
	     int		len;	/* length of the table returned	*/
	     DEV_NUM_MAP	table[1];
	     };


/*
 * The following structure is passed between the format program and the device
 * driver inorder to format a device.
 */
struct	fmt_args
	     {
	     int	flags;		/* flags indicating how to do format */
	     int	err_code;	/* error code from the format	     */
	     int	interleave;	/* interleave to be used on format   */
	     ushort	reserved;	/* 16 bits (used by hardware)	     */
	     ushort	list_len;	/* length of defect list (MSB first) */
	     };

/*
 * The following define the bits that are used in the flags field of the format
 * structure.
 */
#define	FMT_ERROR	0x8000		/* error occured on format	*/
#define FMT_DONE	0x4000		/* format is complete		*/
#define	FMT_PREP_ERROR	0x2000		/* error occured on prepare	*/
#define	FMT_CMPLT_LIST	0x0004		/* remove existing defect list	*/
#define	FMT_DEFECTS	0x0002		/* format with indicated defects*/
#define	FMT_BACKGROUND	0x0001		/* perform the format in background */

/*
 * The following structure is used to issue SCSI generic command
 */
struct	scsigen_cmd {
	int 	card_num;		/* Card number			*/
	int	scsi_id;		/* SCSI id			*/
	int	lun;			/* Logical Unit Number		*/
	int 	cmd_len;		/* Command length in bytes	*/
	uchar	*cmdp;			/* Pointer to command/parameters*/
	char	rwflag;			/* read/write flag		*/
	int	data_len;		/* Length of data		*/
	uchar	*data_buff;		/* pointer to data buffer	*/
};
typedef	struct	scsigen_cmd	SCSIGENERIC_CMD;
	
/*
 * The following define the rwflag field of the structure scsigen_cmd
 */
#define	GENERIC_READ	1		/* Get data from the device 	*/
#define	GENERIC_WRITE	2		/* Send data to the device	*/

commankêL ç  $        j  m‰*å™ˆ*m‰*     j  	                  ./usr/include/sys/i386/scsi_os_ether.h  #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)os_ether.h	1.3	AIX)	/* Modified: 14:16:38 2/9/90 */



/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * scsi_os_ether.h
 *
 * This file contains the definitions of structures that are OS specific for
 * the SCSI ethernet driver.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	------	-----	---------------------------------------------
 * 0.00		7/12/89 GGS	Original code entry
 *
 */

#include <mbuf.h>
#include <protosw.h>
#include <socket.h>
#include <if.h>
#include <netisr.h>
#include <route.h>
#include <in.h>
#include <in_systm.h>
#include <ip.h>
#include <in_var.h>
#include <if_ieee802.h>
#include <ioctl.h>

/*
 * Make some system wide defines for the SCSI ethernet driver.
 */
#define	MAX_SCSI_ETHER	16	/* 16 ethernet controllers on a system!!! */
#define	MAX_SCSI_ETHER_CONFIG	2 * MAX_SCSI_ETHER

#define	ETHER_ADDR_SIZE	LAN_ADDR_SIZE	/* size of an ethernet address	*/

#define	NUM_ETHER_BUFS	48	/* buffers for receiving ethernet packets */

#define	SCSI_ETHER_LOW_WATER	4	/* output has to leave this many buffs */
#define	SCSI_ETHER_HI_WATER     8	/* this many have to be free to output */
mmand kêDý Ö  $        í  r‰*šˆ*r‰*     4Œí  	                  ./usr/include/sys/i386/scsi_tape.h r.h  #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)scsi_tape.h	1.7	AIX)	/* Modified: 14:44:50 4/25/91 */



/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * scsi_tape.h
 *
 * This file contains the defines that are specific to the tape device driver
 * but are not specific to a particular OS.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	-------	-----	----------------------------------------------
 * 0.00		3/02/89	GGS	Original Code Entry
 * 0.10		2/24/90 GGS	Added min_block_size & max_block_size fields
 *
 */
#include <scsitape.h>

/*
 * The following defines are what are used in the drvr_state field of the
 * device's state table.
 */
#define	TAPE_NO_REWIND	0x0001	/* don't rewind the tape on start/stop	*/
#define	TAPE_RETENTION	0x0002	/* retention tape on a start		*/
#define	TAPE_READ_FROM	0x0004	/* a read has been done on the tape	*/
#define	TAPE_WRITTEN_TO	0x0008	/* a write has been done on the tape	*/
#define	TAPE_END	0x0010	/* we've reached the end of the tape	*/
#define	TAPE_FIXED_BLK	0x0020	/* fixed block tape			*/
#define	TAPE_VARBL_BLK	0x0040	/* variable block tape			*/
#define	TAPE_BACKSPACE	0x0080	/* tape is moving in reverse		*/

/*
 * The following defines the state structure for tape devices.
 */
struct	tape_state
	     {
	     int	drvr_state;	/* state of the driver		*/
	     int	block_size;	/* block size in bytes		*/
	     int	density;	/* tape density in bits / inch	*/
	     ulong	min_block_size;	/* minimum bytes / block	*/
	     ulong	max_block_size;	/* maximum bytes / block	*/
	     };

typedef	struct	tape_state	TAPE_STATE;

/*
 * This structure will define what a configuration entry looks like for the
 * Tape class.  Since the configuration structures have to reside in a very
 * restricted place on disk, we will try to make them as small as possible.
 */
struct	tape_config
	     {
	     GEN_CONFIG		gen;	/* generic configuration	*/
	     ulong	reserved;	/* reserved bits		*/
	     };

typedef	struct	tape_config	TAPE_CONFIG;

#define	TAPE_CONFIG_LEN	sizeof( TAPE_CONFIG )

#define	TAPE_CONFIG_VER	1
 thkêèø a  $        5  l‰*å™ˆ*l‰*     q5  
                  ./usr/include/sys/i386/scsi_timers.h h  #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)sc_timers.h	1.2	AIX)	/* Modified: 14:17:16 2/9/90 */



/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * scsi_timers.h
 *
 * This module contains the definitions that are needed for the timers as
 * they are viewed by the SCSI driver code.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * ---------	------	-----	---------------------------------------------
 * 0.00		5/29/89	GGS	Original Code Entry
 *
 */

/*
 * The following are what is needed for the SCSI timers that we'll be using
 * in the SCSI device driver.
 */
struct	scsi_timer
	     {
	     int	flags;	/* flags as to how to treat the timer	*/

#define	ST_WAKEUP	0x0001	/* wakeup process when timer goes off	*/
#define	ST_CALL		0x0002	/* call routine when timer goes off	*/
#define	ST_ACTIVE	0x8000	/* timer is active			*/

	     int	timer;	/* length of time to wait (in tics)	*/
	     union
		  {
		  int	*wakeup;
		  int	(*rtn)();
		  }	action;
	     int	arg1;
	     int	arg2;
	     int	arg3;
	     int	arg4;
	     };

typedef	struct	scsi_timer	SCSI_TIMER;

/*
 * The following are the global definitions that are required for the
 * SCSI timer routines.
 */
#ifdef	DEF_GLOBALS
int		scsi_timer_active = FALSE;/* timer(s) running?		*/
SCSI_TIMER	scsi_timers[MAX_SCSI_TIMERS];
#else
extern	int		scsi_timer_active;
extern	SCSI_TIMER	scsi_timers[];
#endif


	 kêÄ¨ `  $        r  l‰*ñ™ˆ*l‰*     7ˆr  
                  ./usr/include/sys/i386/scsiclose.h h h  #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)scsiclose.h	1.5	AIX)	/* Modified: 14:15:36 2/9/90 */


/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * scsiclose.h
 *
 * This file contains the structures required for defining the delayed close
 * code used by some device drivers.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	-------	-----	----------------------------------------------
 * 0.00		3/06/89	GGS	Original Code Entry
 *
 */

/*
 * The following structure is used when a delayed close is to be performed.
 */
struct	delay_close
	     {
	     struct	callout	*close_timer;
	     int		(*stop_rtn)();
	     int		close_flags;
	     time_t		close_delay;
	     REQ_Q		*reqp;
	     SCSICB		*cbufp;
	     TBUF		*dbufp;
	     };

typedef	struct	delay_close	DELAY_CLOSE;

/*
 * The following flags are used to determine the (gross) state of the close.
 */
#define	DC_CLOSE_PENDING	0x0001	/* close operation pending	*/
					/*  Waiting for a timeout	*/
#define	DC_CLOSING		0x0002	/* close being performed	*/
#define	DC_OPEN_WANTED		0x0004	/* open wanted - waiting for	*/
					/*  close to complete		*/
#define	DC_OPENING		0x0008	/* open being performed		*/

#ifdekê – Õ  $          r‰*šˆ*r‰*     G`                JÁ  ./usr/include/sys/i386/scsiconfig.h  h  #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)scsiconfig.h	1.6	AIX)	/* Modified: 14:21:19 12/20/91 */


/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * scsiconfig.h
 *
 * This file defines what the SCSI configuration table looks like.  This table
 * will be kept on a defined sector on a defined drive in all systems.  If the
 * driver is called and it finds that this table is not present, it will build
 * an initial table for use.
 *
 * The idea for this table is to allow some history of how devices were attached
 * to the SCSI subsystem.  This allows the device driver to keep device numbers
 * the same for a growing configuration.  Since this table is historical in
 * nature, two systems with the same device configuration (ie same devices at
 * the same places in the SCSI address space), will not have the same OS device
 * addresses unless the devices were added in the same order on both systems.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	------	-----	---------------------------------------------
 * 0.00		11/17/88 GGS	Original code entry
 * 1.00		8/15/89	GGS	Complete restructuring of how SCSI configuration
 *				is done.  Device Classes are added.
 *
 */

/*
 * There are a set of defines that are in os.h.  This is because the location
 * of the configuration record, the minor number of the drive where the 
 * configuration record is located and the original SCSI configuration are
 * really OS dependent.
 *
 * The defines to be found in os.h are:
 *
 *	SCSI_CONF_SEC		sector where the SCSI configuration is located
 *	NUM_SCSI_CONF_SECS	number of sectors that the SCSI configuration
 *				may occupy.
 *	SHARE_SCSI_CONF_SEC	if defined, then the sector(s) where the SCSI
 *				configuration record is located is shared with
 *				other data structures.
 *	SCSI_CONF_DEV		device where the SCSI configuration is located
 *	SCSI_INIT_CONF		initial SCSI configuration record
 *	MAX_SCSI_DEVICES	maximum number of SCSI devices that can fit in
 *				the SCSI configuration record
 *
 */

#define	CONF_NAME_LEN	16	/* length of configuration record name	*/
/*
 * The following is the layout of the header for the SCSI configuration record
 */
struct	scsi_config_hdr
	     {
	     ushort	config_len;	/* length of the configuration record */
	     char	config_name[CONF_NAME_LEN];/* configuration recd name */
	     ushort	config_sig;	/* signature indicating a valid recrd */
	     ushort	config_version;	/* version of the config record	      */
	     ulong	config_rba;	/* RBA where next config header is	*/
	     ushort	config_offset;	/* offset into sector where next hdr is	*/
	     };

typedef	struct	scsi_config_hdr	SCSI_CONFIG_HDR;

/*
 * The following is the name of the configuration record.  Note that this WILL
 * have a trailing 0 and that is to be included in the record on disk.
 */
#define	SCSI_CONF_NAME	"AIX SCSI Config"

/*
 * The following is the signature indicating that the record is valid.
 */
#define	SCSI_CONF_SIG	((ushort)0x9967)/* "root" configuration record	*/
#define	OLD_SCSI_CONF_SIG	((ushort)0x9966) /* old 1.2.0 config record */

/*
 * The following is the current version of the configuration record.  It is
 * conceivable that there could be multiple valid formats for the configuration
 * record.  This will allow the driver to determine which one of several formats
 * it should read if it ever needs to.
 */
#define	SCSI_CONF_VER	0x0001

/*
 * The minimum allocation is used only for the first sector in a configuration
 * table that can have multiple sectors.  This allows others to use the first
 * sector also without consuming the sector totally.
 */
#define	SCSI_MIN_ALLOC	32

/*
 * The following is the layout of a SCSI class header.  Note that all of the devices
 * in a class follow the class header.  Once all of the devices for a class are
 * listed, then the next class record is defined.
 *
 */
#define	CLASS_NAME_LEN	16
struct	class_rec
	     {
	     char	class_name[CLASS_NAME_LEN];	/* name of the class	*/
	     ushort	record_len;			/* length of device rec	*/
	     ushort	num_records;			/* number of device recs*/
	     ushort	total_records;			/* total # of records	*/
	     ushort	class_version;			/* version # of class	*/
	     };

typedef	struct	class_rec	CLASS_REC;
fkêÔ _  $        „  l‰*ñ™ˆ*l‰*     2„  
                  ./usr/include/sys/i386/scsicpu.h .h  h  #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)scsicpu.h	1.5	AIX)	/* Modified: 14:15:56 2/9/90 */


/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * scsicpu.h
 *
 * This file contains the defines that are specific to the sample CPU device
 * driver.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	-------	-----	----------------------------------------------
 * 0.00		2/11/89	GGS	Original Code Entry
 *
 */

#define	MAX_CPUS	16		/* max number of CPUs in system	*/
#define	MAX_CPU_CONFIG	2 * MAX_CPUS

/*
 * The following defines the number of buffers that will be allocated for use
 * when TARGET mode commands are being processed.
 */
#define	NUM_TARGET_BUFS	48
 havkê ­ ^  $        Ñ  l‰*ó™ˆ*l‰*     zÑ  
                  ./usr/include/sys/i386/scsitape.h h  h  #ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)scsitape.h	1.6	AIX)	/* Modified: 14:53:04 4/25/91 */


/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * tape.h
 *
 * This file contains the defines that are specific to the tape device driver.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	-------	-----	----------------------------------------------
 * 0.00		1/21/89	GGS	Original Code Entry
 * 0.10         2/24/91 GGS	Added Support for Fixed Length Blocks
 *
 */

#define	MAX_TAPE	16		/* max number of tapes in system */
#define	MAX_TAPE_CONFIG	2 * MAX_TAPE

#define MTDEV_FIXED_BLK	0x0002		/* use fixed length blocks	*/
#define	MTDEV_NOREWIND	0x0004		/* don't rewind the tape	*/
#define	MTDEV_RETEN	0x0008		/* retention tape on an open	*/
me ordekê^‚ Ô  $        z4  r‰*%šˆ*r‰*     ±©z4  	              6U  ./usr/include/sys/i386/state.h .#ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)state.h	1.10	AIX)	/* Modified: 14:45:35 4/25/91 */

/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */


/*
 * state.h
 *
 * This file defines all of the structures and values for keeping the state
 * of the SPOCK/TRIBBLE device driver and the card(s) in the system.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	------	-----	---------------------------------------------
 * 0.00		5/1/88	GGS	Original code entry
 * 0.10		6/1/89	GGS	Split various structures and defines into
 *				their own .h files.
 *
 */
#include <request.h>

/*
 * The following is the structure for the scatter/gather list.
 *
 * NOTE:
 *    Any new fields must be added at the end.  The hardware expects the
 *    indicated fields to be in order and we can't change that but we can
 *    put extra fields at the end of the structure.
 */
struct	scat_gath_list
	     {
	     SCAT_GATH_ENT	list[MAX_SCAT_GATH_ENTS]; /* HARDWARE	*/
	     /*
	      * What follows are software defined fields and can be changed
	      * the fields above this are hardware dependent and cannot be
	      * changed.
	      */
	     struct scat_gath_list FAR	*next;	/* next entry in free	*/
	     int			length;	/* # entries in list	*/
	     REQ_Q	FAR		*reqs[MAX_SCAT_GATH_ENTS];
	     };

typedef	struct	scat_gath_list	SCAT_GATH_LIST;

/*
 * Structure for indicating someone wants to wait on an event.
 */
struct	waitp
	     {
	     int		cardno;
	     int		scsi_id;
	     int		lun;
	     int		flags;

#define	SW_WAKEUP	0x0001	/* wakeup process when wait is done	*/
#define	SW_CALL		0x0002	/* call routine when wait is done	*/

	     union
		  {
		  int	FAR	*wakeup;
		  struct
		       {
		       int FAR	(*rtn)();
		       ulong	arg1;
		       ulong	arg2;
		       ulong	arg3;
		       ulong	arg4;
		       }	call;
		  }		action;

#define	wakeup_id	action.wakeup
#define	wakeup_rtn	action.call.rtn
#define	wakeup_arg1	action.call.arg1
#define	wakeup_arg2	action.call.arg2
#define	wakeup_arg3	action.call.arg3
#define	wakeup_arg4	action.call.arg4

	     struct waitp FAR	*next;
	     struct waitp FAR	*prev;
	     };

typedef	struct	waitp	WAITP;

/*
 * State Information for SPOCK/TRIBBLE device driver.
 */
struct	lu_def
	     {
	     struct lu_def FAR	*next;	/* pointer to next structure	*/
	     int	state;		/* a reflection of device state	*/
	     ushort	dev_type;	/* type of SCSI device		*/
	     ulong	soft_errors;	/* # of soft errors on device	*/
	     ulong	hard_errors;	/* # of hard errors on device	*/
	     int	retries_left;	/* # of retries left on device	*/
	     ulong	dev_flags;	/* device flags			*/
	     int	drvr_req_state;	/* used only by DASD!!!!	*/
	     int	devno;		/* SPOCK/TRIBBLE device assigned*/
	     int	timer;		/* timer value for timeouts	*/
	     int	busy_index;	/* index into BUSY structure	*/
	     int	busy_repeats;	/* # of BUSY repeats performed	*/
	     DEV_RTNS FAR *dev_rtns;	/* device specific routines	*/
	     VEND_UNIQ_RTNS FAR *vend_uniq_rtns;/* pntr to vendor unique rtns*/
	     REQ_Q FAR	*rq_head;	/* head of request queue	*/
	     REQ_Q FAR	*rq_tail;	/* tail of request queue	*/
	     REQ_Q FAR	*rq_next;	/* next request in queue	*/
	     char  FAR	*dev_state;	/* ptr to device specific state	*/
	     };

/*
 * The following flag goes in the drvr_req_state field.  It is used to
 * indicate a request that requires multiple interrupts to complete.
 */
#define	REQ_STAGED	0x8000

#define	DEVF_RM		0x00000001	/* media is removable		*/
#define	DEVF_STOPPED	0x00000002	/* drive is stopped/not-ready	*/
#define	DEVF_LOCKED	0x00000004	/* media is locked		*/
#define	DEVF_UATN	0x00000008	/* unit had an attention	*/
#define	DEVF_NOREASGN	0x00000010	/* don't re-assign device	*/
#define	DEVF_NOMINIDISK	0x00000020	/* don't use minidisks		*/
#define	DEVF_TARGET	0x00000040	/* this is a target device	*/
#define	DEVF_MEDIA_END	0x00000080	/* at end of media		*/
#define	DEVF_RESERVE	0x00000100	/* reserve device prior to use	*/
#define	DEVF_NORELEASE	0x00000200	/* don't release the device	*/
#define	DEVF_CLOSED	0x00000400	/* device has been closed	*/
#define	DEVF_HAVECAP	0x00000800	/* device capacity is valid	*/
#define	DEVF_RESERVED	0x00001000	/* all (part) of device is reserved */
#define	DEVF_NOSYNC	0x00002000	/* don't allow SCSI sync communicatn*/
#define	DEVF_NODISC	0x00004000	/* don't allow device to disconnect */
#define	DEVF_RES_NOT_LOCKED 0x00008000	/* device is reserved but not locked */
#define	DEVF_NOIDLE	0x00010000	/* device doesn't go to IDLE state */
#define	DEVF_NOMINIT	0x00020000	/* device doesn't support multi-initiator */
#define	DEVF_SKIP_LUS	0x00040000	/* skip non-0 lu's		*/
#define	DEVF_EXCLUSIVE	0x00080000	/* device is for exclusive use	*/
#define	DEVF_NO_RETRIES	0x00100000	/* don't use retries on the device */
#define	DEVF_NO_ERP	0x00200000	/* don't use Error Recovery on the device */
#define	DEVF_NORESERVE	0x00400000	/* don't try to reserve device	*/
#define	DEVF_BROKEN	0x40000000	/* device broke while running	*/
#define	DEVF_NOTPRES	0x80000000	/* drive is not present		*/

typedef	struct	lu_def	LU_DEF;

struct	device_state
	     {
	     int	flags;		/* flags for operation of dev	*/
	     int	state;		/* state of the device		*/
	     int	scsi_id;	/* SCSI id of base device	*/
	     int	clun;		/* current LUN being run	*/
	     LU_DEF FAR	*lup;		/* pointer to state structure	*/
	     };

typedef	struct	device_state	DEV_STATE;

/*
 * Values for state field
 */
#define	DSOFT_STATE	0x8000	/* flag indicating a driver supplied state */
#define	DNOT_INIT	255	/* device not initialized		*/
#define	DNOT_PRES	0	/* device is not present		*/
#define	DSRESET		1	/* card is doing a soft reset		*/
#define	DHRESET		2	/* card is doing a hard reset		*/
#define	RESTART		3	/* restarting pending I/O		*/
#define	DASSIGN		4	/* doing an assignment			*/
#define	SCSI_RESET	5	/* reseting the device			*/
#define	DABORT		6	/* aborting the command			*/
#define	REQST_SENSE	7	/* doing a request sense		*/
#define	DBUSY		8	/* device is busy			*/
#define	DIDLE		9	/* device is idle			*/
#define	DHALTED		10	/* device was halted			*/
#define	DUNASSIGN	11	/* un-assigning a device 		*/
#define	RESTARTB	12	/* un-assigning a device (part of restart) */
#define	RESTARTC	13	/* set timeout value (part of restart)	*/
#define	RESERVE		14	/* re-reserve a device			*/
#define	DEVICE_TIMEOUT	15	/* set a device's timeout		*/

struct	cworkq
	     {
	     ushort		flags;	/* flags about the operation	*/
	     ushort		devno;	/* device being worked on	*/
	     struct cworkq FAR	*next;	/* next item in work queue	*/
	     struct cworkq FAR	*prev;	/* previous item in work queue	*/
	     };

typedef	struct	cworkq	CWORKQ;

/*
 * Flags for the card work queue.
 */
#define	CWQF_ASSIGN	0x0001		/* perform an assignment	*/
#define	CWQF_UNASSIGN	0x0002		/* perform an un-assignment	*/
#define	CWQF_TM		0x0004		/* use target mode on assignmnt	*/

/*
 * Structure for a SCSI command block.  This structure is only for getting
 * the command off of the free list.  It only maintains the size of the 
 * SCSI control block, not its internal structure.
 */
#define	SCSICB_PAD	(12 - sizeof(char FAR *))
struct	scsi_cmd_blk
	     {
	     struct	scsi_cmd_blk	FAR	*next;
	     char				scsi_block[SCSICB_PAD];
	     };

typedef	struct	scsi_cmd_blk	SCSICB;

struct	card_state
	     {
	     ushort	card_id;	/* POS ID of the card		*/
	     ushort	scsi_id;	/* SCSI ID of the card		*/
	     ushort	io_addr;	/* I/O address of card		*/
	     ushort	arb_level;	/* arbitration level		*/
	     ushort	irq_level;	/* IRQ level that card is on	*/
	     char  FAR	*memory_map;	/* Card's memory map		*/
	     ulong	soft_errors;	/* count of soft errors		*/
	     ulong	reset_count;	/* number of times card reset	*/
	     int	retry_count;	/* number of retries left	*/
	     int	resets_left;	/* number of resets left	*/
	     int	state;		/* state of the overall card	*/
	     int	restart_dev;	/* device number when restarting*/
	     int	flags;		/* flags about the card		*/
	     int	num_devs;	/* number of devices card has	*/
	     int	card_devno;	/* dev # for card stuff		*/
	     DEV_STATE	*dstate;	/* state for each device	*/
	     LU_DEF FAR	*scsi_dev;
	     CARD_RTNS	*card_rtns;	/* ptr to rtns to access card	*/
	     WAITP	*asg_waith;	/* assignment queue (HEAD)	*/
	     WAITP	*asg_waitt;	/* assignment queue (TAIL)	*/
	     CWORKQ	*workq_head;	/* head of card's work queue	*/
	     CWORKQ	*workq_tail;	/* tail of card's work queue	*/
	     };

#define	CARDF_RES		0x0001	/* reserve device before use	*/
#define	CARDF_SHORT_SLOT	0x0002	/* card is in a 16-bit slot	*/
#define	CARDF_TARGET_OK		0x0004	/* card can do target mode	*/
#define	CARDF_BREAK_PANIC	0x0008	/* panic when a card breaks	*/
#define	CARDF_RESOURCE_PANIC	0x0010	/* panic when a resource unavail*/
#define	CARDF_INIT_PANIC	0x0020	/* panic on init errors		*/
#define	CARDF_CONFIG_PANIC	0x0040	/* panic on config errors	*/

#define	scsi_index(id,lun)	(id * MAX_LUN + lun)

#define	CNOT_INIT	-2	/* card is not initialized		*/
#define	CNOT_PRES	0	/* card is not present			*/
#define	CRESET		1	/* card is in a reset cycle		*/
#define	CERP		2	/* card is in an ERP cycle		*/
#define	COK		3	/* card is running & OK			*/
#define	CINIT		4	/* card is initializing			*/
#define	CBUSY		5	/* card is busy running a command	*/
#define	BROKE		-1	/* card is hopelessly confused		*/

/*
 * Structure for temporary buffers.  This structure is only used in maintaining
 * the free list.  The routines that use the buffers assume that they are just
 * a pointer to a buffer of TBUFSIZE bytes.
 */
struct	tbuf
	     {
	     char		buff[TBUFSIZE - sizeof( struct tbuf FAR * )];
	     struct tbuf FAR	*next;
	     };

typedef	struct tbuf	TBUF;

#ifdef	DEF_GLOBALS
struct	card_state	cstate[MAX_CARDS];
WAITP	FAR		*wait_free;	/* free list of wait records	*/
WAITP	FAR		*asg_waitph;	/* list wait for a logical dev	*/
WAITP	FAR		*asg_waitpt;	/* list wait for a logical dev	*/
CWORKQ	FAR		*card_free;	/* free list for work queue	*/
WAITP	FAR		*cwq_waitph;	/* wait list for work queue	*/
WAITP	FAR		*cwq_waitpt;	/* wait list for work queue	*/
REQ_Q	FAR		*req_free;	/* free list for requests	*/
WAITP	FAR		*req_waitph;	/* list wait for requests	*/
WAITP	FAR		*req_waitpt;	/* list wait for requests	*/
WAITP	FAR		*tbuf_waitph;
WAITP	FAR		*tbuf_waitpt;
TBUF	FAR		*gen_buff_freep;/* free list for temp buffers	*/
WAITP	FAR		*scsi_waitph;	/* list wait for scsi cmnd blks	*/
WAITP	FAR		*scsi_waitpt;	/* list wait for scsi cmnd blks	*/
SCSICB	FAR		*scsi_freep;	/* free list for scsi cmnd blks	*/

WAITP   FAR             *sg_waitph;     /* wait list for scatter/gather */
WAITP   FAR             *sg_waitpt;     /* wait list for scatter/gather */

WAITP	FAR		*buff_wait_qh;	/* wait list for target buffers	*/
WAITP	FAR		*buff_wait_qt;	/* wait list for target buffers	*/

WAITP	FAR		*ether_waitph;	/* wait list for ethernet buffs	*/
WAITP	FAR		*ether_waitpt;	/* wait list for ethernet buffs	*/

SCAT_GATH_LIST	FAR	*scsi_scat_gath_freep;	/* free list for scatter/gathr */
int			max_target_buff_len	= 0;
DEV_CLASS	FAR	*scsi_class_anchor	= NULL;

extern	int		iodone();
int			(*scsi_iodone)() = iodone;
int			usec_loop_cnt;	/* loop count for 1 usec	*/

/*
 * The following is the drive where the scsi configuration was found.
 */
int			scsi_config_drive;
#else
extern	struct	card_state	cstate[];
extern	WAITP	FAR	*wait_free;	/* free list of wait records	*/
extern	WAITP	FAR	*asg_waitph;	/* list wait for a logical dev	*/
extern	WAITP	FAR	*asg_waitpt;	/* list wait for a logical dev	*/
extern	CWORKQ	FAR	*card_free;	/* free list for work queue	*/
extern	WAITP	FAR	*cwq_waitph;	/* wait list for work queue	*/
extern	WAITP	FAR	*cwq_waitpt;	/* wait list for work queue	*/
extern	REQ_Q	FAR	*req_free;	/* free list for requests	*/
extern	WAITP	FAR	*req_waitph;	/* list wait for requests	*/
extern	WAITP	FAR	*req_waitpt;	/* list wait for requests	*/
extern	WAITP	FAR	*tbuf_waitph;
extern	WAITP	FAR	*tbuf_waitpt;
extern	TBUF	FAR	*gen_buff_freep;/* free list for temp buffers	*/
extern	WAITP	FAR	*scsi_waitph;	/* list wait for scsi cmnd blks	*/
extern	WAITP	FAR	*scsi_waitpt;	/* list wait for scsi cmnd blks	*/
extern	SCSICB	FAR	*scsi_freep;	/* free list for scsi cmnd blks	*/
extern	WAITP	FAR	*buff_wait_qh;	/* wait list for target buffers	*/
extern	WAITP	FAR	*buff_wait_qt;	/* wait list for target buffers	*/
extern	WAITP	FAR	*ether_waitph;	/* wait list for ethernet buffs	*/
extern	WAITP	FAR	*ether_waitpt;	/* wait list for ethernet buffs	*/
extern	WAITP	FAR	*sg_waitph;	/* wait list for scatter/gather	*/
extern	WAITP	FAR	*sg_waitpt;	/* wait list for scatter/gather	*/
extern	SCAT_GATH_LIST	FAR	*scsi_scat_gath_freep;
extern	int		(*scsi_iodone)();
extern	int		scsi_config_drive;
extern	int		max_target_buff_len;
extern	int		usec_loop_cnt;	/* loop count for 1 usec	*/
extern	DEV_CLASS	FAR	*scsi_class_anchor;
#endif

/*
 * Flags for start_io()
 */
#define	WAIT_ASG	0x8000	/* wait for a device to become free	*/

/*
 * Flags for q_scsi_io()
 */
#define	REQ_IO_NOWAIT	0x0000	/* don't wait for the request to complete */
#define	REQ_IO_WAIT	0x0001	/* wait for the request to complete	*/

/*
 * Flags for scsi_statem()
 */
#define	TASK_TIME	0x8000	/* called from task time		*/
	CERP	kêøˆ s  $        ‹  h‰*B˜ˆ*h‰*     NX‹  
                  ./usr/include/sys/i386/swap.h  .#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)swap.h	16.3	LCC)	/* Modified: 16:06:25 9/16/89 */

#ifndef _h_SWAP
#define _h_SWAP

#ifndef	_h_TYPES
#include <sys/types.h>
#endif	/* _h_TYPES */

/* @(#)swap.h	1.1 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/*
 * The following structure contains the data describing a
 * swap file.
 */

typedef unsigned char use_t;	/* counter of dbd's pointing to a swap blk */
#define MAXSUSE		255		/* maximum share count on swap */

typedef struct swaptab {
	dev_t	st_dev;		/* The swap device.			*/
	use_t	*st_ucnt;	/* Ptr to use count array for pages on swap. */
	use_t	*st_last;	/* Ptr into use count array at which	*/
				/* the next search will begin.		*/
	int	st_swplo;	/* Block number of first block on	*/
				/* device to be used for swapping.	*/
	int	st_npgs;	/* Number of pages of swap space on device. */
	int	st_nfpgs;	/* Number of free pages on device.	*/
	short	st_flags;	/* Flags (defined below).		*/
} swpt_t;

/* Bits in st_flags */
#define	ST_INDEL	0x01	/* This file is in the process 	*/
				/* of being deleted.  Don't	*/
				/* allocate from it.		*/


#ifdef	KERNEL
extern swpt_t	swaptab[];	/* The table of swap files.	*/
extern int	nextswap;;	/* Index into swptab to the	*/
				/* next file to  allocate from.	*/
#endif	/* KERNEL */

/*
 * Values for the "type" argument of the swapctl() system call.
 */
#define	SC_LIST		0	/* List the currently active	*/
				/* swap files.			*/
#define	SC_ADD		1	/* Add a new swap file.		*/
#define	SC_DEL		2	/* Delete one of the currently	*/
				/* active swap files.		*/

#endif /* _h_SWAP */
   stkêC k  $        È  i‰*<˜ˆ*i‰*     AiÈ                    ./usr/include/sys/i386/sysi386.s  h  h  /* H_SCCSID(@(#)sysi386.s	16.2	LCC)	/* Modified: 07:22:05 2/22/89 */
/* SCCSIDgen1(@(#)sysi386.s	1.4	AIX)	/* Modified: 11/19/88 13:49:21 */

/*
/ *	Definitions of System Call Entry Point Numbers
/ *
/ *
/ * For use by SCALL and SCALL0
/ */
	.globl	_cerror

/*
/ * The general template; take a system call# and a label to branch
/ * to on error.  Fall through on success.
/ *	ex:
/ *			.global	foo
/ *		foo: 	SCALLF	FOO,fooerr 
/ *			ret				; success is fine
/ *		fooerr:	movl	foomap[%eax],%eax	; map error codes
/ *			jmp	_cerror			; then return failure
/ */
.macro	SCALLF	callno fail
	mov	$callno,%eax
	lcall	$0x7,$0
	jc	fail
/* falls through on success */
.endm

/*
/ * The "standard" system call
/ *	ex:
/ *			.global	open
/ *		open: 	SCALL	OPEN
/ *			ret		; eax will be as the kernel left it
/ *					; on success; -1 on error.
/ */
.macro	SCALL	callno
	SCALLF	callno,_cerror
/* falls through on success */
.endm

/*
/ * Make sure we return 0 on success.
/ *	ex:
/ *			.global	chmod
/ *		chmod: 	SCALL0	CHMOD
/ *			ret		; eax will be zero on success
/ */
.macro	SCALL0	callno
	SCALLF	callno,_cerror
	movl	$0,%eax
/* probably wants to return after this */
.endm

/*
/ * Default entry point prolog
/ */
.macro	PROLOG
.endm
kêÐ q  $          h‰*<˜ˆ*h‰*     fg  
              LO  ./usr/include/sys/i386/tkr.h 6.s/*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/
#include <sccs.h>
H_SCCSID(@(#)tkr.h	16.4	AIX)	/* Modified: 16:07:11 9/16/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/* adapter unit numbers */
#define ADAPTER0	0
#define ADAPTER1	1

/* masks for telling which adapter we have */
#define PRIMARY		0x1
#define ALTERNATE	0x2

/* Programmed I/O instructions for poking the board.
/* read the switch settings which returns an encoded value containing
 * the starting location of the ROM and the adaptor's interrupt level.
 */
#define READ_SETUP1(port)	inb(port)

/* These are only used on the ADAPTER/A for additional setup of I/O registers */
#define READ_SETUP2(port)	inb(port+0x2)	

/* used for initialization.  This is a two step process whereby the adapter
 * is given a reset command, which is latched.  After delaying for at least
 * 50 milliseconds, the adapter is released.
 */
#define A_RESET(port)		outb(port+0x1,1)
#define A_RELEASE(port)		outb(port+0x2,1)

/* resets and re-enables all adapter interrupt circuitry */
#define A_IRELEASE(port)	outb(port+0x3,1)

/* global interrupt release for ADAPTER I/II's */
#define GLOBAL_IREL(irq) outb(0x2f0+(irq),1)

#define	SETUP_INTBITS	0x03		/* mask to get interrupt level bits */
#define	MMIO_BIT19	0x01		/* SETUP_2 bit that is MMIO bit19 */

/* number to ticks that the board must be held in a reset state before it
 * can be unlatched.  The manual recommends 50 ms, but I set it to a 100ms
 * just for safety
 */
#define LATCH_TIME	(hz*100L/1000L + 1)

/* 
 * give the board INIT_WAITS * LATCH_TIME ms to complete initialization
 */
#define INIT_WAITS	100

/* defines for directing the tk_watch to reset and reopen the adapter */
#define OUTPUT_WATCH	0
#define REOPEN_ADAPTER	1

/*
 * This is a hardware dependent card identifier used to check to see if we
 * actually have token ring installed where the SWITCH_READ() told us that
 * it was
 */
#define CARD_ID_I	0x5049434fL	/* card id for ADAPTER/I */
/* in the future: don't know the card id for ADAPTER/II - using same as I */
#define CARD_ID_II	0x5049434fL	/* card id for ADAPTER/II */
#define CARD_ID_A	0x4d415253L	/* card id for ADAPTER/A */

#define	ADAPTER_NONE	0		/* card is not a token ring adapter */
#define	ADAPTER_I	1		/* card is adapter/I */
#define	ADAPTER_II	2		/* card is adapter/II */
#define	ADAPTER_A	3		/* card is adapter/A */


struct tkdevice {
	u_short hardwired;	/* hard-wired values stuck in the ROM */
	u_char length;
	u_char rom_entry;
	u_char rom[7675];
	u_char rom_checksum;
	u_char rrr_high;	/* high and low bytes of ram relocation */
	u_char rrr_low;		/* register */
	u_short wrb;		/* write region buffer */
	u_short wwo;		/* write window open */
	u_short wwc;		/* write window close */
	u_char isrp_high;	/* interrupt status register-PC/high byte */
	u_char isrp_low;	/* interrupt status register-PC/low byte */
	u_char isra_high;	/* interrupt status register-adapter/high byte*/
	u_char isra_low;	/* interrupt status register-adapter/low byte*/
	u_char tcr_high;	/* timer control register / high byte */
	u_char tcr_low;		/* timer control register / low byte */
	u_char tvr_high;	/* timer value register / high byte */
	u_char tvr_low;		/* timer value register / low byte */
	u_char hole1[24];
	u_char reset_isrp_high;	/* reset isrp - high byte */
	u_char reset_isrp_low;	/* reset isrp - low byte */
	u_char hole_high1;
	u_char reset_isra_low;	/* reset isra - low byte */
	u_char reset_tcr_high;	/* reset tcr - high byte */
	u_char hole3[27];
	u_char set_isrp_high;	/* set isrp - high byte */
	u_char set_isrp_low;	/* set isrp - low byte */
	u_char hole_high2;
	u_char set_isra_low;	/* set isra - low byte */
	u_char set_tcr_high;	/* set tcr - high byte */
	u_char padding1[179];
	u_char adapter_addr[24];/* nibbles: encoded adapter address */
	u_char adapter_addrc[24];/* nibbles 1s complement of adapter address */	
	u_char tk_id[16];	/* nibbles: token ring adapter identifier */
	u_char tk_id2[32];	/* nibbles: token ring adapter identifier 2 */
	u_char padding2[160];
};


#define RAM_WORD(ram,off)	(*(u_short far *)(ram + (off)))
#define FLIP(word) 	(u_short)( ((u_short)(word) >> 8) | ((word) << 8) )

/* 
 * Bit masks for ISRP - low register
 */
#define SSB_RESPONSE 	0x04
#define ARB_COMMAND	0x08
#define ASB_FREE	0x10
#define SRB_RESPONSE	0x20
#define ADAPTER_CHK	0x40

#define ISRP_LOW_BITS	"\20\7DEAD\6SRB_RESP\5ASB_FREE\4ARB_COM\3SSB_RESP"

/* 
 * Bit masks for the ISRP - high register 
 */
#define SHARED_INTR	0x02
#define ACCESS_INTR	0x04
#define ERROR_INTR	0x08
#define TIMER_INTR	0x10
#define INTR_ENABLE	0x40
#define NMI_INTRCTRL	0x80

#define ISRP_HIGH_BITS	"\20\7INTR_EN\5TIM_INTR\4ERR_INTR\3ACC_INTR\2SH_INTR"

/* 
 * Bit masks for the ISRA - low register
 */ 

#define SSB_FREE	0x01
#define ARB_FREE	0x02
#define ASB_FREE_REQ	0x04
#define SRB_FREE_REQ	0x08
#define ASB_RESPONSE	0x10
#define SRB_COMMAND	0x20

#define ISRA_LOW_BITS	\
	"\20\6SRB_COM\5ASB_RESP\4SRB_FREQ\3ASB_FREQ\2ARB_FREE\1SSB_FREE"

/*
 * Bit masks for the ISRA - high register
 */

#define SOFT_INTR_MASK	0x01
#define HARD_INTR_MASK	0x02
#define PROCESSOR_CHK	0x08
#define DEADMAN_TIMER	0x10
#define SEE_ACCESS_INTR	0x20
#define SEE_TIMER_INTR  0x40

#define ISRA_HIGH_BITS  \
	"\20\7SEE_TIMER\6SEE_ACCESS\5DEADMAN\4PROCESSOR_CHK\2HARD_MSK\1SOFT_MSK"

#define OPEN_OPTS_LOW		0x00
#define OPEN_OPTS_HIGH		0x00

/* receive open parameters for ADAPTER I */
#define NUM_RECV8		18
#define RECV_LEN8		256

/* receive open parameters for ADAPTER II/A */
#define RECV_LEN16		1032
#define NUM_RECV16		12

/* the size of the trasmit buffer is independent of the adapter type */
#define XMIT_LEN		2040
#define NUM_XMIT		1

/* asb queue definitions, should be as large as the largest number of
 *  receieve buffers possible
 */
#define ASB_QUEUE_SIZE		18

/* queue up all of the asb requests that can't immediately be serviced.  
 * dequeuing occurrs when an ASB_FREE interrupt is received
 */
struct asb_q {
	u_char  cmd;
	u_short response_data;
};

/* PC to adapter commands */
#define DIR_INTERUPT		0x00
#define DIR_MODIFY_OPEN_PARMS	0x01
#define DIR_RESTORE_OPEN_PARMS	0x02
#define DIR_OPEN_ADAPTER	0x03
#define DIR_CLOSE_ADAPTER	0x04
#define DIR_SET_GROUP_ADDR	0x06
#define DIR_SET_FUCTIONAL_ADDR	0x07
#define DIR_READ_LOG		0x08
#define DIR_SET_BRIDGE_PARMS	0x09
#define TRANSMIT_DIR_FRAME	0x0a
#define DIR_CONFIG_BRIDGE_RAM	0x0c

/* adapter to PC commands */
#define RECEIVED_DATA		0x81
#define RING_STATUS_CHANGE	0x84
#define TRANSMIT_DATA_REQUEST	0x82

/* where all messages are routed */
#define DIRECT_STATION		0x0000

/* 
 * Bit masks for Ring Commands that we might receive.
 */
#define SIGNAL_LOSS		0x8000
#define HARD_ERROR		0x4000
#define SOFT_ERROR		0x2000
#define TRANSMIT_BEACON 	0x1000
#define LOBE_WIRE_FAULT 	0x0800
#define AUTO_REMOVAL		0x0400
#define REMOVE_RECEIVED  	0x0100
#define COUNTER_OVERFLOW 	0x0080
#define SINGLE_STATION   	0x0040
#define RING_RECOVERY	 	0x0020

/* codes for when everything OK */
#define INIT_COMPLETE		0x80
#define SUCCESS			0x00

/* error codes that could occur at initialization or open */
#define PROCESSOR_FAIL		0x20
#define ROM_FAIL		0x22
#define RAM_FAIL		0x24
#define INSTRUCTION_FAIL	0x26
#define INTERRUPT_FAIL		0x28
#define MEMORY_FAIL		0x2a
#define PROTOCOL_FAIL		0x2c
#define TIMER_FAIL		0x40
#define WRITE_RAM_FAIL		0x42
#define READ_RAM_FAIL		0x44
#define RO_RAM_FAIL		0x46
#define INIT_TIMEOUT		0x48

#define INVALID_FAIL		0x01
#define OPEN_FAIL		0x03
#define PARAM_FAIL		0x05
#define CANCEL_FAIL		0x07
#define RBUF_FAIL		0x30
#define ADDR_FAIL		0x32
#define RBUF_LEN_FAIL		0x33
#define XBUF_LEN_FAIL		0x34
rp_hikêúi p  $        j  i‰*>˜ˆ*i‰*     ûµj                    ./usr/include/sys/i386/tss386.h 
H_SCCSID(@(#)tss386.h	16.4	LCC)	/* Modified: 16:07:57 9/16/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _h_TSS386
#define	_h_TSS386

#define 	TSSNOBITMAP	0xDFFF		/* GH Errata 6 0ffff to 0dfff */
#define 	MAXIOPORT	0x10000		/* Maximum mappable I/O port */

	/* NEEDSWORK: this really should not be needed as it is now dynamic */
#define 	IOMAPSIZE	(MAXIOPORT >> 9) /* Size of I/O bit map */

struct tss386 {
	ushort t_back;		/* Back link to previous tss */
	ushort t_rsvdx;
	ulong t_esp0;		/* SP to load on change to priv level 0 */
	ushort t_ss0;		/* SS to load on change to priv level 0 */
	ushort t_rsvd0;
	ulong t_esp1;		/* SP to load on change to priv level 1 */
	ushort t_ss1;		/* SS to load on change to priv level 1 */
	ushort t_rsvd1;
	ulong t_esp2;		/* SP to load on change to priv level 2 */
	ushort t_ss2;		/* SS to load on change to priv level 2 */
	ushort t_rsvd2;
	ulong t_pdbr;		/* Page directory base register (cr3) */
	ulong t_eip;		/* Instruction pointer */
	ulong t_eflags;		/* Machine status flags */
	ulong t_eax;		/* EAX (accumulator) register */
	ulong t_ecx;		/* ECX (count) register */
	ulong t_edx;		/* EDX (data) register */
	ulong t_ebx;		/* EBX (base) register */
	ulong t_esp;		/* Stack pointer */
	ulong t_ebp;		/* Base Pointer */
	ulong t_esi;		/* ESI (Source/Index) register */
	ulong t_edi;		/* EDI (Destination/Index) register */
	ushort t_es;		/* ES (Extra segment) register */
	ushort t_rsvd3;
	ushort t_cs;		/* CS (Code segment) register */
	ushort t_rsvd4;
	ushort t_ss;		/* SS (Stack segment) register */
	ushort t_rsvd5;
	ushort t_ds;		/* DS (Data segment) register */
	ushort t_rsvd6;
	ushort t_fs;		/* FS (extra segment) register */
	ushort t_rsvd7;
	ushort t_gs;		/* GS (extra segment) register */
	ushort t_rsvd8;
	ushort t_ldt;		/* LDT for this task */
	ushort t_rsvd9;
	ushort t_bits;		/* Special bits (e.g. the T-bit) */
	ushort t_bitmapbase;	/* Base of the i/o permission bit map */
#ifdef MERGE386
	char t_iobitmap[IOMAPSIZE];	/* I/O bit map */
#endif
};

#ifdef KERNEL
extern struct tss386 tss;
#endif

#endif /* _h_TSS386 */
ADAPTEkê”µ o  $        D  i‰*B˜ˆ*i‰*     ÀcD  
                  ./usr/include/sys/i386/tuneable.h h  h  H_SCCSID(@(#)tuneable.h	16.3	LCC)	/* Modified: 16:08:57 9/16/89 */

#ifndef _h_TUNEABLE
#define _h_TUNEABLE

/* @(#)tuneable.h	1.1 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

typedef struct tune {
	int	t_gpgslo;	/* If freemem < t_getpgslow, then start	*/
				/* to steal pages from processes.	*/
	int	t_gpgshi;	/* Once we start to steal pages, don't	*/
				/* stop until freemem > t_getpgshi.	*/
				/* Also used to decide when to swap in.	*/

	int	t_unused;	/* Was t_age.  Not used in this system.	*/

	int	t_vhandr;	/* Run vhand once every t_vhandr ticks	*/
				/* when freemem < maxmem / t_vhndfrac.	*/
	int	t_vhndfrac;	/* See t_vhandr.  Overlayed by t_vhandl	*/
				/* after the page daemon starts up.	*/
#define t_vhandl t_vhndfrac	/* In the running system: maxmem / t_vhndfrac */

	int	t_maxsc;	/* The maximum number of contiguous	*/
				/* pages which will be swapped out in a	*/
				/* single operation.			*/
	int	t_prep;		/* Max. number of pre-loaded pages	*/
} tune_t;

extern tune_t	tune;

#endif /* _h_TUNEABLE */
gs *kê€7 n  $        w  i‰*>˜ˆ*i‰*     Ž…w                ò‘  ./usr/include/sys/i386/vcrt.h e./*
 *	IBM Personal System/2
 *
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1984, 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Microsoft Corporation
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef _h_VCRT
#define _h_VCRT

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)vcrt.h	16.3	LCC)	/* Modified: 16:09:48 9/16/89 */

#include <sys/i386/ansicrt.h>	/* definitions for ANSI crt control */
#include <sys/merge/fscreen.h>	/* virtual screen state  */

/*
 * this structure describes the state of a CRT (or a virtual CRT).
 */
struct vcrt 
{
	/* basic virtual state information - for console.c 	*/
	char	nrows;		/* number of rows on the screen	*/
	char	ncols;		/* number of columns on screen	*/
	char	currow;		/* current cursor row		*/
	char	curcol;		/* current cursor column	*/

	/* ANSI virtual screen state information			*/
	char	font;		/* currently enabled char set	*/ 
	char	foreground;	/* foreground color		*/
	char	background;	/* background color		*/
	char	border;		/* border color			*/
	char	video;		/* general video attributes	*/
	char	textmode;	/* are we in a text mode	*/
	char	mapped;		/* are we really on the screen	*/

	/* information for use by driver and lower level code	*/
	char	mode;		/* current display mode		*/
	char	attribute;	/* default display attribute	*/
	char	monitor;	/* monitor type			*/

	/* information to identify driver and physical units	*/
	char	driver;		/* real driver number (vcrtsw)	*/
	char	crtunit;	/* which monitor (of available)	*/
	char	kbunit;		/* which keyboard (of avail)	*/

	/* ANSI virtual keyboard state information		*/
	char	kbd_state;	/* active shifts and locks	*/
	char	pstate;		/* ANSI state-machine state	*/
	char	pnum;		/* number of ansi parameters	*/
	int	parms[NPARMS];	/* current ansi parameters	*/

	/* detailed state information - used by real drivers	*/
	caddr_t realbuf;	/* address of display memory	*/
	caddr_t	savebuf;	/* buffer for use when unmapped	*/
	int	savelen;	/* length of save buffer	*/
	int	start;		/* current dsply offset in buf	*/

	/* scroll state information				*/
	char	scr_topvalid;	/* is top page of memory valid	*/
	char	scr_botvalid;	/* is bottom memory page valid	*/
	short	scr_curline;	/* current scroll pos (line#)	*/
	short	scr_brkline;	/* line# where scroll wraps	*/
	short	scr_lstline;	/* line# of last valid line	*/
	short	scr_totline;	/* tot # lines in screen buffer	*/
	short	scr_numline;	/* tot less overlap (top/bot)	*/

	/* virtual terminal information - for hot-keying	*/
	struct scrstate kd_scrstate;
};

/* values for the ANSI state machine	*/
#define	NORMAL	1	/* passing characters through			*/
#define ESCED	2	/* we've seen an ESC, waiting for rest of CSI	*/
#define PARAMS	3	/* we're building the parameter list		*/
#define PU	4	/* building a function key definition		*/
#define PU1	5	/* building a function key definition		*/
#define PU2	6	/* building a function key definition		*/
#define PU3	7	/* building a function key definition		*/

/* bits within the keyboard state - corresponding to shifts */
#define	SHIFTED		0x01	/* a shift key is down */
#define CONTROL		0x02	/* control key is down */
#define CAPS		0x04	/* Caps lock in effect */
#define NUMS		0x08	/* Num lock in effect  */
#define ALTED		0x10	/* an alt key is down  */
#define SCROLL_LOCKED 	0x20	/* scroll lock in effect */
#define REAL_CONTROL	0x40	/* the REAL control key has been depressed,
				 * not the mapped version.
				 */

/* bits within the attribute field - corresponding to ANSI renditions */
#define VID_BRITE	0x01	/* intensified		*/
#define VID_BLINK	0x02	/* blinking		*/
#define VID_REVERSE	0x04	/* dark on light	*/
#define VID_OFF		0x08	/* blank		*/
#define	VID_MONO	0x10	/* restricted to mono	*/

/* 
 * this table is analagous to the devswitch and is used to vector
 * crt operations to the drivers for the various types of adaptors
 */
struct vcrtsw {
	int (near *v_probe)();	/* probe for existing units	*/
	int (near *v_init)();	/* initialize device and vcrt	*/
	int (near *v_update)();	/* update screen and cursor pos */
	int (near *v_ioctl)();	/* handle screen ioctls		*/
	int (near *v_load)();	/* virtual screen switch - load */
	int (near *v_save)();	/* virtual screen switch - save */
	int (near *v_mode)();	/* mode set / init routine	*/
	int v_savelen;		/* length of a save area	*/
};

#ifdef	KERNEL
extern struct vcrtsw vcrtsw[];
#endif

#endif	/* _h_VCRT */
_kê¸î m  $        ä  i‰*?˜ˆ*i‰*     €iä  
                  ./usr/include/sys/i386/vgasave.h  h  h  /* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/* H_SCCSID (@(#)vgasave.h	16.3.1.1	LCC)	/* Modified	19:24:19	10/27/90	*/



/*
 *
 *     Copyright (c) 1987, 1989 Locus Computing Corporation.
 *     All rights reserved.
 *     This is an unpublished work containing CONFIDENTIAL INFORMATION
 *     that is the property of Locus Computing Corporation.
 *     Any unauthorized use, duplication or disclosure is prohibited.
 */

/*
 * this structure defines the format of the vga state save area that is
 *	maintained and used by the functions in vgasave.c.  The multi-
 *	workstation code requires the kernel version of this structure
 *	be called vga_save rather than vgasave.
 */
#ifdef KERNEL
struct	vga_save
#else
struct	vgasave
#endif
{			
    /* GENERAL REGISTERS						*/ 
    unsigned char   vs_misc_out;	/* Miscellaneous Output Reg	*/
    unsigned char   vs_input_stat0;	/* Input Status Register 0	*/
    unsigned char   vs_input_stat1;	/* Input Status Register 1	*/
    unsigned char   vs_feature_ctrl;	/* Feature Control Register	*/
    unsigned char   vs_vga_enable;	/* VGA Enable Register		*/

    /* SEQUENCER REGISTERS						*/
    unsigned char   vs_seq_index;	/* Sequencer Index Register	*/
    unsigned char   vs_seq_data[NSEQ_REGS]; /* Sequencer Data Registers */

    /* CRT CONTROLLER REGISTERS						*/
    unsigned char   vs_crt_index;	/* CRT Controller Index Reg	*/
    unsigned char   vs_crt_data[NCRT_REGS]; /* CRT Controller Data Register */

    /* GRAPHICS CONTROLLER REGISTER	 				*/
    unsigned char   vs_grx_index;	/* Graphic Controller Index Reg	*/
    unsigned char   vs_grx_data[NGRX_REGS]; /* Data Register Array	*/

    /* ATTRIBUTE CONTROLLER REGS					*/
    unsigned char   vs_attr_index;	/* Attribute Index Register	*/
    unsigned char   vs_attr_data[NATT_REGS];/* Data Register Array	*/
    unsigned char   vs_attr_flipflop;	/* Attribute flip flop		*/

    /* VIDEO D.A.C. REGISTERS						*/
    unsigned char   vs_pel_indx_w;	/* PEL Index Register - Write   */
    unsigned char   vs_pel_indx_r;	/* PEL Index Register - Read 	*/
    unsigned char   vs_pel_mask;	/* PEL Mask Register 		*/
    unsigned char   vs_dac_state;	/* DAC State Register		*/
    unsigned char   vs_color;		/* next color to be written	*/

    /* COLOR LOOK UP TABLE						*/
    int    vs_lut_len;			/* Number of color to save/load */
    struct lut_arg	vs_color_lut;	/* Color Look-Up Table		*/

    /* POINTERS TO REGEN-AREA BUFFERS					*/
    struct {				/* Information on saved memory 	*/
	long    vs_maxlen;		/* size of save/restore buffer	*/
	long	vs_curlen;		/* amt of memory actually saved	*/
	char   *vs_buf;			/* address of saved contents 	*/
    } vs_maps[NEGA_MAPS+1];		/* extra map for char/attr view	*/

    /* OTHER INFORMATION ABOUT THE SAVED VIRTUAL VGA			*/
    char   *vs_mem_base;		/* Base address of saved meory	*/
    int	   vs_mode;			/* BIOS mode table index if any */
    int	   vs_vgaflgs;			/* Flags			*/
    int    vs_devid;			/* Device ID in vmdevsw		*/
    int    vs_vminor;			/* Minor device number		*/
    int    vs_pslot;			/* vm86 process slot		*/
    int    vs_vgastat;			/* Status			*/
#ifdef KERNEL
    struct vga_save *vga_nxt;		/* next save area in chain	*/
#else
    struct vgasave *vga_nxt;		/* next save area in chain	*/
#endif
    unsigned short   old_scrmode;	/* Previous screen mode.	*/ 
};

/*
 * when vga_s_init is called, it needs to know what type of monitor is
 *	to be used, in order to figure out what initial color look up
 *	table to load.  These values can be passed to describe the desired
 *	monitor type.
 */
#define MONITOR_C	1	/* used to request color parms    	*/
#define MONITOR_M	2	/* used to request monochrome parms 	*/
#define MONITOR_X	0	/* used to request real monitor prms 	*/
ablekêÖÙ l  $        ý  i‰*C˜ˆ*i‰*     atý  
              @i  ./usr/include/sys/i386/vseg.h .h/*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)vseg.h	16.3	LCC)	/* Modified: 16:11:32 9/16/89 */

/* H_SCCSIDgen1(@(#)vseg.h	1.19	AIX)/* Modified: 16:21:55 11/20/88 */

#ifndef _h_VSEG
#define _h_VSEG
/*
 * The vseg (virtual segment) structure defines a piece of possibly
 * sharable contiguous virtual address space.  Individual vsegs are
 * used to define a process's text, data, stack, and shared memory
 * virtual segments.
 */

#ifdef i386
#ifndef	_h_PAGE
#include <sys/i386/page.h>
#endif	/* _h_PAGE */

/* Max # of inodes associated with the vseg */
#ifdef	MERGE386
#define INODESPERVSEG	3
#else	/* ! MERGE386 */
#define INODESPERVSEG	1
#endif	/* ! MERGE386 */

/* Number of page-tables/dbd-tables per vseg */
#define PTSPERVSEG	1
#endif	/* i386 */

#ifdef	b370
/*
 *	INODESPERVSEG is really the number of 
 *	(inode,vsegoffset,fileoffset,length) pairs that the vseg can hold.
 *	mapping text&data from the same coff file requires 2 slots...
 */

#define INODESPERVSEG	3	/* Max # of inodes associated with the vseg */

/*
 *	this determines how large a vseg can be.
 *	PTSPERVSEG * (size of VSEG)
 *	370: 4*(512 pages) == 4*2 ==8 Mbytes
 *	XA:  32*(512 pages) == 64 Mbytes
 *	NEEDSWORK:
 *		we have this set to an artificial number to save space
 *		in the vseg. we need to figure out how/whether we can
 *		create a new vseg if we fill a private vseg (e.g.,
 *		we malloc lots and lots of memory).
 */
#ifdef	S370
#define PTSPERVSEG	4	/* Number of page-tables per vseg */
#endif	S370
#ifdef	XA370
#define PTSPERVSEG	32	/* Number of page-tables per vseg */
#endif	XA370
#endif	/* b370 */

struct vseg {
	ushort v_flags;		/* See flags below */
	ushort v_refs;		/* Reference count */
	ushort v_corerefs;	/* In core reference count */
	ushort v_ptpsize;	/* Number of elements in the arrays */
				/* to which v_ptpp & v_dbdpp point */
	ulong v_size;		/* Vseg size (in bytes) */
	ulong v_filled;		/* bytes of core which have been filled. */
	ulong v_nvalid;		/* number of resident pages */
	ulong v_npages;		/* number of pages in core or on swap */
#ifdef b370
	ulong	v_swapnvalid;	/* nvalid when last swapped out */
#endif	/* b370 */

#ifdef i386
	pte_t **v_ptpp;		/* Pointer to list of page tables pages */
	pte_t *v_ptps[PTSPERVSEG];  	/* v_ptpp usually points here */
	dbd_t **v_dbdpp;	/* Pointer to list of dbd pages */
	dbd_t *v_dbdps[PTSPERVSEG];	/* v_dbdpp usually points here */
	/*
	 * v_ptpp and v_dbdpp are also both used as (dbd_t *) when the
	 * vseg is swapped out (they point to dbd's which specify the
	 * block numbers to which the page tables and dbds were written.
	 */
#endif	/* i386 */

#ifdef b370
	vaddr_t	*v_ptpp;		/* Pointer to list of page tables pages */
	vaddr_t	v_ptps[PTSPERVSEG];	/* v_ptpp usually points here */
	dbd_t	*v_swdbdp;		/* Pointer to list of dbds */
	dbd_t	v_swdbds[PTSPERVSEG];	/* v_swdbdp usually points here */
#endif	/* b370 */

	struct vseg *v_forw;	/* Busy list forw link; free link if !VS_BUSY */
	struct vseg *v_back;	/* Busy list back link */

	struct inode *v_ipa[INODESPERVSEG];  /* Associated inodes */
	ulong v_fsizea[INODESPERVSEG];	/* Size in bytes of this vseg's
					 * part of file */
	off_t v_foffa[INODESPERVSEG];	/* Starting offset in file */
	off_t v_fposa[INODESPERVSEG];	/* Starting position in memory of file
					 * (relative to start of vseg) */

	int (*v_expfunc)();	/* Function called when vseg is 'expanded'. */

#ifdef MERGE386
	struct mregion *v_mreg; /* pointer to merge region structure */
#endif /* MERGE386 */

#ifdef b370
#ifdef	XA370			/* NEEDSWORK: should be MIXEDVSEGS */
	ulong	v_rsvdsize;		/* bytes reserved at front */
	ulong	v_rosize;		/* bytes of RO storage in vseg */
#endif	/* XA370 */			/* NEEDSWORK: should be MIXEDVSEGS */
#endif	/* b370 */
};

typedef	struct vseg	vseg_t;


#define VS_PRIVATE	0x0001	/* vsegment cannot be shared */
#define VS_READONLY	0x0002	/* vsegment cannot be written */
#define VS_FILEASSOC	0x0004	/* vsegment is associated with an file/inode */
#define VS_EXPANDDOWN	0x0008	/* vsegment expands down (for stack support) */
#define VS_DEVICEMEM	0x0010	/* vsegment maps device (aka "magic") memory */
#define	VS_MIXED	0x0020	/* vseg contains both RO and writable pages */
				/* VS_MIXED is an XA370 feature */
#define VS_INHERIT	0x00FF	/* These flags are inherited on a fork */

#define VS_LOCK		0x0100	/* vsegment is locked */
#define VS_WANTED	0x0200	/* A process is waiting on VS_LOCK */
#define VS_SWAPWAKE	0x0400	/* Wakeup sched() when unlocking if runout */
#define VS_SWAPPED	0x0800	/* Page tables are on the swap device */
#define VS_NOSWAP	0x1000	/* vsegment is plock'ed: don't swap */
#define VS_GROWING	0x2000	/* vsegment is being grown */
#define VS_BUSY		0x8000	/* vsegment is in use (not on free list) */


/*
 * Each process has a list of procvsegs structures in its process table.
 * These procvsegs structures define which vsegments a given process has
 * associated with it.
 */
struct procvseg  {
	struct procvseg *pv_next; /* pointer to next per proc, or next free. */
	struct vseg *pv_vseg;	/* Pointer to vsegment */
	vaddr_t pv_vaddr;	/* The Vsegment's linear address for this proc*/
	ushort pv_flags;	/* See flags below */
};

typedef	struct procvseg	pvseg_t;

#define PV_READONLY	0x0001	/* Pvsegment is READONLY */
#define PV_ATTACHED	0x0002	/* Process attached this vseg (so if vswapout
				 * detaches, it will know to reattach). */
#define PV_OLD		0x0004	/* Start of the list of old vsegs during an
				 * exec. */
#define PV_DELETED	0x0008	/* Soon to be deleted; don't let vsattach
				 * or vsdetach modify the pagedir */
#ifdef i386
#define PV_KERNSHARE	0x0010	/* This pvseg contains at least 1 user/kernel
				 * shared page, and needs special handling in
				 * procdup().
				 */
#endif /* i386 */

#ifdef b370
#define	PV_MIXED	0x0020	/* mixed READONLY and writeable protections */
#endif /* b370 */

#define PV_TYPE		0xf000	/* Mask for PV_SEGMENT type */
#define PV_TEXT		0x1000	/* Text segment */
#define PV_DATA		0x2000	/* Data segment */
#define PV_STACK	0x3000	/* Stack segment */
#define PV_SHM		0x4000	/* System V shared memory */
#define PV_SHLTEXT	0x5000	/* Shared library Text */
#define PV_SHLDATA	0x6000	/* Shared library Data */
#ifdef MERGE386
#define PV_VM86		0xA000	/* VM86 vseg */
#endif
#define	PV_MAGIC	0xB000	/* mapped screen memory */

/* Flags inherited by fork() */
#define PV_INHERIT	(PV_TYPE | PV_READONLY)

#ifdef KERNEL
/* routines in vseg.c */
extern vseg_t	*vsalloc();		/* Allocate a vseg */
extern vseg_t	*vsfind();		/* Find a shared vseg */
extern pvseg_t	*pvsassoc();		/* Associate with a vaddr */
#ifdef b370
extern pvseg_t	*vtopvseg();		/* Find procvseg for a vaddr */
#else	/* ! b370 */
extern pvseg_t	*ltopvseg();		/* Find procvseg for a vaddr */
#endif	/* ! b370 */
extern pvseg_t	*pvsegalloc();		/* Allocate a procvseg */

/* global counter for "available" procvsegs */
extern int pvseg_freecnt;
#endif /* KERNEL */

#endif	/* ~_h_VSEG */
dbdkêxv h  $        ]=  j‰*@˜ˆ*j‰*     !Z]=  
              f›  ./usr/include/sys/i386/x25.h  .h/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)x25.h	16.5 LCC)	/* Modified: 11:35:06 1/13/90 */

/*
* Copyright (C) 1988, 1989, Locus Computing Corporation
 * All Rights Reserved
 */

#define INITIALLUN 64
#define SERVERLUN 0

#define MAXLINES 2	/* Max number of physical lines */
#define MAXVC    10	/* Max number of logical units per line */
#define MAXLUNS	 (MAXVC*MAXLINES)

#define X25PRI 26 

/* wait modes */
#define X25NOWAIT 0
#define X25WAIT	1
#define X25TIMEDWAIT 2
#define X25CALLBACK 3

/* protocols */
#define	X25PROTO_X29	0
#define	X25PROTO_IP	1
#define	X25PROTO_GEN	2
#define	X25PROTO_UNUSED 3

#define CBFREE(cp)	add_que(cp, &free_list)

#define GETPTR(board, address)	((icarshort(board, address+2) << 4) + \
					icarshort(board, address))

#define PTR2LONG(ptr)	(((long)ptr.segment << 4) + ptr.offset)

#define XIO_SIZE	2048

struct	farptr {
	unsigned short offset;
	unsigned short segment;
};

struct  xio_struct {
	unsigned char    xio_info[2];
        unsigned short   xio_count ;     /* byte count in xio_data       */
        unsigned char   xio_data[XIO_SIZE] ;
} ;

#define X25TASK		2

/* X.25 packet types */

#define X25DATABIT	0x01	/* this must be clear for DATA */
#define X25CALL		0x0b
#define X25CALLCONF	0x0f
#define X25CLEAR	0x13
#define X25CLEARCONF	0x17
#define X25INTR		0x23
#define X25INTRCONF	0x27
#define X25RESET	0x1b
#define X25RESETCONF	0x1f
#define X25RESTART	0xfb
#define X25RESTARTCONF	0xff
#define X25REGISTER	0xf3
#define X25REGISTERCONF 0xf7
#define X25DIAGNOSTIC   0xf1

#ifdef KERNEL

/* These are the possible sequence numbers of the state machine */
/* last state must be less than 127 */

#define S_SRVOPEN	1
#define S_XIOLUN	2
#define S_OPEN		3
#define S_XIOMODE	4
#define S_XIOOPEN	5
#define S_READCALL	6
#define S_MAKECALL	7
#define S_READCONF	8
#define S_CONNECT	9
#define S_STARTREAD	10	
#define S_READDATA	11
#define S_RESPOND	12	
#define S_CLOSE		13	
#define S_CLEAN		14
#define S_DONE		15
#define S_FIRSTREAD	16
#define S_GETSTAT	17
#define S_STATUS	18
#define S_INVITECLEAR   19
#define S_PRIMEREAD     20
#define S_SENDPARAM	21
#define S_READPARAM	22


#define S_PASSIVE	0x80
#define S_NOMODES	0x7f

/* used in x25com */
#define X25BOARD	0
#define BCBPNT		0x45aL
#define BCBLEN		0x10L
#define DQ_PTR		0x0L
#define DQ_ADDR		0x16L
#define ZQ_PTR		0x4L
#define ZQ_ADDR		0x1eL

struct	que_pnt {
	struct host_cmd_block *f;
	struct host_cmd_block *b;
};

/*
 * This structure is used to keep the current state of the lines and luns
 */

struct  lun_table {
	int lun;			/* lun #			*/
	int line;			/* line associated with this lun*/
	int state;			/* LUN state			*/
	int status;			/* last failure status */
	int protocol;			/* associated protocol */
	struct que_pnt qp;		/* pointers to posted cmd_blk's	*/
};

/*
 * Common states in lun_tabs & command_blocks
 */

#define XREAD		0x0001		/*Read cmd pending or this is a read*/
#define XWRITE		0x0002		/*Write cmd pending or this is a write*/
#define XOPEN		0x0004		/*Open cmd pending or this is a open*/
#define XCLOSE		0x0008		/*Close cmd pending or this is a close*/
#define XIOCTL		0x0010		/*Ioctl cmd pending or this is a ioctl*/

/*
 * lun states
 */

#define LONLINE		0x0040		/* Lun has been opened */

/*
 * This structure defines a entry in the command queue that is used to
 * to keep track of a command to be sent to the titan x25 software in the 
 * comm board.
 *
 * A command block may be on one of 3 ques at any one time.  The first is
 * a free list of command blocks. The next que is the post que, this
 * que consists of entries that haven't been posted to the commb.
 * The last que is the lun que. A cmd_block is placed on a luns' que 
 * after it's posted to the commb. It is then waiting completion via a status
 * block from the commb
 */

struct host_cmd_block {
	int lun;			/* owner lun			*/
	int cmd;			/* Command ig - OPEN/READ/CLOSE */
	union {
		int x;			/* Generic for postcmd		*/
		int line;		/* Open, line #			*/
		int count;		/* READ/WRITE, count		*/
		int code;		/* IOCTL, ioctl code		*/
	} ux;
	union {
		char *z;		/* generic for postcmd		*/
		char *buffer;		/* Read/write buffer pnt	*/
		char *arg;		/* Ioctl arg pnt		*/
		unsigned char c[4];	/* Ioctl cmds			*/	
	} uz;
	struct xio_struct *ioptr;	/* Ioctl arg pointer		*/
	int state;			/* state ig - complete/timeout/free */
	int actual;			/* Byte count actually xfer'edu	*/
	int callarg;			/* callback argument */
					/* error - for callback only	*/
	int (*callback)();		/* proc to callback if callback set */
					/* callarg - when callback error */
	struct que_pnt qp;		/* pointers to others que entries */
	int timeout;			/* number of expired ticks acrued */
};

/*
 * Command block states
 *
 * (These start at 20 because of the common states above)
 */

#define BTIMING		0x0020		/* Timeout requested		   */
#define BERROR		0x0040		/* I/O error                       */
#define BINTR		0x0100		/* Signal pending		   */
#define BSLEEPING	0x0200		/* a proc is sleeping on this blk  */
#define BDONE		0x0400		/* I/O is complete                 */
#define BCALLBACK	0x1000		/* callback when complete	   */

/*
 * This is the command structure that is sent to the commb via the
 * command que in the dual port ram.
 */

struct commb_cmd_block {
	union {
		struct farptr bufpnt;
		unsigned short count;
		unsigned char cmd[4];
	} cbu;
	unsigned char lun;
	unsigned char cmd;
};

/*
 * THis is the status block that is received from the commb after the
 * completion of each command
 */

struct commb_stat_block {
	unsigned char cmd;
	unsigned char lun;
	union {
		signed char status;
		struct farptr z_tic;
		struct {
			struct farptr ptr;
			unsigned short count;
		} xfer;
		struct {
			char fill[4];
			char signal;
		} sig;
		struct {
			char z_junk[4];
			char z_sig_code;
		} z_signal;
	} sbu;
	char z_pkt_type;
	char z_dbit_ack;
};

/*
*******************************************************************************
**              TITN CONFIDENTIAL AND PROPRIETARY
**      This source is the sole property of TITN Inc.
**      Reproduction or utilization of this source in whole or in part
**      is forbidden without the written consent of TITN Inc.
****************************************************************************
**      static char SccsId[] = "@(#)commb.h     3.0     08/24/87";
*******************************************************************************
**                      (c) Copyright TITN,Inc  1986
**                          All Rights Reserved
*******************************************************************************
**
**      FILE NAME               : commb.h
**      DESCRIPTION             : contains the definitions for interfacing to
**                                the communications board to the host
**                                system.  This includes the IOCTL's and
**                                some queueing structures.
**
**      AUTHOR                  : TITN Development Team
**
*/
 
/*****************************************************************/
/**             C O M M B       I N T E R F A C E               **/
/*****************************************************************/
 
/************************/
/*  driver commands     */
/************************/
 
#define DEMPTY           0x00   /* free queue entry */
#define DTIC             (2*1)  /* DTIC, 255,address */
#define DOPEN            (2*2)  /* DOPEN,lun,mode */
#define DCLOSE           (2*3)  /* DCLOSE,lun */
#define DREAD            (2*4)  /* DREAD,lun,count */
#define DREADC           (2*5)  /* DREADC,lun */
#define DWRITE           (2*6)  /* DWRITE,lun,count */
#define DWRITEC          (2*7)  /* DWRITEC,lun */
#define DIOCTL           (2*8)  /* DIOCTL,lun,command */
#define DIOCTLC          (2*9)  /* DIOCTLC,lun, */
#define DSIGE            (2*11) /* DSIGE,lun */
#define DALIVE           (2*12) /* DALIVE,255 */
#define DRESETO          (2*13) /* DRESETO,lun */
#define DRESETR          (2*14) /* DRESETR,lun */
#define DRESETW          (2*15) /* DRESETW,lun */
#define DRESETI          (2*16) /* DRESETI,lun */
 
/********************************/
/*      firmware commands */
/********************************/
 
#define ZEMPTY           0x00   /* free queue entry */
#define ZTIC             (2*1)  /* ZTIC,255,address */
#define ZOPEND           (2*2)  /* ZOPEND,lun,status */
#define ZCLOSED          (2*3)  /* ZCLOSED,lun,status */
#define ZREAD            (2*4)  /* ZREAD,lun,pointer,count */
#define ZREADD           (2*5)  /* ZREADD,lun,status */
#define ZWRITE           (2*6)  /* ZWRITE,lun,pointer,count */
#define ZWRITED          (2*7)  /* ZWRITED,lun,status */
#define ZIOCTLR          (2*9)  /* ZIOCTLR,lun,pointer,count */
#define ZIOCTLW          (2*10) /* ZIOCTLW,lun,pointer,count */
#define ZIOCTLD          (2*11) /* ZIOCTLD,lun,status */
#define ZSIGNAL          (2*12) /* ZSIGNAL,lun,signal */
#define ZALIVE           (2*14) /* ZALIVE,255 */
#define ZRESETO          (2*15) /* ZRESETO,lun,status */
#define ZRESETR          (2*16) /* ZRESETR,lun,status */
#define ZRESETW          (2*17) /* ZRESETW,lun,status */
#define ZRESETI          (2*18) /* ZRESETI,lun,status */

#endif /* KERNEL */

/*
**      Adaptor numbers definitions.
**
**      These adaptor numbers are used in the open sequence of any user
**      lun, when an XIOMODE ioctl is sent to X.25. It allows selection
**      of the operation mode of the lun.
*/
 
#define A_X25           0       /* X.25 adaptor, what it is		*/
#define A_X29           1       /* X.29 adaptor, for tty emulation      */
#define A_PAD           6
 
/*
**  Signal definitions
*/
 
#define SIGBAND         26      /* special out-of-band signal */
#define SIGX25          27      /* arrival of an X.25 incoming call */
#define SIGXCDON        28      /* signal to user carrier detect on */
#define SIGXCDOFF       29      /* signal to user carrier detect off */
#define SIGXCRASH       30      /* signal to user of crash */
#define SIGXIDIN        31      /* signal to user xid packet has arrived */
#define SIGXL2OFF       32      /* signal to user level 2 is non-operational */
#define SIGXL2ON        33      /* signal to user level 2 is operational */
#define SIGAR           34      /* Accept Recived: signal for call accept */
#define SIGDAT          35      /* Data packet received, no outstanding read */
#define SIGWRITE        39      /* signal to enable user to issue a write */
#define SIG_CL_CONF     40      /* signal to user clear confirmation */
#define SIG_RS_CONF     41      /* signal to user reset confirmation */
#define SIG_REG_CF      42      /* signal to user registration confirmation */
#define SIGPARAM        43
 
/*
**  I/O control commands
*/
 
#define XIOLUN  1              /* reserve a lun */
#define XIOOPN  2              /* officially open a LUN */
#define XIOSTR  3              /* status request */
#define XIODATA 4              /* switch X.25 software to data mode */
#define XIOPKT  5              /* switch X.25 software to packet mode */
#define XIOLST  6              /* link status (frame level) */
#define XIOVST  7              /* virtual circuit status (packet level) */
#define XIOSTAT 8              /* statistics */
#define XIOSHUT 9              /* orderly shut down of X.25 software */
#define XIOMODE 10             /* give mode and line numbers */
#define XIOIT   11             /* interrupt in data mode */
#define XIONET  13             /* network type */
#define XIOREAD 14             /* Test if data to read */
#define XIOWRITE 15            /* Test if data to write */
#define XIODOWN 16             /* Turn off Level 2 (DISC) */
#define XIOUP   17             /* Turn on Level 2 (SABM) */
#define XIOSTART 18            /* Turn on Level 1 hardware */
#define XIOSTOP 19             /* Turn off Level 1 hardware */
#define XIOSXID 20             /* Send ISO XID password */
#define XIORXID 21             /* Retrieve ISO XID password */
#define XIOFLAG 22             /* Turn on special packet flags */
#define XIOBIT  23             /* Turn on D/M/Q bit observation */
#define XIOOPT  24             /* Turn on special option processing */
#define XIOFRAME 25            /* Direct Level 2 access */
#define XIOINTRR        26
#define XIOSNDINIT      27             /* send an Initialization table */
#define XIOGETINIT      28             /* retrieve an Initialization table */
#define XIOCLRAM        29             /* shutdown a line structure table */
#define XIOVCMODE       30              /* Get virtual circuit settings */
#define XIOISOTIMERS    31              /* Set ISO timers */
#define XIOACU          32              /* ACU control   */
#define XIOREGIST       33          /* send (req) or read (conf) a regist. pk */
#define XIODELAY        34
 
/* the following ioctl's should only be done on the initial lun */
#define X25CLOSESERVER  95
#define X25OPENSERVER   96
#define X25INIT    	97
#define X25TIMEOUT 	98
#define X25ERR	  	99
#define X25ROUTE	100

#define X29SETP         0x09           /* ioctl TIOCSETP */
#define X29GETP         0x08           /* ioctl TIOCGETP */
#define X29SETN         0x0a
#define X29SETC         0x11
#define X29GETC         0x12

/********************************************************/
/*    E R R O R   R E T U R N   C O D E S 		*/
/********************************************************/

#define		ELOPEN		-1	/* LUN is already open */
#define		ELNOOR		-2	/* LUN number out of range */
#define		EBAN		-3	/* Bad adapter number	*/
#define		EBLN    	-4	/* Bad line number	*/
#define		ELCLOS		-5	/* LUN is closed	*/
#define		EOREAD		-6	/* Outstanding read on LUN	*/
#define		EOWRIT		-7	/* Outstanding write on LUN	*/
#define		ELWFOP		-8	/* LUN is waiting for open params */
#define		ELIWS		-9	/* LUN is in write state	*/
#define		ELIAS		-10	/* LUN is in answer state	*/
#define		ELIRS		-11	/* LUN is in read state	*/
#define		ELIOS		-12	/* LUN is in ON state	*/
#define		ETOMCH		-13	/* data length is to large for Mbox */
#define		ELNWS		-14	/* LUN is not in write state	*/
#define		ENOPOOL		-15	/* No buffer pool for writing	*/
#define		ENOBUF		-16	/* No buffer for writing	*/
#define		EBIT		-17	/* Bad IOCTL type	*/
#define		EBCMD		-18	/* Bad command from driver */
#define		ESLNO		-19	/* Server lun is not open */
#define		ELDOWN		-20	/* Link level is down */
#define		ERPKSZ		-21	/* Bay byte count on packet read */
#define		EPKSZ		-22	/* Bad byte count on packet write */
#define		ELUP		-23	/* Link level already up */
#define		EHOFF		-24	/* Hardware off */
#define		EHON		-25	/* Hardware already on */
#define		EINITAB		-26	/* init table contained bad values */
#define		ESXID		-27	/* error in sending xid */
#define		EWRINV		-28	/* Write invalid on this lun */
#define		EIOINV		-29	/* Bad IOCTL code for this lun */
#define		ERDINV		-30	/* Read invalid on this lun */
#define		EINPRG		-31	/* Operation already in progress */
#define		EBADDTE		-32	/* Bad DTE address (QLLC) */
#define		EBPKT		-33	/* Bad packet type for write */
#define		EVCLR		-34	/* Virtual circuit is cleared */
#define		EWSTATE		-35	/* Invalid write in this state */
#define		ERSTATE		-36	/* Invalid read in this state */
#define		EVRESET		-37	/* Virtual circuit is reset */

/*
****************************************************************************
**              TITN CONFIDENTIAL AND PROPRIETARY
**      This source is the sole property of TITN Inc.
**      Reproduction or utilization of this source in whole or in part
**      is forbidden without the written consent of TITN Inc.
****************************************************************************
*/
 */kê²d i  $        ³  j‰*@˜ˆ*j‰*     \¦³  
                  ./usr/include/sys/i386/x29.h  .h/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#) x29.h  16.2 LCC)	/* Modified: 16:13:22 9/16/89 */

/*
* Copyright (C) 1988, 1989, Locus Computing Corporation
 * All Rights Reserved
 */

#define QBIT	0x80

/* definition for pad messages */
#define SETMSG		0x02
#define READMSG 	0x04
#define SETRDMSG	0x06
#define PARAMMSG	0x00
#define INVITEMSG	0x01
#define BREAKMSG	0x03
#define RESELMSG	0x07
#define ERRORMSG	0x05

/* parameter value used in READMSG */
#define READPARAM	0x00

/* set in PARAMMSG when the parameter reference is invalid */
#define INVALIDBIT	0x80

/* error types sent as a response to SETMSG and SETRDMSG in
 * addition to the INVALIDBIT in PARAMMSG
 */
#define NOINFO		0x00
#define NOIMPLEMENT	0x01
#define NOVALID		0x02
#define NOALTER		0x03
#define NOWRITE		0x04
#define INVALIDSEP	0x05

/* error types sent in an ERRORMSG */
#define LESSTHAN8	0x00
#define BADMSGCODE	0x01
#define BADFIELD	0x02
#define BADCOUNT	0x03
#define BADORDER	0x04
#define TOOLONG		0x05

/* define x.29 parameters */
#define X29PARAM1	1
#define PADRECALL	X29PARAM1
#define X29PARAM2	2
#define PADECHO		X29PARAM2
#define X29PARAM3	3
#define PADFORWARD	X29PARAM3
#define X29PARAM4	4
#define PADTIMER	X29PARAM4
#define X29PARAM5	5
#define PADDEVCTRL	X29PARAM5
#define X29PARAM6	6
#define PADSERVICE	X29PARAM6
#define X29PARAM7	7
#define PADBREAK	X29PARAM7
#define X29PARAM8	8
#define PADDISCARD	X29PARAM8
#define X29PARAM9	9
#define PADPADCR	X29PARAM9
#define X29PARAM10	10
#define PADFOLD		X29PARAM10
#define X29PARAM11	11
#define PADSPEED	X29PARAM11
#define X29PARAM12	12
#define PADFLOW		X29PARAM12
#define X29PARAM13	13
#define PADLFCR		X29PARAM13
#define X29PARAM14	14
#define PADPADLF	X29PARAM14
#define X29PARAM15	15
#define PADEDIT		X29PARAM15
#define X29PARAM16	16
#define PADDEL		X29PARAM16
#define X29PARAM17	17
#define PADLDEL		X29PARAM17
#define X29PARAM18	18
#define PADLRTYPE	X29PARAM18
#define X29PARAM19	19
#define PADEDTSIG	X29PARAM19
#define X29PARAM20	20
#define PADECHOMSK	X29PARAM20
#define X29PARAM21	21
#define PADPARITY	X29PARAM21
#define X29PARAM22	22
#define PADPAGE		X29PARAM22
t on kê.´ æ  $        ù
  m‰*í™ˆ*m‰*     «Mù
  	                  ./usr/include/sys/i386/xhd.h  .h#ifndef H_SCCSID
#include <sccs.h>
#endif /* H_SCCSID */
H_SCCSID(@(#)xhd.h	1.4	AIX)	/* Modified: 23:31:34 8/3/90 */

/* 
 * (C) Copyright IBM Corp. 1989,1990
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * xhd.h
 *
 * This file contains the definitions for the structure and other defines
 * that are necessary to link various DASD device drivers together under
 * one major number.
 *
 * Author:
 *   Guy G. Sotomayor, Jr.
 *   IBM Corp.
 *   Boca Raton, FL
 *   (407) 982-7428
 *   VNET: GGS @ BCRVMPC2
 *
 * Maintanence Log:
 *
 * Revision	Date	Who	Description
 * --------	-------	-----	----------------------------------------------
 * 0.00		12/21/89 GGS	Original Code Entry
 *
 */

/*
 * The following defines the maximum number of drives that AIX supports.
 */
#define	MAX_AIX_DISKS	66
#define	MAX_XHD_NAME	16

/*
 * The following structure is defined for each DASD device driver that wants to
 * be associated under the common DASD major number(s).  This allows other vendors
 * to add disk device drivers to the system and to be able to use the various
 * commands (like maint & minidisks) to be able to access those drives.
 */
struct	xhd_link
	     {
	     struct xhd_link	*next;		/* pointer to next structure	*/
	     char		*driver_name;	/* name of the device driver	*/
	     int		flags;		/* flags about this structure	*/
	     int		min_drives;	/* minimun # of drives used	*/
	     int		max_drives;	/* maximum # of drives used	*/
	     int		drive_offset;	/* offset (from 0) of 1st drive	*/
	     int		cur_drives;	/* current # of drives used	*/
	     int		track0_length;	/* length of track 0		*/
	     int		(*init)();	/* init routine			*/
	     int		(*open)();	/* open routine			*/
	     int		(*close)();	/* close routine		*/
	     int		(*read)();	/* read routine			*/
	     int		(*write)();	/* write routine		*/
	     int		(*ioctl)();	/* ioctl routine		*/
	     int		(*park)();	/* park routine			*/
	     int		(*dump)();	/* dump routine			*/
	     int		(*strategy)();	/* strategy routine		*/
	     int		(*mbstrategy)();/* multi-block I/O strategy rtn	*/
	     int		(*get_partition)();/* returns ptr to table entry*/
	     };

typedef	struct	xhd_link	XHD_LINK;

/*
 * The following defines describe the bits that are in the flags field of the
 * xhd_link structure.
 */
#define	XHDL_INITIALIZED	0x0001		/* driver was initialized	*/
#define	XHDL_PRESENT		0x0002		/* hardware is present		*/
#define	XHDL_DRIVES_VALID	0x0004		/* current # of drives is valid	*/

/*
 * The following structure is passed back each time an XHD_INFO IOCTL is
 * made.
 *
 */
struct	xhdl_info
             {
	     char	driver_name[MAX_XHD_NAME];
	     int	start_drive;
	     int	num_drives;
	     };

typedef	struct	xhdl_info	XHDL_INFO;

#define	XHDIO	('X' << 8)
#define	XHD_INFO	(XHDIO | 1)
fine		Ekê¾ È  ÿ¡             ]‰*]‰*]‰*          	                  ./usr/include/sys/icmp_var.h  .h../netinet/icmp_var.h _vkêXk Š  $          ‰*6˜ˆ*‰*     Ð†  	              eR  ./usr/include/sys/icrt.h r.h  .h/*
 *	IBM Personal Computer IX/AT
 *		Version 1.00
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1984, 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Microsoft Corporation
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

/*	H_SCCSID(@(#)icrt.h	16.3	LCC)	/* Modified: 21:42:33 9/15/89 */

/*
** various and sundry information relating to memory mapped screens
*/

#include "comcrt.h"

/*
 * definitions for internal modes (used in switching fonts)
 */

#define M_B_INTERNAL	11
#define M_C_INTERNAL	12

#define NFKEYS  48	/* max number of function key definitions */

/*
 * common definitions for all crt devices
 */

#define NORMAL  1   	/* type of crt state - most chars will go onto screen */
#define ADDR(r, c) ((r - 1) * NCOLS + (c - 1))

#define MODE	0x08	/* offset of mode register for mca, cga, and pga */
#define SCAN	0x09	/* offset of overscan register for mca, cga, and pga */

    /* mode register bit values */
#define MR_80COL	0x01	/* alpha mode, 80 col */
#define MR_GRAPH	0x02	/* lo-res graphics mode (COLOR/BW, 200x320) */
#define MR_BW		0x04	/* black and white mode */
#define MR_VENABLE	0x08	/* video enable */
#define MR_G640		0x10	/* hi-res graphics mode (BW only, 200x640) */
#define MR_BLINK	0x20	/* enable blink atrribute */

    /* cga graphics support */
#define NPROWS		200		/* number of pel rows */
#define NPCOLS		640		/* number of pel cols */
#define PELSIZE		(NPROWS*(NPCOLS/8))
#define EVENBASE	0x0000		/* base offset of even rows */
#define ODDBASE		0x2000		/* base offset of odd rows */



/* attr and font defines */
#define PRIMARY	0
#define BOLD	1
#define USCORE	4
#define BLINK	5
#define REVERSE	7
#define NOREVERSE 21	/* not ANSI standard */
#define NDISP	8
#define FONT0	10
#define FONT1	11
#define FONT2	12

/* display/adapter defines (rest are in comcrt.h) */
#define NDEVS	6	/* number of minor devices */
#define	NODISP	0
#define CONS	0
#define AMBIG_COLOR	(NDEVS)	/* must be an illegal type */

/* address and limit specifications for crt memory areas */
#define MONO_PADDR	0xB0000L
#define MONO_LIMIT	0xFFF
#define COLOR_PADDR	0xB8000L
#define COLOR_LIMIT	0x3FFF
#define EGA_PADDR	0xA0000L
#define	EGA_LIMIT	0xFFFF
#define	VGA_PADDR	0xA0000L
#define VGA_LIMIT	0x1FFFFL

/* common definitions for register CRTC registers */
#define RINDEX	4
#define RDATA	5
#define	RSALO	13
#define RSAHI	12
#define RCRLO	15
#define RCRHI	14

/* common definitions for all crt devices */
#define NROWS	25	/* number of rows */
#define NCOLS	80	/* number of columns */

struct crtsw {
	int (near *v_scroll)();
	int (near *v_copy)();
	int (near *v_clear)();
	int (near *v_pchar)();
	int (near *v_scurs)();
	int (near *v_init)();
	int (near *v_sgr)();
	int (near *v_ioctl)();
};


#define NPARMS 3	/* max # of params */

/*
** the crt structure is used to hold the state information
** separately for each minor device
*/
struct crt {
	int crow, ccol;		/* current active position */
	int param[NPARMS];	/* parameter list */
	int pnum;		/* index of parameter we're building */
	int state;		/* state of machine */
	int pres;		/* presence flag: non-zero means present */
	int nrows;		/* number of rows on this display */
};


    /* crt[].pres field defines, 0 means not present */
#define CP_TEXT		1	/* text mode */
#define CP_GRAPH	2	/* graphics mode */


/* mscrbuf is memory set aside for keeping the multiple console screen pages.
 * The first char of the first page is saved in the two bytes beginning at
 * mscrbuf[mscrtop], while the last byte of the last page is the preceding
 * two bytes.  The NROWS*NCOLS chars that make up the page currently being
 * displayed on the screen are backed by the bytes beginning with
 * mscrbuf[mscrcur], although the copy of the bytes in the mscrbuf array
 * is not necessarily valid until the data is no longer on the screen.
 *
 * This buffer is used for mca, ega and pga displays.  For cga displays,
 * only the mscrtop offset is used to determine where the fist page begins,
 * as the screen memory doesn't need to backed up by the mscrbuf buffer.
 */
#define MSCRSAVPGS 4
#define SCRSIZE	(NROWS * NCOLS)
#define SCRSZ2	2048	/* power of 2 >= SCRSIZE */
#define MSCRSIZE  (SCRSZ2 * MSCRSAVPGS)
#define MSCREXTRA  (MSCRSIZE - MSCRSAVPGS * SCRSIZE)

/* Macros for computing the offset for the end of a screen */
#define SCREENEND(start,len) \
	((start+SCRSIZE <= len) ? (start+SCRSIZE) : (start+SCRSIZE-len))

#define MSCRCUREND SCREENEND(*mscrcur, MSCRSIZE)

#define MSCRMASK(addr)	((addr)&(MSCRSIZE-1))

/* parameters to mscrbufcopy */
#define MC_FROMSCREEN	0
#define MC_TOSCREEN	1

#dkêTÝ Æ  ÿ¡             ]‰*]‰*]‰*          	                  ./usr/include/sys/if.h h../net/if.h e/sykê¦ Ä  ÿ¡             ]‰*]‰*]‰*          	                  ./usr/include/sys/if_arp.h h  .h../net/if_arp.h kêÂ ˆ  $        Ö+  ‰*E˜ˆ*‰*     4mÖ+  	               R  ./usr/include/sys/if_ena.h h  .h/*
 * WD8003
 *
 * definitions for use with WD8003 driver for AIX on the PS/2
 */

/* Hardware definitions for the WD8003 and 8390 LAN controller		*/

#include <sys/sccs.h>
H_SCCSID(@(#)if_ena.h	1.1    IBM AIX)    /* Modified: 19:33:39 7/15/92 */
#define MINFRAME 60
/* WD8003 Definitions and Statistics					*/

#define TX_BUF_CNT	6
#define TX_BUF_LEN	(TX_BUF_CNT*256)

/* WD8003 Commands							*/

#define SFTRST	0x80			/* software reset command	*/
#define MEMENA	0x40			/* memory enable switch		*/
 
#define IRR             4       /* Interrupt Request Register (on       */
                                /*      boards with WD83C583 chip)      */
#define CCR             5       /* Configuration Control Register       */
                                /*      (Micro Channel boards with      */
                                /*      WD83C593 chip)                  */
#define LAAR            5       /* LA Address Register (16 bit AT bus   */
                                /*      boards)                         */
/* IRR register definitions */
#define IRR_IEN         0x80    /* Interrupt Enable */
#define IRR_IRQMASK     0x60    /* mask for IRQ bits */
#define IRR_IRQ2        0x00    /* IRQ2 selected */
#define IRR_IRQ3        0x20    /* IRQ3 selected */
#define IRR_IRQ4        0x40    /* IRQ4 selected */
#define IRR_IRQ7        0x60    /* IRQ7 selected */

/* CCR register definitions */
#define EIL             0x4             /* enable interrupts            */

/* LAAR register definitions */
#define MEM16ENB        0x80
#define LAN16ENB        0x40

/* WD8003 register locations						*/

#define	UBA_STA		8
#define	WD_BYTE		0xE
#define CMD_OFFSET 	0x10

/* 8390 Registers: Page 1						*/
/* NOTE: All addresses are offsets from the command register (cmd_reg)	*/

#define	PSTART	0x1
#define	PSTOP	0x2
#define	BNRY	0x3
#define	TPSR	0x4
#define	TBCR0	0x5
#define	TBCR1	0x6
#define	ISR	0x7
#define RBCR0	0xA
#define RBCR1	0xB
#define	RCR	0xC
#define	TCR	0xD
#define	DCR	0xE
#define	IMR	0xF
#define	RSR	0xC
#define	CNTR0	0xD
#define CNTR1	0xE
#define	CNTR2	0xF

/* 8390 Registers: Page 2						*/
/* NOTE: All addresses are offsets from the command register (cmd_reg)	*/

#define	PAR0	0x1
#define	CURR	0x7
#define MAR0	0x8

/* 8390 Commands							*/

#define	PAGE_0	0x00
#define	PAGE_1	0x40
#define	PAGE_2	0x80
#define	PAGE_3	0xC0

#define	PG_MSK	0x3F			/* Used to zero the page select
					   bits in the command register */

#define	STA	0x2			/* Start 8390			*/
#define STP	0x1			/* Stop 8390			*/
#define	TXP	0x4			/* Transmit Packet		*/
#define	ABR	0x20			/* Value for Remote DMA CMD	*/

/* 8390 ISR conditions							*/

#define	PRX	0x1
#define	PTX	0x2
#define	RXE	0x4
#define	TXE	0x8
#define	OVW	0x10
#define	CNT	0x20
#define RST	0x80

#define ANY_INTR (u_char)(PRX|PTX|RXE|TXE|OVW|CNT)

/* 8390 IMR bit definitions						*/

#define	PRXE	0x1
#define	PTXE	0x2
#define	RXEE	0x4
#define	TXEE	0x8
#define	OVWE	0x10
#define	CNTE	0x20
#define	RDCE	0x40

/* 8390 DCR bit definitions						*/

#define	WTS	0x1
#define	BOS	0x2
#define	LAS	0x4
#define	BMS	0x8
#define	FT0	0x20
#define	FT1	0x40


/* 8390 TCR bit definitions						*/

#define	CRC	0x1
#define	LB0_1	0x2
#define LB0_2	0x4
#define	ATD	0x8
#define	OFST	0x10


/* RCR bit definitions							*/

#define	SEP	0x1
#define	AR	0x2
#define	AB	0x4
#define	AM	0x8
#define	PRO	0x10
#define	MON	0x20

/* TSR bit definitions							*/
#define TSR_COL 0x4
#define TSR_ABT 0x8

/* 8390 Register initialization values					*/

#define	INIT_IMR	PRXE + PTXE + RXEE + TXEE + OVWE + CNTE
#define INIT_DCR	BMS + FT1
#define	INIT_TCR	0
#define	INIT_RCR	AB + AM
#define	RCRMON		MON

/* Misc. Commands & Values						*/

#define	CLR_INT		0xFF		/* Used to clear the ISR */
#define	NO_INT		0		/* no interrupts conditions */
#define ADDR_LEN	6
#define NETPRI		PZERO+3

/* Defines for Adaptor Board ID's for Microchannel */

#define WD_ID	0xABCD			/* generic id for WD test */
#define ETI_ID	0x6FC0			/* 8003et/a ID */
#define STA_ID	0x6FC1			/* 8003st/a ID */
#define WA_ID	0x6FC2			/* 8003w/a ID */
#define WD1_ID  0x61C8			/* 8013e/a */
#define WA1_ID  0x61C9			/* 8013w/a */
#define ENA03E_ID  0xEFE5		/* IBM ENA 03E */
#define ENA13E_ID  0xEFD5		/* IBM ENA 13E */
#define ENA13W_ID  0xEFD4		/* IBM ENA 13W */

/* Tokens identifying board type */
#define	WD8003ETA	(ETHERNET_MEDIA)
#define	WD8003STA	(STARLAN_MEDIA)
#define	WD8003EA	(ETHERNET_MEDIA | INTERFACE_CHIP)
#define	WD8003SHA	(STARLAN_MEDIA | INTERFACE_CHIP)
#define	WD8003WA	(TWISTED_PAIR_MEDIA | INTERFACE_CHIP)
#define WD8013EPA	(ETHERNET_MEDIA | INTERFACE_CHIP | INTERFACE_594_CHIP)
#define WD8013WPA	(TWISTED_PAIR_MEDIA | INTERFACE_CHIP | INTERFACE_594_CHIP)
#define	ENA003WA	(TWISTED_PAIR_MEDIA | INTERFACE_CHIP | VENDOR_IBM)
#define ENA013EPA	(ETHERNET_MEDIA | INTERFACE_CHIP | INTERFACE_594_CHIP | VENDOR_IBM)
#define ENA013WPA	(TWISTED_PAIR_MEDIA | INTERFACE_CHIP | INTERFACE_594_CHIP | VENDOR_IBM)


/* other Microchannel info */
#define STARLAN_MEDIA           0x00000001
#define ETHERNET_MEDIA          0x00000002
#define TWISTED_PAIR_MEDIA      0x00000003
#define	EW_MEDIA		0x00000004	/* Ethernet and Twisted Pair */
#define INTERFACE_CHIP		0x00000010 	/* needs additional setup */
#define VENDOR_WD		0x00000000 	/* vendor flags */
#define VENDOR_IBM		0x00000100
#define MEDIA_MASK		0x00000007

#define IOBASE_594		0x800 		/* I/O base address if 594 chip */
#define	BOARD_16BIT		0x00000040	/* 16 bit capability */
#define	RAM_SIZE_UNKNOWN	0x00000000	/* 000 => Unknown RAM Size */
#define RAM_SIZE_RESERVED_1     0x00010000      /* 001 => Reserved */
#define RAM_SIZE_8K             0x00020000      /* 010 => 8k RAM */
#define RAM_SIZE_16K            0x00030000      /* 011 => 16k RAM */
#define RAM_SIZE_32K            0x00040000      /* 100 => 32k RAM */
#define RAM_SIZE_64K            0x00050000      /* 101 => 64k RAM */
#define	RAM_SIZE_RESERVED_6	0x00060000	/* 110 => Reserved */ 
#define	RAM_SIZE_RESERVED_7	0x00070000	/* 111 => Reserved */ 
#define	SLOT_16BIT		0x00080000	/* 16 bit board - 16 bit slot */
#define	NIC_690_BIT		0x00100000	/* NIC is 690 */
#define	ALTERNATE_IRQ_BIT	0x00200000	/* Alternate IRQ is used */
#define	INTERFACE_594_CHIP	0x00400000	/* Interface chip is a 594 */

#define NUM_ID	4

/* Register offset definitions...since different boards have different names
	for register offsets 0x00-0x07, generic names will be assigned */
#define	BID_REG_0		0x00
#define	BID_REG_1		0x01
#define	BID_REG_2		0x02
#define	BID_REG_3		0x03
#define	BID_REG_4		0x04
#define	BID_REG_5		0x05
#define	BID_REG_6		0x06
#define	BID_REG_7		0x07

/* Register offset definitions...the names for this registers are consistant
	across all boards, so specific names will be assigned */
#define	BID_LAN_ADDR_0		0x08	/* these 6 registers hold the */
#define	BID_LAN_ADDR_1		0x09	/*     LAN address for this node */
#define	BID_LAN_ADDR_2		0x0A
#define	BID_LAN_ADDR_3		0x0B
#define	BID_LAN_ADDR_4		0x0C
#define	BID_LAN_ADDR_5		0x0D
#define	BID_BOARD_ID_BYTE	0x0E	/* identification byte for WD boards */
#define	BID_CHCKSM_BYTE		0x0F	/* the address ROM checksum byte */

/* Register offsets for reading the EEPROM in the 584 chip */
#define	BID_EEPROM_0		0x08
#define	BID_EEPROM_1		0x09
#define	BID_EEPROM_2		0x0A
#define	BID_EEPROM_3		0x0B
#define	BID_EEPROM_4		0x0C
#define	BID_EEPROM_5		0x0D
#define	BID_EEPROM_6		0x0E
#define	BID_EEPROM_7		0x0F

/**** defs for manipulating the 584 ****/
#define	BID_OTHER_BIT			0x02
#define	BID_ICR_MASK			0x0C
#define	BID_EAR_MASK			0x0F
#define	BID_ENGR_PAGE			0xA0
#define	BID_RLA				0x10
#define	BID_EA6				0x80
#define	BID_RECALL_DONE_MASK		0x10
#define	BID_EEPROM_MEDIA_MASK		0x07
#define	BID_STARLAN_TYPE		0x00
#define	BID_ETHERNET_TYPE		0x01
#define	BID_TP_TYPE			0x02
#define	BID_EW_TYPE			0x03
#define	BID_EEPROM_IRQ_MASK		0x18
#define	BID_PRIMARY_IRQ			0x00
#define	BID_ALTERNATE_IRQ_1		0x08
#define	BID_ALTERNATE_IRQ_2		0x10
#define	BID_ALTERNATE_IRQ_3		0x18
#define	BID_EEPROM_RAM_SIZE_MASK	0xE0
#define	BID_EEPROM_RAM_SIZE_RES1	0x00
#define	BID_EEPROM_RAM_SIZE_RES2	0x20
#define	BID_EEPROM_RAM_SIZE_8K		0x40
#define	BID_EEPROM_RAM_SIZE_16K		0x60
#define	BID_EEPROM_RAM_SIZE_32K		0x80
#define	BID_EEPROM_RAM_SIZE_64K		0xA0
#define	BID_EEPROM_RAM_SIZE_RES3	0xC0
#define	BID_EEPROM_RAM_SIZE_RES4	0xE0
#define	BID_EEPROM_BUS_TYPE_MASK	0x07
#define	BID_EEPROM_BUS_TYPE_AT		0x00
#define	BID_EEPROM_BUS_TYPE_MCA		0x01
#define	BID_EEPROM_BUS_TYPE_EISA	0x02
#define	BID_EEPROM_BUS_SIZE_MASK	0x18
#define	BID_EEPROM_BUS_SIZE_8BIT	0x00
#define	BID_EEPROM_BUS_SIZE_16BIT	0x08
#define	BID_EEPROM_BUS_SIZE_32BIT	0x10
#define	BID_EEPROM_BUS_SIZE_64BIT	0x18

/**** Masks bits for the board revision number in the BID_BOARD_ID_BYTE ****/
#define	BID_BOARD_REV_MASK	0x1E

/*** Misc. definitions ***/
#define	BID_MSZ_583_BIT		0x08	/* memory size bit in 583 */
#define BID_SIXTEEN_BIT_BIT	0x01	/* bit has 16 bit capability info */

/*** Defs for board rev numbers greater than 1 ***/
#define	BID_MEDIA_TYPE_BIT	0x01
#define	BID_SOFT_CONFIG_BIT	0x20
#define	BID_RAM_SIZE_BIT	0x40

/**** defs for identifying the 690 ****/
#define BID_CR		0x10		/* Command Register	*/
#define BID_TXP		0x04		/* transmit packet */
#define	BID_TCR		0x1D		/* Transmit Configuration Register */
#define	BID_TCR_VAL	0x18		/* test value for 690 or 8390 */
#define	BID_PS0		0x00		/* register page select - 0 */
#define BID_PS1		0x40		/* register page select - 1 */
#define	BID_PS2		0x80		/* register page select - 2 */
#define	BID_PS_MASK	0x3F		/* to mask off page select bits */

#define PS2_RAMSZ8	 8192
#define PS2_RAMSZ16	16384
#define PS2_RAMSZ64	65536

typedef union {
   struct ether_header  ether;
   struct eth_mac_header llc;
} wd_machdr_t;

#define mac_dst ether.eth_dhost
#define mac_src ether.eth_shost

typedef struct rcv_buf {
	unsigned char	status;
	unsigned char	nxtpg;
	short		datalen;
	wd_machdr_t     pkthdr;
} rcv_buf_t;

#define ETHERNETMTU 1500	/* ETHERMTU assumes SNAP */
#define MACHDRSIZE  sizeof(struct eth_mac_header)

#define SRC_ALIGN        0
#define DST_ALIGN       1
#define LLC_RESPONSE	0x1
#define LLC_XID_FMTID	0x81
#define LLC_SERVICES	0x01	/* Services supported */

#define LLC_LENGTH(h) ntohs((h)->ether.eth_type)
struct wdsoftc {
   struct arpcom wd_ac;		/* ARP table for this device */
#define wd_if	wd_ac.ac_if
#define wd_physaddr wd_ac.ac_lanaddr
   unsigned int wd_vec;		/* IRQ level */
   unsigned int wd_ioport;	/* I/O port */
   unsigned int wd_memsize;	/* size of memory segment */
   caddr_t	wd_base;	/* base address (not virtual) */
   caddr_t      wd_mp;		/* mapped address of memory segment */
   unsigned long wd_type;	/* derived hardware feature type */
   unsigned short wd_id;	/* board adaptor ID */
   unsigned short wd_rev;	/* board revision */
   struct callout *wd_watchdog; /* watchdog callout pointer */
   unsigned short wd_bufflen[2];/* length of transmit data in buffer */
   unsigned char wd_buffers;	/* number of transmit buffers */
   unsigned char wd_buffavail;	/* buffers available */
   unsigned char wd_buffinuse;	/* transmit buffers in use (mask) */
   unsigned char wd_xmitbusy;	/* tranmitter is busy */
   unsigned char wd_lastbuff;	/* last buffer used */
   unsigned char wd_nxtpkt;	/* next packet in the receive ring */
};
ROkêPU Ã  $        õ  ]‰*8–ˆ*]‰*     Aõ  	              £¶  ./usr/include/sys/if_ieee802.h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include	<sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)if_ieee802.h	16.7	AIX)	/* Modified: 8/14/90 15:56:42 */

#if ! defined(_IF_IEEE802)
#define  _IF_IEEE802
/*
 * Copyright (c) 1982, 1986 Regents of the University of California.
 * All rights reserved.  The Berkeley software License Agreement
 * specifies the terms and conditions for redistribution.
 *
 *	@(#)if_ieeee802.h	7.1 (Berkeley) 6/5/86
 */

/*
 * LAN address - 6 octets
 */
#define LAN_ADDR_SIZE 6
#define ETH_ADDR_SIZE LAN_ADDR_SIZE
struct lan_addr {
	u_char lan_addr_octet[LAN_ADDR_SIZE];
};

/*
 * Structure of a ethernet MAC header
 */
struct eth_mac_header {
	u_char eth_dhost[LAN_ADDR_SIZE];
	u_char eth_shost[LAN_ADDR_SIZE];
	u_short eth_len;
};

/*
 * Structure of a 802 LLC header
 */
struct lan_llc_header {
	u_char llc_dsap;
	u_char llc_ssap;
	u_char llc_ctrl;
};

/*
 * Structure of a 802 SNAP header
 */
struct lan_snap_header {
	u_char snap_prot_id[3];
	u_char snap_type[sizeof(u_short)];
};

struct eth_802_header {
	struct eth_mac_header eth_mac;
	struct lan_llc_header eth_llc;
	struct lan_snap_header eth_snap;
};

/*
 * Structure of a Xerox ethernet header.
 */
struct ether_header {
	u_char eth_dhost[LAN_ADDR_SIZE];
	u_char eth_shost[LAN_ADDR_SIZE];
	u_short	eth_type;
};


/*
 * Token ring MAC header
 */
struct ie5_mac_hdr {
	u_char	mac_acf;	/* access control field		*/
	u_char	mac_fcf;	/* frame control field		*/
	u_char	mac_dst[6];	/* destination address		*/
	u_char	mac_src[6];	/* source address		*/
	u_char	mac_rcf[2];	/* routing control field	*/
	u_short	mac_seg[8];	/* up to 8 segment numbers	*/
};

#define	ACF_PRIORITY0		0x00	/* priority level 0		*/
#define	ACF_PRIORITY3		0x60	/* priority level 3		*/
#define	ACF_TOKEN		0x10	/* token			*/
#define	FCF_LLC_FRAME		0x40	/* for frame control field	*/

#define	RCF_BROADCAST_MASK	0xe0	/* 3 bits of broadcast field	*/
#define	RCF_ALL_BROADCAST	0x80	/* all routes broadcast		*/
#define	RCF_LOCAL_BROADCAST	0x40	/* single route broadcast	*/
#define	RCF_LENGTH_MASK		0x1f	/* 5 bits of routing length	*/
#define	RCF_DIRECTION		0x80	/* direction			*/
#define	RCF_FRAME0		0x00	/*  516 max LLC pkt		*/
#define	RCF_FRAME1		0x10	/* 1500 max LLC pkt		*/
#define	RCF_FRAME2		0x20	/* 2052 max LLC pkt		*/
#define	RCF_FRAME3		0x30	/* 4472 max LLC pkt		*/
#define	RCF_FRAME4		0x40	/* 8191 max LLC pkt		*/
#define	RCF_FRAME_MASK		0x70	/* mask for frame bits		*/

#define	RI_PRESENT		0x80	/* routing information present	*/

#define	route_bytes(mac)	((mac)->mac_rcf[0] & RCF_LENGTH_MASK)
#define	has_route(mac)		((mac)->mac_src[0] & RI_PRESENT)
#define	largest_frame(mac)	((mac)->mac_rcf[1] & RCF_FRAME_MASK)
#define	is_broadcast(mac)	(has_route(mac)		\
				 && ((mac)->mac_rcf[1] & (RCF_LOCAL_BROADCAST \
							| RCF_ALL_BROADCAST)))

/*
 * mac_to_llc	-	given the ^ to the MAC, get to the LLC
 */
#define mac_to_llc(mac)	\
	(struct ie2_llc_hdr *) (((char *) (mac)) + mac_size(mac))

#define	mac_size(mac)		\
	(14 + (has_route(mac) ? route_bytes(mac) : 0))

/*
 * Token ring LLC header
 */
struct ie2_llc_hdr {
	unsigned char	dsap;		/* DSAP				*/
	unsigned char	ssap;		/* SSAP				*/
	unsigned char	ctrl;		/* control field		*/
	unsigned char	prot_id[3];	/* protocol id			*/
	unsigned short	type;		/* type field			*/
};

#define	LANTYPE_IP	0x0800		/* IP protocol */
#define LANTYPE_ARP	0x0806		/* Addr. resolution protocol */

/*
 * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
 * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
 * by an ETHER type (as given above) and then the (variable-length) header.
 */
#define	ETHERTYPE_TRAIL		0x1000		/* Trailer packet */
#define	ETHERTYPE_NTRAILER	16

#define NO_SNAP		0x0		/* No SNAP type */

#define	ETHERMTU	1492		/* 1500 - llc header - snap header */
#define	ETHERMIN	60
#define ETH_FCSSIZ	4		/* Frame CRC size */

#define TOKEN_MTU	1992		/* 2018 - llc hdr - snap hdr
						- route info (18 bytes) */

#define SNAP_SAP	0xaa
#define UI_CONTROL	3
#define XID_CONTROL	0xaf
#define TEST_CONTROL	0xe3

#define CTRL_P_OR_F	0x10

/*
 * Address Resolution Protocol.
 *
 * See RFC 826 for protocol description.  Structure below is adapted
 * to resolving internet addresses.  Field names used correspond to 
 * RFC 826.
 */
struct lan_arp {
	struct arphdr la_hdr;	/* fixed-size header */
	u_char arp_sha[LAN_ADDR_SIZE];	/* sender hardware address */
	u_char arp_spa[4];	/* sender protocol address */
	u_char arp_tha[LAN_ADDR_SIZE];	/* target hardware address */
	u_char arp_tpa[4];	/* target protocol address */
};
#define	arp_hrd	la_hdr.ar_hrd
#define	arp_pro	la_hdr.ar_pro
#define	arp_hln	la_hdr.ar_hln
#define	arp_pln	la_hdr.ar_pln
#define	arp_op	la_hdr.ar_op


/*
 * Structure shared between the ethernet driver modules and
 * the address resolution code.
 */
struct arpcom {
	struct ifnet ac_if;			/* network-visible interface */
	u_char ac_lanaddr[LAN_ADDR_SIZE];	/* LAN hardware address */
	struct in_addr ac_ipaddr;		/* copy of ip address */
};

/*
 * Internet to lan address resolution table.
 */
struct arptab {
	struct in_addr at_iaddr;	/* internet address */
	u_char at_lanaddr[LAN_ADDR_SIZE];	/* LAN address */
	u_char at_timer;		/* minutes since last reference */
	u_char at_flags;		/* flags */
	struct mbuf *at_hold;		/* last packet until resolved/timeout */
};

/*
 * Internet to token ring address resolution table.
 */
struct	ie5_arptab {
	struct	in_addr at_iaddr;	/* internet address */
	u_char	at_traddr[6];		/* token ring address */
	u_char	at_timer;		/* minutes since last reference */
	u_char	at_flags;		/* flags */
	u_char	at_rcf[2];		/* route control field		*/
	u_short	at_seg[8];		/* routing info			*/
	struct	mbuf *at_hold;		/* last packet until resolved/timeout */
	u_long	at_inserted;		/* "bootticks" when entry created */
};

/*
 * token ring RAW socket addresses
 */
struct sockaddr_802_5 {
	ushort			sa_family;	/* address family: AF_802_2 */
	struct ie5_mac_hdr	sa_mac;		/* MAC portion		    */
	struct ie2_llc_hdr	sa_llc;		/* LLC portion		    */
};

#ifdef	KERNEL
extern u_char lanbroadcastaddr[];
struct arptab *arptnew();
struct	ie5_arptab *ie5_arptnew();
char *lan_sprintf();
extern int ether_xerox;
#endif

#ifndef SIOCSARP_802_5
#define	SIOCSARP_802_5	_IOW(i, 93, struct ie5_arpreq)	/* set arp entry */
#define	SIOCGARP_802_5	_IOWR(i,94, struct ie5_arpreq)	/* get arp entry */
#define	SIOCDARP_802_5	_IOW(i, 95, struct ie5_arpreq)	/* delete arp entry */
#endif

#endif ! defined(_IF_IEEE802)
 LLkêÞÉ Á  ÿ¡             ]‰*]‰*]‰*          	                  ./usr/include/sys/in.h e../netinet/in.h kêôO ¿  ÿ¡             ]‰*]‰*]‰*          	                  ./usr/include/sys/in_pcb.h 2.h h../netinet/in_pcb.h _pcbkêÎ ½  ÿ¡             ]‰*]‰*]‰*          	                  ./usr/include/sys/in_systm.h h h../netinet/in_systm.h yskê) »  ÿ¡             ^‰*^‰*^‰*          	                  ./usr/include/sys/in_var.h h h h../netinet/in_var.h _varkê" q  $        9  =‰*d™ˆ*=‰*     xg9  	              ðl  ./usr/include/sys/inline.h h h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)inline.h	16.10	LCC)	/* Modified: 11:35:40 9/9/90 */

#ifndef _h_INLINE
#define _h_INLINE

/* 
 * Definitions of inlines, and macro replacements
 * for them if UNFAST (latter only scantily tested).
 */

#if	defined(NOLOCKCNT) || defined(NOCHECKS)
#define	lockinc(ip)
#define lockdec(ip)
#else   /* !(defined(NOLOCKCNT) || defined(NOCHECKS)) */
#define	lockinc(ip)	lockInc()
#define lockdec(ip)	lockDec()
#endif	/* !(defined(NOLOCKCNT) || defined(NOCHECKS)) */

#if	defined(NOCHECKS)
#define	_B_CHAIN_CHECK(bp)	/**/
#else	/* !defined(NOCHECKS) */
#define _B_CHAIN_CHECK(bp)	\
	if ((bp)->av_back->av_forw != (bp) || (bp)->av_forw->av_back != (bp)) \
		panic("Notavail: bad chain", (bp)); else
#endif	/* !defined(NOCHECKS) */

/* Notavailbody assumes that it is called at spl6() */
#define	Notavailbody(bp, lockflag) \
{ \
	_B_CHAIN_CHECK(bp); \
	(bp)->av_back->av_forw = (bp)->av_forw; \
	(bp)->av_forw->av_back = (bp)->av_back; \
	(bp)->av_forw = NULL; \
	if ( !( ((bp)->b_flags |= (lockflag)) & B_LOCKED) ) { \
		if ((bp)->b_flags & B_DELWRI) \
			freebufs.delwri--; \
		freebufs.total--; \
	} \
	(bp)->b_refcnt = 1; \
}

/* Change a buffer from being exclusively locked to being share locked.
 * N.B. the share bit is turned on before the exclusive bit is turned
 * off so that there's no window during which the buffer looks non-busy.
 * If we're at spl6 or higher the order the bits are flipped doesn't
 * matter.
 */
#define bxrelebody(bp)	\
	( (bp)->b_flags & B_DOWNGRADE \
	? ((bp)->b_flags |= B_SLOCK, (bp)->b_flags &= ~(B_XLOCK|B_DOWNGRADE)) \
	: 0 )

/*
 *  Inline code used to acquire and lock a file block token and an inode token.
 */
#define token_lock_body(fp) \
	(ft_lock(fp) && it_lock(fp->f_inode, (fp->f_flag & FWRITE)))

#define ft_lock(fp) \
	((fp->f_tcbdes == NULLTCB 	\
		     || (fp->f_flag&(FPRESENT|FTOKWNT)) == FPRESENT) \
	? ++fp->f_tlckcnt : acq_token(fp))

#define it_lock(ip, mod) \
	    ((((ip->i_flag&(IPRESENT|ITOKWNT)) == IMPRESENT) \
	    || (!mod && ((ip->i_flag&(IPRESENT|ITOKWNT)) == IRPRESENT))) \
	    ? ++ip->i_tlckcnt : iacq_token(ip, mod))

/*
 *  Inline code used to acquire and lock a file block token.
 */
#define ftk_lock_body(fp)						\
{	if (fp->f_tcbdes == NULLTCB ||					\
		(fp->f_flag&(FPRESENT|FTOKWNT)) == FPRESENT) {		\
		fp->f_tlckcnt++;					\
	} else acq_token(fp); /* get and lock file token */		\
}

/*
 *  Inline code used to acquire and lock an inode token.
 */
#define itk_lock_body(ip, mod)						\
{	if (((ip->i_flag&(IPRESENT|ITOKWNT)) == IMPRESENT) ||		\
	   (!mod && ((ip->i_flag&(IPRESENT|ITOKWNT)) == IRPRESENT))) {	\
		ip->i_tlckcnt++;					\
	} else iacq_token(ip,mod);	/* get and lock inode token */	\
}

/*
 *  Inline code used to unlock a file block token and an inode token.
 */
#define token_unlock_body(fp)						\
{	itk_unlock( (fp->f_inode) );					\
	ftk_unlock(fp);							\
}

/*
 *  Inline code used to unlock a file block token.
 */
#define ftk_unlock_body(fp)						\
{	if ( (--fp->f_tlckcnt == 0) && (fp->f_tcbdes != NULLTCB) &&	\
		(fp->f_flag&FTOKWNT)) {					\
		if (fp->f_wnttok > 0)					\
			wakeup((caddr_t)&(fp->f_wnttok));		\
		else							\
			prep_reltok(fp);				\
	}								\
}

/*
 *  Inline code used to unlock an inode token.
 */
#if ! defined(NOCHECKS)
#define itk_unlock_body(ip)						\
{	if (ip->i_tlckcnt == 0)						\
		panic("itk_unlock");					\
	if ( (--ip->i_tlckcnt == 0) && (ip->i_flag&ITOKWNT)) {		\
		if (ip->i_wnttok > 0)					\
			wakeup((caddr_t)&(ip->i_wnttok));		\
		else							\
			iprep_reltok(ip);				\
	}								\
}
#else /* defined(NOCHECKS) */
#define itk_unlock_body(ip)						\
{									\
	if ((--ip->i_tlckcnt == 0) && (ip->i_flag & ITOKWNT)) {		\
		if (ip->i_wnttok > 0)					\
			wakeup((caddr_t) &(ip->i_wnttok));		\
		else							\
			iprep_reltok(ip);				\
	}								\
}
#endif /* defined(NOCHECKS) */

#ifndef UNFAST
#ifndef CODE_COVERAGE
#define  geterror(bp)				\
{ if (bp->b_flags&B_ERROR)			\
	if ((u.u_error = bp->b_error)==0)	\
		u.u_error = EIO;		\
}
#endif /* ~CODE_COVERAGE */

/* Note: this trick only works if buffers are not mapped */
#define	 clrbuf(bp)				\
{	bzero( (bp)->b_un.b_addr, BSIZE );	\
	(bp)->b_resid = 0;			\
}

#define  token_lock(fp)		token_lock_body( (fp) )
#ifndef CODE_COVERAGE	/* Macros which contain if|for|while. */
#define  ftk_lock(fp)		ftk_lock_body( (fp) )
#define  itk_lock(ip, mod)	itk_lock_body( (ip), (mod) )
#endif /* ~CODE_COVERAGE */

#define  token_unlock(fp)	token_unlock_body( (fp) )
#ifndef CODE_COVERAGE	/* Macros which contain if|for|while. */
#define  ftk_unlock(fp)		ftk_unlock_body( (fp) )
#define  itk_unlock(ip)		itk_unlock_body( (ip) )
#endif /* ~CODE_COVERAGE */

#define	GETF(fp, fd) \
	if ((unsigned)(fd) >= NOFILE || ((fp) = u.u_ofile[fd]) == NULL) { \
		u.u_error = EBADF; \
		return; \
	} else

#define	ISSIG(p) (((p)->p_sig.sigs[0] || (p)->p_sig.sigs[1]) \
		 && ((p)->p_flag&STRC \
		    || ((p)->p_sig.sigs[0] & (~((p)->p_sigignore.sigs[0] | (p)->p_sigmask.sigs[0]) | sigmask(SIGCHLD))) \
		    || ((p)->p_sig.sigs[1] & ~((p)->p_sigignore.sigs[1] | (p)->p_sigmask.sigs[1]))) \
		 && issig())

#define Notavail(bp, lockflag)		Notavailbody( (bp), (lockflag) )

#define bxrele(bp)		bxrelebody(bp)

#else  /* UNFAST */

#define	GETF(fp, fd)  \
	if ( ((fp) = getf(fd)) == NULL) { \
		return; \
	} else

#define	ISSIG(p)	issig(p)

#endif	/* UNFAST */

#define notavail(bp)		Notavail( (bp), B_XLOCK )

#endif  /* ~_h_INLINE */
he buffkêØ p  $           >‰*b™ˆ*>‰*     0Ÿ   	              Ý±  ./usr/include/sys/ino.h /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)ino.h	16.5	LCC)	/* Modified: 18:16:29 9/22/89 */

#ifndef	_h_INO
#define	_h_INO

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _h_TYPES */

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif  /* _h_PARAM */

/*
 * Inode structure as it appears on
 * a disk block.
 */

/*
   NOTE!: Any changes to the disk inode structure will require
   corresponding changes to made in flpdinode(dev/network.c)
   or heterogeneous network operation will cease to work!!
*/
/*
   NOTE!: The fields that get sent across the net should grow
   from the top down.  The fields not sent across the net
   should grow from the bottom up.  (greg t.).
**/

#define NADDR	13
#define NDADDR	(NADDR-3) /* number of direct block pointers */

struct dinode
{
	struct  DINODE
	{
		unsigned short	DI_mode;     	/* mode and type of file */
		nlink_t	DI_nlink;    	/* number of links to file */
		short	DI_uid;      	/* owner's user id */
		short	DI_gid;      	/* owner's group id */
		ino_uniqid_t DI_uniqid;	/* unique identifier */
		short	DI_filler;	/* filler */
		dflag_t	DI_dflag;	/* disk flags */
		off_t	DI_size;     	/* number of bytes in file */
		time_t	DI_mtime;   	/* time last modified */
		time_t	DI_atime;   	/* time last accessed */
		time_t	DI_ctime;   	/* time changed */
		commitcnt_t DI_cmtcnt;	/* gfs commit seq number */
		fstore_t DI_fstore;	/* file propogation attributes */
		long	DI_version;	/* version number of this copy of the
						data; */
		daddr_t  DI_blocks;	/* actual number of blocks used */
	} DI_DINO;
#	define di_mode		DI_DINO.DI_mode
#	define di_nlink		DI_DINO.DI_nlink
#	define di_uid		DI_DINO.DI_uid
#	define di_gid		DI_DINO.DI_gid
#	define di_uniqid	DI_DINO.DI_uniqid
#	define di_dflag		DI_DINO.DI_dflag
#	define di_size		DI_DINO.DI_size
#	define di_mtime		DI_DINO.DI_mtime
#	define di_atime		DI_DINO.DI_atime
#	define di_ctime		DI_DINO.DI_ctime
#	define di_cmtcnt	DI_DINO.DI_cmtcnt
#	define di_fstore	DI_DINO.DI_fstore
#	define di_version	DI_DINO.DI_version
#	define di_blocks	DI_DINO.DI_blocks

#ifdef SMALLBLOCKS
	char	di_pad[27];
	char	di_sbflag;		/* flags for small blocks */
					/* see inode.h for bit definitions */
#else /* ~SMALLBLOCKS */
	char	di_pad[28];		/* space for future growth */
#endif /* ~SMALLBLOCKS */

	daddr_t  	di_addr[NADDR];	/* disk block addresses */

#ifdef SMALLBLOCKS
#define SMBLKSZ 384	/* bytes available in the inode for data */
#define SBASIZE SMBLKSZ	/* used by applications for ifdefing	*/
	char	di_sbbuf[SMBLKSZ];	/* small block buffer */
#endif /* SMALLBLOCKS */
};

#ifdef SMALLBLOCKS
/*
 * flag bits used in i_sbflag in the inode (and di_sbflag in the disk inode)
 */
#define SBINUSE		0x1	/* the small byte is in use in the disk inode */
#define SBAUSE		SBINUSE /* Backward compatibility */
#endif /* SMALLBLOCKS */

/* flags in di_dflag and i_dflag */
#define DIDEL      0x1	/* file has been deleted */
#define DISTORE    0x2	/* file is stored localled */
#define DIALLOC    0x10	/* inode has been allocated to a file */
#define DIHIDDEN   0x20	/* this is a hidden directory */
#define DILONGDIR  0x40	/* this is a BSD 4.3 format, long directory */
#define DILINK     0x80 /* this file is a symbolic link */
#define	DIFORCE	   0x100/* DISTORE is forced to retain current value */
#define DIXIPC     0x200/* File is used for x286 IPC support */
#define	DIPERSS	(DISTORE|DIFORCE)	/* flags local to an SS */
#define DIMOUNTEDON 0x400 /* File is mounted on. Used by dstat & dirstat */
#define DISOCKET   0x800 /* flags a socket when set */

/* flags in di_mode and i_mode */
#define	IFMT	0xf000		/* type of file */
#define		IFIFO	0x1000	/* fifo special */
#define		IFCHR	0x2000	/* character special */
#define		IFMPC	0x3000	/* character multiplex file */
#define		IFDIR	0x4000	/* directory */
#define		IFBLK	0x6000	/* block special */
#define		IFMPB	0x7000	/* block multiplex file */
#define		IFREG	0x8000	/* regular */

/*	in BSD4.3, IFSOCK is 0x1000 and pipes are sockets	*/
/*	making them IFIFO plus a di_flag==DISOCKET seems	*/
/*	the best compromise if we also have pipes		*/
#define	IFSOCK	IFIFO		/* inode is bound to socket */
#define	ISUID	04000		/* set user id on execution */
#define	ISGID	02000		/* set group id on execution */
#define	ISVTX	01000		/* save swapped text even after use */
#define	IREAD	00400		/* read, write, execute permissions */
#define	IWRITE	00200
#define	IEXEC	00100
#define IENFMT	ISGID		/* enforcement mode locks (lockf) */
#define	IGDEV	ISGID		/* generic devices (in-core inodes only) */

#ifndef  NOCHECKS
#ifdef  SMALLBLOCKS
	struct xCDS { char _ChkDinoSiz_[sizeof(struct dinode)==512 ? 1 : -1];};
#else  /* ~SMALLBLOCKS */
	struct xCDS { char _ChkDinoSiz_[sizeof(struct dinode)==128 ? 1 : -1];};
#endif /* ~SMALLBLOCKS */

/* Make sure the disk inode size evenly divides into BSIZE */
struct xDCK
{
	char _Dino_ck[ (BSIZE % sizeof(struct dinode)) == 0 ];
};
#endif /* ~NOCHECKS */

/* Number of inodes in a block */
#define	INOPB	( BSIZE / sizeof(struct dinode) )
#endif	/* ~_h_INO */
kê<Ü o  $        6a  >‰*e™ˆ*>‰*     ¡6a  	              ¡  ./usr/include/sys/inode.h  h h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */


#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)inode.h	16.20	LCC)	/* Modified: 09:55:58 11/1/91 */

#ifndef	_h_INODE
#define	_h_INODE

#ifndef _h_TYPES
#ifdef KERNEL
#include <types.h>
#else /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* _h_TYPES */

#ifndef _h_INO
#ifdef KERNEL
#include <ino.h>
#else /* ~KERNEL */
#include <sys/ino.h>
#endif /* ~KERNEL */
#endif /* _h_INO */

#ifdef NFS
#ifndef __TYPES_RPC_HEADER__
#ifdef KERNEL
#include <rpctypes.h>
#else /* ~KERNEL */
#include <rpc/rpctypes.h>
#endif /* ~KERNEL */
#endif /* __TYPES_RPC_HEADER__ */

#ifndef __NFS_HEADER__
#ifdef KERNEL
#include <nfs.h>
#else /* ~KERNEL */
#include <rpc/nfs.h>
#endif /* ~KERNEL */
#endif /* __NFS_HEADER__ */

#ifndef __RNODE_HEADER__
#ifdef KERNEL
#include <rnode.h>
#else /* ~KERNEL */
#include <rpc/rnode.h>
#endif /* ~KERNEL */
#endif /* __RNODE_HEADER__ */
#endif /* NFS */

/*
 * The I node is the focus of all
 * file activity in unix. There is a unique
 * inode allocated for each active file,
 * each current directory, each mounted-on
 * file, text file, and the root. An inode is 'named'
 * by its gfs/inumber pair. 
 */

	/* Pipesize defines */
#define	PIPSIZ	((NADDR-3)*BSIZE)
#define	PIPLWM	PIPSIZ
#define	PIPHWM	(2*PIPLWM)

#define FILETYPE(mode) ((mode)&IFMT)
#define ISDEVMODE(mode) (FILETYPE(mode)==IFCHR || FILETYPE(mode)==IFBLK)

#define ISREG(ip)	(FILETYPE((ip)->i_mode) == IFREG)
#define ISDIR(ip)	(FILETYPE((ip)->i_mode) == IFDIR)
#define ISCHR(ip)	(FILETYPE((ip)->i_mode) == IFCHR)
#define ISFIFO(ip)	(FILETYPE((ip)->i_mode) == IFIFO)
#define ISDEVICE(ip)	ISDEVMODE((ip)->i_mode)

#define PIPDIFF(ip)	((ip)->i_size - (((ip)->i_lastfreed+1)<<BSHIFT))
#define INPAGE(blk,ptr) (((ptr)>>BSHIFT) == (blk) && ((ptr)&BMASK) != 0)
#define NULLFOFFS ((off_t)-1L)

#define CHGCTIME(ip)    (ip)->i_ctime = gettod(), (ip)->i_flag |= ICHG
#define CHGMTIME(ip)    (ip)->i_ctime = (ip)->i_mtime = gettod(), \
			(ip)->i_flag |= (ICHG|IUPD)

#define VALIDGFS(gfs)	validgfs(gfs)
#define BITMAPSIZE 32
#define MAX_VER_VALUE	0x7ffffffeL	/* max legal value of version entry */

struct rlock				/* Format of a record lock structure */
{	struct	rlock	*rl_next;	/* ... ptr to next lock for Inode */
	struct	proc	*rl_proc;	/* ... ptr to controlling process, if
						local, otherwise == 0 */
		off_t	rl_lob;		/* ... low bound of record  */
		off_t	rl_hib;		/* ... hi bound of record */
		pid_t	rl_pid;		/* ... pid holding lock */
		long	rl_key;		/* ... key on the lock - pid or other */
		int	rl_waitct;	/* ... number of waiting proces */
		siteno_t rl_site;	/* ... site where process is running */
		short	rl_mode;	/* ... type of lock - type of key */
};

#define NCACHE 32		/* number of cache entries */
#define CACHEMASK 0x1f		/* mask to avoid divides */

union pcache {
	union pcache *pc_next;
	struct pc_ent {
		daddr_t	pc_lbn;
		daddr_t	pc_pbn;
	} pc_ent[NCACHE];
};

extern union pcache pcache[];


struct	inode
{
	struct inode	*i_lrunext;	/* forward ptr. for lru list */
	struct inode	*i_lruprev;	/* back ptr. for lru list */
	struct inode	*i_ilink;	/* pointer to sister inode where one
				         * is used for update propagation */
	dev_t		i_dev;		/* device where inode resides */
	gfs_t		i_gfs;		/* global filesystem number */
	ino_t		i_number;	/* inode number within GFS */
#define i_num		i_number
	iflag_t		i_flag;		/* ILOCK, etc. see below */

	struct userQuota *i_quota;	/* points to quota info, if enabled */
	struct rlock	 *i_rlock;	/* head of record lock list */
	union  pcache	 *i_cache;	/* fifo bmap cache buffer */

	sitemap_t	i_cssmap;	/* bit map used at css; set for
				    	 * each ss with file open */
	sitemap_t	i_ssmap;	/* bit map used at ss; set for
				    	 * each us using this ss; */
	sitemap_t	i_modmap;	/* us's where mod is ongoing */
	sitemap_t	i_uscache;	/* us's with valid cache's */

	gfs_t		i_mntgfs;	/* the gfs number of the filesystem
				 	 * mounted on this inode. */
	ino_t		i_pdnumber;	/* dcommit, parent directory i-number */
	long		i_pdversion;	/* dcommit, parent's version number */
	ino_uniqid_t	i_pduniqid;	/* dcommit, parent's unique id */

	struct tok_ctrlb *i_itcblnk; /* inode token TCB (ss) */
	daddr_t		i_lastr;	/* last read (for read-ahead) */
	pid_t		i_pidlock;	/* pid holding inode locked */
	int		i_retaddr;	/* calling address of inode locker */
	commitcnt_t	i_scmtcnt;	/* O_REPLSYNC current commit count */
	long		i_sparel;	/* (reserved for future expansion) */

	short		i_arefcnt;	/* number of pointers to the file;
				   	 * equal to i_orefcnt + CSS opens
				         * + SS opens + cwd + mounted pointers
				    	 * + rootdir + record locks
					 * + transient accesses */
	short		i_orefcnt;	/* number of US opens for Read,
					 * NLR and Mod */
	short		i_usrdcnt;	/* us count of number of local Reads */
	short		i_usmodcnt;	/* us count of the number of local
					 * Mods */
	siteno_t	i_ss;		/* used at us to tell where ss is */
	islot_t  	i_ssislot;	/* inode slot number at the ss */

	short		i_dlyflag;	/* delayed commit flags */
	short		i_hlink;        /* hash chain link (iget/iput/ifind) */
	unsigned short	i_acount;	/* outstanding async writes */
	short		i_spares;	/* (reserved for future expansion) */

	u_char		i_tlckcnt;	/* inode token lock count */
	u_char		i_wnttok;	/* inode token want semaphore */
	char		i_replflgs;	/* flags for serializing writes in
					 * an OREPLSYNC file; used ILOCK and
					 * IWANT bits */
	char		i_sparec;	/* (reserved for future expansion) */

	struct  DINODE  I_DINO;

#define  i_mode	  I_DINO.DI_mode
#define  i_nlink  I_DINO.DI_nlink	/* directory entries */
#define  i_uid	  I_DINO.DI_uid		/* owner */
#define  i_gid	  I_DINO.DI_gid		/* group of owner */
#define  i_dflag  I_DINO.DI_dflag	/* disk flags; see ino.h */
#define  i_size   I_DINO.DI_size	/* size of file */
#define  i_mtime  I_DINO.DI_mtime	/* last modification time */
#define  i_atime  I_DINO.DI_atime	/* access time */
#define  i_ctime  I_DINO.DI_ctime	/* creation time */
#define  i_uniqid I_DINO.DI_uniqid	/* unique identifier */
#define  i_cmtcnt I_DINO.DI_cmtcnt	/* gfs commit seq number */
#define  i_fstore I_DINO.DI_fstore	/* file propogation attributes */
#define  i_version I_DINO.DI_version	/* file version number */
#define  i_blocks I_DINO.DI_blocks	/* actual number of blocks used */

	union IADDR_UN {

		struct i_f_tag {
			daddr_t     I_addr[NADDR];	/* file or directory */
		} i_f;
#define	i_addr		i_un.i_f.I_addr

		struct i_ff_tag {  /* fifo */
		       	daddr_t     I_paddr[NADDR];
		       	struct tok_ctrlb *I_fmtcblnk; /* mod TCB chain 
		        				       * (ss only) */
		       	struct tok_ctrlb *I_frtcblnk; /* read TCB chain
		       				       * (ss only) */
			struct file *I_file; 	/* backlink to fp */
		       	off_t	I_fxread;	/* data expected
		       				 * to be read */
		       	off_t	I_fxwrite;	/* data known to have
		       				 * been written, though
		       				 * not necessarily at
		       				 * this site yet. */
		       	daddr_t	I_lastfreed;	/* last freed page */
		       	short	I_fflag;	/* status bits */
		       	struct proc *I_xproc;   /* proc except select */
		       	struct proc *I_rproc;	/* proc read select */
		       	struct proc *I_wproc;	/* proc write select  */
		       	pid_t	I_rpgrp;	/* read proc group */
		       	pid_t	I_wpgrp;	/* write proc group */
		} i_fifo;
#define i_fmtcblnk	i_un.i_fifo.I_fmtcblnk
#define i_ftcblnk	i_un.i_fifo.I_fmtcblnk	/* compatibility */
#define i_frtcblnk	i_un.i_fifo.I_frtcblnk
#define i_file		i_un.i_fifo.I_file
#define	i_fflag		i_un.i_fifo.I_fflag
#define	i_frptr		i_un.i_fifo.I_frptr
#define	i_fxread	i_un.i_fifo.I_fxread
#define	i_fxwrite	i_un.i_fifo.I_fxwrite
#define	i_lastfreed	i_un.i_fifo.I_lastfreed
#define i_xproc		i_un.i_fifo.I_xproc
#define i_rproc		i_un.i_fifo.I_rproc
#define i_wproc		i_un.i_fifo.I_wproc
#define i_rpgrp		i_un.i_fifo.I_rpgrp
#define i_wpgrp		i_un.i_fifo.I_wpgrp

		struct socket *I_socket; /* pointer to socket if bind done */
#define i_socket   	i_un.I_socket

		struct {
			dev_t		I_rdev;		/* i_addr[0] */
			daddr_t		I_rdevsite;	/* i_addr[1] */
			off_t		I_mpxchan;	/* i_addr[2] */
		} i_d;
#define	i_rdev		i_d.I_rdev
#define i_rdevsite 	i_d.I_rdevsite
#define	i_mpxchan	i_d.I_mpxchan

#ifdef X286PROCS 
#define I_OVRLYSIZ  48					/* overlay for 286 */
		char i_286ovrly[I_OVRLYSIZ];		/* process support */
#endif	/* X286PROCS */

#ifdef NFS
		struct {
			fhandle_t	Ir_fh;		/* file handle */
			u_short		Ir_flags;	/* flags, see below */
			short		Ir_error;	/* async write error */
			struct timeval	Ir_nfsattrtime;	/* time attr cached */
			struct ucred	*Ir_cred;	/* cred's for bio */
			struct ucred	*Ir_unlcred;	/* unlinked creds */
			char		*Ir_unlname;	/* unlinked file name */
			struct inode	*Ir_unldvp;	/* parent dir unlinked
							 * file */
			daddr_t		Ir_blksize;	/* remote block size */
			daddr_t		Ir_rsize;	/* local size */
		} i_rnode;
#define r_unlcred	 i_un.i_rnode.Ir_unlcred
#define r_unlname	 i_un.i_rnode.Ir_unlname
#define r_unldvp	 i_un.i_rnode.Ir_unldvp
#define r_fh		 i_un.i_rnode.Ir_fh
#define r_rflags	 i_un.i_rnode.Ir_flags
#define r_aerror	 i_un.i_rnode.Ir_error
#define r_nfsattrtime	 i_un.i_rnode.Ir_nfsattrtime
#define r_cred		 i_un.i_rnode.Ir_cred
#define r_blksize	 i_un.i_rnode.Ir_blksize
#define r_rsize		 i_un.i_rnode.Ir_rsize
#endif /* NFS */

	} i_un;

#ifdef SMALLBLOCKS
	char	i_sbflag;	/* small block flags */
#endif /* SMALLBLOCKS */
};


#define IGETWAIT 300	/* time, in seconds for ILOCK wait */

#define	INOHASH(gfs,ino)	((int)(((gfs)+(ino)) & v.v_himask))

/*
 * ISLOT is a macro used calculate to the inode slot for a given
 * inode.  It is necessary because the 286 compiler has trouble
 * calculating slot numbers for arrays which span more than 32k.
 *
 * WARNING: The 286 macro below makes use of the fact that Growsysd
 * allocates a new segment on each call, so we don't have to subtract
 * the base offset of the inode table because we know is is zero.
 */
#ifdef M_I286
#define ISLOT(x)  (((unsigned) ftooff((x))) / sizeof(struct inode))
#else
#define ISLOT(x)  ((x) - inode)
#endif

struct iavlist
{	struct inode	*ia_lrunext;
	struct inode	*ia_lruprev;
};

#ifdef KERNEL
extern struct	inode *inode;

extern struct	inode *rootdir;	     /* pointer to inode of root directory */
extern short	*inohash;
extern struct	iavlist iavlist[];	/* list headers for LRU lists */
extern int	niavlist;		/* number of list headers */

/* hack to get baddr to work in sys1.c and vmpage.c..... */
extern struct inode  LOCAL_IP;
extern struct inode  * local_ip;

extern	struct	inode *ialloc();
extern	struct	inode *ifind();
extern	struct	inode *iget();
extern	struct	inode *owner();
extern	struct	inode *namei();
extern	struct  inode *eiget();
extern	struct  plist *on_proplist();
extern	struct  inode *iopen();
extern	struct	inode *inodeget();	/* get available inode from LRU list */
extern	void	      inodehremove();	/* remove entry from inode cache */
extern	void	      inodenotavail();	/* remove entry from inode LRU list */
extern	bool_t	      inoderelse();	/* return inode to LRU list */
extern	void	      deallocinode();	/* 				*/
extern	void	      inodeflush();	/* invalidate and flush an inode */
#define on_plist(gfs, inum)				\
	((plist->pl_gfs == 0) ?  NULL  :		\
		on_proplist(gfs,inum))
#endif /* KERNEL */

/* flags for delayed commit in i_dlyflag */
#define DLYPEND		0x1	/* pending commit on this inode */
#define DLYDIRPEND	0x2	/* pending dir action on this inode's parent */
#define DLYCOMCLOSE	0x4	/* commit this inode on next close */
#define DLYDEL		0x8	/* disk copy of inode still in DIDEL state */
#ifdef QUOTA
#define DLYQUOTADONE	0x10	/* quota: inode has already been subtracted */
#endif /* QUOTA */

#define	MERGEDFLAG(replicated, perSS)\
	(((replicated) & ~DIPERSS) | ((perSS) & DIPERSS))

/* inode flags defines for i_flag */

/* not clear what the right thing to do about IACC is */
#define	IACC		0x0L		/* obsolete field */

#define	ILOCK		0x1L		/* inode is locked */
#define	IWANT		0x2L		/* some process waiting on lock */
#define	IUPD		0x4L		/* data has been modified */
#define	ICHG		0x8L		/* inode has been changed */
#define	ITIMES		0x10L		/* times need to be updated on disk */
#define	ITRUNC		0x20L		/* file has been truncated */
#define	IMOUNT		0x40L		/* filesystem mounted here */
#define	ITEXT		0x80L		/* executing text file */
#define	IWCOMMIT	0x100L		/* waiting to do a commit--no PROPs */
#define	IUPIN		0x200L		/* update propagation in */
#define	IUPOUT		0x400L		/* update propagation out */
#define	IUPPROP		(IUPIN|IUPOUT)	/* prop in progress */
#define	INEEDPROP	0x800L		/* file has propagation pending */
#define	IOLDV	 	0x1000L		/* incore version only--not on disk */
#define	IINVALID	0x2000L		/* re-read from disk before using */
#define	IUSCACHE	0x4000L		/* using site cache inuse flag */
#define	IIFREE		0x8000L		/* deallocate inode on close */
#define	IDEVRD		0x10000L	/* physical device open done */
#define	IDEVWR		0x20000L	/* physical device open done */
#define IDEVOPEN	(IDEVRD|IDEVWR)	/* physical device open */
#define	IERRSP		0x40000L	/* out_of_space error */
#define	IERRRW		0x80000L	/* disk read/write error */
#define	ISITEDN		0xc0000L	/* lost storage site */
#define IERR		(IERRSP|IERRRW|ISITEDN)	/* any error */
#define	IHIDDEN		0x100000L	/* inode hidden from iget */
#define	ICLOSEUS	0x200000L	/* all remote using sites closing */
#define	ICLOSESS	0x400000L	/* all non-css storage sites closing */
#define	ICSSACC		0x800000L	/* inode is in the process of iopen */
#define	IENFLOCK	0x1000000L	/* enforced locks used on this inode */
#define	ICSSCLS		0x2000000L	/* CSS is doing a close on this inode */
#define	INONLR		0x4000000L	/* map NLR to READ */
#define	ISSTEXT		0x8000000L	/* remotely exec text file (CSS only) */
#define	IRPRESENT	0x10000000L	/* Inode token held for read */
#define	IMPRESENT	0x30000000L	/* Inode token held for mod */
#define	ITOKINVALID	0x20000000L	/* Inode token invalid -- lost SS. */
#define	ITOKWNT		0x40000000L	/* Inode token wanted by another site */
#define	IPRESENT	(IRPRESENT|IMPRESENT)	/* Inode token held */
#define	INEEDWACK	0x80000000L	/* filesystem low on space */

/*
 * FIFO special bits.
 * The first two bits are set when fifos are opened
 * and reset when fifos are closed.
 */

#define IF_ROPEN	0x1		/* fifo currently open for read */
#define IF_WOPEN	0x2		/* fifo currently open for write */
#define IF_RLOCAL	0x4		/* fifo reader is local */
#define IF_WLOCAL	0x8		/* fifo writer is local */
#define IF_WRITING	0x20		/* fifo write in progress */

/* The following flags are kept only at the ss/css resp. */
#define IF_REMOTE	0x40		/* FIFO rdr/wtr at same remote site */
#define IF_OPEN		0x80		/* FIFO has been opened */

/* The following flags are for fifo select implementation */
#define IF_COLL		0x100		/* collision occured during select */
#define IF_XCOLL	0x100		/* collision occured exception select */
#define IF_RCOLL	0x200		/* collision occured read select */
#define IF_WCOLL	0x400		/* collision occured write select */
#define IF_WRBLOCK	0x2000		/* writer has been blocked */

/* The following flags are for FASYNC support */
#define IF_RASYNC	0x4000		/* FASYNC set for reading */
#define IF_WASYNC	0x8000		/* FASYNC set for writing */

/* The following flags are available use chfifotok() */
#define IF_COMMON	(IF_ROPEN|IF_WOPEN|IF_WRBLOCK|IF_REMOTE|IF_OPEN)

/* Commit flag and mask.  The first bit in the high order (4th) byte
   of the disk page address is used to indicate whether or not the 
   page corresponding to this address has been modified since the last
   commit operation (set=yes).  The mask is used to mask off this bit
   when the address is passed to a routine which will attempt to access
   the page.								*/

#define CMIT_FLAG 	0x1000000L	/* LSB of highest order byte	*/
#define CMIT_DIRTY 	0x2000000L	/* Page in bmap cache, not inode */
#define CMIT_MASK 	0xffffffL	/* Three low order bytes	*/
#define CMIT_SMALLBLOCK	0x2000000L	/* indicates a smallblock file  */
					/* to fetchwpage */
#define ALL_CMTBITS	(short)0x1fff	/* all NADDR commit bits are set */
#define NULL_CMTBITS	(short)0x000	/* inode only */
#define INDIRMASK	(short)0x1c00	/* commit bits for indirect blocks */
#define TruncBit	(short) (1 << NADDR + 1)	/* inode truncated */

/* The function INOSEQ gives a long value such that any two net messages
 * using the same file (i.e., the same site, gfs and inode number) will
 * get the same value from this function and therefore will be processed
 * in the order in which they arrive.
 */
#define INOSEQ(fsite, gfs, ino) \
	( ((fsite)<<26) | (((gfs)<<17)&0x03FE0000) | ((ino)&0x0001FFFF) )

/* This compile time check will not compile if the site will not fit in
 * the 6 bits alloted above. It's time to rewrite the function or reduce
 * MAXSITE.
 */
#ifdef _h_SPACE
#if (MAXSITE > (1 << 6))
rewrite the inoseq function or reduce maxsite.
#endif /* (MAXSITE > (1 << 6)) */
#endif /* _h_SPACE */

/* SSOPEN returns true if the inode has a valid storage site
 * associated with it.
 */
#define	SSOPEN(ip) ((ip)->i_ss == loc_site ? (ip)->i_ssmap : (ip)->i_ss)

/*  CHECK_ENFLOCK returns true if enforced locks apply to this regular file */
#define CHECK_ENFLOCK(ip) (((ip)->i_mode & (IENFMT|IEXEC|(IEXEC>>3)|(IEXEC>>6)) ) == IENFMT)

/****************************************************************
 * The nmlfilsys structure is used to as the variant portion of
 * the netmsg for all filesystem related messages that send
 * the disk inode as part of the message.  This includes the
 * following request messages:
 *	NM_OPEN, NM_BESS, NM_USCOMMIT, NM_CLSFSS, NM_VVPROP,
 *	NM_CHINODE
 * and responses to the following messages:
 * 	NM_BESS, NM_OPEN, NM_USCOMMIT,
 ***************************************************************/
struct nmlfilsys {
	struct DINODE	nfl_DINO;
#define  nfl_mode	nfl_DINO.DI_mode 	/* mode and type of file   */
#define  nfl_nlink	nfl_DINO.DI_nlink	/* number of links to file */
#define  nfl_uid	nfl_DINO.DI_uid  	/* file owner's user id    */
#define  nfl_gid	nfl_DINO.DI_gid   	/* file owner's group id   */
#define  nfl_dflag	nfl_DINO.DI_dflag 	/* disk flags; see ino.h */
#define  nfl_uniqid	nfl_DINO.DI_uniqid  	/* file unique identifier  */
#define  nfl_isize	nfl_DINO.DI_size  	/* number of bytes in file */
#define  nfl_mtime	nfl_DINO.DI_mtime 	/* time file last modified */
#define  nfl_atime	nfl_DINO.DI_atime 	/* time file last accessed */
#define  nfl_ctime	nfl_DINO.DI_ctime	/* time inode last changed */
#define  nfl_cmtcnt	nfl_DINO.DI_cmtcnt	/* commit sequence number  */
#define  nfl_fstore	nfl_DINO.DI_fstore	/* propogation attributes  */
#define  nfl_version	nfl_DINO.DI_version	/* version of the file 	   */
#define  nfl_blocks	nfl_DINO.DI_blocks	/* actual # of blocks used */
#define  nfl_pipesize	nfl_DINO.DI_blocks	/* overload for fifo stat  */

	PADOPEN(NFLlongs)
	gfs_t		Nfl_gfs;	/* global file system number       */
	long		Nfl_iflag;	/* incore inode flags; see inode.h */
	igflag_t	Nfl_open_req;	/* open/close flags; see flag.h    */
	dev_t		Nfl_rdev;	/* major-minor dev name            */
	gfs_t		Nfl_mntgfs;	/* used by listat                  */
	ino_t		Nfl_inum;	/* inode number within the gfs     */
	off_t		Nfl_mpxchan;	/* channel number for mpx devices  */
	PADCLOSE(NFLlongs, xNFLlongs, xUNFLlongs)
#define nfl_gfs		xUNFLlongs.xNFLlongs.Nfl_gfs
#define nfl_iflag	xUNFLlongs.xNFLlongs.Nfl_iflag
#define nfl_open_req	xUNFLlongs.xNFLlongs.Nfl_open_req
#define nfl_rdev	xUNFLlongs.xNFLlongs.Nfl_rdev
#define nfl_mntgfs	xUNFLlongs.xNFLlongs.Nfl_mntgfs
#define nfl_inum	xUNFLlongs.xNFLlongs.Nfl_inum
#define nfl_mpxchan	xUNFLlongs.xNFLlongs.Nfl_mpxchan
#define NNFLLONGS	(sizeof (struct NFLlongs) / sizeof (long))

	PADOPEN(NFLshorts)
	siteno_t	Nfl_ss;		/* storage site chosen/desired     */
	islot_t		Nfl_ssislot;	/* storage site incore inode slot  */
	short		Nfl_fdes;	/* file descriptor used by tokens  */
	short		Nfl_tcbdes;	/* token control block descriptor  */
	short		Nfl_cmtbits;	/* 10 incore commit bits           */
	short		Nfl_tmgrsite;	/* file token manager site         */
	siteno_t	Nfl_us;		/* using site (ss<->css messages)  */
	short		Nfl_chiflag;	/* NM_CHINODE options, see below   */
	short		Nfl_bsize;	/* file system block size of SS    */
	siteno_t	Nfl_rdevsite;	/* rdevsite */
	short		Nfl_groups[NETNGROUPS];	/* environment */
	short		Nfl_tkflg;	/* token flags; see tokens.h       */
	PADCLOSE(NFLshorts, xNFLshorts, xUNFLshorts)
#define nfl_ss		xUNFLshorts.xNFLshorts.Nfl_ss
#define nfl_ssislot	xUNFLshorts.xNFLshorts.Nfl_ssislot
#define nfl_fdes	xUNFLshorts.xNFLshorts.Nfl_fdes
#define nfl_tcbdes	xUNFLshorts.xNFLshorts.Nfl_tcbdes
#define nfl_cmtbits	xUNFLshorts.xNFLshorts.Nfl_cmtbits
#define nfl_tmgrsite	xUNFLshorts.xNFLshorts.Nfl_tmgrsite
#define nfl_us		xUNFLshorts.xNFLshorts.Nfl_us
#define nfl_chiflag	xUNFLshorts.xNFLshorts.Nfl_chiflag
#define nfl_bsize	xUNFLshorts.xNFLshorts.Nfl_bsize
#define nfl_rdevsite	xUNFLshorts.xNFLshorts.Nfl_rdevsite
#define nfl_groups	xUNFLshorts.xNFLshorts.Nfl_groups
#define nfl_tkflg	xUNFLshorts.xNFLshorts.Nfl_tkflg
#define NNFLSHORTS	(sizeof (struct NFLshorts) / sizeof (short))
};

#define NCI_SETALL	0xffff	/* used by the chinode system call */
#define NCI_ROOT	0x2	/* operation requested by root */
#define NCI_SETHIDDEN	0x4	/* set hidden directory bit */
#define NCI_CLRHIDDEN	0x8	/* clear hidden directory bit */
#define NCI_CLRSUID	0x10	/* clear setuid, setgid mode bits */
#define NCI_MODE	0x20	/* (file protection) mode bits */
#define NCI_UID		0x40	/* uid and gid of owner of file */
#define NCI_TIMES	0x80	/* access and mod times */
#define NCI_FSTORE	0x100	/* propagation attributes */
#define NCI_SETXIPC	0x200	/* Set X286 IPC bit in dflag */

#ifndef  NOCHECKS
/* If the following statement causes a compiler warning or error,
 * then the length of the nmlfilsys structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMLFS, nmlfilsys);
#endif  /* ~NOCHECKS */

/****************************************************************
 * The nmsfilsys structure is used to as the variant portion of
 * the netmsg for miscellaneous filesystem related messages that
 * do not send the disk inode as part of the message.  This
 * includes the following request message types:
 * 	NM_DEVOPEN, NM_USCLOSENC, NM_ABORT, NM_TRUNC,
 *	NM_SSCLOSENC, NM_REQLBNLIST
 ***************************************************************/
struct nmsfilsys {
	PADOPEN(NFSlongs)
	gfs_t		Nfs_gfs;	/* global file system number       */
	igflag_t	Nfs_open_req;	/* open/close flags; see flag.h    */
	off_t		Nfs_isize;	/* file size (in bytes)            */
	time_t		Nfs_atime;	/* file access time                */
	daddr_t		Nfs_endsize;	/* file region end in NM_TRUNC     */
	ino_t		Nfs_inum;	/* inode number within the gfs     */
	long		Nfs_ext;	/* AIX extended argument	   */
	off_t		Nfs_mpxchan;	/* AIX multiplex channel number	   */
	pid_t		Nfs_sesid;	/* process session id or staus flag*/
	struct tty *	Nfs_ttyp;	/* pointer to controlling tty      */
	PADCLOSE(NFSlongs, xNFSlongs, xUNFSlongs)
#define nfs_gfs		xUNFSlongs.xNFSlongs.Nfs_gfs
#define nfs_open_req	xUNFSlongs.xNFSlongs.Nfs_open_req
#define nfs_isize	xUNFSlongs.xNFSlongs.Nfs_isize
#define nfs_atime	xUNFSlongs.xNFSlongs.Nfs_atime
#define nfs_endsize	xUNFSlongs.xNFSlongs.Nfs_endsize
#define nfs_scmtcnt	xUNFSlongs.xNFSlongs.Nfs_endsize
#define nfs_inum	xUNFSlongs.xNFSlongs.Nfs_inum
#define nfs_ext		xUNFSlongs.xNFSlongs.Nfs_ext
#define nfs_mpxchan	xUNFSlongs.xNFSlongs.Nfs_mpxchan
#define nfs_sesid	xUNFSlongs.xNFSlongs.Nfs_sesid
#define nfs_ttyp	xUNFSlongs.xNFSlongs.Nfs_ttyp
#define NNFSLONGS	(sizeof (struct NFSlongs) / sizeof (long))

	PADOPEN(NFSshorts)
	islot_t		Nfs_ssislot;	/* storage site incore inode slot  */
	short		Nfs_cmtbits;	/* 10 commit bits                  */
	siteno_t	Nfs_us;		/* using site (ss <-> css messages */
	PADCLOSE(NFSshorts, xNFSshorts, xUNFSshorts)
#define nfs_ssislot	xUNFSshorts.xNFSshorts.Nfs_ssislot
#define nfs_cmtbits	xUNFSshorts.xNFSshorts.Nfs_cmtbits
#define nfs_us		xUNFSshorts.xNFSshorts.Nfs_us
#define NNFSSHORTS	(sizeof (struct NFSshorts) / sizeof (short))
};
/* If the following statement causes a compiler warning or error,
 * then the length of the nmsfilsys structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMSFS, nmsfilsys);

/* inodiskio subroutine return values */
#define DI_NOWRITE	0	/* no need to write block out */
#define DI_AWRITE	1	/* don't wait for write to finish */
#define DI_DWRITE	2	/* don't schedule write immediately */
#define DI_WRITE	3	/* check result of write */
#endif	/* ~_h_INODE */
fdkêú· n  $        y	  >‰*e™ˆ*>‰*     Âµy	  	                  ./usr/include/sys/iobuf.h  h h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)iobuf.h	16.4	LCC)	/* Modified: 18:17:52 9/22/89 */

#ifndef  _h_IOBUF
#define  _h_IOBUF

/* @(#)iobuf.h	6.1 */
/*
 * Each block device has a iobuf, which contains private state stuff
 * and 2 list heads: the b_forw/b_back list, which is doubly linked
 * and has all the buffers currently associated with that major
 * device; and the d_actf/d_actl list, which is private to the
 * device but in fact is always used for the head and tail
 * of the I/O queue for the device.
 * Various routines in bio.c look at b_forw/b_back
 * (notice they are the same as in the buf structure)
 * but the rest is private to each device driver.
 */
struct iobuf
{
	int	ib_flags;		/* see buf.h */
	struct	buf *ib_forw;		/* first buffer for this dev */
	struct	buf *ib_back;		/* last buffer for this dev */
	struct	buf *ib_actf;		/* head of I/O queue */
	struct 	buf *ib_actl;		/* tail of I/O queue */
	dev_t	ib_dev;			/* major+minor device name */
	char	ib_active;		/* busy flag */
	char	ib_errcnt;		/* error count (for recovery) */
	struct eblock	*io_erec;	/* error record */
	int	io_nreg;		/* number of regs to log on errors */
	physadr	io_addr;		/* csr address or SDA for device */

#ifdef  vax
	physadr	io_mba;			/* mba address */
#endif  /* vax */
	struct	iostat	*io_stp;	/* unit I/O statistics */
#if	defined(u370) /* Start of IX/370 code */
        int     firstpf;                /* first RPN */
        int     lastpf;                 /* last  RPN */
        char    devid[7];               /* device id */
#else  /* ~(u370) End of IX/370 code */
	time_t	io_start;
	int	io_s1;			/* space for drivers to leave things */
	int	io_s2;			/* space for drivers to leave things */
#endif /*~(u370) */
};
#if	defined(u370) /* Start of IX/370 code */
#define tabinit(dv,stat)	{0,0,0,0,0,makedev(dv,0),0,0,0,0,0,stat,0,0,""}
#endif  /* (u370)	 End of IX/370 code */
#if defined(vax) 
#define tabinit(dv,stat)	{0,0,0,0,0,makedev(dv,0),0,0,0,0,0,0,stat,0,0}
#define NDEVREG	(sizeof(struct device)/sizeof(int))
#endif /* defined(vax) */ 

#define	B_ONCE	01	/* flag for once only driver operations */
#define	B_TIME	04	/* for timeout use */

#endif  /* ~_h_IOBUF */
ime    kêÖõ m  $        ¡>  ?‰*f™ˆ*?‰*     Ýu¡>  	              {  ./usr/include/sys/ioctl.h  h h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef _POSIX_SOURCE
#ifndef H_SCCSID
#include	<sccs.h>
#endif /* !H_SCCSID */
H_SCCSID(@(#)ioctl.h	1.2    IBM AIX)    /* Modified: 20:01:56 7/15/92 */
#endif /* ! _POSIX_SOURCE */

#ifndef	_H_IOCTL
#define	_H_IOCTL

#ifndef _POSIX_SOURCE

#include <sys/ioctlcmd.h>
#include <sys/types.h>
#include <sgtty.h>

/*
**	Structures definitions for ioctl args
*/

/*	tty control character stuff	*/
struct tchars {
	char	t_intrc;	/* interrupt */
	char	t_quitc;	/* quit */
	char	t_startc;	/* start output */
	char	t_stopc;	/* stop output */
	char	t_eofc;		/* end-of-file */
	char	t_brkc;		/* input delimiter (like nl) */
};
struct ltchars {
	char	t_suspc;	/* stop process signal */
	char	t_dsuspc;	/* delayed stop process signal */
	char	t_rprntc;	/* reprint line */
	char	t_flushc;	/* flush output (toggles) */
	char	t_werasc;	/* word erase */
	char	t_lnextc;	/* literal next character */
};
struct ttypagestat {
	int	tps_length;	/* screen length (vertical) */
	int	tps_lpos;	/* current vertical position */
	char	tps_statc;	/* show system status info */
	char	tps_pagec;	/* show next screenful */
	char	tps_pgoffc;	/* ignore paging till next input */
	char	tps_flag;	/* page the screen even in cbreak */
};

#ifdef _MBCS
/*
 * define a codeset structure template
 */
struct tcset {
	u_short		tdc_len;   /* length of table to be read/written */
	charlen_t 	tdc_codeset[CODESIZE];
};
#endif /* _MBCS */

/*
	Default control characters:
	Some of these defaults are duplicated in termio.h, namely,
	CUNDEF, CINTR, CQUIT, CEOF, CSTART, and CSTOP.  If you change any of
	these (I really doubt that anyone will want to...), make sure
	that termio.h gets exact duplicates, otherwise cpp will complain
	about multiple definitions whenever we compile the kernel.
*/
#define	CTRL(c)	('c'&037)
#define CUNDEF	0377
#define	CINTR	0177	/* DEL */
#define	CQUIT	026	/* cntl v */
#define	CEOF	04	/* cntl d */
#define	CSTART	021	/* cntl q */
#define	CSTOP	023	/* cntl s */
#define	CEOT	CEOF
#define	CBRK	CUNDEF
#define	CSUSP	CTRL(z)
#define	CDSUSP	CTRL(y)
#define	CRPRNT	CTRL(r)
#define	CFLUSH	CTRL(o)
#define	CWERASE	CTRL(w)
#define	CLNEXT	CUNDEF
#define	CSTAT	CTRL(t)
#define	CPAGE	(' ')
#define	CPGOFF	CTRL(m)

/*	disk partition stuff	*/
struct	dkpart {
	long	dk_numblks;	/* number of sectors in partition */
	long	dk_cyloff;	/* cylinder where partition starts */
};

/*	disk partition table ioctl commands	*/
#define	DKGETPART	_IOR(d, 0, struct dkpart) /* get disk partition entry */
#define	DKSETPART	_IOW(d, 1, struct dkpart) /* set disk partition entry */

#endif /* ! _POSIX_SOURCE */

/*
**	Ioctl commands:
*/
/* Window/terminal size structure.
 * This information is stored by the kernel
 * in order to provide a consistent interface,
 * but is not used by the kernel.
 *
 * Type are "unsigned short" so that types.h not required.
 */

#ifdef _POSIX_SOURCE
struct _Winsize 
#else
struct winsize 
#endif
{
	unsigned short	ws_row;			/* rows, in characters */
	unsigned short	ws_col;			/* columns, in characters */
	unsigned short	ws_xpixel;		/* horizontal size, pixels */
	unsigned short	ws_ypixel;		/* vertical size, pixels */
};

#ifndef _POSIX_SOURCE
/*
 * Pun for SUN.
 */
struct ttysize {
	unsigned short	ts_lines;
	unsigned short	ts_cols;
	unsigned short	ts_xxx;
	unsigned short	ts_yyy;
};
#define TIOCGSIZE	TIOCGWINSZ
#define TIOCSSIZE	TIOCSWINSZ

#ifndef NO_AUSTIN_HOOKS
/* ******************************* AUSTIN HOOK ************************ */
struct hfscreen	{
	unsigned short screen[25][80];
	};
struct hfcurpos {
	unsigned short row;
	unsigned short column;
	};

/* subcodes for HFSKEP ioctl	*/
#define KEPOPEN		0x01
#define KEPCLOSE	0x02
#define KEPIOCTL	0x03
#define KEPREAD		0x04
#define KEPWRITE	0x05
#define KEPRDSLP	0x06
/* ******************************************************************** */
#endif

/*	file control ioctl commands	*/
#define FIOCLEX		_ION(f, 1)		/* set exclusive use on fd */
#define FIONCLEX	_ION(f, 2)		/* remove exclusive use */
#define FIOGETOWN	_IOR(f, 123, int)	/* 4.2: get owner */
#define FIOSETOWN	_IOW(f, 124, int)	/* 4.2: set owner */
#define FIOASYNC	_IOW(f, 125, int)	/* 4.2: set/clr async i/o */
#define FIONBIO		_IOW(f, 126, int)	/* 4.2: set/clr non-blk i/o */
#define FIONREAD	_IOR(f, 127, long)	/* get # bytes to read */

/*	tty ioctl commands	*/
#define TIOCGETD	_IOR(t, 0, int)		/* get line discipline */
#define TIOCSETD	_IOW(t, 1, int)		/* set line discipline */
#define TIOCHPCL	_ION(t, 2)		/* hang up on last close */
#define TIOCMODG	_IOR(t, 3, int)		/* get modem control state */
#define TIOCMODS	_IOW(t, 4, int)		/* set modem control state */
#define		TIOCM_LE	0001		/* line enable */
#define		TIOCM_DTR	0002		/* data terminal ready */
#define		TIOCM_RTS	0004		/* request to send */
#define		TIOCM_ST	0010		/* secondary transmit */
#define		TIOCM_SR	0020		/* secondary receive */
#define		TIOCM_CTS	0040		/* clear to send */
#define		TIOCM_CAR	0100		/* carrier detect */
#define		TIOCM_RNG	0200		/* ring */
#define		TIOCM_DSR	0400		/* data set ready */
#define		TIOCM_RI	TIOCM_RNG	/* ring (alternate) */
#define		TIOCM_CD	TIOCM_CAR	/* carrier detect (alternate) */
#define TIOCGETP	_IOR(t, 8, struct sgttyb) /* get params -- gtty */
#define TIOCSETP	_IOW(t, 9, struct sgttyb) /* set params -- stty */
#define TIOCSETN	_IOW(t, 10, struct sgttyb) /* set, but no flushtty */
#define TIOCOSM   	_IOR(t, 11, int)	/* osm logging allowed */
#define TIOCNOSM  	_IOR(t, 12, int)	/* osm logging disallowed */
#define TIOCEXCL	_ION(t, 13)		/* set exclusive use of tty */
#define TIOCNXCL	_ION(t, 14)		/* reset exclusive use of tty */
#define TIOCFLUSH	_IOW(t, 16, int)	/* flush buffers */
#define TIOCSETC	_IOW(t, 17, struct tchars) /* set special chars */
#define TIOCGETC	_IOR(t, 18, struct tchars) /* get special chars */

#ifdef _MBCS
#define	TIOCSCLTBL	0x00007417		/* _IOW(t, 23)
						    set codeset info. */
#define	TIOCGCLTBL	0x00007418		/* _IOR(t, 24
						    get codeset info. */
#endif /* _MBCS */

#if defined(_BSD) && !defined(KERNEL)
#define		CRTBS		0x00010000	/* do backspacing for crt */
#define		PRTERA		0x00020000	/* \ ... / erase */
#define		CRTERA		0x00040000	/* " \b " to wipe out char */
#define		TILDE		0x00080000	/* hazeltine tilde kludge */
#define		MDMBUF		0x00100000	/* start/stop output on carrier intr */
#define		LITOUT		0x00200000	/* literal output */
#define		TOSTOP		0x00400000	/* SIGSTOP on background output */
#define		FLUSHO		0x00800000	/* flush output to terminal */
#define		NOHANG		0x01000000	/* no SIGHUP on carrier drop */
#define		L001000		0x02000000
#define		CRTKIL		0x04000000	/* kill line with " \b " */
#define		PASS8		0x08000000
#define		CTLECH		0x10000000	/* echo control chars as ^X */
#define		PENDIN		0x20000000	/* tp->t_rawq needs reread */
#define		DECCTQ		0x40000000	/* only ^Q starts after ^S */
#define		NOFLSH		0x80000000	/* no output flush on signal */
#endif /* _BSD && !KERNEL */

#define TIOCLBIS	_IOW(t, 127, int)	/* bis local mode bits */
#define TIOCLBIC	_IOW(t, 126, int)	/* bic local mode bits */
#define TIOCLSET	_IOW(t, 125, int)	/* set entire local mode word */
#define TIOCLGET	_IOR(t, 124, int)	/* get local modes */
#define TIOCSBRK	_ION(t, 123)		/* set break bit */
#define TIOCCBRK	_ION(t, 122)		/* clear break bit */
#define TIOCSDTR	_ION(t, 121)		/* set data terminal ready */
#define TIOCCDTR	_ION(t, 120)		/* clear data terminal ready */
#define TIOCGPGRP	_IOR(t, 119, long)	/* get pgrp of tty */
#define TIOCSPGRP	_IOW(t, 118, long)	/* set pgrp of tty */
#define TIOCSLTC	_IOW(t, 117, struct ltchars) /* set bsd special chars */
#define TIOCGLTC	_IOR(t, 116, struct ltchars) /* get bsd special chars */
#define TIOCOUTQ	_IOR(t, 115, int)	/* output queue size */
#define TIOCSTI		_IOW(t, 114, char)	/* simulate terminal input */
#define TIOCNOTTY	_ION(t, 113)		/* void tty association */
#define TIOCPKT		_IOW(t, 112, int)	/* 4.2: pty: set/clr pkt mode */
#define		TIOCPKT_DATA		0x00	/* data packet */
#define		TIOCPKT_FLUSHREAD	0x01	/* flush packet */
#define		TIOCPKT_FLUSHWRITE	0x02	/* flush packet */
#define		TIOCPKT_STOP		0x04	/* stop output */
#define		TIOCPKT_START		0x08	/* start output */
#define		TIOCPKT_NOSTOP		0x10	/* no more ^S, ^Q */
#define		TIOCPKT_DOSTOP		0x20	/* now do ^S ^Q */
#define TIOCSTOP	_ION(t, 111)		/* 4.2: stop output, like ^S */
#define TIOCSTART	_ION(t, 110)		/* 4.2: start output, like ^Q */
#define TIOCMSET	_IOW(t, 109, int)	/* set all modem bits */
#define TIOCMBIS	_IOW(t, 108, int)	/* bis modem bits */
#define TIOCMBIC	_IOW(t, 107, int)	/* bic modem bits */
#define TIOCMGET	_IOR(t, 106, int)	/* get all modem bits */
#define TIOCREMOTE	_IOW(t, 105, int)	/* 4.2: remote input editing */

#ifdef _POSIX_SOURCE
#define TIOCGWINSZ      _IOR(t, 104, struct _Winsize)    /* get window size */
#define TIOCSWINSZ      _IOW(t, 103, struct _Winsize)    /* set window size */
#else
#define TIOCGWINSZ      _IOR(t, 104, struct winsize)    /* get window size */
#define TIOCSWINSZ      _IOW(t, 103, struct winsize)    /* set window size */
#endif

#define TIOCUCNTL	_IOW(t, 102, int)	/* pty set/clr usr cntrl mode */
#define		UIOCCMD(n)	_IO(u, n)		/* usr cntl op "n" */

#define TIOCRESET	_ION(t, 101)		/* LCC: reset tty structure */
#define TIOCSCONS	_ION(t, 104)		/* 4.2: Select console line */
#define TIOCGPAGE	_IOR(t, 64, struct ttypagestat)	/* get page/stat info */
#define TIOCSPAGE	_IOW(t, 65, struct ttypagestat)	/* set page/stat info */

#define BBNTTNO		(('b'<<8)|1)		/* rfg:bbn tty empty? */

#define	OTTYDISC	0		/* old, v7 std tty driver */
#define	NETLDISC	1		/* line discip for berk net */
#define	NTTYDISC	2		/* new tty discipline */

/* SPECIAL BSD/SYSV MERGE IOCTL COMMANDS */
/* the following two values are reserved and noted as such in termio.h */
#define TCSETPSX   (TIOC|36)
#define TCGETPSX   (TIOC|37)

/*
 *	Additional tty mode flags for 4.[12] bsd
 */
#define	LCRTBS	0000001		/* correct backspacing for crt */
#define	LPRTERA 0000002		/* printing terminal \ ... / erase */
#define	LCRTERA	0000004		/* do "\b \b" to wipe out character */
#define	LTILDE	0000010		/* IIASA - hazeltine tilde kludge */
#define	LMDMBUF	0000020		/* IIASA - start/stop output on carrier intr */
#define	LLITOUT	0000040		/* IIASA - suppress any output translations */
#define	LTOSTOP	0000100		/* send stop for any background tty output */
#define	LFLUSHO	0000200		/* flush output sent to terminal */
#define	LNOHANG 0000400		/* IIASA - don't send hangup on carrier drop */
#define	LETXACK 0001000		/* IIASA - diablo style buffer hacking */
#define	LCRTKIL	0002000		/* erase whole line on kill with "\b \b" */
#define	LPASS8  0004000		/* allow all 8 bits to pass through on input */ 
#define	LCTLECH	0010000		/* echo control characters as ^X */
#define	LPENDIN	0020000		/* tp->t_rawq is waiting to be reread */
#define	LDECCTQ 0040000		/* only ^Q starts after ^S */
#define	LNOFLSH 0100000		/* disable flush after signal */

#define		uclaltchars	ttypagestat
#define		ut_length	tps_length
#define		ut_lpos		tps_lpos
#define		ut_statc	tps_statc
#define		ut_pagec	tps_pagec
#define		ut_npagec	tps_pgoffc
#define		ut_pgcbrk	tps_flag
#define		TIOGUCLA	TIOCGPAGE
#define		TIOSUCLA	TIOCSPAGE

/*
 *	Additional flags for terminal paging
 */
#define PGCBRK		0001	/* enable page-stop even in cbreak mode */
#define PGBELL		0002	/* ring bell on full page stop */
#define ERASBELL 	0004	/* ring bell on attempted erase-past-prompt */
/*	State bits don't really belong here, but shucks ....	*/
#define PAGESTOP	0010	/* state bit: tty is stopped on a full page */
#define PG0LPOS		0020	/* state bit: last page-start set t_lpos = 0 */
#define PG_ENB		0040	/* paging enabled (if length is also > 0) */

/*
 * General device I/O controls
 */
#define DIOCONLINE	_ION(D, 0)		/* turn device on-line */
#define DIOCOFFLINE	_ION(D, 1)		/* turn device off-line */
#define DIOCRESET	_ION(D, 2)		/* reset the device */
#ifdef b370
/*
 * 370 device I/O controls
 */
#define DEVADDR		_ION(D, 100)		/* virtual address of this device */
#endif /* b370 */

/*
 * osm device I/O controls
 */
#define OSMIOC_WRITE_ON	_ION(O, 0)		/* include console writes */
#define OSMIOC_WRITE_OFF _ION(O, 1)		/* exclude console writes */
#define OSMIOC_ECHO_ON	_ION(O, 2)		/* include input echoes */
#define OSMIOC_ECHO_OFF _ION(O, 3)		/* exclude input echoes */

/* socket i/o controls */
#define SIOCSHIWAT	_IOW(s,  0, int)		/* set high watermark */
#define SIOCGHIWAT	_IOR(s,  1, int)		/* get high watermark */
#define SIOCSLOWAT	_IOW(s,  2, int)		/* set low watermark */
#define SIOCGLOWAT	_IOR(s,  3, int)		/* get low watermark */
#define SIOCATMARK	_IOR(s,  7, int)		/* at oob mark? */
#define SIOCSPGRP	_IOW(s,  8, int)		/* set process group */
#define SIOCGPGRP	_IOR(s,  9, int)		/* get process group */

#define SIOCADDRT	_IOW(r, 10, struct rtentry)	/* add route */
#define SIOCDELRT	_IOW(r, 11, struct rtentry)	/* delete route */

#define SIOCSIFADDR	_IOW(i, 12, struct ifreq)	/* set ifnet address */
#define SIOCGIFADDR	_IOWR(i,13, struct ifreq)	/* get ifnet address */
#define SIOCSIFDSTADDR	_IOW(i, 14, struct ifreq)	/* set p-p address */
#define SIOCGIFDSTADDR	_IOWR(i,15, struct ifreq)	/* get p-p address */
#define SIOCSIFFLAGS	_IOW(i, 16, struct ifreq)	/* set ifnet flags */
#define SIOCGIFFLAGS	_IOWR(i,17, struct ifreq)	/* get ifnet flags */
#define SIOCGIFBRDADDR	_IOWR(i,18, struct ifreq)	/* get broadcast addr */
#define SIOCSIFBRDADDR	_IOW(i,19, struct ifreq)	/* set broadcast addr */
#define SIOCGIFCONF	_IOWR(i,20, struct ifconf)	/* get ifnet list */
#define SIOCGIFNETMASK	_IOWR(i,21, struct ifreq)	/* get net addr mask */
#define SIOCSIFNETMASK	_IOW(i,22, struct ifreq)	/* set net addr mask */
#define SIOCGIFMETRIC	_IOWR(i,23, struct ifreq)	/* get IF metric */
#define SIOCSIFMETRIC	_IOW(i,24, struct ifreq)	/* set IF metric */
#define SIOCGIFMTU	_IOWR(i,25, struct ifreq)	/* get IF mtu */
#define SIOCSIFMTU	_IOW(i,26, struct ifreq)	/* set IF mtu */
#define SIOCGIFREMMTU	_IOWR(i,27, struct ifreq)	/* get IF remmtu */
#define SIOCSIFREMMTU	_IOW(i,28, struct ifreq)	/* set IF remmtu */

#define SIOCSARP	_IOW(i, 30, struct arpreq)	/* set arp entry */
#define SIOCGARP	_IOWR(i,31, struct arpreq)	/* get arp entry */
#define SIOCDARP	_IOW(i, 32, struct arpreq)	/* delete arp entry */
#define SIOCSIFIUCV	_IOW(i, 33, struct ifreq)	/* set iucv state */
#define SIOCGIFIUCV	_IOWR(i,34, struct ifreq)	/* get iucv state */
#define	SIOCSARP_802_5	_IOW(i, 93, struct ie5_arpreq)	/* set arp entry */
#define	SIOCGARP_802_5	_IOWR(i,94, struct ie5_arpreq)	/* get arp entry */
#define	SIOCDARP_802_5	_IOW(i, 95, struct ie5_arpreq)	/* delete arp entry */
#define	IOCTYPE		0xff00
#define IOCINFO 	0xff01
#define IOCCONFIG	0xff02
#define IOCSTATS	0xff03

#ifdef b370
#define HDIORST		_ION(F,75)	/* reset driver (re-read vtoc) */
#define HDIOPAR		_ION(F,76)	/* get drive information (fba_dev) */
#endif

#ifdef	i386
/* Floppy/Micro diskette control */
#define FDIO	('F' << 8)
#define FDFMTON		(FDIO|1)	/* formatting on */
#define FDFMTOFF	(FDIO|2)	/* formatting off */
#define FDVERIFY	(FDIO|3)	/* enable last byte read back verify */
#define FDNOVERIFY	(FDIO|4)	/* disable last byte read back verify */

/* Hard disk control */
#define HDIO	('H' << 8)
#define HDIORST	(HDIO|1)	/* hard disk reset */
#define HDIOPAR	(HDIO|2)	/* hard disk parameters */
#define HDIOSTAT     (HDIO|9)	/* hard disk partition open status */
#define HDSETERRSCAN (HDIO|10)	/* set "scanning for errors" mode */
#define HDCLRERRSCAN (HDIO|11)	/* clear "scanning for errors" mode */
#define HDNUMDISKS _IOR(H,12,int) /* get the max number of disks supported */

#include <sys/i386/crtioctl.h>	/* CRT related ioctls in their own module */

#endif	/* i386 */
#endif /* !_POSIX_SOURCE */

#ifdef i386
/* ioctl commmands for posdev driver */
#define PIOCMACHINFO _IOR(p,0,struct mach_info)	
#endif /* i386 */

#endif /* ~_H_IOCTL */
-line *kêªÆ l  $        j  ?‰*f™ˆ*?‰*     =”j  	                  ./usr/include/sys/ioctlcmd.h h h
/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */


#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)ioctlcmd.h	16.4.1.1	LCC)	/* Modified: 17:31:11 2/14/91 */
/* SCCSIDPUFF(@(#) ioctlcmd.h 4.1 LM 12:52:59 4/23/85 C 22:12:36 4/23/85); */

#ifndef	_h_IOCTLCMD
#define	_h_IOCTLCMD

/*
**	Ioctl command macros:
**
*/

/*
	Ioctl's have the command encoded in the lower word, and the
	size of any in or out parameters in the upper word.  The high 2
	bits of the upper word are used to encode the in/out status of
	the parameter.
*/
#define	OLDIOCTL(x)	((x)&0xffff)		/* masks old style ioctl cmd */
#define	IOC_VALUE	0x1			/* use literal arg value */
#define	IOC_NONE	0x2			/* no parameters */
#define	IOC_OUT		0x4			/* reference: copy out */
#define	IOC_IN		0x8			/* reference: copy in */
#define	IOC_INOUT	(IOC_IN | IOC_OUT)	/* reference: copy in+out */
#define	IOC_NEW		(IOC_IN | IOC_OUT | IOC_NONE | IOC_VALUE)

#define	IOCMAXSIZ		0x12c
#define IOCSIZMASK		0x7f


/*
	Since the `cmd' argument to ioctl() is an int, the above
	encoding scheme will not work on machines that have 16 bit ints.
	In this case, the `cmd' cannot encode the size or dataflow
	we treat these as old style commands and map them inside
	the kernel to reconstruct this information.
*/
#define _IO(x,y)	_ION(x,y)	/* When we picked up the 4.2a stuff 
					   for LOCUS. Rozen */
#if	defined(SIXTEENBITS) || defined(KERNEL)

#define	_ION(x,y)	(('x'<<8)|(y))
#define	_IOV(x,y)	(('x'<<8)|(y))
#define	_IOR(x,y,t)	(('x'<<8)|(y))
#define	_IOW(x,y,t)	(('x'<<8)|(y))
#define	_IOWR(x,y,t)	(('x'<<8)|(y)) /* _IORW is defined in sdio */

#else

#define	_IOV(x,y)	((IOC_VALUE<<28)|('x'<<8)|(y))
#define	_ION(x,y)	((IOC_NONE<<28)|('x'<<8)|(y))
#define	_IOW(x,y,t)	((IOC_IN<<28)|((sizeof(t)&IOCSIZMASK)<<16)|('x'<<8)|(y))
#define	_IOR(x,y,t)	((IOC_OUT<<28)|((sizeof(t)&IOCSIZMASK)<<16)|('x'<<8)|(y))
#define	_IOWR(x,y,t)	((IOC_INOUT<<28)|((sizeof(t)&IOCSIZMASK)<<16)|('x'<<8)|(y))

#endif

#endif /* ~_h_IOCTLCMD */
FIUCV	kêÖÈ ¹  ÿ¡             ^‰*^‰*^‰*          	                  ./usr/include/sys/ip.h c../netinet/ip.h kêvV ·  ÿ¡             ^‰*^‰*^‰*          	                  ./usr/include/sys/ip_icmp.h  h h../netinet/ip_icmp.h icmkêV µ  ÿ¡             ^‰*^‰*^‰*          	                  ./usr/include/sys/ip_var.h   h h../netinet/ip_var.h _varkêœq k  $        Ä  ?‰*f™ˆ*?‰*     i\Ä  	                  ./usr/include/sys/ipc.h /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)ipc.h	16.6	AIX)	/* Modified: 18:19:35 9/22/89 */

#ifndef _h_IPC
#define _h_IPC

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _h_TYPES */

/* Common IPC Access Structure */
struct ipc_perm {
	ushort	uid;	/* owner's user id */
	ushort	gid;	/* owner's group id */
	ushort	cuid;	/* creator's user id */
	ushort	cgid;	/* creator's group id */
	ushort	mode;	/* access modes */
	ushort	seq;	/* slot usage sequence number */
	key_t	key;	/* key */
};

/* Common ipc_perm mode definitions. */
#define	IPC_ALLOC	0100000		/* entry currently allocated */
#define IPC_TYPEDEP	0007000		/* for msg,sem,shm dependent defs */
#define IPC_PERMS	0000777		/* permission mode bits */

/* Common IPC operation flag definitions. */
#define	IPC_CREAT	0001000		/* create entry if key doesn't exist */
#define	IPC_EXCL	0002000		/* fail if key exists */
#define	IPC_NOWAIT	0004000		/* error if request must wait */

/* Keys. */
#define	IPC_PRIVATE	(key_t)0	/* private key */

/* Control Commands. */
#define	IPC_RMID	0	/* remove identifier */
#define	IPC_SET		1	/* set options */
#define	IPC_STAT	2	/* get options */

#endif /* ~_IPC_ */
pickkê°2 ‡  $        /  ‰*µ™ˆ*‰*     ß’/  
              ›j  ./usr/include/sys/itkczech.h h h/*
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1990 IBM Corporation
 *	All Rights Reserved
 */

/*
 * This include file contains code which can be used to check the
 * consistency of the kernel's file and inode tokens.
 * This is contained in an include file so that it can be included in
 * the kernel (for running with stringent token checks), and in crash,
 * for dump analysis.
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)itkczech.h	1.5	LCC)	/* Modified: 14:17:42 11/20/90 */

#ifndef _h_INODE
#include <inode.h>
#include <tokens.h>
#endif /*!_h_INODE*/


/*
 * For now, use the INUSE bit to decide which tcb's have been referenced.
 * We could also allocate a parallel table for this, but the bit is available.
 */
#define	REF(tcbp)	((tcbp)->tcb_flag & TCB_INUSE)
#define	SET_REF(tcbp)	((tcbp)->tcb_flag |= TCB_INUSE)
#define	CLEAR_REF(tcbp)	((tcbp)->tcb_flag &= ~TCB_INUSE)

#ifdef KERNEL

#define printf ncprintf

#define	XLATE_TCB(Ktcbp)	(Ktcbp)
#define	XLATE_IP(Kip)		(Kip)
#define	XLATE_TLCI(Ktlci)	(Ktlci)

#define	Kv		v
#define	Ktcb_flist	tcb_flist


bool_t check_tokens_panic = FALSE;

#else /*!KERNEL*/

extern struct var var;
#define Kv	var

struct var	v;	/* copy of var struct with translated pointers */

extern struct tok_ctrlb *tcb_table;

static struct inode *Kinode;	/* Base of kernel's inode table */
static struct inode *inode;	/* user mode copy of kernel's inode table */
static struct tok_ctrlb *Ketcb_table;	/* end of kernel's tcb table */
static struct tok_ctrlb *etcb_table;	/* end of my copy of tcb table */
static struct tok_ctrlb *Ktcb_flist;	/* kernel's freelist. */


#define	Ktcb_table	Ktcb
#define	Ktcb_loci	Kloci

#define	XLATE_TCB(Ktcbp)	(&tcb_table[(Ktcbp) - Ktcb_table])
#define	XLATE_IP(Kip)		(&inode[(Kip) - Kinode])
#define	XLATE_TLCI(Ktlci)	(&tcb_loci[(Ktlci) - Ktcb_loci])
#endif /*!KERNEL*/

#ifdef _ANSI_C_
#define	ASSERT(assertion, why) \
	if (!(assertion)) { \
		printf("Assertion FAILED!: %s: i %d tcb %d (%s)\n", \
			#assertion, ip? ip - inode: -1, \
			tcbp? tcbp - tcb_table: -1, why); \
		flaws++; \
	} else /* your ';' here */
#else /*!ansi*/
#define	VASSERT(assertion, why) \
	if (!(assertion)) { \
		printf("Assertion FAILED!: %s: i %d tcb %d (%s) L%d\n", \
			"assertion", ip? ip - inode: -1, \
			tcbp? tcbp - tcb_table: -1, why, __LINE__); \
		flaws++; \
	} else /* your ';' here */ \
		printf("TRUE:%s: i %d tcb %d (%s) L%d\n", \
			"assertion", ip? ip - inode: -1, \
			tcbp? tcbp - tcb_table: -1, why, __LINE__);

#define	ASSERT(assertion, why) \
	if (!(assertion)) { \
		printf("Assertion FAILED!: %s: i %d tcb %d (%s) L%d\n", \
			"assertion", ip? ip - inode: -1, \
			tcbp? tcbp - tcb_table: -1, why, __LINE__); \
		flaws++; \
	} else /* your ';' here */

#endif /*!ansi*/

static int flaws;		/* Using this static makes the code easier. */
static struct inode *ip;	/* Two dummy globals to make assert's work ...*/
static struct tok_ctrlb *tcbp;	/* ... in contexts with no ip or tcbp */

#ifndef KERNEL

caddr_t
Get_K_Ptr(Name)
char *Name;
{
	struct symrec *sym = symsrch(Name);
	char *ptrval = NULL;

	if (sym == NULL) {
		printf("Get_K_Ptr: Couldn't find sym %s\n", Name);
		return NULL;
	}
	vmread(&ptrval, KOFF(sym), sizeof ptrval);
	return ptrval;
}

/*
 * routine called by crash (or other tools) to check the consistency of the
 * kernel's inode tokens.
 */
cr_check_tokens()
{

	/* Read our Kernel symbols */
	Kinode = (struct inode *)Get_K_Ptr("inode");
	Ketcb_table = (struct tok_ctrlb *)Get_K_Ptr("etcb_table");
	Ktcb_flist = (struct tok_ctrlb *)Get_K_Ptr("tcb_flist");

	/* Copy var struct so we can relocate the pointers. */
	v = Kv;

	/* Allocate and read in the inode table */
	getinode(Kinode);

	/* Allocate and read in the tok_ctrlb table */
	gettcb();
	etcb_table = tcb_table + (Ketcb_table - Ktcb_table);

	/* Allocate and read in the token-site table */
	gettokreq();

	/* Now call check_tokens to do the checking. */
#ifdef TESTING_ONLY
	Xcheck_tokens("cr_check_tokens");
#else	/*!TESTING*/
	check_tokens("cr_check_tokens");
#endif	/*!TESTING*/
}

#ifdef TESTING_ONLY
#include <sys/times.h>
Xcheck_tokens(whence)
char *whence;
{
	int i;
	struct tms start, end;
#define	ITER	1000

	times(&start);
	for (i = 0; i < ITER; i++)
		check_tokens(whence);
	times(&end);
	printf("\ncheck_tokens: %f microsec per call\n",
		(double)(end.tms_utime - start.tms_utime)
		* (1.0e6 / (HZ * ITER)));
}
#endif /*TESTING_ONLY*/

getinode(Kinode)
struct inode *Kinode;
{
	int itable_size = Kv.v_inode * sizeof(struct inode);

	if ((inode == NULL) &&
	    (inode = (struct inode *)malloc(itable_size)) == NULL)
	{
		printf ("malloc error for inode table\n");
		return;
	}
	vmread((char *)inode, Kinode, itable_size);
	v.ve_inode = inode + (Kv.ve_inode - Kinode);
}

#endif KERNEL

/*
 * Perform some consistency checks on tokens.
 * Returns the number of flaws found.
 *
 * Consistency:
 *    * All token control blocks must be either on the freelist or
 *	attached to an inode.
 *    * No token can be pointed more than once.
 *    * All and only tok_ctrlb's on the freelist are FREE.
 *    * Master tcb's have request chains.
 *    * Slave tcb's point at their master.
 *    * All non-free tokens should be pointed to by at least one
 *	struct tok_loci.
 *    * token must be on the queue appropriate to its
 *	TCB_INODE and TCB_FORMOD flags.
 *    * All tok_loci elements should be either on freelist or a token.
 *
 * (Note care used when using pointers in the tables:
 *  1: this code must work from user mode crash analyzers.
 *  2: this code should be somewhat tolerant of bad pointers.
 * )
 */

check_tokens(whence)
char *whence;
{
	register struct tok_ctrlb *tcbp;
	static char *last_ok_whence;
	static time_t last_ok_tod;

	flaws = 0;

	/* Mark all tcb's as not-inuse, so we can figure out what really is */
	for (tcbp = tcb_table; tcbp < etcb_table; tcbp++)
		CLEAR_REF(tcbp);

	/*
	 * Scan through all inodes, their tokens, and the tok_loci entries,
	 * checking for consistency, and marking tokens as being referenced.
	 */
	scan_inodes();

	/*
	 * Mark all tcb's on freelist as REF'd.
	 */
	scan_tcb_flist();

	/* Check that all tcb's are accounted for. */
	scan_tcb_table();

#ifdef KERNEL
	if (flaws != 0) {
		printf("\ncheck_tokens from %s had %d flaws\n", whence, flaws);
		printf("last successful check: from %s at time %ld\n",
			last_ok_whence, last_ok_tod);
		if (check_tokens_panic)
			panic("check_tokens");
	}
	last_ok_whence = whence;
	last_ok_tod = gettod();
#else /*!KERNEL*/
	return flaws;
#endif /*!KERNEL*/
}




scan_inodes()
{
	register struct inode *ip;
	register struct tok_ctrlb *tcbp = NULL;

	for (ip = inode; ip < v.ve_inode; ip++) {
		if (ip->i_arefcnt == 0) {
			ASSERT(ip->i_itcblnk == NULL, "aref 0");
			ASSERT(ip->i_frtcblnk == NULL, "aref 0");
			ASSERT(ip->i_fmtcblnk == NULL, "aref 0");
			continue;
		}

		/*
		 * Check the inode token.
		 */
		if (ip->i_itcblnk) {
			check_inode_token(ip);
		}

		if (ISFIFO(ip)) {
			/*
			 * check the fifo tokens.
			 */
			if (tcbp = ip->i_frtcblnk) {
				check_fifo_tokens(ip, tcbp, 0);
			}

			if (tcbp = ip->i_fmtcblnk) {
				check_fifo_tokens(ip, tcbp, TCB_FORMOD);
			}
		}
	}
	return flaws;	/* for possible later use standalone */
}

/*
 * Flags whose state we can check in all non-FREE tokens.
 */
#define	TCB_FLAG_MASK	(TCB_INODE|TCB_FORMOD|TCB_SLAVE)

/*
 * Check the consistency of an inode's inode-token info.
 * There should be at most 1 token.
 * If there's a token, there should be at least one rqchain
 * entry, which should all point at the token.
 */
check_inode_token(ip)
register struct inode *ip;  /* Xlated pointer to inode w. non-null inode tcb. */
{
	register struct tok_ctrlb *tcbp;
	register struct tok_loci *tkp;
	register struct inode *tcbip;	/* Xlated ptr from tcb */

	tcbp = XLATE_TCB(ip->i_itcblnk);

	ASSERT((tcbp->tcb_flag & TCB_FLAG_MASK) == TCB_INODE, "inode token");
	ASSERT(tcbp->tcb_stat != TCB_FREE, "on inode");
	tcbip = XLATE_IP(tcbp->tcb_iptr);
#ifdef STEVE_SAYS_THIS_SHOULD_NOT_HAPPEN
	/* Prop inodes sometimes share normal inode's tokens? (empirical) */
	ASSERT(tcbip == ip || tcbip == XLATE_IP(tcbip->i_ilink),
		"tcb must point at inode");
#else
	ASSERT(tcbip == ip, "tcb must point at inode");
#endif
	ASSERT(!REF(tcbp), "dup");
	tkp = tcbp->tcb_rqchn;
	/*ASSERT(tkp != NULL, "inode token's site list");*/
	for ( ; tkp != NULL; tkp = tkp->tlci_chain) {
		tkp = XLATE_TLCI(tkp);
		ASSERT(tkp->tlci_tcb == ip->i_itcblnk, "inode token");
		ASSERT((tkp->tlci_stat&LCI_MASK)!=LCI_UNUSED, "inode token");
		/* Should I do this if its not the same token?? */
		SET_REF(XLATE_TCB(tkp->tlci_tcb));
	}
	ASSERT(REF(tcbp), "should have tlci chain");
	return flaws;
}


/*
 * Checks the consistency of either of the two fifo token lists for
 * an inode.
 */
check_fifo_tokens(ip, rawtcbp, val_under_mask)
struct inode *ip;	/* translated pointer to inode w. inode tcb. */
struct tok_ctrlb *rawtcbp; /* untranslated tcbp (i_f{r|m}tcblnk). */
int val_under_mask;	/* implies which token.. (FORMOD => i_fwtcblnk) */
{
	register struct tok_ctrlb *tcbp;	/* translated tcbp */
	register struct tok_ctrlb *master;	/* Ptr to master for chain. */
	register struct tok_loci *tkp;
	struct tok_loci *rawtkp;		/* Kernel mode pointer */
	int cnt;
#define	MAX_TCB		100	/* ?? max tcb's on one token list */

	/* save untranslated master ptr for back-ptr checks and later scans */
	master = rawtcbp;

	/*
	 * Scan down the master tcb and its slaves.
	 */
	for (cnt = 0; cnt++ < MAX_TCB && rawtcbp ; rawtcbp = tcbp->tcb_chain) {
		tcbp = XLATE_TCB(rawtcbp);
		if (rawtcbp != master) {
			val_under_mask |= TCB_SLAVE;
			ASSERT(tcbp->tcb_master == master,
				"slaves must point @ master");
		} else if (val_under_mask & TCB_SLAVE) {
			ASSERT(FALSE, "tcb loop on inode!");
			break;
		}
		ASSERT((tcbp->tcb_flag & TCB_FLAG_MASK) == val_under_mask,
			"file token");
		ASSERT(tcbp->tcb_stat != TCB_FREE, "on inode");
		ASSERT(!tcbp->tcb_iptr || XLATE_IP(tcbp->tcb_iptr) == ip,
			"back ptr");
		ASSERT(!REF(tcbp), "dup");
	}

	/*
	 * Now scan through the request chain on the master.
	 */
	tcbp = XLATE_TCB(master);
	for (rawtkp = tcbp->tcb_rqchn; rawtkp; rawtkp = tkp->tlci_chain) {
		tkp = XLATE_TLCI(rawtkp);
		ASSERT((tkp->tlci_stat&LCI_MASK)!=LCI_UNUSED, "file tkn");
		/* ?? Should I check that tlci_tcb is on tcb list? */
		SET_REF(XLATE_TCB(tkp->tlci_tcb));
	}
	/*
	 * Now scan through the tcb list again, checking that all are ref'd.
	 */
	rawtcbp = master;
	for (cnt = 0; rawtcbp && cnt++ < MAX_TCB ; rawtcbp = tcbp->tcb_chain) {
		tcbp = XLATE_TCB(rawtcbp);
		ASSERT(REF(tcbp), "file tcb needs tlci chain");
	}
	return flaws;
}

scan_tcb_flist()
{
	register struct tok_ctrlb *rawtcbp;	/* untranslated tcbp */
	register struct tok_ctrlb *tcbp;		/* translated tcbp */
	int cnt;

	rawtcbp = Ktcb_flist;
	for (cnt = 0; rawtcbp && cnt++ < 10000; rawtcbp = tcbp->tcb_chain) {
		tcbp = XLATE_TCB(rawtcbp);
		ASSERT(tcbp->tcb_stat == TCB_FREE, "on freelist");
		ASSERT(!REF(tcbp), "on freelist");
		SET_REF(tcbp);
	}
	return flaws;
}

scan_tcb_table()
{
	register struct tok_ctrlb *tcbp;
	register struct tok_loci *tkp;

	for (tcbp = tcb_table; tcbp < etcb_table; tcbp++) {
		if ( !REF(tcbp)
		  && tcbp->tcb_stat != TCB_FREE
		  && !(tcbp->tcb_flag & (TCB_SLAVE|TCB_INODE)) )
		{
			tkp = tcbp->tcb_rqchn;
			ASSERT(tcbp->tcb_iptr == NULL && tkp != NULL,
				"file tcb shouldn't have iptr");
			/*
			 * Normal file tokens aren't attached to the inode:
			 * they are pointed to by local AND REMOTE file
			 * table entries.
			 * We could check the file table here, but it wouldn't
			 * find remote file table entries, so don't bother.
			 */
			for (; tkp != NULL; tkp = tkp->tlci_chain) {
				tkp = XLATE_TLCI(tkp);
				ASSERT(XLATE_TCB(tkp->tlci_tcb) == tcbp,
					"inode token");
				ASSERT((tkp->tlci_stat&LCI_MASK)!=LCI_UNUSED,
					"inode token");
				SET_REF(XLATE_TCB(tkp->tlci_tcb));
			}
		}
	}
	for (tcbp = tcb_table; tcbp < etcb_table; tcbp++)
		ASSERT(REF(tcbp), "not ref'd anywhere!");
	return flaws;
}
/*####*/
kêì j  $        Ÿ  ?‰*j™ˆ*?‰*     R‘Ÿ  	                  ./usr/include/sys/jhframe.h  h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)jhframe.h	16.4	LCC)	/* Modified: 18:20:09 9/22/89 */


/*
jb net frame is:
	dst ip address
	src ip address
	 * subframe - contains an arbitrary sized chunk of a given remote
	 * port's output queue.
		src port id
		dst port id
		seq ack seq
		rcv window size
		size of chunk
		chunk...
 */

struct jbsubframe
{
	ushort	sf_size;	/* bytes in sf_data. */
	port_t	sf_dstport;	/* destination port */
	port_t	sf_srcport;	/* source port */
	ushort	sf_wind;	/* size of new window */
	seq_t	sf_seq;		/* beginning sequence number of these packets */
	seq_t	sf_ackseq;	/* sequence num this acks to */
	long	sf_flag;	/* retransmit required bit (long for padding) */
};


/* value of sf_size indicating that there aren't any more subframes in
 * this frame (and that data in this subframe header isn't otherwise valid).
 */
#define	SF_ENDFRAME	0xffff

/* bits in sf_flag */
#define	SFREXMT		0x01	/* send me some more data */
#define	SFAYT		0x02	/* Are You  There?... forces an ack */
#define	SFCLOSE		0x04	/* I am about to close */


/* Probably doesn't belong in this file */
/* This is the header of each packet as queued in the socket */
struct jbpkhdr
{
	ushort	pk_size;	/* number of bytes of data. */
	char	pk_control;	/* ack|syn|... control info */
	char	pk_rsvd;	/* reserved... */
	/* ...possibly followed by data */
};

#define	FLP_PKHDR(pkhp)	(pkhp)->pk_size = SHORTtoNET((pkhp)->pk_size)

/* arbitrary lower limit on number of bytes of data which must fit in
 * a subframe to justify adding it to the current frame...
 */
/* NEEDSWORK: is this really necessary: it is useful to send an ack even
 * if no data actually goes across.  */
#define MINPKDATA	(4 * sizeof(long))

/* definition of bits in pk_control */
/* NEEDSWORK: are pk_{control,rsvd} a waste? I don't know of any other
 * bits we will need... maybe open and close message bits?
 */
#define	PKCONT	0x01
#define	PKPUSH	0x02
#define	PKNOOP	0x04
#define	PKCLOSE	0x08
nkê6| i  $        ˜  ?‰*j™ˆ*?‰*     Q‘˜  	                  ./usr/include/sys/jhhost.h   h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)jhhost.h	16.4	LCC)	/* Modified: 18:20:43 9/22/89 */

#ifndef __IN_HEADER__
#include <in.h>
#endif /* __IN_HEADER__ */

/*
 * definition of a host table entry.
 */

struct jbhost
{
	struct jbhost	*h_next;	/* next host on same net or freelink */
	struct netsw	*h_netswp;	/* shouldn't be here? */
	struct jbsocket	*h_socklist;	/* list of sockets to host */
	struct in_addr	h_address;	/* host's internet address */
	short		h_flags;
};

extern struct jbhost	jbhosts[];
extern int		jbnumhosts;
extern struct jbhost	*jbhostbusy;	/* easy/lame lookup method... */
extern struct jbhost	*jbhostfree;

#define H_HASWORK	0x1		/* the host has work */
kêdš h  $          ?‰*k™ˆ*?‰*     R»  	              hc  ./usr/include/sys/jhsocket.h h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)jhsocket.h	16.4	LCC)	/* Modified: 18:21:19 9/22/89 */

/*
 * jbsocket.h:
 * This file describes the data-structures used to implement jordan's
 * simple reliable packet delivery protocol.
 */

/*
 * buffer/queue definition.  Packets to be sent or received
 * from the net are queued using this structure.
 * (This is a simple circular buffer scheme.  We may someday want
 * to do something more sophisticated.)
 */
struct queue
{
	char	*q_buf;		/* space for buffering */
	char	*q_head;	/* where to insert next in the queue */
	int	q_size;		/* size of q_buf */
	int	q_cnt;		/* number of bytes currently queued. */
};
#define	MAXQSIZE(qp)	((int)(qp)->q_size)

/*
 * structure used to implement a "sliding window" flow control/ack scheme.
 */
struct window
{
	seq_t	w_minseq;	/* min sequence number of output window */
	seq_t	w_curseq;	/* next sequence number to use */
	seq_t	w_size;		/* size of window-- minseq + size is maxseq. */
};

/*
 * A socket is one end of a unidirectional reliable sequential
 * packet stream.  This data structure describes all the state
 * information for either end of the socket pair.
 */
struct jbsocket
{
	struct jbsocket *s_next;	/* next socket to this host. */
	struct jbhost	*s_rhost;	/* remote host info */
	port_t		s_rport;	/* port number of remote end of pair */
	port_t		s_lport;	/* port id of this socket */

	/* interface info */
	int	(*s_asyncf)();		/* routine called when the state of
					 * the socket changes... (connect
					 * complete, new data, more room). */
	caddr_t	s_asyncarg;		/* arg passed (along with socket num)
					 * to s_asyncf.  */

	/* windowing/buffering information */
	struct queue	s_oqueue;	/* output queue */
	struct queue	s_iqueue;	/* input queue */
	struct window	s_owindow;	/* output window */
	struct window	s_iwindow;	/* input window */
	int		s_oresid;	/* amt of outgoing packet left */
	int		s_iresid;	/* amt of incoming packet left */

	time_t		s_lackto;	/* length... */
	struct callout	*s_ackto;	/* for delayed ack. */
	time_t		s_lreqto;
	struct callout	*s_reqto;	/* open window timeout */
	time_t		s_lrexmtto;
	struct callout	*s_rexmtto;	/* retransmit timeout */
	time_t		s_laytto;	/* (zero ==> don't do ayt) */
	struct callout	*s_aytto;	/* Are You There timeout */
#ifdef	CTO_ARG
	struct callout	s_ackTo;	/* to pass to ctimeout... */
	struct callout	s_reqTo;	/* to pass to ctimeout... */
	struct callout	s_rexmtTo;	/* to pass to ctimeout... */
	struct callout	s_aytTo;	/* to pass to ctimeout... */
#endif	/* CTO_ARG */

	short		s_reqretries;	/* number of request-retries so far */
	short		s_rexretries;	/* num retransmit-retries so far */
	short		s_aytretries;	/* num are-you-there retries so far */
	short		s_maxretries;	/* max retries before reporting via
					 * a call to asyncf. */
	
	short		s_state;	/* state... (see below) */
};

extern struct jbsocket	jbsockets[];
extern int		jbnumsockets;
extern struct jbsocket	*speclisten;
extern struct jbsocket	*wildlisten;
extern struct jbsocket	*jbsockfree;

/* s_state definitions */
#define	JBS_STATEMASK	0x0f
#define	JBS_CLOSED		0x00
#define	JBS_OPNING		0x01	/* socket being opened */
#define	JBS_OPEN		0x02	/* socket is open */
#define	JBS_CLSING		0x03	/* in the process of closing */
#define	JBS_ACKNEED	0x010	/* Owe this socket an ack */
#define JBS_ASKREXMT	0x020	/* need to request a retransmission */
#define JBS_ASKAYT	0x040	/* need to send "Are You There" msg */
#define JBS_XMTNEED	0x080	/* must transmit something/anything */
#define JBS_ACTIVE	0x100	/* socket is not free */
#define JBS_ICONT	0x200	/* iresid refers to a continued packet */

/* the part of s_state dealing with the user interface */
#define	JBS_SAWFULL	0x1000

/* codes passed to s_asyncf ... */
#define	JBSCONNECT	1	/* open/connect complete. */
#define	JBSCLOSED	2	/* close/disconnect complete */
#define	JBSDATAAVAIL	3	/* more data is available (read end only)...
				 * either has been stored, or can be read. */
#define	JBSOUTREADY	4	/* some data was taken by remote port, so we
				 * can queue some more */
#define	JBSRETRIES	5	/* exceeded retry limit for some operation. */
ID(@kêjw g  $        4  @‰*k™ˆ*@‰*     ý”4  	                  ./usr/include/sys/jhtypes.h  h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)jhtypes.h	16.4	LCC)	/* Modified: 18:21:54 9/22/89 */
#ifndef JHTYPES_H
#define JHTYPES_H
/*
 * special types for the jordan brown protocol.
 */

/* seq_t is the type used for sequence numbers... it must be a signed
 * type so that (a 'is before' b) can be coded (a - b < 0).
 */
typedef long	seq_t;

typedef	short	port_t;
#define	WILDPORT	((port_t)-1)
#define	MINPRIVPORT	1024
#define	MAXPRIVPORT	30000

typedef	short	host_t;		/* index into host table */

typedef	short	sock_t;		/* index into socket table */
#define	NOSOCK		((port_t)-1)

sock_t	jblisten();
sock_t	jbcall();

typedef	ushort	len_t;

#ifdef u370
#define	BIG_ENDIAN
#else /* !u370 */
#define	LITTLE_ENDIAN
#endif /* !u370 */
#ifdef BIG_ENDIAN
/* Little-endian is standard, need to flip. */
#define	SHORTtoNET(s)	( ((s)>>8 & 0xff) | ((s)&0xff)<<8 )
#define	NETtoSHORT(s)	SHORTtoNET(s)
#define	LONGtoNET(s)	( s>>24 & 0xff | s>>8 & 0xff00 | s<<8 & 0xff0000 | s<<24 & 0xff000000)
#define	NETtoLONG(s)	LONGtoNET(s)
#else /* LITTLE_ENDIAN */
/* the least-significant-byte-first order is the 'network standard' */
#define	SHORTtoNET(s)	((ushort)s)
#define	NETtoSHORT(s)	((ushort)s)
#define	LONGtoNET(s)	((long)s)
#define	NETtoLONG(s)	((long)s)
#endif /* LITTLE_ENDIAN */

#define	EQ_ADDR(a1, a2)		( a1.s_addr == a2.s_addr )

#endif /* JHTYPES_H */
_t		kêªí f  $        Œ?  @‰*l™ˆ*@‰*     ‚eŒ?  	              re  ./usr/include/sys/journal.h  h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)journal.h	16.4	LCC)	/* Modified: 18:22:31 9/22/89 */
/* SCCSIDPUFF(@(#) journal.h 4.3 LM 00:11:56 6/21/85 C 00:12:02 6/21/85); */

#ifndef _h_JOURNAL
#define _h_JOURNAL

#ifndef _h_TYPES
#ifdef KERNEL
#include <types.h>
#else /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~ _h_TYPES */

#ifndef _h_PARAM
#ifdef KERNEL
#include <param.h>
#else /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif /* ~ _h_PARAM */

/***************************************************************************
 *
 *                               journal.h
 *
 *      Data structures and constants used by the IX/370 journaling code.
 *
 ***************************************************************************/

		/* BASIC CONSTANTS */

#define JR_SPL()  spl6();       /* Highest spl level at which journal entries
				 * may be recorded. May never be less than spl6.
				 * Tradeoff: spl18 would allow everything to
				 * journaled, but would cause lots of journal
				 * code to completely disable the system.
				 * Actually, spl6 is the only value supported
				 * at the moment */

#define JR_NMASKS 1             /* number of mask words in jrs_masks */

#define JPRI	  40		/* journal process priority */

#define JRNSFN	"/dev/journal"	/* default journal output device */

/***************************************************************************
 *
 * The "journ_args" structure defines the arguments of the journal system
 * call.
 *
 ***************************************************************************/

struct journ_args {
					/* first 2 fields only for JRFILSYS op */
	caddr_t		jra_ufsm;	/* address of user buffer for fsmtbl */
	caddr_t		jra_ugfs;	/* address of user buffer for fsm2gfs */

	int             jra_op;         /* journal operation to be executed */
	int		jra_flags;	/* mode flags for journal operations */
	unsigned int    jra_count;      /* when doing a JRSTART with JRF_COUNT,
					 * how many blocks are to be written
					 * before stopping?     */
	long            jra_masks[JR_NMASKS];   /* bits to select what we'll
						 * actually journal on this run */
	dev_t		jra_dev;	/* dev on which to journal*/
	sitemap_t	jra_sites;	/* only netmessages from/to
					 * jra_sites are journaled      */
	char		jra_restrcts;	/* journaling is restricted to the
					 * specified events     */
} ;


	/* jra_op */
#define JRSTART  1              /* start event recording */
#define JRSTOP   2              /* wait for event recording termination */
#define JRFILSYS 3		/* return the fsmtbl contents to the user */


	/* jra_flags */
#define JRF_IMMED	0x00000001	/* Stop immediately */
#define JRF_COUNT	0x00000002	/* Journal only mjr_count
					   buffers before stopping */

	/* jra_restrcts */
#define JRR_IN         0x1             /* journal incoming messages */
#define JRR_OUT        0x2             /* journal outgoing messages */


/***************************************************************************
 *
 * The "jrstate" structure contains state information for the control of
 * journal recording. The different fields are initialized by the "jrstart"
 * routine.
 *
 ***************************************************************************/

struct	jrstate {
	int     jrs_running;            /* 0 = journal off, 1 = journal on */
	long	jrs_masks[JR_NMASKS];	/* masks indicating what is
					 * to be measured */

	/* pointer to allocated space for journal buffers, used by jrstop 
	 * to free the allocated space */
#ifdef u370
	caddr_t jrs_allocp;
#endif /* u370 */
#if	defined(__UNDEF__) || defined(i386)
	paddr_t jrs_allocp;
	paddr_t jrs_paddr;
#endif	/* defined(__UNDEF__) || defined(i386) */
	caddr_t jrs_firstbuf;           /* start of buffer pool, set by jrstart
					 * (journal.c) when space is allocated
					 * for the journalbuffers. */
	caddr_t jrs_next;		/* pointer to next entry to use */
	caddr_t jrs_pastend;		/* address of byte past end of usable
					 * portion of this buffer (note: last
					 * jretype size bytes are always kept
					 * free in case a skip or termination
					 * code is needed */
	int	jrs_bufindex;		/* number of current buf 0 base */
	unsigned int    jrs_remaining;  /* number of buffers we've got to write
					 * before terminating the journal */
	int     jrs_error;              /* error codes are left here
					 * asynchronously for pickup by jrstop */
	struct	buf *jrs_iobp;		/* pointer to the I/O buffer used
					 * for ongoing I/O. */
	dev_t	jrs_dev;		/* major/minor of journal device */
	int	jrs_semaphore;		/* if quiescing, wait to be posted
					 * on this flag when last measurement
					 * is in the buffer. */
	int	jrs_flags;		/* flags to indicate state of the
					 * measurement code */
	struct  proc *jrs_flshproc;     /* pointer to the proc struct of the
					 * journal device flusher process */
	sitemap_t jrs_sites;            /* only netmessages from/to
					 * jrs_sites are journaled */
	char    jrs_restrcts;           /* journaling is restricted
					 * to the specified events */
};

		/* jrs_flags */
#define JRSF_BUSY       0x0001          /* someone is in the measurement
					 * system call */
#define JRSF_STARTED    0x0002          /* we're between a start and a stop
					 * request (no more starts please) */
#define JRSF_RUNNING    0x0004          /* we are actually recording new entries
					 * in the journal buffers (note: the
					 * jrs_running boolean above is a copy
					 * of this-intended so in-line measurement
					 * code won't have to do time-consuming
					 * bit mask checking in jrs_flags */
#define JRSF_ENDED      0x0008          /* we have stopped recording new entries
					 * but have not yet closed up with a jrstop */
#define JRSF_OPEN       0x0010          /* journal device is open */
#define JRSF_PENDEND    0x0020          /* a jrstop is pending.  When this is on,
					 * jrs_semaphore must be signal'd when last
					 * entry is recorded (does not mean I/O is
					 * complete, just last entry is in buffer) */


		/* jrs_error */
#define JRE_OVERRUN     1               /* rate of measurements was too high so
					 * we overran the output device */
#define JRE_IOSTART	2		/* couldn't start write */
#define JRE_IOFAILS	3		/* IO encountered async. error */
#define JRE_NOSPACE	4		/* not enough memory to allocate journal
					 * buffer space */


extern  struct jrstate  jrstate;        /* so each includer of journal.h knows
					 * where to find the journal state. It
					 * really lives in journal.c */


/***************************************************************************
 *
 * The "jrdevt" structure defines the entry points for the special write
 * routines used by the journaling code and the type of the device used.
 * The "jrstart" routine (journal.c) looks through the table of "jrdevt"
 * structures and compares the "jrd_strategy" field with the "d_strategy"
 * field of the "bdevsw" entry determined by the "jra_dev" (struct journ_args)
 * argument of the journal system call. If a matching field is found, the
 * corresponding "jrd_jrwrite" routine is used to write the journal buffers.
 *
 ***************************************************************************/

struct jrdevt {
	int     (*jrd_strategy)();      /* address of normal write routine for dev X */
	int     (*jrd_jrwrite)();       /* address of special journal write
					 * routine for device X */
	int     (*jrd_jrflush)();       /* flusher routine to support asynchronous
					 * output, necessary only if no standard
					 * asynchronous routine is available */
	int	(*jrd_jrinit)();	/* special init routine needed on some
					 * journal devices */
	char    jrd_type;               /* type of the journaling device */
};


		/* jrd_type */
#define JRD_SEQ         0x1	/* output is strictly sequential e.g. tape */
#define JRD_WRAP        0x2	/* output space is limited and used in a
				 * circular way e.g. any disk filesystems */
#define JRD_FLUSH       0x4	/* a special flusher process must be started
				 * to guaranty asynchronous output. This
				 * process is forked by "jrstart" and stopped
				 * by "jrstop" */
#define JRD_REWND	0x8	/* device must be rewound after journal header
				 * has been read e.g. tape */
#define JRD_INIT	0x10	/* device has a special init routine */
#define JRD_1KBLK	0x20	/* block size of device is 1K */
#define JRD_4KBLK	0x40	/* block size of device is 4K */


/***************************************************************************
 *
 * The table of "jrdevt" structures is initialized when the following code
 * is included by "space.h". This is done only once in "conf.c". To add a new
 * journal write routine the following steps must be carried out
 *      - write an asynchronous write routine for the new device and integrate
 *        it into the driver
 *      - if no asynchronous output possible on this device write a flusher
 *        routine, to be executed by a special flusher process and integrate
 *        it into the driver
 *      - build a new "jrdevt" entry with the addresses and type of the new
 *        device routines
 *      - update JRDEVTYPES, the number of "jrdevt" structures defined
 *
 ***************************************************************************/

#ifdef u370
#define JRDEVTYPES 2
#ifdef CONFC
extern int nulldev();
extern int mtstrategy(), mtjwrite();
#ifdef DISKJOURNAL
extern int d370strategy(), d370jwrite(), d370jflush(), d370jinit();
#endif /* DISKJOURNAL */

struct jrdevt jrdevt[JRDEVTYPES] = {
/* jrd_strategy   jrd_jrwrite  jrd_jrflush  jrd_jrinit  jrd_type */
  {mtstrategy,  mtjwrite,  nulldev,     nulldev,    JRD_SEQ | JRD_REWND | JRD_4KBLK},		/* tape */
#ifdef DISKJOURNAL
  {d370strategy,  d370jwrite,  d370jflush,  d370jinit,  JRD_WRAP | JRD_FLUSH | JRD_INIT | JRD_4KBLK}	/* disk */
#endif /* DISKJOURNAL */
};
 
#endif /* CONFC */
#endif /* u370 */

#if 	defined(__UNDEF__) || defined(i386)
#define JRDEVTYPES 1
#ifdef CONFC
extern int nulldev();
extern int fdstrategy(), fdjwrite(), fdjflush(), fdjinit();

struct jrdevt jrdevt[JRDEVTYPES] = {
/* jrd_strategy   jrd_jrwrite  jrd_jrflush  jrd_jrinit  jrd_type */
  {fdstrategy,    fdjwrite,    fdjflush,    fdjinit,    JRD_WRAP | JRD_FLUSH | JRD_INIT | JRD_1KBLK}	/* floppy */
};
 
#endif /* CONFC */
#endif 	/* defined(__UNDEF__) || defined(i386) */

/***************************************************************************
 *
 * The "jrheader" structure is stored at the beginning of each journal
 * output device. It is read by "jrstart", which checks the "j_identifier"
 * field to identify valid journal devices. Any journal device must be
 * initialized by the "jrinit" command before it can be used by the journaling
 * routines. This command puts a standard "jrheader" at the beginning of the 
 * device.
 *
 ***************************************************************************/

		/* jrheader constants */
#define JR_IDENTIFIER	"IX/370 Journal Header"	/* whenever this string is changed
						 * the jrinit command must be recompiled
						 * and the actual length of this string 
						 * which is coded in the jrstart routine
						 * must be changed */
#define JR_IDLGTH       24              /* rounded to next double word boundary */
#define JR_SWAPSTAMP    0x01020304L     /* used to detect byte swapping problems */


struct jrheader {
	PADOPEN(jLt)
	long		J_byteswap;	/* allows the data reduction program to
					 * detect (and possibly handle) byte
					 * swapping problems. This field is set
					 * to JR_SWAPSTAMP by "jrstart" */
	long            J_masks[JR_NMASKS];	/* masks indicating what is
					         * to be measured */
	sitemap_t       J_sites;	/* only netmessages from/to
					 * jrs_sites are journaled */
	/* the next 3 fields are necessary only for JRD_WRAP type journal
	 * devices, they contain a dummy value for other device types */
	ulong		J_pgno;		/* number of pages on the journal dev */
	ulong		J_last;		/* address of the last journal buffer
					 * on the journal device */
	ulong		J_wrap;		/* wraparound count */

	ulong		J_id;		/* identification number for each
					 * journal run stored on one device */
	jrtime_t        J_time;		/* start time of this journal run */
	PADCLOSE(jLt, jLs, jLu)
#define j_byteswap	jLu.jLs.J_byteswap
#define j_masks		jLu.jLs.J_masks
#define j_sites		jLu.jLs.J_sites
#define j_pgno		jLu.jLs.J_pgno
#define j_last		jLu.jLs.J_last
#define j_wrap		jLu.jLs.J_wrap
#define j_id		jLu.jLs.J_id
#define j_time		jLu.jLs.J_time
#define NJLONGS	(sizeof(struct jLt)/sizeof(long))

	PADOPEN(jSt)
	siteno_t	J_siteno;	/* site number */
	PADCLOSE(jSt, jSs, jSu)
#define j_siteno	jSu.jSs.J_siteno
#define NJSHORTS	(sizeof(struct jSt)/sizeof(short))
	
	PADOPEN(jCt)
	char            J_identifier[JR_IDLGTH];        /* identifies this device
							 * as a valid journal dev */
	char            J_restrcts;     /* journaling is restricted to the
					 * specified events (see jra_restrcts) */
	char            J_type;         /* see jrd_type */
	PADCLOSE(jCt, jCs, jCu)
#define j_identifier	jCu.jCs.J_identifier
#define j_restrcts	jCu.jCs.J_restrcts
#define j_type		jCu.jCs.J_type
#define NJCHARS		(sizeof(struct jCt)/sizeof(char))
};

		/* j_next, j_last, j_wrap */
#define J_INFINIT       0xFFFFFFFFL     /* very large number used as dummy value */

/***************************************************************************
 *
 * The "jrentry" structure defines the fixed header, which stands at the
 * beginning of each journal entry. For an entry with no variables recorded
 * this structure maps the entire entry. If variables are recorded, they
 * follow this structure.
 *
 ***************************************************************************/

struct jrentry {
	long    jre_type;       /* what kind of entry is this? this must be
				 * the first field or else skip & end marks
				 * won't come out right */
	jrtime_t jre_time;      /* when did this event happen? */
	long	jre_len;	/* length of the journaled event, including 
				 * struct jrentry */
};


		/* jre_type */
/* here we define only two special types, all other types are defined in "journent.h" */
#define JRSKIPBUF   0xFFFFFFFEL /* this entry type means go on to next buffer */
#define JRLASTENTRY 0xFFFFFFFFL /* type field for the last entry in a journal file */

/* this constant is used as the effective size of the "jrentry" struct, and
 * it ensures timestamp alignment */
#define JRE_SIZE	roundup(sizeof(struct jrentry),sizeof(jrtime_t))

/***************************************************************************
 *
 * The "jrbufhdr" structure is inserted at the beginning of each journal
 * buffer. All buffers belonging to one journal run have the same id field
 * and increasing buffer numbers. This information is needed only on wraparound
 * type devices. It enables the analyzation program to read the journal buffers
 * in the correct sequence.
 *
 ***************************************************************************/

struct jrbufhdr {
	ulong		jrb_id;	/* this field must match with the j_id field
				 * of the journal header and is used to identify
				 * journal buffers belonging to a specific journal run */
	ulong		jrb_no;	/* sequence number of the journal buffer, used
				 * by the analyzation program to determine the 
				 * correct sequence of buffers */
};

		/* buffer constants */
/* WARNING: Whenever these constants are changed the journal buffer alignment
 * calculation in journal.c and jrnetmsg.c must be changed, too!!!!!!!
 */
#define NJOURNBUF   2           /* number of journaling buffers, unless the I/O
				 * support is enhanced for more elaborate
				 * multibuffering, 2 is the only size supported */
#define JOURNBUFSZ  (16*1024L)	/* size of each measurement buffer in bytes.
				 * Note that kernel space of size
				 * NJOURNBUF*JOURNBUFSZ is dynamically allocated
				 * when "jrstart" is called. The space is
				 * released by "jrstop".  This is the physical 
				 * size written to the journal file. */


#endif /* ~_h_JOURNAL */
		J_kê
ú e  $        W  @‰*l™ˆ*@‰*     dW  	                  ./usr/include/sys/journent.h h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */


#ifndef _h_JOURNENT
#define _h_JOURNENT
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)journent.h	16.4	LCC)	/* Modified: 18:23:05 9/22/89 */
/* SCCSIDPUFF(@(#) journent.h 4.3 LM 00:13:30 6/21/85 C 00:13:35 6/21/85); */

      /*----------------------------------------------------------*
       |                                                          |
       |                    Journal entry masks.                  |
       |                                                          |
       |        Real time recording of journal entries is         |
       |        controlled by a bit mask.  Since it may be        |
       |        desirable to have more than 32 different          |
       |        control bits, an array of mask words              |
       |        is available.  Each is defined as a long.         |
       |                                                          |
       |        To define a new activation category XXXX,         |
       |        create two defines below:                         |
       |                                                          |
       |        # define JRMW_XXXX n                              |
       |        # define JRMM_XXXX 0xYYYYYYYYL                    |
       |                                                          |
       |        where n is the index of the mask word to be       |
       |        checked for this category, and YYYYYYYY is        |
       |        a long constant with exactly one bit turned       |
       |        on.  JRMW_XXXX and JRMM_XXXX become the           |
       |        first two parameters to each entry definition     |
       |        in this activation category.                      |
       |                                                          |
       |        JRMW_---- may not exceed JR_NMASKS-1              |
       |                                                          |
       |                                                          |
       *----------------------------------------------------------*/

/* The following macros are used for the journaling of netmessages */

#define JRMW_NMIN   0                   /* incoming netmessages complete */
#define JRMM_NMIN   0x00000001L         /* (no data buffers)             */
#define JRT_NMIN    1
#define JRNMIN(site,a1,l1)              JRN_NMS(JRMW_NMIN,JRMM_NMIN,site,JRT_NMIN,a1,l1)

#define JRMW_NMOUT  0                   /* outgoing netmessages complete */
#define JRMM_NMOUT  0x00000002L         /* (no data buffers)             */
#define JRT_NMOUT   2
#define JRNMOUT(site,a1,l1)             JRN_NMS(JRMW_NMOUT,JRMM_NMOUT,site,JRT_NMOUT,a1,l1)

#define JRMW_NMPART 0                   /* selected parts of netmessages */
#define JRMM_NMPART 0x00000004L
#define JRT_NMPART  3
#define JRNMPART(restrcts,site,a1,l1)   JRN_NMRS(JRMW_NMPART,JRMM_NMPART,restrcts,site,JRT_NMPART,a1,l1)

#endif /* ~_h_JOURNENT */
bkê¾Â d  $        å	  @‰*m™ˆ*@‰*     Ú„å	  	                  ./usr/include/sys/journmac.h h h
/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)journmac.h	16.4	LCC)	/* Modified: 18:23:41 9/22/89 */
/* SCCSIDPUFF(@(#) journmac.h 4.3 LM 00:14:14 6/21/85 C 00:14:19 6/21/85); */

#ifndef _h_JOURNMAC
#define _h_JOURNMAC

#ifdef KERNEL
/**************************************************************************/
/*  									  */
/*            Macros to Record Journal Entries of Netmessages             */
/*									  */
/**************************************************************************/

/* The following macros are building blocks for the journal macros used in
 * the kernel code. They must be defined separately because the PC/AT C-compiler
 * cannot handle big macros.
 */

/* is journaling activated? */
#define JRT	(jrstate.jrs_running)

/* is mask bit set for this event? */ 
#define JRM(flagword,mask)	(jrstate.jrs_masks[flagword] & mask)

/* do the restrictions apply? */
#define JRR(restrcts)	(jrstate.jrs_restrcts & restrcts)

/* is site included in sitemap? */
#define JRS(site)	(sitmap(jrstate.jrs_sites,site))

/* call journal routine */
#define JRC(type,a1,l1)	jrn_010a(type,a1,l1);

      /*----------------------------------------------------------*
       |							  |
       |                     JRN_NMRS                             |
       | Journal macro including restriction-test and site-test.  |
       | Make sure that using this macro the restrictions are     |
       | consistent with the ones defined in meas.h.              |
       |                                                          |
       *----------------------------------------------------------*/

#define JRN_NMRS(f,m,r,s,t,a,l) { \
	register spl_t p; p = JR_SPL(); \
	if (JRT && JRM(f,m) && JRR(r) && JRS(s)) { JRC(t,a,l); } \
	splx(p); \
}

      /*----------------------------------------------------------*
       |							  |
       |                     JRN_NMS                              |
       | Journal macro including site-test.                       |
       |                                                          |
       *----------------------------------------------------------*/

#define JRN_NMS(f,m,s,t,a,l) { \
	register spl_t p; p = JR_SPL(); \
	if (JRT && JRM(f,m) && JRS(s)) { JRC(t,a,l); } \
	splx(p); \
}

#endif /* KERNEL */

#endif /* ~_h_JOURNMAC */
N  kêÌT r  $        ƒ  =‰*üšˆ*=‰*     Qƒ  	                  ./usr/include/sys/kbdpackutils.h  h  h  /***************************************************************************/
/*
/*	Filename:	utils.h
/*
/*	Author:		Richard A. Brachman
/*
/*	Description:	Contains structure definitions, masks and assorted
/*			macros for use with utils.c
/*
/***************************************************************************/

#ifndef H_UTILS
#define H_UTILS

#ifndef H_SCCSID
#include <sccs.h>
#endif	/* ! H_SCCSID */
H_SCCSID(@(#)kbdpackutils.h	1.2	AIX)	/* Modified: 9/16/89 22:24:34 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#define CLR_FLG(x)	(x) &= 0x00

/* masks for type of keys */
#define GRAPHIC_MSK	0x00
#define SINGLE_MSK	0x01
#define ESC_MSK		0x02
#define CNTL_MSK	0x03

/* macros to set type of key */
#define SETK_GRAPHIC(x)	(x) |= GRAPHIC_MSK	/* pointless, but be complete */
#define SETK_SINGLE(x)	(x) |= SINGLE_MSK
#define SETK_ESC(x)	(x) |= ESC_MSK
#define SETK_CNTL(x)	(x) |= CNTL_MSK

/* macros to query type of key */
/* If the type is not SINGLE, ESC or CNTL, then it is GRAPHIC */
#define GET_KEY_TYPE(x)	((x) & CNTL_MSK)
#define ISK_SINGLE(x)	(GET_KEY_TYPE((x)) == SINGLE_MSK)
#define ISK_ESC(x)	(GET_KEY_TYPE((x)) == ESC_MSK)
#define ISK_CNTL(x)	(GET_KEY_TYPE((x)) == CNTL_MSK)

/* masks for state of keys */
#define DEAD_MSK	0x00
#define NORM_MSK	0x04
#define CURS_MSK	0x08
#define CPFK_MSK	0x0c
#define NONEK_MSK	0x10

/* macros to set state of key */
#define SET_DEAD_ST(x)	(x) |= DEAD_MSK		/* pointless, but be complete */
#define SET_NORM_ST(x)	(x) |= NORM_MSK
#define SET_CURS_ST(x)	(x) |= CURS_MSK
#define SET_CPFK_ST(x)	(x) |= CPFK_MSK
#define SET_NONEK_ST(x)	(x) |= NONEK_MSK

/* macros to query state of key */
/* If the state is not NORM, CURS or CPFK, then it is DEAD */
#define GET_KEY_STATE(x)	((x) & 0x1c)
#define IS_ST_NORM(x)		(GET_KEY_STATE((x)) == NORM_MSK)
#define IS_ST_CURS(x)		(GET_KEY_STATE((x)) == CURS_MSK)
#define IS_ST_CPFK(x)		(GET_KEY_STATE((x)) == CPFK_MSK)
#define IS_ST_NONEK(x)		(GET_KEY_STATE((x)) == NONEK_MSK)

/* masks for action of caplock on key */
#define NO_CAPS_MSK	0x20
#define YES_CAPS_MSK	0x00

/* macros to set action of caplock on key */
#define NO_CAPS_LOCK(x)		(x) |= NO_CAPS_MSK
#define YES_CAPS_LOCK(x)	(x) |= YES_CAPS_MSK	/* pointless, but be complete */

/* macro to query action of caplock on key */
#define IS_CAPS_SET(x)	(!((x) & NO_CAPS_MSK))

/* masks for character code pages */
#define CHARP0_MSK	0x00
#define CHARP1_MSK	0x40
#define CHARP2_MSK	0x80
#define NO_CHAR_MSK	0xc0

/* macros to set character code pages */
#define SET_CHARP0(x)	(x) |= CHARP0_MSK	/* pointless, but be complete */
#define SET_CHARP1(x)	(x) |= CHARP1_MSK
#define SET_CHARP2(x)	(x) |= CHARP2_MSK
#define SET_NOCHAR(x)	(x) |= NO_CHAR_MSK

/* macros to query character code page */
/* If the code page is not CHARP1 or CHARP2, then it is CHARP0 */
#define GET_KEY_CHARP(x)	((x) & NO_CHAR_MSK)
#define IS_CHARP1(x)		(GET_KEY_CHARP((x)) == CHARP1_MSK)
#define IS_CHARP2(x)		(GET_KEY_CHARP((x)) == CHARP2_MSK)
#define IS_NOCHAR(x)		(GET_KEY_CHARP((x)) == NO_CHAR_MSK)

/* structure for compressed keymaps */
struct pack_key {
	unsigned char keyinfo;
	unsigned char keycode;
};

#endif
e anakêÚä c  $        Z  @‰*m™ˆ*@‰*     ØZ  	              w´  ./usr/include/sys/kcfg.h utils.h/*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/
/* H_SCCSID(@(#)kcfg.h	16.6	AIX)	Modified: 18:01:28 9/16/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#define CIOC    ('C' << 8)
#define CFRSTAT (CIOC | 1)          /* get status */
#define CFDCODE (CIOC | 2)          /* define code */
#define CFDDEV  (CIOC | 3)          /* define device */
#define CFUVRM  (CIOC | 4)          /* update vrm */
#define CFUDRV  (CIOC | 5)          /* configure unix device driver */
#define CFQDEV  (CIOC | 6)          /* query device */
#define CFBUFF  (CIOC | 7)          /* initialize BIOCA and define device */

#define DEVNAME 4           /* number of bytes used for device name  */
#define MIN_MDISK   16384   /* min minidisk iodn possible */
#define MAX_MDISK   32767   /* max minidisk iodn possible */
#define DRV_TYPE    0X1     /* bit value for device driver type */
#define SHR_TYPE    0X2     /* bit value for shared device type */
#define ADD_IODN    0X1     /* bit value for add iodn option */
#define DEL_IODN    0X2     /* bit value for delete iodn option */
#define ADD_IOCN    0X1     /* bit value for add iocn option */
#define DEL_IOCN    0X2     /* bit value for delete iocn option */
#define DUP_IOCN    0X4     /* bit value for duplicate iocn option */
#define Q_HRDW      0X1     /* bit value for query for hardware info */
#define Q_DEV       0X2     /* bit value for query for device info */
#define Q_RAS       0X4     /* bit value for query for RAS info */

/*
    the following are bit patterns used when determining minidisk 
    characteristics
*/
#define M_VTOC		0x8000	/* vtoc space */
#define M_BADBLK	0x4000	/* bad block space */
#define M_DUMP		0x2000	/* dump space */
#define M_DOS_EXT	0x1000	/* DOS EXTended partition */
#define M_DOS_16	0x0800	/* DOS 16-bit FAT */
#define	M_DOS_12	0x0400	/* DOS 12-bit FAT; THIS SUCKS! */
#define M_OURS		0x0200	/* either reserved or bad block - don't care */
#define M_UNKNOWN	0x0100	/* don't touch it, you don't own it! */
#define M_RSVD      0x0080	/* a minidisk created by maint */
#define M_LOW_POS   0x0040	/* low end disk position */
#define M_MID_POS   0x0020	/* middle disk position */
#define M_HIGH_POS  0x0010	/* high end disk position */
#define M_PAGING    0x0008	/* paging space */
#define M_UNIX_FS   0x0004 	/* unix file system */
#define M_UNIX_OS   0x0002	/* unix operating system */
#define M_AUTO_IPL  0x0001	/* auto ipl */

/*
    the following are bit patterns used when defining a minidisk
*/
#define DF_UNIX_FS  M_UNIX_FS   /* define as unix file system minidisk */
#define DF_UNIX_OS  M_UNIX_OS   /* define as unix operatins sys minidisk */
#define DF_IPL      M_AUTO_IPL  /* define as automatic ipl minidisk */

#define DF_BADBLK	M_BADBLK	/* defines for building bad block space */
#define DF_DUMP		M_DUMP		/* defines for building dump space */
#define DF_PAGING	M_PAGING	/* defines for building paging space */



/*
   structure needed for define code SVC  
*/
struct defcode {
    int iocn;         /* IOCN to define */
    int opts;         /* options word */
    int ciocn;        /* IOCN to copy */
};

/*
    structure needed for define device SVC
*/
struct defdev {
    unsigned short iodn;         /* IODN to use */
    unsigned short iocn;         /* IOCN to use */
    unsigned short opts;         /* add/delete */
    unsigned short chars;        /* device characteristics */
    char name[4];       /* device name */
    int spare;
    union {
	struct {
            int offhc;          /* offset to hardware characteristics */
            int offdc;          /* offset to device characteristics */
            int offras;         /* offset to RAS info */
	} offsets; 
        int ddi[1];         /* device dependent info */
    } ddi_data;
};

/*
    structure needed for send command SVC
*/
struct sc_data {
    int rv2;    
    int rv3;
    int rv4;
    int rv5;
    int rv6;
};    

/*
    structure to configure unix drivers
*/
struct unxdrv {
    dev_t   devno;      /* major/minor device number */
    unsigned short   iodn;       /* IODN to set */
    unsigned short   ddilen;     /* device dependent info length (in bytes) */
    unsigned short   lev;        /* interrupt level */
    union {
	char ddi_scs [1];
	struct sc_data ddi_sc;
    } ddi;
};

/*
    structure for query device SVC's
*/
struct qdev {
    unsigned short iodn;     /* IODN to query */
    unsigned short options;  /* Query device options */
    int length;              /* length of the following */
    char buffer[1];          /* info returned in here */
};


/*
    structure for query minidisk SVC
*/
struct qmini {
    unsigned short m_iodn;	/* iodn of minidisk */
    unsigned short r_iodn;	/* iodn of real disk */
    unsigned short chars;	/* device characteristics */
    char blsize;		/* block size */
    char spare;			/* not used */
    long sectors;		/* number of sectors */
    long blocks;	        /* number of blocks */
    char name[4];		/* name of minidisk */
    int date;			/* creation date */
};

/*
    structure for query real disk SVC
*/
struct qreal {
    unsigned short r_iodn;	/* iodn of real disk */
    unsigned short minis;	/* number of minidisks returned in qmini array*/
    long length;		/* length of real disk in sectors */
    int total;			/* total number of minidisks on the real disk */
    struct qmini qmini[50];	/* individual minidisk info */
};
e Q_HRkêlA ´  $          ^‰*>–ˆ*^‰*     çµ  	                  ./usr/include/sys/kernel.h ils.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)kernel.h	16.3	LCC)	/* Modified: 19:21:52 9/15/89 */

/*
 * Copyright (c) 1982, 1986 Regents of the University of California.
 * All rights reserved.  The Berkeley software License Agreement
 * specifies the terms and conditions for redistribution.
 *
 *	@(#)kernel.h	7.1 (Berkeley) 6/4/86
 */

/*
 * Global variables for the kernel
 */

long	rmalloc();

/* 1.1 */
#define MAXHOSTNAMELEN	64
extern long	hostid;
extern char	hostname[MAXHOSTNAMELEN];
extern int	hostnamelen;

/* 1.2 */
int	realitexpire();
ck sizekêÒå b  $        E
  @‰*m™ˆ*@‰*     ¶oE
  	                  ./usr/include/sys/kprof.h  ils.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)kprof.h	16.4	LCC)	/* Modified: 15:07:15 8/25/90 */
/* SCCSIDPUFF(@(#) kprof.h 3.1 LM 18:01:16 4/14/85 C 18:03:15 4/14/85); */

#ifndef _h_KPROF
#define _h_KPROF

/*
 * This include file defines constants for use with the kernel
 * profiling pseudo-device driver.  It did not come with system 5,
 * rather it was created to contain constants that were defined
 * in several programs and a kernel module.
 */

/*
 * The profiling table in the kernel contains an entry for each routine
 * that can be profiled.  The maximum size of this table is genned into the
 * kernel, setting a fixed upper limit on the number of routines that can
 * be profiled.  In practice, this limit should always be greater than
 * the number of routines in the kernel (including device driver and other
 * optional modules)
 */
#define PRFMAX	7000		/* maximum number of profilable routines */

/*
 * There are three IOCTL operations that can per performed on the
 * profiling pseudo-device.
 */
#define PRF_GSTAT 1		/* return current profiling status	*/
#define PRF_NSYM  2		/* return number of loaded symbol addrs */
#define PRF_ENABL 3		/* turn profiling on or off		*/

/*
 * the status information returned by the GSTAT ioctl is a word containing
 * a few bits of profiling state information.
 */
#define PRF_ON	1		/* profiling is enabled and running	*/
#define PRF_VAL 2		/* table of routine addresses is loaded */
#define PRF_CALLS 4		/* call counting is enabled and running */

/*
 * the NSYM ioctl returns the number of symbols currently loaded into the
 * symbol table.  The ENABL ioctl turns profiling on or off, depending on the
 * argument: PRF_ON turns profiling on; 0 turns profiling off.
 *
 * The table of routine addresses is loaded by doing a write to the pseudo-
 * device.  The buffer should contain the (sorted) addresses of the routines
 * to be profiled, and must contain PRFMAX or fewer addresses.
 *
 * The profiling statistics are collected by doing a read from the pseudo-
 * device.  The receiving buffer will contain NUMSYM addresses (where NUMSYM
 * is the number of loaded symbols) and NUMSYM+1 counters, the last counter
 * indicating the number of user-mode ticks.
 * If call counting is enabled, the buffer will contain an additional NUMSYM
 * counters, indicating the number of times each routine was called.
 */

#endif /* ~_h_KPROF */
ilekê¢~ a  $        ò  A‰*n™ˆ*A‰*     Ö¢ò  	                  ./usr/include/sys/larp.h   ils.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)larp.h	16.12	LCC)	/* Modified: 22:30:42 10/24/90 */

#define LARP_VERSION	3

/* This version of larp supports no more than 2 gateways, hence 3 hops. */
#define	MAX_HOPS	3

/*
 * unit of information about mapping of sites to addresses.
 * (this structure gets sent across the net.  Be careful of padding.
 */
struct larp_info {
	struct in_addr	li_path[MAX_HOPS];	/* complete path (reversed) */
	struct in_addr	li_dest;	/* where the interface goes */

	siteno_t	li_siteno;
	u_short		li_unused;	/* padding for alignment */

	unsigned char	li_base_cost;	/* cost of path to site */
	unsigned char	li_flags;	/* see defines below */
	unsigned char	li_hops;	/* hops to site via this path */
	unsigned char	li_age;		/* larp_watch ticks since SUSPECTED */
};
/* Simplify getting ultimate destination */
#define li_addr li_path[0]

/*
 * Values stored in li_flags (aka lli_flags)
 * Some flags may be valid locally but not set, others are sent but never
 * kept in the local entry (hence LOCAL_FLAGS & NET_FLAGS).
 * These two are both sent and kept locally.
 */
#define LARP_NETWORK	0x1	/* li_dest is a network */
#define	LARP_SUSPECT	0x2	/* Larp entry has given us problems. */

/* Flags which are sent but never kept locally */
#define LARP_GATEWAY	0x4	/* Originator can act as a gateway */
#define	NET_FLAGS	(LARP_GATEWAY)

/* Set of flags which are never xmitted. */
#define	LOCAL_FLAGS	0x00	/* (None yet) */

/* The set of flags which are valid in both network and local larp entries */
#define	COMMON_FLAGS	(~(NET_FLAGS|LOCAL_FLAGS))


/*
 * Maximum value for the li_base_cost field.  This is absurdly huge,
 * but we just want to make sure we avoid wrapping.
 */
#define	COST_MAX	100

/*
 * Table for storing information about sites & their addresses.
 * These entries are hung off of the site table via si_larp.
 * The job of LARP is to keep this table as full (and up to date)
 * as possible.
 */
struct loc_larp_info {
	struct loc_larp_info   *lli_next;
	struct larp_info	lli_info;
	u_long			lli_transmits;	/* total transmissions */
	u_char 			lli_retrans;	/* consecutive retrans */
};

/* For easy access: */
#define	lli_siteno	lli_info.li_siteno
#define	lli_base_cost	lli_info.li_base_cost
#define lli_flags	lli_info.li_flags
#define lli_dest	lli_info.li_dest
#define lli_age		lli_info.li_age
#define lli_hops	lli_info.li_hops
#define lli_path	lli_info.li_path
#define lli_addr	lli_info.li_addr

#define	MAX_LLI_RETRANS	254	/* Maximum allowable value for lli_retrans */
#define MAX_SUSPECT_AGE	12	/* Maximum age of a suspect larp entry. */
				/* (about 1 minute).*/

/* Header prepended to the larp_info table when sent across the net. */
struct larp_hdr {
	u_long	 l_cluster;	/* TCF cluster id */
	ushort	 l_num_ent;	/* Number of entries in this larp packet */
	siteno_t l_locsite;	/* N.B. padding demands that this be a short */
	u_char	 l_tcf_vers;	/* TCF version */
	u_char   l_larp_vers;	/* LARP version */
	u_char	 l_opcode;	/* Request/Response */
	u_char   l_pad;		/* Unused byte (padding) (always zero). */
};

/*
 * Values of the opcode field in the larp header.
 */
#define	L_REQUEST	0x0
#define	L_RESPONSE	0x1


/*
 * An Actual larp packet (though we don't use this definition to access it):
 *   struct larp_packet {
 *	struct larp_hdr lp_hdr;
 *	struct larp_info[lp_hdr.l_num_ent];
 *   };
 */

/*
 * Set the time to live to something reasonable;
 */
#define LARP_TTL	15


/*
 * Statistics kept about the locus_arp protocol's behaviour.
 */
struct larp_stats {
	unsigned long larp_requests;
	unsigned long kick_larps;
	unsigned long larp_inputs;
	unsigned long teach_responses;
	unsigned long new_info_kick;
	unsigned long route_checks;	/* messages sent to checkout channels */
	unsigned long loops_detected;
};

#ifdef KERNEL
extern struct larp_stats larp_stats;
#endif /*KERNEL*/
minor kê@Ç `  $        ý  A‰*¬™ˆ*A‰*     U‰ý  	                  ./usr/include/sys/linenum.h ls.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985-86, 1989, 1991 IBM Corp.
 *	(c) Copyright 1983-86, 1989, 1991 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)linenum.h	16.4	LCC)	/* Modified: 19:36:10 11/12/91 */
/* SCCSIDPUFF(@(#) linenum.h 4.1 LM 12:53:29 4/23/85 C 22:12:42 4/23/85); */
#ifndef	_h_LINENUM
#define	_h_LINENUM

/*	@(#)linenum.h	2.1	*/
/*  There is one line number entry for every 
    "breakpointable" source line in a section.
    Line numbers are grouped on a per function
    basis; the first entry in a function grouping
    will have l_lnno = 0 and in place of physical
    address will be the symbol table index of
    the function name.
*/
struct lineno
{
	union
	{
		long	l_symndx ;	/* sym. table index of function name
						iff l_lnno == 0      */
		long	l_paddr ;	/* (physical) address of line number */
	}		l_addr ;
	unsigned short	l_lnno ;	/* line number */
} ;

#define	LINENO	struct lineno
#define	LINESZ	6	/* sizeof(LINENO) */
#define	LINE_PSEUDO_ENTRY	65535L	/* Line entry count for section      */
									/*  header marking first line entry  */
									/*  as pseudo line count entry       */

#endif /* ~_h_LINENUM */
T_Fkê¬š ^  $        s  A‰*n™ˆ*A‰*     »s  	                  ./usr/include/sys/lock.h .h ls.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif  /* ~H_SCCSID */
H_SCCSID(@(#)lock.h	16.3	LCC)	/* Modified: 18:04:53 9/16/89 */
#ifndef _h_LOCK
#define _h_LOCK

/*
 * flags for locking procs and texts
 */
#define	UNLOCK	 0
#define	PROCLOCK 1
#define	TXTLOCK	 2
#define	DATLOCK	 4
/*
 * The following values are kept in u_lock, and are inherited,
 * These should be moved to another variable, when practical.
 */
#define	DIR_REAL	0x8		/* directory modes: should be moved */
#define	DIR_SYS5LOOK	0x10		/* directory modes: should be moved */
#ifdef  RESSUP
/*
**	following are used in calls to pgfix()
*/
#define	PGFIX	1
#define	PGFREE	0
#endif  /* RESSUP */
#endif /* ~_h_LOCK */
= 0  kêtÁ ]  $        ’  A‰*o™ˆ*A‰*     »’  	              t  ./usr/include/sys/lockf.h h ls.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)lockf.h	16.5	LCC)	/* Modified: 14:50:57 1/13/90 */

/* H_SCCSIDgen1(@(#)lockf.h	11.19	LCC)/* Modified: 14:07:20 10/18/88 */

/*
 *
 * NAME:        lockf.h
 *
 * PURPOSE:     This file provides declarations associated with the lockf()
 *              system call.
 *
 */

#ifndef _h_LOCKF
#define _h_LOCKF

#ifndef _PARAM_
#ifdef KERNEL
#include <param.h>
#else /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif /* ~_PARAM_ */

#ifndef _h_UNISTD
#include <unistd.h>
#endif

#if !defined(_h_stat) && !defined(KERNEL)
/*
 * Include stat.h for S_ENFMT
 */
#include <sys/stat.h>
#endif /* ~_h_STAT && ~KERNEL */


/* The following are used internally by read/write on files with enforced
 * locks or internally by the fcntl() system call.  They cannot be
 * specified in the lockf() system call.
 */
#define F_TESTWAIT  4   /*  Wait for record to be unlocked, but don't lock it */
#define F_GETLOCK   5   /*  Return a locked region (for F_GETLK fcntl) */
#define F_ENFCHECK  6   /*  Check for enforced locks */
#define F_DOSSHARE  7   /*  Set DOS file sharing mode */
#define F_NFSENFCHECK 8	/*  Check for enforced locks on exported NFS file */

/* These are the different types of locks, specified internally through the
 * lockf, locking and fcntl system calls.
 */
#define	F_RLOCK		0x10	/* Shared lock, permits other shared locks */
				/* Even if enforced, it permits reading. */
#define	F_WLOCK		0x20	/* Exclusive lock, permits no other locks */
				/* When enforced, doesn't permit other process
				 * to read or write locked region. */
#define	F_ENFORCED	0x40	/* Lock is enforced */
#define F_DOS	        0x80	/* Special dos-style lock */

#define F_RENFLOCK	(F_RLOCK | F_ENFORCED)
#define F_WENFLOCK	(F_WLOCK | F_ENFORCED)
#define F_ENFRDLCK	(F_RLOCK | F_ENFORCED | F_DOS)
#define F_ENFWRLCK	(F_WLOCK | F_ENFORCED | F_DOS)
#define	F_LOCKMODE	(F_RLOCK | F_WLOCK | F_ENFORCED | F_DOS)

/*
 * the following values are not kept in lock records - they
 * are only used as additional argument flags for interpreting
 * the key and pid fields of a lock
 */
#define F_US		0x100	/* this is a using site lock (or US&SS) not SS*/
#define F_DSLOCK	0x200	/* pid and pid1 form a DS-type key */
#define F_NFSLOCK	0x400	/* pid and pid1 form a NFS-type key */
#define F_BSDLOCK	0x800	/* this is a bsd flock lock */
#define F_AUXMODE	(F_US | F_DSLOCK | F_NFSLOCK | F_BSDLOCK)

/* The following definitions are used when testing for enforced locks
 * since all locks are not necessarily enforced for all other processes.
 */
#define F_MYWLOCK	F_WLOCK
#define F_MYRLOCK	F_RLOCK

/* The largest range which can be used in DOS-locking */
#define FCHR_MAX_UNSIGN	((u_long)0xffffffff)


struct	nfs_flock {
	short		l_type;
	short		l_whence;
	long		l_start;
	long		l_len;
	unsigned long	l_sysid;	 /* must be zero */
	pid_t		l_pid;		 /* must be zero */
	long		l_key;		 /* remote pid */
};

#ifdef KERNEL
#define NULLFLOCK ((struct flock *)NULL)

extern  void  systlock(); /*  Global lock tester                          */
extern  void  sysulock(); /*  Global unlock function                      */
extern	void  clslock();  /*  Process termination unlock routine 	  */

#define BSDKEY(fp)	(((u_long)loc_site << 16)|((fp)-file))
#endif /* KERNEL */

/*
   the following structure defines the contents of the "variable" part
   of the netmsgs which get sent for remote using site lockf (USLOCKF) and
   storage site lockf (SSLOCKF) messages
*/
struct nmlockf
{
	PADOPEN(NLKlongs)
	gfs_t		Nlk_gfs;    /* gfs of file to be acted on */
	ino_t		Nlk_inum;   /* inum of file to be acted on */
	u_long		Nlk_lob;    /* low record boundary */
	u_long		Nlk_hib;    /* high record boundary */
	long		Nlk_key;    /* key for lock - remote pid or other */
	pid_t		Nlk_pid;    /* pid holding lock */
	PADCLOSE(NLKlongs, xNLKlongs, xUNLKlongs)
#define	nlk_gfs		xUNLKlongs.xNLKlongs.Nlk_gfs
#define	nlk_inum	xUNLKlongs.xNLKlongs.Nlk_inum
#define	nlk_lob		xUNLKlongs.xNLKlongs.Nlk_lob
#define	nlk_hib		xUNLKlongs.xNLKlongs.Nlk_hib
#define	nlk_key		xUNLKlongs.xNLKlongs.Nlk_key
#define	nlk_pid		xUNLKlongs.xNLKlongs.Nlk_pid
#define	NNLKLONGS	(sizeof(struct NLKlongs) / sizeof(long))

	PADOPEN(NLKshorts)
	short		Nlk_swindex; /* index into rmt_slp/rmt_wakeup */
	short		Nlk_oflag;   /* operation flag */
	PADCLOSE(NLKshorts, xNLKshorts, xUNLKshorts)
#define	nlk_swindex	xUNLKshorts.xNLKshorts.Nlk_swindex
#define	nlk_oflag	xUNLKshorts.xNLKshorts.Nlk_oflag
#define	NNLKSHORTS	(sizeof(struct NLKshorts) / sizeof(short))
};

/* If the following statement causes a compiler warning or error,
 * then the length of the nmlockf structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMLF, nmlockf);
#endif /* _h_LOCKF */
followkêb€ Å  ÿ¡             v‰*v‰*v‰*          	                  ./usr/include/sys/lockmgr.h ls.h../rpc/lockmgr.hkê6´ \  $        ¨  B‰*o™ˆ*B‰*     h|¨  
                  ./usr/include/sys/low.h #include <sccs.h>
SCCSID(@(#)low.h	16.3	LCC)	/* Modified: 18:06:36 9/16/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _h_LOW
#define _h_LOW

#ifdef	VRM
#include <sys/types.h>

/*
 * VM page 0 data - these definitions should be used only if defining
 * in low.s and in a .h (tracechan is an example) runs too slow.
 * For a more complete map of page 0 see VRM Tech Ref.
 */

#define FREESLTS (*(uint *)     0xB8)   /* free paging disk slots */
#define PGCYCLES (*(uint *)     0xBC)   /* page replacement cycles */
#define PGFAULTS (*(uint *)     0xC0)   /* page faults w/ preemption */
#define NONPDIOS (*(uint *)     0xC4)   /* non-paging disk IOs */

#define FPTYPE  (*(char *)      0xCC)   /* FPA type, set by VRM */
#define IRP     (*(ushort *)    0xD4)

#define PS      (*(ushort *)    0xE2)
#define ELEV    (*(short *)     0xE4)   /* execution level */
#define VMID    (*(short *)     0xE6)   /* virtual machine id */

#define RTIMER  (*(time_t *)    0xF0)

#define TIMEINV (*(long  *)     0xF8)

#define CTABPTR (*(long  *)    0xC80)	/* pointer to default collate table */

#endif	/* VRM */
#endif	/* _h_LOW */
kêÜŽ [  $        1  B‰*¬™ˆ*B‰*     ¦¤1  
                  ./usr/include/sys/lprio.h h ls.h/* @(#)lprio.h	4.2 86/08/14 16:12:28 */
/* H_SCCSID(@(#)lprio.h	16.4	LCC)	/* Modified: 16:54:40 9/19/91 */
/* H_SCCSIDgen1(@(#)lprio.h	1.5	LCC)	/* Modified: 14:55:45 10/13/88 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _h_TERMIO
#ifdef KERNEL
#include <termio.h>
#else /* ~KERNEL */
#include <sys/termio.h>
#endif /* ~KERNEL */
#endif /* _h_TERMIO */

#ifndef _h_IOCTL
#ifdef KERNEL
#include <ioctl.h>
#else /* ~KERNEL */
#include <sys/ioctl.h>
#endif /* ~KERNEL */
#endif /* _h_IOCTL */

struct lprio {
	int     ind;            /* indent value */
	int     col;            /* maximum character count */
	int     line;           /* maximum line count */
};

struct lprmode {
	int     modes;          /* optional line printer modes */
};

	/* option flags */
#define PLOT    01
#define NOCL    02      /* no cr/lf */
#define	NOFFCLOSE	04	/* no form-feed on printer close */
#define NOFF    0400
#define NONL    01000
#define NOTB    02000
#define NOBS    04000
#define NOCR    010000
#define CAPS    020000
#define WRAP    040000


#define LPR     ('l'<<8)
#define LPRGET  (LPR|01)
#define LPRSET  (LPR|02)
#define LPRGETV (LPR|05)
#define LPRSETV (LPR|06)

/*  IBM additional ioctl's   */

#define LPRVRMG (LPR|10)
#define LPRVRMS (LPR|11)
#define LPRUGES (LPR|12)
#define LPRUFLS (LPR|13)
#define LPRURES (LPR|14)
#define LPRGMOD (LPR|15)
#define LPRSMOD (LPR|16)
#define LPRGETA (LPR|17)
#define LPRSETA (LPR|18)
#define LPRGTOV (LPR|19)
#define LPRSTOV (LPR|20)

/* Line printer line discipline additional ioctl */

#define LPRTTY (LPR|21)


/* optional printer modes */
struct oprmode {
	int flags;
};
#define LPRSYNC      0x01
#define LPRALLERR    0x02
#define LPRFONTINIT  0x04
#define SLOWPRNT     0x08


/* error reporting structure */
struct LPRUDE
{       int       status;       /* error reason code */
	int       cresult;      /* current operation result :PSB */
	int       tadapt;       /* adapter type */
	int       npio;         /* number pending IO operations */
};

	/* status values - error reason codes */

#define LPRPOUT  01      /* printer out of forms - intervention req'd */
#define LPRPTIM  0400    /* timeout - intervention required */
#define LPRPERR  01000   /* unspec. internal error - intervention req'd */
#define LPRTERR  02000   /* transmission error */
#define LPRINIT  04000   /* adapter initialization failed */
#define LPRADAP  010000  /* adapter not present */
#define LPRSOFT  020000  /* software error */
#define LPRREAD  040000  /* read error */


	    /* types of adapter */

#define LPRPARALLEL        01
#define LPRSERIAL          02

/* RS232 parameter change structure for LPRGETA and LPRSETA */

struct lpr232 {
	unsigned c_cflag;
};

/* variable timeout value change structure for LPRGTOV and LPRSTOV */
struct lptimer {
	unsigned v_timout;
};
he largkêªä Z  $        ;  B‰*o™ˆ*B‰*     ,n;  
                  ./usr/include/sys/machinfo.h s.h/*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/
/*
 *	@(#)machinfo.h	1.2
 *
*	(c) Copyright 1987, 1989 Locus Computing Corporation
 *	All Rights Reserved
 *
 *	this file defines information that can be used to figure out what
 *	sort of machine and configuration we are running on.  It is intended
 *	to be used in kernels that are supposed to run on multiple different
 *	models of fundamentally similar machines.
 *
 *	for any given architecture, the particular macros and values are 
 *	highly machine dependent, but the notion of having this sort of
 *	information is probably machine independent
 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)machinfo.h	1.2    IBM AIX)    /* Modified: 20:01:51 7/15/92 */

#ifndef _h_MACHINFO
#define _h_MACHINFO

/* Type declaration for mach_info structrue */
extern struct mach_info
{	long	mach_type;		/* type of CPU and box */
	long	mach_options;		/* special options on this processor */
	long	cpu_level;		/* CPU revision level	*/
	long	mach_level;		/* machine revision level */
	long	mach_serial;		/* machine serial number */
} mach_info;

#ifdef i386
#ifndef KERNEL
/* function in librts that fills mach_info structure */
extern int _get_mach_info();
/*
 * Macro to initialize mach_info structure so macros work in
 * system and application programs.
 */
#define GET_MACH_INFO() _get_mach_info()
#endif /* !KERNEL */

/* macros to make sense out of a PC machine type */
#define	PC_BOX(cpu,arch,model)	((cpu << 16L) + (arch << 8) + model)
#define	PC_CPU(type)		((type >> 16) & 0xffff)
#define	PC_ARCH(type)		((type >> 8) & 0xff)
#define PC_MODEL(type)		(type & 0xff)

/* defined PC machine types */
#define	PC_AT	PC_BOX( 286, 1, 0 )		/* PC/AT */
#define PC_386	PC_BOX( 386, 1, 0 )		/* 386 AT clones */
#define PS2_50	PC_BOX( 286, 2, 50 )		/* PS/2 model 50 */
#define PS2_55	PC_BOX( 386, 2, 55 )		/* PS/2 model 55, not PS/55 */
#define PS2_57_OR_56  PC_BOX( 386, 2, 57 )	/* PS/2 model 57 OR 56 */
#define PS2_60	PC_BOX( 286, 2, 60 )		/* PS/2 model 60 */
#define	PS2_70	PC_BOX( 386, 2, 70 )		/* PS/2 model 70 */
#define PS2_77_OR_76  PC_BOX( 386, 2, 77 )	/* PS/2 model 77 OR 76 */
#define PS2_80	PC_BOX( 386, 2, 80 )		/* PS/2 model 80 */
#define PS2_90	PC_BOX( 386, 2, 90 )		/* PS/2 model 90 */
#define PS2_95	PC_BOX( 386, 2, 95 )		/* PS/2 model 95 */
#define PS2_35	PC_BOX( 386, 1, 35 )		/* PS/2 model 35 OR 40 */

/* options that can be associated with a machine	*/
#define OPT_2KNVRAM	0x00000001	/* this machine has 2K nvram	*/
#define OPT_TIMER_LATCH	0x00000002	/* timer 0 latch, such as MCA machine */
#define OPT_DELAY_PORT	0x00000004	/* I/O delay port on some PS/2s	*/
#define OPT_PS2_MOUSE	0x00000008	/* PS/2 type mouse port		*/
#define OPT_PS2_ISABUS	0x00000010	/* PS/2 ISA bus machine		*/
#define	TYP_MICRO_CHAN	0x00000200	/* Micro Channel architecture	*/

/* macros to answer basic questions about '86 boxes */
#define HAS_2K_NVRAM()		(mach_info.mach_options & OPT_2KNVRAM)
#define HAS_TIMER_LATCH()	(mach_info.mach_options & OPT_TIMER_LATCH)
#define HAS_DELAY_PORT()	(mach_info.mach_options & OPT_DELAY_PORT)
#define HAS_PS2_MOUSE()		(mach_info.mach_options & OPT_PS2_MOUSE)
#define HAS_PS2_ISABUS()	(mach_info.mach_options & OPT_PS2_ISABUS)
#define HAS_MICRO_CHAN()	(mach_info.mach_type & TYP_MICRO_CHAN)

/* macros for 386 chip levels				*/
#define B1_386		(0x303)		/* dh,dl id bytes for 80386 B1 step */
#define C0_386		(0x304)		/* dh,dl id bytes for 80386 C0 step */
#endif /* i386 */

#endif /* !_h_MACHINFO */
 d* Ükêî Y  $        ”  B‰*p™ˆ*B‰*     )n”  
                  ./usr/include/sys/maindefs.h s.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)maindefs.h	16.3	LCC)	/* Modified: 18:09:05 9/16/89 */
/* SCCSIDPUFF(@(#) maindefs.h 4.1 LM 12:53:48 4/23/85 C 22:12:45 4/23/85); */

#ifndef _h_MAINDEFS
#define _h_MAINDEFS

/*
	These defines are opcodes to the system start svc.
**/

#define	IC_MAIN		0x1	/* do mdprocstartup */
#define IC_INIT		0x2	/* start init */
#define IC_SVRPROC	0x3	/* run a svrproc */
#define IC_TOPCHG	0x4	/* run topchg() */
#define IC_PROPIN	0x5	/* run propin() */
#define IC_SIGNET	0x6	/* run the signet daemon */

#define IC_PRINT	0x10	/* print a string on the console */
#define IC_READ		0x11	/* read a line from the console */

#endif /* ~_h_MAINDEFS */
_MACkê\Ç X  $        æ	  B‰*S–ˆ*B‰*     næ	  	                  ./usr/include/sys/map.h /*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)map.h	16.3	LCC)	/* Modified: 20:02:21 9/15/89 */

/*
 * Resource Allocation Maps.
 *
 * Associated routines manage sub-allocation of an address space using
 * an array of segment descriptors.  The first element of this array
 * is a map structure, describing the arrays extent and the name
 * of the controlled object.  Each additional structure represents
 * a free segment of the address space.
 *
 * A call to rminit initializes a resource map and may also be used
 * to free some address space for the map.  Subsequent calls to rmalloc
 * and rmfree allocate and free space in the resource map.  If the resource
 * map becomes too fragmented to be described in the available space,
 * then some of the resource is discarded.  This may lead to critical
 * shortages, but is better than not checking (as the previous versions
 * of these routines did) or giving up and calling panic().  The routines
 * could use linked lists and call a memory allocator when they run
 * out of space, but that would not solve the out of space problem when
 * called at interrupt time.
 *
 * N.B.: The address 0 in the resource address space is not available
 * as it is used internally by the resource map routines.
 */

struct  allmapents
{
	union
	{
		struct  mapent  * UAL_mlimit;
		rmap_t  UAL_msize;
	} UAL_one;
	union
	{
		char  * UAL_mname;
		rmap_t  UAL_maddr;
	} UAL_two;
};

struct  map
{
	struct  allmapents  M_map;

#define m_limit		M_map.UAL_one.UAL_mlimit
#define m_name		M_map.UAL_two.UAL_mname
};

struct  mapent
{
	struct  allmapents  M_map;
#define m_size		M_map.UAL_one.UAL_msize
#define m_addr		M_map.UAL_two.UAL_maddr
};

#ifdef  KERNEL

extern  struct	map *swapmap;

#define	ARGMAPSIZE	16
extern  struct	map *argmap;

#if	defined(PAGING) || defined(SWAPPING)
extern  struct	map *kernelmap;
#endif  /* (PAGING || SWAPPING) */

#ifdef	b370
#ifdef	SVPAGING
extern	struct	map *sptmap;
#else	/* ~SVPAGING */
extern	struct	map *pt370map;
#endif	/* ~SVPAGING */
#endif	/* b370 */

extern struct	map *mbmap;

#if	defined(i386)
extern struct	map *coremap;
#endif	/* (i386) */

extern  rmap_t  rmalloc();

#if	defined(PAGING) || defined(SWAPPING) || defined(i386)
extern  rmap_t  rmget();
#endif	/* (PAGING || SWAPPING || i386) */

#endif  /* KERNEL */
opkê(¶ ³  $        ­  _‰*>–ˆ*_‰*     ±e­  	              ßµ  ./usr/include/sys/mbuf.h s.h s.h/*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)mbuf.h	16.3.1.2	LCC)	/* Modified: 19:34:06 11/5/90 */

/*
 * Copyright (c) 1982, 1986 Regents of the University of California.
 * All rights reserved.  The Berkeley software License Agreement
 * specifies the terms and conditions for redistribution.
 *
 *	@(#)mbuf.h	7.1 (Berkeley) 6/4/86
 */

/*
 * Constants related to memory allocator.
 */
#define	MSIZE		128			/* size of an mbuf */

#define	MMINOFF		12			/* mbuf header length */
#define	MTAIL		4
#define	MMAXOFF		(MSIZE-MTAIL)		/* offset where data ends */
#define	MLEN		(MSIZE-MMINOFF-MTAIL)	/* mbuf data length */

/*
 * NMBCLUSTERS is now a patchable parameter on AIX PS/2 and 370 systems.
 * The value can be found in /etc/master and is configurable by modifying
 * /etc/system with the the keyword 'mbclusters'.
 */

#define	NMBPCL		(CLBYTES/MSIZE)		/* # mbufs per cluster */

/*
 * Macros for type conversion
 */

/* NEEDSWORK:THis is NOT how SVPAGING shoudl work */
/* network cluster number to virtual address, and back */
#define	cltom(x) ((struct mbuf *)((u_long)mbutl + ((u_long)(x) << CLSHIFT)))
#define	mtocl(x) (((u_long)x - (u_long)mbutl) >> CLSHIFT)

/* address in mbuf to mbuf head */
#define	dtom(x)		((struct mbuf *)((u_long)x & ~(MSIZE-1)))

/* mbuf head, to typed data */
#define	mtod(x,t)	((t)((u_long)(x) + (x)->m_off))

struct mbuf {
	struct	mbuf *m_next;		/* next buffer in chain */
	u_long	m_off;			/* offset of data */
	short	m_len;			/* amount of data in this mbuf */
	short	m_type;			/* mbuf type (0 == free) */
        union {
                u_char  mun_dat[MLEN];  /* data storage */
                struct {
			short  mun_cltype;
                        int  (*mun_clfun)();
                        u_long  mun_clarg;
			u_long  mun_spare;
                } mun_cl;
        } m_un;
	struct	mbuf *m_act;		/* link in higher-level mbuf list */
};
#define       m_dat   m_un.mun_dat
#define	      m_cltype m_un.mun_cl.mun_cltype
#define       m_clfun m_un.mun_cl.mun_clfun
#define       m_clarg m_un.mun_cl.mun_clarg
#define	      m_spare m_un.mun_cl.mun_spare

/* mbuf types */
#define	MT_FREE		0	/* should be on free list */
#define	MT_DATA		1	/* dynamic (data) allocation */
#define	MT_HEADER	2	/* packet header */
#define	MT_SOCKET	3	/* socket structure */
#define	MT_PCB		4	/* protocol control block */
#define	MT_RTABLE	5	/* routing tables */
#define	MT_HTABLE	6	/* IMP host tables */
#define	MT_ATABLE	7	/* address resolution tables */
#define	MT_SONAME	8	/* socket name */
#define	MT_ZOMBIE	9	/* zombie proc status */
#define	MT_SOOPTS	10	/* socket options */
#define	MT_FTABLE	11	/* fragment reassembly header */
#define	MT_RIGHTS	12	/* access rights */
#define	MT_IFADDR	13	/* interface address */

/* flags to m_get */
#define	M_DONTWAIT	0
#define	M_WAIT		1

/* flags to m_pgalloc */
#define	MPG_MBUFS	0		/* put new mbufs on free list */
#define	MPG_CLUSTERS	1		/* put new clusters on free list */
#define	MPG_SPACE	2		/* don't free; caller wants space */

/* length to m_copy to copy all */
#define	M_COPYALL	1000000000L

/*
 * m_pullup will pull up additional length if convenient;
 * should be enough to hold headers of second-level and higher protocols. 
 */
#define	MPULL_EXTRA	32

#define	MGET(m, i, t) \
	{ spl_t ms = splimp(); \
	  if ((m)=mbfree) \
		{ if ((m)->m_type != MT_FREE) panic("mget"); (m)->m_type = t; \
	  mbstat.m_mtypes[MT_FREE]--; mbstat.m_mtypes[t]++; \
		  mbfree = (m)->m_next; (m)->m_next = 0; \
		  (m)->m_off = MMINOFF; } \
	  else \
		(m) = m_more(i, t); \
	  splx(ms); }
/*
 * Mbuf page cluster macros.
 * MCLALLOC allocates mbuf page clusters.
 * Note that it works only with a count of 1 at the moment.
 * MCLGET adds such clusters to a normal mbuf.
 * m->m_len is set to CLBYTES upon success and to 0 upon failure.
 * MCLFREE frees clusters allocated by MCLALLOC.
 */
#define	MCLALLOC(m, i) \
	{ spl_t ms = splimp(); \
	  if (mclfree == 0) \
		(void)m_clalloc(1, MPG_CLUSTERS, M_DONTWAIT); \
	  if ((m)=mclfree) \
	     {++mclrefcnt[mtocl(m)];mbstat.m_clfree--;mclfree = (m)->m_next;} \
	  splx(ms); }

#define	M_HASCL(m)	((m)->m_off >= MSIZE)
#define	MTOCL(m)	((struct mbuf *)(mtod((m), u_long)&~CLOFSET))

#define	MCLGET(m) \
	{ struct mbuf *p; \
	  MCLALLOC(p, 1); \
	  if (p) { \
		(m)->m_off = (u_long)p - (u_long)(m); \
		(m)->m_len = CLBYTES; \
	  	(m)->m_cltype = 1; \
		(m)->m_spare = 1; \
	  } \
	  else \
		(m)->m_len = 0;	\
	}

#define	MCLFREE(m) { \
	if (--mclrefcnt[mtocl(m)] == 0) \
	    	{ (m)->m_next = mclfree;mclfree = (m);mbstat.m_clfree++;} \
	}

#define	MFREE(m, n) \
	{ spl_t ms = splimp(); \
	  if ((m)->m_type == MT_FREE) panic("MFREE"); \
	  mbstat.m_mtypes[(m)->m_type]--; \
	  mbstat.m_mtypes[MT_FREE]++; \
	  (m)->m_type = MT_FREE; \
	  if (M_HASCL(m)) mclput(m); \
	  (n) = (m)->m_next; (m)->m_next = mbfree; \
	  (m)->m_off = 0; (m)->m_act = 0; mbfree = (m); \
	  splx(ms); \
	  if (m_want) { \
		  m_want = 0; \
		  wakeup((caddr_t)&mbfree); \
	  } \
	}

/*
 * Mbuf statistics.
 */
struct mbstat {
	short	m_mbufs;	/* mbufs obtained from page pool */
	short	m_clusters;	/* clusters obtained from page pool */
	short	m_clfree;	/* free clusters */
	short	m_drops;	/* times failed to find space */
	short	m_mtypes[256];	/* type specific mbuf allocations */
};

#ifdef	KERNEL

#ifdef	PAGING
extern	struct mbuf mbutl[];		/* virtual address of mbufs */
extern	struct pte Mbmap[];		/* page tables to map Netutl */
#else	/* ~PAGING */
extern	struct mbuf *mbutl;		/* starting virtual address of mbufs */
#endif	/* ~PAGING */

extern	struct	mbstat mbstat;
extern	int	nmbclusters;
extern	struct	mbuf *mbfree, *mclfree;
extern	char	mclrefcnt[];
extern	int	m_want;
extern	int	mincluster;		/* use a cluster or many mbufs? */
struct	mbuf *m_get(),*m_getclr(),*m_free(),*m_more(),*m_copy(),*m_pullup();
caddr_t	m_clalloc();
#endif
   kêvß W  $        ®  B‰*q™ˆ*B‰*     >~®  	              i  ./usr/include/sys/mdisk.h .h s.h/*
 *	IBM Personal Computer IX/AT
 *		Version 1.00
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1987, 1989  IBM Corp.
*	(c) Copyright 1987,  1989  Locus Computing Corporation
 *	All Rights Reserved
 */
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)mdisk.h	16.5	LCC)	/* Modified: 18:25:27 9/22/89 */

#ifndef _h_MINID
#define _h_MINID

/*
**	mdisk.h - generic code to read in, check, and
**	possibly construct the driver partition table from the
**	mbr and vtoc tables on disk. This file contains the
**	definition of the generic data structure to hold the
**	partitions, hdpart.
*/

#if defined(i386) || defined(SA_386)
/* 
** 	major layout: two major device numbers are attached in a known order,
**	and kept track of by the driver in an array.
** 	MINIDEV provides standard access to the 32 partitions on each
**	of 7 disks (31 minidisks, and the whole disk)
**	MBRDEV provides the direct access to the 5 mbr partitions (the
**	4 mbr partitions, and the 1 first dos partition)
*/
#define	MINIDEV		0	/* array index for mini dev */
#define	MBRDEV		1	/* array index for mbr dev */

/*
**	minor number layout is: dddm mmmm
** 	where ddd is the drive number 
** 	mmmmm is the minidisk number (AIX partition)
**	the drive and mini macros divide the minor device number
*/
#define drive(dev)		((minor(dev) >> 5) & 0x07ff)
#define minidisk(dev)		(minor(dev) & 0x1f)
#define mkminiminor(dr, mini)	((dr << 5) | minidisk(mini))

/*
**	the mbraccess and minortopart macros indicate and map
**	the major and minor device numbers to the hdpart table (see below).
*/
#define mbraccess(dev, maj)	(major(dev) == (maj)[MBRDEV])
#define	minortopart(dev, maj)	(mbraccess(dev, maj) 			  \
					? (minidisk(dev) + MAX_MINIDISKS - 1) \
					: minidisk(dev))
/*
**	for each drive,
**		the 1 whole disk partition (0),
**		the 31 possible minidisk partitions (1-31),
**		the 4 mbr partitions (32-35),
** 		the 1 active DOS partition (36)
**	are collected in hdpart.
**	The hdpart structure holds dissimilar partition types, to simplify
**	driver coding and copyout of the structure. Note that indexing is
**	accomplished thru the mintopart() macro.
*/
#define MBR_PARTS	(MAX_PARTITIONS+1)	  /* no. of mbr entries */
#define	MAX_PARTS	(MAX_MINIDISKS+MBR_PARTS) /* total entries per disk */
#define DOS_PART	(MAX_PARTS-1)		  /* the DOS partition */
#define WHL_PART 	(0)			  /* the whole disk partition */

struct hdpart {
	daddr_t start;  /* starting cylinder of partition */
	daddr_t length; /* length of the partition in blocks */
	char	ind;	/* type of operating system  * M000 */
	char	flg;	/* open/close and special write status */
};

/* 
**	open closed and special status flags for hdpart
*/
#define OPNIMP  0x80	/* defines OPeNed impostor	   */
#define OPNPRT	0x40	/* defines OPeNed partition	   */
#define OPNWRT	0x20	/* defines OPeNed and WRiTable	   */
#define OPNRES	0x10	/* defines OPeNed and REServed     */

/*
** invalid macros check the validity of partitions and their types
*/
#define	invalidmini(dr, pindex, hdpart)		(	\
	(dr >= MAX_DISKS) ||				\
	(hdpart[dr][WHL_PART].length == 0) ||		\
	(pindex >= MAX_MINIDISKS) ||			\
	(hdpart[dr][pindex].length == 0)	)

#define	invalidmbr(dr, pindex, hdpart)		(		\
	(dr >= MAX_DISKS) ||					\
	(hdpart[dr][WHL_PART].length == 0) ||			\
	(pindex < MAX_MINIDISKS || pindex >= MAX_PARTS) ||	\
	(hdpart[dr][pindex].length == 0)	)

#define invalidmbrtype(ind)	((ind) == SI_AIX_BOOT || (ind) == SI_AIX_NOBOOT)

/*
**	magic and driver io buffer length
*/
#define	HDIOWRT		0x9aa9
#define	HDINIT_BUFLEN	(sizeof(MBRSTRUCT) + (sizeof(VTOC1_3) * 2))

/*
**	the drivers use this macro to decode the minidisk start and length
** 	fields.
*/
#define makelong(shi,slo)    ((((shi) & 0xffffL) << 16) | ((slo) & 0xffffL))
#endif /* defined(i386) || defined(SA_386) */

#if	defined(u370)
#include	<sys/minidisk.h>
/*
**	minor number layout is: dddd mmmm
** 	where dddd is the drive number 
** 	mmmm is the minidisk number (AIX partition)
**	the drive and mini macros divide the minor device number
*/
#define drive(dev)		((minor(dev) & MINI_D_MASK) >> MINI_D_SHIFT)
#define minidisk(dev)		(minor(dev) & MINI_M_MASK)
#define mkminiminor(dr, mini)	(((dr) << MINI_D_SHIFT) | minidisk(mini))

/*
**	for each drive,
**		the 1 whole disk partition (0),
**		the 7 possible minidisk partitions (1-7),
*/

#define	MAX_PARTS	MINISPERDRIVE	/* total entries per disk */
#define WHL_PART 	(0)		/* the whole disk partition */

struct hdpart {
	daddr_t start;  /* starting cylinder of partition */
	daddr_t length; /* length of the partition in blocks */
	u_short	ind;	/* type of partition */
	u_short	flg;	/* open/close and special r/w status */
};

#define	HDINIT_BUFLEN	(sizeof(VTOC1_3) * 2)

#endif	/* defined(u370) */
#endif /* _h_MINID */
r kêl« V  $        Ý  B‰*q™ˆ*B‰*     ftÝ  	                  ./usr/include/sys/meas.h  .h s.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)meas.h	16.3	LCC)	/* Modified: 18:10:50 9/16/89 */
/* SCCSIDPUFF(@(#) meas.h 4.3 LM 00:15:31 6/21/85 C 00:15:36 6/21/85); */

#ifndef _h_MEAS
#define _h_MEAS

/*
 *	Include file for performance measurement procedures.
 */

#if	defined(JOURNAL) && !defined(_h_JOURNAL)
#include <journal.h>
#endif  /* (JOURNAL && !_h_JOURNAL) */

#if	!defined(JOURNAL) && !defined(_h_JOURNENT)
#include <journent.h>
#endif  /* (!JOURNAL && !_h_JOURNENT) */
#if	!defined(JOURNAL) && !defined(_h_JOURNMAC)
#include <journmac.h>
#endif  /* (!JOURNAL && !_h_JOURNMAC) */
#ifdef KERNEL
#ifdef  MEASDF
int	meas_flags;	/* Measurement flags */
long	microtime;	/* Resettable microsecond time */
#else   /* ~MEASDF */
extern int	meas_flags;	/* Measurement flags */
extern long	microtime;	/* Resettable microsecond time */
#endif  /* ~MEASDF */
#endif /* KERNEL */


#define		MEAS_ON		0x00000001	/* Measurement on-off switch */
#define		MEAS_INT	0x00000002	/* Measure interrupts */
#define		MEAS_SVR	0x00000004	/* Measure server processes */
#define		MEAS_SC		0x00000008	/* Measure system calls */
#define		FSACCESS	0x00000010	/* Measure file system access */

/* Bit turned on in u.u_m_flags to indicate that this process is doing 
 * measurement so that exit() can reset meas_flags */

#define		MEASURER	0x00000001	
	
#define		MSC	1	/* Code to measure a system call */
#define		MSP	2	/* Code to measure a server process */
#define		MINT	3	/* Code to measure an interrupt */
#define		MTEST	4	/* Code for measurement testing & calibration */

/* These #defines are for the beg_int() interrupt calls in the respective
 * routines.  Each call uses an I* #define to pass its code to begint()
 */
#define	G_REMOTE	0x00000001	/* Set when the measuremt goes remote*/
#define MPRI 40		/* Measurement process priority */

#define MAXMEAS 100

/* Structure for measurement system call data */
struct meas {
	int m_consumed;
	int m_elapsed;
	char m_sleeps;
	char m_ints;
	char m_flags;
};

#define Itest		0000
#define	Ihardclock	0020
#define Isoftclock	0021


#ifdef 	MEAS

#ifdef  JOURNAL		

struct meas_args {
	int	meas_op;			/* journal or meas */

	union {
		struct mc_args {		/* args when called for meas*/
			int ms_place; 
			int ms_type; 
			int ms_count; 
			struct meas *ms_buf;
		} meas;

		struct jr_args {		/* args for journal */
			int mjr_flags;		/* mode flags for journal
						   operations */
			unsigned int mjr_count;	/* when doing a MSJRSTART
						   with MJRF_COUNT, how
						   many blocks are to be
						   written before stopping?*/
			long	mjr_masks[JR_NMASKS];
						/* bits to select what we'll
						   actually journal on this
						   run */
			dev_t	mjr_dev;	/* dev on which to journal*/
		} journ;
	} ms_u;
} ;
#endif  /* JOURNAL */

      /*----------------------------------------------------------*
       |                                                          |
       |                     Values of meas_op                    |
       |                                                          |
       *----------------------------------------------------------*/

#define	MS_MEAS	1			/* measure syscalls and ints */
#define MS_JRSTART 2			/* start event recording */
#define MS_JRSTOP 3			/* wait for event recording 
					   termination */

 
      /*----------------------------------------------------------*
       |                                                          |
       |                 Values of journ.mjr_flags                |
       |                                                          |
       *----------------------------------------------------------*/

#define MJRF_IMMED	0x00000001	/* Stop immediately */
#define MJRF_COUNT	0x00000002	/* Journal only mjr_count
					   buffers before stopping */
#endif 	/* MEAS */

#endif /* ~_h_MEAS */
drikê"o U  $        ª„  C‰*r™ˆ*C‰*     |iª„  	              	»  ./usr/include/sys/minidisk.h s.h#ifndef H_SCCSID
#include <sccs.h>
#endif /* !H_SCCSID */
H_SCCSID(@(#)minidisk.h	16.12.1.3	AIX)	/* Modified: 13:51:53 10/19/90 */
/* 
* Copyright (C)  1989, Locus Computing Corporation
 * All Rights Reserved
 */ 
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef	_h_MINIS
#define	_h_MINIS

#include <sys/types.h>
#include <sys/param.h>
#if !defined(KERNEL)
#include <cfgcom.h>
#endif /* !defined(KERNEL) */
#if defined(KERNEL) || defined(u370)
#include <sys/mdisk.h>
#endif /* defined(KERNEL) || defined(u370) */

/*** NOTES:
	1)	Disk blocks are BLOCKSIZE bytes in length.
	2)	Disk sectors are the same size as disk blocks, but the word
		'sector' is only used when referencing a sector number.
	3)	The words 'disk blocks' and 'blocks' refer to the same thing.
	4)	Filesystem blocks are not referenced to anywhere in here.
***/

/***************************************************************************/
/******************* MAIN SYSTEM STRUCTURES AND DEFINES ********************/
/***************************************************************************/

/**************************************************************************/
/**** KERNEL AND SYSTEM DEPENDENT DEFINES AND MAXIMUMS - DO NOT CHANGE ****/
/**************************************************************************/

/* These are system maximums - do not change */
#define	DSPL_BSIZE	1024	/* size to use for display and stanzas */
#define MAX_MINIDISKS 	32	/* maximum number of minidisks in vtoc */
#define MAX_MINIDISKS_IN_VTOC	32	/* number of minidisk slots in vtoc */
#define MINI_D_SHIFT		5

#if defined(i386) || defined(SA_386)
#define BLOCKSIZE	512	/* blocksize for ST506 and ESDI */
#define BOOT0SIZE	512	/* Size of boot 0 block */
/*
 * See the comments in module src.i386/cmd/md/det_upbnd.c for comments
 * on the restriction of a maximum of 7 disks in the configuration.
 */
/*#define MAX_DISKS	56	 */
#define MAX_DISKS	7	/* maximum number of supported hard disks */
#define NODISKS		MAX_DISKS
#define MAX_PARTITIONS	4	/* maximum number of partitions in MBR */
/*
 * MAX_SCSI_DEVICES must be the same as MAX_DISKS to avoid compilation
 * errors.
 */
#define MAX_SCSI_DEVICES	MAX_DISKS	/* maximum number of devs */
#define MBOOTSIZE	446	/* Size of masterboot boot */


/*
 * Values for the system_ind field of the partition table
 * found in the PS/2 MBR
 */
#define SI_UNKNOWN	0	/* unknown (type 0) partition */
#define SI_DOS_12	1	/* dos 12-bit FAT partition */
#define SI_DOS_16	4	/* dos 16-bit FAT partition */
#define SI_EXT_DOS	5	/* extended dos partition */
#define SI_DOS_32MB	6	/* DOS and OS/2 partitions greater than 32MB */
#define SI_HPFS		7	/* OS/2 High Performance File System partition*/
#define SI_AIX_BOOT	8	/* AIX partition containing VTOC */
#define SI_AIX_NOBOOT	9	/* AIX partition */

/*
 * Values for the boot indicator field of the partition table
 * found in the PS/2 MBR
 */
#define BOOTABLE	0x80
#define NOTBOOTABLE	0x00

/* These are the types defined for the logical table type field */
#define LT_END 		0	/* end of logical space table marker */
#define LT_DOS_12	1	/* dos 12-bit FAT partition */
#define LT_AIX_PAGE 	2	/* page space minidisk */
#define LT_AIX_DUMP	3	/* dump space minidisk */
#define LT_DOS_16	4	/* dos 16-bit FAT partition */
#define LT_EXT_DOS 	5	/* extended dos partition */
#define LT_UNKNOWN	6	/* partition type 0 */
#define LT_AIX_UNALLOC	7	/* free space trapped within vtoc */
#define LT_AIX_BOOT 	8	/* AIX minidisk containing /unixtext */
#define LT_AIX_NOBOOT 	9	/* any other AIX minidisk */
#define LT_UNALLOC	0xa	/* free space avail to any OS (not in vtoc) */
#define LT_AIX_RSVD	0xb	/* boot0, VTOC, bkup VTOC, boot1 placeholder */
#define LT_BAD_BLOCK 	0xe	/* bad block minidisk */
#define LT_RESERVED 	0xf	/* reserved disk space placeholder */

/* These are the logical table IPL flag field values. They save which partition
   is currently active, so that information is not lost when we write the mbr
   back out. */
#define LT_ACTIVE	1
#define LT_NOTACTIVE	0

#endif /* defined(i386) || defined(SA_386) */

#if defined(u370)
#define FREE_SPACE_ID		((char) 255)

#define BLOCKSIZE	BSIZE
#define BOOT0SIZE	(0)		/* 370 doesn't have a boot0 record */
#define BOOT1SIZE	sizeof(MBRSTRUCT)	/* Should be equal to BSIZE */
#define	BOOT0_DADDR	((daddr_t)1)
#define	BOOT1_DADDR	((daddr_t)1)
#define	MAXMINOR	65535		/* see minor() in types.h */
#endif /* defined(u370) */

/*
** The following set of defines is of questionable utility
*/
/*
 * Define the rest in terms of MINI_D_SHIFT so that
 * they're easy to change and hard to get wrong. 
 */
#define MINISPERDRIVE 	(1<<MINI_D_SHIFT)
#define MINI_M_MASK	(MINISPERDRIVE - 1)
#define MINI_D_MASK	(MAXMINOR & ~MINI_M_MASK)
#define MAX_DRIVE	((MAXMINOR + 1) >> MINI_D_SHIFT)
#if defined(u370)
#define NODISKS		MAX_DRIVE
#endif	/* defined(u370) */


#define MAX_BOOT1	96	/* max number of blocks in boot */
#define V2_STRTABLEN	511	/* size of vtoc2 string table area */
#define V3_STRTABLEN	507	/* size of vtoc3 string table area */
#define STRTAB_LEN	(V2_STRTABLEN+V3_STRTABLEN)   /* 511 + 507 */
#define MINMINOR	1	/* min minidisk minor device number */
#if defined(i386)  ||  defined(SA_386)
#define MAXMINOR	MAX_MINIDISKS	/* maximum minidisk minor dev */
#endif /* defined(i386)  ||  defined(SA_386) */
#if defined(u370)
#define MAXMINOR	65535		/* maximum minidisk minor dev */
#endif /* defined(u370) */
#define WHOLEDISK_ID	0	/* minidisk ID for access to entire disk */

/* minidisk types for the MINIDISK structure within the VTOC */
#define MD_END		0	/* end of vtoc table marker */
#define MD_PAGE		1	/* page space minidisk */
#define MD_DUMP		2	/* dump space minidisk */
#define MD_UNALLOC	3	/* free space for AIX */
#define MD_AIX_BOOT	8	/* any AIX minidisk containing /unixtext */
#define MD_AIX_NOBOOT	9	/* AIX minidisk */
#define MD_BAD_BLOCK 	0xe	/* bad block table minidisk */

/* These are the PARTN and MINIDISK IPL flag field values */
#define MD_ACTIVE	 0x80
#define MD_NOTACTIVE	 0x00

/* This is the MAGIC STRING that will be in every VTOC */
#define MAGIC_STRING "VTOC"
#define MAGIC_LENGTH (sizeof(MAGIC_STRING) - 1)

#define MD_RSVD_BIT	0x80	/* minidisk reserved bit */
#define MD_ID_BITS	0x1f	/* minidisk ID */

/* These are to create the BIOS signature at the end of MBR */
#define SIGNAT_LOW	0xaa
#define SIGNAT_HI	0x55

/****************************************************************/
/**** KERNEL AND SYSTEM DEPENDENT STRUCTURES - DO NOT CHANGE ****/
/****************************************************************/

/* This is the BIOS signature check */
#define SIGNATURE struct _signature
SIGNATURE
{
    unsigned char highword;	/* should be 0x55 */
    unsigned char lowword;	/* should be 0xaa */
};

#if defined(i386) || defined(SA_386)
/* This is the partition table structure (at the end of the PS/2 MBR) */
#define PARTITION struct _partition
PARTITION
{
    unsigned char IPL_ind;	/* IPL indicator:  80H - yes, 00H - no */
    unsigned char s_head;  	/* head # for start of area */
    unsigned char s_sector;	/* 2 bit MSB for s_cyl, 6 bit s_sector */
    unsigned char s_cyl;	/* 8 bit LSB */
    unsigned char system_ind;	/* system indicator: see #defines below  */
    unsigned char e_head;	/* ending head # for area */
    unsigned char e_sector;	/* 2 bit MSB for e_cyl, 6 bit e_sector */
    unsigned char e_cyl;	/* 8 bit LSB */
    unsigned short rel_sect_l;	/* relative sector (low word) */
    unsigned short rel_sect_h;	/* relative sector (high word) */
    unsigned short num_sect_l;	/* number of sectors (low word) */
    unsigned short num_sect_h;	/* number of sectors (high word) */
};


/* This is the Master Boot Record (mbr) sector structure for a PS/2 */
#define MBRSTRUCT struct _mbrstruct
MBRSTRUCT
{
    unsigned char boot[MBOOTSIZE];	/* boot 0 code area */
    PARTITION part[MAX_PARTITIONS];	/* four partition table entries */
    SIGNATURE sign;			/* signature for BIOS */
};
#endif /* defined(i386) || defined(SA_386) */

#if defined(u370)
/* This is the boot1 record on a ckd or fba disk */

/* the following structure is at the high-address end of the boot block */
#define ENDOFBOOT struct _end_of_boot
ENDOFBOOT {
	daddr_t		_Bb_vtocp;		/* pointer to vtoc1 block */
	long		_Bb_bpc;		/* blocks per cylinder */
	long		_Bb_bpt;		/* blocks per track */
	u_char		_Bb_type;		/* disk type, DF_FBA | DF_CKD */
	char		_Bb_pad;
	SIGNATURE	_Bb_sign;		/* magic number */
};

/* This is the boot1 record on a ckd or fba disk */
#define MBRSTRUCT struct _boot1struct
MBRSTRUCT
{
#define BOOTTEXT	(BSIZE - sizeof(ENDOFBOOT))
	unsigned char	B_boot[BOOTTEXT];	/* room for code */
#undef BOOTEXT
	ENDOFBOOT	bB_eob;			/* see above structure */
};

	/* fields in the end of boot structure */
#define B_vtocp		bB_eob._Bb_vtocp	/* pointer to vtoc1 block */
#define B_bpc		bB_eob._Bb_bpc		/* blocks per cylinder */
#define B_bpt		bB_eob._Bb_bpt		/* blocks per track */
#define B_type		bB_eob._Bb_type		/* disk type, DF_FBA | DF_CKD */
#define B_sign		bB_eob._Bb_sign		/* magic number */
#endif	/* defined(u370) */

/* This is the minidisk structure */
#define MINIDISK struct _minidisk
MINIDISK
{
    unsigned long s_block;	/* starting block number */
    unsigned long num_blks;	/* length of minidisk in blocks */
    unsigned char type;		/* type of minidisk (see MD_??? types below) */
    unsigned char mdisk_id;	/* minidisk id number */
    unsigned short str_index;	/* index into string table */
};
												
/* This is sector 1 of the Volume Table of Contents structure */
#define VTOC1 struct _vtoc1
VTOC1
{
    char magic_string[4];	/* "VTOC" */
    char version;		/* version number */
    unsigned char seq_num;	/* sequence number (must match others) */
    unsigned short bootsize;	/* max length of boot 1 in disk blocks */
				/* (which follows the backup vtoc) */
    unsigned short numbadblks;	/* number of bad blocks (ST506 only) */
    unsigned short badblkoff;	/* offset within the bad block minidisk */
				/* of the actual start of the bad blk map */
    long vt_spare;		/* (to put mini[] on 8 byte boundry) */
    MINIDISK mini[MAX_MINIDISKS];   /* minidisk entries and a terminator */
#define VTOC1_PAD1_SIZE	(512 - 4 * sizeof (char) \
		    - sizeof (char) - sizeof  (unsigned char) \
		    - 3 * (sizeof (unsigned short)) - sizeof (long) \
		    - MAX_MINIDISKS * (sizeof (MINIDISK)))
    char pad1[VTOC1_PAD1_SIZE];	/* (to insure sizeof VTOC1 is BLOCKSIZE) */
};

/* This is sector 2 of the Volume Table of Contents structure */
#define VTOC2 struct _vtoc2
VTOC2
{
    unsigned char seq_num;	    /* sequence number (must match others) */
    char str_table1[V2_STRTABLEN];  /* first part of mount string table */
};

/* This is sector 3 of the Volume Table of Contents structure */
#define VTOC3 struct _vtoc3
VTOC3
{
    char str_table2[V3_STRTABLEN];  /* second part of mount string table */
    unsigned char seq_num;	    /* sequence number (must match others) */
    unsigned long chksum;	    /* checksum */
};

/* This structure concatenates the mount string table together */
#define VTOC2_3 struct _vtoc2_3
VTOC2_3
{
	VTOC2 vtoc2;		/* vtoc sector 2 */
	VTOC3 vtoc3;		/* vtoc sector 3 */
};

/* This structure is the entire 3-sector vtoc concatenated together */
#define VTOC1_3 struct _vtoc_1_3
VTOC1_3
{
	VTOC1 vtoc1;		/* vtoc sector 1 */
	VTOC2 vtoc2;		/* vtoc sector 2 */
	VTOC3 vtoc3;		/* vtoc sector 3 */
#ifdef	u370
	char  vtocpad[BSIZE - sizeof(VTOC1) - sizeof(VTOC2) - sizeof(VTOC3)];
#endif	/* u370 */
};

/* This structure is just a place holder and allows us to access the VTOC */
/* string table.  It is unioned with the VTOC2_3 structure. */
#define STRTABLE struct _strtable
STRTABLE
{
	char pad;			/* place holder for seq_num in VTOC2 */
	char str_table[STRTAB_LEN]; 	/* concatenated string table */
	char pad1;			/* place holder for seq_num in VTOC3 */
	long pad2;			/* place holder for chksum in VTOC3 */
};

/* This union allows us to access the vtoc string table as a whole */
#define VTOC_MOUNT union _vtoc_mount
VTOC_MOUNT
{
	VTOC2_3 *vtoc2_3;	/* pointer to VTOC's 2 and 3 */
	STRTABLE *strtable;	/* same pointer to entire string table */
};

/* This structure is the definition of a bad block entry */
#define BADBLKENTRY struct _badblkentry
BADBLKENTRY
{
	long bbe_badsect;	/* sector address of bad sector */
	long bbe_alternate;	/* sector address of alternate (good) sector */
};

/* This structure is the bad block list that resides in the bad block mdisk */
#define BADBLKLIST struct _badblklist
BADBLKLIST
{
	char bbl_magic[4];	/* BBLK magic string "BBLK" */
	char bbl_pad[4];	/* reserved */
	BADBLKENTRY bbl_list[1];/* first element of the bad block list */
};


/*************************************************/
/**** SYSTEM DEPENDENT MACROS - DO NOT CHANGE ****/
/*************************************************/

#if defined(i386) || defined(SA_386)

/* These are the macros to retrieve the high/low word of a long int */
#define HIWORD(a)		((a & (long)0xffff0000) >> 16)
#define LOWWORD(a)		(a & (long)0x0000ffff)

/* These are the macros to mask sector and cylinder numbers */

/* macro to get 6-bit sector number from sect field */
#define SECT_MASK(a)	((char)((short)a & (short)0x003f))

/* macro to get 2-bit MSB of cylinder from sect field */
#define CYL_MSB_MASK(a)	(((short)((short)a & (short)0xc0)) << 2)

/* macro to mask off LSB of 10-bit cylinder */
#define CYL_LSB(a)		((char)((short)a & (short)0x00ff))

/* macro to put 2-bit MSB of 10-bit cylinder into upper 2 bits of sect field */
#define CYL_MSB(a)		((char)(((short)a & (short)0x0300) >> 2))
#endif /* defined(i386) || defined(SA_386) */


#if !defined(KERNEL)

/***********************************************/
/* APPLICATION SPECIFIC STRUCTURES AND DEFINES */
/***********************************************/

/* minidisk parameters */
#define SHWLEN		NODISKS*HDISKLEN /* size of showbuf */
#if defined(i386)  ||  defined(SA_386)
#define MDNAMELEN	5	/* minidisk name length without null */
#endif /* defined(i386)  ||  defined(SA_386) */
#if defined(u370)
#define MDNAMELEN	8	/* length of minidisk name ("chd65535") */
#endif /* defined(u370) */
#define HDISKLEN 	8  	/* length of "hdiskxx" */
#if defined(i386)  ||  defined(SA_386)
#define KEYLEN 		20	/* length of keywords for createlf */
#define CMDLEN 		40	/* length of system call command string */
#define NONE 		0
#define CHKD 		1
#define CHKN 		0
#endif /* defined(i386)  ||  defined(SA_386) */
#define DOS_MAJOR_NUMBER 5	/* major dev number for DOS /dev entries */
#define MAXINPUT	256	/* size of token list return from display */
#define MAXDSP		40	/* maximum array size of cfg__dsp structs */
#define MAXCHG		256	/* size of buffer for call to cfgcuval */
#if defined(i386)  ||  defined(SA_386)
#define HMIN		5	/* lower bound of minor # on hdisk0 */
#define HMAX	MAX_MINIDISKS	/* upper bound of minor # on any drive */
#endif /* defined(i386)  ||  defined(SA_386) */

#define VALMAX     75   	/* maximum length of a keyword value */
#define LISTVALMAX 75   	/* maximum length of a keyword value that */
				/*    is a list                           */
#define ATRSZMAX 4096   	/* maximum size in bytes of an attribute */
				/*    file stanza from the master or     */
				/*    system files                       */
#define ATRNUMMAX 400   	/* maximum number of attributes       */
				/*    (keywords) in an attribute file */
				/*    stanza                          */

#if defined(i386)  ||  defined(SA_386)
#define BLKDEV		"/dev/hd"	/* block hard disk /dev entry prefix */
#define RAWDEV		"/dev/rhd"	/* raw hard disk /dev entry prefix */


/* This is the logical space map of the entire disk */
#define LOGICAL_SPACE struct _logical_space
LOGICAL_SPACE
{
  unsigned char	name[MDNAMELEN+1];/* name of minidisk. eg. "hd01" */
  unsigned char	minordev:5;	/* minor device number for this minidisk */
  unsigned char	unused:2;	/* reserved */
  unsigned char	rsvd:1;		/* minidisk reserved flag (1=yes) */
  unsigned char	type:4;		/* 4 bit code for minidisk type. 0 - 15 */
  unsigned char	b:1;		/* 1 bit for beginning of disk flag */
  unsigned char	m:1;		/* 1 bit for middle of disk flag */
  unsigned char	e:1;		/* 1 bit for end of disk flag */
  unsigned char	IPL_ind:1;	/* 1 bit for active marker of PARTITION */
  unsigned long	start;		/* starting sector of minidisk */
  unsigned long	length;		/* length of minidisks in sectors */
  char *	mount;		/* mount string */
  char		automount;	/* automount indicator: Y-yes, N-no */
  char		perm;		/* mount permission: R-read, W-read/write */
  gfs_t		gfs;		/* global filesystem number */
  siteno_t	gfspack;	/* global filesystem pack number */
};

/* This is the boot0 code */
#define BOOT0 struct _boot0
BOOT0 {
	char code[BOOT0SIZE];
	int size;
};

#endif /* defined(i386)  ||  defined(SA_386) */

/* This is the hdboot (formerly boot1) code */
#define BOOT1 struct _boot1
BOOT1 {
	char code[BLOCKSIZE * MAX_BOOT1];
	int size;
};

#if defined(i386)  ||  defined(SA_386)

/* external structure for cfgmpcc function */
struct positns
{
	 unsigned beg : 1;
	 unsigned mid : 1;
	 unsigned end : 1;
} positions;

/* This is the table for holding the free space entries when adding minidisks */
#define FREE_SPACE struct _free_space
FREE_SPACE
{
  int ls_index;		/* index into logical table for free space entry */
  struct positns posit;	/* position on hard disk free space lives */
  int num_part;		/* number of partitions required for adding md */
};

/* This structure is for determning how many hard disks are installed */
struct disk
{
	char name[10];       		/* disk name  */
};
struct disk hdisk[NODISKS];

#endif /* defined(i386)  ||  defined(SA_386) */

/* This structure is used to hold working data about the minidisk that is */
/* currently being added, deleted or changed. */
struct mdstruct 
{
   char sname[MDNAMELEN+1];	/* minidisk name */
   char blocks[MAXKWD];		/* size in blocks */
#if defined(i386)  ||  defined(SA_386)
   char pth[MAXDIR];		/* directory to be stanza name in /etc/flsts */
#endif /* defined(i386)  ||  defined(SA_386) */
   char mnt[MAXDIR];		/* mount parameters (eg. true,readonly) */
   char gfs[12];		/* gfs number string of minidisk */
   char gfspack[7];		/* gfs pack number string of minidisk */
   char site[MAXKWD];		/* site name (eg. aix) */
   char type[MAXKWD];		/* site type (eg. nonrepl) */
   char minordev;		/* minor device number */
   char m_type;			/* minidisk type (LT_AIX_????) */
   int HMLflg;			/* position flag = ANY, HIGH, MED, or LOW */
   int disk;			/* disk drive the minidisk is to go on */
   unsigned quit : 1;		/* quit bit */
   unsigned bdisk : 1;		/* build disk list bit */
   unsigned qry : 1;		/* query bit */
   unsigned end : 1;		/* end bit  */
   unsigned bkup : 1;		/* backup bit */
   unsigned fsbkup : 1;		/* backup bit */
   char *sbuf;			/* ptr to system stanza buffer */
   unsigned sbyt;		/* length of system buffer */
   char *fbuf;			/* ptr to filesystems buffer */
   unsigned fbyt;		/* length of filesystems buffer */
};

/***********************************************/
/**** APPLICATION SPECIFIC GLOBAL VARIABLES ****/
/***********************************************/

/*
** Properly speaking, there should only be extern's here.  However, for
** historical reasons the 386 still needs them, so we'll leave them in.
*/
#if defined(i386)  ||  defined(SA_386)
struct	mdstruct mdsk;		/* current working minidisk in memory */
char	input [MAXINPUT];	/* buf to pass/receive from common routines */
char	shwbuf[SHWLEN];     	/* return from show routine */
cfg__dsp display [MAXDSP];   	/* cfg__dsp struct array for display routn */
char	rsystnm[MAXKWD];	/* stanza name for raw device   */
char	syscmd[100];		/* buffer for system commands   */
int	kwv_err;		/* keyword value read status    */
char	update[MAXCHG];		/* internal list of keyword value tokens */
				/* to be used by cfgcuval to update stanza */
CFG__SFT	*systm;		/* pointer to system file structure */
CFG__SFT	*filesystms;	/* pointer to filesystems file structure */
CFG__SFT	*mdskKAF;	/* pointer to mdkaf file structure */

int diskflag;			/* determines if cfgmhml is called */

int filesopen;			/* flag set in cfgmadd, cfgmdel, cfgmchg when */
				/* system and filesystems files are opened */
			 	/* (flag checked in cfgmshw) */
int	vtocflg[NODISKS][2];	/* vtoc error flags for when a vtoc is bad */
				/* (set by check_vtoc function in libmd.a) */
#endif /* defined(i386)  ||  defined(SA_386) */

extern struct	mdstruct mdsk;	/* current working minidisk in memory */
extern char	input[];	/* buf to pass/receive from common routines */
extern char	shwbuf[];     	/* return from show routine */
extern cfg__dsp display[];   	/* cfg__dsp struct array for display routn */
extern char	rsystnm[];	/* stanza name for raw device   */
extern char	syscmd[];	 /* buffer for system commands   */
extern int	kwv_err;	/* keyword value read status    */
extern char	update[];	/* internal list of keyword value tokens */
				/* to be used by cfgcuval to update stanza */
extern CFG__SFT	*systm;		/* pointer to system file structure */
extern CFG__SFT	*filesystms;	/* pointer to filesystems file structure */
#if defined(i386)  ||  defined(SA_386)
extern CFG__SFT	*mdskKAF;	/* pointer to mdkaf file structure */
#endif /* defined(i386)  ||  defined(SA_386) */

extern int	diskflag;	/* determines if cfgmhml is called */

extern int	filesopen;	/* flag set in cfgmadd, cfgmdel, cfgmchg when */
				/* system and filesystems files are opened */
			 	/* (flag checked in cfgmshw) */
#if defined(i386)  ||  defined(SA_386)
extern int vtocflg[NODISKS][2];	/* vtoc error flags for when a vtoc is bad */
				/* (set by check_vtoc function in libmd.a) */
#endif /* defined(i386)  ||  defined(SA_386) */

/***************************************/
/***** APPLICATION SPECIFIC MACROS *****/
/***************************************/
#if defined(u370)
#define BYTES_PER_SEC(d)	(disk[d]->drive_info.un.dk.bytpsec)
#define SEC_PER_TRK(d)		(disk[d]->drive_info.un.dk.secptrk)
#define TRK_PER_CYL(d)		(disk[d]->drive_info.un.dk.trkpcyl)
#define NUM_OF_BLOCKS(d)	(disk[d]->drive_info.un.dk.numblks)
#endif /* defined(u370) */

/* the size of the 1st partn reserved structures in blks that must be good */
#define GOODSIZE \
	((BOOT0SIZE + 2 * sizeof(VTOC1_3)) / BLOCKSIZE + MAX_BOOT1)

/* the actual size of the partition table within the MBR */
#define MBRLEN	((sizeof(PARTITION) * MAX_PARTITIONS) + sizeof(SIGNATURE))

/* the size of the masterboot area within the MBR */
#define BOOTLEN	(sizeof(MBRSTRUCT) - MBRLEN)

#if defined(i386)  ||  defined(SA_386)
/* this is the logical space table list size (max number of entries) */
/* there must be room for 32 minidisks, AIX_RSVD, RSVD, 3 partitions, +1 */
#define LOGICAL_LIST_SIZE \
		(MAX_MINIDISKS + MAX_PARTITIONS + 2)

/* macro to create a minor device number */
/* d = disk index, m = minidisk id */
#define MKMINOR(d,m) \
	((unsigned char)m | (((unsigned char)d & (unsigned char)0x07) << MINI_D_SHIFT))

/* macro to get minidisks ID from minor device number */
#define GET_ID(m)	((unsigned char)m & (unsigned char)MD_ID_BITS)

/* macro to get disk number from minor device number */
#define GET_DISK(m)		(((unsigned char)m & (unsigned char)0xe0) >> MINI_D_SHIFT)

/* macro to get reserved bit from minor device number field in VTOC */
#define GET_RSVD(m)	(((unsigned char)m & (unsigned char)MD_RSVD_BIT) >> 7)

/* macro to test for end of VTOC minidisk list condition */
/* d = disk index, m = minidisk index */
#define END_OF_VTOC(d,m) \
		(m >= MAX_MINIDISKS || vtoc1[d]->mini[m].type == MD_END)

/* macro to test for end of LOGICAL SPACE table condition */
/* d = disk index, e = entry index */
#define END_OF_LSPACE(d,e) \
		(d >= MAX_SCSI_DEVICES || e >= LOGICAL_LIST_SIZE || \
			l_space[d][e]->type == LT_END)

/* macro to test if this logical table entry is any kind of free space */
/* d = disk index, e = entry index */
#define IS_FREE(t) \
		((t) == LT_UNALLOC || (t) == LT_AIX_UNALLOC)

/* macro to test if this logical table entry is any kind of AIX fileystem */
/* d = disk index, e = entry index */
#define IS_FILESYSTEM(t) \
		((t) == LT_AIX_NOBOOT || (t) == LT_AIX_BOOT)

/* macro to test if this is an AIX minidisk */
#define IS_AIX(t) \
	(IS_FILESYSTEM(t) || (t) == LT_AIX_PAGE || \
	 (t) == LT_AIX_DUMP || (t) == LT_BAD_BLOCK)

#endif /* defined(i386)  ||  defined(SA_386) */

#if defined(u370)
/* this is the logical space table list size (max number of entries) */
#define LOGICAL_LIST_SIZE	(MAX_MINIDISKS + MAX_MINIDISKS + 1)

/* Macro to create a minor device number */
#define MKMINOR(d, m)	\
	(((unsigned char)m | ((unsigned short)d << MINI_D_SHIFT))&0xffff)

/* MKWDMINOR must change when MAXMINIDISKS increases from 8 */
#define MKWDMINOR(d, m)	\
	(((unsigned char)m | ((unsigned short)d << MINI_D_SHIFT))&0xffff)

/* Macro to get minidisks ID from minor device number */
#define GET_ID(m) (DEVICE_ID_TO_MINI_ID(m))

/* Macro to get disk number from minor device number */
#define GET_DISK(m)	\
	(DEVICE_ID_TO_DISK_ID(m))
#endif /* defined(u370) */

/******************************************/
/**** APPLICATION SPECIFIC ERROR CODES ****/
/******************************************/
/* non fatal return and error return codes */
#define CFG_CHGS  1	/* /dev entries were changed due to DOS add or del */
#define CFG_DFLT  2	/* installed minidisk, but not where user wanted */
#define CFG_NRRP  3	/* no room in required position */
#define CFG_NROD  4	/* no room on disk */
#define CFG_DONE  5	/* an operation is complete */
#define CFG_RDND  6	/* real disk not defined */
#define CFG_UCFS -1	/* unable to change free space type to requested type */
#define CFG_PBAD -2	/* primary VTOC corrupted */
#define CFG_BBAD -3	/* backup VTOC corrupted */
#define CFG_MNBF -4	/* minidisk name is badly formed */
#define CFG_NFIT -5	/* can't fit bad block minidisk on disk */
#define CFG_NSLF -6	/* can't find a starting location for partition */
#define CFG_FSNA -7	/* free MBR slot for 1st AIX partition not available */
#define CFG_BMAG -8	/* bad magic number in superblock */
#define CFG_ULKB -9	/* unlink /dev entries call returned an error */

/* FATAL (Termination) Error Return Codes - minidisks/mdrc start at -5000 */
#define CFG_MDIO -5000	/* disk I/O error */
#define CFG_USZF -5001  /* the format of a stanza is not correct */
#define CFG_DELF -5002  /* delete of minidisk failed due to being busy */
#define CFG_APIE -5003  /* invalid parameter passed */
#define CFG_DVEX -5004  /* a stanza exists with requested minidisk name */
#define CFG_MKFF -5005  /* filesystem could not be made on AIX minidisk */
#define CFG_DBZY -5006  /* device is busy */
#define CFG_SYNX -5007  /* mdrc syntax error */
#define CFG_LTNG -5008	/* logical table no good */
#define CFG_LTFL -5009	/* logical table full - no more minidisks */
#define CFG_VTNG -5910	/* VTOC no good */
#define CFG_VTNF -5011	/* VTOC not found */
#define CFG_SIGB -5012	/* MBR partition table signature is bad */
#define CFG_FSNF -5013	/* freespace entry not found in logical table */
#define CFG_VFNM -5014	/* VTOC and /etc/filesystems data did not match */
#define CFG_PRMD -5015	/* primary site is down */
#define CFG_NGFS -5016	/* no free gfs numbers left */
#define CFG_HDNF -5017  /* no hard disk in system */
#define CFG_FSDB -5018	/* fsdb for change of gfs and gfspack info failed */
#define CFG_B0NG -5019	/* boot0 code file is bad or missing */
#define CFG_B1NG -5020	/* boot1 code file is bad or missing */
#define CFG_BBTB -5021	/* bad block table bad */
#define CFG_NMBR -5022	/* masterboot code file is bad or missing */
#define CFG_SZTB -5023	/* stanza too big or concatenated */
#define CFG_MAXP -5024  /* maximum number of partitions already defined */
#define CFG_OCFG -5025	/* osconfig failure */
#define CFG_SFBE -5026	/* special file build error, cant create /dev entries */
#define	CFG_EXMP -5027	/* exceeded the max # physical partition (4) */
#define CFG_LOCK -5028	/* program is locked by another task */
#define CFG_ECRE -5029	/* file creation error */


/******************************************/
/**** APPLICATION SPECIFIC MISC VALUES ****/
/******************************************/

/* misc */
#define FOREVER	for(;;)
#define ILLCMD	1

#ifndef SUCCESS
#define SUCCESS	0
#endif /* SUCCESS */

#ifndef FAIL
#define FAIL	1
#endif /* FAIL */

#ifndef NO
#define YES	1
#define NO 	0
#endif	/* NO */
#define BELL	7

#if defined(i386)  ||  defined(SA_386)
/* Minidisks subcommand numbers */
#define ADD	1
#define DEL	2
#define CHG	3
#define SHOW	4
#define REL	5
#define MARK	6
#endif /* defined(i386)  ||  defined(SA_386) */

/*  values set in minidisks Show function  */
#define ALL	5
#define DSK	6

/* values for flag for cfgpcc function */
#define IPCC	0
#define MPCC	1

/* values to set HMLflg in mdstruct */
#define ANY	0
#define HIGH 	3
#define MED	2
#define LOW	1

/* useflag values */
#define DOS		0	/* DOS partition (minidisk) */
#define AIXBOOT		1	/* partition will be a AIX filesystem */
#define AIXNOBOOT	2	/* partition will be assigned to coprocessor */

/* locflag values */
#define MDLOCH 	3      /* partition goes at high end of hardfile       */
#define MDLOCM 	2      /* partition goes near the center of hardfile   */
#define MDLOCL 	1      /* partition goes near beginning of hardfile    */
#define MDLOCX 	0      /* partition goes in next available place       */

/* Defines for searching for free minor dev numbers */
#define NOFREEMINOR	0
#define FREEMINOR	1

/* Lost+Found Building Defines */
#define MAX_LF_CNT	1024	/* max number of entries in lost+found dir */
#define MIN_LF_CNT	128	/* min number of entries in lost+found dir */
#define ENTRYLEN	50	/* length of l+f directory enties */
#define LFMOD		0755	/* permissions for lost+found dir */
#define ENTRYMOD	0666	/* permissions for l+f entries */
#define INODE_DIV	10	/* number to divide the number of inodes by */

/* Trace point definitions */
#define MN_API  	3               /* maps to hook id */
#define MN_CRE  	1               /* minidisk created */
#define MN_CFGA 	2               /* configuration updated for create */
#define MN_DEL  	3               /* minidisk deleted */
#define MN_CFGD 	4               /* configuration updated for delete */

/* 44MB hard disk sizes for experimantation */
#define D44M_HD_PER_CYL		7
#define D44M_SEC_PER_TRK	17
#define D44M_NUM_CYL		730

/* 70MB hard disk sizes for experimentation */
#define D70M_HD_PER_CYL		64
#define D70M_SEC_PER_TRK	32
#define D70M_NUM_CYL		70

/* 115MB hard disk sizes for experimentation */
#define D115M_HD_PER_CYL	64
#define D115M_SEC_PER_TRK	32
#define D115M_NUM_CYL		110

/**************************************************/
/**** FILE NAMES, COMMANDS AND STANZA KEYWORDS ****/
/**************************************************/

/* file names */
#ifdef USEFILES
#define VTOCFILE	"./vtoc_" 	/* prototype of vtoc filename */
#define MBRFILE		"./hd_0"   	/* prototype of mbr filename */
#endif
#define MDKAF		"/etc/mdkaf"
#define SYFILE		"/etc/system"
#define USYFILE		"/local/system.sav"
#define FLSYS		"/etc/filesystems"
#define UFLSYS		"/local/filesystems.sav"
#define MASFILE		"/etc/master"
#define GFSFILE		"/etc/fsmap"
#if defined(i386)  ||  defined(SA_386)
#define BOOT0FILE	"/generic/install/generic.i386/mhdboot0"
#define BOOT1FILE	"/generic/install/generic.i386/mhdload"
#define MBOOTFILE	"/etc/masterboot"
#endif /* defined(i386)  ||  defined(SA_386) */
#define MNT		"/mnt"		/* directory to mount minidisk on */
#define MNTDIR		"/.mntdir"	/* if /mnt busy mount on this dir */
#define DEVSTRING	"/dev/"
#define LOCKSUFX	".LCK"
#define LOCKDIR		"/etc/locks/"

/* external program commands */
#define MAKEFS		"/etc/mkfs -l -f%s -v%s /dev/%s %s"
#define FSDB		"/etc/fsdb /dev/%s > /dev/null 2> /dev/null"
#define FSDB_CMD	"gfs=%d\ngp=%d\nq\n"
#define UNMOUNT		"/etc/umount /dev/%s > /dev/null 2> /dev/null"

/*  stanza names, keywords, and keyword values   */
#define BACKBONE	",backbone"
#define BLOCK		"bs"
#define CHECK		"check"
#define COPKEY		"mdisk"
#define DEV		"dev"
#define DRIVER		"driver"
#define DTYPE		"dtype"
#define DTYPE_PARTITION "partition"
#define FALSESTR	"false"
#define FREE		"free"
#define FSIZ		"size"
#define FSTYPE		"type"
#define	GFS		"gfs"
#define	GFSPACK		"gfspack"
#define HDISK		"disk"
#define INODES	    "inodes"
#define MAJOR		"major"
#define MDFLSTZ		"mdskfls"
#if defined(i386)  ||  defined(SA_386)
#define MDPREFIX	"hd"
#endif /* defined(i386)  ||  defined(SA_386) */
#define MDSYSTZ		"mdsksys"
#define MINOR		"minor"
#define MODES		"modes"
#define MOUNT		"mount"
#define NAME		"name"
#define NONREPL		"nonrepl"
#define PRIMPACK	",primary"
#define READONLY	",readonly"
#define REALDISK	"fd"
#define REPL		"repl"
#define RFIXD		"\tnoshow = true\n\tnoipl = true\n\n"
#define SITE		"site"
#define SIZE		"nob"
#define STARTPACKNO "1"
#define TRUESTR		"true"
#define TYPE		"ftype"
#define USERPACK	",user"
#define VCHECK		"vcheck"
#define VOL		"vol"

/* punctuation strings */
#define BLANKS	 "  "
#define COMMA	 ", "
#define NEWLNS	 "\n"

/* characters */
#ifndef NULLC
#define NULLC 	'\0'
#endif /* NULLC */

#ifndef EQLSGN
#define EQLSGN 	'='
#endif /* EQLSGN */

#ifndef ASTRSK
#define ASTRSK 	'*'
#endif /* ASTRSK */

#ifndef NEWLN
#define NEWLN 	'\n'
#endif /* NEWLN */

#ifndef BLANK
#define BLANK 	' '
#endif /* BLANK */

#define ZERO 	'0'
#define NINE 	'9'
#ifndef SPACE
#define SPACE 	'\040'
#endif /* SPACE */

#if defined(u370)
/* NOTE:
 * 	The following defines are only required by
 *	i370 applicaitons.
 */

/* These are boolean expressions */
#ifndef TRUE
#define TRUE 		1
#endif /* TRUE */

#ifndef FALSE
#define FALSE 		0
#endif /* FALSE */

#endif /* defined(u370) */

/************************************************************/
/**** End of Application Specific Structures and Defines ****/
/************************************************************/


#endif /* !defined(KERNEL) */

#endif /* _h_MINIS */
ine INkêÖ  T  $        ‰  C‰*r™ˆ*C‰*     d)‰  	                  ./usr/include/sys/mmconf.h h s.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

/*
 *
 * device driver configuration header file for mem.c
 *
 * This module is included by conf.c and is responsible for allocating
 * all data structures required by the device driver.  Three device
 * specific pre-processor defined symbols are available for our use:
 *
 *	B_xyz		block major device number (if any)
 *	C_xyz		character major device number (if any)
 *	N_xyz		number of configured controllers
 *	U_xyz		number of configured sub-units
 *
 * (where "xyz" is the device driver prefix)
 *
 */
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)mmconf.h	16.3	LCC)	/* Modified: 18:12:46 9/16/89 */

int	mm_cmaj = C_mm;		/* need to know our major device number */
dif /* kê0[ S  $        D
  C‰*s™ˆ*C‰*     úÀD
  	                  ./usr/include/sys/mntctl.h h s.h
H_SCCSID(@(#)mntctl.h	16.3	LCC)	/* Modified: 18:13:33 9/16/89 */
/* @(#)mntctl.h	7.2 87/11/06 20:17:26 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
#ifndef _h_mntctl
#define _h_mntctl

#include <sys/vmount.h>
#include <sys/types.h>

/*
 * mntctl.h
 */

/* this is the list of possible mount control commands                  */
#define MC_MOUNTS       0       /* get mount status information         */
#define MC_UMOUNTS	1	/* force unmout of particular mount point
				 * and all mount points below it.
				 */

/* This is the structure of the mount information that is returned
   from the mntctl() system call.  An array of these structures
   immediately follows the buffer's header (of struct bheader type).
   When the mntctl() system call returns successfully, the number of
   elements in the array is contained in the buffer header field size.  */

struct  m_info
{
        unsigned long m_nid;    /* the nid of a remote mount            */
        char         *m_object; /* path of the mounted object           */
        char         *m_stub;   /* path of the mounted-over object      */            
        unsigned int m_flag;    /* flag indicating whether a vmount is
                                   read-only, removable, device, or
                                   remote                               */
        time_t       m_date;    /* date that vfs was created            */
};

/* the mntctl buffer must have this structure as its header             */
struct bheader
{
        unsigned long nid;      /* node id of machine to get mount
                                   status from                          */
        int           reserved; /* for internal use of system call      */
        unsigned int  size;     /* # of minfo structures in buffer OR
                                   required size of buffer              */
        struct m_info  m[1];     /* start of minfo descriptions          */
} ;

/* The search info struct is used internally by mntctl as a handy place
 * to stick things that we need to keep track of during the search of the
 * VFS tree.
 */
struct srch_info {		
	int	s_mcount;	/* number of mounts */
	int	s_bcount;	/* number of bytes we need to hold the object */
				/* and stub path names.			      */
	struct m_info *s_mptr;	/* pointer to the minfo structs in bheader    */
	char	*s_strptr;	/* pointer to string space in buf	      */
};

/* Flags used by the search routine */
#define	COUNT		0x01		/* Count the nodes */
#define	F_UNMOUNT	0x02		/* Force unmount all nodes */

#endif  /* _h_mntctl */
i386kêº« R  $        ó"  D‰*t™ˆ*D‰*     üÀó"  	              i  ./usr/include/sys/mount.h  h s.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)mount.h	16.13	LCC)	/* Modified: 13:50:15 4/9/92 */

#ifndef _h_MOUNT
#define _h_MOUNT

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _h_TYPES */

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif  /* _h_PARAM */

#ifdef NFS
#ifndef __NFS_CLNT_HEADER__
#ifdef KERNEL
#include <nfs_clnt.h>
#else /* ~KERNEL */
#include <rpc/nfs_clnt.h>
#endif /* ~KERNEL */
#endif /* __NFS_CLNT_HEADER__ */
#endif /* NFS */

/*
 * Mount structures.
 * One allocated on every mount.
 * Used to find the super block, etc.
 */

/*
 * Global mount information. Note: this structure is a subset of the
 * 	local mount entry (pmount).
 */

struct gmount
{
	PADOPEN(gmLt)
	gfs_t		Gm_gfs;
	gfs_t		Gm_ongfs;
	ino_t		Gm_oninum;
	struct gmount  *Gm_next;
	struct gmount  *Gm_chain;
	ino_t		Gm_tino;
	PADCLOSE(gmLt, gmLs, gmLu)
#define	gm_gfs		gmLu.gmLs.Gm_gfs
#define	gm_ongfsindex	gmLu.gmLs.Gm_ongfs
#define gm_ongfs	gmLu.gmLs.Gm_ongfs
#define	gm_oninum	gmLu.gmLs.Gm_oninum
#define	gm_next		gmLu.gmLs.Gm_next
#define gm_lwm		gmLu.gmLs.Gm_next	/* used in gsmount */
#define	gm_chain	gmLu.gmLs.Gm_chain
#define	gm_tino		gmLu.gmLs.Gm_tino
#define	NGMLONGS	(sizeof(struct gmLt) / sizeof(long))

	PADOPEN(gmSt)
	siteno_t	Gm_css;
	islot_t		Gm_sndslot;
	PADCLOSE(gmSt, gmSs, gmSu)
#define	gm_css		gmSu.gmSs.Gm_css
#define	gm_sndslot	gmSu.gmSs.Gm_sndslot
#define	NGMSHORTS	(sizeof(struct gmSt) / sizeof(short))

	PADOPEN(gmCt)
	char		Gm_gflags;
	char		Gm_lflags;
	PADCLOSE(gmCt, gmCs, gmCu)
#define	gm_gflags		gmCu.gmCs.Gm_gflags
#define	gm_lflags		gmCu.gmCs.Gm_lflags
};

/*
 * Local mount information
 */
struct	pmount
{
	PADOPEN(gmLpt)
	gfs_t		Gm_gfs;
	gfs_t		Gm_ongfs;
	ino_t		Gm_oninum;
	struct pmount  *Gm_next;
	struct gmount  *Gm_chain;
	ino_t		Gm_tino;
	PADCLOSE(gmLpt, gmLs, gmLu)
#define	pm_gfs		gmLu.gmLs.Gm_gfs
#define	pm_ongfs	gmLu.gmLs.Gm_ongfs
#define	pm_oninum	gmLu.gmLs.Gm_oninum
#define	pm_next		gmLu.gmLs.Gm_next
#define	pm_chain	gmLu.gmLs.Gm_chain
	PADOPEN(gmSpt)
	siteno_t	Gm_css;
	islot_t		Gm_sndslot;
	PADCLOSE(gmSpt, gmSs, gmSu)
#define	pm_css		gmSu.gmSs.Gm_css
#define	pm_sndslot	gmSu.gmSs.Gm_sndslot
	PADOPEN(gmCpt)
	char		Gm_gflags;
	char		Gm_lflags;
	PADCLOSE(gmCpt, gmCs, gmCu)
#define	pm_gflags		gmCu.gmCs.Gm_gflags
#define	pm_lflags		gmCu.gmCs.Gm_lflags
	dev_t	pm_dev;		/* device mounted */
	union {
		struct buf *pm_U_bufp;	/* pointer to superblock */
					/* set to NULL if the gfs is not mounted
					   locally */
		struct mntinfo *pm_U_mi; /* NFS mount info record */
	} pm_U;
#define pm_bufp pm_U.pm_U_bufp
#define pm_mi   pm_U.pm_U_mi
	struct packlist *pm_pklist;	/* head of pack list (kept at CSS) */
	ulong	*pm_fsmp;		/* pointer into file system monitor
					 * table */
	struct fileSysQuota *pm_qInfo;  /* pointer to structure used for */
					/* manipulating user quotas, if NULL */
					/* then quotas are not on for this */
					/* file system. */
};

/* Nfs mounts use this field for the inode number of the root inode */
#define	gm_rootino	gm_tino

/*
 * Linked list of pack/site pairs.
 */
struct packlist {
	struct packlist *pkl_next;	/* linked list of packs with this gfs */
	fstore_t	pkl_fstore;	/* value of s_fstore */
	unsigned short	pkl_sbflags;	/* value of s_flags */
	siteno_t pkl_site;		/* site where this pack is mounted */
	pckno_t pkl_pack;		/* pack mounted at the above site */
};

#define PM(gp)	((struct pmount *)gp)
/* Some defined constants for return codes in netmsgs used when mounting
 * or unmounting a gfs
 */

#define GM_P_PAGE (BSIZE/sizeof (struct gmount))
#define GM_P_NPAGE (N_BSIZE/sizeof (struct gmount))
#define GFSISHERE	1	/* the gfs is mounted here too  */
#define GFSINUSE	2	/* an inode incore for that gfs */

/* Flags values for glogal gm_gflags; Some of these are obtained from the
	s_flags field of the superblock; */
#define GM_RDONLY	0x1	/* take from SB_RONLY; is global */
#define	GM_NOSUID	0x2	/* take from SB_NOSUID; is global */
#define	GM_SYNCW	0x8	/* take from SB_SYNCW; is global */
#define GM_REPLTYPE	0x20	/* take from SB_REPLTYPE; is global */
#define GM_USER		0x40	/* take from SB_USER; is global */
#define GM_REPLMNT	0x10	/* mounted at more than one site */
#ifdef BRIDGE
#define GM_BRIDGE	0x40	/* this file system is on a bridge */
#endif /* BRIDGE */

/* Flags values for local gm_lflags; Some of these are obtained from the
	s_flags field of the superblock; */
#define GM_PRIMPACK	0x1	/* take from SB_PRIMPACK; only applicable to
				   the local copy of the filesystem */
#define GM_BACKBONE	0x2	/* take from SB_BACKBONE; only applicable to
				   the local copy of the filsystem */
#define GM_OK		0x4	/* gmount entry in lastest gsmount copy */
#define GM_PATTACHED	0x8	/* gmount struct preceeds pmount */
#define GM_RECOVERY	0x10	/* recovery in progress on this gfs */
#define GM_BLK		0x20	/* commits blocked on this pack */
#define GM_TOKENS	GM_BLK	/* used by NFS fsys's during recovery to
			         * signal token recovery required */
#define GM_UMOUNT	0x40	/* attempting to unmount this filesystem,
				 * no opens with this SS */
#define GM_UPDATE	GM_RECOVERY
#define GM_MOUNTING	0x80	/* mount op in progress on this gfs. */
	/* Bits to send to remote site when doing a local mount */
#define GM_MNTSEND	(GM_RDONLY | GM_REPLTYPE | GM_USER)

/* defines for file system acces monitor */
#if defined(u370) || defined(vax)
#define MAXFSMTBL	30	/* maximum number of file systems that can 
				 * be monitored */
#endif /* (u370 || vax) */
#if	 defined(i386)
#define MAXFSMTBL	8	/* maximum number of file systems that can 
				 * be monitored */
#endif	/*  defined(i386) */

#ifdef KERNEL
extern  struct  gmount **gfshash;
extern  struct  buf *gsbuf[];
extern  struct  gmount *gsmount;
extern  short   gsmounts;
extern  short   gsbufs;
extern  short   gmounts;

extern	gfs_t	npmount;
extern	ulong	fsmtbl[][MAXSITE];
extern	gfs_t	fsm2gfs[];
extern	int	fsmindex;

extern	struct pmount	emptymount;	/* returned by gfsindex if no entry */

extern	struct packlist *allocPack();
extern	struct packlist *packFree;
extern	struct gmount   *addgfs();
extern  struct gmount	*addgs();
extern  struct gmount	*gsindex();
extern	struct gmount	*gfsindex();
extern  struct gmount	*gsentry();
extern  struct gmount   *pmdev();
extern commitcnt_t	gethwm();

#endif /* KERNEL */

/*
 * the following bits share the upper bits of the gfs long
 */
#define GFS_NFS		0x00008000
#define GFS_NUMBER	0x00003fff
#define GFS_SITE	0xffff0000
#define GFS_FLAGS	0x0000c000
#define GFS_EXTERNAL	0xffff3fff
#define GFSINDEX(gfs)   (*(struct gmount *)gfsindex(gfs))
/* convert GFS to external representation ignore flags */
#define XGFS(gfs)	((gfs) & (GFS_EXTERNAL))

/* superblock and mount macros */
/* the following assumes that gm_css is a short (siteno_t) */
#define CSSINFLUX	0x8000
#define CSSSITE		0x7fff
#define	CSS(gfs)	(GFSINDEX(gfs).gm_css & CSSSITE)
#define CSSP(gp)	(((struct gmount *)gp)->gm_css & CSSSITE)
#define	ISINFLUX(gfs)	(GFSINDEX(gfs).gm_css & CSSINFLUX)
#define	SETINFLUX(gfs)	(GFSINDEX(gfs).gm_css |= CSSINFLUX)

/* temporary macro for PMINDEX (same as GFSINDEX) */
#define PMINDEX(gfs)	(*(struct pmount *)gfsindex(gfs))
#define PINDEX(gfs)	((struct pmount *)gfsindex(gfs))
#define PMOUNT(gfs)	(PMINDEX(gfs))
#define GMOUNT(gfs)	(GFSINDEX(gfs))
#define GINDEX(gfs)	((struct gmount *)gfsindex(gfs))
/* convert from a pmount pointer (when the pmount table is being scanned) */
/* to a gfs for passing back accross the net.  (used in quota stuff) */
#define ISMNTP(gp)	((gp)->gm_lflags & GM_PATTACHED)
#define ISMOUNT(gfs)	(ISMNTP(GINDEX(gfs)))
#define ISSPARCE(gfs)	((gfs) & GFS_SITE)

#define ISNFS(gfs)	((gfs) & GFS_NFS)
#define ISNFSIP(ip)	(ISNFS((ip)->i_gfs))
#define ISMTNFS(gfs)	(ISNFS(gfs) && ISMOUNT(gfs))
#define ISMTNFSIP(ip)	((ip)->i_dev == nfsdev)

#define SUPBLK(gfs)	((struct filsys *)(PMINDEX(gfs).pm_bufp->b_un.b_addr))
#define SUPBLKP(gp)	((struct filsys *)((gp)->pm_bufp->b_un.b_addr))
#define	REPLFS(gfs)	(GFSINDEX(gfs).gm_gflags & GM_REPLTYPE)
#define	REPLFSP(gp)	((gp)->gm_gflags & GM_REPLTYPE)
#define	fsbackbone(gfs)	(GFSINDEX(gfs).gm_lflags & (GM_BACKBONE|GM_PRIMPACK))
#define	FSBACKBONE(gfs)	(GFSINDEX(gfs).gm_lflags & (GM_BACKBONE|GM_PRIMPACK))
#define	FSBACKBONEP(gp)	(gp->gm_lflags & (GM_BACKBONE|GM_PRIMPACK))
/* don't use non-backbone hwm's for remote operations */
#define	HWM(gfs)	(fsbackbone(gfs) ? gethwm(gfs) : 0)
#define HWMP(gp)  	(((gp)->gm_lflags & (GM_BACKBONE|GM_PRIMPACK)) ? gethwm((gp)->gm_gfs) : 0)
#define SYNCW(ip)	(GMOUNT(ip->i_gfs).gm_gflags & GM_SYNCW)
#define	LOCINUM	((ino_t)-1

#endif /* ~_h_MOUNT */
opy okêT¡ Q  $        ~  D‰*u™ˆ*D‰*     Ñ~  	                  ./usr/include/sys/msg.h /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)msg.h	16.3	LCC)	/* Modified: 18:15:20 9/16/89 */

#ifndef _h_MSG
#define _h_MSG

#ifndef _h_IPC
#ifdef  KERNEL
#include <ipc.h>
#else  /* ~KERNEL */
#include <sys/ipc.h>
#endif /* ~KERNEL */
#endif  /* _h_IPC */

/*
**	IPC Message Facility.  Added into LOCUS by Brett Fleisch.
*/

/*
**	Implementation Constants.
*/

#define	PMSG	(PZERO + 2)	/* message facility sleep priority */

/*
**	Permission Definitions.
*/

#define	MSG_R	0400	/* read permission */
#define	MSG_W	0200	/* write permission */

/*
**	ipc_perm Mode Definitions.
*/

#define	MSG_RWAIT	01000	/* a reader is waiting for a message */
#define	MSG_WWAIT	02000	/* a writer is waiting to send */
#define	MSG_SWAIT	04000	/* select operation is waiting for something */

/*
**	Message Operation Flags.
*/

#define	MSG_NOERROR	010000	/* no error if big message */

/*
**	Structure Definitions.
*/

/*
**	There is one msg queue id data structure for each q in the system.
*/

struct msqid_ds {
	struct ipc_perm	msg_perm;	/* operation permission struct */
	struct msg	*msg_first;	/* ptr to first message on q */
	struct msg	*msg_last;	/* ptr to last message on q */
	ushort		msg_cbytes;	/* current # bytes on q */
	ushort		msg_qnum;	/* # of messages on q */
	ushort		msg_qbytes;	/* max # of bytes on q */
	pid_t		msg_lspid;	/* pid of last msgsnd */
	pid_t		msg_lrpid;	/* pid of last msgrcv */
	time_t		msg_stime;	/* last msgsnd time */
	time_t		msg_rtime;	/* last msgrcv time */
	time_t		msg_ctime;	/* last change time */
#ifdef u370
	ushort		msg_rwcnt ;	/* waiting for read count */
	ushort		msg_wwcnt ;	/* waiting for write count */
#endif /* u370 */
};

/*
**	There is one msg structure for each message that may be in the system.
*/

struct msg {
	struct msg	*msg_next;	/* ptr to next message on q */
	long		msg_type;	/* message type */
	short		msg_ts;		/* message text size */
	caddr_t		msg_spot;	/* message text address */
	time_t		msg_time;	/* time msg was sent */
	suid_t		msg_uid;	/* sender's uid */
	sgid_t		msg_gid;	/* sender's gid */
	pid_t		msg_pid;	/* sender's pid */
	long		msg_nid;	/* sender's nid */
};

/*
**	User message buffer template for msgsnd and msgrecv system calls.
*/

struct msgbuf {
	long	mtype;		/* message type */
	char	mtext[1];	/* message text */
};

struct msgxbuf {
	time_t	mtime;		/* time message was sent */
	suid_t	muid;		/* author's effective uid */
	sgid_t	mgid;		/* author's effective gid */
	unsigned long mnid;	/* author's node id */
	pid_t	mpid;		/* author's process id */
	long	mtype;		/* message type */
	char	mtext[1];	/* message text */
};

/*
**	Message information structure.
*/

struct msginfo {
	int	msgmax,	/* max message size */
		msgmnb,	/* max # bytes on queue */
		msgmni,	/* # of message queue identifiers */
		msgssz,	/* msg segment size (should be word size multiple) */
		msgtql;	/* # of system message headers */
	ushort	msgseg;	/* # of msg segments (MUST BE < 32768) */
};

#endif /* ~_h_MSG */
fikêð P  $          D‰*u™ˆ*D‰*     Ïn  	                  ./usr/include/sys/msgbuf.h h s.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)msgbuf.h	16.3	LCC)	/* Modified: 18:16:10 9/16/89 */
#ifndef _h_MSGBUF
#define _h_MSGBUF

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  ~KERNEL
#include <sys/param.h>
#endif ~KERNEL
#endif  _h_PARAM

#define	MSG_MAGIC	0x063060L
#ifdef	NEWMSGBUF
#define	MSG_BSIZE	prfbuf.msg_size
#define	MSG_MIN		132	/* minimum size for printf buffer */

struct	prfbuf {
	long	msg_magic;
	long	msg_bufx;
	int	msg_size;
	char	*msg_bufc;
};
#ifdef KERNEL
extern struct	prfbuf prfbuf;
#endif KERNEL
#ifdef	vax
#define	MSG_LEN	(NBPG*CLSIZE - sizeof (struct prfbuf) )
#endif	vax

#else  ~NEWMSGBUF

#if	defined(NOKMAP) || !defined(CLSIZE)
#define		MSG_BSIZE	(BSIZE - 2 * sizeof (long))
#else	!(NOKMAP || !CLSIZE)
#define		MSG_BSIZE	(4096 - 2 * sizeof (long))
#endif	!(NOKMAP || !CLSIZE)

struct	prfbuf {
	long	msg_magic;
	long	msg_bufx;
	char	msg_bufc[MSG_BSIZE];
};

#define	 MSGBUFPAGES	(sizeof (struct prfbuf)/NBPG)

#ifdef KERNEL
extern  struct	prfbuf prfbuf;
#endif KERNEL

#endif ~NEWMSGBUF
#endif ~_h_MSGBUF
trkêB	 O  $        	  D‰*u™ˆ*D‰*     ¯Ž	  	                  ./usr/include/sys/mtio.h h h s.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

/*	SCCSID(@(#)mtio.h	16.3	LCC)	/* Modified: 18:17:00 9/16/89 */
/*
 * Structures and definitions for mag tape io control commands
 */

/* mag tape io control commands */
#define MTIOCTOP	(('m'<<8)|1)	/* do a mag tape op */
#define MTIOCGET	(('m'<<8)|2)	/* get mag tape status */

/* structure for MTIOCTOP - mag tape op command */
struct	mtop	{
	short	mt_op;		/* operations defined below */
	daddr_t	mt_count;	/* how many of them */
};

/* operations */
#define MTWEOF	0	/* write an end-of-file record */
#define MTFSF	1	/* forward space file */
#define MTBSF	2	/* backward space file */
#define MTFSR	3	/* forward space record */
#define MTBSR	4	/* backward space record */
#define MTREW	5	/* rewind */
#define MTOFFL	6	/* rewind and put the drive offline */
#define MTNOP	7	/* no operation, sets status only */

/* define a few MT operations somebody left out of <sys/mtio.h> */
#define MTRETEN 8
#define MTERASE 9
/* extentions supported by the SCSI tape driver on the RT */
#define MTEOD   10  /* skip forward to end of data (count ignored) */
#define MTFSS   11  /* skip forward to n seqential filemarks */
#define MTBSS   12  /* skip backward to n seqential filemarks */
#define MTTS    13  /* select track n */
#define MTREMOVE 14 /* count =0/!=0 disallows/allows media removal */
#define MTLOAD   15  /* sends a SCSI load command (count ignored) */

/* structure for MTIOCGET - mag tape get status command */

struct	mtget	{
	short	mt_type;	/* type of magtape device */
/* the following two registers are grossly device dependent */
	short	mt_dsreg;	/* ``drive status'' register */
	short	mt_erreg;	/* ``error'' register */
/* end device-dependent registers */
	short	mt_resid;	/* residual count */
/* the following two are not yet implemented */
	daddr_t	mt_fileno;	/* file number of current position */
	daddr_t	mt_blkno;	/* block number of current position */
/* end not yet implemented */
};

/*
 * Constants for mt_type byte
 */
#define MT_ISTS		01
#define MT_ISHT		02
#define MT_ISTM		03
#define MT_ISMT		04
#define MT_ISUT		05

#ifndef KERNEL
#define DEFTAPE "/dev/rmt12"
#endif
sender'kêxQ N  $        ¸  D‰*u™ˆ*D‰*     Â¸  	                  ./usr/include/sys/mtpr.h h h s.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)mtpr.h	16.3	LCC)	/* Modified: 18:17:51 9/16/89 */
/* SCCSIDPUFF(@(#) mtpr.h 4.1 LM 12:54:15 4/23/85 C 22:12:49 4/23/85); */

#ifndef _h_MTPR
#define _h_MTPR

#if	defined(vax) || defined(SOFT_VAX)

/*
 * VAX processor register numbers
 */

#define	KSP	0x0		/* kernel stack pointer */
#define	ESP	0x1		/* exec stack pointer */
#define	SSP	0x2		/* supervisor stack pointer */
#define	USP	0x3		/* user stack pointer */
#define	ISP	0x4		/* interrupt stack pointer */
#define	P0BR	0x8		/* p0 base register */
#define	P0LR	0x9		/* p0 length register */
#define	P1BR	0xa		/* p1 base register */
#define	P1LR	0xb		/* p1 length register */
#define	SBR	0xc		/* system segment base register */
#define	SLR	0xd		/* system segment length register */
#define	PCBB	0x10		/* process control block base */
#define	SCBB	0x11		/* system control block base */
#define	IPL	0x12		/* interrupt priority level */
#define	ASTLVL	0x13		/* async. system trap level */
#define	SIRR	0x14		/* software interrupt request */
#define	SISR	0x15		/* software interrupt summary */
#define	ICCS	0x18		/* interval clock control */
#define	NICR	0x19		/* next interval count */
#define	ICR	0x1a		/* interval count */
#define	TODR	0x1b		/* time of year (day) */
#define	RXCS	0x20		/* console receiver control and status */
#define	RXDB	0x21		/* console receiver data buffer */
#define	TXCS	0x22		/* console transmitter control and status */
#define	TXDB	0x23		/* console transmitter data buffer */
#define	MAPEN	0x38		/* memory management enable */
#define	TBIA	0x39		/* translation buffer invalidate all */
#define	TBIS	0x3a		/* translation buffer invalidate single */
#define	PMR	0x3d		/* performance monitor enable */
#define	SID	0x3e		/* system identification */

#if VAX780
#define	ACCS	0x28		/* accelerator control and status */
#define	ACCR	0x29		/* accelerator maintenance */
#define	WCSA	0x2c		/* WCS address */
#define	WCSD	0x2d		/* WCS data */
#define	SBIFS	0x30		/* SBI fault and status */
#define	SBIS	0x31		/* SBI silo */
#define	SBISC	0x32		/* SBI silo comparator */
#define	SBIMT	0x33		/* SBI maintenance */
#define	SBIER	0x34		/* SBI error register */
#define	SBITA	0x35		/* SBI timeout address */
#define	SBIQC	0x36		/* SBI quadword clear */
#define	MBRK	0x3c		/* micro-program breakpoint */
#endif

#if VAX750
#define	MCSR	0x17		/* machine check status register */
#define	CSRS	0x1c		/* console storage receive status register */
#define	CSRD	0x1d		/* console storage receive data register */
#define	CSTS	0x1e		/* console storage transmit status register */
#define	CSTD	0x1f		/* console storage transmit data register */
#define	TBDR	0x24		/* translation buffer disable register */
#define	CADR	0x25		/* cache disable register */
#define	MCESR	0x26		/* machine check error summary register */
#define	CAER	0x27		/* cache error */
#define	IUR	0x37		/* init unibus register */
#define	TB	0x3b		/* translation buffer */
#endif

#endif	/* defined(vax) || defined(SOFT_VAX) */

#endif /* ~_h_MTPR */
kêô {  $        !  g‰*:˜ˆ*g‰*     ¡e!  
              ¾e  ./usr/include/sys/mtstream.h s.hH_SCCSID(@(#)mtstream.h	1.2    IBM AIX)    /* Modified: 20:01:07 7/15/92 */

/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/* 
 * io/mtPS2.h
 *
 * This file contains the include definitions for the 6157 streaming
 * tape adapter on the PS/2.
 *
 */

/*
 * Offsets into the io_bus_addrs array.  It will contain the I/O space
 * addresses of the adapter's registers; either the MCA values, listed
 * immediately below, or the ISA values which follow.
 */
#define	MTCR	0	/* control register */
#define MTDCR	1	/* diagnostic control register */
#define	MTDDPR	2	/* drive data port register */
#define	MTFBP1R	3	/* feedback port 1 register */
#define	MTFBP2R	4	/* feedback port 2 register */

/* 
 * I/O addresses for MCA bus
 */
#define	MCA_MTCR	0x3123	/* control register */
#define MCA_MTDCR	0x3124	/* diagnostic control register */
#define	MCA_MTDDPR	0x3125	/* drive data port register */
#define	MCA_MTFBP1R	0x3126	/* feedback port 1 register */
#define	MCA_MTFBP2R	0x3127	/* feedback port 2 register */

/* 
 * I/O addresses for ISA bus
 */
#define	ISA_MTCR	0x4219	/* control register */
#define ISA_MTDCR	0x4619	/* diagnostic control register */
#define	ISA_MTDDPR	0x5219	/* drive data port register */
#define	ISA_MTFBP1R	0x4A19	/* feedback port 1 register */
#define	ISA_MTFBP2R	0x4E19	/* feedback port 2 register */

#define NUM_IO_ADDRS	5

/*
 * The MCA version provides the DMA channel via a POS register while the
 * ISA version is "hard-wired" and is not available for software to read;
 * therefore, we define it here.
*/
#define ISA_DMA_CHAN	2

#define MT_INTLEV	6

/*
 * MTCR bits
 */
#define RESET	0x01	/* reset (+) */
#define ONLINE	0x02	/* online (+) */
#define REQUEST	0x04	/* request (+) */
#define INTENB	0x08	/* interrupt and DMA request enable (+) */
#define DACK	0x10	/* DACK (DMA Acknowledge) enable (+) */
#define TC	0x20	/* TC (Terminal count) enable (+) */
#define RPCL	0x40	/* Reset Parity Check Latch (+) */
#define	RIL	0x80	/* Reset Interrupt Latch (+) */

/* 
 * Diagnostic Control Register Bits
 */
#define	DIRECT	0x01	/* direction (+) */
#define DRDY	0x02	/* ready (+) */
#define ACK	0x04	/* acknowledge (+) */
#define DEXCEPT	0x08	/* exception (+) */
#define DSETTRA	0x10	/* set teransfer active (+) */
#define DEXTWRP	0x20	/* external wrap (+) */
#define DDMODE	0x40	/* diagnostic mode */
#define CLEARRL	0x80	/* clear ready latch */

/*
 * Feedback Port 1 Register Bits
 */
#define READYL	0x01	/* Ready Latch (+) */
#define SETTRA	0x02	/* Set transfer active (+) */
#define EXTWRP	0x04	/* External Wrap (+) */
#define TCENA	0x08	/* Terminal Count enable (+) */
#define DMAREQ	0x10	/* DMA request (-) */
#define INTTR	0x20	/* Interrupt (-) */
#define TRANSFR	0x40	/* Transfer (-) */
#define DMODE	0x80	/* diagnostic mode (+) */

/*
 * feedback port 2 register bits 
 */
#define	DIRECT	0x01	/* direction (-) */
#define READY	0x02	/* ready (-) */
#define ACK	0x04	/* acknowledge (-) */
#define EXCEPT	0x08	/* exception (-) */
#define READL	0x10	/* read latch (+) */
#define WRITEL	0x20	/* write latch (+) */
#define READSL	0x40	/* read status latch (+) */
#define PCHKL	0x80	/* parity check latch (+) */

/*
 * Controller Commands
 */
#define SELECTR	0x01	/* select regular */
#define SELECTL 0x11	/* select & lock */
#define BOT	0x21	/* rewind */
#define	RET	0x24	/* retention */
#define ERASE	0x22	/* erase */
#define	WRITED	0x40	/* write data */
#define	WRITEM	0x60	/* write file mark */
#define	WRITEMF	0x62	/* write file mark on the fly */
#define READD	0x80	/* read data */
#define	READDF	0x82	/* read data on the fly */
#define	SPACER	0x89	/* space reverse */
#define	READFM	0xa0	/* read file mark */
#define	READST	0xc0	/* read status */
#define READEST	0xc4	/* read extended status */
#define TEST1	0xc2	/* self-test 1 */
#define	TEST2	0xca	/* self-test 2 */
#define	TEST3	0xcb	/* self-test 3 */

/*
 * Status Bits (status commmand)
 */
#define ST0	0x0080	/* some bit is on in status byte 0 */
#define CNI	0x0040	/* cartridge not in place */
#define DFF	0x0020	/* device fault flag - catastrophic error */
#define	WRP	0x0010	/* write protected */
#define EOM	0x0008	/* end of media */
#define UDA	0x0004	/* unrecoverable data- hard error(status read resets) */
#define BNL	0x0002	/* block in error not located (read status resets) */
#define FIL	0x0001	/* file mark detected (read status resets) */

#define	ST1	0x8000	/* some bit is on in status byte 1 */
#define ILL	0x4000	/* illegal command (read status resets) */
#define NDT	0x2000	/* no data detected (read status resets) */
#define MBD	0x1000	/* marginal block detected (read status resets) */
#define BOM	0x0800	/* beginning of tape */
#define	BPE	0x0400	/* bus parity error (read status resets) */
#define ERM	0x0200	/* end of recorded media (read status resets) */
#define	POR	0x0100	/* power on/reset occurred (read status resets) */
R	0x312kê€i M  $        *  E‰*v™ˆ*E‰*     ó½*  	                  ./usr/include/sys/nch.h /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)nch.h	16.3	LCC)	/* Modified: 18:18:40 9/16/89 */

struct nmchn {
	PADOPEN(Nclongs)
	long Nch_ignoremap;
	long Nch_icsite;
	long Nch_nmount;
	long Nch_nsite;
	long Nch_sitetype;
	long Nch_blksize;
	long Nch_window;
	long Nch_pidhash;
	PADCLOSE(Nclongs, xNcl, xUNcl)

	PADOPEN(Ncchars)
	char Nch_mm_cmaj;
	char Nch_sy_cmaj;
	PADCLOSE(Ncchars, xNcc, xUNcc)
};

#define nch_ignoremap	xUNcl.xNcl.Nch_ignoremap
#define nch_icsite	xUNcl.xNcl.Nch_icsite
#define nch_nmount	xUNcl.xNcl.Nch_nmount
#define nch_nsite	xUNcl.xNcl.Nch_nsite
#define nch_sitetype	xUNcl.xNcl.Nch_sitetype
#define nch_blksize	xUNcl.xNcl.Nch_blksize
#define nch_window	xUNcl.xNcl.Nch_window
#define nch_pidhash	xUNcl.xNcl.Nch_pidhash
#define nch_mm_cmaj	xUNcc.xNcc.Nch_mm_cmaj
#define nch_sy_cmaj	xUNcc.xNcc.Nch_sy_cmaj
/* 
 *kêä´ L  $        ¼  E‰*v™ˆ*E‰*     Yˆ¼  	              ©Ž  ./usr/include/sys/netctrl.h  s.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

/*
 * netctrl.h
 *
 *	this header file defines the data structures and macros that
 *	are used to control Locus network activity
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)netctrl.h	16.4	LCC)	/* Modified: 18:27:25 9/22/89 */

#if ! defined(_h_NETCTRL)
#define _h_NETCTRL

#if ! defined(_h_NETSTAT)
#include <sys/netstat.h>
#endif /* ! defined(_h_NETSTAT) */

#if ! defined(_h_TYPES)
#include <sys/types.h>
#endif /* ! defined(_h_TYPES) */

/* net_options */
#define NET_FLOW	0	/* start/stop locus traffic	*/
#define NET_RESERVED	1	/* reserved	 		*/
#define NET_STATS	2	/* get network statistics	*/
#define SITE_STATS	3	/* get site statistics		*/
#define MSG_STATS	4	/* get message statistics	*/
#define SITE_PARMS	5	/* get/set site parameters	*/
#define	NET_TOPWAIT	6	/* Wait for topchg state change */

#define MAX_NET_OPT	6	/* greatest valid option	*/

#define SET_OPT		128	/* bit indicates data should be */
				/* set or reset as apropriate	*/

/* parameters for option NET_FLOW */
#define NET_STOP	0	/* stop locus traffic		*/
#define NET_START	1	/* start locus traffic		*/
#define NET_JOIN	2	/* join the locus cluster	*/

/* values for site checksumming */
#define CKS_ON		0	/* checksumming on */
#define CKS_OFF		1	/* checksumming off */

/* net statistics structure */
struct net_stats {
	long ns_forwarded;	/* number of forwarded packets */
	long ns_cantfwd;	/* number of unforwardable packets */
	long ns_badsite;	/* number of packets to an illegal site */
	long ns_badpkts;	/* number of malformed packets */
};

struct site_stat {
	u_long ss_in_pkts;	/* # of incomming packets */
	u_long ss_out_pkts;	/* # of outgoing packets */
	u_long ss_dups;		/* # of duplicate packets */
	u_long ss_retrans;	/* # of retransmitted packets */
	u_long ss_msgdrops;	/* # of messages dropped for lack of a netmsg */
	u_long ss_bufdrops;	/* # of messages dropped for lack of a buffer */
	u_long ss_xmterrs;	/* # of hard transmission failures */
	u_long ss_crcerrs;	/* # of checksum errors */
	u_long ss_badmsg;	/* # of messages w/ invalid length or type */
	u_long ss_badsite;	/* # of messages w/ invalid, ignored site */
	u_long ss_badseq;	/* # of messages received out of order */
	u_long ss_ack_blocks;	/* # of acknowledgement window blocks */
	u_long ss_s_ack_blocks; /* # of special ack window blocks */
	time_t ss_connect_time; /* time in contact with foreign site */
	u_short ss_channel;	/* current channel number */
	u_short ss_chn_opens;	/* number of sucessful channel opens */
	char ss_chan_stat;	/* current channel status */
	char ss_site_stat;	/* current site status */
};

/* For lame compilers with only 7 characters recognition */
#define site_stats st_stats

struct site_stats {
	int ss_num_sites;	/* number if site_stat entries following */
	struct site_stat ss_entries[1];	/* first site_stat entry */
};

struct msg_stat {
	u_long ms_msgin[NCLASS];	/* # of messages received, by class */
	u_long ms_msgout[NCLASS];	/* # of messages xmitted, by class */
	u_long ms_rsptimes[NCLASS];	/* average time until msg completion */
	u_long ms_untimed;		/* # of untimed messages sent */
};

/* For lame compilers with only 7 characters recognition */
#define msg_stats m_stats

struct msg_stats {
	int ms_num_sites;	/* number of msg_stat entries following */
	struct msg_stat ms_entries[1];	/* first msg_stat entry */
};

struct site_parm {
	siteno_t sp_route;	/* site to whom to route net messages */
	u_short sp_timeout;	/* timeout value for retransmissions */
	u_short sp_block_size;	/* size of site's file blocks */
	u_char	sp_retries;	/* # of retransmissions for a net message */
	u_char	sp_window;	/* ack window for normal messages */
	u_char	sp_s_window;	/* ack window for special messages */
	u_char  sp_checksum;	/* 0 => no checksumming, 1 => checksumming */
};

/* For lame compilers with only 7 characters recognition */
#define site_parms st_parms

struct site_parms {
	int sp_num_sites;		/* # of site_parm entries following */
	struct site_parm sp_entries[1];	/* first site_parm entry */
};

#endif /* ! defined(_h_NETCTRL) */
ll Rkê^R ±  ÿ¡             _‰*_‰*_‰*          	                  ./usr/include/sys/netisr.h   s.h../net/netisr.h kê²w K  $        ­£  E‰*w™ˆ*E‰*     A‡­£  	              Ãg  ./usr/include/sys/netmsg.h   s.h/*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986, 1988, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)netmsg.h	16.13	AIX)	/* Modified: 13:07:05 8/24/90 */

/*
 * Netmsg buffers are used to send small requests and responses across the
 * network.  Server processes look through this structure for work to do.
 * Processes also wait on elements of this structure for responses to
 * requests sent over the network.  A  netmsg buffer is linked to
 * nmhdr if it is a request waiting for a svrproc to process;  While it
 * is being used it is not on any queue and when it is free it is on
 * nmfreelist.	Messages are sent over the network directly from this structure.
 * The first few fields are strictly local and are not transmitted.  The
 * organiziation is as follows:
 *	1. local fields like link pointers and flags
 *	2. netmsg fields which are sent on all messages.
 *	3. An overlay area which can have one of several formats.  Those
 *	   formats are declared in .h files related to the type of message
 *	   being sent.
 */

#ifndef _h_NETMSG
#define _h_NETMSG

#ifdef _MBCS

#ifndef _h_TYPES
#ifdef KERNEL
#include <types.h>
#else /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* _h_TYPES */

#ifndef _h_PARAM
#ifdef KERNEL
#include <param.h>
#else /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif /* _h_PARAM */

union net_obj {
	struct netmsg *msg_obj;
	struct net_packet *packet_obj;
};

struct net_packet {
	/* this MUST be the first member of the net message */
	/* NEEDSWORK: struct netmsg or struct net_packet? */
	union net_obj Np_forw;	/* pointer to next net object */
	long np_flag;		/* local net message flags */
	char *np_d_addr;	/* address of attached data */
	long np_d_count;	/* number of bytes of attached data */
	time_t	np_ltime;	/* local timestamp */
};

#define np_forw		Np_forw.packet_obj

struct netmsg
{
	/*
	 * this structure exists so we can "cleanly" determine the
	 * size of the local portion of the netmsg header. */
	struct NMLOCALHDR {
		struct net_packet Nm_head;
#define nm_forw		NM_LOCHDR.Nm_head.Np_forw.msg_obj
#define nm_flag		NM_LOCHDR.Nm_head.np_flag
#define nm_d_addr	NM_LOCHDR.Nm_head.np_d_addr
#define nm_d_count	NM_LOCHDR.Nm_head.np_d_count
#define nm_ltime	NM_LOCHDR.Nm_head.np_ltime
#define nm_protocol	NM_LOCHDR.Nm_head.np_protocol
		/*
		 * link to buf structure.  This is used locally only
		 * to point to a related big data buffer that is
		 * coming from or going out across the network.
		 */
		struct	buf  *Nm_buf;
#define nm_buf		NM_LOCHDR.Nm_buf
		/*
		 * nm_svrseq is a sequencing field used by certain
		 * types of messages to ensure that order of arrival
		 * of requests matches order of service.  The field
		 * is generated at the receiving site if requested.
		 * Information about whether the field need be
		 * generated and the formula to be used in generating
		 * it is kept in netmsgsw table.
		 */
		long		Nm_svrseq;
#define nm_svrseq	NM_LOCHDR.Nm_svrseq
		siteno_t	Nm_rsite;	/* routed to site	*/
#define nm_rsite	NM_LOCHDR.Nm_rsite
		u_long Nm_res_received;		/* bit-map of responses */
						/* received so far	*/
#define nm_res_received NM_LOCHDR.Nm_res_received
		short		Nm_proc;	/* process holding this nm */
#define nm_proc		NM_LOCHDR.Nm_proc
	} NM_LOCHDR;

/* Start of Fields which are sent over the network to foreign sites. */

/*
 * WARNING: This must always point at the beginning of the network
 * part of the netmsg.	Really, this network part should be a substructure,
 * like NM_LOCHDR.
 */
#define  nm_netprt	nm_version	/* first field sent across the net */
/*
 * First come a few special fields which are hand-aligned.  Be careful.
 * These are kept here so that they can be held fixed for all eternity.
 * This assumes that sizeof(align_t)/sizeof(char) == 4.
 */
	char		nm_version;	/* version of net message */
	char		nm_level[sizeof(align_t) - sizeof(char) /*nm_version*/];
	unsigned long	nm_cluster;	/* Canonical byte order, must match */
/*
 * Since NM_ADDR is a pointer, it is NEVER flipped, so it is not
 * part of NMlongs (though due to its declaration, it IS padded correctly).
 */
	struct netmsg *NM_ADDR;
#define  nm_nmaddr	NM_ADDR

/*
 * All the long fields from the fixed part of a netmsg come next.
 */
	PADOPEN(NMlongs)
	u_long	Nm_ack;		/* this message ack's up to...	      */
	u_long	Nm_ack_needed;	/* this message needs this ack number */
	long	Nm_base;	/* base of multiple message request   */
	long	Nm_cur;		/* current part of multiple request   */
	long	Nm_last;	/* end of multiple message request    */
	u_long	Nm_res_needed;	/* response mask for multiple request */
	time_t	Nm_time;	/* timestamp */
	PADCLOSE(NMlongs, xNMlongs, xUNMlongs)
			/* number of longs worth flipping in netmsg hdr. */
#define NNMLONGS	(sizeof(struct NMlongs) / sizeof(long))
#define nm_ack			xUNMlongs.xNMlongs.Nm_ack
#define nm_ack_needed		xUNMlongs.xNMlongs.Nm_ack_needed
#define nm_req_base		xUNMlongs.xNMlongs.Nm_base
#define nm_req_cur		xUNMlongs.xNMlongs.Nm_cur
#define nm_req_last		xUNMlongs.xNMlongs.Nm_last
#define nm_res_needed		xUNMlongs.xNMlongs.Nm_res_needed
#define nm_time			xUNMlongs.xNMlongs.Nm_time

	PADOPEN(NMshorts)
	short		Nm_retcode;	/* return code on requests	   */
	u_short		Nm_size;	/* size of this net message	   */
	u_short		Nm_channel;	/* channel id			   */
	siteno_t	Nm_fsite;	/* foreign (final receipient) site */
	siteno_t	Nm_lsite;	/* local (originator) site	   */
	u_short		Nm_req_size;	/* size of request block	   */
	PADCLOSE(NMshorts, xNMshorts, xUNMshort)
			/* Number of shorts in fixed part of netmsg */
#define NNMSHORTS	(sizeof (struct NMshorts) / sizeof (short))
#define nm_retcode	xUNMshort.xNMshorts.Nm_retcode
#define nm_size		xUNMshort.xNMshorts.Nm_size
#define nm_channel	xUNMshort.xNMshorts.Nm_channel
#define nm_fsite	xUNMshort.xNMshorts.Nm_fsite
#define nm_lsite	xUNMshort.xNMshorts.Nm_lsite
#define nm_req_size	xUNMshort.xNMshorts.Nm_req_size

	PADOPEN(NMchars)
	char		Nm_type;	/* message type			*/
			/* nm_order detects byte and word ordering differences
			 * between different machines */
	char		Nm_netflags;	/* low level network flags:
					 * tells byte order, and indicates
					 * broadcast messages. */
	unsigned char	Nm_header_cks;	/* header checksum */
	unsigned char	Nm_data_cks;	/* data checksum */
	PADCLOSE(NMchars, xNMchars, xUNMchar)
#define nm_type		xUNMchar.xNMchars.Nm_type
#define nm_netflags	xUNMchar.xNMchars.Nm_netflags
#define nm_header_cks		xUNMchar.xNMchars.Nm_header_cks
#define nm_data_cks		xUNMchar.xNMchars.Nm_data_cks
/*
 * nm_howflip is filled in just before a message is flipped, and tells
 * how to flip the message to make it make sense
 */
#define nm_howflip	xUNMchar.xNMchars.Nm_netflags
/* The overlay portions of the netmsg are overlayed with the nm_var field.
 * The size, NMVARSIZE is chosen to be at least as long as the longest
 * variable part.  This value must be adjusted if any of the overlayed
 * structures becomes larger than NMVARSIZE.  If overlooked, this condition
 * is checked at compile time since each of the overlayed structures is
 * accompanied by the use of the CHECKNMVARSIZE macro (defined in types.h).
 */
	char nm_var[NMVARSIZE];
};
#ifdef KERNEL
/*
 * values returned by the network message handlers to indicate acceptance
 * of a message or the reason for rejection.
 */

#define ACCEPT		0	/* message accepted */
#define REJECT_CHKS	1	/* message rejected--bad checksum */
#define REJECT_CHAN	2	/* channel should be rejected */
#define REJECT_SITE	3	/* cannot open a channel to this site */
#define REJECT_DUP	4	/* message rejected--dup or out of order */
#define REJECT_INVAL	5
#define REJECT_RESRC	6	/* message rejected--out of resources */

extern struct netmsg **netmsg;
extern struct netmsg nmfreelist;
extern struct netmsg nmhdr;
extern	struct netmsg  *getnmsg();
extern siteno_t fifo_site();
extern int free_netmsgs;		/* number of netmsgs on freelist */
extern int n_in_msgs;			/* Minimum # of messages for input */

#ifdef	SEVENCHARNAMES			/* Keep the many compilers happy */
#define netwantsnm	nwnm
#endif	/* SEVENCHARNAMES */

/*
 * For debugging purposes, use netmsgs in a fifo manner so that they stick
 * around longer before being overwritten.  This method is NOT recommended!
 * It may obscure hidden race conditions and is far less efficient than LIFO
 * processing.
 */
#if ! defined(NOCHECKS)
#define NETMSG_FIFO
extern struct netmsg *netmsg_tail;	/* ptr to tail of free netmsg queue */
#endif /* ! defined(NOCHECKS) */

extern	netmap_t netwantsnm;

extern int    nmnetsize;    /* size of a netmsg as it goes out on the net */

/*
 * This is macro for sleeping and waiting for a response to a network
 * message.  The spl6 must be done to prevent a race which would have
 * the process sleep after the wakeup had been done.  This could happen
 * if the response comes back after the while loop test and before
 * the sleep
 */
#define NMWAITbody(nmp) {					\
	spl_t sss = spl6();				\
							\
	while (! ((nmp)->nm_flag & N_DONE)) {		\
		(void) sleep((caddr_t) (nmp), PRINM);	\
		if ((nmp)->nm_channel != site[(nmp)->nm_fsite].si_channel) \
			(nmp)->nm_retcode = ESITEDN1;	\
	}						\
	splx(sss);  }

#if !defined(UNFAST) && !defined(CODE_COVERAGE)
#define	NMWAIT	NMWAITbody
#endif /* !defined(UNFAST) && !defined(CODE_COVERAGE) */

#endif /* KERNEL */

/*
 * The flags in nm_flag are a combination of network message and local flags
 *
 */
/*  Local Flags */
#define N_NEEDRESP	0x01L	/* net message request needs a response */
#define N_DONE		0x02L	/* I/O for this net message is completed */
#define N_BUSY		0x04L	/* not on netfreelist			 */
#define N_NETINM	0x08L	/* This is a net input netmsg */
#define N_ERROR		0x10L	/* error, details are in nm_retcode */
#define N_USER_ACCESS	0x20L	/* this netmessage is for a user packet */
#define N_WANTED	0x40L	/* do wakeup when not busy		 */
#define N_NOTMAPPED	0x80L	/* updprop - empty page, not allocated */
#define N_RELSE		0x100L	/* net message can be freed upon posting */
#define N_WAKEUP	0x200L	/* wakeup net message */
#define N_B_RELSE	0x400L	/* attached buffer is to be released */
#define N_B_IODONE	0x800L	/* attached buffer is to passed to iodone */
#define N_RELSE_ON_XMIT 0x1000L /* release net message on transmit done   */
#define N_PRIVATE	0x2000L /* private netmessage, do not release */
#define N_ON_ACK_QUEUE	0x4000L /* is net message waiting on an ack queue */
#define N_FORWARD	0x8000L /* this message is being forwarded */
#define N_IN_DRIVER	0x10000L/* the driver currently has the net message */
#define N_RESP_WAIT	0x20000L/* net message is waiting for a response */
#define N_PROC_LOCKED	0x40000L/* a process has been charged for this lock */
#define N_LOCKWANTED	0x80000L/* charged process waiting for a netmsg */
#define N_B_IOWAIT	0x100000L/* someone is doing a iowait() on buf */

/*
 * network flags. (nm_netflags, a.k.a. nm_howflip)
 */
#define NNF_ORDERMASK	0x3	/* 2 low order bits for byte order (flip.h) */
#define NNF_BROADCAST	0x4	/* the message was broadcast, don't forward */
#define NNF_NEEDACK	0x8	/* let the remote side know that we need    */
				/* this message acked because we've hit our */
				/* limit of outstanding messages	    */
#define NNF_SPCL_ACK	0x10	/* ack numbers are in "special" namespace   */
#define	NNF_NACK	0x20	/* tell remote that we missed a message	    */
#define	NNF_QUENCH	0x40	/* tell remote to do synchronous writes	    */

/*
 * Descriptions of the different messages, the actual definitions are below.
 *
 * Basic communication messages.
 *	NM_NOP		nothing message, only carries piggy-back ack
 *	NM_CHNOPN	opens communication between sites
 *	NM_RCHNOPN	treated as a request, different number
 *
 * Filesystem messages
 *	NM_NAMEI(R)	follow a remote path and open a file (nmnamei)
 *	NM_OPEN(R)	open a file sent from US to CSS (nmlfilsys)
 *	NM_OPENL(R)	return first data block along w/NM_OPEN info (nmlfilsys)
 *	NM_STAT(R)	stat a file (nmlfilsys)
 *	NM_BESS(R)	CSS request for SS open. (nmlfilsys)
 *	NM_DEVOPEN(R)	do device open routine, US to SS (nmsfilsys)
 *	NM_READ(R)	US read from SS (nmrdwr)
 *	NM_WRITE	US write to SS (nmrdwr)
 *	NM_SWRITE(R)	US write to SS with response (nmrdwr)
 *	NM_ERR		SS to US error notification (nmsfilsys)
 *	NM_USCOMMIT(R)	US commits changes at SS (nmlfilsys).
 *	NM_ABORT(R)	US aborts changes at SS (nmlfilsys).
 *	NM_USCLOSENC	US close at SS (nmsfilsys)
 *	NM_SSCLOSENC	SS close at CSS (nmsfilsys)
 *	NM_COMCLOSE	US close with commit at SS (nmlfilsys).
 *	NM_CLOSEUS	SS requests the US to close (nmsfilsys)
 *	NM_CLOSESS	CSS requests the SS to close (nmsfilsys)
 *	NM_CLSFSS	SS update notification to US (nmlfilsys)
 *	NM_TRUNC	US truncates file at SS (nmsfilsys).
 *	NM_UPDPROP	CSS update notification to SS's (nmlfilsys).
 *	NM_REQLBNLIST(R) propin page list request from propout site (nmsfilsys).
 *	NM_CHINODE(R)	change specific inode (nmlfilsys)
 *	NM_FUNBLOCK	FIFO reader unblock (nmrdwr)
 *	NM_NFSNM	NFS - namei (symlink/stat/nfs) to CSS
 *	NM_NFSRNM	NFS - rename
 *	NM_NFSRDDIR	NFS - read directory
 *
 * Mount/unmount messages
 *	NM_MTNOTIF(R)	filesystem mount notification (nmmount)
 *	NM_MTNFS	NFS  filesystem mount notification (nfsmount)
 *	NM_OKTOUMT(R)	prepare to unmount filesystem (nmmount)
 *	NM_UMTNOTIF(R)	filesystem unmount notification (nmmount)
 *	NM_RECDONE	recovery finished on a gfs (nmmount)
 *
 * Remote process messages
 *	NM_FPR(R)	migrate/exec/fork/run process request (nmnetproc)
 *	NM_SENV(R)	send process environment (nmnetproc)
 *	NM_SPDTA(R)	send process data area (nmnetproc)
 *	NM_SSIG(R)	send signal info (nmnetproc)
 * #ifdef _MBCS
 *	NM_SCSET(R)	send codeset information (nmnetproc)
 * #endif
 *	NM_SLOCK(R)	send open file record locks (nmnetproc)
 *	NM_SOFILE(R)	send open file info (nmnetproc)
 *	NM_FORK(R)	send fork specific data (nmnetproc)
 *	NM_FRKDNE	fork/run completed; no response (nmnetproc)
 *	NM_EXECDNE	migrate/exec completed; long response (nmnetproc)
 *
 * Process tracking messages
 *	NM_PSPAR(R)	Update (pid,site) info at parent (nmproctrack)
 *	NM_PSORIG	Update (pid,site) info at origin site (nmproctrack)
 *	NM_PSGRP(R)	Update (pgrp,site) info at group orig site (nmproctrack)
 *	NM_PSTOP	Update origin site info at topology change (nmproctrack)
 *	NM_WAIT		get data from remote zombie (nmwait)
 *	NM_ABNDN	remote exit message sent to children (nmabandn)
 *	NM_PRIO		get/set process priority (nmsignal)
 *	NM_GRPPRIO	get/set process group priority (nmsignal)
 *	NM_UIDPRIO	get/set all process priorities owned by uid (nmsignal)
 *	NM_GGROUPS	get session/pgrps
 *
 * Topology change messages
 *	NM_PROBE	Null "are you there?" message (nmtopchg)
 *	NM_SITEDOWN(R)	request to join new partition (nmtopchg)
 *	NM_NEWPARTSET	new partition notification (nmtopchg)
 *	NM_GETTOP	request to get global state (nmtopchg)
 *	NM_PMOUNT	local state information (nmtopchg)
 *	NM_NEWTOP	global state notification (nmtopchg)
 *	NM_SNDIND(R)	request SS inode table info (nmtopchg)
 *
 * Token passing messages
 *	NM_AWARDTOK	Grant token to US (nmtoken)
 *	NM_CLRTOK	Clear TCB at TMS (nmtoken)
 *	NM_RELTOK	TMS Release token request to US (nmtoken)
 *	NM_RQSTOK	Request for token from US to TMS (nmtoken)
 *	NM_TOKINIT	Initialize token data structures at SS (nmtoken)
 *	NM_TOKRLSD	US releases token to TMS (nmtoken)
 *	NM_STATTOK	CSS requests status updates from token holder
 *	NM_FIFOWKUP	TMS notifies of FIFO token status change
 *
 * Remote signal messages
 *	NM_SIGPROC(R)	Send signal to a process (nmsignal)
 *	NM_SIGGRP(R)	Send signal to a process group (nmsignal)
 *	NM_SIGUID(R)	Send signal to processes with matching uid (nmsignal)
 *	NM_GSPGRP(R)	Get/Set pgrp for a process (nmsignal)
 *	NM_INFERIOR(R)	Find ancestral processes (nminferior).
 *
 * File locking messages
 *	NM_USLOCKF(R)	lockf request from the us to ss (nmlockf)
 *	NM_SSLOCKF(R)	lockf action from the ss to each us (nmlockf)
 *
 * Remote character device messages
 *	NM_RCDW(R)	RCD writes (nmrcd)
 *	NM_RCDR(R)	RCD reads (nmrcd)
 *	NM_RC_RWDLY	Read/Write Delayed response (nmrcd)
 *	NM_RCDIO(R)	RCD ioctls (nmrcd)
 *	NM_RC_IODLY	Ioctl Delayed response (nmrcd)
 *	NM_RCDCAN	Cancel RCD request due to signal (nmrcd)
 *	NM_TTYHUP	send msg to remote tty site to do ttyhup
 *
 * Remote sleep/wakeup messages
 *	NM_WAKEUP	Wake a process sleeping on a remote event (nmwakeup)
 *	NM_SLPCAN	Process woke up on its own (nmwakeup)
 *
 * Remote select messages
 *	NM_SELECT	Remote selscan
 *	NM_SELCAN	Cancel remote select
 *	NM_SELWAKE	Remote select delayed response
 *
 *
 * Quota Messages
 *	NM_QSETDLIM	Update SS limit info about user.
 *	NM_QGETDLIM	Retrieve SS limit info about user.
 *	NM_QSETDUSE	Update SS limit info about user.
 *	NM_QSYNC	Sync in core quota info to disk.
 *	NM_QSETWARN	Set warning limits.
 *	NM_QDOWARN	Generate warnings for user for filesystems over quota.
 *	NM_QSETUID	New user logging in, update caches.
 *
 * Miscellaneous messages
 *	NM_DEBUG	remote console output control, for debugging (nmdebug)
 *	NM_USTAT	Remote ustat (nmustat)
 *	NM_DUSTAT	Remote dustat (nmdustat)
 *	NM_DPACKLST	Get packlist info for dustat() (nmdustat + buffer)
 *	NM_GETCOMLIST	Request for superblock commit list (nmmount)
 *	NM_BRIDGE	Message requesting OS-bridge service (nmlfilsys)
 *	NM_TIME_SYNC	Synchronize network clocks (nmtimesync)
 *	NM_FIFOIOC	Update SS inode of FIFO
 *	NM_PIPESIZE	Ask SS for current i_size status of a FIFO
 *
 * Other NM_ related defines.
 *	MAXMSG		Last used message number
 */


/*
 * definitions of message types described above
 *
 *  *********	Do not change this without updating
 *  *********	- netmsgsw in netmsgsw.c
 */
#define NM_NOP		0
#define NM_CHNOPN	1
#define NM_OPEN		2
#define NM_BESS		3
#define NM_DEVOPEN	4
#define NM_READ		5
#define NM_WRITE	6
#define NM_ERR		7
#define NM_USCLOSENC	8
#define NM_SSCLOSENC	9
#define NM_CLOSEUS	10
#define NM_CLOSESS	11
#define NM_CLSFSS	12
#define NM_USCOMMIT	13
#define NM_ABORT	14
#define NM_TRUNC	15
#define NM_UPDPROP	16
#define NM_REQLBNLIST	17
#define NM_MTNOTIF	18
#define NM_OKTOUMT	19
#define NM_UMTNOTIF	20
#define NM_FPR		21
#define NM_SENV		22
#define NM_SPDTA	23
#define NM_FRKDNE	24
#define NM_EXECDNE	25
#define NM_PSPAR	26
#define NM_PSORIG	27
#define NM_PSGRP	28
#define NM_PSTOP	29
#define NM_WAIT		30
#define NM_ABNDN	31
#define NM_PROBE	32
#define NM_SITEDOWN	33
#define NM_NEWPARTSET	34
#define NM_GETTOP	35
#define NM_PMOUNT	36
#define NM_NEWTOP	37
#define NM_SNDIND	38
#define NM_CHINODE	39
#define NM_SSIG		40
#define NM_AWARDTOK	41
#define NM_CLRTOK	42
#define NM_RELTOK	43
#define NM_RQSTOK	44
#define NM_TOKINIT	45
#define NM_TOKRLSD	46
#define NM_SIGPROC	47
#define NM_SIGGRP	48
#define NM_SIGUID	49
#define NM_GSPGRP	50
#define NM_INFERIOR	51
#define NM_DEBUG	52
#define NM_USLOCKF	53
#define NM_DIRSTAT	54
#define NM_RCDW		55
#define NM_RCDR		56
#define NM_RC_RWDLY	57
#define NM_RCDIO	58
#define NM_RC_IODLY	59
#define NM_RCDCAN	60
#define NM_GETCOMLIST	61
#define NM_USTAT	62
#define NM_FUNBLOCK	63
#define NM_WAKEUP	64
#define NM_SLPCAN	65
#ifdef BRIDGE
#define NM_BRIDGE	66
#endif /* BRIDGE */
#ifdef TIME_SYNC
#define NM_TIME_SYNC	67
#endif /* TIME_SYNC */
#define NM_SELECT	68
#define NM_SELCAN	69
#define NM_SELWAKE	70
#define NM_MTNFS	71
#define NM_NFSNM	72
#define NM_NFSRNM	73
#define NM_STATTOK	74
#define NM_GGROUPS	75
#define NM_FIFOWKUP	76
#define NM_FORK		77
#define NM_PRIO		78
#define NM_GRP_PRIO	79
#define NM_UID_PRIO	80
#define NM_COMCLOSE	81
#define NM_SITE		82
#define NM_SLOCK	83
#define NM_NAMEI	84
#define NM_STAT		85
#define NM_SWRITE	86
#define NM_DUSTAT	87
#define NM_PACKLST	88
#define NM_RCHNOPN	89
#define NM_OPENL	90
#define	NM_SOFILE	91
#define	NM_QSETDLIM	92
#define	NM_QGETDLIM	93
#define	NM_QSETDUSE	94
#define	NM_QSYNC	95
#define	NM_QSETWARN	96
#define	NM_QDOWARN	97
#define	NM_QSETUID	98
#define NM_UPRINTF	99
#define NM_NFSRDDIR	100
#define NM_FIFOIOC	101
#define	NM_AYT		102
#define	NM_RAYT		103

#define	NM_SCSET	104
#define NM_TTYHUP	105
#define	NM_PIPESIZE	106

#define	MAXMSG		107

/*
 * Bit masks for nm_type; If the high order bit is on the message is
 * a response to the type indicated in the other bits.
 */
#define RESPONSEBIT 0x80
#define RESPONSEMASK 0x7f
/* Constants for message characteristics stored in netmsgsw */

#define NMT_SPECIAL	0x01	/* message can be sent to down sites */
#define NMT_INTPROC	0x02	/* message is to be processed by */
				/* interrupt driver */
#define NMT_LARGE	0x04	/* message has associated data buffer */
				/* to send */
#define NMT_DELAYED	0x08	/* delayed response to RCD request */
#define NMT_SHRESP	0x10	/* needs a short response */
#define NMT_LNGRESP	0x20	/* needs a long response */
#define NMT_NEEDRESP	0x30	/* needs a response */
#define NMT_MULTIPLE	0x40	/* message may be fragmented */


/* the netmsgsw structure is used by the network interrupt driver
 * and svrproc to determine how to process a netmsg or buffer.
 */
struct netmsgsw {
	funcp_t nms_svrfunc;	/* routine to process a request */
	funcp_t nms_flip;	/* routine to flip the request */
	funcp_t nms_rflip;	/* routine to flip the response */
	funcp_t nms_seqf;	/* routine defining the sequence a message
				 * belongs to */
	long	nms_flags;	/* flags describing the message, see above */
};

extern struct netmsgsw netmsgsw[];	/* the switch table */

#define SvrRetNorm	0	/* normal svrproc return value */
#define SvrRetExit	1	/* force the svrproc to exit (used
				 * by svrfpr to start a new process) */

#define MAXUNM		2	/* number of nms a process can have locked */

#else  /* _MBCS not defined ==> 1.2 header */

#ifndef _h_TYPES
#ifdef KERNEL
#include <types.h>
#else /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* _h_TYPES */

#ifndef _h_PARAM
#ifdef KERNEL
#include <param.h>
#else /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif /* _h_PARAM */

union net_obj {
	struct netmsg *msg_obj;
	struct net_packet *packet_obj;
};

struct net_packet {
	/* this MUST be the first member of the net message */
	/* NEEDSWORK: struct netmsg or struct net_packet? */
	union net_obj Np_forw;	/* pointer to next net object */
	long np_flag;		/* local net message flags */
	char *np_d_addr;	/* address of attached data */
	long np_d_count;	/* number of bytes of attached data */
	time_t	np_ltime;	/* local timestamp */
};

#define np_forw		Np_forw.packet_obj

struct netmsg
{
	/*
	 * this structure exists so we can "cleanly" determine the
	 * size of the local portion of the netmsg header. */
	struct NMLOCALHDR {
		struct net_packet Nm_head;
#define nm_forw		NM_LOCHDR.Nm_head.Np_forw.msg_obj
#define nm_flag		NM_LOCHDR.Nm_head.np_flag
#define nm_d_addr	NM_LOCHDR.Nm_head.np_d_addr
#define nm_d_count	NM_LOCHDR.Nm_head.np_d_count
#define nm_ltime	NM_LOCHDR.Nm_head.np_ltime
#define nm_protocol	NM_LOCHDR.Nm_head.np_protocol
		/*
		 * link to buf structure.  This is used locally only
		 * to point to a related big data buffer that is
		 * coming from or going out across the network.
		 */
		struct	buf  *Nm_buf;
#define nm_buf		NM_LOCHDR.Nm_buf
		/*
		 * nm_svrseq is a sequencing field used by certain
		 * types of messages to ensure that order of arrival
		 * of requests matches order of service.  The field
		 * is generated at the receiving site if requested.
		 * Information about whether the field need be
		 * generated and the formula to be used in generating
		 * it is kept in netmsgsw table.
		 */
		long		Nm_svrseq;
#define nm_svrseq	NM_LOCHDR.Nm_svrseq
		siteno_t	Nm_rsite;	/* routed to site	*/
#define nm_rsite	NM_LOCHDR.Nm_rsite
		u_long Nm_res_received;		/* bit-map of responses */
						/* received so far	*/
#define nm_res_received NM_LOCHDR.Nm_res_received
		short		Nm_proc;	/* process holding this nm */
#define nm_proc		NM_LOCHDR.Nm_proc
	} NM_LOCHDR;

/* Start of Fields which are sent over the network to foreign sites. */

/*
 * WARNING: This must always point at the beginning of the network
 * part of the netmsg.	Really, this network part should be a substructure,
 * like NM_LOCHDR.
 */
#define  nm_netprt	nm_version	/* first field sent across the net */
/*
 * First come a few special fields which are hand-aligned.  Be careful.
 * These are kept here so that they can be held fixed for all eternity.
 * This assumes that sizeof(align_t)/sizeof(char) == 4.
 */
	char		nm_version;	/* version of net message */
	char		nm_res1;
	char		nm_res2;
	char		nm_res3;
	unsigned long	nm_cluster;	/* Canonical byte order, must match */
/*
 * Since NM_ADDR is a pointer, it is NEVER flipped, so it is not
 * part of NMlongs (though due to its declaration, it IS padded correctly).
 */
	struct netmsg *NM_ADDR;
#define  nm_nmaddr	NM_ADDR

/*
 * All the long fields from the fixed part of a netmsg come next.
 */
	PADOPEN(NMlongs)
	u_long	Nm_ack;		/* this message ack's up to...	      */
	u_long	Nm_ack_needed;	/* this message needs this ack number */
	long	Nm_base;	/* base of multiple message request   */
	long	Nm_cur;		/* current part of multiple request   */
	long	Nm_last;	/* end of multiple message request    */
	u_long	Nm_res_needed;	/* response mask for multiple request */
	time_t	Nm_time;	/* timestamp */
	PADCLOSE(NMlongs, xNMlongs, xUNMlongs)
			/* number of longs worth flipping in netmsg hdr. */
#define NNMLONGS	(sizeof(struct NMlongs) / sizeof(long))
#define nm_ack			xUNMlongs.xNMlongs.Nm_ack
#define nm_ack_needed		xUNMlongs.xNMlongs.Nm_ack_needed
#define nm_req_base		xUNMlongs.xNMlongs.Nm_base
#define nm_req_cur		xUNMlongs.xNMlongs.Nm_cur
#define nm_req_last		xUNMlongs.xNMlongs.Nm_last
#define nm_res_needed		xUNMlongs.xNMlongs.Nm_res_needed
#define nm_time			xUNMlongs.xNMlongs.Nm_time

	PADOPEN(NMshorts)
	short		Nm_retcode;	/* return code on requests	   */
	u_short		Nm_size;	/* size of this net message	   */
	u_short		Nm_channel;	/* channel id			   */
	siteno_t	Nm_fsite;	/* foreign (final receipient) site */
	siteno_t	Nm_lsite;	/* local (originator) site	   */
	u_short		Nm_req_size;	/* size of request block	   */
	PADCLOSE(NMshorts, xNMshorts, xUNMshort)
			/* Number of shorts in fixed part of netmsg */
#define NNMSHORTS	(sizeof (struct NMshorts) / sizeof (short))
#define nm_retcode	xUNMshort.xNMshorts.Nm_retcode
#define nm_size		xUNMshort.xNMshorts.Nm_size
#define nm_channel	xUNMshort.xNMshorts.Nm_channel
#define nm_fsite	xUNMshort.xNMshorts.Nm_fsite
#define nm_lsite	xUNMshort.xNMshorts.Nm_lsite
#define nm_req_size	xUNMshort.xNMshorts.Nm_req_size

	PADOPEN(NMchars)
	char		Nm_type;	/* message type			*/
			/* nm_order detects byte and word ordering differences
			 * between different machines */
	char		Nm_netflags;	/* low level network flags:
					 * tells byte order, and indicates
					 * broadcast messages. */
	unsigned char	Nm_header_cks;	/* header checksum */
	unsigned char	Nm_data_cks;	/* data checksum */
	PADCLOSE(NMchars, xNMchars, xUNMchar)
#define nm_type		xUNMchar.xNMchars.Nm_type
#define nm_netflags	xUNMchar.xNMchars.Nm_netflags
#define nm_header_cks		xUNMchar.xNMchars.Nm_header_cks
#define nm_data_cks		xUNMchar.xNMchars.Nm_data_cks
/*
 * nm_howflip is filled in just before a message is flipped, and tells
 * how to flip the message to make it make sense
 */
#define nm_howflip	xUNMchar.xNMchars.Nm_netflags
/* The overlay portions of the netmsg are overlayed with the nm_var field.
 * The size, NMVARSIZE is chosen to be at least as long as the longest
 * variable part.  This value must be adjusted if any of the overlayed
 * structures becomes larger than NMVARSIZE.  If overlooked, this condition
 * is checked at compile time since each of the overlayed structures is
 * accompanied by the use of the CHECKNMVARSIZE macro (defined in types.h).
 */
	char nm_var[NMVARSIZE];
};
#ifdef KERNEL
/*
 * values returned by the network message handlers to indicate acceptance
 * of a message or the reason for rejection.
 */

#define ACCEPT		0	/* message accepted */
#define REJECT_CHKS	1	/* message rejected--bad checksum */
#define REJECT_CHAN	2	/* channel should be rejected */
#define REJECT_SITE	3	/* cannot open a channel to this site */
#define REJECT_DUP	4	/* message rejected--dup or out of order */
#define REJECT_INVAL	5
#define REJECT_RESRC	6	/* message rejected--out of resources */

extern struct netmsg **netmsg;
extern struct netmsg nmfreelist;
extern struct netmsg nmhdr;
extern	struct netmsg  *getnmsg();
extern siteno_t fifo_site();
extern int free_netmsgs;		/* number of netmsgs on freelist */
extern int n_in_msgs;			/* Minimum # of messages for input */

#ifdef	SEVENCHARNAMES			/* Keep the many compilers happy */
#define netwantsnm	nwnm
#endif	/* SEVENCHARNAMES */

/*
 * For debugging purposes, use netmsgs in a fifo manner so that they stick
 * around longer before being overwritten.  This method is NOT recommended!
 * It may obscure hidden race conditions and is far less efficient than LIFO
 * processing.
 */
#if ! defined(NOCHECKS)
#define NETMSG_FIFO
extern struct netmsg *netmsg_tail;	/* ptr to tail of free netmsg queue */
#endif /* ! defined(NOCHECKS) */

extern	netmap_t netwantsnm;

extern int    nmnetsize;    /* size of a netmsg as it goes out on the net */

/*
 * This is macro for sleeping and waiting for a response to a network
 * message.  The spl6 must be done to prevent a race which would have
 * the process sleep after the wakeup had been done.  This could happen
 * if the response comes back after the while loop test and before
 * the sleep
 */
#define NMWAITbody(nmp) {					\
	spl_t sss = spl6();				\
							\
	while (! ((nmp)->nm_flag & N_DONE)) {		\
		(void) sleep((caddr_t) (nmp), PRINM);	\
		if ((nmp)->nm_channel != site[(nmp)->nm_fsite].si_channel) \
			(nmp)->nm_retcode = ESITEDN1;	\
	}						\
	splx(sss);  }

#if !defined(UNFAST) && !defined(CODE_COVERAGE)
#define	NMWAIT	NMWAITbody
#endif /* !defined(UNFAST) && !defined(CODE_COVERAGE) */

#endif /* KERNEL */

/*
 * The flags in nm_flag are a combination of network message and local flags
 *
 */
/*  Local Flags */
#define N_NEEDRESP	0x01L	/* net message request needs a response */
#define N_DONE		0x02L	/* I/O for this net message is completed */
#define N_BUSY		0x04L	/* not on netfreelist			 */
#define N_NETINM	0x08L	/* This is a net input netmsg */
#define N_ERROR		0x10L	/* error, details are in nm_retcode */
#define N_USER_ACCESS	0x20L	/* this netmessage is for a user packet */
#define N_WANTED	0x40L	/* do wakeup when not busy		 */
#define N_NOTMAPPED	0x80L	/* updprop - empty page, not allocated */
#define N_RELSE		0x100L	/* net message can be freed upon posting */
#define N_WAKEUP	0x200L	/* wakeup net message */
#define N_B_RELSE	0x400L	/* attached buffer is to be released */
#define N_B_IODONE	0x800L	/* attached buffer is to passed to iodone */
#define N_RELSE_ON_XMIT 0x1000L /* release net message on transmit done   */
#define N_PRIVATE	0x2000L /* private netmessage, do not release */
#define N_ON_ACK_QUEUE	0x4000L /* is net message waiting on an ack queue */
#define N_FORWARD	0x8000L /* this message is being forwarded */
#define N_IN_DRIVER	0x10000L/* the driver currently has the net message */
#define N_RESP_WAIT	0x20000L/* net message is waiting for a response */
#define N_PROC_LOCKED	0x40000L/* a process has been charged for this lock */
#define N_LOCKWANTED	0x80000L/* charged process waiting for a netmsg */
#define N_B_IOWAIT	0x100000L/* someone is doing a iowait() on buf */

/*
 * network flags. (nm_netflags, a.k.a. nm_howflip)
 */
#define NNF_ORDERMASK	0x3	/* 2 low order bits for byte order (flip.h) */
#define NNF_BROADCAST	0x4	/* the message was broadcast, don't forward */
#define NNF_NEEDACK	0x8	/* let the remote side know that we need    */
				/* this message acked because we've hit our */
				/* limit of outstanding messages	    */
#define NNF_SPCL_ACK	0x10	/* ack numbers are in "special" namespace   */
#define	NNF_NACK	0x20	/* tell remote that we missed a message	    */
#define	NNF_QUENCH	0x40	/* tell remote to do synchronous writes	    */

/*
 * Descriptions of the different messages, the actual definitions are below.
 *
 * Basic communication messages.
 *	NM_NOP		nothing message, only carries piggy-back ack
 *	NM_CHNOPN	opens communication between sites
 *	NM_RCHNOPN	treated as a request, different number
 *
 * Filesystem messages
 *	NM_NAMEI(R)	follow a remote path and open a file (nmnamei)
 *	NM_OPEN(R)	open a file sent from US to CSS (nmlfilsys)
 *	NM_OPENL(R)	return first data block along w/NM_OPEN info (nmlfilsys)
 *	NM_STAT(R)	stat a file (nmlfilsys)
 *	NM_BESS(R)	CSS request for SS open. (nmlfilsys)
 *	NM_DEVOPEN(R)	do device open routine, US to SS (nmsfilsys)
 *	NM_READ(R)	US read from SS (nmrdwr)
 *	NM_WRITE	US write to SS (nmrdwr)
 *	NM_SWRITE(R)	US write to SS with response (nmrdwr)
 *	NM_ERR		SS to US error notification (nmsfilsys)
 *	NM_USCOMMIT(R)	US commits changes at SS (nmlfilsys).
 *	NM_ABORT(R)	US aborts changes at SS (nmlfilsys).
 *	NM_USCLOSENC	US close at SS (nmsfilsys)
 *	NM_SSCLOSENC	SS close at CSS (nmsfilsys)
 *	NM_COMCLOSE	US close with commit at SS (nmlfilsys).
 *	NM_CLOSEUS	SS requests the US to close (nmsfilsys)
 *	NM_CLOSESS	CSS requests the SS to close (nmsfilsys)
 *	NM_CLSFSS	SS update notification to US (nmlfilsys)
 *	NM_TRUNC	US truncates file at SS (nmsfilsys).
 *	NM_UPDPROP	CSS update notification to SS's (nmlfilsys).
 *	NM_REQLBNLIST(R) propin page list request from propout site (nmsfilsys).
 *	NM_CHINODE(R)	change specific inode (nmlfilsys)
 *	NM_FUNBLOCK	FIFO reader unblock (nmrdwr)
 *	NM_NFSNM	NFS - namei (symlink/stat/nfs) to CSS
 *	NM_NFSRNM	NFS - rename
 *	NM_NFSRDDIR	NFS - read directory
 *
 * Mount/unmount messages
 *	NM_MTNOTIF(R)	filesystem mount notification (nmmount)
 *	NM_MTNFS	NFS  filesystem mount notification (nfsmount)
 *	NM_OKTOUMT(R)	prepare to unmount filesystem (nmmount)
 *	NM_UMTNOTIF(R)	filesystem unmount notification (nmmount)
 *	NM_RECDONE	recovery finished on a gfs (nmmount)
 *
 * Remote process messages
 *	NM_FPR(R)	migrate/exec/fork/run process request (nmnetproc)
 *	NM_SENV(R)	send process environment (nmnetproc)
 *	NM_SPDTA(R)	send process data area (nmnetproc)
 *	NM_SSIG(R)	send signal info (nmnetproc)
 *	NM_SLOCK(R)	send open file record locks (nmnetproc)
 *	NM_SOFILE(R)	send open file info (nmnetproc)
 *	NM_FORK(R)	send fork specific data (nmnetproc)
 *	NM_FRKDNE	fork/run completed; no response (nmnetproc)
 *	NM_EXECDNE	migrate/exec completed; long response (nmnetproc)
 *
 * Process tracking messages
 *	NM_PSPAR(R)	Update (pid,site) info at parent (nmproctrack)
 *	NM_PSORIG	Update (pid,site) info at origin site (nmproctrack)
 *	NM_PSGRP(R)	Update (pgrp,site) info at group orig site (nmproctrack)
 *	NM_PSTOP	Update origin site info at topology change (nmproctrack)
 *	NM_WAIT		get data from remote zombie (nmwait)
 *	NM_ABNDN	remote exit message sent to children (nmabandn)
 *	NM_PRIO		get/set process priority (nmsignal)
 *	NM_GRPPRIO	get/set process group priority (nmsignal)
 *	NM_UIDPRIO	get/set all process priorities owned by uid (nmsignal)
 *	NM_GGROUPS	get session/pgrps
 *
 * Topology change messages
 *	NM_PROBE	Null "are you there?" message (nmtopchg)
 *	NM_SITEDOWN(R)	request to join new partition (nmtopchg)
 *	NM_NEWPARTSET	new partition notification (nmtopchg)
 *	NM_GETTOP	request to get global state (nmtopchg)
 *	NM_PMOUNT	local state information (nmtopchg)
 *	NM_NEWTOP	global state notification (nmtopchg)
 *	NM_SNDIND(R)	request SS inode table info (nmtopchg)
 *
 * Token passing messages
 *	NM_AWARDTOK	Grant token to US (nmtoken)
 *	NM_CLRTOK	Clear TCB at TMS (nmtoken)
 *	NM_RELTOK	TMS Release token request to US (nmtoken)
 *	NM_RQSTOK	Request for token from US to TMS (nmtoken)
 *	NM_TOKINIT	Initialize token data structures at SS (nmtoken)
 *	NM_TOKRLSD	US releases token to TMS (nmtoken)
 *	NM_STATTOK	CSS requests status updates from token holder
 *	NM_FIFOWKUP	TMS notifies of FIFO token status change
 *
 * Remote signal messages
 *	NM_SIGPROC(R)	Send signal to a process (nmsignal)
 *	NM_SIGGRP(R)	Send signal to a process group (nmsignal)
 *	NM_SIGUID(R)	Send signal to processes with matching uid (nmsignal)
 *	NM_GSPGRP(R)	Get/Set pgrp for a process (nmsignal)
 *	NM_INFERIOR(R)	Find ancestral processes (nminferior).
 *
 * File locking messages
 *	NM_USLOCKF(R)	lockf request from the us to ss (nmlockf)
 *	NM_SSLOCKF(R)	lockf action from the ss to each us (nmlockf)
 *
 * Remote character device messages
 *	NM_RCDW(R)	RCD writes (nmrcd)
 *	NM_RCDR(R)	RCD reads (nmrcd)
 *	NM_RC_RWDLY	Read/Write Delayed response (nmrcd)
 *	NM_RCDIO(R)	RCD ioctls (nmrcd)
 *	NM_RC_IODLY	Ioctl Delayed response (nmrcd)
 *	NM_RCDCAN	Cancel RCD request due to signal (nmrcd)
 *
 * Remote sleep/wakeup messages
 *	NM_WAKEUP	Wake a process sleeping on a remote event (nmwakeup)
 *	NM_SLPCAN	Process woke up on its own (nmwakeup)
 *
 * Remote select messages
 *	NM_SELECT	Remote selscan
 *	NM_SELCAN	Cancel remote select
 *	NM_SELWAKE	Remote select delayed response
 *
 *
 * Quota Messages
 *	NM_QSETDLIM	Update SS limit info about user.
 *	NM_QGETDLIM	Retrieve SS limit info about user.
 *	NM_QSETDUSE	Update SS limit info about user.
 *	NM_QSYNC	Sync in core quota info to disk.
 *	NM_QSETWARN	Set warning limits.
 *	NM_QDOWARN	Generate warnings for user for filesystems over quota.
 *	NM_QSETUID	New user logging in, update caches.
 *
 * Miscellaneous messages
 *	NM_DEBUG	remote console output control, for debugging (nmdebug)
 *	NM_USTAT	Remote ustat (nmustat)
 *	NM_DUSTAT	Remote dustat (nmdustat)
 *	NM_DPACKLST	Get packlist info for dustat() (nmdustat + buffer)
 *	NM_GETCOMLIST	Request for superblock commit list (nmmount)
 *	NM_BRIDGE	Message requesting OS-bridge service (nmlfilsys)
 *	NM_TIME_SYNC	Synchronize network clocks (nmtimesync)
 *	NM_FIFOIOC	Update SS inode of FIFO
 *
 * Other NM_ related defines.
 *	MAXMSG		Last used message number
 */


/*
 * definitions of message types described above
 *
 *  *********	Do not change this without updating
 *  *********	- netmsgsw in netmsgsw.c
 */
#define NM_NOP		0
#define NM_CHNOPN	1
#define NM_OPEN		2
#define NM_BESS		3
#define NM_DEVOPEN	4
#define NM_READ		5
#define NM_WRITE	6
#define NM_ERR		7
#define NM_USCLOSENC	8
#define NM_SSCLOSENC	9
#define NM_CLOSEUS	10
#define NM_CLOSESS	11
#define NM_CLSFSS	12
#define NM_USCOMMIT	13
#define NM_ABORT	14
#define NM_TRUNC	15
#define NM_UPDPROP	16
#define NM_REQLBNLIST	17
#define NM_MTNOTIF	18
#define NM_OKTOUMT	19
#define NM_UMTNOTIF	20
#define NM_FPR		21
#define NM_SENV		22
#define NM_SPDTA	23
#define NM_FRKDNE	24
#define NM_EXECDNE	25
#define NM_PSPAR	26
#define NM_PSORIG	27
#define NM_PSGRP	28
#define NM_PSTOP	29
#define NM_WAIT		30
#define NM_ABNDN	31
#define NM_PROBE	32
#define NM_SITEDOWN	33
#define NM_NEWPARTSET	34
#define NM_GETTOP	35
#define NM_PMOUNT	36
#define NM_NEWTOP	37
#define NM_SNDIND	38
#define NM_CHINODE	39
#define NM_SSIG		40
#define NM_AWARDTOK	41
#define NM_CLRTOK	42
#define NM_RELTOK	43
#define NM_RQSTOK	44
#define NM_TOKINIT	45
#define NM_TOKRLSD	46
#define NM_SIGPROC	47
#define NM_SIGGRP	48
#define NM_SIGUID	49
#define NM_GSPGRP	50
#define NM_INFERIOR	51
#define NM_DEBUG	52
#define NM_USLOCKF	53
#define NM_DIRSTAT	54
#define NM_RCDW		55
#define NM_RCDR		56
#define NM_RC_RWDLY	57
#define NM_RCDIO	58
#define NM_RC_IODLY	59
#define NM_RCDCAN	60
#define NM_GETCOMLIST	61
#define NM_USTAT	62
#define NM_FUNBLOCK	63
#define NM_WAKEUP	64
#define NM_SLPCAN	65
#ifdef BRIDGE
#define NM_BRIDGE	66
#endif /* BRIDGE */
#ifdef TIME_SYNC
#define NM_TIME_SYNC	67
#endif /* TIME_SYNC */
#define NM_SELECT	68
#define NM_SELCAN	69
#define NM_SELWAKE	70
#define NM_MTNFS	71
#define NM_NFSNM	72
#define NM_NFSRNM	73
#define NM_STATTOK	74
#define NM_GGROUPS	75
#define NM_FIFOWKUP	76
#define NM_FORK		77
#define NM_PRIO		78
#define NM_GRP_PRIO	79
#define NM_UID_PRIO	80
#define NM_COMCLOSE	81
#define NM_SITE		82
#define NM_SLOCK	83
#define NM_NAMEI	84
#define NM_STAT		85
#define NM_SWRITE	86
#define NM_DUSTAT	87
#define NM_PACKLST	88
#define NM_RCHNOPN	89
#define NM_OPENL	90
#define	NM_SOFILE	91
#define	NM_QSETDLIM	92
#define	NM_QGETDLIM	93
#define	NM_QSETDUSE	94
#define	NM_QSYNC	95
#define	NM_QSETWARN	96
#define	NM_QDOWARN	97
#define	NM_QSETUID	98
#define NM_UPRINTF	99
#define NM_NFSRDDIR	100
#define NM_FIFOIOC	101
#define	NM_AYT		102
#define	NM_RAYT		103
#define MAXMSG	104

/*
 * Bit masks for nm_type; If the high order bit is on the message is
 * a response to the type indicated in the other bits.
 */
#define RESPONSEBIT 0x80
#define RESPONSEMASK 0x7f
/* Constants for message characteristics stored in netmsgsw */

#define NMT_SPECIAL	0x01	/* message can be sent to down sites */
#define NMT_INTPROC	0x02	/* message is to be processed by */
				/* interrupt driver */
#define NMT_LARGE	0x04	/* message has associated data buffer */
				/* to send */
#define NMT_DELAYED	0x08	/* delayed response to RCD request */
#define NMT_SHRESP	0x10	/* needs a short response */
#define NMT_LNGRESP	0x20	/* needs a long response */
#define NMT_NEEDRESP	0x30	/* needs a response */
#define NMT_MULTIPLE	0x40	/* message may be fragmented */


/* the netmsgsw structure is used by the network interrupt driver
 * and svrproc to determine how to process a netmsg or buffer.
 */
struct netmsgsw {
	funcp_t nms_svrfunc;	/* routine to process a request */
	funcp_t nms_flip;	/* routine to flip the request */
	funcp_t nms_rflip;	/* routine to flip the response */
	funcp_t nms_seqf;	/* routine defining the sequence a message
				 * belongs to */
	long	nms_flags;	/* flags describing the message, see above */
};

extern struct netmsgsw netmsgsw[];	/* the switch table */

#define SvrRetNorm	0	/* normal svrproc return value */
#define SvrRetExit	1	/* force the svrproc to exit (used
				 * by svrfpr to start a new process) */

#define MAXUNM		2	/* number of nms a process can have locked */

#endif  /* _MBCS */

#endif /* ~_h_NETMSG */


odekêXS J  $        *  F‰*w™ˆ*F‰*      *  	              ðƒ  ./usr/include/sys/netproc.h  s.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)netproc.h	16.7	AIX)	/* Modified: 13:24:40 9/5/90 */
/* H_SCCSID_PASC(1.3	PASC) */

#ifndef _h_NETPROC
#define _h_NETPROC

#ifndef _h_USER
#ifdef KERNEL
#include <user.h>
#else /* ~KERNEL */
#include <sys/user.h>
#endif /* ~KERNEL */
#endif /* _h_USER */

#ifndef _h_REG
#ifdef KERNEL
#include <reg.h>
#else /* ~KERNEL */
#include <sys/reg.h>
#endif /* ~KERNEL */
#endif /* _h_REG */

#ifndef _h_PROC
#ifdef KERNEL
#include <proc.h>
#else /* ~KERNEL */
#include <sys/proc.h>
#endif /* ~KERNEL */
#endif /* _h_PROC */

#ifndef _h_SIGNAL
#include <signal.h>
#endif  /* _h_SIGNAL */

/*
 * The following data structure is used to format a
 * buffer for transmission of data from
 *  o  the proc structure,
 *  o  the user structure, and
 *  o  the open file table
 *
 * Most fields are exact copies of the data fields in
 * one of the three structures mentioned above.
 *
 *  the structure trans redefines the data area of the buffer to
 *  accommodate the information needed to fork a child process
 *  at the remote site
 */

/*
   struct trns_ofile

   Holds open file table info for a remote process.
   Heterogeneous exchangable structure.
*/
struct trns_ofile
{
	PADOPEN(to_Lt)
	gfs_t		to_Ligfs;	/* Global file system number	*/
	ino_t		to_Linum;	/* Inode number			*/
	pid_t		to_Lpgrp;	/* process group (FIFO only)	*/
	long   		to_Lflag;
	PADCLOSE(to_Lt, to_Ls, to_Lu)
#define	fdt_igfs	to_Lu.to_Ls.to_Ligfs
#define	fdt_inum	to_Lu.to_Ls.to_Linum
#define	fdt_pgrp	to_Lu.to_Ls.to_Lpgrp
#define	fdt_flag	to_Lu.to_Ls.to_Lflag
#define	TO_NLONGS	(sizeof (struct to_Lt) / sizeof (long))

	PADOPEN(to_St)
	short		to_Stcbdes;
	siteno_t	to_Stmgrsite;	/* Token manager site		*/
	PADCLOSE(to_St, to_Ss, to_Su)
#define	fdt_tcbdes	to_Su.to_Ss.to_Stcbdes
#define	fdt_tmgrsite	to_Su.to_Ss.to_Stmgrsite
#define	TO_NSHORTS	(sizeof (struct to_St) / sizeof (short))

	PADOPEN(to_Ct)
	char		to_Cpofile;	/* Per_process open file flags	*/
	unsigned char	to_Cfd;		/* file descriptor */
	/* This is really an ino_uniqid_t (long) */
	unsigned char	to_Uniqid	/* Inode unique id */
	PADCLOSE(to_Ct, to_Cs, to_Cu)
#define	fdt_pofile	to_Cu.to_Cs.to_Cpofile
#define	fdt_fd		to_Cu.to_Cs.to_Cfd
#define	fdt_uniqid	to_Cu.to_Cs.to_Uniqid
};
#define OFMAX (N_BSIZE/sizeof(struct trns_ofile))
/*
   struct trns_lock

   Holds lock information for open files.
   Heterogeneous exchangable structure.
*/
struct trns_lock
{
	PADOPEN(tl_Lt)
	off_t		tl_Llob;
	off_t		tl_Lhib;
	PADCLOSE(tl_Lt, tl_Ls, tl_Lu)
#define	tl_lob	tl_Lu.tl_Ls.tl_Llob
#define	tl_hib	tl_Lu.tl_Ls.tl_Lhib
#define	TL_NLONGS	(sizeof (struct tl_Lt) / sizeof (long))
	PADOPEN(tl_Ct)
	char		tl_Cfdes;
	char		tl_Cmode;
	PADCLOSE(tl_Ct, tl_Cs, tl_Cu)
#define	tl_fdes	tl_Cu.tl_Cs.tl_Cfdes
#define	tl_mode	tl_Cu.tl_Cs.tl_Cmode
};
#define NORLOCKS (N_BSIZE/(sizeof (struct trns_lock)))

#ifdef	MM_VSEGS
/*
   struct trns_vsgs

   The following structure declares the vseg and procvseg information
   needed for remote fork and migrate.
*/
struct	trns_vsgs
{
	vaddr_t		tv_vaddr;	/* vsegs virtual address	*/
	ulong		tv_size;	/* size of vseg in bytes 	*/
	ushort		tv_type;	/* procvseg type 		*/
};

#define TEXT_VS		0		/* text vseg info indx 	*/
#define DATA_VS		1		/* data vseg info indx	*/
#define STK_VS		2		/* stack vseg info indx	*/
#define SHLIB_VS	3		/* shlib(s) data vseg info indx	*/
#define MAX_VS		SHLIB_VS+MAX_SHLIB /* max nbr vseg info entries */

#endif	/* MM_VSEGS */

/*
   struct trns_fork

   This structure holds the information required only for remote fork
   and migrate.  This structure is only seen by a homogeneous site so
   padding etc. is not necessary.
*/
struct trns_fork
{
	/*
	   The following three fields were size_t's but were change to
	   unsigned longs so that they would be the same size on all
	   machines
	*/
	u_long		tf_txtsize;	/* Text size			*/
	u_long		tf_dtasize;	/* Data				*/
	u_long		tf_stksize;	/* Stack			*/

	gfs_t		tf_txigfs;	/* Text gfs			*/
	ino_t		tf_txinum;	/* Text inode number		*/
	ino_uniqid_t	tf_txuniqid;	/* Text uniqid			*/
	long		tf_txversion;	/* Text version			*/
	struct usr_fork	tf_ufork;	/* Fork only fields from u.	*/

	struct trapblk	tf_trapblk;	/* values of user's registers and
					 * other machine dependent state info */
#ifdef	MM_VSEGS
	struct
	trns_vsgs	tf_vsgs[MAX_VS]; /* procvseg and vseg info for data,
					    * stack, shared library data */
#endif	/* MM_VSEGS */
#ifdef FASTPS
	char		tf_cmnd[P_CMNDSZ]; /* text of the command string */
#endif /* FASTPS */
};

#define TR_NOFDS 8		/* # of trns_ofile structs in a trns_data */

/*
   struct trns_dta

   Collects information required for all remote process requests.
   The same structure is used for either fork/migrate or exec/run.
   The end of trns_dta is used as a trns_exec request.
   Hybrid exchangable structure.
*/
struct trns_dta
{
	PADOPEN(td_Lt)
	pid_t		tr_Lppid;	/* PID of parent process	*/
	pid_t		tr_Lpid;	/* PID of process		*/
	ksigmask_t	tr_Lsig;	/* Pending signals		*/
	long		tr_Lflag;	/* Process flags		*/
	time_t		tr_Lclktim;	/* Time until alarm clock	*/
	gfs_t		tr_Lcd_igfs;	/* Working directory gfs number	*/
	ino_t		tr_Lcd_inum;	/* Working directory i-number	*/
	gfs_t		tr_Lrd_igfs;	/* Root directory gfs number	*/
	ino_t		tr_Lrd_inum;	/* Root directory i-number	*/
	time_t		tr_Lalrmleft;	/* Time until /dev/alrm time	*/
	time_t		tr_Lalrmintvl;	/* Time between /dev/alrm click	*/
	PADCLOSE(td_Lt, td_Ls, td_Lu)
#define	tr_ppid		td_Lu.td_Ls.tr_Lppid
#define	tr_pid		td_Lu.td_Ls.tr_Lpid
#define	tr_sig		td_Lu.td_Ls.tr_Lsig
#define	tr_flag		td_Lu.td_Ls.tr_Lflag
#define	tr_clktim	td_Lu.td_Ls.tr_Lclktim
#define	tr_cd_igfs	td_Lu.td_Ls.tr_Lcd_igfs
#define	tr_cd_inum	td_Lu.td_Ls.tr_Lcd_inum
#define	tr_rd_igfs	td_Lu.td_Ls.tr_Lrd_igfs
#define	tr_rd_inum	td_Lu.td_Ls.tr_Lrd_inum
#define	tr_alrmleft	td_Lu.td_Ls.tr_Lalrmleft
#define	tr_alrmintvl	td_Lu.td_Ls.tr_Lalrmintvl
#define	TR_NLONGS	(sizeof (struct td_Lt) / sizeof (long))

	PADOPEN(td_St)
	short 		tr_Smorefds;	/* # of additional open files */
					/* not included in this msg */
	short 		tr_Sfirstfd;	/* first needed fd */
	PADCLOSE(td_St, td_Ss, td_Su)
#define	tr_morefds	td_Su.td_Ss.tr_Smorefds
#define	tr_firstfd	td_Su.td_Ss.tr_Sfirstfd
#define	tr_bigfd	td_Su.td_Ss.tr_Sfirstfd
#define	TR_NSHORTS	(sizeof (struct td_St) / sizeof (short))

	PADOPEN(td_Ct)
	char		tr_Cfrkflg;	/* Fork/Exec/Migrate/Run/Trans	*/
	char		tr_Clockct;	/* Number of file locks held    */
	char		tr_Cgetsigs;	/* Do we need to get signal info? */
	PADCLOSE(td_Ct, td_Cs, td_Cu)
#define	tr_frkflg	td_Cu.td_Cs.tr_Cfrkflg
#define	tr_lockct	td_Cu.td_Cs.tr_Clockct
#define	tr_getsigs	td_Cu.td_Cs.tr_Cgetsigs

	struct trns_ofile tr_fildt[TR_NOFDS];	/* Open file info	*/
	struct prc_dta	tr_prcpart;	/* Fields from proc structure	*/
	struct usr_dta	tr_usrpart;	/* Fields from user struct	*/
	struct ucred	tr_usrcred;	/* User credentials		*/

	/* Place for execution parameters, for exec only 		*/
	/* (==> heterogeneous)						*/
	struct xarg_set		tr_xargs;	/* File/args/env	*/
};

#ifndef NOCHECKS
/* If the following statment causes a compiler message, struct trns_dta
 * has grown too large to fit in a single buffer.
 */
struct xTRNSDTA { char yynmyy[N_BSIZE+1-sizeof(struct trns_dta)]; };
#endif /* ~NOCHECKS */

/*
   the following structure defines the contents of the "variable" part
   of the netmsgs which get sent for netproc messages:
	NM_FPR
	NM_SENV
	NM_SPDTA
	NM_FRKDNE
	NM_EXECDNE
 */
struct nmnetproc
{
	PADOPEN(nnp_LT)
	pid_t	Nnp_ppid;	/* parent process id, used by EXECDNE only */
	pid_t	Nnp_pid;	/* process id requesting remote action */
	long	Nnp_pageno;	/* page number of args or data being sent */
	ksigmask_t Nnp_sig;	/* used by EXECDNE only: update of sig mask */
	long	Nnp_sig_arg[NUMSIGARG];
	PADCLOSE(nnp_LT, nnp_LS, nnp_LU)
#define	nnp_ppid	nnp_LU.nnp_LS.Nnp_ppid
#define	nnp_pid		nnp_LU.nnp_LS.Nnp_pid
#define	nnp_pageno	nnp_LU.nnp_LS.Nnp_pageno
#define	nnp_nchild	nnp_LU.nnp_LS.Nnp_pageno
#ifdef	MM_VSEGS
#define	nnp_vaddr	nnp_LU.nnp_LS.Nnp_pageno
#endif	/*MM_VSEGS */
#define	nnp_sig		nnp_LU.nnp_LS.Nnp_sig
#define	nnp_sig_arg	nnp_LU.nnp_LS.Nnp_sig_arg
#define	NNPLONGS	(sizeof(struct nnp_LT) / sizeof(long))
	PADOPEN(nnp_ST)
	suid_t	Nnp_uid;	/* user id requesting netproc op */
	sgid_t	Nnp_gid;	/* group id requesting netproc op */
	PADCLOSE(nnp_ST, nnp_SS, nnp_SU)
#define	nnp_fuid	nnp_SU.nnp_SS.Nnp_uid
#define	nnp_fgid	nnp_SU.nnp_SS.Nnp_gid
#define	NNPSHORTS	(sizeof(struct nnp_ST) / sizeof(short))
	PADOPEN(nnp_CT)
	char	Nnp_seq;	/* p_migseq, used as check by svrsndproc */
	char	Nnp_dogroup;	/* do gosite stuff at the source site */
	PADCLOSE(nnp_CT, nnp_CS, nnp_CU)
#define nnp_seq		nnp_CU.nnp_CS.Nnp_seq
#define nnp_dogroup	nnp_CU.nnp_CS.Nnp_dogroup
};

#ifndef  NOCHECKS
/* If the following statement causes a compiler warning or error,
 * then the length of the nmnetproc structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMNP, nmnetproc);
#endif /* ~NOCHECKS */

#ifdef  KERNEL

/*
 *  These constants define the different types of remote
 *  fork calls:
 */
#define RP_NEWPROC	1
#define RP_NEWIMAGE	2
#define RP_SIGNAL	4

#define RP_MIG	   0				/* migrate call */
#define RP_FORK	   RP_NEWPROC			/* remote fork call */
#define RP_EXEC	   RP_NEWIMAGE			/* remote exec call */
#define RP_RUNE	   (RP_NEWPROC|RP_NEWIMAGE)	/* remote rune call */
#define RP_SIGMIG  (RP_MIG|RP_SIGNAL)	/* migrate induced by SIGMIGRATE */

#endif  /* KERNEL */

/* signal action info for NM_SSIG */
struct trns_sig {
	PADOPEN(nss_LT)
	ksigmask_t Nss_sigmask[NSIG];	/* signals to be blocked */
	ksigmask_t Nss_sigonstack;	/* signals to take on sigstack */
	ksigmask_t Nss_sigintr;		/* signals that interrupt syscalls */
	ksigmask_t Nss_oldmask;		/* saved mask from before sigpause */
	long	Nss_sp;			/* signal stack pointer */
	long	Nss_onstack;		/* current status */
	int	(* Nss_signal[NSIG])();	/* Parents signal actions */
	PADCLOSE(nss_LT, nss_LS, nss_LU)
#define	nss_sigmask	nss_LU.nss_LS.Nss_sigmask
#define	nss_sigonstack	nss_LU.nss_LS.Nss_sigonstack
#define	nss_sigintr	nss_LU.nss_LS.Nss_sigintr
#define	nss_oldmask	nss_LU.nss_LS.Nss_oldmask
#define	nss_sp		nss_LU.nss_LS.Nss_sp
#define	nss_onstack	nss_LU.nss_LS.Nss_onstack
#define	nss_signal	nss_LU.nss_LS.Nss_signal
#define	NSSLONGS	(sizeof(struct nss_LT) / sizeof(long))
};

#ifdef _MBCS
/* codeset information for NM_SCSET (send codeset info.) */
struct trns_cset {
	PADOPEN(ncs_lT)
	charlen_t Ncs_codeset[256];	/* codeset information for namei */
	PADCLOSE(ncs_lT, ncs_lS, ncs_lU)
#define ncs_codeset	ncs_lU.ncs_lS.Ncs_codeset
};
#endif /* _MBCS */

#endif /* ~_h_NETPROC */
ukêÔÝ I  $        k  F‰*w™ˆ*F‰*     	¾k  	                  ./usr/include/sys/netsel.h   s.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)netsel.h	16.5	LCC)	/* Modified: 18:29:20 9/22/89 */

#ifndef _h_NETSELECT
#define _h_NETSELECT

#ifndef _h_TYPES
#ifdef KERNEL
#include <types.h>
#else /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* _h_TYPE */

#ifndef _h_PARAM
#ifdef KERNEL
#include <param.h>
#else /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif /* _h_PARAM */

/*
   the following structure defines the contents of the "variable" part
   of the netmsgs which get sent for remote select/selselect
*/
struct nmselect
{
	PADOPEN(nselect_LT)
	pid_t		Nsel_pid;
	off_t		Nsel_offset;
	gfs_t		Nsel_gfs;
	ino_t		Nsel_inode;
	dev_t		Nsel_dev;
	off_t		Nsel_mpxchan;
	PADCLOSE(nselect_LT, nselect_LS, nselect_LU)
#define	nsel_pid	nselect_LU.nselect_LS.Nsel_pid
#define	nsel_offset	nselect_LU.nselect_LS.Nsel_offset
#define	nsel_gfs	nselect_LU.nselect_LS.Nsel_gfs
#define	nsel_inode	nselect_LU.nselect_LS.Nsel_inode
#define	nsel_dev	nselect_LU.nselect_LS.Nsel_dev
#define	nsel_mpxchan	nselect_LU.nselect_LS.Nsel_mpxchan
#define	NSELLONGS	(sizeof(struct nselect_LT) / sizeof(long))

	PADOPEN(nselect_ST)
	short		Nsel_flag;
	short		Nsel_handle;
	islot_t		Nsel_ssislot;
	PADCLOSE(nselect_ST, nselect_SS, nselect_SU)
#define nsel_flag	nselect_SU.nselect_SS.Nsel_flag
#define nsel_handle	nselect_SU.nselect_SS.Nsel_handle
#define nsel_ssislot	nselect_SU.nselect_SS.Nsel_ssislot
#define	NSELSHORTS	(sizeof(struct nselect_ST) / sizeof(short))
};

/* If the following statement causes a compiler warning or error,
 * then the length of the nmselect structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMSL, nmselect);

/* values for nsel_flag */
#define SEL_READ FREAD   /* 0x01 remote select for read */
#define SEL_WRITE FWRITE /* 0x02 remote select for write */
#define SEL_EXCEP  0x04  /* remote select for exception */
#define SEL_IMMEDIATE 0x08 /* don't sleep on remote side */
#define SEL_SECOND 0x10	 /* second (remote) selscan pass */
#define SEL_NOCOLL 0x20  /* no collision occured during selscan */
#define SEL_REMOTE 0x80  /* process performing remote select */
#define SEL_LOCALONLY 0x100 /* perform local fd scan only */
#define SEL_PIPE   0x200 /* perform select on pipe */


/*	Remote Select/Wakeup Structure	*/

struct rem_sel {
	struct proc *proc;	/* local processes proc pointer */
	pid_t	pid;		/* remote server process pid	*/
	int	fd;		/* file descriptor (local)	*/
	short	which;		/* read,write,exception flag	*/
	short	selected;	/* selected (2, 1)		*/
	short	site;		/* site where server process is */
};

extern struct rem_sel rem_sel[];

#define NRMTSEL 32

#endif /* ! _h_NETSELECT */
_dta	kêÌì H  $        7  F‰*x™ˆ*F‰*     Èw7  	              „  ./usr/include/sys/netslp.h   s.h
/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)netslp.h	16.4	LCC)	/* Modified: 18:29:54 9/22/89 */
/* SCCSIDPUFF(@(#) netslp.h 4.3 LM 00:21:09 6/21/85 C 00:21:13 6/21/85); */

#ifndef _h_NETSLP
#define _h_NETSLP

#ifndef _h_TYPES
#ifdef KERNEL
#include <types.h>
#else /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* _h_TYPE */

#ifndef _h_PARAM
#ifdef KERNEL
#include <param.h>
#else /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif /* _h_PARAM */

/*
   the following structure defines the contents of the "variable" part
   of the netmsgs which get sent for remote wakeup (WAKEUP) and
   sleep cancel (SLPCAN)
*/
struct nmwakeup
{
	PADOPEN(nwakeup_ST)
	short		Nwak_sindex; /* index into rmt_slp */
	short		Nwak_windex; /* index into rmt_wakeup */
	PADCLOSE(nwakeup_ST, nwakeup_SS, nwakeup_SU)
#define	nwak_sindex	nwakeup_SU.nwakeup_SS.Nwak_sindex
#define	nwak_windex	nwakeup_SU.nwakeup_SS.Nwak_windex
#define	NWAKLONGS	0
#define	NWAKSHORTS	(sizeof(struct nwakeup_ST) / sizeof (short))
};

/* If the following statement causes a compiler warning or error,
 * then the length of the nmwakeup structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMWK, nmwakeup);


/*	Remote Sleep/Wakeup Structures 		*/


/* rmt_slp is structure used at the execution site of the process wishing
	to sleep on some remote activity */

struct rmt_slp {
	struct	proc *rs_procp;	/* pointer to process sleeping */
	short	rs_flag;	/* see below */
	short	rs_retcode;	/* return code from remote sleep */
	siteno_t rs_rmtsite;	/* used for consistency checking and cleanup */
	short	rs_windex;	/* index into rmt_wakeup at rs_rmtsite, used
				   for consistency checking */
};
/* Values for rs_flag */
#define RS_PENDING	1	/* set while the remote request is ongoing,
				   not knowning if a slp is needed or not */
#define RS_SLEEP	2	/* proc is asleep waiting for remote wakeup */
#define	RS_WAKEUP	3	/* wakeup has come in aon this remote sleep */


/* rmt_wakeup is structure used at the site remote to the sleeping process -
	i.e. the site where the wakeup is to be generated */

struct rmt_wakeup {
	caddr_t rw_chan;	/* local sleep channel */
	int	rw_hash;	/* index in slpque; -1 means not in use */
	short 	rw_sindex;	/* index into remote rmt_slp table */
	siteno_t rw_rmtsite;	/* site remote sleeper is on */
};

extern struct rmt_slp rmt_slp[];
extern struct rmt_wakeup rmt_wakeup[];

/* The following routines are used to implement remote sleep/wakeup:
 *	int slp_index = getrmtslp() preallocates a rmt_slp table entry
 *		and returns the slot index.  This is called at the site
 *		where the process is going to sleep.  Regardless
 *		of whether you sleep, you must eventually deallocate
 *		this table entry by setting
 *			rmt_slp[slp_index].rw_flag = 0;
 *	int wak_index = setrmtwakeup(rmt_site, slp_chan, slp_index)
 *		allocates a rmt_wakeup table entry and returns the
 *		slot index -- which is then given to the sleeping process
 *		on the remote site.  This is called at the site from which
 *		the wakeup is to generated.  This entry is deallocated
 *		when the next time a wakeup(slp_chan) occurs, or when
 *		sscansleep() is called (or slpcan() is called at the
 *		site which was supposed to be sleeping).
 *	slpcan(slp_index) is called at the sleeping site when the process
 *		(after being told to sleep by a remote site) decides not
 *		to wait for the wakeup message from the remote site (such
 *		as when the sleeping process is awaken by a signal).  This
 *		routine caused both the rmt_sleep entry and the rmt_wakeup
 *		entries to be deallocated.
 *	sscansleep(rmt_site, wak_index, slp_index) deallocates a rmt_wakeup
 *		table entry (the rmt_site and slp_index arguments are passed
 *		only for consistency checks).  It is called by svrslpcan()
 *		and by sitedown() when the remote process is no longer
 *		waiting for the remote wakeup.  It could also be called
 *		at the wakeup site if it changes its mind and doesn't tell
 *		the remote site to sleep.
 */
extern short getrmtslp();
extern int setrmtwakeup();
extern int slpcan();
extern int sscansleep();

#endif /* ! _h_NETSLP */
ikêò G  $        ^  F‰*x™ˆ*F‰*     µT^  	              jg  ./usr/include/sys/netstat.h  s.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

/*
 * netstat.h
 *
 *	this header file defines the data structures and macros that
 *	are used to accumulate locus netowrk performance statistics
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)netstat.h	16.4	LCC)	/* Modified: 18:30:28 9/22/89 */
/* SCCSIDPUFF( @(#)netstat.h	1.3 LM 18:27:27 C 1/9/86 ); */

#if ! defined(_h_NETSTAT)
#define _h_NETSTAT

#define NUM_NM_CLASS	15	/* number of distinct locus message classes */
#define NUM_UM_CLASS	 5	/* number of distinct user message classes */

#define NCLASS	(NUM_NM_CLASS+NUM_UM_CLASS)
/*
 * most of the collected statistics are on a per-site basis
 */
struct sitedata {
	long ss_pktin;		/* number of packets received from site */
	long ss_pktout;		/* number of packets sent to site */
	long ss_dupsin;		/* number of duplicate messages received */
	long ss_retrans;	/* number of retransmissions to site */
	long ss_msgdrops;	/* number dropped for want of a netmsg */
	long ss_bufdrops;	/* number dropped for want of a buffer */
	long ss_xmterrs;	/* number of hard transmission failures */
	long ss_crcerrs;	/* errors detected by checksumming */
	long ss_badmsg;		/* invalid message type or length */
	long ss_badsite;	/* invalid, ignored, down or closed site */
	long ss_badseq;		/* improper channel #s or ack # too high */
	long ss_sackblock;	/* number of special ack blocks */
	long ss_ackblock;	/* number of normal ack blocks */
	long ss_opens;		/* number of times site was down & up */

	long ss_msgin[NCLASS];	/* messages received - per class */
	long ss_msgout[NCLASS]; /* messages sent out - per class */
	long ss_rsptime[NCLASS];/* average time to response/ack */
	long ss_untimed;	/* number of untimed messages sent */
};

/*
 * there are a few statistics that are maintained on a per-network basis
 */
struct netstats {
	long ns_forwarded;	/* number of messages we forwarded */
	long ns_cantfwd;	/* number of non-forwardable messages */
	long ns_userin;		/* number of non-locus packets received */
	long ns_userout;	/* number of non-locus packets sent */
	long ns_badpkts;	/* number rejected for mal-formedness */
	long ns_badsite;	/* number rejected for bad site */
};

/*
 * data recording macros
 *	NETSTAT_BUMP	increment a network statistic counter
 *	SITESTAT_BUMP	increment a site statistic counter
 *	USRMSGIN	record the arrival of a user-type message
 *	USRMSGOUT	record the sending o a user-type message
 *	NETMSGIN	record the arrival of a locus-type message
 *	NETMSGOUT_START stamp an outgoing message with its xmit start time
 *	NETMSGOUT_STOP	compute the service time for a message and note that
 *			it went out.
 */
#ifdef	NETSTATS

#define nm_CLASS(nmp)			(nm_classmap[ ((nmp)->nm_type) & 0xff ])

#define SITESTAT_BUMP(site,field)	sitedata[site].field++
#define USRMSGIN(site,class)  sitedata[site].ss_msgin[class+NUM_NM_CLASS]++
#define USRMSGOUT(site,class) sitedata[site].ss_msgout[class+NUM_NM_CLASS]++
#define NETMSGIN(nmp)	    sitedata[(nmp)->nm_fsite].ss_msgin[nm_CLASS(nmp)]++
#define NETMSGOUT_START(nmp)		(nmp)->nm_ltime = rmtime()/1000;
#define NETMSGOUT_DONE(nmp)		do {\
	unsigned long diff;\
	diff = (rmtime() / 1000) - (nmp)->nm_ltime;\
	if (diff < 240000) /* 4 minutes, for overflow protection */ {\
		sitedata[(nmp)->nm_fsite].ss_rsptime[nm_CLASS(nmp)] += diff;\
		sitedata[(nmp)->nm_fsite].ss_msgout[nm_CLASS(nmp)]++;\
	} else \
		sitedata[(nmp)->nm_fsite].ss_untimed++;\
    } while (0)
#define NETSTAT_BUMP(net,field)		do {\
	if(netstats != NULL)\
		 netstats[net].field++;\
	/* else (netstats == NULL) this function is disabled */ \
    } while (0)

#else	/* !NETSTATS */
/* when NETSTATS is not defined, all of the data recording macros go away */
#define NETSTAT_BUMP(n,f)	 /* this function disabled */
#define SITESTAT_BUMP(s,f)	/* this function disabled */
#define USRMSGIN(s,c)		/* this function disabled */
#define USRMSGOUT(s,c)		/* this function disabled */
#define NETMSGIN(n)		/* this function disabled */
#define NETMSGOUT_START(n)	/* this function disabled */
#define NETMSGOUT_DONE(n)	/* this function disabled */
#endif	/* !NETSTATS */

#ifdef	KERNEL
extern struct netstats *netstats;	/* per network statistics */
extern struct sitedata sitedata[];	/* per site statistics */
extern unsigned char nm_classmap[];	/* map from req types to nm classes */
extern unsigned long rmtime();		/* micro-second time routine */
#else  /* ~KERNEL */
/*
 * If a non-kernel module includes this file, it is going to be interested
 * in reading recorded statistics, and the big question will be what do
 * the various classes of netmessages correspond to.  We can put a default
 * set of correspondances in here for them.  Note that this depends on
 * the way the nm_classmap array is defined in netstat.c
 */

char *nm_CLASSES[NCLASS] = {
	/* 00 */ "misc",
	/* 01 */ "nops",
	/* 02 */ "read",
	/* 03 */ "writes",
	/* 04 */ "open, stat",
	/* 05 */ "rcd ops",
	/* 06 */ "synch",
	/* 07 */ "proc crt/dst",
	/* 08 */ "proc sig/sts",
	/* 09 */ "cls/cmt/trunc",
	/* 10 */ "read rsp",
	/* 11 */ "other rsp",
	/* 12 */ "css-ss",
	/* 13 */ "topchg/update",
	/* 14 */ "netwrk maint",
	/* 15 */ "user-1",
	/* 16 */ "user-2",
	/* 17 */ "user-3",
	/* 18 */ "user-4",
	/* 19 */ "user-5"
};
#endif	/* ~ KERNEL */
#endif /* ! defined(_h_NETSTAT) */
 tkêÂ´ F  $        M  F‰*x™ˆ*F‰*     ~M  	                  ./usr/include/sys/nettty.h   s.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#include <sccs.h>
H_SCCSID(@(#)nettty.h	16.4	LCC)	/* Modified: 18:31:03 9/22/89 */

/*
 *	Net tty data structures 
 */

#include <nty_msg.h>

struct chan {
	sock_t	sock;
	bool_t	partial;
	char	opcode;

	/* really only one of these is needed */
	int	ctrllen;	/* length of pkt being rcvd (so far) */
	int	ctrlleft;	/* space left in buf */
	caddr_t	ctrlptr;	/* pointer into buf */

	union ctrlpkt ctrlpkt;	/* control packet being received */
};

struct nettty {
	struct chan low;	/* low-pri channel */
	/* NEEDSWORK:  should implement high-pri channel */
	/*struct chan high;*/	/* high-pri channel */
	short	flushing;	/* currently flushing keystrokes */
	short	sfsneeded;	/* other side currently flushing */
	short	ntystate;	/* state bits */
};

/* ntystate bits */
#define	NTYOHELD	0x1	/* holding output */
#define	NTYNEEDSM	0x2	/* send a modes packet when we get a chance */

#define	NTYCOMPAT
#ifdef NTYCOMPAT
/* these two modes are only used to support old versions of the PC software */
#define	NTYHASUNECHO	0x4	/* the PC side can send 'UNECHOEDDATA' */
#define	NTYFALSEMODES	0x8	/* the PC has been sent false modes. */
#endif /* NTYCOMPAT */
d(_kêRÃ E  $        B  G‰*y™ˆ*G‰*     »B  	                  ./usr/include/sys/netvers.h  s.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)netvers.h	16.22.2.1	LCC)	/* Modified: 13:40:22 4/2/91 */

	/* Current locus net message version number */
#define NETMSG_VERSION	0x47

	/* Current net message compatibility level */
#define NETMSG_LEVEL 	0x1  /* only valid for this NETMSG_VERSION sites */

#if	defined(NOCHECKS)
#define	_NMLEVEL_CHECK()	/**/
#else	/* !defined(NOCHECKS) */
#define _NMLEVEL_CHECK()	\
	if (netlev.blev[0])	\
		panic("set_nmlevel: level argument too large!\n"); \
	else
#endif	/* !defined(NOCHECKS) */

/*--------------------------------------------------------------*
| routine:							|
|	set_nmlevel						|
|								|
| purpose:							|
|	Put a 24-bit level value in into nm_level in network	|
|	byte order.						|
|								|
| parameters:							|
|	pointer to level, value to store there			|
|								|
| returns:							|
|	void							|
|								|
| algorithm:							|
|	Use htonl() to convert the level to network byte order	|
|								|
| NOTE: For values below 256, this simply zeros nm_level[0,1]	|
|	and set nm_level[2] to value.  Maybe we want 3 		|
|	independent level numbers in the nm_level, instead	|
|	of the 24-bit network byte order number here.		|
|								|
*--------------------------------------------------------------*/

#define	set_nmlevel(lptr,level) {		\
	union {					\
		u_long llev;			\
		char blev[sizeof(u_long)];	\
	} netlev;				\
\
	/* Convert level to network byte order. */	\
	netlev.llev = htonl(level);		\
\
	_NMLEVEL_CHECK();			\
\
	/* Store as 24 bit value */		\
	lptr[0] = netlev.blev[1];		\
	lptr[1] = netlev.blev[2];		\
	lptr[2] = netlev.blev[3];		\
}

ack */kê: D  $        °   G‰*y™ˆ*G‰*     »°   	              »  ./usr/include/sys/network.h  s.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)network.h	16.7	LCC)	/* Modified: 13:01:43 12/11/89 */
/* SCCSIDPUFF(@(#) network.h 3.1 LM 17:58:01 4/14/85 C 18:02:37 4/14/85); */

#ifndef _h_NETWORK
#define _h_NETWORK

#ifndef _h_BUF
#ifdef	KERNEL
#include <buf.h>
#else  /* ~KERNEL */
#include <sys/buf.h>
#endif /* ~KERNEL */
#endif	/* _h_BUF */

	/* size parameters for network switches */
#define MAXNETTYPES	16	/* room for this many different network types */
#define MAXNET		64	/* room for this many netsw entries */

#define SENDLONG()	(nmp->nm_buf)

#define SEQUENCED	1
#define NOT_SEQUENCED	0

#define NET_XMIT_OK	0
#define NET_XMIT_FAIL	(! NET_XMIT_OK)

/*
 * Network type info - one per driver
 */

struct nettype
{
				/* entry points in device-dependent driver */
	int	(*nt_init)();		/* initialize the network */
	int	(*nt_ostart)();		/* call here to request output */
	int	(*nt_reset)();		/* reset function */
	int	(*nt_prnet)();		/* net print function */
	int	(*nt_prstats)();		/* statistics print function */
	int	(*nt_copyfunc)();		/* packet access function */
	int	(*nt_to_func)();		/* timeout function */
	int	(*nt_setaddr)();		/* timeout function */
	int	(*nt_pktrel)();		/* packet release function */
				/* other info about this network type */
	short	nt_flags;		/* type flags on this net */
	short	nt_packet_size;		/* biggest packet this net can handle */
	short	nt_num_pieces;		/* number of logical packets guaranteed
					   to fit in a physical packet */
	long	nt_to_count;	/* timeout countdown */
};

/*
 * Networks switch structure
 * one entry per separately addressable network interface
 * (a given network type may have more than one netsw entry,
 * especially a point-to-point network like the tca.
 */

struct netsw
{
	int (*n_init)();	/* initialize interface function */
	int (*n_ostart)();	/* output startup function */
	int (*n_reset)();	/* reset (on ubareset) function */
	int (*n_prnet)();	/* print interface statistics function */
	int (*n_prstats)();	/* print interface statistics function */
	int (*n_copyfunc)();	/* copy from interface buffer routine */
	int (*n_setaddr)();	/* set site's physical address */
	int (*n_to_func)();	/* function to call upon timeout */
	u_short n_to_count;	/* countdown value until timeout occurs */
	short n_flags;		/* various interface flags (see below */
	u_short n_packet_size;	/* maximum data packet that can be sent */
	u_short n_num_pieces;	/* maximum number of pieces a packet can be */
				/* fragmented into */
	/*
	 * following fields used ONLY by locus netmsg code
	 */
	struct buf *n_ibp;	/* input buffer for network */
	struct netmsg *n_inmp;	/* input net message for network */
	struct netmsg *n_inmp2; /* backup input net message for network */
	struct site *n_head;	/* head of sites queued for device */
	struct site *n_tail;	/* tail of sites queued for device */
	struct net_packet *n_u_head;	/* head of user traffic queue */
	struct net_packet *n_u_tail;	/* head of user traffic queue */
	struct nettype	*n_type;	/* pointer to type info */
	/*
	 * following fields used ONLY by packet routing code (netroute.c)
	 */
	short	n_netnum;	/* network number for this interface */
	short	XXn_typecode;	/* NETTYPE_TCA or NETTYPE_ETH */
	int	XXn_subnet;	/* device dependent e.g., subnet
				   or port number */
	int (*XXn_pktrel)();	/* packet release function */
	struct nioqent	*XXn_oqstart;	/* start of netroute output queue */
	struct nioqent	*XXn_oqlast;	/* end of netroute output queue */

#ifdef IXONLY
	sema_t		XXn_exsema;	/* to provide exclusive access */
#endif /* IXONLY */
};

#if defined(KERNEL) && defined(u370)
extern struct	nettype nettypes[];
extern int		nettynxt;		/* next avail nettypes ntry */
#endif /* defined(KERNEL) && defined(u370) */

#if defined(KERNEL)
extern int maxnets;
extern	struct	netsw netsw[];
extern int		netswnxt;		/* next avail netsw entry */
extern	bool_t	Havenet;
extern	int	lnet_started;
extern unsigned long cluster_id;
#endif /* defined(KERNEL) */

/*
 *	Flags in netsw[].n_flags
 */

#define N_NOTATTACH	0x00		/* I don't have one of these. */
#define N_HAVEIT	0x01		/* I have one of these */
#define N_STARTED	0x02		/* have done an initial netstart on */
#define N_CKSUM		0x0004		/* perform checksums on this net */
#define N_PTOP		0x0010		/* historical??? */
#define N_SLOW		0x0020		/* BUG: unimplemented */
#define N_INPENDING	0x0040		/* currently have a read pending */
#define N_OUTPENDING	0x0080		/* now doing a write on this net */

/*
 * Network numbers are assigned in confnet.c
 */

#ifdef IP_LOCUS
#define NONET		((netno_t)-1)
#else /* ~IP_LOCUS */
#define NONET		0
#endif /* ~IP_LOCUS */
#define ETHNNO		1
#define TKRNNO		2
#define LCCNNO		2
#define DIDONNO		3
#define CTCNNO		4

#define PREDEFNETS	5


/* Macros for manipulating netmap_t's (which will go away someday). */
/* netmap_t is a short, so just shift on all machines */
#define netbit(net) ((netmap_t)1 << (net))
#define netinmap(map,net) ((map) & netbit(net))
#define addnet(map,net) ((map) |= netbit(net))
#	define delnet(map,net) ((map) &= ~netbit(net))

#ifdef	NETSTATS
/* statistics gathering variables */

struct debug_net
{
	u_long dbg_nmp;		/* netmsg pointer (actually an address) */
	time_t dbg_time;	/* when we sent this message */
	long dbg_l1;		/* netmsg type specific (long) */
	long dbg_l2;		/* netmsg type specific (long) */
	u_long dbg_seqn;	/* netmsg sequence number */

	short dbg_len;		/* length of netmsg */
	siteno_t dbg_fsite;	/* who sent/received this message */
	short dbg_s1;		/* netmsg type specific (short) */

	char dbg_flag;		/* DBG_{IN,OUT}PUT, and status stuff*/
	char dbg_nmtype;	/* netmsg type */
	char dbg_mcks;		/* netmsg checksum */
	char dbg_c1;		/* netmsg type specific (char) */
};

/* Bits in dbg_flag */
#define	DBG_DIR		0x03	/* Direction mask: two bits for compat w. old */
#define		DBG_INPUT	0x01
#define		DBG_OUTPUT	0x02
#define DBG_DROPPED	0x04	/* Message not actually xmitted or accepted. */

/*
 * Bits used to indicate what happened to the message
 * (see network & netstrat)
 */
#define	DBG_STATUS	0xf0	/* Status mask... why dropped */
#define	DBG_STAT_SHIFT	4	/* to put status in low-order bits */

/* input flags.  Output flags can overlay these. */
#define DBG_SHORT		0x10
#define DBG_IGNORED		0x20
#define DBG_WRONG_LSITE		0x30
#define DBG_BAD_TYPE		0x40
#define DBG_REJECT_CHAN		0x50
#define DBG_REJECT_SITE		0x60
#define DBG_NOT_SPECIAL		0x70
#define DBG_CHAN_MISMATCH	0x80
#define DBG_DUP			0x90
#define DBG_OUT_OF_SEQ		0xa0
#define DBG_REJECT_RESP		0xb0
#define DBG_REJECT_REQ		0xc0


#if defined(NETSTATS)
#define	FIX_STATS(dbgp, flags)	((dbgp)->dbg_flag |= flags)
#else /*!NETSTATS*/
#define	FIX_STATS(dbgp, flags)
#endif /*!NETSTATS*/

#ifdef	KERNEL

extern int dbg_cnt;		/* for "table growth" routines */

extern struct	debug_net *dbg;		/* ptr to start of netmsg debug table */
extern	struct	debug_net *dbgp;

extern	long dbgi_cnt;		/* total input messages logged */
extern	long dbgo_cnt;		/* total output messages logged */
extern	int dbgi;		/* index to next free element in table */

extern  struct debug_net *net_savestat(struct netmsg *, int);

#endif	/* KERNEL */

#endif	/* NETSTATS */

/* define to make net_getwork differ from net_getibufs in 7 chars. */
#define net_getwork	net_gtwrk

/* flags for turning global time synchronization on or off */

extern	bool_t nosynctime;	/* 1 => don't sync off net, 0 => sync */
extern	bool_t nosendtime;	/* 1 => don't send time, 0 => send time */

#define NETDATA(nmp)	(caddr_t)&((nmp)->nm_netprt)

#define nmflags(nmxp)	(netmsgsw[(nmxp)->nm_type & RESPONSEMASK].nms_flags)
#define isnmresp(nmxp)	((nmxp)->nm_type & RESPONSEBIT)

#define nbufioclr(bp, cmp, routine, flag, netp)		\
	do {						\
		if ((bp) != (cmp)) (routine)(bp);	\
		else (netp)->n_flags |= (flag);		\
	} while(0);

#if defined(KERNEL) && defined(NTY)
/*
 * functions provided by the packet routing module and used (indirectly)
 * by the network-tty code.
 */
extern struct netsw	*ni_addnet();
extern void		ni_enqout();
extern struct nioqent 	*ni_getwork();
extern void		ni_pktrelease();

#endif /* defined(KERNEL) && defined(NTY) */
#endif /* ~_h_NETWORK */
kê	 Ã  ÿ¡             v‰*v‰*v‰*          	                  ./usr/include/sys/nfs.h ../rpc/nfs.h /sykêÀo Á  ÿ¡             v‰*v‰*v‰*          	                  ./usr/include/sys/nfs_clnt.h s.h../rpc/nfs_clnt.h nfs_clkê
 ¿  ÿ¡             v‰*v‰*v‰*          	                  ./usr/include/sys/nfs_errno.h .h../rpc/nfs_errno.h fs_erkê®œ ½  ÿ¡             v‰*v‰*v‰*          	                  ./usr/include/sys/nfsmount.h  .h../rpc/nfsmount.h nfsmoukêœû C  $        Ø  G‰*z™ˆ*G‰*     RWØ  	                  ./usr/include/sys/nioqent.h   .h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */


#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)nioqent.h	16.3	LCC)	/* Modified: 18:28:25 9/16/89 */

#ifndef JHTYPES_H
#include <jhtypes.h>
#endif /* JHTYPES_H */

#ifndef __IN_HEADER__
#include <in.h>
#endif /* __IN_HEADER__ */

/*
 * entry in a network output queue
 * ** network independent **
 */
struct nioqent
{
	struct nioqent	*ni_next;	/* addr of next entry in queue if any */
	struct netsw	*ni_net;	/* net this entry is for */
	struct in_addr	ni_addr;	/* destination address */
	caddr_t		ni_bufp;	/* address of data buffer */
	int		ni_count;	/* number of bytes to send */
	ushort		ni_service;	/* service this entry is for */
	int		(*ni_relfn)();	/* fn to release the above buffer */
	paddr_t		ni_arg;		/* argument available to relfn */
};
kê®ê B  $        ~  G‰*z™ˆ*G‰*     A\~  	                  ./usr/include/sys/niservice.h .h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)niservice.h	16.3	LCC)	/* Modified: 18:29:15 9/16/89 */

/* This is an entirely bogus header file.
 * Its purpose is to define the mapping between the various
 * network-type dependent protocol or type specifiers and the functions
 * which serve them.
 */

/* The indexes into the netsw table... this is really silly to define
 * since there is no way to be sure it is right, but here goes.
 */
#define	NETTYPE_ETH	5	/* empirical */
#define	NETTYPE_TCA	7	/* a guess!! */

/* NEEDSWORK: flipping!!!!! */
#define	PROTO_ETHDISC	0x1717	/* NEEDSWORK: bogus */
#define	PROTO_ETHECHO	0x1718	/* Equally bogus */
#define	PROTO_ETHJB	0x0411	/* my birthday */

#define	PROTO_TCAPCI	0x0000
#define	PROTO_TCADISC	0x0001
#define	PROTO_TCAECHO	0x0002
#define	PROTO_TCAJB	0x0003

/* Net independent proto numbers */
#define	PROTO_PCI	0
#define	PROTO_DISC	1
#define	PROTO_ECHO	2
#define	PROTO_JB	3

/* Structure used by netroute to map between various proto stuff. */
struct ni_protomap
{
	u_short		pm_niproto;	/* network ind. proto code. */
	u_short		pm_ndproto;	/* network dep. proto code. */
	short		pm_typecode;
	funcp_t		pm_rcvfuncp;
};
tykê2ê A  $        6	  G‰*{™ˆ*G‰*     VW6	  	                  ./usr/include/sys/nmdirstat.h .h
/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)nmdirstat.h	16.6	LCC)	/* Modified: 18:32:52 9/22/89 */

#ifndef _NMDIRSTAT_
#define _NMDIRSTAT_

#ifndef _TYPES_
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _TYPES_ */

struct nmdirstat{
	PADOPEN(NMDlongs)
	off_t	Ndi_offset;	/* offset into directory */
	long	Ndi_space;	/* space user has remaining in buffer; */
				/* in response it indicates available data */
	long	Ndi_count;	/* count of struct dirstat's (response only) */
	gfs_t	Ndi_gfs;	/* gfs number of directory */
	ino_t	Ndi_inum;	/* inode number of directory */
	uid_t	Ndi_uid;	/* uid of caller for access checks */
	gid_t	Ndi_gid;	/* gid of caller for access checks */
	PADCLOSE(NMDlongs, xNMDlongs, xUNMDlong)
#define ndi_offset	xUNMDlong.xNMDlongs.Ndi_offset
#define ndi_space	xUNMDlong.xNMDlongs.Ndi_space
#define	ndi_count	xUNMDlong.xNMDlongs.Ndi_count
#define	ndi_gfs		xUNMDlong.xNMDlongs.Ndi_gfs
#define	ndi_inum	xUNMDlong.xNMDlongs.Ndi_inum
#define	ndi_uid		xUNMDlong.xNMDlongs.Ndi_uid
#define	ndi_gid		xUNMDlong.xNMDlongs.Ndi_gid
#define NNMDLONGS	(sizeof (struct NMDlongs) / sizeof (long))

	PADOPEN(NMDshorts)
	islot_t Ndi_islot;	/* inode slot on ss	*/
	short	Ndi_bsize;	/* BSIZE for sender. */
	short	Ndi_groups[NGROUPS];		/* groups for access checks */
	PADCLOSE(NMDshorts, xNMDshorts, xUNMDshort)
#define ndi_islot	xUNMDshort.xNMDshorts.Ndi_islot
#define ndi_bsize	xUNMDshort.xNMDshorts.Ndi_bsize
#define ndi_groups	xUNMDshort.xNMDshorts.Ndi_groups
#define NNMDSHORTS	(sizeof (struct NMDshorts) / sizeof (short))

	PADOPEN(NMDchars)
	char	Ndi_done;	/* th-th-that's all folks (response only) */
	PADCLOSE(NMDchars, xNMDchars, xUNMDchars)
#define ndi_done	xUNMDchars.xNMDchars.Ndi_done
#define NNMDCHARS	(sizeof (struct NMDchars) / sizeof (char))
};

#ifndef  NOCHECKS
/* If the following statement causes a compiler warning or error,
 * then the length of the nmdirstat structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMDS, nmdirstat);
#endif /* ~NOCHECKS */

#endif /* ! _NMDIRSTAT_ */
	0kê¡ @  $        S  G‰*{™ˆ*G‰*     BS  	                  ./usr/include/sys/nmdustat.h  .h
/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)nmdustat.h	16.4	LCC)	/* Modified: 18:33:27 9/22/89 */

#ifndef _h_NMDUSTAT
#define _h_NMDUSTAT

#ifndef _h_TYPES
#ifdef KERNEL
#include <types.h>
#else /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */

#ifndef _h_PARAM
#ifdef KERNEL
#include <param.h>
#else /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif /* ~_h_PARAM */

/* This is essentially a subset of the filsys struct. 
 * I have tried to make the trailing field names the same. 
 * This structure must be kept in parallel with the dustat structure, which
 * is user-visible. I have not made them one because the user needs an
 * array of packlist structures at the end, and this makes it too large
 * to fit in the nm_var field of a netmsg.  When changing this, be sure to
 * update the flipping routine as well. */
struct nmdustat {
	fstore_t	ndu_fstore;
#define ndu_gfs		ndu_fstore
/* On requests, the fstore field is borrowed to specify the gfs. */

	commitcnt_t	ndu_hwm;
	commitcnt_t	ndu_lwm;
	daddr_t		ndu_fsize;
	daddr_t		ndu_tfree;	/* number of free blocks. */
	ino_t		ndu_tinode;	/* # of free inodes. */
	ino_t		ndu_isize;	/* addr of first data block. */

	short		ndu_bsize;	/* size of BSIZE. */
	pckno_t		ndu_pckno;
	siteno_t	ndu_site;	
	unsigned short	ndu_flags;

	char		ndu_inopb;	/* inodes per block. */
	char		ndu_version;
	char		ndu_packcnt;	/* count of valid packlists in
					   this message. Only valid when
					   used for NM_DPACKLST msg. */
	char		ndu_dummy[5];	/* padding/expansion */
	char 		ndu_fsmnt[32];
	char		ndu_fpack[8];
};

#ifndef NOCHECKS
/* If the following statement causes a compiler warning or error,
 * then the length of the nmdustat structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMDUS, nmdustat);
#endif  /* ~NOCHECKS */

#endif /* ! _h_NMDUSTAT */
ompilkê˜ ¼  $          w‰*Ù™ˆ*w‰*     /Á  	                  ./usr/include/sys/nmlnfs.h h  .h
/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)nmlnfs.h	16.4	LCC)	/* Modified: 19:54:31 9/16/89 */


#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  ~KERNEL
#include <sys/types.h>
#endif ~KERNEL
#endif  _h_TYPES

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  ~KERNEL
#include <sys/param.h>
#endif ~KERNEL
#endif  _h_PARAM

struct nmlnfs {
	PADOPEN(NLNFSlongs)
	gfs_t		Nfs_fgfs;
	gfs_t		Nfs_tgfs;
	ino_t		Nfs_fino;
	ino_t		Nfs_tino;
	igflag_t	Nfs_flag;
	unsigned int	Nfs_groups[NETNGROUPS];	/* environment */
	PADCLOSE(NLNFSlongs, xNLNFSlongs, xUNLNFSlong)
#define nfs_groups	xUNLNFSlong.xNLNFSlongs.Nfs_groups
#define nfs_tgfs	xUNLNFSlong.xNLNFSlongs.Nfs_tgfs
#define nfs_fgfs	xUNLNFSlong.xNLNFSlongs.Nfs_fgfs
#define nfs_fino	xUNLNFSlong.xNLNFSlongs.Nfs_fino
#define nfs_tino	xUNLNFSlong.xNLNFSlongs.Nfs_tino
#define nfs_flag	xUNLNFSlong.xNLNFSlongs.Nfs_flag
#define NNLNFSLONGS	(sizeof (struct NLNFSlongs) / sizeof (long))

	PADOPEN(NLNFSshorts)
	short		Nfs_index;
	suid_t		Nfs_uid;			/* environment */
	sgid_t		Nfs_gid;			/* environment */

	PADCLOSE(NLNFSshorts, xNLNFSshorts, xUNLNFSshort)
#define nfs_uid		xUNLNFSshort.xNLNFSshorts.Nfs_uid
#define nfs_gid		xUNLNFSshort.xNLNFSshorts.Nfs_gid
#define nfs_index	xUNLNFSshort.xNLNFSshorts.Nfs_index
#define NNLNFSSHORTS	(sizeof (struct NLNFSshorts) / sizeof (short))
	fhandle_t	nfs_fhandle;
};

/* If the following statement causes a compiler warning or error,
 * then the length of the nmlockf structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNLNFS, nmlnfs);
32];
	ckêèa ?  $        /  G‰*{™ˆ*G‰*     >n/  	                  ./usr/include/sys/nmmount.h   .h
/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)nmmount.h	16.6	LCC)	/* Modified: 13:29:56 7/29/90 */

#ifndef	_h_NMMOUNT
#define	_h_NMMOUNT

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _h_TYPES */

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  ~KERNEL
#include <sys/param.h>
#endif /* ~KERNEL */
#endif  /* _h_PARAM */

struct nmmount {
	PADOPEN(NMTlongs)
	gfs_t		Nmt_gfs;
	gfs_t		Nmt_mtgfs;
	ino_t		Nmt_mtinum;
	commitcnt_t	Nmt_hwm;
	commitcnt_t	Nmt_lwm;
	fstore_t	Nmt_fstore;
	ino_t		Nmt_tino;
	PADCLOSE(NMTlongs, xNMTlongs, xUNMTlong)
#define nmt_gfs		xUNMTlong.xNMTlongs.Nmt_gfs
#define nmt_mtgfs	xUNMTlong.xNMTlongs.Nmt_mtgfs
#define nmt_mtinum	xUNMTlong.xNMTlongs.Nmt_mtinum
#define nmt_hwm		xUNMTlong.xNMTlongs.Nmt_hwm
#define nmt_lwm		xUNMTlong.xNMTlongs.Nmt_lwm
#define nmt_fstore	xUNMTlong.xNMTlongs.Nmt_fstore
#define nmt_tino	xUNMTlong.xNMTlongs.Nmt_tino
#define NNMTLONGS	(sizeof (struct NMTlongs) / sizeof (long))

	PADOPEN(NMTshorts)
	unsigned short	Nmt_sbflags;
	siteno_t	Nmt_css;
	pckno_t		Nmt_pack;
	siteno_t	Nmt_ocss;
	PADCLOSE(NMTshorts, xNMTshorts, xUNMTshort)
#define nmt_sbflags	xUNMTshort.xNMTshorts.Nmt_sbflags
#define nmt_css		xUNMTshort.xNMTshorts.Nmt_css
#define nmt_pack	xUNMTshort.xNMTshorts.Nmt_pack
#define nmt_ocss	xUNMTshort.xNMTshorts.Nmt_ocss
#define NNMTSHORTS	(sizeof (struct NMTshorts) / sizeof (short))

	PADOPEN(NMTchars)
	char		Nmt_gmgflags;
	PADCLOSE(NMTchars, xNMTchars, xUNMTchar)
#define nmt_gmgflags	xUNMTchar.xNMTchars.Nmt_gmgflags
};


#ifndef  NOCHECKS
/* If the following statement causes a compiler warning or error,
 * then the length of the nmmount structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMMT, nmmount);
#endif /* ~NOCHECKS */

#endif /* ~_h_NMMOUNT */
Ekêò >  $        ™
  H‰*{™ˆ*H‰*     An™
  	                  ./usr/include/sys/nmnamei.h   .h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)nmnamei.h	16.10	LCC)	/* Modified: 21:47:14 10/29/91 */
 
/*
 * This structure is passed to namei containing the information
 * necessary for local namei's, and to remote namei's with the
 * additional information needed to recreate the environment.
 */
struct nmnamei {
	PADOPEN(NIlong)
	igflag_t	Ni_openmode;	/* namei */
	igflag_t	Ni_nameimode;	/* namei */
	gfs_t	Ni_groot;		/* environment */
	gfs_t	Ni_gsearch;		/* environment */
	gfs_t	Ni_glocal;		/* environment */
	dev_t	Ni_rdev;		/* namei for "mknod" */
					/* also used as a gfs in link/rename */
	ino_t	Ni_iroot;		/* environment */
	ino_t	Ni_isearch;		/* environment */
	ino_t	Ni_ilocal;		/* environment */
	ino_t	Ni_lkino;		/* inode number for link/rename */
	PADCLOSE(NIlong, xNIlong, xUNIlong)
	PADOPEN(NIshort)
	siteno_t Ni_rdevsite;		/* namei for "mknod" */
	suid_t	Ni_uid;			/* environment */
	sgid_t	Ni_gid;			/* environment */
	short	Ni_path;		/* environment */
	unsigned short	Ni_crmode;	/* namei for NEWOK */
	sitepath_t Ni_spath[SPATHLEN];	/* environment */
	short	Ni_groups[NETNGROUPS];	/* environment */
	suid_t	Ni_ruid;		/* environment for NFS */
	PADCLOSE(NIshort, xNIshort, xUNIshort)
	PADOPEN(NIchar)
	char	Ni_uvers[UVERS_SIZE + 1];	/* hidden dir prefix	*/
	char	Ni_sys5look;			/* sys5 dir lookup mode */
#ifdef _MBCS
	char	Ni_uflag;		/* namei - locale flag */
#endif /* _MBCS */
	PADCLOSE(NIchar, xNIchar, xUNIchar)
};

#define	ni_openmode	xUNIlong.xNIlong.Ni_openmode
#define	ni_nameimode	xUNIlong.xNIlong.Ni_nameimode
#define	ni_rootgfs	xUNIlong.xNIlong.Ni_groot
#define	ni_searchgfs	xUNIlong.xNIlong.Ni_gsearch
#define	ni_localgfs	xUNIlong.xNIlong.Ni_glocal
#define	ni_rdev		xUNIlong.xNIlong.Ni_rdev
#define	ni_rootino	xUNIlong.xNIlong.Ni_iroot
#define	ni_searchino	xUNIlong.xNIlong.Ni_isearch
#define	ni_localino	xUNIlong.xNIlong.Ni_ilocal
#define	ni_lkino	xUNIlong.xNIlong.Ni_lkino

#define	ni_rdevsite	xUNIshort.xNIshort.Ni_rdevsite
#define	ni_uid		xUNIshort.xNIshort.Ni_uid
#define	ni_gid		xUNIshort.xNIshort.Ni_gid
#define	ni_path		xUNIshort.xNIshort.Ni_path
#define	ni_crmode	xUNIshort.xNIshort.Ni_crmode
#define	ni_spath	xUNIshort.xNIshort.Ni_spath
#define	ni_groups	xUNIshort.xNIshort.Ni_groups
#define	ni_ruid		xUNIshort.xNIshort.Ni_ruid

#define	ni_uvers	xUNIchar.xNIchar.Ni_uvers
#define	ni_sys5look	xUNIchar.xNIchar.Ni_sys5look

#ifdef _MBCS
#define	ni_uflag	xUNIchar.xNIchar.Ni_uflag
#endif /* _MBCS */


CHECKNMVARSIZE(xNMNI, nmnamei);
X_STATSkê¢C »  $        W  w‰*Ú™ˆ*w‰*     ÀjW  	                  ./usr/include/sys/nmnfsrddir.h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)nmnfsrddir.h	1.4	LCC)	/* Modified: 19:55:22 9/16/89 */
 
/*
 */
struct nmnfsrddir {
	PADOPEN(NRDDIRlongs)
	ino_t Nrddir_inum;		/* Inode of the directory */
	gfs_t Nrddir_gfs;		/* Gfs of the directory */
	unsigned int	Nrddir_groups[NETNGROUPS];	/* environment */
	int	Nrddir_ext;			/* extended argument */
	off_t	Nrddir_cookie;
	int	Nrddir_count;
	PADCLOSE(NRDDIRlongs, xNRDDIRlongs, xUNRDDIRlongs)
	PADOPEN(NRDDIRshorts)
	suid_t	Nrddir_uid;			/* environment */
	sgid_t	Nrddir_gid;			/* environment */
	islot_t	Nrddir_ssislot;		/* islot of the directory to read */
	PADCLOSE(NRDDIRshorts, xNRDDIRshorts, xUNRDDIRshorts)
};

#define nd_inum		xUNRDDIRlongs.xNRDDIRlongs.Nrddir_inum
#define nd_gfs		xUNRDDIRlongs.xNRDDIRlongs.Nrddir_gfs
#define nd_groups	xUNRDDIRlongs.xNRDDIRlongs.Nrddir_groups
#define nd_ext		xUNRDDIRlongs.xNRDDIRlongs.Nrddir_ext
#define nd_cookie	xUNRDDIRlongs.xNRDDIRlongs.Nrddir_cookie
#define nd_count	xUNRDDIRlongs.xNRDDIRlongs.Nrddir_count
#define	NNRDDIRLONGS	(sizeof (struct NRDDIRlongs) / sizeof (long))

#define nd_uid		xUNRDDIRshorts.xNRDDIRshorts.Nrddir_uid
#define nd_gid		xUNRDDIRshorts.xNRDDIRshorts.Nrddir_gid
#define nd_ssislot	xUNRDDIRshorts.xNRDDIRshorts.Nrddir_ssislot
#define	NNRDDIRSHORTS	(sizeof (struct NRDDIRshorts) / sizeof (short))

#ifndef NOCHECKS
CHECKNMVARSIZE(xNMNFSRDDIR, nmnfsrddir);
#endif
dkêø¶ =  $        >
  H‰*|™ˆ*H‰*     ó>
  	                  ./usr/include/sys/nmrdwr.h r.h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)nmrdwr.h	16.10	LCC)	/* Modified: 16:55:23 6/10/92 */

#ifndef _h_NMRDWR
#define _h_NMRDWR

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _h_TYPES */

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif  /* _h_PARAM */

struct nmrdwr {
	PADOPEN(NRWlongs)
	gfs_t	Nrw_gfs;	/* file gfs number for sequencing */
	ino_t	Nrw_inum;	/* file inode number for sequencing */
	long	Nrw_lpgno;
	off_t	Nrw_isize;	/* fifo i_size/write pointer	*/
	off_t	Nrw_fxrdwr;	/* fifo future r/w pointer	*/
	off_t	Nrw_frptr;	/* fifo current read pointer	*/
	long	Nrw_uid;	/* user id needed for nfs operations */
	long	Nrw_gid;	/* group id needed for nfs operations */
	PADCLOSE(NRWlongs, xNRWlongs, xUNRWlongs)
#define nrw_gfs		xUNRWlongs.xNRWlongs.Nrw_gfs
#define nrw_inum	xUNRWlongs.xNRWlongs.Nrw_inum
#define nrw_lpgno	xUNRWlongs.xNRWlongs.Nrw_lpgno
#define nrw_isize	xUNRWlongs.xNRWlongs.Nrw_isize
#define nrw_fxread	xUNRWlongs.xNRWlongs.Nrw_fxrdwr
#define nrw_fxwrite	xUNRWlongs.xNRWlongs.Nrw_fxrdwr
#define nrw_frptr	xUNRWlongs.xNRWlongs.Nrw_frptr
#define nrw_nfsuid	xUNRWlongs.xNRWlongs.Nrw_uid
#define nrw_nfsgid	xUNRWlongs.xNRWlongs.Nrw_gid
#define NNRWLONGS	(sizeof (struct NRWlongs) / sizeof (long))

	PADOPEN(NRWshorts)
	islot_t	Nrw_ssislot;	/* storage site inode address */
	islot_t	Nrw_usislot;	/* using site inode address */
	short	Nrw_retrans;	/* retransmission count for READs */
	short	Nrw_flags;	/* NCI flags for writes */
	PADCLOSE(NRWshorts, xNRWshorts, xUNRWshorts)
};
#define nrw_ssislot	xUNRWshorts.xNRWshorts.Nrw_ssislot
#define nrw_usislot	xUNRWshorts.xNRWshorts.Nrw_usislot
#define	nrw_retrans	xUNRWshorts.xNRWshorts.Nrw_retrans
#define nrw_flags	xUNRWshorts.xNRWshorts.Nrw_flags
#define NNRWSHORTS	(sizeof (struct NRWshorts) / sizeof (short))

#define NRW_FDEFERC	0x1	/* do deferred commits of changes */
#define NRW_ROOT	0x2	/* operation requested by root */
#define NRW_HOLE	0x4	/* buffer contains a hole */

#ifndef  NOCHECKS
/* If the following statement causes a compiler warning or error,
 * then the length of the nmrdwr structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMRW, nmrdwr);
#endif /* ~NOCHECKS */

#endif /* ~_h_NMRDWR */
nekêêv <  $        8  H‰*|™ˆ*H‰*     ||8  	                  ./usr/include/sys/nmtmsync.h h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)nmtmsync.h	16.4	LCC)	/* Modified: 18:35:44 9/22/89 */
/* SCCSIDPUFF(@(#) nmtmsync.h 4.1 LM 12:54:57 4/23/85 C 22:12:58 4/23/85); */

#ifndef _h_NMTIMESYNC
#define _h_NMTIMESYNC

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _h_TYPES */

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif  /* _h_PARAM */

struct nmtimesync {
	PADOPEN(NTSlongs)
	time_t		Nts_lttime;	/* local transmission time  */
	time_t		Nts_ltmicro;
	time_t		Nts_rrtime;	/* remote receipt time      */
	time_t		Nts_rrmicro;
	time_t		Nts_rttime;	/* remote transmission time */
	time_t		Nts_rtmicro;
	time_t		Nts_lrtime;	/* local receipt time       */
	time_t		Nts_lrmicro;
	PADCLOSE(NTSlongs, xNTSlongs, xUNTSlongs)
};
#define	nts_lttime	xUNTSlongs.xNTSlongs.Nts_lttime
#define nts_ltmicro	xUNTSlongs.xNTSlongs.Nts_ltmicro
#define nts_rrtime	xUNTSlongs.xNTSlongs.Nts_rrtime
#define nts_rrmicro	xUNTSlongs.xNTSlongs.Nts_rrmicro
#define nts_rttime	xUNTSlongs.xNTSlongs.Nts_rttime
#define nts_rtmicro	xUNTSlongs.xNTSlongs.Nts_rtmicro
#define nts_lrtime	xUNTSlongs.xNTSlongs.Nts_lrtime
#define nts_lrmicro	xUNTSlongs.xNTSlongs.Nts_lrmicro
#define NNTSLONGS	(sizeof (struct NTSlongs) / sizeof (long))

/* If the following statement causes a compiler warning or error,
 * then the length of the nmtimesync structure is larager than
 * NMVARSIZE and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMTS, nmtimesync);

#endif /* ~_h_NMTIMESYNC */
kêPÐ ;  $        d
  H‰*~™ˆ*H‰*     Üd
  	                  ./usr/include/sys/nmtopchg.h h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)nmtopchg.h	16.4	LCC)	/* Modified: 18:36:20 9/22/89 */
/* SCCSIDPUFF(@(#) nmtopchg.h 4.3 LM 00:22:58 6/21/85 C 00:23:02 6/21/85); */

#ifndef	_h_NMTOPCHG
#define	_h_NMTOPCHG

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _h_TYPES */

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif  /* _h_PARAM */

struct nmtopchg {
	PADOPEN(Ntlongs)
	sitemap_t	Ntop_partset;
	gfs_t		Ntop_gfs;
	commitcnt_t	Ntop_commitcnt;
	long		Ntop_seq;
	sitemap_t	Ntop_origlist;	/* map used to inform actsite which
					   origsites need to get info from me,
					   and to inform origsites from which
					   sites they need to get info. */
	fstore_t	Ntop_fstore;	/* fstore of local pack of Ntop_gfs */
	PADCLOSE(Ntlongs, xNtl, xUNtl)
/* NEEDSWORK: re-using commitcnt to avoid network reboot, clean up. */
#define	ntop_ignoremask	xUNtl.xNtl.Ntop_commitcnt
#define	ntop_partset	xUNtl.xNtl.Ntop_partset
#define	ntop_gfs	xUNtl.xNtl.Ntop_gfs
#define	ntop_commitcnt	xUNtl.xNtl.Ntop_commitcnt
#define	ntop_seq	xUNtl.xNtl.Ntop_seq
#define	ntop_origlist	xUNtl.xNtl.Ntop_origlist
#define	ntop_fstore	xUNtl.xNtl.Ntop_fstore
#define	NTCLONGS	(sizeof(struct Ntlongs) / sizeof(long))
	PADOPEN(Ntshorts)
	short		Ntop_strelm;
	short		Ntop_version;
	pckno_t		Ntop_pack;	/* local pack number of Ntop_gfs */
	unsigned short	Ntop_sbflags;	/* local supblock flags for Ntop_pack */
	short		Ntop_index;	/* starting index into mount table */
	short		Ntop_gsmnts;	/* total # of gsmounts */
	PADCLOSE(Ntshorts, xNtshorts, xUNtshort)
#define	NTCSHORTS	(sizeof(struct Ntshorts) / sizeof(short))
	PADOPEN(Ntchars)
	char		Ntop_status;
	PADCLOSE(Ntchars, xNtchars, xUNtchar)
};
#define ntop_strelm	xUNtshort.xNtshorts.Ntop_strelm
#define ntop_version	xUNtshort.xNtshorts.Ntop_version
#define ntop_pack	xUNtshort.xNtshorts.Ntop_pack
#define ntop_sbflags	xUNtshort.xNtshorts.Ntop_sbflags
#define ntop_index	xUNtshort.xNtshorts.Ntop_index
#define ntop_gsmnts	xUNtshort.xNtshorts.Ntop_gsmnts
#define ntop_status	xUNtchar.xNtchars.Ntop_status

/* If the following statement causes a compiler warning or error,
 * then the length of the nmtopchg structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMTC, nmtopchg);

#endif /* ~_h_NMTOPCHG */
#endkê:n :  $        ƒ  H‰*~™ˆ*H‰*     jÂƒ  	                  ./usr/include/sys/nmustat.h  h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)nmustat.h	16.4	LCC)	/* Modified: 18:37:23 9/22/89 */

#ifndef	_h_NMUSTAT
#define	_h_NMUSTAT

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif /* ~_h_PARAM */

/*
   Struct nmustat carries remote ustat information.
   Used with message types NM_USTAT/NM_RUSTAT.
*/
struct nmustat {
	PADOPEN(nust_longs)
	gfs_t	Nust_gfs;	/* Gfs to ustat		*/
	ino_t	Nust_tinode;	/* Free inodes	*/
	daddr_t	Nust_tfree;	/* Total free blocks	*/
	PADCLOSE(nust_longs, nustLS, nustLU)
#define	nust_gfs	nustLU.nustLS.Nust_gfs
#define	nust_tinode	nustLU.nustLS.Nust_tinode
#define	nust_tfree	nustLU.nustLS.Nust_tfree
#define	NNUSTLONGS	(sizeof(struct nust_longs) / sizeof(long))

	PADOPEN(nust_CT)
	char	nust_Cfname[6];	/* File system name	*/
	char	nust_Cfpack[6];	/* Pack name		*/
	PADCLOSE(nust_CT, nust_CS, nust_CU)
#define	nust_fname	nust_CU.nust_CS.nust_Cfname
#define	nust_fpack	nust_CU.nust_CS.nust_Cfpack
};

#ifndef  NOCHECKS
/* If the following statement causes a compiler warning or error,
 * then the length of the nmustat structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMUS, nmustat);
#endif  /* ~NOCHECKS */

#endif /* ~_h_NMUSTAT */
localkê°Á 9  $          H‰*~™ˆ*H‰*     ËŒ  	                  ./usr/include/sys/nty_msg.h  h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)nty_msg.h	16.4	LCC)	/* Modified: 18:37:58 9/22/89 */

/* net tty mode message format (also PC mode state) */
/* control message opcodes */
/* 0 is not used, indicates no message in progress */
#define	NTY_DATA		1
#define	NTY_SETMODE		2
#define	NTY_AMFLUSH		3
#define	NTY_STOPFLUSH		4
#define	NTY_PLZFLUSH		5
#define	NTY_VBREAK		6
#define	NTY_XONCTRL		7
#define	NTY_HOLD		8
#define	NTY_RELEASE		9
#define	NTY_UNECHOEDDATA	10

struct modes
{
	short	align;	/* used to force even length */
	char	intr;
	char	quit;
	char	swtch;
	char	erase;
	char	kill;
	char	eof;
	char	eol;
	char	eol2;
	char	stop;
	char	start;
	char	quote;
	/* following are booleans */
	char	isig;			/* enable signal chars */
	char	icanon;			/* canonicalize */
	char	echo;			/* echo enabled */
	char	echoe;			/* echo erase as bsspbs */
	char	echok;			/* echo kill as crlf */
	char	echonl;			/* echo nl even if no echo */
	char	noflsh;			/* flush on intr, quit */

	char	olcuc;			/* xlate lc to uc on echo */
	char	onlcr;			/* xlate nl to crnl on echo */
	char	ocrnl;			/* xlate cr to nl on echo */

	char	istrip;			/* strip high bit on input */
	char	inlcr;			/* xlate nl to cr on input */
	char	igncr;			/* ignore cr on input */
	char	icrnl;			/* xlate cr to nl on input */
	char	iuclc;			/* xlate uc to lc on input */
	char	ixany;			/* any char restarts after ^S */
};

/* control packets are read into one of these, and then looked at through */
/* the appropriately colored glasses. */
union ctrlpkt {
	struct modes modes;
	char	buf[1];		/* to read data into */
};

nt tablkêÒâ 8  $        ¤  H‰*™ˆ*H‰*     »¤  	                  ./usr/include/sys/ntyconf.h  h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

/*
 *
 * device driver configuration header file for pty.c
 *
 * This module is included by conf.c and is responsible for allocating
 * all data structures required by the device driver.  Three device
 * specific pre-processor defined symbols are available for our use:
 *
 *	B_xyz		block major device number (if any)
 *	C_xyz		character major device number (if any)
 *	N_xyz		number of configured controllers
 *	U_xyz		number of configured sub-units
 *
 * (where "xyz" is the device driver prefix)
 *
 */
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)ntyconf.h	16.4	LCC)	/* Modified: 18:38:34 9/22/89 */

#ifndef U_nty
#define U_nty	(N_tca)		/* + ..., add others as needed */
#endif /* ~U_nty */
/*
 * structures needed for network ttys
 */
#include <tty.h>
#include <jhtypes.h>
#include <nettty.h>
#ifdef NOTYET
#include <clstconf.h>
#endif /* NOTYET */

#ifdef CONFC

struct nettty nty_dev[U_nty];

struct tty nty_tty[U_nty];


#endif /* CONFC */

lushkê2- 7  $        ™  I‰*™ˆ*I‰*     z™  	              þm  ./usr/include/sys/o_dstat.h  h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)o_dstat.h	16.4	LCC)	/* Modified: 18:39:06 9/22/89 */

#ifndef _h_ODSTAT
#define _h_ODSTAT

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _h_TYPES */


#if defined(LCC) || defined(DEVCOMPAT)
/*
 * Structure describing the attributes of files across all
 * the types of file systems which are supported.  This is
 * a superset of the AIX stat structure's fields.
 */
#undef CALLER
#undef OTHER
#undef SOMEONE
#undef NO_ONE
enum tagtype	{ CALLER, OTHER, SOMEONE, NO_ONE };

#undef VNON
#undef VDIR
#undef VCHR
#undef VBLK
#undef VREG
#undef VMPC
#undef VFIFO
#undef VBAD
#undef VHDIR
#undef VSOCK
#undef VLNK
#define VUNDEF  VNON
enum vtype      { VDIR, VCHR, VBLK, VREG, VMPC, VFIFO, VBAD, VNON,
		  VHDIR, VSOCK, VLNK} ;

/* These definitions are used by old versions of stat, fstat, dstat and dfstat
 * and should be deleted when the above routines are deleted.
 */
struct	oldstat
{
	dev_t	st_dev;
	ino_t	st_ino;
	smode_t  st_mode;
	nlink_t	st_nlink;
	suid_t	st_uid;
	sgid_t	st_gid;
	off_t	st_size;
	time_t	st_atime;
	long	st_spare1;
	time_t	st_mtime;
	long	st_spare2;
	time_t	st_ctime;
	long	st_spare3;
	long	st_blksize;
	long	st_blocks;
	long	st_spare4[2];
	dev_t	st_rdev;
	short	st_spare5;
};

/*
 * Structure of the result of fullstat
 */
struct  o_fullstat
{
	/* Beginning of stat block replica... */
	dev_t   st_dev;            /* ID of device containing */
				   /* a directory entry for this file */
				   /* File serial + device uniquely */
				   /* identifies the file within the system */
	ino_t   st_ino;            /* File serial number */
	smode_t  st_mode;          /* File mode; see #define's below */
	nlink_t	st_nlink;          /* Number of links */
	suid_t   st_uid;           /* User ID of the file's owner */
	sgid_t   st_gid;           /* Group ID of the file's group */
	off_t   st_size;           /* File size in bytes */
	time_t  st_atime;          /* Time of last access */
	long	st_spare1;
	time_t  st_mtime;          /* Time of last data modification */
	long	st_spare2;
	time_t  st_ctime;          /* Time of last file status change */
				   /* Time measured in seconds since */
				   /* 00:00:00 GMT, Jan. 1, 1970 */
	long	st_spare3;
	long	st_blksize;
	long	st_blocks;
	long	st_spare4[2];
	dev_t   st_rdev;           /* ID of device */
				   /* This entry is defined only for */
				   /* character or block special files */
	short	st_spare5;

	/* ...End of stat block replica */

	suid_t	fst_uid_raw;	   /* The file's untranslated uid */
	sgid_t	fst_gid_raw;	   /* The file's untranslated gid */
	enum vtype	fst_type;		/* vnode type */
	enum tagtype	fst_uid_rev_tag;	/* Enumerated in */
	enum tagtype	fst_gid_rev_tag;	/*   vattr.h	 */
	union {
	    short * Fst_other_gid_list;	/* Pointer to first gid on alternate */
				   	/*   concurrent group list	*/
	    long  X;			/* Keep same size on all machines */
	} U;
#define	fst_other_gid_list	U.Fst_other_gid_list
	short	fst_other_gid_count;	/* Number of gid's on alternate */
				    	/*   concurrent group list	*/

	long	fst_vfs;	   /* Vfs id			 */
	long	fst_nid;           /* Node id			 */
	long	fst_flag;	   /* Flag word			 */
	long	fst_i_gen;	   /* inode generation number	 */
	long	fst_reserved[8];   /* Reserved			 */

};

struct ostat {
	short	st_dev;
	s_ino_t	st_ino;
	unsigned short st_mode;
	nlink_t	st_nlink;
	short	st_uid;
	short	st_gid;
	short	st_rdev;
	off_t	st_size;
	time_t	st_atime;
	time_t	st_mtime;
	time_t	st_ctime;
};

#define	__ODSTAT1 \
	gfs_t	dst_gfs;	/* Global file system number */ \
	siteno_t dst_css;	/* Current synchronization site */ \
	siteno_t dst_ss;	/* Current storage site (dfstat only) */ \
	s_ino_t	dst_ino;	/* Inode number */ \
	short	dst_flags;	/* Flags (dstat only) -- see below */ \
 \
	unsigned short dst_mode;/* mode and type of file, see below */ \
	nlink_t	dst_nlink;    	/* number of links to file */ \
	short	dst_uid;      	/* owner's user id */ \
	short	dst_gid;      	/* owner's group id */ \
	ino_uniqid_t dst_uniqid;/* unique identifier */  

#define	__ODSTAT2 \
	dflag_t	dst_dflag;	/* disk flags (see below )*/

#define __ODSTAT3 \
	off_t	dst_size;     	/* number of bytes in file */ \
	time_t	dst_atime;   	/* time last accessed */ \
	time_t	dst_mtime;   	/* time last modified */ \
	time_t	dst_ctime;   	/* time inode last changed */ \
	daddr_t dst_rdev;	/* (site,major_dev,minor_dev) -- devices only */ \
	commitcnt_t dst_cmtcnt;	/* gfs commit seq number */ \
	fstore_t dst_fstore;	/* file propogation attributes */ \
	long  dst_version;	/* Version number of file */ \
	daddr_t dst_blocks;	/* Total number of blocks used in file. */ \
	short	dst_bsize;	/* File system block size */ \
	short	dst_unused;	/* Room for future expansion */


struct  odstat
{
	__ODSTAT1
	__ODSTAT2
	__ODSTAT3
};

#endif /* LCC || DEVCOMPAT */


#ifdef UCLA_CS
/* These definitions are used by lstat and lfstat (real old version of
 * dstat dfstat) and should be deleted when the above routines are deleted.
 */

typedef char	packno_t;
typedef long	vv_ver_t;
#define VVSIZE	4
typedef struct { vv_ver_t vva[VVSIZE]; }	vv_t;
typedef struct { packno_t packa[VVSIZE]; }	pack_t;

struct  o_dstat
{
	char	ods_gfs;
	char	ods_css;
	s_ino_t	ods_ino;
	unsigned short ods_mode;
	nlink_t ods_nlink;
	short   ods_uid;
	short   ods_gid;
	daddr_t ods_rdev;
	off_t   ods_size;
	time_t  ods_mtime;
	time_t  ods_ctime;
	vv_t	ods_vv;
	dflag_t ods_dflag;
	pack_t	ods_pack;
};
#endif /* UCLA_CS */

#endif  /* ~_h_ODSTAT */
       kê´® 6  $          I‰*w™ˆ*I‰*     €\  	                  ./usr/include/sys/osm.h /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#include	"./sccs.h"
H_SCCSID(@(#)osm.h	16.4	LCC)	/* Modified: 18:39:40 9/22/89 */
/**********
 *	This code came from IX370.
***********/

/*  OSM - operating system messages:  allows system messages
 *     to be read via a special file.
 *     minor 0:  starts from beginning of buffer and waits for more.
 *     minor 1:  starts at current buffer position and waits.
 *     minor 2:  starts from beginning of buffer and doesn't wait.
 */


struct putbuf {
	char	*osmcad;
	char	*osmfad;
	char	*osmlad;
	};

/* definitions for minor devices */

#define OSM_BEG_WAIT	0	/* start at beginning, wait for more */
#define OSM_CUR_WAIT	1	/* start at current pos, wait for more */
#define OSM_BEG_EOF	2	/* start at beginning, eof if no more */

#define OSM_MAX_MINOR	2	/* largest supported minor */

/* special characters */

#define OSM_MISSED	'\377'	/* indicates some printfs were lost due to
				 * wrapping around the circular buffer */
#define OSM_NCPRINTF	'%'	/* appears at start of ncprintf lines */

/* flags for osmputc */
#define OSMP_PRINTF	0	/* character is from printf/ncprintf */
#define OSMP_WRITE	1	/* character is from console write */
#define OSMP_ECHO	2	/* character is echoed from console input */
_inkê T 5  $        ö  I‰*€™ˆ*I‰*     @–ö  	                  ./usr/include/sys/osmconf.h  h h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#include <sccs.h>
H_SCCSID(@(#)osmconf.h	16.4	LCC)	/* Modified: 18:40:16 9/22/89 */

#ifndef OSM_H
#include <osm.h>
#endif /* !OSM_H */

#ifdef CONFC
char osmbuf[OSMSIZE];

struct putbuf osmlog = {&osmbuf[0], &osmbuf[0], &osmbuf[OSMSIZE-1]};
struct putbuf *op = &osmlog;
#endif /* CONFC */
wakêè 4  $        wS  J‰*™ˆ*J‰*     O‰wS  	              oY  ./usr/include/sys/param.h h  h h/*
 *		AIX/370
 *		5713-AFL
 * 5713-AEQ COPYRIGHT IBM CORP 1989
 * LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
 *
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#include <sccs.h>
H_SCCSID(@(#)param.h	1.3    IBM AIX)    /* Modified: 20:01:59 7/15/92 */

#ifndef	_h_PARAM
#define	_h_PARAM

#include <DOPTIONS.h>
#ifdef KERNEL
#ifndef	LOCORE
#include <debugflag.h>
#ifndef _h_TYPES
#include <types.h>
#endif  /* ! _h_TYPES */
#include <config.h>
#include <var.h>
#ifndef	_h_SIGNAL
#include <signal.h>
#endif  /* ! _h_SIGNAL */
#endif	/* LOCORE */

#else  /* ~KERNEL */

#ifndef _h_TYPES
#include <sys/types.h>
#endif  /* ! _h_TYPES */
#include <sys/config.h>
#ifndef _h_SIGNAL
#include <signal.h>
#endif  /* ! _h_SIGNAL */
#endif /* ~KERNEL */

#ifdef BRIDGE
#define BRIDGE_DEV	12  /* must agree with bdevsw in conf32.c */
#endif /* BRIDGE */

/* Changed number of partitions per drive from 8 to 16.  This meant changing
 *	the definition of "dkblock".
 * Changed number of mounted file systems from 15 to 31.
 * Changed per-user process limit from 25 to 40.
 */

/*
 *	include the file with debug defined in it!
 */

#define		PLP

/*
 *
 * Tunable variables which do not usually vary per system.
 *
 * The sizes of most system tables are configured
 * into each system description.  The file system buffer
 * cache size is assigned based on available memory.
 * The tables whose sizes don't vary often are given here.
 */

#if	defined(i386)
#	define	SSIZE	4096	/* initial stack size (bytes) */
#	define	SINCR	1024	/* increment of stack (bytes) (not used)*/
#	define	KSTACKSIZE	4096	/* kernel stack size */
#endif	/* defined(i386) */




#if	defined(u370)
#define SSIZE		1	/* initial stack size in clicks (pages) */
#define SINCR		1	/* incrementof stack on faults in clicks */
#endif  /* defined(u370) */

#define MAXUID	65535		/* maximum value of a user id */
#define MAXUID_MASK ((unsigned long) 0xffff)	/* 16-bit mask for user id */
#define	NOFILE	200		/* max open files per process */

#define MAXFDMAP 255		/* max size of fdmap in a run() syscall */
				/* should be at least as large as the largest */
				/* NOFILE of any machine on the net */

#define N_DVU_INF 3		/* # of fields to describe a device address */
#define	CANBSIZ	256		/* max size of typewriter line */
#define	NCARGS	16384		/* # characters in exec arglist */

				/* Multiple group support from AIX and BSD43 */
				/* NOTE: NGROUPS is also defined in <grp.h>
				 * for AIX.  If you update the one here,
				 * you should also update the one in <grp.h>.*/
#define NGROUPS 32		/* max. number of groups */
#define NETNGROUPS 16		/* temporary: no. of groups for remote files */
#define	NOGROUP	-1		/* marker for empty group set member */

#define	MAXPATHLEN	1024	/* Maximum length of a pathname (including
				 * symbolic link expansions). */
#define	MAXLINK	        32767	/* max. hard links */
#define MAXSYMLINK      50	/* max. symbolic links */
#define	MAXSITE		32	/* largest conceivable number of sites	*/
				/* upper limit on v.v_sites		*/

#define MSWAPX	(v.v_mount + 1)	/* MUST be illegal mount index */

#ifdef	SWAPPING
#	define SCHEDFREQ (hz/2)	/* run scheduler 2 times per second */
#	define PAGEFREQ (hz+10)	/* never */
#endif	/* SWAPPING */

#ifdef  BSD_SCHED
#ifdef	b370
#	define PAGEFREQ (hz/3)		/* run pager 4 times per second */
#	define SCHEDFREQ (hz/6)		/* run scheduler 6 times per second */
#else	/* ~b370 */
#	define PAGEFREQ (hz/4)		/* run pager 4 times per second */
#	define SCHEDFREQ (hz/10)	/* run scheduler 10 times per second */
#endif	/* b370 */
#endif	/* BSD_SCHED */

#ifdef SYS3_SCHED
#	define SCHEDFREQ   15		/* run scheduler every 15 ticks */
#endif

#ifdef	NO_PAGER
#	define NSYSPROCS 1	/* processes 0 and 1 */
#else	/* ~NO_PAGER */
#ifdef	i386
#	define NSYSPROCS 3	/* processes 0, 1, 2, and 3 */
#	define PAGEPROC  1
#	define PFAULT_AHEAD 6 /* physio_dc #page fault ins before lock down */
#else	/* ~i386 */
#define NSYSPROCS 4	/* processes 0, 1, 2, 3 and 4 (0 for swapin)	*/
			/*			      (1 for init)	*/
			/*			      (2 for pager)	*/
			/*			      (3 for swapout)	*/
			/*			      (4 for overhead)	*/
#	define PAGEPROC  2
#endif	/* ~i386 */
#endif	/* ~NO_PAGER */

/*
 * priorities
 * probably should not be
 * altered too much
 */

#define	PSWP	0
#define	PINOD	10

#define PSPCLP	11

#define PAGESIZE 2048

#define PTOKEN	20
#define	PRIBIO	20
#define	PRIMAP	20
#define PRINM   20
#define	PRIUBA	24
#define	PZERO	25
#define	PPIPE	26
#define PSTABLE 27
#define	PWAIT	30
#define PXTOKEN	31 /* positive priority -- used to wait for token */
#define	PSLEP	40
#define	PUSER	50
#define PIDLE	127
/* flags and masks for system 5 compatible sleep. */
#define PCATCH  0400		/* bit which tells sleep to return instead
				 * of longjmp'ing to u.u_qsav on receipt of
				 * a signal. */
#define	PMASK	0177		/* mask off PCATCH. */

#define	NZERO	20

/*
 * Return values from tsleep().
 */
#define	TS_OK	0	/* normal wakeup */
#define	TS_TIME	1	/* timed-out wakeup */
#define	TS_SIG	2	/* asynchronous signal wakeup */

/*
 * fundamental constants of the implementation--
 * cannot be changed easily.
 */

#define	NBBY		8		/* number of bits in a byte       */
#define NBPB		(8)		/* number of bits in a byte - AIX */
#define	BPBSHIFT	(3)		/* log2(NBPB)			  */
#define	NBPW		sizeof(int)	/* number of bytes in an integer  */

#if	defined(i386)
#	define	LSBINDEX	0
#endif	/* defined(i386) */
#if	defined(u370)
#	define	LSBINDEX	3
#endif	/*  defined(u370) */

#ifndef	LSBINDEX
/* #error "LSBINDEX must be defined"
 * ^ This was meant to blow the compilation, but was removed so that
 *	5.2 cpp can run.
 * Define LSBINDEX to be the index in a long of the least
 * significant byte on this machine
 */
#endif /* ~LSBINDEX */

/* the index of the nth least signifcant digit (0 = lsb, 3=msb) of a
 * long. Depends entirely on LSBINDEX on any machine we presently care
 * about, with bytes xor words or both possibly flipped.
 * this works, try it if you don't believe.
 * (this is really only meant to take constants as args).
 * the + 4 is since negative % foo is negative or zero.
 */
#define	SBINDEX(SB)	( ( ((SB) & 1? -LSBINDEX:LSBINDEX) + 4 + (SB)) % 4 )

#define XRDEVSITE(RDEV) ( (RDEV) [ SBINDEX(2) ])

#ifdef	i386
/*
 * Implementation dependent constants
 */
#define	NBPG		4096	/* Number of bytes per page */
#define	NBPP		NBPG	/* Nbr of bytes per page.  SysV compatibilty. */
#define NBPC		NBPG	/* Number of bytes per "click" */
#define	NETNBPG		512	/* NBPG when sending info across on netforks */
#define PGSHIFT		12	/* Page shift size */
#define USERVBASE	0x00000000  /* User linear (virtual) base address */
#define KERNVBASE	0xF0000000  /* Kernel linear (virtual) base address */
#define KALLOCVBASE	0xF1000000  /* Kernel virt addr for dynm allocation */
#define PHYSVBASE	0xF8000000  /* Kernel (virtual) address of phys mem */
#define USRSTACKBASE	0x20000000  /* Base of the User stack */
#define STACKWINDOW	NBPG	/* Allowable difference (in bytes) between */
#endif	/* ! i386 */
				/*    stack fault address and current sp.  */
#if	defined(u370) /* Start of IX/370 code */
/*
 * fundamental constants of the implementation--
 * cannot be changed easily
 */

#	define  NBPG	4096		/* Number of bytes per page */
#	define	NBPP	NBPG		/* Nbr of bytes per page.    */
#	define  PGSHIFT	12		/* LOG2(NBPG) 		     */
#	define	LOG2BPP	PGSHIFT		/* log2(NBPG).		     */
#	define	NPPS3	16		/* Nbr of pages per segment. */
#	define	LOG2PPS3 4		/* log2(NPPS).		     */
#	define	NPPSXA	256		/* Nbr of pages per segment. */
#	define	LOG2PPSXA 8		/* log2(NPPS).		     */
#ifdef	S370
#	define	NPPS	NPPS3		/* Nbr of pages per segment. */
#	define	LOG2PPS	LOG2PPS3	/* log2(NPPS).		     */
#endif	/* S370 */
#ifdef	XA370
#	define	NPPS	NPPSXA		/* Nbr of pages per segment. */
#	define	LOG2PPS	LOG2PPSXA	/* log2(NPPS).		     */
#endif	/* XA370 */

#	define	NBPS	(NBPG*NPPS)	/* Nbr of bytes per segment. */
#	define  LOG2BPS (LOG2BPP+LOG2PPS) /* log2(NBPS).	     */
#	define	UTXTORG	(NBPG*NPPS3)	/* Virtual address of 1st    */
					/* word of user's text area. */
					/* Must allow space for ISA. */
					/* We currently use the	     */
					/* entire 1st segment.	     */

					/* Following define used for	*/
					/* compatability of core files.	*/
#	define	USIZERND 4096		/* Round size of user struct */

#ifdef	b370
#ifdef	SVPAGING
#	define	UPAGES	6		/* Six pages for the u		*/
					/* structure, kernel stack and	*/
					/* segment table.		*/
#else	/* ~SVPAGING */
typedef	unsigned int	ste_t;
#	define	UPAGES	3		/* Three pages for the u	*/
					/* structure and kernel stack	*/
#endif	/* ~SVPAGING */
#endif	/* b370 */
					/* Clicks per segment  */
					/* are only used to figure   */
					/* out "logical" segments    */
					/* (i.e. text, data & stack) */
					/* and those are 64k even in */
					/* XA (For compatibility)    */
#	define NCPS	NPPS3		/* Number of clicks per segment */
#	define NCPSHIFT LOG2PPS3	/* LOG2(NCPS) if exact       */
#	define NBPC	NBPG		/* Number of Bytes Per Click */
#	define BPCSHIFT LOG2BPP		/*  (BPC is Bytes Per Click  */
				   	/* which is called BPP on u370) */
#	define NCPD	1		/* Number of clicks per disk blk */
#	define NCPDSHIFT 0		/* LOG2(NCPD) if exact		 */
#endif  /* (u370) End of IX/370 code */
	/* Network file system unit definitions */
#define N_BSIZE		4096		/* the network standard sized buf. */

#define N_BMASK		(N_BSIZE-1)	/* This will all get fixed with 4k */
#define N_BSSHIFT	12		/* log2(N_BSIZE)		   */

#define N_FSSIZE	512	/* the network standard file system unit. */
#define N_FSSHIFT	9	/* log2(N_FSSIZE) */

#define	N_FSRATIO	(BSIZE/N_FSSIZE) /* ratio of local BSIZE to net std */
#define NETTOFSB(x)	((x) / N_FSRATIO)
#define FSBTONET(x)	((x) * N_FSRATIO)
#define  btonb(x) 	(((unsigned)(x)+(N_BSIZE-1)) >> N_BSSHIFT)
					   /* bytes to net bufs */

#define	PGOFSET		(NBPG-1)	/* byte offset into page */
#define NWPG		(NBPG/NBPW)	/* Number Words per Page */

#ifndef NULL
#define NULL	0
#endif /* !NULL */

#ifndef CNULL
#define CNULL	((char*)NULL)
#endif /* !CNULL */

#ifndef INULL
#define INULL	((int*)NULL)
#endif /* !INULL */

#define	MINCPY	1		/* minimum number of copies of a file */
#define	CMASK	0		/* default mask for file creation */
#define	NODEV	(dev_t)(-1)
#define	ROOTINO	((ino_t)2)	/* i number of all roots */
#define	SUPERB	((daddr_t)1)	/* block number of the super block */

/*
 * Clustering of hardware pages on machines with ridiculously small
 * page sizes is done here.  The paging subsystem deals with units of
 * CLSIZE pte's describing NBPG (from vm.h) bytes each...
 *
 * Even though parts of the code pretend to understand the difference
 * between a click and a segment, other parts have the implicit assumption
 * that these are the same.  Much code examination is required to be
 * successful in making these different.  (dave)
 *
#if	defined(PAGING) || defined(SWAPPING)
 * NOTE: SSIZE, SINCR and UPAGES must be multiples of CLSIZE
#endif  (PAGING || SWAPPING)
 */

#ifdef  b370
#define  DEV_BSIZE	4096	/* Logical device block size */
#define  DEV_BSHIFT	12	/* Log2 of DEV_BSIZE */
#else
#define  DEV_BSIZE      512     /* Logical device block size */
#define  DEV_BSHIFT	9	/* Log2 of DEV_BSIZE */
#endif  /* b370 */

	/* btodb - calculates (bytes/DEV_BSIZE) */
#define btodb(bytes) ((unsigned long)(bytes) >> DEV_BSHIFT)

	/* dbtob - calculates (db * DEV_BSIZE) */
#define dbtob(db) ((unsigned long)(db) << DEV_BSHIFT)

	/* Logical device blocks per file system block*/
#define  LDBSPERFSB	(BSIZE/DEV_BSIZE)

	/* Block size of block devices and file systems */
#if	defined(u370) || defined(i386)
#define  BSIZE		4096
#endif	/* u370 || i386 */

#ifndef BSIZE
#define  BSIZE		1024
#endif /* !BSIZE */

#if defined(i386) || defined(u370)
#	define	CLSIZE	1
#	define	CLSHIFT		PGSHIFT
#endif /* defined(i386) || defined(u370) */
#ifdef	u370
#	define	clbase(i)	(i)
#	define	clrnd(i)	(i)
#endif	/* u370 */

#define	CLOFSET		(CLSIZE*NBPG-1)	/* for clusters, like PGOFSET */

	/*  block numbers per message blk (used by page level propagation) */
#define		BNPERBLK	(N_BSIZE/(sizeof(daddr_t)) - 1)

#if BSIZE==512

#define	BMASK	0777		/* BSIZE-1 */
#define	BSHIFT	9		/* LOG2(BSIZE) */
#define	NMASK	0177		/* NINDIR-1 */
#define	NSHIFT	7		/* LOG2(NINDIR) */

#endif /* BSIZE */

#if BSIZE==1024

#define	BMASK	01777
#define	BSHIFT	10
#define	NMASK	0377
#define	NSHIFT	8

#endif /* BSIZE */

#if BSIZE==2048

#define	BMASK	03777
#define	BSHIFT	11
#define	NMASK	0777
#define	NSHIFT	9

#endif /* BSIZE */

#if BSIZE==4096

#define	BMASK	07777
#define	BSHIFT	12
#define	NMASK	01777
#define	NSHIFT	10

#endif /* BSIZE */

/*
 * UBSIZE: Units for communication with user in ulimit, ustat.
 */
#define UBSIZE  512             /* bytes in a "user block" (<= BSIZE) */
#define UBSHIFT 9               /* LOG2(UBSIZE) */


#	define	CLBYTES	(CLSIZE*NBPG)

#ifndef MCLBYTES
#define MCLBYTES CLBYTES
#endif

/* must be same as spl in routines like eipstart */
#define	splimp		spl6


/* bitmap macros */
#define sitbit(sit) ((sitemap_t)1 << ((sit)-1))

#define sitmap(map,sit) ((map) & sitbit(sit))
#define msitmap(map,sit) ((map) |= sitbit(sit))
#define nsitmap(map,sit) ((map) & ~sitbit(sit))
#define dsitmap(map,sit) ((map) &= ~sitbit(sit))

/* assign bit fields (good for both netmaps and sitemaps) */
#define copybits(dst,src,mask)	((dst) &= ~(mask), (dst) |= (src) & (mask))

/* inumber to disk address and inumber to disk offset */
#	define	itod(x)	((daddr_t)((((unsigned)(x)+2*INOPB-1)/INOPB)))
#	define	itoo(x)	((int)(((x)+2*INOPB-1)%INOPB))

/* file system blocks to disk blocks and back */
#if	defined(i386)
#define	fsbtodb(b)	((b)*(LDBSPERFSB))
#define	dbtofsb(b)	((b)/(LDBSPERFSB))
#else	/* ! (i386) */
#define	fsbtodb(b)	(b)
#define	dbtofsb(b)	(b)
#endif	/* ! (i386) */

#define	NINDIR	(BSIZE/sizeof(daddr_t))

/*
 * Macros for fast min/max
 */
#define	MIN(a,b) (((a)<(b))?(a):(b))
#define	MAX(a,b) (((a)>(b))?(a):(b))

/*
 * Some macros for units conversion
 */
/* Core clicks (NBPG bytes) to segments and vice versa */
/* These macros are not used everywhere that they should be -- Beware */
#if	defined(u370) /* Start of IX/370 code */
#	ifdef  NCPSHIFT
#		define ctos(x) (((x)+(NCPS-1))>>NCPSHIFT)
#		define stoc(x) ((x)<<NCPSHIFT)
#	else  /* ~NCPSHIFT */
#		define ctos(x) (((x)+(NCPS-1))/NCPS)
#		define	stoc(x) ((x)*NCPS)
#	endif /* ~NCPSHIFT */

	/* bytes to segment */
#	define btos(x) (ctos(btoc(x)))
	/* segment to bytes */
#	define stob(x) (ctob(stoc(x)))
#else  /* ~(u370) End of IX/370 code */
#	define	ctos(x)	(x)
#	define	stoc(x)	(x)
#endif /* ~(u370) */

#ifdef X286PROCS
/* Extract the selector (high 16 bits) from a 286 mode pointer */
#define	x286sel(x)	((ushort) ((ulong) (x) >> 16))

/* Extract the offset (low 16 bits) from a 286 mode pointer */
#define	x286off(x)	((ushort) (x))

#if defined(M_I86) || defined(DOS)
/* Create a 286 mode pointer from a selector and offset */
#define x286ptr(sel, off) \
	(((char far *) ((unsigned long) (sel) << 16) + (unsigned int) (off)))
#else
/* Create a 286 mode pointer from a selector and offset */
#define x286ptr(sel, off) \
	(((caddr_t) ((unsigned long) (sel) << 16) + (unsigned int) (off)))
#endif

/* Real mode pointer to physical address */
#define realtop(realptr) \
	((paddr_t) (((ulong)(realptr) & 0xffff0000L) >> 12) + (ushort)(realptr))

/* Real mode segment and offset to physical address */
#define realsotop(seg, off) \
	(((paddr_t) (ushort) (seg) << 4) + (ushort) (off))
#endif /* X286PROCS */


#ifdef	i386
#	define	ctod(x)	(((x) << PGSHIFT) >> DEV_BSHIFT)
#	define	dtoc(x)	(((x) << DEV_BSHIFT) >> PGSHIFT)
#	define	dtob(x)	((x) << DEV_BSHIFT)
#	define	btod(x)	((x) >> DEV_BSHIFT)
#	define	ctob(x)	((long)(x)<<PGSHIFT)
#	define	btoc(x)	((unsigned)(((unsigned long)(x)+NBPG-1)>>PGSHIFT))
#endif	/* i386 */

#ifdef b370
#       define  ctod(x)	((x) * (NBPG/DEV_BSIZE))
#       define  dtoc(x)	((x)/(NBPG/DEV_BSIZE))
#       define  dtob(x)	((x) * DEV_BSIZE)
#       define  btod(x)	((x) / DEV_BSIZE)
#       define  ctob(x)	((x) << PGSHIFT)
#       define  btoc(x)	(((unsigned)(x)+(NBPG-1)) >> PGSHIFT)
#endif  /* b370 */


/*
 * Some defines for the global bit flags contained in glblflg
 */
#define	dep_site	(glblflg&1)
#define	diskless	(glblflg&2)
#define	rswpdev		(glblflg&4)
#define	ICHKDONE	010
#define	rootcheck	(glblflg&ICHKDONE)

#if	defined(KERNEL)
#define	addophis(x,y)
#define	addsophis(w,x,y,z)

/*
 * Provide about n microseconds of delay
 *	This can not possibly be right for all machine types/models!!!
 *	Perhaps we could factor in a machine dependent MIPS factor or somesuch
 */
#define	DELAY(n)	{ register int N = (n); while (--N > 0); }
#endif	/* (KERNEL ) */

/*
 * Machine-dependent bits and macros
 */
#if	 defined(i386)
/*
 * USERMODE can be passed a CS register or a fake PSW.
 */
#define USERMODE(ps)	((ps) & SELRPL)
/*
 * Use SELINCR in the fake PSW used by BASEPRI because it is sure to
 * be distinct from SELPRI.
 */
#define	BASEPRI(ps)	((ps) & SELINCR)
#else	/* (i386) */
/*
 * Some defines for those systems that are not sixteen bits, and don't
 * need to support the concept of large, middle, and small model user
 * programs.   Suptr and Fuptr are used for user arg list manipulation.
 */
#define suptr(a, b, c)	suword( (a), (b) )
#define fuptr(a, b)	fuword( (a) )
#endif	/* !(i386) */

/* how many y sized objects does it take to store x things */
#ifndef howmany
#	define	howmany(x,y)	(((x)+((y)-1))/(y))
#endif

#if	defined(u370) /* Start of IX/370 code */
/*	The following values are used as the second parameter to
 *	a "psema" call.
 */

#define	DISABLE	 0		/* Disable interrupts.  Do not	*/
				/* resume the process until a	*/
				/* "vsema" is done on the	*/
				/* semaphore.			*/
#define	ENABLE	 &u.u_qsav	/* If an interrupt occurs while	*/
				/* the process is on the sema-	*/
				/* phore queue, do a resume on	*/
				/* "u.u_qsav".			*/

#endif  /* (u370)End of IX/370 code */

#ifdef b370

#	define	BASEPRI(psw)	((psw & (IOmask | EXmask)) != (IOmask | EXmask))

#	define	fuword		fulong
#	define	suword		sulong
#	define	fuibyte		fubyte
#	define	suibyte		subyte
#	define	fuishort	fushort
#	define	suishort	sushort
#	define	fuilong		fulong
#	define	suilong		sulong
#	define	fuiword		fuword
#	define	suiword		suword
#endif	/* b370 */

/*
   Constants and macros used to facilitate layout of heterogeneously
   exchangable structures.
*/

#define	ALIGN_SZ	(sizeof(align_t))
#define	ALIGN_ROUND	(ALIGN_SZ - 1)

/*
   The padding macros below use the value of the PADNAME pre-processor
   macro as the name for padding variables.
*/
#ifndef	PADNAME
#define	PADNAME		__PAD__
#endif	/* -PADNAME */


/*
   PADOPEN(stag)

   Opens a union and a nested struct with the tag `stag'.  DO NOT USE
   a `;' after the closing `)'.
*/

#define	PADOPEN(stag) \
	union { struct stag {


/*
   PADCLOSE(stag, sname, uname)

   Close struct with tag `stag' and name it `sname';  Declare padding
   array named PADNAME.  Close union and name it `uname'.  DO NOT USE
   a `;' after the closing `)'.
*/

#define	PADCLOSE(stag, sname, uname) \
	}  sname;  PADARRAY((struct stag), PADNAME) } uname;


/*
   PADARRAY(padobj, arrayname)

   PADARRAY declares an array of align_t's named `arrayname' whose size
   is chosen such that a union of `padobj' and PADDARY(padobj, xyz)
   will meet the heterogeneous structure size criterion.  DO NOT USE
   a `;' after the closing `)'.
*/

#define	PADARRAY(padobj, arrayname) \
	align_t  arrayname[(sizeof padobj + ALIGN_ROUND) / ALIGN_SZ];


/*
   PAD(decl, uname)

   Surrounds declaration `decl' with a union that also includes an
   align_t for padding.  DO NOT USE a `;' after the closing `)'.
*/

#define	PAD(decl, uname) \
	union { decl; align_t PADNAME; } uname;

		/* short/long order detection constants:		*/

/*
   NSYSCALLS is the size of the sysent array,
   i.e. the number of available system calls.
   In the future nsyscalls should be computed
   in sysent.c.  A number like "MAXSYSCALL" might be reasonable
   for declaring other arrays, but it is not a good idea to
   require that we keep this number and the number in sysent in sync.
   Note that NSYSCALLS may be larger than the number of syscalls.
*/
#	define	NSYSCALLS       231

/*
   SPATHLEN is the maximum length of the list of attempted
   sites/cpu-types that the user may specify
*/
#define	SPATHLEN	16

/* The size of the variable portion of the netmsg. */
#define NMVARSIZE	140
#define	lobyte(X)	(((unsigned char *)&X)[0])
#define	hibyte(X)	(((unsigned char *)&X)[1])
#define	loword(X)	(((ushort *)&X)[0])
#define	hiword(X)	(((ushort *)&X)[1])

/*
 * Maximum size of hostname recognized and stored in the Kernel.
 */
#define MAXHOSTNAMELEN 64

/*
 * Maximum number of load modules which can be cached.
 * Maximum number of shared libraries that can be referenced by a single
 * executable.
 */
#define	LDM_CACHE_SIZE	10
#define	MAX_SHLIB	LDM_CACHE_SIZE

/*
 * Fast machine dependant setting/clearing of hardware interrupts
 */
#if defined(i386)
#ifdef __HIGHC__
#define	Cli	cli()		/* _ASM("cli") */
#define	Sti	sti()		/* _ASM("sti") */
#else
/* The PS/2 compiler does not handle symbolic asm directives */
#define Cli	asm(0xfa)	/* should be asm("cli") */
#define Sti	asm(0xfb)	/* should be asm("sli") */
#endif 	/* __HIGHC__ */
#endif	/* i386 */
#endif 	/* ~_h_PARAM */
/kê¬e ¹  ÿ¡             w‰*w‰*w‰*          	                  ./usr/include/sys/pathname.h h h../rpc/pathname.h pathnakê¾I 3  $        á  J‰*™ˆ*J‰*     *‡á  	                  ./usr/include/sys/pcb.h /*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)pcb.h	16.4	LCC)	/* Modified: 18:41:39 9/22/89 */

#ifndef _h_PCB
#define _h_PCB


#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _h_TYPES */

#if	defined(PTINU) && !defined(_h_PTE)
#include <pte.h>
#endif  /* (PTINU && ~_h_PTE) */

/*
 * VAX process control block
 */

struct pcb
{
	int	pcb_ksp; 	/* kernel stack pointer */
#ifdef	vax
	int	pcb_esp; 	/* exec stack pointer */
	int	pcb_ssp; 	/* supervisor stack pointer */
	int	pcb_usp; 	/* user stack pointer */
	int	pcb_r0; 
	int	pcb_r1; 
	int	pcb_r2; 
	int	pcb_r3; 
	int	pcb_r4; 
	int	pcb_r5; 
	int	pcb_r6; 
	int	pcb_r7; 
	int	pcb_r8; 
	int	pcb_r9; 
	int	pcb_r10; 
	int	pcb_r11; 
	int	pcb_r12; 
#define	pcb_ap pcb_r12
	int	pcb_r13; 
#define	pcb_fp pcb_r13
	int	pcb_pc; 	/* program counter */
	int	pcb_psl; 	/* program status longword */
#endif	/* vax */
#ifdef	b370
	int	pcb_r0; 
	int	pcb_r1; 
	int	pcb_r2; 
	int	pcb_r3; 
	int	pcb_r4; 
	int	pcb_r5; 
	int	pcb_r6; 
	int	pcb_r7; 
	int	pcb_r8; 
	int	pcb_r9; 
#define	pcb_dbase pcb_r9
	int	pcb_r10; 
#define	pcb_ibase pcb_r10
	int	pcb_r11; 
#define	pcb_ap pcb_r11
	int	pcb_r12; 
#define	pcb_fp pcb_r12
	int	pcb_r13; 
#define	pcb_sp pcb_r13
#define	pcb_usp pcb_r13
	int	pcb_r14; 
#define	pcb_rtrn pcb_r14
	int	pcb_r15; 
#define	pcb_nargs pcb_r15
	double	pcb_fpr0;
	double	pcb_fpr2;
	double	pcb_fpr4;
	double	pcb_fpr6;
	int	pcb_psw[2]; 	/* program status word */
	int	pcb_cr1;	/* Control register 1 */
	int	pcb_spl[2];	/* Saved spl when switching */
#endif	/* b370 */
#ifdef	SOFT_VAX
	int	pcb_ast;	/* ast pending for this process */
#endif	/* SOFT_VAX */
#if	defined(vax) || defined(SOFT_VAX)
#ifdef	NOKMAP
	struct pte pcb_u[UPAGES];	/* ptes for private _u in phys mem */
#endif	/* NOKMAP */
	struct  pte *pcb_p0br; 	/* seg 0 base register */
	long	pcb_p0lr; 	/* seg 0 length register and astlevel */
	struct  pte *pcb_p1br; 	/* seg 1 base register */
	long	pcb_p1lr; 	/* seg 1 length register and pme */
#endif	/* defined(vax) || defined(SOFT_VAX) */

/*
 * Software pcb (extension)
 */
#ifdef	PAGING
	int	pcb_szpt; 	/* number of pages of user page table */
	int	pcb_cmap2;
#endif	/* PAGING */
	label_t	*pcb_sswap;
	int	pcb_sigc[5];	/* signal trampoline code must fit here */

#ifdef	PTINU
	struct	pte pcb_pt[NUPT];	/* user page table entries, does not
					*  include the entries for the user
					*  structure itself, which are instead
					*  stored in p_uptes
					*/
#endif	/* PTINU */
};

#ifdef	vax
#ifndef lint

#define	AST_NONE	0x04000000	/* ast level */
#define	AST_USER	0x03000000	/* ast for user mode */

#define	ASTLVL_NONE	4
#define	ASTLVL_USER	3

#define	AST_CLR		0x07000000

#else /* lint */
/* values which fit into  an int */

#define	AST_NONE	0x0400		/* ast level */
#define	AST_USER	0x0300		/* ast for user mode */

#define	ASTLVL_NONE	4
#define	ASTLVL_USER	3

#define	AST_CLR		0x0700

#endif /* lint */
#define	aston() \
	{ \
		u.u_pcb.pcb_p0lr = (u.u_pcb.pcb_p0lr &~ AST_CLR) | AST_USER; \
		mtpr(ASTLVL, ASTLVL_USER); \
	}

#define	astoff() \
	{ \
		u.u_pcb.pcb_p0lr = (u.u_pcb.pcb_p0lr &~ AST_CLR) | AST_NONE; \
		mtpr(ASTLVL, ASTLVL_NONE); \
	}
#endif	/* vax */


#ifdef	SOFT_VAX
#ifdef	lint
#define	AST_NONE	0x0400		/* ast level */
#define	AST_CLR		0x0700
#else	/* lint- */
#define	AST_NONE	0x04000000	/* ast level */
#define	AST_CLR		0x07000000
#endif	/* lint- */

#define	astpending()	(u.u_pcb.pcb_ast)
#define aston()		(u.u_pcb.pcb_ast++)
#define astoff()	(u.u_pcb.pcb_ast=0)
#endif	/* SOFT_VAX */


#endif /* _h_PCB */
ay be lkêVP ´  $        s  ‰*¨ ˆ*‰*     ÷$s  	                  ./usr/include/sys/pfpcontrol.h h{*	LICENSED MATERIALS - PROPERTY OF IBM				*}
{*	(c) Copyright 1990 IBM Corporation				*}
{*	All Rights Reserved						*}

{* SCCSID(@(#)pfpcontrol.h	1.3	AIX)	Modified 11/20/90 14:41:54				*}
{*  Define 80387 control word parts to be used with fpcontrol.s		*}
{*  routines fp_control(), fp_exmask(), fp_exunmask(),			*}
{*  fp_round(), fp_precision() and fp_restore().			*}

{* This group is to be used with:					*}
{* fp_control(), fp_exmask() and fp_exunmask()				*}

const
	FPM_INV_OP	= 1;
	FPM_DENORM	= 2;
	FPM_DIVIDE_0	= 4;
	FPM_OVERFLOW	= 8;
	FPM_UNDERFLOW	= 16;
	FPM_PRECISION	= 32;

{* This group is to be used with:					*}
{* fp_control() and fp_round()						*}

	FPR_NEAR	= 0;
	FPR_DOWN	= 1024;
	FPR_UP		= 2048; 
	FPR_CHOP	= 3072;

{* This group is to be used with:					*}
{* fp_control() and fp_precision()					*}

	FPP_SINGLE	= 0;
	FPP_DOUBLE	= 512;
	FPP_EXTENDED	= 768;

nt	pckêœë ·  ÿ¡             w‰*w‰*w‰*          	                  ./usr/include/sys/pmap_clnt.h  h../rpc/pmap_clnt.h map_ckê» µ  ÿ¡             w‰*w‰*w‰*          	                  ./usr/include/sys/pmap_prot.h  h../rpc/pmap_prot.h map_pkêèÕ 2  $        ¨@  J‰*‚™ˆ*J‰*     œ¨@  	              %t  ./usr/include/sys/proc.h ot.h  h/*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)proc.h	16.6.3.1	AIX)	/* Modified: 12:45:24 7/17/91 */

#ifndef	_h_PROC
#define	_h_PROC

#ifndef _h_PARAM
#include <sys/param.h>
#endif /* _h_PARAM */

#ifndef _h_RESOURCE
#include <sys/resource.h>
#endif /* _h_RESOURCE */

#ifndef _h_TIME
#include <sys/time.h>
#endif /* _h_TIME */

#ifdef b370
#ifdef KERNEL
#include <vector.h>
#else	/* !KERNEL */
#include <sys/b370/vector.h>
#endif	/* !KERNEL */
#endif /* b370 */

#if	defined(PTINU) && !defined(_h_PTE)
#include <sys/pte.h>
#endif	/* (PTINU && ~_h_PTE) */

#ifdef  FASTPS
/*	We save the first part of the executed command in the
 *	process table entry for a process.  This is used by the
 *	"ps" command.  The following symbol defines how much
 *	space to allocate in each proc table entry for this string.
 */

#define	P_CMNDSZ	40
#endif  /* FASTPS */

#if defined(i386) && !(defined(_h_USER)&&defined(_h_TSS386)&&defined(_h_MMU386))
#include <sys/i386/tss386.h>	/* needed for UPAGES */
#include <sys/i386/mmu386.h>
#include <sys/user.h>
#endif

#ifdef	SVPAGING
#ifndef _h_PAGE
#ifdef i386
#include <sys/i386/page.h>
#endif
#ifdef b370
#include <sys/b370/page.h>
#endif
#endif /* _h_PAGE */
#endif	/* SVPAGING */


/*
 * The following structure collects those data fields that need to
 * be transmitted to the foreign site in case of a 'netfork' or
 * 'netexec' call.  Heterogeneous exchangable structure.
 */
struct prc_dta
{
	PADOPEN(PSl)
	long	PNx_maxrss;		/* Copy of u.u_limit[MAXRSS]	*/
	ksigmask_t PNx_sigmask;		/* current signal mask */
	ksigmask_t PNx_sigignore;	/* mask of signals being ignored */
	ksigmask_t PNx_sigcatch;	/* mask of signals caught by user */
	ksigmask_t PNx_sigunsafe;    	/* old-style unsafe signal delivery */
	/* index into p_sig_arg[] for SIGMIGRATE argument */
#define	MIG_SIGARG	0
	/* number of different signals which need to be saved in p_sig_arg[] */
#define NUMSIGARG	1
	long	PNx_sig_arg[NUMSIGARG];	/* signal argument from kill3() */
	pid_t	PNx_pgrp;		/* Name of process group leader	*/
	pid_t	PNx_sesid;		/* Name of session leader */
	struct itimerval PNx_realitim;	/* real time timer */
	PADCLOSE(PSl, PSls, PSlu)
#define	PNX_maxrss	PSlu.PSls.PNx_maxrss
#define	PNX_sigmask	PSlu.PSls.PNx_sigmask
#define	PNX_sigignore	PSlu.PSls.PNx_sigignore
#define	PNX_sigcatch	PSlu.PSls.PNx_sigcatch
#define PNX_sigunsafe	PSlu.PSls.PNx_sigunsafe
#define	PNX_sig_arg	PSlu.PSls.PNx_sig_arg
#define	PNX_pgrp	PSlu.PSls.PNx_pgrp
#define PNX_sesid	PSlu.PSls.PNx_sesid
#define	PNX_realitim	PSlu.PSls.PNx_realitim
#define	NPRCLONGS	(sizeof(struct PSl) / sizeof(long))

	PADOPEN(PSt)
	short		PNX_Suid;	/* User id to direct tty sigs	*/
	short		PNX_Ssuid;	/* set (effective) user id	*/
	short		PNX_Ssgid;	/* set (effective) group id	*/
	PADCLOSE(PSt, PSs, PSu)
#define	PNX_uid		PSu.PSs.PNX_Suid
#define	PNX_suid	PSu.PSs.PNX_Ssuid
#define	PNX_sgid	PSu.PSs.PNX_Ssgid
#define NPRCSHORTS	(sizeof(struct PSt) / sizeof(short))

	PADOPEN(PCt)
	char		PNX_Cnice;	/* Nice for cpu usage		*/
	char		PNX_Cmigseq;	/* count of migrates/remote execs */
	PADCLOSE(PCt, PCs, PCu)
#define	PNX_nice	PCu.PCs.PNX_Cnice
#define	PNX_migseq	PCu.PCs.PNX_Cmigseq
};


/*
 * One "proc" structure allocated per active process.
 * It contains all data needed about the process while
 * the process may be swapped out.  Other per process
 * data (user.h) is swapped with the process.
 */
struct	proc
{
	struct	proc *p_link;	/* linked list of running processes */
#ifdef	BSD_SCHED
	struct	proc *p_rlink;
#endif	/* BSD_SCHED */
#if	defined(PAGING) || defined(SWAPPING)
	struct	proc *p_rlink;
	struct	pte *p_addr;	/* u-area kernel map address */
	struct	pte *p_p0br;	/* page table base P0BR */
#ifdef	PTINU
	struct pte p_uptes[UPAGES];	/* ptes for pages of u structure */
#endif	/* PTINU */
#ifdef	b370
	struct	pte370 *p_pt370; /* 370 pte base	 */
#endif	/* b370 */
#endif  /* (PAGING || SWAPPING) */
#ifdef	b370
	u_int	p_cr1;		/* CR1 contents to dispatch this process */
#ifdef SVPAGING
	ste_t	*p_st370;	/* Segment table base */
#else
	u_int *p_st370;
#endif  /* SVPAGING */
	u_long	p_vecflag;	/* process vector flags.  see vector.h
				   for definitions */
	struct  vec_facility *p_vecfac; /*pointer to VF descriptor for
				   cpu on which our state is actually
				   loaded and valid.  NULL if state is
				   not validly loaded anywhere. */
	struct  vec_save p_vecsave; /* saved vector state */
#endif	/* b370 */
#ifdef	FASTPS
	long	p_ttyd;		/* controlling tty for proc (used by ps) */
	siteno_t p_ttydsite;	/* controlling tty site for proc (used by ps) */
	time_t	p_start;	/* time the process started */
#endif	/* FASTPS		u_ttyd is #defined to be u_procp->p_ttyd.  */
	char	p_usrpri;	/* user-priority based on p_cpu and p_nice */
	char	p_pri;		/* priority, negative is high */
	signed char p_pri_2;	/* secondary priority, negative is high */
	char	p_cpu;		/* cpu usage for scheduling */
	char	p_stat;
	char	p_time;		/* resident time for scheduling */
	char	p_slptime;	/* time since last block */
	char	p_cursig;
	char	p_nmalloc;	/* number of netmsgs this process can send */
	ksigmask_t p_sig;	/* signals pending to this process */
	long	p_flag;
	struct  prc_dta p_nptx;	/* collection of data needed for netfork */
#define		p_nice		p_nptx.PNX_nice
#define		p_migseq	p_nptx.PNX_migseq
#define		p_uid		p_nptx.PNX_uid
#define		p_suid		p_nptx.PNX_suid
#define		p_sgid		p_nptx.PNX_sgid
#define		p_pgrp		p_nptx.PNX_pgrp
#define		p_sesid		p_nptx.PNX_sesid
#define		p_realIntervalTimer	p_nptx.PNX_realitim
#define		p_maxrss	p_nptx.PNX_maxrss
#define		p_sigmask	p_nptx.PNX_sigmask
#define		p_sigignore	p_nptx.PNX_sigignore
#define		p_sigcatch	p_nptx.PNX_sigcatch
#define		p_sigunsafe	p_nptx.PNX_sigunsafe
#define		p_sig_arg	p_nptx.PNX_sig_arg
	struct  netmsg *p_nmrq;	     /* addr of request buffer sent by child */
	struct pspair	*p_remkids;  /* head of remote pidsite list	*/
	pid_t	p_pid;		/* unique process id */
	pid_t	p_ppid;		/* process id of parent */
	struct	proc *p_pptr;	/* pointer to process structure of parent */
	/* pointer to next active process */
	struct  proc  * p_nxtactive;
#ifdef MERGE386
	char *p_vm86;		/* reserve space for now, the correct type
				 * declaration will be added later. */
#endif /* MERGE386 */
#if	defined(SYS5SHM) 
#if	defined(PAGING) || defined(SWAPPING)
/*
 * These fields are used by the PAGING/SWAPPING version 
 * of the shared memory code.  They are not used by
 * other versions (in particular the region or vseg version)
 */
	int	p_smbeg;	/* beginning pte entry for shared memory */
	int	p_smend;	/* ending pte entry for shared memory */
#endif	/* PAGING || SWAPPING */
#endif	/* SYS5SHM */
	short	p_idhash;	/* hashed based on p_pid for kill+exit+... */
	union
	{
		struct
		{
#if	defined(SWAPPING) || defined(PAGING)
			short	P_poip;		/* cnt of pageouts in progress*/
#define  p_poip		P_UN.P_ST.P_poip
			short	P_szpt;		/* copy of page table size */
#define  p_szpt		P_UN.P_ST.P_szpt
			size_t	P_tsize;	/* size of text (clicks) */
#define  p_tsize	P_UN.P_ST.P_tsize
			size_t	P_dsize;	/* size of data size (clicks) */
#define  p_dsize	P_UN.P_ST.P_dsize
			size_t	P_ssize;	/* copy of stack size (clicks)*/
#define  p_ssize	P_UN.P_ST.P_ssize
			int 	P_rssize; 	/* current resident set size */
						/* in clicks.		     */
#define  p_rssize	P_UN.P_ST.P_rssize
			size_t	P_swrss;	/* resident set size before */
						/* last swap.		    */
#define  p_swrss	P_UN.P_ST.P_swrss
			short	P_ndx;		/* proc index for memall for */
						/* vfork()		     */
#define  p_ndx		P_UN.P_ST.P_ndx
			swblk_t	P_swaddr;	/* disk address of u area    */
						/* when swapped 	     */
#define  p_swaddr	P_UN.P_ST.P_swaddr
#ifdef	b370
			short	P_szpt370;	/* Number of 370 pt allocated */
#define	p_szpt370	P_UN.P_ST.P_szpt370
			short	P_limpt370;	/* Address space for 370 pt */
#define	p_limpt370	P_UN.P_ST.P_limpt370
#endif	/* b370 */
#endif 	/* (PAGING || SWAPPING) */
#ifdef  FASTPS
			char P_cmnd[P_CMNDSZ];	/* Space for the text of the */
						/* command string. Used by   */
						/* ps.			     */
#define  p_cmnd		P_UN.P_ST.P_cmnd
			long	P_ttime;	/* Total time used */
#define	p_ttime		P_UN.P_ST.P_ttime
#endif	/* FASTPS */
			struct rlock *P_lockp;	/* chain for inode locks */
#define p_lockp		P_UN.P_ST.P_lockp
			caddr_t P_wchan;	/* event process is awaiting */
#define p_wchan		P_UN.P_ST.P_wchan
#ifndef	MM_VSEGS
			struct	text *P_textp;	/* pointer to text structure */
#define p_textp		P_UN.P_ST.P_textp
#endif	/* MM_VSEGS */
			struct callout *P_itimo;/* timeout for real timer */
#define	p_realIntTimeout P_UN.P_ST.P_itimo
			time_t	P_clktim;	/* time to alarm clock signal */
#define p_clktim	P_UN.P_ST.P_clktim
			struct callout *P_alrmp;/* ptr to /dev/alrm timeout */
#define	p_alrmp		P_UN.P_ST.P_alrmp
			long P_alrmt;		/* # of ticks for /dev/alrm */
						/* timeouts.		    */
#define	p_alrmt		P_UN.P_ST.P_alrmt
			short	P_cpticks;	/* ticks of cpu time */
#define  p_cpticks	P_UN.P_ST.P_cpticks

#ifndef  NOTEXTLINKS
			struct	proc *P_xlink;	/* linked list of processes */
						/* sharing the same text.   */
#define  p_xlink	P_UN.P_ST.P_xlink
#endif   /* NOTEXTLINKS */

			float_t	P_pctcpu;	/* %cpu for this process   */
						/* during p_time.          */
#define  p_pctcpu	P_UN.P_ST.P_pctcpu

#ifdef	b370
#ifdef	SVPAGING
			union {
			    dbd_t p_daddr[UPAGES];
					/* Disk Pointers of u on swap */
			    caddr_t	p_caddr;
					/* Virtual address of uarea in spt */
			} P_addr;
#define p_addr		P_UN.P_ST.P_addr
#endif	/* SVPAGING */
#endif	/* b370 */

#ifdef	i386
			u_short P_ublksz;	/* Size (in pages) of the   */
						/* ublock (the Kern stack + */
						/* U struct + ldt + the I/O */
						/* permission bit map.      */
#define  p_ublksz	P_UN.P_ST.P_ublksz
			union {
			    dbd_t pa_uswaddr[UPAGES];
						/* Disk Pointer of u on swap */
			    pte_t pa_uaddr[UPAGES + 1];
						/* Ptes which map the U blk */
						/* plus one for the pagedir */
			} P_addr;
#define p_uswaddr	P_UN.P_ST.P_addr.pa_uswaddr
#define p_uaddr		P_UN.P_ST.P_addr.pa_uaddr
#define p_pagedir	P_UN.P_ST.P_addr.pa_uaddr[UPAGES]
#endif  /* i386 */

#ifdef	MM_VSEGS
			struct procvseg *P_pvsp; /* ptr to process's pvsegs */
#define p_pvsp		P_UN.P_ST.P_pvsp
#endif	/* MM_VSEGS */

#ifdef	X286PROCS
			caddr_t P_286caddrs[1];	/* 286procs overlay area */
#define p_286caddrs	P_UN.P_ST.P_286caddrs
			ushort P_286shorts[3];	/* 286procs overlay area */
#define p_286shorts	P_UN.P_ST.P_286shorts
			char P_is286proc;	/* Is this a 286 proc? */
#define p_is286proc	P_UN.P_ST.P_is286proc
			char P_pad;		/* Available for use */
#endif  /* X286PROCS */
		}  P_ST;

		struct
		{
			short	P_xstat;	/* xstat of xproc */
#define	p_xstat	P_UN.P_XST.P_xstat
			struct  rusage  P_xru;	/* xp_ru of xproc */
#define	p_xru	P_UN.P_XST.P_xru
		}  P_XST;
	}  P_UN;
};

#define	PIDHASH(pid)		((int)(pid) & v.v_hpmask)
#define HASH(x)			(( (int) x >> 5) & (v.v_hsmask))


#ifdef  KERNEL
/*
 * setpri(): Set user priority.  The rescheduling flag (runrun)
 * is set if the priority is better than the currently running
 * process.  The first argument is a proc pointer and the second
 * is a scratch integer.
 */
extern long freemem;
extern long desfree;
#if	(defined(PAGING) || defined(SWAPPING))
#define _memnice(pp,reg) /* effectively, nice(4) */		\
{	if (pp->p_rssize > pp->p_maxrss && freemem < desfree)	reg += 2*4; }
#else	/* !(defined(PAGING) || defined(SWAPPING)) */
#define _memnice(pp,reg)
#endif	/* !(defined(PAGING) || defined(SWAPPING)) */

#define setpri(pp,reg)						\
{								\
	reg = ((pp->p_cpu & 0377) >> 1) + (pp->p_nice << 1)	\
	       - 2*NZERO + PUSER; 				\
	_memnice(pp, reg);					\
	if (reg > 127)						\
		reg = 127;					\
	pp->p_usrpri = reg;					\
}

extern  short	*pidhash;
extern  struct proc **slpque;
extern  struct proc  *proc;		/* Base of process table	*/
extern	char 	*rslpque;		/* Remote sleep queue		*/
extern	int	first_sp;		/* pid of first server proc	*/
extern	int	max_sp;			/* pid of last server proc	*/
extern	int	min_sp;			/* Min number of server procs	*/
extern	int	lowat_sp;		/* Server proc low water mark	*/
extern	int	hiwat_sp;		/* Server proc high water mark	*/

extern siteno_t	origsite();
extern siteno_t	sosite;			/* This partitions surrogate	*/
					/* origin site			*/

extern  pid_t	UpdPid;			/* Pid of updprop process	*/

extern	struct	proc *pfind();
extern	struct	proc *proc_checks();


#ifdef	BSD_SCHED
#define	NQS	32		/* 32 run queues */
#define QMASK	0xffffffffL	/* the bottom NQS bits of an int */
#define QRANGE	4		/* ((1+(maxpri=127)) + (NQS-1)) / NQS */
				/* maxpri/QRANGE must be < NQS */

struct	prochd {
	struct	proc *ph_link;	/* linked list of running processes */
	struct	proc *ph_rlink;
};
extern	struct prochd qs[NQS];
extern	long	whichqs;	/* bit mask summarizing non-empty qs's */
#endif	/* BSD_SCHED */

/* Pointer to the head of the process table free list */
extern  struct  proc  * proc_flist;

/* Pointer to the tail of a circular list of active processes */
/* New processes are inserted at the head of the list */
extern  struct  proc  * proc_active;
#endif  /* KERNEL */

#ifdef i386
#define IS386PROC(procp) ((procp)->p_is286proc == 0)
#define IS286PROC(procp) ((procp)->p_is286proc != 0)
#endif /* i386 */

/* stat codes */
#define	SSLEEP	1		/* awaiting an event */
#define	SWAIT	2		/* (abandoned state) */
#define	SRUN	3		/* running */
#define	SIDL	4		/* intermediate state in process creation */
#define	SZOMB	5		/* intermediate state in process termination */
#define	SSTOP	6		/* process being traced */
#define SXBRK	7		/* process waiting for free memory */

/* flag codes */
#define	SLOAD	0x00000001L	/* in core */
#define	SSYS	0x00000002L	/* swapper or pager process */
#define	SLOCK	0x00000004L	/* process being swapped out */
#define	SSWAP	0x00000008L	/* save area flag */
#define	STRC	0x00000010L	/* process is being traced */
#define	SWTED	0x00000020L	/* another tracing flag */
#define	SULOCK	0x00000040L	/* user settable lock in core */
#define	SKEEP	0x00000100L	/* another flag to prevent swap out */
#define	SWEXIT	0x00000400L	/* working on exiting */
#define	SPHYSIO	0x00000800L	/* doing physical i/o (bio.c) */
#define	STIMO	0x00040000L	/* timing out during sleep */
#define SCLDSTP 0x00080000L	/* wants to get signal upon child stop */
#define	SSVRWT	0x00100000L	/* svr proc waiting for exit to finish */
#define	SOWEUPC	0x00200000L	/* owe process an addupc() call at next ast */
#define SSPCL	0x00400000L	/* process is a special server process */
#define	SSEL	0x00800000L	/* selecting; wakeup/waiting danger */

#define SRMTFRK 0x01000000L	/* parent ready to page core to remote child */

#define SEXECED 0x02000000L	/* cleared in child when created by fork(),
				   set on exec() or run() */

#define	SRCDINPROG 0x04000000L	/* RCD operation in progress */
#define SCOMMIT	0x08000000L	/* open all files for periodic commit(NOT SUP)*/
#define SDEFERC	0x08000000L	/* open all files for deferred commit */
#define SDORUN	0x10000000L	/* child of a run() system call */
#define SPASC	0x20000000L	/* process is PASC executable */
 

#ifdef	XA370
#define	SXA31BITS 0x20000000L	/* This is a big one */
#endif	/* XA370 */

#define	SNCS	0x80000000L	/* user is using New Calling Sequence */

#if	defined(PAGING) || defined(SWAPPING)
#define	SPAGE	0x00000080L	/* process in page wait state */
#define	SDLYU	0x00000200L	/* delayed unlock of pages */
#define	SVFORK	0x00001000L	/* process resulted from vfork() */
#define	SVFDONE	0x00002000L	/* another vfork flag */
#define	SNOVM	0x00004000L	/* no vm, parent in a vfork() */
#define	SPAGI	0x00008000L	/* init data space on demand, from inode */
#define	SSEQL	0x00010000L	/* user warned of sequential vm behavior */
#define	SUANOM	0x00020000L	/* user warned of random vm behavior */
#endif  /* (PAGING || SWAPPING) */

#ifdef	MM_VSEGS
#define	SHBUFWT	0x00000080L	/* parent needs wakeup from newborn child */
#define	SSUSP	0x00000200L	/* proc is suspended as if it were swapped */
#define	SINDEL	0x00004000L	/* proc is on swapdev which is being deleted */
#endif	/* MM_VSEGS */

/*
   The following defines are the arguments understood by newproc().
*/
#define	NP_FORK		0		/* Plain old fork		*/
#define	NP_VFORK	1		/* Vfork			*/
#define	NP_SVRFORK	2		/* Fork a new svrproc		*/
#define NP_RUN		3		/* Same as vfork, but set the	*/
					/* child's p_flag&SDORUN bit	*/

#endif /* ~_h_PROC */
kêâ 1  $        Ž  J‰*‚™ˆ*J‰*     øvŽ  	                  ./usr/include/sys/prop.h ot.h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)prop.h	16.6	LCC)	/* Modified: 21:06:29 12/5/91 */

#ifndef _h_PROP
#define _h_PROP

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _h_TYPES */

struct plist
{
	gfs_t	pl_gfs;
	ino_t	pl_inum;
	long	pl_version;	/* version of file requested */
	short	pl_cmtbits;	/* compressed 10 incore commit bits   JB  */
	siteno_t pl_site;	/* site which sent the update message */
	struct  plist  * pl_forward;	/* queue forward pointer */
	struct  plist  * pl_backward;	/* queue backward pointer */
};

extern  struct  plist  * plist_flist;	/* head of free list */

/* The criterion for an entry in the list being empty is pl_gfs == 0 */

struct lbnlist
{			/* this structure template will */
	long	ll_totalblks;	/* enable direct reference to lbn */
	daddr_t	ll_lbn[BNPERBLK];	/* list buffer returned by SS  JB */
} ;

/*
 * These declarations are slightly inconsistent with common kernel
 * variable naming. This is to minimize changes from an earlier 
 * simplistic implimentation of the queue.  In addition to the naming
 * variations the queue has a tail component, for compatibility. The
 * tail component has a gfs and inode number of zero.  This also permits
 * plist to always contain a valid pointer.
 */
extern  struct  plist  * plist;	/* head of the queue */
extern  struct  plist  * proplist;	/* first element of plist pool */
extern  struct  plist  * plistNPLIST;	/* last element of plist pool */
extern  int  nplist;

/* flags for propopen returns */
#define PR_ONEOLD	0x1	/* local is one version out-of-date */
#define PR_ZERO		0x2	/* previous local version had zero length */
#define PR_NEWFILE	0x4	/* freshly created inode */
#define PR_NOSTORE	0x8	/* remote inode not stored */
#define PR_INODEONLY	0x10	/* inode only change */
#define PR_TXTBSY	0x20	/* can't overwrite file, text in use */
#define PR_SAVEOLD	0x40	/* inode re-used, save old incore until close */
#define PR_LOCKLINK	0x80	/* linked inode has been locked */
#define PR_OLDSTORE	0x100	/* inode stored before propagation */
#define PR_UPTODATE	0x200	/* inode already up to date */
#define PR_LOCALDOM	0x400	/* local copy of higher version */

/* error codes returned by spropin() system call */

#define PROP_ERROR	-1	/* error occured trying to propogate */
				/* the following error used internally only */
#define PROP_OPENERROR	-2	/* the local file could not be opened */
#define PROP_DONE	0	/* propogation successful */
#define PROP_NOTNEEDED  1	/* file already up to date */
#define PROP_NOFSTORE	2	/* file not propogated due to fstore */
#define PROP_LOCALDOM  	3	/* local file of greater version */

#endif /* ~_h_PROP */
lekê4½ °  $        N  _‰*B–ˆ*_‰*     ¼µN  
              Œ¶  ./usr/include/sys/protosw.h h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)protosw.h	16.3	LCC)	/* Modified: 19:24:26 9/15/89 */

/*
 * Copyright (c) 1982, 1986 Regents of the University of California.
 * All rights reserved.  The Berkeley software License Agreement
 * specifies the terms and conditions for redistribution.
 *
 *	@(#)protosw.h	7.1 (Berkeley) 6/4/86
 */

#ifndef _PROTOSW_
#define _PROTOSW_
/*
 * Protocol switch table.
 *
 * Each protocol has a handle initializing one of these structures,
 * which is used for protocol-protocol and system-protocol communication.
 *
 * A protocol is called through the pr_init entry before any other.
 * Thereafter it is called every 200ms through the pr_fasttimo entry and
 * every 500ms through the pr_slowtimo for timer based actions.
 * The system will call the pr_drain entry if it is low on space and
 * this should throw away any non-critical data.
 *
 * Protocols pass data between themselves as chains of mbufs using
 * the pr_input and pr_output hooks.  Pr_input passes data up (towards
 * UNIX) and pr_output passes it down (towards the imps); control
 * information passes up and down on pr_ctlinput and pr_ctloutput.
 * The protocol is responsible for the space occupied by any the
 * arguments to these entries and must dispose it.
 *
 * The userreq routine interfaces protocols to the system and is
 * described below.
 */
struct protosw {
	short	pr_type;		/* socket type used for */
	struct	domain *pr_domain;	/* domain protocol a member of */
	short	pr_protocol;		/* protocol number */
	short	pr_flags;		/* see below */
/* protocol-protocol hooks */
	int	(*pr_input)();		/* input to protocol (from below) */
	int	(*pr_output)();		/* output to protocol (from above) */
	int	(*pr_ctlinput)();	/* control input (from below) */
	int	(*pr_ctloutput)();	/* control output (from above) */
/* user-protocol hook */
	int	(*pr_usrreq)();		/* user request: see list below */
/* utility hooks */
	int	(*pr_init)();		/* initialization hook */
	int	(*pr_fasttimo)();	/* fast timeout (200ms) */
	int	(*pr_slowtimo)();	/* slow timeout (500ms) */
	int	(*pr_drain)();		/* flush any excess space possible */
};

#define	PR_SLOWHZ	2		/* 2 slow timeouts per second */
#define	PR_FASTHZ	5		/* 5 fast timeouts per second */

/*
 * Values for pr_flags
 */
#define	PR_ATOMIC	0x01		/* exchange atomic messages only */
#define	PR_ADDR		0x02		/* addresses given with messages */
/* in the current implementation, PR_ADDR needs PR_ATOMIC to work */
#define	PR_CONNREQUIRED	0x04		/* connection required by protocol */
#define	PR_WANTRCVD	0x08		/* want PRU_RCVD calls */
#define	PR_RIGHTS	0x10		/* passes capabilities */

/*
 * The arguments to usrreq are:
 *	(*protosw[].pr_usrreq)(up, req, m, nam, opt);
 * where up is a (struct socket *), req is one of these requests,
 * m is a optional mbuf chain containing a message,
 * nam is an optional mbuf chain containing an address,
 * and opt is a pointer to a socketopt structure or nil.
 * The protocol is responsible for disposal of the mbuf chain m,
 * the caller is responsible for any space held by nam and opt.
 * A non-zero return from usrreq gives an
 * UNIX error number which should be passed to higher level software.
 */
#define	PRU_ATTACH		0	/* attach protocol to up */
#define	PRU_DETACH		1	/* detach protocol from up */
#define	PRU_BIND		2	/* bind socket to address */
#define	PRU_LISTEN		3	/* listen for connection */
#define	PRU_CONNECT		4	/* establish connection to peer */
#define	PRU_ACCEPT		5	/* accept connection from peer */
#define	PRU_DISCONNECT		6	/* disconnect from peer */
#define	PRU_SHUTDOWN		7	/* won't send any more data */
#define	PRU_RCVD		8	/* have taken data; more room now */
#define	PRU_SEND		9	/* send this data */
#define	PRU_ABORT		10	/* abort (fast DISCONNECT, DETATCH) */
#define	PRU_CONTROL		11	/* control operations on protocol */
#define	PRU_SENSE		12	/* return status into m */
#define	PRU_RCVOOB		13	/* retrieve out of band data */
#define	PRU_SENDOOB		14	/* send out of band data */
#define	PRU_SOCKADDR		15	/* fetch socket's address */
#define	PRU_PEERADDR		16	/* fetch peer's address */
#define	PRU_CONNECT2		17	/* connect two sockets */
/* begin for protocols internal use */
#define	PRU_FASTTIMO		18	/* 200ms timeout */
#define	PRU_SLOWTIMO		19	/* 500ms timeout */
#define	PRU_PROTORCV		20	/* receive from below */
#define	PRU_PROTOSEND		21	/* send to below */

#define	PRU_NREQ		21

#ifdef PRUREQUESTS
char *prurequests[] = {
	"ATTACH",	"DETACH",	"BIND",		"LISTEN",
	"CONNECT",	"ACCEPT",	"DISCONNECT",	"SHUTDOWN",
	"RCVD",		"SEND",		"ABORT",	"CONTROL",
	"SENSE",	"RCVOOB",	"SENDOOB",	"SOCKADDR",
	"PEERADDR",	"CONNECT2",	"FASTTIMO",	"SLOWTIMO",
	"PROTORCV",	"PROTOSEND",
};
#endif

/*
 * The arguments to the ctlinput routine are
 *	(*protosw[].pr_ctlinput)(cmd, arg);
 * where cmd is one of the commands below, and arg is
 * an optional argument (caddr_t).
 *
 * N.B. The IMP code, in particular, pressumes the values
 *      of some of the commands; change with extreme care.
 * TODO:
 *	spread out codes so new ICMP codes can be
 *	accomodated more easily
 */
#define	PRC_IFDOWN		0	/* interface transition */
#define	PRC_ROUTEDEAD		1	/* select new route if possible */
#define	PRC_IFNEWADDR		2	/* interface address changed or added */
#define	PRC_IFUP		3	/* interface transition */
#define	PRC_QUENCH		4	/* some said to slow down */
#define	PRC_MSGSIZE		5	/* message size forced drop */
#define	PRC_HOSTDEAD		6	/* normally from IMP */
#define	PRC_HOSTUNREACH		7	/* ditto */
#define	PRC_UNREACH_NET		8	/* no route to network */
#define	PRC_UNREACH_HOST	9	/* no route to host */
#define	PRC_UNREACH_PROTOCOL	10	/* dst says bad protocol */
#define	PRC_UNREACH_PORT	11	/* bad port # */
#define	PRC_UNREACH_NEEDFRAG	12	/* IP_DF caused drop */
#define	PRC_UNREACH_SRCFAIL	13	/* source route failed */
#define	PRC_REDIRECT_NET	14	/* net routing redirect */
#define	PRC_REDIRECT_HOST	15	/* host routing redirect */
#define	PRC_REDIRECT_TOSNET	16	/* redirect for type of service & net */
#define	PRC_REDIRECT_TOSHOST	17	/* redirect for tos & host */
#define	PRC_TIMXCEED_INTRANS	18	/* packet lifetime expired in transit */
#define	PRC_TIMXCEED_REASS	19	/* lifetime expired on reass q */
#define	PRC_PARAMPROB		20	/* header incorrect */

#define	PRC_NCMDS		21

#ifdef PRCREQUESTS
char	*prcrequests[] = {
	"IFDOWN", "ROUTEDEAD", "IFNEWADDR", "IFUP",
	"QUENCH", "MSGSIZE", "HOSTDEAD", "HOSTUNREACH",
	"NET-UNREACH", "HOST-UNREACH", "PROTO-UNREACH", "PORT-UNREACH",
	"FRAG-UNREACH", "SRCFAIL-UNREACH", "NET-REDIRECT", "HOST-REDIRECT",
	"TOSNET-REDIRECT", "TOSHOST-REDIRECT", "TX-INTRANS", "TX-REASS",
	"PARAMPROB"
};
#endif

/*
 * The arguments to ctloutput are:
 *	(*protosw[].pr_ctloutput)(req, so, level, optname, optval);
 * req is one of the actions listed below, so is a (struct socket *),
 * level is an indication of which protocol layer the option is intended.
 * optname is a protocol dependent socket option request,
 * optval is a pointer to a mbuf-chain pointer, for value-return results.
 * The protocol is responsible for disposal of the mbuf chain *optval
 * if supplied,
 * the caller is responsible for any space held by *optval, when returned.
 * A non-zero return from usrreq gives an
 * UNIX error number which should be passed to higher level software.
 */
#define	PRCO_GETOPT	0
#define	PRCO_SETOPT	1

#define	PRCO_NCMDS	2

#ifdef PRCOREQUESTS
char	*prcorequests[] = {
	"GETOPT", "SETOPT",
};
#endif

#ifdef KERNEL
extern	struct protosw *pffindproto(), *pffindtype();
#endif
#endif  /* _PROTOSW_ */
 ckêXÊ 0  $        º  J‰*‚™ˆ*J‰*     ¯_º  	              Ž  ./usr/include/sys/psl.h /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)psl.h	16.3	LCC)	/* Modified: 18:48:33 9/16/89 */

#ifndef  _h_PSL
#define  _h_PSL

#ifdef	vax
/*
 * VAX program status longword
 */

#define	PSL_C		0x00000001	/* carry bit */
#define	PSL_V		0x00000002	/* overflow bit */
#define	PSL_Z		0x00000004	/* zero bit */
#define	PSL_N		0x00000008	/* negative bit */
#define	PSL_ALLCC	0x0000000f	/* all cc bits - unlikely */
#define	PSL_T		0x00000010	/* trace enable bit */
#define	PSL_IV		0x00000020	/* integer overflow enable bit */
#define	PSL_FU		0x00000040	/* floating point underflow enable */
#define	PSL_DV		0x00000080	/* decimal overflow enable bit */
#ifndef lint
#define	PSL_IPL		0x001f0000	/* interrupt priority level */
#define	PSL_PRVMOD	0x00c00000	/* previous mode (all on is user) */
#define	PSL_CURMOD	0x03000000	/* current mode (all on is user) */
#define	PSL_IS		0x04000000	/* interrupt stack */
#define	PSL_FPD		0x08000000	/* first part done */
#define	PSL_TP		0x40000000	/* trace pending */
#define	PSL_CM		0x80000000	/* compatibility mode */

#define	PSL_MBZ		0x3020ff00	/* must be zero bits */
#else /* lint */
/* lint thinks that the above longword constants are long,
 * which they are!
 */
#define	PSL_IPL		0x001f	/* interrupt priority level */
#define	PSL_PRVMOD	0x00c0	/* previous mode (all on is user) */
#define	PSL_CURMOD	0x0300	/* current mode (all on is user) */
#define	PSL_IS		0x0400	/* interrupt stack */
#define	PSL_FPD		0x0800	/* first part done */
#define	PSL_TP		0x4000	/* trace pending */
#define	PSL_CM		0x8000	/* compatibility mode */

#define	PSL_MBZ		0x3020	/* must be zero bits */
#endif /* lint */


#define	PSL_USERSET	(PSL_PRVMOD|PSL_CURMOD)
#define	PSL_USERCLR	(PSL_IS|PSL_IPL|PSL_MBZ)
#endif	/* vax */


#if	defined (M68000)
	/*
 	* Motorola 68000 program status word (long on the stack)
 	*/

#	define	PSL_C		0x00000001	/* carry bit */
#	define	PSL_V		0x00000002	/* overflow bit */
#	define	PSL_Z		0x00000004	/* zero bit */
#	define	PSL_N		0x00000008	/* negative bit */
#	define	PSL_X		0x00000010	/* extend bit */
#	define	PSL_ALLCC	0x0000001f	/* all cc bits - unlikely */
#	define	PSL_T		0x00008000	/* trace enable bit */
#	define	PSL_IPL		0x00000700	/* interrupt priority level */
#	define	PSL_CURMOD	0x00002000	/* current mode (on is super) */

#	define	PSL_MBZ		0xffff58e0	/* must be zero bits */

#	define	PSL_USERSET	(0)
#	define	PSL_USERCLR	(PSL_CURMOD|PSL_IPL|PSL_MBZ)
#endif	/* defined (M68000) */

#if	defined (__UNDEF__) || defined (i386)
/*
 * Intel iAPX286 program status word (flags)
 */

#define PSL_C	0x0001		/* 'Carry' bit */
#define PSL_P	0x0004		/* 'Parity' bit */
#define PSL_A	0x0010		/* 'Auxiliary Carry' bit */
#define PSL_Z	0x0040		/* 'Zero' bit */
#define PSL_S	0x0080		/* 'Sign' bit */
#define PSL_T	0x0100		/* 'Trace' bit */
#define PSL_I	0x0200		/* 'Interrupt enable' bit */
#define PSL_D	0x0400		/* 'Direction' flag */
#define PSL_O	0x0800		/* 'Overflow' bit */
#define PSL_IOPL 0x3000		/* 'Interrupt Priority level' */
#define PSL_NT  0x4000		/* 'Nested Task Flag' bit  */

#define PSL_MBZ	(PSL_IOPL)

#define	PSL_USERSET	(PSL_I)
#define	PSL_USERCLR	(PSL_MBZ)

#ifdef i386
#define PSL_RF	0x10000		/* Debug fault enable */
#define PSL_VM	0x20000		/* Virtual 8086 process mode */
#endif

#endif	/* defined (__UNDEF__) || defined(i386) */

#ifdef	RESSUP /* Start of code from IX/370 */
/*	The following is the format of the IBM/370 processor status
 *	word (psw) used by the TSS resident supervisor (RESSUP).
 */

typedef struct psw {
	int	ps_npriv   :  1 ;	/* Non-privileged bit.	*/
	int		   :  1 ;	/* Not used.		*/
	int	ps_pagint  :  1 ;	/* Paging interrupt	*/
					/* mask bit.		*/
	int	ps_apgrmsk :  1 ;	/* Asynchronous program	*/
					/* interrupt mask bit.	*/
	int	ps_extmsk  :  1 ;	/* External interrupt	*/
					/* mask bit.		*/
	int	ps_asynmsk :  1 ;	/* Asynchronous		*/
					/* interrupt mask bit.	*/
	int	ps_tmrmsk  :  1 ;	/* Timer interrupt	*/
					/* mask bit.		*/
	int	ps_iomsk   :  1 ;	/* I/O interrupt mask	*/
					/* bit.			*/
	int	ps_ilc	   :  2 ;	/* Instruction length	*/
					/* code.		*/
	int	ps_cc	   :  2 ;	/* Condition code.	*/
	int	ps_fpomsk  :  1 ;	/* Floating point	*/
					/* overflow mask.	*/
	int	ps_decomsk :  1 ;	/* Decimal overflow	*/
					/* mask.		*/
	int	ps_expumsk :  1 ;	/* Exponent underflow	*/
					/* mask.		*/
	int	ps_sigmsk  :  1 ;	/* Significance		*/
					/* exception mask.	*/
	int	ps_icode   : 16 ;	/* Interrupt code.	*/
	caddr_t	ps_iadr		;	/* Interrupt address.	*/
} psw_t;

/*	The following alternate definition of the psw format is
 *	sometimes useful for referencing the mask fields.
 */

typedef struct pswf {
	int	ps_npriv   :  1 ;	/* Non-privileged bit.	*/
	int	ps_tskmsk  :  7 ;	/* Task mask.		*/
	int	ps_ilc	   :  2 ;	/* Instruction length	*/
					/* code.		*/
	int	ps_cc	   :  2 ;	/* Condition code.	*/
	int	ps_prgmsk  :  4 ;	/* Program mask.	*/
	int	ps_icode   : 16 ;	/* Interrupt code.	*/
	caddr_t	ps_iadr		;	/* Interrupt address.	*/
} pswf_t;

/* End of code from IX/370 */

/*	The following simplified definition is used for speed in trap.c */

struct wordpsw {
	long psw_word1;
	caddr_t psw_iadr;
};

/* fields in psw_word1 */
#define PSW_npriv	0x80000000L	/* mask for non-privileged bit */
		/* no shift--used only as a boolean */
#define PSW_intmask	0x0f000000	/* mask for external, timer, i/o */
		/* no shift--used only as a boolean */
#define PSW_ilc		0x00c00000L	/* mask for instruction length code */
#define ilc_SH		22		/* amount to shift ilc */
#define PSW_cc		0x00300000L	/* mask for condition code */
#define cc_SH		20		/* amount to shift cc */
#define PSW_pmask	0x00040000	/* mask for program mask */
#define pmask_SH	16		/* amount to shift program mask */
#define PSW_icode	0x0000ffffL	/* mask for interrupt code */
		/* no shift--it's already in bit 31 */

#endif  /* RESSUP */
#endif  /* ~_h_PSL */
f	defikêò /  $          J‰*T–ˆ*J‰*     Ž  	              ·  ./usr/include/sys/pte.h /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)pte.h	16.3	LCC)	/* Modified: 20:03:13 9/15/89 */
#ifndef	_h_PTE

#define	_h_PTE	/* just so we don't let ourself get included more than once */

#if	(defined(vax) || defined(SOFT_VAX))

/*
 * VAX page table entry
 *
 * There are two major kinds of pte's: those which have ever existed (and are
 * thus either now in core or on the swap device), and those which have
 * never existed, but which will be filled on demand at first reference.
 * There is a structure describing each.  There is also an ancillary
 * structure used in page clustering.
 */

#ifndef LOCORE
#ifdef	BITSHI
struct pte
{
#ifdef	M_XENIX
	unsigned long
#else	/* !M_XENIX */
	unsigned int
#endif	/* M_XENIX! */
		pg_v:1,			/* valid bit */
		pg_prot:4,		/* access control */
		pg_m:1,			/* hardware maintained modified bit */
		pg_fod:1,		/* is fill on demand (=0) */
		pg_swapm:1,		/* have to write back to swap */
		pg_vreadm:1,		/* modified since vread (or with _m) */
		:2,
		pg_pfnum:21;		/* core page frame number or 0 */
};
struct hpte
{
	unsigned int
		pg_high:9,		/* special for clustering */
		:2,
		pg_pfnum:21;
};
struct fpte
{
	unsigned int
		pg_v:1,
		pg_prot:4,
		:1,
		pg_fod:1,		/* is fill on demand (=1) */
		pg_fileno:5,		/* file mapped from or TEXT or ZERO */
		pg_blkno:20;		/* file system block number */
};
#else	/* BITSHI- */
struct pte
{
unsigned int	pg_pfnum:21,		/* core page frame number or 0 */
		:2,
		pg_vreadm:1,		/* modified since vread (or with _m) */
		pg_swapm:1,		/* have to write back to swap */
		pg_fod:1,		/* is fill on demand (=0) */
		pg_m:1,			/* hardware maintained modified bit */
		pg_prot:4,		/* access control */
		pg_v:1;			/* valid bit */
};
struct hpte
{
unsigned int	pg_pfnum:21,
		:2,
		pg_high:9;		/* special for clustering */
};
struct fpte
{
unsigned int	pg_blkno:20,		/* file system block number */
		pg_fileno:5,		/* file mapped from or TEXT or ZERO */
		pg_fod:1,		/* is fill on demand (=1) */
		:1,
		pg_prot:4,
		pg_v:1;
};
#endif	/* BITSHI- */
#endif	/* LOCORE- */

#define	PG_PUR		0xc	/* least value in pg_prot allowing user read */
#define	PG_PUW		0x4	/* only value in pg_prot allowing user write */
#define	PG_V		0x80000000
#define	PG_PROT		0x78000000
#define	PG_M		0x04000000
#define	PG_FOD		0x02000000
#define PG_SWAPM	0x01000000 /* gmo do we need this? */
#define	PG_VREADM	0x00800000
#define	PG_PFNUM	0x001fffff

#define	PG_FZERO	20	/* was NOFILE */
#define	PG_FTEXT	21	/* was (NOFILE+1) */
#define	PG_FMAX		(PG_FTEXT)

#define	PG_NOACC	0
#define	PG_KW		0x10000000
#define	PG_KR		0x18000000
#define	PG_UW		0x20000000
#define	PG_URKW		0x70000000
#define	PG_URKR		0x78000000

/*
 * Pte related macros
 */

#ifdef	vax
#define	dirty(pte)	((pte)->pg_fod == 0 && (pte)->pg_pfnum && \
			    ((pte)->pg_m || (pte)->pg_swapm))
#endif	/* vax */

#ifdef	b370
/* Storage keys bits: */

#define	SK_ACC		0xf0		/* Access Control bits	*/
#define	SK_F		0x08		/* Fetch Protection bit */
#define	SK_R		0x04		/* Reference bit	*/
#define	SK_C		0x02		/* Change bit		*/

#define	referenced(pte)	(isk(ctob((pte)->pg_pfnum)) & SK_R)
#define	changed(pte)	(isk(ctob((pte)->pg_pfnum)) & SK_C)
#define	dirty(pte)	((pte)->pg_fod == 0 && (pte)->pg_pfnum && \
			    ((pte)->pg_m || (pte)->pg_swapm || changed(pte)))
#endif	/* b370 */

#ifndef LOCORE
#ifdef KERNEL
extern	struct	pte *vtopte();

/* utilities defined in locore.s */
extern	struct pte Sysmap[];
extern	struct pte Usrptmap[];
extern	struct pte usrpt[];
extern	struct pte Swapmap[];
extern	struct pte Forkmap[];
extern	struct pte Xswapmap[];
extern	struct pte Xswap2map[];
extern	struct pte Pushmap[];
extern	struct pte Vfmap[];
extern	struct pte mmap[];
extern	struct pte msgbufmap[]; /* gmo do we need this ? */
extern	struct pte camap[];
extern	struct pte Nexmap[][16];
#endif	/* KERNEL- */
#endif	/* LOCORE- */
#endif	/* (defined(vax) || defined(SOFT_VAX)) */

#if	defined(b370) && !defined(SVPAGING)

#ifdef	S370
struct	pte370	{
	unsigned short	pg3_pfnum:12,
			pg3_v:1,
			:3;
};
#define	PTETYPE		unsigned short
#define	LOG2PTESZ	1

#define	FRSHIFT	8
#define	FRDIV	256
#define	FRINCR	NBPG/FRDIV

#define	ctofr(click)	((click) << 4)
#define	frtoc(frame)	((frame) >> 4)
#define	btofr(addr)	((addr) >> FRSHIFT)
#define	frtob(frame)	((frame) << FRSHIFT)

#define	SEGT	0xf0000000

#define	INVPAGE	0x0008

#endif	/* S370 */

#ifdef	XA370
struct	pte370	{
	unsigned int	:1,
		 	pg3_pfnum:19,
			:1,
			pg3_v:1,
			:10;
};
#define	PTETYPE		unsigned int
#define	LOG2PTESZ	2

#define	FRSHIFT		0
#define	FRDIV		1
#define	FRINCR		NBPG/FRDIV

#define	ctofr(click)	((click) << 12)
#define	frtoc(frame)	((frame) >> 12)
#define	btofr(addr)	((addr) >> FRSHIFT)
#define	frtob(frame)	((frame) << FRSHIFT)

#define	SEGT		0x0000000f
#define	INVPAGE		0x00000400
#define	INVSEG		0x00000020

#endif	/* XA370 */

#define	STETYPE		int
#define	STELEN		sizeof (STETYPE)
#define	LOG2STESZ	2
	/* Shift to find a ST index */
#define	LOG2STI		(LOG2BPS)
	/*  .. and a ST pointer for an entry */
#define	LOG2STB		(LOG2BPS-LOG2STESZ)

#define	PTE370LEN	sizeof (PTETYPE)
#define PTSLEN		(NPPS*PTE370LEN)
#define	LOG2PTSSZ	(LOG2PPS+LOG2PTESZ)
#define	PTS370PG	(NBPG >> LOG2PTSSZ)
#define LOG2PTSPG	(LOG2BPP - LOG2PTSSZ)

#define	SYSKEY		0xf8
#define USRKEY		0xe0
#define TEXTKEY		0xe8

#ifdef	KERNEL
/*
 * 370 memory management tables defined in LOCORE.s
 */

/* Kernel address space page tables */

extern struct  pte370 *spt;

/* VAX pte's for 370 usrpt's */

extern	struct pte Upt370map[];

/* 370 usrpt's */

extern struct  pte370 upt370[];

/* 370 maps for */

extern	struct pte370 *copym370;
extern	struct pte370 *mm370;

#endif	/* KERNEL */
#endif	/* b370 && !SVPAGING */
#endif	/* ~_h_PTE */
*/kêvÔ .  $          K‰*šˆ*K‰*     —·  	                  ./usr/include/sys/ptmp.h .h h  hH_SCCSID(@(#)ptmp.h	1.2	AIX)	/* Modified: 18:15:04 8/24/89 */
/* @(#)ptmp.h	7.1 - 87/06/15 - 18:45:37 */
/*
 *	per process temporary data
 */

/* This is original "aix 2.2.1" source code */

struct ptmp {
	u_short	pt_uid;			/* userid */
	char	pt_name[8];		/* login name */
	long	pt_cpu[2];		/* CPU (sys+usr) P/NP time tics */
	long    pt_io;                  /* chars transferred P/NP */
	long    pt_rw;                  /* blocks read/written P/NP */
	unsigned pt_mem;		/* avg. memory size (64byte clicks) */
};	
ned inkêÔW -  $        £  K‰*†™ˆ*K‰*     á£  	              Ø  ./usr/include/sys/ptrace.h  h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)ptrace.h	16.12	LCC)	/* Modified: 13:19:53 7/21/90 */
/* SCCSIDPUFF(@(#) ptrace.h 4.1 LM 12:55:48 4/23/85 C 22:13:08 4/23/85); */

#ifndef _h_PTRACE
#define _h_PTRACE

#include <sys/types.h>

/*	The structure used for communication between ptrace/procxmt
 *	(for process tracing). See sig.c
 */

struct ptrace {
	pid_t		ip_lock;	/* process request intended for. */
	int		ip_req ;	/* The request code for	*/
					/* the ptrace request -	*/
					/* see below.		*/
	caddr_t		ip_addr ;	/* Address to be read	*/
					/* or modified.		*/
	union {
		int	ui_data;	/* Value to be read or written */
#ifdef _I386
		char	ui_float[10];	/* 387 floating pt. value. */
#endif /* _I386 */
	} ip_u;
	struct buf *ip_bp;	/* Buffer containing larger data */
#define	ip_data		ip_u.ui_data
#define	ip_float	ip_u.ui_float
};

/*	The possible value for ip_req are as follows.
 */

#define	PT_ETR		 0	/* Enable tracing of the	*/
				/* process.			*/
#define	PT_RT		 1	/* Read the text word at the	*/
				/* address ip_addr.		*/
#define	PT_RD		 2	/* Read the data word at the	*/
				/* address ip_addr.		*/
#define	PT_RU		 3	/* Read the word of the u-block	*/
				/* at relative address ip_addr.	*/
				/* This address is relative to	*/
				/* the start of the u-block.	*/
#define	PT_WT		 4	/* Write the word ip_data at	*/
				/* the text address ip_addr.	*/
#define	PT_WD		 5	/* Write the word ip_data at	*/
				/* the data address ip_addr.	*/
#define	PT_WU		 6	/* Write the word ip_data	*/
				/* into the u-block at relative	*/
				/* address ip_addr.		*/
#define	PT_CT		 7	/* Continue execution at	*/
				/* location ip_addr or at the	*/
				/* interrupt address if ip_addr	*/
				/* is 1.  Give signal number	*/
				/* ip_data to the process if	*/
				/* this value is not zero.	*/
#define	PT_EX		 8	/* Force the process to exit	*/
				/* with the lowest pending	*/
				/* signal number as the exit	*/
				/* code.			*/
#define	PT_CTX		 9	/* This is the same as PT_CT	*/
				/* except that, in addition, a	*/
				/* trace trap will be given to	*/
				/* the process after each	*/
				/* instruction execution.	*/
#define	PT_RR		11	/* Read the register number	*/
				/* given by ip_addr.  The	*/
				/* mnemonics for addressing the	*/
				/* various registers are given	*/
				/* below for the 370.		*/
#define PT_RFPR		12	/* Read the floating point reg	*/
				/* given by ip_addr.		*/
				/* Note that 370 fp registers   */
				/* are accessed through PT_RR   */
#define	PT_WR		14	/* Write the word ip_data into	*/
				/* register ip_addr.		*/
#define	PT_WFPR		15	/* Write the word ip_data into	*/
				/* floating point reg ip_addr.	*/
				/* Note that 370 fp registers   */
				/* are accessed through PT_RR   */
#define PT_BLKRD	17	/* read in bytes of data	*/
#define PT_BLKWRT	19	/* read out bytes of data	*/

	/*	Vector facility extensions to ptrace  	*/

#define PT_VSSRD	20	/* read in vector segment size  */
#define PT_VSRD		21	/* Read in vector status reg.   */
				/* and store into location 	*/
				/* pointed by ip_addr		*/
#define PT_VSWRT	22	/* Write value given by ip_addr */
				/* into vector status register  */
#define PT_VMRD		23	/* Read vector mask reg. into   */
				/* location pointed to by param.*/
				/* ip_addr			*/
#define PT_VMWRT	24	/* Write the vector mask reg.   */  
				/* with the value at location   */
				/* pointed to by ip_addr	*/
#define PT_VACRD	25      /* Read the vector activity reg.*/
				/* and store the value into loc.*/
				/* pointed to by ip_addr	*/
#define PT_VACWRT	26      /* Write the value at location  */
				/* pointed to by ip_addr into   */
				/* the vector activity register */
#define PT_VRRD		27	/* Read the vector register	*/
				/* specified by ip_addr into the*/
				/* ui_bp		        */ 
#define PT_VRWRT	28 	/* Write the vector register num*/
				/* given in ip_addr from ui_bp  */
#define PT_VRDRD        29	/* Read the vector register pair*/
				/* specified by ip_addr into the*/
				/* ui_bp		        */ 
#define PT_VRDWRT	30 	/* Write the vector register pair*/
				/* given in ip_addr from ui_bp  */


	/* BSD 4.3 names for ip_req values */
#define PT_TRACE_ME	0	/* child declares it's being traced */
#define PT_READ_I	1	/* read word in child's I space */
#define PT_READ_D	2	/* read word in child's D space */
#define PT_READ_U	3	/* read word in child's user structure */
#define PT_WRITE_I	4	/* write word in child's I space */
#define PT_WRITE_D	5	/* write word in child's D space */
#define PT_WRITE_U	6	/* write word in child's user structure */
#define PT_CONTINUE	7	/* continue the child */
#define PT_KILL		8	/* kill the child process */
#define PT_STEP		9	/* single step the child */
#define PT_READ_GPR	11	/* read general purpose registers */
#define PT_READ_FPR	12	/* read floating point registers */
				/* Note that 370 fp registers    */
				/* are accessed through PT_RR    */
#define PT_WRITE_GPR	14	/* write to general purpose registers */
#define PT_WRITE_FPR	15	/* write to floating point registers */
				/* Note that 370 fp registers    */
				/* are accessed through PT_RR    */
#define PT_READ_BLOCK	17	/* read blk of data from child's addr space*/
#define PT_WRITE_BLOCK	19	/* write blk of data from child's addr space*/
#define PT_READ_VSEG_SIZ 20	/* read in vector segment size  */
#define PT_READ_VSR	21	/* Read in vector status reg.   */
#define PT_WRITE_VSR	22	/* Write into vector status reg.  */
#define PT_READ_VMR	23	/* Read vector mask reg.   */
#define PT_WRITE_VMR	24	/* Write to vector mask reg.    */
#define PT_READ_VACR	25      /* Read the vector activity reg.*/
#define PT_WRITE_VACR	26      /* Write into the vector activity reg.*/
#define PT_READ_VFR	27	/* Read the vector floating point register*/
#define PT_WRITE_VFR	28	/* Write into the vector floating point reg.*/
#define PT_READ_VDR	29	/* Read the vector double register	*/
#define PT_WRITE_VDR	30	/* write into the vector double register*/

#ifdef _U370
/*	The following mnemonics are used to represent the registers
 *	for ptrace calls PT_RR and PT_WR.  They appear in the ip_data
 *	field of the ptrc buffer.
 */
#ifndef _KERNEL
/* used by debuggers */
#define	PT_R_R0		0
#define	PT_R_R1		1
#define	PT_R_R2		2
#define	PT_R_R3		3
#define	PT_R_R4		4
#define	PT_R_R5		5
#define	PT_R_R6		6
#define	PT_R_R7		7
#define	PT_R_R8		8
#define	PT_R_R9		9
#define	PT_R_R10	10
#define	PT_R_R11	11
#define	PT_R_R12	12
#define	PT_R_R13	13
#define	PT_R_R14	14
#define	PT_R_R15	15
#define	PT_R_FP0	16
#define	PT_R_FP1	17
#define	PT_R_FP2	18
#define	PT_R_FP3	19
#define	PT_R_FP4	20
#define	PT_R_FP5	21
#define	PT_R_FP6	22
#define	PT_R_FP7	23
#endif /* ~_KERNEL */

#define	PT_R_PS1	24	/* Left half of PSW.		*/
#define	PT_R_PS2	25	/* Right half of PWS.		*/

#define	PT_R_NBR	26	/* The number of registers in	*/
				/* the above list.		*/

/* Vector register numbers	*/

#define	PT_R_VR0	30   /* vector data registers 0-15 */
#define PT_R_VR1	31
#define PT_R_VR2	32
#define PT_R_VR3	33
#define PT_R_VR4	34
#define PT_R_VR5	35
#define PT_R_VR6	36
#define PT_R_VR7	37
#define PT_R_VR8	38
#define PT_R_VR9	39
#define PT_R_VR10	40
#define PT_R_VR11	41
#define PT_R_VR12	42
#define PT_R_VR13	43
#define PT_R_VR14	44
#define PT_R_VR15	45
#define PT_R_VS		46   /* vector status register */
#define PT_R_VM		47   /* vector mask register */
#define PT_R_VAC	48   /* vector activity count register */
#define PT_R_VNBR	49   /* number of vector registers */

#endif /* _U370 */

#if	(defined(_I386)) && !defined(_KERNEL)
#define PT_REG(reg)	((reg)-(LOWREG))
#endif	/*  defined(_I386)) && !defined(_KERNEL) */

#endif /* ~_h_PTRACE */
o by kê
g ,  $        #  K‰*†™ˆ*K‰*     {z#  	              _¢  ./usr/include/sys/ptrack.h  h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)ptrack.h	16.4	LCC)	/* Modified: 18:44:06 9/22/89 */
/* SCCSIDPUFF(@(#) ptrack.h 4.3 LM 00:24:48 6/21/85 C 00:24:54 6/21/85); */

#ifndef _h_PTRACK
#define _h_PTRACK

#ifndef _h_TYPES
#ifdef KERNEL
#include <types.h>
#else /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */

#ifndef _h_PARAM
#ifdef KERNEL
#include <param.h>
#else /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif /* ~_h_PARAM */

#ifndef _h_RESOURCE
#ifdef KERNEL
#include <resource.h>
#else /* ~KERNEL */
#include <sys/resource.h>
#endif /* ~KERNEL */
#endif /* ~_h_RESOURCE */

/*
   (pid,site) structures:
   Struct pspair is maintained locally and has a link field.
	It is used for both Pid and Pgrp tracking.
   Struct pstab is used to build lists for exchange during netproc operations.
	It is used for Pid tracking only.
*/

struct	pspair {
	struct pspair	*ps_next;		/* Link to next item	*/
	pid_t		ps_pid;
#define ps_pgrp		ps_pid
	union {
		struct {
			siteno_t	Ps_site;
			char		Ps_stat;
			char		Ps_migseq;
		} Ps_pidtrk;
#define ps_site		Ps_un.Ps_pidtrk.Ps_site
#define ps_stat		Ps_un.Ps_pidtrk.Ps_stat
#define ps_migseq	Ps_un.Ps_pidtrk.Ps_migseq
		struct {
			sitemap_t	Ps_grpsites;
			char		Ps_lockcnt;
		} Ps_grptrk;
#define ps_grpsites	Ps_un.Ps_grptrk.Ps_grpsites
#define ps_lockcnt	Ps_un.Ps_grptrk.Ps_lockcnt
	} Ps_un;
};

struct  pstab {
	PADOPEN(PSLt)
	pid_t		pstL_pid;		/* Process id		*/
	PADCLOSE(PSLt, PSLs, PSLu)
#define	pst_pid		PSLu.PSLs.pstL_pid
#define	NPSTLONGS	(sizeof(struct PSLt) / sizeof(long))
	PADOPEN(PSSt)
	siteno_t	pstS_site;		/* Site			*/
	PADCLOSE(PSSt, PSSs, PSSu)
#define	pst_site	PSSu.PSSs.pstS_site
#define	NPSTSHORTS	(sizeof(struct PSSt) / sizeof(short))
	PADOPEN(PSCt)
	char		pstC_stat;		/* Status		*/
	PADCLOSE(PSCt, PSCs, PSCu)
#define	pst_stat	PSCu.PSCs.pstC_stat
};

			/* ps_stat and pst_stat values	*/
#define	PSS_END		0	/* End of pstab list	*/
#define	PSS_NORM	1	/* normal status	*/
#define	PSS_ORPH	2	/* child part'ned away	*/
#define	PSS_ZOMB	3	/* remote zombie	*/
/* NOTE: ps_stat may also contain a signal number for a stopped process,
 * so none of the above values should conflict with signal numbers which
 * may stop a process (e.g. SIGSTOP, SIGTSTP, SIGTTOU, SIGTTIN).
 */

	/* Bit to distinguish pids/pgrps in NM_PSTOP messages */
#define PS_GRPBIT	0x80000000L

extern struct pspair	*findpsp(),
			*getpsp();

extern int		addpsp(),
			freepsp(),
			rempsp(),
			purgepsp();

/*
 * Definitions for the determining origin site number from pid and
 * possible pids from an origin site number.
 */
extern siteno_t pid_to_site();	/* site number which generated pid */
extern siteno_t origsite();	/* take sosite into account */

extern pid_t	site_pids[];	/* minimum pid generated by each site */
/* minimum pid generated by the given site */
#define site_to_pid(siteno) (site_pids[siteno])

/* boolean: was pid generated locally? */
#define local_pid(pid) (((pid) >= site_pids[loc_site]) &&	\
			((pid) < site_pids[loc_site + 1]))
/* boolean: is pid a special low numbered system process? */
#define sys_pid(pid) ((pid) < site_pids[1])

/*
 * Head of pspair list for procs that originated here but have migrated
 * elsewhere.  If this site is the SO site, the list also holds entries
 * for every proc in the partition whose true originating site has gone
 * down.
 */
extern struct pspair	*orig_ps;

/*
 * "gorig_ps" is like "orig_ps", except for process groups.  For each process
 * group, it contains a sitemap indicating where processes in the group may
 * be found.
 */
extern struct pspair	*gorig_ps;

/*
   the following structure defines the contents of the "variable" part
   of the netmsgs which get sent for process tracking messages:
	NM_PSORIG
	NM_PSPAR
*/
struct nmproctrack {
	PADOPEN(npt_LT)
	pid_t	Npt_pid;	/* process whose state/location has changed */
	pid_t	Npt_ppid;	/* his parent */
	PADCLOSE(npt_LT, npt_LS, npt_LU)
#define	npt_pid		npt_LU.npt_LS.Npt_pid
#define	npt_ppid	npt_LU.npt_LS.Npt_ppid
#define	NNPTLONGS	(sizeof(struct npt_LT) / sizeof(long))
	PADOPEN(npt_ST)
	siteno_t Npt_site;	/* his new site; 0 if now dead */
	siteno_t Npt_rtrysite;	/* retry site, for use by sendtopid() */
	PADCLOSE(npt_ST, npt_SS, npt_SU)
#define	npt_site	npt_SU.npt_SS.Npt_site
#define	npt_rtrysite	npt_SU.npt_SS.Npt_rtrysite
#define	NNPTSHORTS	(sizeof(struct npt_ST) / sizeof(short))
	PADOPEN(npt_CT)
	char Npt_migseq;	/* count of migrates for PSORIG sequencing */
	PADCLOSE(npt_CT, npt_CS, npt_CU)
#define	npt_migseq	npt_CU.npt_CS.Npt_migseq
};

/* If the following statement causes a compiler warning or error,
 * then the length of the nmproctrack structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMPT, nmproctrack);

/*
	The following two structures define the variable part and the
	long buffer part of a NM_PSTOP message.
*/

struct nmptrktop {	/* the "variable" part of the message */
	PADOPEN(nptp_LT)
	long Nptp_seq;
	PADCLOSE(nptp_LT, nptp_LS, nptp_LU)
#define nptp_seq	nptp_LU.nptp_LS.Nptp_seq
	PADOPEN(nptp_ST)
	short Nptp_npids;
	PADCLOSE(nptp_ST, nptp_SS, nptp_SU)
#define nptp_npids	nptp_SU.nptp_SS.Nptp_npids
#define	NNPTPLONGS	(sizeof(struct nptp_LT) / sizeof(long))
#define	NNPTPSHORTS	(sizeof(struct nptp_ST) / sizeof(short))
};

/* If the following statement causes a compiler warning or error,
 * then the length of the nmproctrack structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMPTT, nmptrktop);

/* calculate the largest number of elements which can be placed in the
 * struct ptrktop arrays and still keep the size of the struct less
 * than N_BSIZE.
 */
#define NPSTOP ((N_BSIZE - (sizeof(long) - sizeof(char))) \
			 / (sizeof(long) + sizeof(char)))

struct ptrktop {	/* the long buffer part of the message */
	PADOPEN(nptb_LT)
	pid_t	Nptb_pids[NPSTOP];
	PADCLOSE(nptb_LT, nptb_LS, nptb_LU)
#define	nptb_pids	nptb_LU.nptb_LS.Nptb_pids
#define	NNPTBLONGS	(sizeof(struct nptb_LT) / sizeof(long))
#define	NNPTBSHORTS	0
	PADOPEN(nptb_CT)
	char	Nptb_seqs[NPSTOP];
	PADCLOSE(nptb_CT, nptb_CS, nptb_CU)
#define nptb_seqs	nptb_CU.nptb_CS.Nptb_seqs
};

/*
 * MAXSEQSKIP: used by svrpsorig() and svrpstop() to determine if a message is
 * outof date.
 * If the difference between the migseq number in the message and the expected
 * number, treated as an unsigned char, is less than MAXSEQSKIP, then the
 * message is up to date.  There are two cases where this fails:
 *  1.	If a message arrives ahead of *ALL* MAXSEQSKIP previous messages,
 *	we will consider it to be out of date when it isn't.
 *  2.  If the current message was supposed to arrive more than (256-MAXSEQSKIP)
 *	messages ago, we will consider it to be up to date when it isn't.
 * Since the latter case seems more likely, choose MAXSEQSKIP to be much less
 * than 128.
 */
#define MAXSEQSKIP	64

/*
   the following structure defines the contents of the "variable" part
   of the netmsgs which get sent for remote waits (NM_WAIT).
*/
struct nmwait {
	/* This padding is probably pointless, but consistent. */
	PADOPEN(nwait_LT)
	pid_t	Nwait_pid;
	struct rusage Nwait_rusage;	/* see resource.h... given to parent */
					/* when he does a wait. */
	PADCLOSE(nwait_LT, nwait_LS, nwait_LU)
#define	nwait_rusage	nwait_LU.nwait_LS.Nwait_rusage
#define	nwait_pid	nwait_LU.nwait_LS.Nwait_pid
#define	NNWAITLONGS	(sizeof(struct nwait_LT) / sizeof(long))

	PADOPEN(nwait_ST)
	short		Nwait_stat;
	PADCLOSE(nwait_ST, nwait_SS, nwait_SU)
#define	nwait_stat	nwait_SU.nwait_SS.Nwait_stat
#define	NNWAITSHORTS	(sizeof(struct nwait_ST) / sizeof(short))
};

/* If the following statement causes a compiler warning or error,
 * then the length of the nmwait structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMWT, nmwait);

/*
   the following structure defines the contents of the "variable" part
   of the netmsgs which get sent for abandoning remote children (NM_ABNDN).
*/
#define ABNDN_NPIDS	(NMVARSIZE / sizeof(pid_t) - 1)
struct nmabandn {
	PADOPEN(nabn_LT)
	pid_t	Nabn_pids[ABNDN_NPIDS];
	PADCLOSE(nabn_LT, nabn_LS, nabn_LU)
#define	nabn_pids	nabn_LU.nabn_LS.Nabn_pids
#define	NNABNLONGS	(sizeof(struct nabn_LT) / sizeof(long))
	PADOPEN(nabn_ST)
	short		Nabn_npids;	/* number of valid pids in response */
	PADCLOSE(nabn_ST, nabn_SS, nabn_SU)
#define	nabn_npids	nabn_SU.nabn_SS.Nabn_npids
#define	NNABNSHORTS	(sizeof(struct nabn_ST) / sizeof(short))
};

/* If the following statement causes a compiler warning or error,
 * then the length of the nmabandn structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMABND, nmabandn);

#endif /* ~_h_PTRACK */
hen tkê° +  $        /  K‰*†™ˆ*K‰*     ¦Ž/  	                  ./usr/include/sys/ptsconf.h h  h
/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)ptsconf.h	16.3	LCC)	/* Modified: 18:51:16 9/16/89 */

/*
 * device driver configuration header file for pty.c
 *
 * This module is included by conf.c and is responsible for allocating
 * all data structures required by the device driver.  Three device
 * specific pre-processor defined symbols are available for our use:
 *
 *	B_xyz		block major device number (if any)
 *	C_xyz		character major device number (if any)
 *	N_xyz		number of configured controllers
 *	U_xyz		number of configured sub-units
 *
 * (where "xyz" is the device driver prefix)
 *
 */

/*
 * The ptc half of the the pseudo-tty lives off the slaves structures.
 */
#include <pty.h>

#ifdef  SELECT
struct	pts_select pts_select[U_pts];
#endif  /* SELECT */

struct tty pts_tty[U_pts];
struct ptyinfo ptc_info[U_pts];

ikêr¯ *  $        –  K‰*‡™ˆ*K‰*     ýÀ–  	                  ./usr/include/sys/pty.h 
/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985-86, 1989, 1991 IBM Corp.
 *	(c) Copyright 1983-86, 1989, 1991 Locus Computing Corporation
 *	All Rights Reserved
 */
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)pty.h	16.4.1.2	AIX)	/* Modified 3/18/91 18:13:03 */

/*
 * this data structure contains information about each pty, for which there is
 * no room in the normal tty structure.  Rather than extend the tty structure
 * for this extra stuff, we maintain a parallel table
 */
struct ptyinfo
{	short	pt_sopens;	/* number of opens against the server */
	short	pt_copens;	/* number of opens against the controller */
	int	pt_state;	/* current pty state bits */
	int	pt_modes;	/* pty modes */
	long	pt_applflags;	/* Application defined, getable/setable flags */
	struct proc *pt_master;	/* pid of process that has the master */
	ushort	ICANON_sav;	/* save value for ICANON tty struct */
	u_char	ccVMIN_sav;	/* save value for t_cc[VMIN] tty struct */
	u_char	pt_send;	/* for PKT mode */
	u_char  pt_ucntl;	/* cmd for user mode */
	int	pt_rlogind_state;	/* state of the rlogind protocol func */
	caddr_t	pt_pibuf;	/* used by rlogind, input buffer */
	caddr_t	pt_fibuf;	/* used by rlogind, output buffer */
	char	*pt_pbp;	/* used by rlogind, pointer into input buff */
	char	*pt_fbp;	/* used by rlogind, pointer into output buff */
	int	pt_pcc;		/* used by rlogind, count of input buff */
	int	pt_fcc;		/* used by rlogind, count of output buff */
};

/* pty states */
#define	PTY_C_RWAIT	0x0001	/* controller waiting for input */
#define PTY_C_WWAIT	0x0002	/* controller waiting to output */
#define PTY_C_NOBLK	0x0004	/* noblock reads on control dev	*/
#define PTY_PKT		0x0010	/* pty packet mode */
#define PTY_REMOTE	0x0020	/* remote and flow controlled input */
#define PTY_UCNTL	0x0040	/* user control mode */

/* pty modes */
#define	RAWQINT	0x0001		/* send SIGPTY when the raw Q is drained */
#define	OUTQINT 0x0002		/* send SIGPTY when the out Q is non-empty */
#define REMOTE	0x0004		/* flow control without input editing */

#ifdef	SELECT
/* 
 * this data structure keeps track of selects on ptys
 */
struct	pts_select {
	struct proc	*pt_rsel;
	struct proc	*pt_wsel;
	short		pt_flags;
};

#define	PF_RCOLL	0x0001
#define	PF_WCOLL	0x0002
#endif /* SELECT */

/* pty ioctls */
#define	PTYIOR		(('Z'<<8) + 2)		/* how much data can we read */
#define	PTYIOW		(('Z'<<8) + 3)		/* how much data is written */
#define	PTYSTATUS	(('Z'<<8) + 4)		/* how many opens are there */
#define	PTYGETM		(('Z'<<8) + 5)		/* get pty modes */
#define	PTYSETM		(('Z'<<8) + 6)		/* set pty modes */
#define PTYADDM		(('Z'<<8) + 7)		/* or in new pty modes */
#define PTYDELM		(('Z'<<8) + 8)		/* and out old pty modes */
#define PTYSETAPPL	(('Z'<<8) + 9)		/* set usr application flags */
#define PTYGETAPPL	(('Z'<<8) + 10)		/* get usr application flags */
#define PTYWRRAW	(('Z'<<8) + 11)		/* write to raw queue */
#define PTYRLOGIN	(('Z'<<8) + 12)		/* write to raw queue */

  /* arg to PTYWRRAW is pointer to this structure */
struct ptywrraw {
	char *ptr;
	unsigned cnt;
};

struct	rlogind_parms {
	int	socket;
	int	pty;
	int	status;
	char	*user_buffer;
	int	buf_len;
};
y kê— )  $        ±   L‰*‡™ˆ*L‰*     `ˆ±   	              é  ./usr/include/sys/quota.h h h  h/*
**	LICENSED MATERIALS - PROPERTY OF IBM
**	(c) Copyright 1988, 1989 IBM Corp.
**	(c) Copyright 1988, 1989 Locus Computing Corporation
**	All Rights Reserved
**
** module:	quota.h
**
**
** purpose:	contains all declarations necessary for user and kernel
**		quota usage.
**
** major data structures:
**		dqblk is used everywhere and contains the ondisk info
**
**
** notes:
**		see design document (i.e. Steve Kiser) for an overview on
**		how this works
**
*/
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)quota.h	16.4	LCC)	/* Modified: 21:17:53 8/22/90 */

/*
 * Copyright (c) 1982, 1986 Regents of the University of California.
 * All rights reserved.  The Berkeley software License Agreement
 * specifies the terms and conditions for redistribution.
 *
 *	@(#)quota.h	7.1 (Berkeley) 6/4/86
 */

#ifndef _h_QUOTA_
#define _h_QUOTA_

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _h_TYPES */

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif  /* _h_PARAM */

/*
 * MELBOURNE DISC QUOTAS
 *
 * Various junk to do with various quotas (etc) imposed upon
 * the average user (big brother finally hits UNIX).
 *
 */

/*
 * Definitions for the 'quota' system call.
 */
#define	Q_SETDLIM	1	/* set disc limits & usage */
#define	Q_GETDLIM	2	/* get disc limits & usage */
#define	Q_SETDUSE	3	/* set disc usage only */
#define	Q_SYNC		4	/* update disc copy of quota usages */
#define	Q_SETUID	16	/* change proc to use quotas for uid */
#define	Q_SETWARN	25	/* alter inode/block warning counts */
#define	Q_DOWARN	26	/* warn user about excessive space/inodes */

/*
 * Used in Q_SETDUSE.
 */
struct	dqusage {
	u_short	du_curinodes;
	u_long	du_curblocks;
};

/*
 * Used in Q_SETWARN.
 */
struct	dqwarn {
	u_char	dw_bwarn;
	u_char	dw_iwarn;
};

/*
 * The following structure defines the format of the disc quota file
 * (as it appears on disc) - the file is an array of these structures
 * indexed by user number.  The setquota sys call establishes the inode
 * for each quota file (a pointer is retained in the mount structure).
 *
 * The following constants define the number of warnings given a user
 * before the soft limits are treated as hard limits (usually resulting
 * in an allocation failure).  The warnings are normally manipulated
 * each time a user logs in through the Q_DOWARN quota call.  If
 * the user logs in and is under the soft limit the warning count
 * is reset to MAX_*_WARN, otherwise a message is printed and the
 * warning count is decremented.  This makes MAX_*_WARN equivalent to
 * the number of logins before soft limits are treated as hard limits.
 */
#define	MAX_IQ_WARN	3
#define	MAX_DQ_WARN	3

struct	dqblk {
	PADOPEN(QuotaBlk_lt)
	u_long	QBlkhardlimit;	/* absolute limit on disc blks alloc */
	u_long	QBlksoftlimit;	/* preferred limit on disc blks */
	u_long	Qcurrentblocks;	/* current block count */
	PADCLOSE(QuotaBlk_lt, QuotaBlk_ls, QuotaBlk_lu)
	PADOPEN(QuotaBlk_st)
	u_short	QInohardlimit;	/* maximum # allocated inodes + 1 */
	u_short	QInosoftlimit;	/* preferred inode limit */
	u_short	Qcurrentinodes;	/* current # allocated inodes */
	PADCLOSE(QuotaBlk_st, QuotaBlk_ss, QuotaBlk_su)
	PADOPEN(QuotaBlk_ct)
	u_char	QBlkwarn;	/* # warnings left about excessive disc use */
	u_char	QInowarn;	/* # warnings left about excessive inodes */
	PADCLOSE(QuotaBlk_ct, QuotaBlk_cs, QuotaBlk_cu)
};

/* definition actually used by the kernel and should be used by apps */
#define	blockHard	QuotaBlk_lu.QuotaBlk_ls.QBlkhardlimit
#define	blockSoft	QuotaBlk_lu.QuotaBlk_ls.QBlksoftlimit
#define	blockUsage	QuotaBlk_lu.QuotaBlk_ls.Qcurrentblocks
#define	inodeHard	QuotaBlk_su.QuotaBlk_ss.QInohardlimit
#define	inodeSoft	QuotaBlk_su.QuotaBlk_ss.QInosoftlimit
#define	inodeUsage	QuotaBlk_su.QuotaBlk_ss.Qcurrentinodes
#define	blockWarn	QuotaBlk_cu.QuotaBlk_cs.QBlkwarn
#define	inodeWarn	QuotaBlk_cu.QuotaBlk_cs.QInowarn

#ifndef	KERNEL
/* backwards compatibility for apps using quota structures */
#define	dqb_bhardlimit	blockHard
#define	dqb_bsoftlimit	blockSoft
#define	dqb_curblocks	blockUsage
#define	dqb_ihardlimit	inodeHard
#define	dqb_isoftlimit	inodeSoft
#define	dqb_curinodes	inodeUsage
#define	dqb_bwarn	blockWarn
#define	dqb_iwarn	inodeWarn
#endif	/* ~KERNEL */
		
/*
 * The following structure records disc usage for a user on a filesystem.
 * There is one allocated for each quota that exists on any filesystem
 * for the current user. A cache is kept of other recently used entries.
 */
#define QUOTA_HASH 100

struct fileSysQuota {
	struct inode *quotaFile;
	struct userQuota *quotaHash[QUOTA_HASH];
};

struct	userQuota {
	struct userQuota *hashForward;
	struct userQuota *hashBack;
	struct fileSysQuota *hashOwner;
	struct userQuota *cacheForward;
	struct userQuota *cacheBack;
	suid_t uid;
	short refCount;
	short	flags;
#define	UQ_DIRTY	0x01	/* this quota modified since read */
#define	UQ_BLOCKW	0x02	/* has been warned about blk limit */
#define	UQ_INODEW	0x04	/* has been warned about inode limit */
/* these aren't used yet, may not be needed, left over from 4.3 */
#define	DQ_LOCK		0x08	/* this quota locked (no MODS) */
#define	DQ_WANT		0x10	/* wakeup on unlock */
#define	DQ_FAKE		0x20	/* no limits here, just usage */
	struct dqblk ondisk;	/* actual usage & quotas updated to disk */
};

/* definition actually used by the kernel and should be used by apps */
#define	userFree	hashForward
#define	uBlockHard	ondisk.blockHard
#define	uBlockSoft	ondisk.blockSoft
#define	uBlockUsage	ondisk.blockUsage
#define	uInodeHard	ondisk.inodeHard
#define	uInodeSoft	ondisk.inodeSoft
#define	uInodeUsage	ondisk.inodeUsage
#define	uBlockWarn	ondisk.blockWarn
#define	uInodeWarn	ondisk.inodeWarn

#ifndef	KERNEL
/* backwards compatibility for apps using quota structures */
#define	dquot		userQuota
#define	dq_bhardlimit	uBlockHard
#define	dq_bsoftlimit	uBlockSoft
#define	dq_curblocks	uBlockUsage
#define	dq_ihardlimit	uInodeHard
#define	dq_isoftlimit	uInodeSoft
#define	dq_curinodes	uInodeUsage
#define dq_bwarn	uBlockWarn
#define dq_iwarn	uInodeWarn
#define dq_flags	flags
#define dq_cnt		refCount
#define dq_uid		uid
#define dq_dev		hashOwner->quotaFile->i_gfs
#define dq_dqb		ondisk
#endif	/* ~KERNEL */

#define	NIL_USERQUOTA		((struct userQuota *) NULL)
#define	NIL_FSYSQUOTA		((struct fileSysQuota *) NULL)

#if defined(KERNEL)
/* common routines available within quota mechanism */
extern struct fileSysQuota *qAllocFileSys();
extern struct inode *openQuota();
extern struct gmount *qGetFs();
extern struct userQuota *qGetUser();
extern void qPrintWarn();
extern void qSetuid();
extern void qExtractWarn();

/* quota netmessage */
struct nmQuota {
	PADOPEN(Nquota_lt)
	gfs_t nmQgfs;		/* gfs to which to apply quota operation */
	long controlTty;	/* controlling tty of sending process */
	PADCLOSE(Nquota_lt, Nquota_ls, Nquota_lu)
	PADOPEN(Nquota_st)
	suid_t nmQuid;		/* uid of which to apply quota operation */
	PADCLOSE(Nquota_st, Nquota_ss, Nquota_su)
	struct dqblk quotaInfo;	/* parameters for get/set limits and usage */
};
#define nmQuotaGfs	Nquota_lu.Nquota_ls.nmQgfs
#define nmQuotaTty	Nquota_lu.Nquota_ls.controlTty
#define nmQuotaUid	Nquota_su.Nquota_ss.nmQuid

/* contains warning information for each filesystem over quota in the */
/* nmDowarnReply */
struct qWarning {
	PADOPEN(Nwarning_lt)
	gfs_t qWarnGfs;		/* gfs that user is over limit */
	PADCLOSE(Nwarning_lt, Nwarning_ls, Nwarning_lu)
	PADOPEN(Nwarning_st)
	short inodeWarnings;	/* # inode warnings left, -1 for no warning */
	short blockWarnings;	/* # block warnings left, -1 for no warning */
	PADCLOSE(Nwarning_st, Nwarning_ss, Nwarning_su)
};
#define	nmWarnGfs	Nwarning_lu.Nwarning_ls.qWarnGfs
#define nmWarnInode	Nwarning_su.Nwarning_ss.inodeWarnings
#define nmWarnBlock	Nwarning_su.Nwarning_ss.blockWarnings

#define MAX_QUOTA_WARN 	(NMVARSIZE - sizeof(long))/sizeof(struct qWarning)

/* reply message to an nmQuota DOWARN */
struct nmDowarnReply {
	PADOPEN(NWarnReply_st)
	short warnCount;
	PADCLOSE(NWarnReply_st, NWarnReply_ss, NWarnReply_su)
	struct qWarning warning[MAX_QUOTA_WARN];
};
#define qWarnCount	NWarnReply_su.NWarnReply_ss.warnCount

#define	NOQUOTA_WARNING	-1	/* put comment here */
#define NEAR_QUOTA_LIMIT 10

#endif  /* KERNEL */
#endif /* ! _h_QUOTA_ */
curinodkêdª ®  ÿ¡             _‰*_‰*_‰*          	                  ./usr/include/sys/raw_cb.h  h  h../net/raw_cb.h kê*x (  $        ×  L‰*ˆ™ˆ*L‰*     Li×  	              -  ./usr/include/sys/rcdnet.h  h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)rcdnet.h	16.6       LCC)    /* Modified: 23:06:53 1/11/90 */

#ifndef _h_RCDNET
#define _h_RCDNET

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _h_TYPES */

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  /*  ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif  /* _h_PARAM */

#ifndef _h_SIGNAL
#include <signal.h>
#endif  /* _h_SIGNAL */

/*
   RCD data/ioctl structure
*/
struct nmrcd {
	struct Nrcd_Head {
		PADOPEN(Nrcd_Lt)
		pid_t	Nrcd_rqpgrp;		/* Requestor's pgrp	*/
		pid_t	Nrcd_rqsesid;		/* Requestor's session	*/
		ksigmask_t Nrcd_ignsig;		/* Ignored signal mask	*/
		long	Nrcd_count;		/* Character count	*/
		dev_t	Nrcd_rdev;		/* Device number	*/
		off_t	Nrcd_mpxchan;		/* MPX device channel	*/
		long	Nrcd_procp;		/* Requester's proc ptr	*/
		long	Nrcd_ttyp;		/* Terminal pointer	*/
		long	Nrcd_retval;		/* Ret code (ioctl)	*/
		long	Nrcd_ext;		/* AIX extended arg	*/
		PADCLOSE(Nrcd_Lt, Nrcd_Ls, Nrcd_Lu)
#define NRCDLONGS	(sizeof(struct Nrcd_Lt) / sizeof(long))
#define nrcd_rqpgrp	Nrcd_head.Nrcd_Lu.Nrcd_Ls.Nrcd_rqpgrp
#define nrcd_rqsesid	Nrcd_head.Nrcd_Lu.Nrcd_Ls.Nrcd_rqsesid
	/* svrproc pid: returned in immediate response so RCDCAN can notify */
	/* the svrproc during a delayed response */
#define nrcd_sppid	nrcd_rqpgrp
#define nrcd_ignsig	Nrcd_head.Nrcd_Lu.Nrcd_Ls.Nrcd_ignsig
#define nrcd_count	Nrcd_head.Nrcd_Lu.Nrcd_Ls.Nrcd_count
#define nrcd_iocmd	nrcd_count			/* another overload */
#define nrcd_rdev	Nrcd_head.Nrcd_Lu.Nrcd_Ls.Nrcd_rdev
#define nrcd_mpxchan	Nrcd_head.Nrcd_Lu.Nrcd_Ls.Nrcd_mpxchan
#define nrcd_procp	Nrcd_head.Nrcd_Lu.Nrcd_Ls.Nrcd_procp
#define nrcd_ttyp	Nrcd_head.Nrcd_Lu.Nrcd_Ls.Nrcd_ttyp
#define nrcd_retval	Nrcd_head.Nrcd_Lu.Nrcd_Ls.Nrcd_retval
#define nrcd_ext	Nrcd_head.Nrcd_Lu.Nrcd_Ls.Nrcd_ext


		PADOPEN(Nrcd_St)
		siteno_t	Nrcd_rdevsite;		/* Device site */
		PADCLOSE(Nrcd_St, Nrcd_Ss, Nrcd_Su)
#define NRCDSHORTS	(sizeof(struct Nrcd_St) / sizeof(short))
#define nrcd_rdevsite	Nrcd_head.Nrcd_Su.Nrcd_Ss.Nrcd_rdevsite

		PADOPEN(Nrcd_Ct)
		char	Nrcd_type;		/* Message sub-type	*/
		PADCLOSE(Nrcd_Ct, Nrcd_Cs, Nrcd_Cu)
	} Nrcd_head;
	/* sub-type for NM_RCDW ( RCD_{WRITE,OPEN,CLOSE} ) */
#define nrcd_type	Nrcd_head.Nrcd_Cu.Nrcd_Cs.Nrcd_type

#define BITTTOU (1L << (SIGTTOU - 1))
#define BITTTIN (1L << (SIGTTIN - 1))

#define RCD_TYPE	0x07	/* WRITE, OPEN, CLOSE, or FCLOSE */
#define  RCD_WRITE	1
#define  RCD_OPEN	2
#define  RCD_CLOSE	3
#define  RCD_FCLOSE	4
#define RCD_NDELAY	0x08	/* FNDELAY is set in u.u_fmode */

#define RCD_BSIZE	(NMVARSIZE - sizeof(struct Nrcd_Head))

	union {
		char Nrcd_buf[RCD_BSIZE];	/* RCD R/W data */

		/*
		   These are all the ioctl fields, padded for
		   network exchange.  Several "generic" longs,
		   shorts, and chars are reserved.  The #defines
		   at the end of this file will "overlay" each
		   ioctl structure onto these generic fields.
		*/
		struct {
			PADOPEN(Nrcd_lt)
			long	Nrcd_L1;
			PADCLOSE(Nrcd_lt, Nrcd_ls, Nrcd_lu)
#define	nrcd_L1	Nrcd_lu.Nrcd_ls.Nrcd_L1
#define	NRIOCLONGS	(sizeof(struct Nrcd_lt) / sizeof(long))

			PADOPEN(Nrcd_st)
			short	Nrcd_S1;
			short	Nrcd_S2;
			short	Nrcd_S3;
			short	Nrcd_S4;
/* new */
			short	Nrcd_S5;
			short	Nrcd_S6;
			short	Nrcd_S7;
			short	Nrcd_S8;
			short	Nrcd_S9;
			short	Nrcd_S10;
			PADCLOSE(Nrcd_st, Nrcd_ss, Nrcd_su)
#define nrcd_S1 Nrcd_su.Nrcd_ss.Nrcd_S1
#define nrcd_S2 Nrcd_su.Nrcd_ss.Nrcd_S2
#define nrcd_S3 Nrcd_su.Nrcd_ss.Nrcd_S3
#define nrcd_S4	Nrcd_su.Nrcd_ss.Nrcd_S4
/* new */
#define nrcd_S5	Nrcd_su.Nrcd_ss.Nrcd_S5
#define nrcd_S6	Nrcd_su.Nrcd_ss.Nrcd_S6
#define nrcd_S7	Nrcd_su.Nrcd_ss.Nrcd_S7
#define nrcd_S8	Nrcd_su.Nrcd_ss.Nrcd_S8
#define nrcd_S9	Nrcd_su.Nrcd_ss.Nrcd_S9
#define nrcd_S10 Nrcd_su.Nrcd_ss.Nrcd_S10
#define	NRIOCSHORTS	(sizeof(struct Nrcd_st) / sizeof(short))

			PADOPEN(Nrcd_ct)		/* lots of chars */
			char	Nrcd_C1, Nrcd_C2, Nrcd_C3, Nrcd_C4;
			char	Nrcd_C5, Nrcd_C6, Nrcd_C7, Nrcd_C8;
			char	Nrcd_C9;
/* NEW */
			char	Nrcd_C10; char	Nrcd_C11; char	Nrcd_C12;
			char	Nrcd_C13; char	Nrcd_C14; char	Nrcd_C15;
			char	Nrcd_C16; char	Nrcd_C17; char	Nrcd_C18;
			char	Nrcd_C19; char	Nrcd_C20; char	Nrcd_C21;
			char	Nrcd_C22; char	Nrcd_C23; char	Nrcd_C24;
			char	Nrcd_C25; char	Nrcd_C26; char	Nrcd_C27;
			char	Nrcd_C28;
			PADCLOSE(Nrcd_ct, Nrcd_cs, Nrcd_cu)
#define nrcd_C1 Nrcd_cu.Nrcd_cs.Nrcd_C1
#define nrcd_C2 Nrcd_cu.Nrcd_cs.Nrcd_C2
#define nrcd_C3 Nrcd_cu.Nrcd_cs.Nrcd_C3
#define nrcd_C4 Nrcd_cu.Nrcd_cs.Nrcd_C4
#define nrcd_C5 Nrcd_cu.Nrcd_cs.Nrcd_C5
#define nrcd_C6 Nrcd_cu.Nrcd_cs.Nrcd_C6
#define nrcd_C7 Nrcd_cu.Nrcd_cs.Nrcd_C7
#define nrcd_C8 Nrcd_cu.Nrcd_cs.Nrcd_C8
#define nrcd_C9 Nrcd_cu.Nrcd_cs.Nrcd_C9

#define nrcd_C10 Nrcd_cu.Nrcd_cs.Nrcd_C10
#define nrcd_C11 Nrcd_cu.Nrcd_cs.Nrcd_C11
#define nrcd_C12 Nrcd_cu.Nrcd_cs.Nrcd_C12
#define nrcd_C13 Nrcd_cu.Nrcd_cs.Nrcd_C13
#define nrcd_C14 Nrcd_cu.Nrcd_cs.Nrcd_C14
#define nrcd_C15 Nrcd_cu.Nrcd_cs.Nrcd_C15
#define nrcd_C16 Nrcd_cu.Nrcd_cs.Nrcd_C16
#define nrcd_C17 Nrcd_cu.Nrcd_cs.Nrcd_C17
#define nrcd_C18 Nrcd_cu.Nrcd_cs.Nrcd_C18
#define nrcd_C19 Nrcd_cu.Nrcd_cs.Nrcd_C19
#define nrcd_C20 Nrcd_cu.Nrcd_cs.Nrcd_C20
#define nrcd_C21 Nrcd_cu.Nrcd_cs.Nrcd_C21
#define nrcd_C22 Nrcd_cu.Nrcd_cs.Nrcd_C22
#define nrcd_C23 Nrcd_cu.Nrcd_cs.Nrcd_C23
#define nrcd_C24 Nrcd_cu.Nrcd_cs.Nrcd_C24
#define nrcd_C25 Nrcd_cu.Nrcd_cs.Nrcd_C25
#define nrcd_C26 Nrcd_cu.Nrcd_cs.Nrcd_C26
#define nrcd_C27 Nrcd_cu.Nrcd_cs.Nrcd_C27
#define nrcd_C28 Nrcd_cu.Nrcd_cs.Nrcd_C28
		} Nrcd_iocbuf;
	} nrcd_u;
};

/* If the following statement causes a compiler warning or error,
 * then the length of the nmrcd structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMRCD, nmrcd);

#define nrcd_buf	nrcd_u.Nrcd_buf
#define nrcd_iocbuf	nrcd_u.Nrcd_iocbuf

	/* misc. int/long arg */
#define	nrcd_long	nrcd_iocbuf.nrcd_L1
	/* termio (nrcd_cc1 starts the c_cc[NCC] array, currently 8 chars) */
#define	nrcd_iflag	nrcd_iocbuf.nrcd_S1
#define	nrcd_oflag	nrcd_iocbuf.nrcd_S2
#define	nrcd_cflag	nrcd_iocbuf.nrcd_S3
#define	nrcd_lflag	nrcd_iocbuf.nrcd_S4
#define	nrcd_line	nrcd_iocbuf.nrcd_C1
#define	nrcd_cc1	nrcd_iocbuf.nrcd_C2 /* really NCC (= 8) chars */
	/* TIOCSTI */
#define	nrcd_stichar	nrcd_iocbuf.nrcd_C1
	/* sgttyb */
#define	nrcd_ispeed	nrcd_iocbuf.nrcd_C1
#define	nrcd_ospeed	nrcd_iocbuf.nrcd_C2
#define	nrcd_erase	nrcd_iocbuf.nrcd_C3
#define	nrcd_kill	nrcd_iocbuf.nrcd_C4
#define	nrcd_flags	nrcd_iocbuf.nrcd_S1
	/* tchars */
#define	nrcd_intrc	nrcd_iocbuf.nrcd_C1
#define	nrcd_quitc	nrcd_iocbuf.nrcd_C2
#define	nrcd_startc	nrcd_iocbuf.nrcd_C3
#define	nrcd_stopc	nrcd_iocbuf.nrcd_C4
#define	nrcd_eofc	nrcd_iocbuf.nrcd_C5
#define	nrcd_brkc	nrcd_iocbuf.nrcd_C6
	/* ltchars */
#define	nrcd_suspc	nrcd_iocbuf.nrcd_C1
#define	nrcd_dsuspc	nrcd_iocbuf.nrcd_C2
#define	nrcd_rprntc	nrcd_iocbuf.nrcd_C3
#define	nrcd_flushc	nrcd_iocbuf.nrcd_C4
#define	nrcd_werasc	nrcd_iocbuf.nrcd_C5
#define	nrcd_lnextc	nrcd_iocbuf.nrcd_C6
	/* uclatchars */
#define	nrcd_length	nrcd_iocbuf.nrcd_S1
/* What about ut_lpos?  Can't read this field across rcd?  [richard] */
#define	nrcd_statc	nrcd_iocbuf.nrcd_C1
#define	nrcd_pagec	nrcd_iocbuf.nrcd_C2
#define	nrcd_npagec	nrcd_iocbuf.nrcd_C3
#define	nrcd_pgcbrk	nrcd_iocbuf.nrcd_C4
	/* POSIX */
#define nrcd_winsize_ws_row	nrcd_iocbuf.nrcd_S5
#define nrcd_winsize_ws_col	nrcd_iocbuf.nrcd_S6
#define nrcd_winsize_ws_xpixel	nrcd_iocbuf.nrcd_S7
#define nrcd_winsize_ws_ypixel	nrcd_iocbuf.nrcd_S8
#define nrcd_bflag		nrcd_iocbuf.nrcd_S9
#define nrcd_clength	nrcd_iocbuf.nrcd_C26
#define nrcd_pgflag	nrcd_iocbuf.nrcd_C27
#define nrcd_cline	nrcd_iocbuf.nrcd_C28

#define	nm_rcd	NM_PARMS.nm_Prcd

#define	RCD_END		0x40000000	/* End of read: |'ed w/rc_count	*/
#define	RCD_ENDMASK	0x3fffffff	/* Read count mask		*/

extern struct netmsg *rcdnmwait() ;

#endif /* ~_h_RCDNET */
dkê· '  $        E  L‰*ˆ™ˆ*L‰*     
uE  	                  ./usr/include/sys/reboot.h  h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)reboot.h	16.4	LCC)	/* Modified: 18:45:15 9/22/89 */
/* SCCSIDPUFF(@(#) reboot.h 4.1 LM 12:56:02 4/23/85 C 22:13:11 4/23/85); */

#ifndef _h_REBOOT
#define _h_REBOOT

/*
 * Arguments to reboot system call that are
 * also passed to boot program and on to init.
 */
#define	RB_AUTOBOOT	0	/* flags for system auto-booting itself */

#define	RB_ASKNAME	1	/* ask for file name to reboot from */
#define	RB_SINGLE	2	/* reboot to single user only */
#define	RB_DEPSITE	4	/* tells init this is a dependent site */

/* Arguments to reboot(2) system call */
#define	RB_NOSYNC	4	/* dont sync before reboot */
#define	RB_HALT		8	/* don't reboot, just halt */
#define	RB_BOOTDBG	0x10	/* boot debug flag */

#define	RB_PANIC	0	/* reboot due to panic */
#define	RB_BOOT		1	/* reboot due to boot() */

#endif /* ~_h_REBOOT */
d_ckêš¥ &  $          L‰*ˆ™ˆ*L‰*     JO  	                  ./usr/include/sys/recovery.h   h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)recovery.h	16.5	LCC)	/* Modified: 21:15:29 10/20/89 */
/* SCCSIDPUFF(@(#) recovery.h 4.1 LM 12:56:06 4/23/85 C 22:13:11 4/23/85); */

#ifndef _h_RECOVERY
#define _h_RECOVERY

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif  /* _h_TYPES */

/*  The structure of a recovery command to the recovery master
 *  user process.
 */

struct rcmd {
	long	rq_opcode;
	gfs_t	rq_gfs;
};

#ifdef KERNEL
extern  struct rcmd rcmdq[];
extern  int topchgsnap;
extern  int topchgdbgtime;
#endif /* KERNEL */

/*  opcode values for rcmd.rq_opcode  */
#define PRIMRECOV	2	/* do primary site recovery */
#define DBGTOPCHG1	51	/* do snapshot of network history and osm */

#endif /* ~_h_RECOVERY */
OT		1kêzà %  $        E  M‰*­™ˆ*M‰*     ÁE  	              —  ./usr/include/sys/reg.h /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef _h_REG
#define _h_REG

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)reg.h	16.7	LCC)	/* Modified: 20:32:04 5/20/90 */

/*
 * Location of the users' stored
 * registers relative to R0.
 * Usage is u.u_ar0[XX].
 */
 
#ifdef b370
#include <sys/b370/psw.h>
#include <sys/b370/csw.h>
#define R0	(0)
#define R1	(1)
#define	DEST	(1)
#define R2	(2)
#define R3	(3)
#define R4	(4)
#define R5	(5)
#define R6	(6)
#define R7	(7)
#define R8	(8)
#define R9	(9)
#define R10	(10)
#define R11	(11)
#define AP	(11)
#define R12	(12)
#define FP	(12)
#define R13	(13)
#define SP	(13)
#define R14	(14)
#define	RTRN	(14)
#define R15	(15)
#define	NARGS	(15)
#define	FPR0	(16)
#define	FPR2	(18)
#define FPR4	(20)
#define FPR6	(22)
#define	FP0	(16)
#define	FP1	(17)
#define	FP2	(18)
#define	FP3	(19)
#define FP4	(20)
#define FP5	(21)
#define FP6	(22)
#define FP7	(23)
#define PSW	(24)
#define OLDPSW	(24)
#define PSW2	(25)
#define PC	(25)
#define CSW	(26)
#define CSW2	(27)
 
				/* the above list.		*/
/* vector register numbers */
    
#define	VR0	30
#define	VR1	31
#define	VR2	32
#define	VR3	33
#define	VR4	34
#define	VR5	35
#define	VR6	36
#define	VR7	37
#define	VR8	38
#define	VR9	39
#define	VR10	40
#define	VR11	41
#define	VR12	42
#define	VR13	43
#define	VR14	44
#define	VR15	45
#define	VS	46
#define	VM	47
#define	VAC	48
#define VNBR	49

struct trapblk
{
	int tb_r0;			/* Do we need a trapblk which	*/
	int tb_r1;			/* looks like the one for	*/
	int tb_r2;			/* RESSUP ? Gmo.		*/
	int tb_r3;
	int tb_r4;
	int tb_r5;
	int tb_r6;
	int tb_r7;
	int tb_r8;
	int tb_r9;
	int tb_r10;
	int tb_r11;
	int tb_r12;
	int tb_r13;
#define tb_sp tb_r13
	int tb_r14;
	int tb_r15;
	int	tb_fr0;			/* These were defined as	*/
	int	tb_fr1;			/* double tb_fr{0,2,4,6};	*/
	int	tb_fr2;			/* but that causes alignment	*/
	int	tb_fr3;			/* problems in trns_dta. Gmo.	*/
	int	tb_fr4;
	int	tb_fr5;
	int	tb_fr6;
	int	tb_fr7;
	psw_t	tb_psw;
	csw_t	tb_csw;

#ifndef	XA370				/* The XA csw has one more long	*/
	long	tb_pad;			/* so pad the non-XA trapblk	*/
#endif	/* !XA370 */

	union
	{
		long		w_int;
		struct
		{
			u_char		w_char[2];
			u_short		w_short;
		} w_ss;
	} Tb;

#define tb_ilc		Tb.w_ss.w_char[1]
#define tb_intcode	Tb.w_ss.w_short
#define tb_intword	Tb.w_int

/*	Trap block map extended to match TRAPBLK macro in page0.h  9/21/89 -gll- */

	int		tb_cspl;		/* Current SPL level */
	int		tb_cmask;		/* Current system mask */
	int		tb_sign;		/* Trapblock signature */
};

/*
 *	defines for the old calling sequence -- used by the pcc compiler.
 */
#define	NREGS		16
#define	NFPREGS		4
#define	RGSVSZW		NREGS
#define	RGSVSZ		(RGSVSZW*NBPW)	/* Size of the C 	*/
					/* register savearea in	*/
					/* bytes.		*/

/*
 *	defines for the new calling sequence.
 *	this matches what is used by the metaware compilers
 *	changed to the April 1988 linkage
 */
#define TB_SIGNATURE 0x6b6b636b	/* Signature used to identify trapblocks */
#define	MAXSVRG		14		/* Save area has space for 14 regs (r2-r15) */
#define	SAVESZW		(MAXSVRG+4)	/* There's also space for Pascal's "static link" */
	/* 	a previous frame pointer and two reserved words */
#define	SAVESZ		(SAVESZW*4)	/* Same in bytes */
#define	MINFRW		(SAVESZW+4)	/* Minimum frame includes space for 4 parms */
#define	MINFR		(MINFRW*4)
#define	SP_BIAS		0		/* Stack pointer is not biased */
#define	BACK_PTR_OFF	4		/* SP of previous frame */


#define	ARG(n)		(SAVESZ+((n-1)*NBPW)) /* ARG(1)(fp) gives first arg */


#endif /* b370 */

#ifdef	vax

#define	R0	(-18)
#define	R1	(-17)
#define	R2	(-16)
#define	R3	(-15)
#define	R4	(-14)
#define	R5	(-13)
#define	R6	(-12)
#define	R7	(-11)
#define	R8	(-10)
#define	R9	(-9)
#define	R10	(-8)
#define	R11	(-7)
#define	R12	(-21)
#define	R13	(-20)

#define AP	(-21)
#define	FP	(-20)
#define	SPC	(-19)		/* Saved kernel pc		*/
#define	SP	(-5)
#define	PS	(-1)
#define	PC	(-2)

struct trapblk {
	int tb_ap;
	int tb_fp;
	int tb_spc;
	int tb_r0;		/* registers saved at entry to	*/
	int tb_r1;		/* system call			*/
	int tb_r2;
	int tb_r3;
	int tb_r4;
	int tb_r5;
	int tb_r6;
	int tb_r7;
	int tb_r8;
	int tb_r9;
	int tb_r10;
	int tb_r11;
	int tb_args;		/* number of args to syscall	*/
	int tb_sp;		/* saved user SP		*/
	int tb_type;		/* saved trap type (SYSCALL)	*/
	int tb_code;		/* saved syscall code		*/
	int tb_pc;		/* saved user PC		*/
	int tb_ps;		/* saved user PS		*/
};

#endif	/* vax */

#ifdef	M68000
#	define	D0	(-19)
#	define	D1	(-18)
#	define	D2	(-17)
#	define	D3	(-16)
#	define	D4	(-15)
#	define	D5	(-14)
#	define	D6	(-13)
#	define	D7	(-12)
#	define	A0	(-11)
#	define	A1	(-10)
#	define	A2	(-9)
#	define	A3	(-8)
#	define	A4	(-7)
#	define	A5	(-6)
#	define	A6	(-5)
#	define	A7	(-4)
#	define	CONTEXT	(-3)
#	define	PS	(-2)
#	define	PC	(-1)

#	define	SP	A7
#	define	R0	D0
#	define	R1	D1

	/*
	 * This is used by the netproc code to set up the stack
	 * and return to the local syscall() routine in trap.c.
	 * Therefore, if parameters are added to syscall() they
	 * should be put into this structure as well.
	 */

struct trapblk {
	int ks_d0;		/* saved register d0 */
	int ks_d1;
	int ks_d2;
	int ks_d3;
	int ks_d4;
	int ks_d5;
	int ks_d6;
	int ks_d7;
	int ks_a0;		/* saved register a0 */
	int ks_a1;
	int ks_a2;
	int ks_a3;
	int ks_a4;
	int ks_a5;
	int ks_a6;
	int ks_sp;		/* saved stack pointer */
	int ks_context;		/* saved user context */
	int ks_ps;		/* saved user status word */
	int ks_pc;		/* saved user program counter */
};
#endif	/* M68000 */

#if defined(i386)
struct trapblk {
	int	k_edi;
	int	k_esi;
	int	k_ebp;
	int	k_esp;			/* this just points to k_eax */
	int	k_ebx;
	int	k_edx;
	int	k_ecx;
	int	k_eax;
	int	k_gs;
	int	k_fs;
	int	k_es;
	int	k_ds;
	int	k_tnum;	 		/* trap id (zero for interrupts) */
	int	k_terr;	 		/* on traps: hardware error code */
#define	k_ivec	k_terr			/* on interrupts: intr number */
	int	k_eip;
	int	k_cs;			/* cs (is high order garbage?) */
	int	k_eflags;		/* flags register */
	int	k_usp;			/* user sp (only pushed if user mode) */
	int	k_ss;			/* user ss (only pushed if user mode) */
};

#define	EDI	0
#define	ESI	1
#define	EBP	2
#define	KSP	3		/* BOGUS sp pushed by the "pusha" instruction */
#define	EBX	4
#define	EDX	5
#define	ECX	6
#define	EAX	7
#define	GS	8
#define	FS	9
#define	ES	10
#define	DS	11
#define	TNUM	12	/* trap number (zero for interrupts) */
#define	TERR	13	/* error code for traps */
#define	IVEC	TERR	/* interrupt number for interrupts */
#define	EIP	14
#define	CS	15
#define	EFL	16
#define	USP	17		/* user sp */
#define	ESP	17		/* user sp */
#define SP	USP		/* user sp (for mi code compatibility) */
#define	SS	18

#define FIRSTGENREG	EDI	/* First general register in trapblk */
#define LASTGENREG	EAX	/* Last general register in trapblk */
#define	LOWREG		(EDI)	/* Lowest numbered register */
#define	HIGHREG		(SS)	/* Highest numbered register */

#ifdef MERGE386
/* For Merge 386 modules, we provide some SVR3 => Locus glue */
#define UESP	USP
#define ERR	TERR
#define TRAPNO	TNUM
#endif

/*
 * wait3 and forkreturn want to use PC and PS.
 */
#define	PS	EFL
#define	PC	EIP
#endif	/* defined(i386) */


#if  defined(i386)
/*
 * Floating point state as stored by the 80287 and 80387.  This also allows
 * room for the 286 emulator (which uses bigger registers).  This sizes must
 * be the same (for now), since I don't want to recompile the world.
 */
#ifdef i386
#define	FPREGSIZE	(106-7*2)	/* ints are bigger on 386 */
#else /* __UNDEF__ */
#define	FPREGSIZE	(106)
#endif 

struct fp87state
{
	/*
	 * Yes, according to the 387 manual, these are ints
	 * (16 bits on a 286, 32 bits on 386).
	 */
	int	cntrl;		/* control register 	*/
	int	status;		/* status register 	*/
	int	tag;		/* tag word 		*/
	int	ip[2];		/* instruction pointer 	*/
	int	dop[2];		/* data_pointer/operand	*/
	char	temp_regs[FPREGSIZE]; 
};


#endif	  /* i386 */

#endif /* ~_h_REG */

#dkêöq $  $        z	  M‰*‰™ˆ*M‰*     zz	  	                  ./usr/include/sys/reloc.h .h   h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)reloc.h	16.3	LCC)	/* Modified: 18:57:29 9/16/89 */
/* H_SCCSIDgen1(@(#)reloc.h	11.5	AIX);	/* Modified 11/6/88 08:24:55 */

#ifndef	_h_RELOC
#define	_h_RELOC

/*	@(#)reloc.h	2.1	*/
struct reloc {
	long	r_vaddr;	/* (virtual) address of reference */
	long	r_symndx;	/* index into symbol table */
	unsigned short	r_type;		/* relocation type */
	};


/*
 *   relocation types for all products and generics
 */

/*
 * All generics
 *	reloc. already performed to symbol in the same section
 */
#define  R_ABS		0

/*
 * X86 generic
 *	8-bit offset reference in 8-bits
 *	8-bit offset reference in 16-bits 
 *	12-bit segment reference
 *	auxiliary relocation entry
 */
#define	R_OFF8		07
#define R_OFF16		010
#define	R_SEG12		011
#define	R_AUX		013

/*
 * B16 and X86 generics
 *	16-bit direct reference
 *	16-bit "relative" reference
 *	16-bit "indirect" (TV) reference
 */
#define  R_DIR16	01
#define  R_REL16	02
#define  R_IND16	03

/*
 * 3B generic
 *	24-bit direct reference
 *	24-bit "relative" reference
 *	16-bit optimized "indirect" TV reference
 *	24-bit "indirect" TV reference
 *	32-bit "indirect" TV reference
 */
#define  R_DIR24	04
#define  R_REL24	05
#define  R_OPT16	014
#define  R_IND24	015
#define  R_IND32	016

/* 
 * XL generics
 *	10-bit direct reference
 *	10-bit "relative" reference
 *	32-bit "relative" reference
 */
#define	R_DIR10		025
#define R_REL10		026
#define R_REL32		027

/*
 * 3B and M32 generics
 *	32-bit direct reference
 */
#define  R_DIR32	06

/*
 * M32 generic
 *	32-bit direct reference with bytes swapped
 */
#define  R_DIR32S	012
 
 /*
  * DEC Processors  VAX 11/780 and VAX 11/750 
  *
  */
 
#define R_RELBYTE	017
#define R_RELWORD	020
#define R_RELLONG	021
#define R_PCRBYTE	022
#define R_PCRWORD	023
#define R_PCRLONG	024


#define	RELOC	struct reloc
#define	RELSZ	10	/* sizeof(RELOC) */

	/* Definition of a "TV" relocation type */

#if N3B || U3B
#define ISTVRELOC(x)	((x==R_OPT16)||(x==R_IND24)||(x==R_IND32))
#endif /* N3B || U3B */

#if B16 || X86
#define ISTVRELOC(x)	(x==R_IND16)
#endif /* B16 || X86 */

#if M32
#define ISTVRELOC(x)	(x!=x)	/* never the case */
#endif /* M32 */

#endif ~_h_RELOC
traps kêŽË "  $        
  M‰*­™ˆ*M‰*     ´W
  
                  ./usr/include/sys/resource.h   h#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)resource.h	16.7	LCC)	/* Modified: 18:47:00 9/22/89 */

#ifndef	_h_RESOURCE
#define	_h_RESOURCE

#ifndef _h_TIME
#ifdef KERNEL
#include <time.h>
#else /* ~KERNEL */
#include <sys/time.h>
#endif /* ~KERNEL */
#endif /* _h_TIME */

/*
 * Resource utilization information.
 */

/*
 * Copyright (c) 1982, 1986 Regents of the University of California.
 * All rights reserved.  The Berkeley software License Agreement
 * specifies the terms and conditions for redistribution.
 *
 *	@(#)resource.h	7.1 (Berkeley) 6/4/86
 */
/* 
* Copyright (C)  1989, Locus Computing Corporation
 * All Rights Reserved
 */ 
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * Process priority specifications to get/setpriority.
 */

#ifdef	_BSD
#define	PRIO_MIN	-20
#define	PRIO_MAX	20
#else	/* ~_BSD */
#define	PRIO_MIN	0
#define	PRIO_MAX	40
#endif	/* ~_BSD */

#define	PRIO_PROCESS	0
#define	PRIO_PGRP	1
#define	PRIO_USER	2

#define	RUSAGE_SELF	0
#define	RUSAGE_CHILDREN	-1

struct	rusage {
	struct timeval ru_utime;	/* user time used */
	struct timeval ru_stime;	/* system time used */
	long	ru_maxrss;
/*
 * To "add" two rusage structures, make appropriate adjustments for the
 * fields above, and then just add all of the counters between ru_first
 * and ru_last, inclusive.  All of these counters must be longs.
 */
#define	ru_first	ru_ixrss
	long	ru_ixrss;		/* integral shared memory size */
	long	ru_idrss;		/* integral unshared data " */
	long	ru_isrss;		/* integral unshared stack " */
	long	ru_minflt;		/* page reclaims */
	long	ru_majflt;		/* page faults */
	long	ru_nswap;		/* swaps */
	long	ru_inblock;		/* block input operations */
	long	ru_oublock;		/* block output operations */
	long	ru_msgsnd;		/* messages sent */
	long	ru_msgrcv;		/* messages received */
	long	ru_nsignals;		/* signals received */
	long	ru_nvcsw;		/* voluntary context switches */
	long	ru_nivcsw;		/* involuntary " */
#define	ru_last		ru_nivcsw
};

/*
 * Resource limits
 */
#define	RLIMIT_CPU	0		/* cpu time in milliseconds */
#define	RLIMIT_FSIZE	1		/* maximum file size */
#define	RLIMIT_DATA	2		/* data size */
#define	RLIMIT_STACK	3		/* stack size */
#define	RLIMIT_CORE	4		/* core file size */
#define	RLIMIT_RSS	5		/* resident set size */

#define	RLIM_NLIMITS	6		/* number of resource limits */

#define	RLIM_INFINITY	0x7fffffff

struct rlimit {
	long	rlim_cur;		/* current (soft) limit */
	long	rlim_max;		/* maximum value for rlim_cur */
};

#endif	/* ! _h_RESOURCE */
PkêZ¤ ³  ÿ¡             w‰*w‰*w‰*          	                  ./usr/include/sys/rnode.h .h   h../rpc/rnode.h ykêÂv ¬  ÿ¡             _‰*_‰*_‰*          	                  ./usr/include/sys/route.h .h   h../net/route.h ykê+ ±  ÿ¡             w‰*w‰*w‰*          	                  ./usr/include/sys/rpc.h ../rpc/rpc.h /sykêZõ ¯  ÿ¡             w‰*w‰*w‰*          	                  ./usr/include/sys/rpc_msg.h    h../rpc/rpc_msg.hkêHœ ¬  ÿ¡             x‰*x‰*x‰*          	                  ./usr/include/sys/rpctypes.h   h../rpc/rpctypes.h rpctypkêÜA    $        Q  M‰*‰™ˆ*M‰*     ñÁQ  	                  ./usr/include/sys/ruprint.h    h/*
**	LICENSED MATERIALS - PROPERTY OF IBM
**	(c) Copyright 1988, 1989 IBM Corp.
**	(c) Copyright 1988 Locus Computing Corporation
**	All Rights Reserved
**
** module:	ruprint.h	
**
**
** purpose:	contains all declarations necessary for user and kernel
**		remote uprint usage.
**
*/
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#) ruprint.h  16.4 LCC)	/* Modified: 04:34:45 11/10/89 */

/*
* Copyright (C) 1987, 1989, Locus Computing Corporation
 * All Rights Reserved
 */

#define UPRTEXTSIZE	(NMVARSIZE - sizeof(struct Nuprint_lt))

struct nmuprint {
	PADOPEN(Nuprint_lt)
	dev_t	nmdev;		/* remote device */
	off_t	nmttyx;		/* multiplexed channel */
	PADCLOSE(Nuprint_lt, Nuprint_ls, Nuprint_lu)
	char	nmuprtext[UPRTEXTSIZE];
};
#define nmuprdev		Nuprint_lu.Nuprint_ls.nmdev
#define nmuprttyx		Nuprint_lu.Nuprint_ls.nmttyx
SD
#defkê¨s   $           N‰*Š™ˆ*N‰*     ¾   	                  ./usr/include/sys/sccs.h .h    h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

/* SCCSID(@(#)sccs.h	16.7	LCC)	/* Modified: 17:57:41 10/24/90 */

#ifndef _h_SCCS
#define _h_SCCS

#if	defined(NOSCCSIDS) || defined(lint)
#	define  SCCSID(arg)
#	define  H_SCCSID(arg)
#	define	H_SCCSID_PASC(arg)
#	define	SCCSID_PASC(arg)
#	define	SCCSIDPUFF(arg)
#	define  LCC_SCCSID(arg)

#else	/* ~(SCCSIDS || lint) */
#if  defined(__SCCSVERS__)
#if	defined(__ASMFILE__)
	/* The macro S_SCCSID is necessary to force a space before "arg1" */
#	    define S_SCCSID(arg1, arg2)	arg2 arg1
#	    define SCCSID(arg)		S_SCCSID(vers_  arg,)
#	    define H_SCCSID(arg)	S_SCCSID(vers_  arg,)
#	    define H_SCCSID_PASC(arg)
#	    define SCCSID_PASC(arg)
#else	/* ~__ASMFILE__ */
#	    define SCCSID(arg)		asm(" vers_  arg");
#	    define H_SCCSID(arg)	asm(" vers_  arg");
#	    define H_SCCSID_PASC(arg)
#	    define SCCSID_PASC(arg)
#endif	/* ~__ASMFILE__ */
#ifdef  KERNEL
#	define SCCSIDPUFF(arg)
#else  /* ~KERNEL */
#	define SCCSIDPUFF(arg)		asm(" vers_  arg");
#endif /* ~KERNEL */
#	define LCC_SCCSID(arg)
#else /* ~__SCCSVERS__ */
#if	defined(__ASMFILE__)
#	define SCCSID(arg)
#	define SCCSIDPUFF(arg)
#	define H_SCCSID(arg)
#	define H_SCCSID_PASC(arg)
#	define SCCSID_PASC(arg)
#else	/* ~__ASMFILE__ */
#	define SCCSID(arg)		static char const Sccsid[] = "arg";
#	define SCCSIDPUFF(arg)		static char const Sccsidpuff[] = "arg";
#	define H_SCCSID(arg)
#	define H_SCCSID_PASC(arg)
#	define SCCSID_PASC(arg)
#endif	/* ~__ASMFILE__ */
#	define	LCC_SCCSID(arg)		static char const Sccsidlcc[] = "arg";
#endif /* ~__SCCSVERS__ */

#endif /* ~(SCCSIDS || lint) */

#endif /* ~_h_SCCS */
kêx™   $        `  N‰*Š™ˆ*N‰*     æµ`  	                  ./usr/include/sys/scnhdr.h     h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)scnhdr.h	16.5	LCC)	/* Modified: 10:24:17 11/2/89 */
/* SCCSIDPUFF(@(#) scnhdr.h 4.2 LM 00:26:55 6/21/85 C 00:27:01 6/21/85); */

#ifndef	_h_SCNHDR
#define	_h_SCNHDR

/*	@(#)scnhdr.h	2.1	*/
struct scnhdr {
	char		s_name[8];	/* section name */
	long		s_paddr;	/* physical address */
	long		s_vaddr;	/* virtual address */
	long		s_size;		/* section size */
	long		s_scnptr;	/* file ptr to raw data for section */
	long		s_relptr;	/* file ptr to relocation */
	long		s_lnnoptr;	/* file ptr to line numbers */
	unsigned short	s_nreloc;	/* number of relocation entries */
	unsigned short	s_nlnno;	/* number of line number entries */
	long		s_flags;	/* flags */
	};

#define	SCNHDR	struct scnhdr
#define	SCNHSZ	sizeof(SCNHDR)




/*
 * Define constants for names of "special" sections
 */

#define _TEXT		".text"		/* executable code section */
#define _DATA		".data"		/* initialized data */
#define _BSS		".bss"		/* un-initialized data */
#define _DEBUG 		".debug"	/* special section used by dbx */
#define _COMMENT	".comment"	/* version info */
#define _LIB		".lib"		/* shared lib info section */
#define _TV		".tv"

/*
 * The low two bytes of s_flags is used as a section "type"
 */

#define STYP_REG	0x00		/* "regular" section: */
					/*	allocated, relocated, loaded */
#define STYP_DSECT	0x01		/* "dummy" section: */
					/*	not allocated, relocated,
						not loaded */
#define STYP_NOLOAD	0x02		/* "noload" section: */
					/*	allocated, relocated,
						 not loaded */
#define STYP_GROUP	0x04		/* "grouped" section: */
					/*	formed of input sections */
#define STYP_PAD	0x08		/* "padding" section: */
					/*	not allocated, not relocated,
						 loaded */
#define STYP_COPY	0x10		/* "copy" section: */
					/*	for decision function used
						by field update;  not
						allocated, not relocated,
						loaded;  reloc & lineno
						entries processed normally */
#define	STYP_TEXT	0x20		/* section contains text only */
#define STYP_DATA	0x40		/* section contains data only */
#define STYP_BSS	0x80		/* section contains bss only */

#define S_NEWFCN  	0x100		/* new function in an update file */
#define STYP_INFO	0x200		/* comment section : not allocated
						not relocated, not loaded */
#define STYP_OVER	0x400		/* overlay section : relocated
						not allocated or loaded */
#define STYP_LIB	0x800		/* for .lib section : same as INFO */

/*
 * In 3b Update Files (output of ogen), sections which appear in SHARED
 * segments of the Pfile will have the S_SHRSEG flag set by ogen, to inform
 * dufr that updating 1 copy of the proc. will update all process invocations.
 */

#define S_SHRSEG	0x20

#endif /* ~_h_SCNHDR */

kêŽþ ,  $        Ý	  /‰*¶™ˆ*/‰*     ¡Ý	  	                  ./usr/include/sys/scontext.h   h/*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright IBM Corporation 1989, 1990
 *	(c) Copyright Locus Computing Corporation 1989, 1990
 *	All Rights Reserved
 */

#ifndef _POSIX_SOURCE
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)scontext.h	1.1	AIX)	/* Modified 6/26/91 23:33:17 */
#endif /* ! _POSIX_SOURCE */

#ifndef	_H_CONTEXT	/* else we've already been included */
#define _H_CONTEXT

#define	_NSIG	63	/* highest signal number in use */
#define _SIGSETSZ ((_NSIG+31)/32)   /* number of longs in signal mask array */

#ifdef _POSIX_SOURCE
typedef struct __sigset 
#else
typedef struct sigset 
#endif /* _POSIX_SOURCE */
{		/* signal masks are specified thus */
	int setsize;			/* basically a version number */
	unsigned long sigs[_SIGSETSZ];	/* mask words, 32 signals each */
} sigset_t;

/* Information pushed on stack when a signal is delivered.
 * This is used by the kernel to restore state following
 * execution of the signal handler.  It is also made available
 * to the handler to allow it to properly restore state if
 * a non-standard exit is performed.
 */

#ifdef  _U370
#ifdef _POSIX_SOURCE
struct	__sigcontext
#else
struct	sigcontext
#endif /* POSIX_SOURCE */
{
	int	sc_onstack;		/* sigstack state to restore */
	int	sc_regs[16];		/* regs to restore */
	int	sc_psw[2];		/* psw to restore */
	double	sc_fpregs[4];		/* fp regs to restore */
#ifndef _POSIX_SOURCE
#define	sc_dbase	sc_regs[ 8]
#define	sc_ibase	sc_regs[ 9]
#define	sc_ap		sc_regs[10]
#define	sc_fp		sc_regs[11]
#define	sc_sp		sc_regs[12]
#define	sc_rtrn		sc_regs[13]
#define	sc_nargs	sc_regs[14]
#define	sc_dest		sc_regs[15]
#endif /* NOT _POSIX_SOURCE */
	sigset_t sc_smask;		/* signal mask to restore */
};
#endif  /* _U370 */

#ifdef _I386
#ifdef _POSIX_SOURCE
struct __sigcontext
#else
struct sigcontext
#endif /* POSIX_SOURCE */
{
	unsigned sc_onstack;		/* $ sigstack state to restore */
	int	sc_di;			/* $ edi */
	int	sc_si;			/* $ esi */
	int	sc_bp;			/* $ ebp */
	int	sc_sp;			/*   esp */
	int	sc_bx;			/* $ ebx */
	int	sc_dx;			/* $ edx */
	int	sc_cx;			/* $ ecx */
	int	sc_ax;			/* $ eax */
	int	sc_gs;			/* $ gs */
	int	sc_fs;			/* $ fs */
	int	sc_es;			/* $ es */
	int	sc_uds;			/* $ ds */
	int	sc_viol;		/*   viol */
	int	sc_err;			/*   err */
	int	sc_ip;			/* $ eip */
	int	sc_cs;			/* $ cs */
	int	sc_fl;			/* $ fl */
	int	sc_usp;			/* $ esp */
	int	sc_uss;			/* $ ss */
	sigset_t sc_smask;		/* $ signal mask to restore */
};
#endif /* _I386 */

#endif	/* _H_CONTEXT */
lockêúÊ   $        å  O‰*‹™ˆ*O‰*     Y`å  	                  ./usr/include/sys/seg.h 
/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)seg.h	16.3	LCC)	/* Modified: 19:02:06 9/16/89 */
/* SCCSIDPUFF(@(#) seg.h 4.1 LM 12:56:36 4/23/85 C 22:13:19 4/23/85); */

#ifndef _h_SEG
#define _h_SEG

#if	defined(vax) || defined(SOFT_VAX) || defined(b370) || defined(romp)

/*
 * Mapper addresses and bits
 */

#define	RO	PG_URKR		/* access abilities */
#define	RW	PG_UW

#endif	/* vax || SOFT_VAX || b370 || romp */
/*-
***	I am not sure about whether the following ifdef should be
***		SCRATCHREGS or BUFFERSOUT or both or a combination.
***	It is quite likely that the two should be unified into one concept
***		but I am finding it difficult in my current state of mind
***		to see the right connection of the two.  All the 
***		struct savesegreg  savesegreg declarations in the code
***		are ifdef BUFFERSOUT and somehow I don't think this is 
***		right either.  The scratch registers are used by the 
***		LISTMEM memory management system so maybe the distinction
***		is even more obscure than I currently perceive.  (greg)...
**/
	/* buffers are in kernel data so access them directly... */
#define mapbpin(bp, savesegregp, unquenessindicator)	(bp)->b_un.b_addr

	/* nothing to map out since buffers are in kernel data.. */
#define mapbpout( savesegregp )			/* nothing */

	/* set up a link to for a future mapbpin call */
#define setupsavelink( savesegregp )		/* nothing */

	/* follow a link from a previous setupsavelink or mapbpin call */
#define followsavelink( savesegregp ) 		/* nothing */

#endif /* ~_h_SEG */
 */kê˜L   $        ô  O‰*™ˆ*O‰*     ç@ô  	                  ./usr/include/sys/select.h h   h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */

H_SCCSID(@(#)select.h	16.4	LCC)	/* Modified: 18:48:43 9/22/89 */
/* AIX - @(#)select.h	4.2 - 86/10/31 - 18:25:29 */

#ifndef _h_SELECT
#define _h_SELECT

#ifndef  _h_TYPES
#ifdef   KERNEL
#include <types.h>
#else   /* ~KERNEL */
#include <sys/types.h>
#endif  /* ~KERNEL */
#endif  /* ~_h_TYPES */

#ifndef  _h_TIME
#ifdef   KERNEL
#include <time.h>
#else   /* ~KERNEL */
#include <sys/time.h>
#endif  /* ~KERNEL */
#endif  /* ~_h_TIME */

/*
**	Implementation Constants.
*/
#define NFDS(X)	((X) & 0x0000FFFF)
				/* number of file descriptors (bits);
				   apply to nfds parameter of select system
				   call &/or return value from select */
#define NMSGS(X) (((X) >> 16) & 0x0000FFFF)
				/* number of message queues; apply to nfds
				   parameter of select system call &/or
				   return value from select */	 
/*
**	Template for user select parameters
*/
#define	SELLIST(F,M)	\
struct { fd_mask   fdsmask[F];\
	 int   msgids[M];\
}
/*
**	Structure Declarations.
*/

#endif /* ~_h_SELECT */
...
kêÔ¯   $        a  O‰*™ˆ*O‰*     \`a  	                  ./usr/include/sys/sem.h /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)sem.h	16.3	LCC)	/* Modified: 19:03:51 9/16/89 */

#ifndef _h_SEM
#define _h_SEM

/*
	IPC Semaphore Facility.
*/

#ifndef _h_IPC
#ifdef  KERNEL
#include <ipc.h>
#else  /* ~KERNEL */
#include <sys/ipc.h>
#endif /* ~KERNEL */
#endif /* ~_h_IPC */

/*
	Implementation Constants.
*/

#define	PSEMN	(PZERO + 3)	/* sleep priority waiting for greater value */
#define	PSEMZ	(PZERO + 2)	/* sleep priority waiting for zero */

/*
	Permission Definitions.
*/

#define	SEM_A	0200	/* alter permission */
#define	SEM_R	0400	/* read permission */

/*
	Semaphore Operation Flags.
*/

#define	SEM_UNDO	010000	/* set up adjust on exit entry */
#define SEM_ORDER	020000  /* perfore operations non-atomically */
#define SEM_ERR		040000  /* set if error encountered on semop */

/*
	Semctl Command Definitions.
*/

#define	GETNCNT	3	/* get semncnt */
#define	GETPID	4	/* get sempid */
#define	GETVAL	5	/* get semval */
#define	GETALL	6	/* get all semval's */
#define	GETZCNT	7	/* get semzcnt */
#define	SETVAL	8	/* set semval */
#define	SETALL	9	/* set all semval's */

/*
	Structure Definitions.
*/

/*
	There is one semaphore structure for each semaphore in the system.
*/

struct sem {
	pid_t	sempid;		/* pid of last operation */
	ushort	semval;		/* semaphore text map address */
	ushort	semncnt;	/* # awaiting semval > cval */
	ushort	semzcnt;	/* # awaiting semval = 0 */
};


/*
	There is one semaphore id data structure for each set of semaphores
		in the system.
*/
struct semid_ds {
	struct ipc_perm	sem_perm;	/* operation permission struct */
	struct sem 	*sem_base;	/* ptr to first semaphore in set */
	ushort		sem_nsems;	/* # of semaphores in set */
	time_t		sem_otime;	/* last semop time */
	time_t		sem_ctime;	/* last change time */
};

#define SEMAVAIL	(-1)	/* sempid for unallocated semaphores */

/*
	There is one undo structure per process in the system.
*/

struct sem_undo {
	struct sem_undo	*un_np;	/* ptr to next active undo structure */
	short		un_cnt;	/* # of active entries */
	struct undo {
		short	un_aoe;	/* adjust on exit values */
		short	un_num;	/* semaphore # */
		han_t	un_id;	/* semid */
	}	un_ent[1];	/* undo entries (one minimum) */
};

/*
	semaphore information structure
*/
struct	seminfo	{
	int	semmap,		/* # of entries in semaphore map */
		semmni,		/* # of semaphore identifiers */
		semmns,		/* # of semaphores in system */
		semmnu,		/* # of undo structures in system */
		semmsl,		/* max # of semaphores per id */
		semopm,		/* max # of operations per semop call */
		semume,		/* max # of undo entries per process */
		semusz,		/* size in bytes of undo structure */
		semvmx,		/* semaphore maximum value */
		semaem;		/* adjust on exit max value */
};

/*
	User semaphore template for semop system calls.
*/

struct sembuf {
	ushort	sem_num;	/* semaphore # */
	short	sem_op;		/* semaphore operation */
	short	sem_flg;	/* operation flags */
};

#endif /* ~_h_SEM */
(i386)
kêJ   $        w  O‰*­™ˆ*O‰*     P`w  	                  ./usr/include/sys/sgtty.h  h   h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)sgtty.h	16.3	LCC)	/* Modified: 19:04:43 9/16/89 */

/*
Copyright (c) 1984, 1989  Locus Computing Corporation
		All Rights Reserved
*/

/*      @(#)sgtty.h	5.3 u370  source        */
/*
 * Structure for stty and gtty system calls.
 */

#ifndef	_h_SGTTY
#define	_h_SGTTY

#ifndef _h_IOCTL
#ifdef  KERNEL
#include <ioctl.h>
#else  /* ~KERNEL */
#include <sys/ioctl.h>
#endif /* ~KERNEL */
#endif /* _h_IOCTL */

/*
 * Structure for stty and gtty system calls.
 */
typedef struct sgttyb {
	char	sg_ispeed;		/* input speed */
	char	sg_ospeed;		/* output speed */
	char	sg_erase;		/* erase character */
	char	sg_kill;		/* kill character */
#if	defined(vax) 
	short	sg_flags;		/* mode flags */
#else	/* ~(defined(vax))   */
	int	sg_flags;		/* mode flags */
#endif	/* ~(defined(vax)) */
} sgtty_t;

/*
 * Modes
 */
#define	TANDEM	0000001
#define	CBREAK	0000002
#define	LCASE	0000004
#define	ECHO	0000010
#define	CRMOD	0000020
#define	RAW	0000040
#define	ODDP	0000100
#define	EVENP	0040000
#define ANYP	0040100
#define	NLDELAY	0000600
#define TBDELAY 0014000
#define XTABS	TBDELAY
#define	CRDELAY	0003000
#define VTDELAY	0100000
#define BSDELAY 0020000
#define ALLDELAY (BSDELAY|VTDELAY|CRDELAY|TBDELAY|NLDELAY)

#define	CR0	0
#define	CR1	0001000
#define	CR2	0002000
#define	CR3	0003000
#define	NL0	0
#define	NL1	0000400
#define	NL2	0000200
#define	NL3	0000600
#define	TAB0	0
#define	TAB1	0004000
#define	TAB2	0010000
#define	NOAL	0010000	/* NEEDSWORK */

#define	FF0	0
#define	FF1	0100000
#define	BS0	0
#define	BS1	0020000

/*
 * Speeds
 */

#define	B0	0
#define	B50	0000001
#define	B75	0000002
#define	B110	0000003
#define	B134	0000004
#define	B150	0000005
#define	B200	0000006
#define	B300	0000007
#define	B600	0000010
#define	B1200	0000011
#define	B1800	0000012
#define	B2400	0000013
#define	B4800	0000014
#define	B9600	0000015
#define	EXTA	0000016
#define	EXTB	0000017

#endif /* ! _h_SGTTY */
ukêÌ´   $          O‰*™ˆ*O‰*     Q^  	                  ./usr/include/sys/shm.h /*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)shm.h	16.4	AIX)	/* Modified: 19:05:36 9/16/89 */

#ifndef _h_SHM
#define _h_SHM

/*
	IPC Shared Memory Facility.
*/

#ifndef _h_IPC
#include <sys/ipc.h>
#endif /* ~_h_IPC */

#ifdef i386
#ifndef _h_MMU386	/* need to get the definition of NBPPDE */
#include <sys/i386/mmu386.h>
#endif /* ~_h_MMU386 */
#endif /* i386 */

/*
	Implementation Constants.
*/

#if defined(PAGING) || defined(SWAPPING)
#define	SHMLBA	ctob(1)	/* segment low boundary address multiple */
#endif /* defined(PAGING) || defined(SWAPPING) */

#ifdef	b370
#define	SHMLBA		NBPS	/* segment low boundary address multiple */
#endif	/* b370 */

#ifdef i386
#define	SHMLBA		NBPPDE	/* no. of bytes pointed to by a page dir ent */
#endif /* i386 */
			/* (SHMLBA must be a power of 2) */

/*
	Permission Definitions.
*/

#define	SHM_R	0400	/* read permission */
#define	SHM_W	0200	/* write permission */

/*
	Internal flags kept in the ipc_perm.mode field.  These
	can only be the bits in IPC_TYPEDEP from <sys/ipc.h>
*/
#define	SHMF_INIT	01000	/* initialize segment on next attach */
#define	SHMF_LOCKED	02000	/* shmop in progress for this shmid struct */
#define	SHMF_WANTED	04000	/* process waiting for the shmid struct lock */
#define	SHMF_PRESERVE	(SHMF_INIT | SHMF_LOCKED | SHMF_WANTED)
				/* flags to preserve when freeing a shmid */

/* shmat control flag parameters */
#define	SHM_RDONLY	010000	/* attach read-only (else read-write) */
#define	SHM_RND		020000	/* round attach address to SHMLBA */

/* shmctl cmds : not yet implemented, will generate EINVAL if used */
#define SHM_LOCK	3
#define SHM_UNLOCK	4

/* flag parmeter to disclaim() system call */
#define ZERO_MEM	0

/*
	Structure Definitions.
*/

/*
	There is a shared mem id data structure for each segment in the system.
*/

struct shmid_ds {
	struct ipc_perm	shm_perm;	/* operation permission struct */
	int		shm_segsz;	/* segment size in pages */
#if defined(PAGING) || defined(SWAPPING)
	struct pte 	*shm_ptbl;	/* ptr to associated page table */
#endif /* defined(PAGING) || defined(SWAPPING) */
#if defined(SVPAGING) || defined(i386)
	struct vseg	*shm_vseg;	/* pointer to associated vseg */
#endif /* SVPAGING || i386 */
	pid_t		shm_lpid;	/* pid of last shmop */
	pid_t		shm_cpid;	/* pid of creator */
	ushort		shm_nattch;	/* current # attached */
	ushort		shm_cnattch;	/* in memory # attached */
	time_t		shm_atime;	/* last shmat time */
	time_t		shm_dtime;	/* last shmdt time */
	time_t		shm_ctime;	/* last change time */
};

#if defined(PAGING) || defined(SWAPPING)
struct	shmpt_ds {
	int	shm_spte;	/* starting pte entry */
	int	shm_sflg;	/* R/W permission on segment */
};
#endif /* defined(PAGING) || defined(SWAPPING) */

struct	shminfo {
	int	shmmax;	/* max shared memory segment size */
	int	shmmin;	/* min shared memory segment size */
	int	shmmni;	/* # of shared memory identifiers */
	int	shmseg;	/* max attached shared memory segments per process */
	int	shmbrk;	/* gap in clicks between data and shared memory */
	int	shmall;	/* max total shared memory system wide (in clicks) */
};
#endif /* ~_h_SHM */
kêþ›   $        b  N‰*™ˆ*N‰*     ¾yb  	                  ./usr/include/sys/sigmap.h h   h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)sigmap.h	16.3	LCC)	/* Modified: 18:49:17 9/22/89 */

#if defined(LCC) || defined(DEVCOMPAT)

			/* This code is intended to disappear.  These
			 * interfaces should be supported only through
			 * libraries.
			 */

/* This is to let old binaries run on the new system,
 * despite conflicting signal numbers.
 *
 * This stuff really ought to bloody go away.
 */

extern short sigvectmplt[], xsigvectmplt[];

#define SIG5USR1 16 		/* Old signal numbers */
#define SIG5USR2 17 		/* some of these are from AIX 2.1 */
#define SIG5CLD 18 		/* some are from a previous version */
#define SIG5PWR 19 		/* of the LOCUS operating system */
#define SIG5USG1 20 
#define SIG5USG2 21 
#define SIG5USG3 22 
#define SIG5AIO 25 
#define SIG5PTY 26 
#define SIG5IOINT 27 
#define SIG5GRANT 28 
#define SIG5RETRACT 29 
#define SIG5SOUND 30 
#define SIG5MSG 31 
#define SIG5URG 33 
#define SIG5STOP 34 
#define SIG5TSTP 35 
#define SIG5CONT 36 
#define SIG5CHLD 37 
#define SIG5TTIN 38 
#define SIG5TTOU 39 
#define SIG5IO 40 
#define SIG5XCPU 41 
#define SIG5XFSZ 42 
#define SIG5VTALRM 43 
#define SIG5PROF 44 
#define SIG5WINCH 45 
#define SIG5MIGRATE 48 


static unsigned char sig5Nrray[] = {	/* old to new */
/* SIG5USR1 16 */		SIGUSR1,
/* SIG5TICK/USR2 17 */		SIGUSR2,
/* SIG5CLD 18 */		SIGCHLD,
/* SIG5PWR 19 */		SIGPWR,
/* SIG5USG1 20 */		0,
/* SIG5USG2 21 */		0,
/* SIG5USG3 22 */		0,
/* 23 */			0,
/* 24 */			0,
/* SIG5AIO 25 */		SIGIO,
/* SIG5PTY 26 */		SIGIO,
/* SIG5IOINT 27 */		SIGIO,
/* SIG5GRANT 28 */		SIGGRANT,
/* SIG5RETRACT 29 */		SIGRETRACT,
/* SIG5SOUND 30 */		SIGSOUND,
/* SIG5MSG 31 */		SIGMSG,
/* 32 */			0,
/* SIG5URG 33 */		SIGURG,
/* SIG5STOP 34 */		SIGSTOP,
/* SIG5TSTP 35 */		SIGTSTP,
/* SIG5CONT 36 */		SIGCONT,
/* SIG5CHLD 37 */		SIGCHLD,
/* SIG5TTIN 38 */		SIGTTIN,
/* SIG5TTOU 39 */		SIGTTOU,
/* SIG5IO 40 */			SIGIO,
/* SIG5XCPU 41 */		SIGXCPU,
/* SIG5XFSZ 42 */		SIGXFSZ,
/* SIG5VTALRM 43 */		SIGVTALRM,
/* SIG5PROF 44 */		SIGPROF,
/* SIG5WINCH 45 */		SIGWINCH,
/* 46 */			0,
/* 47 */			0,
/* SIG5MIGRATE 48 */		SIGMIGRATE
};

static unsigned char sigN5rray[] = {	/* new to old */
/* SIGURG 16 */			SIG5URG,
/* SIGSTOP 17 */		SIG5STOP,
/* SIGTSTP 18 */		SIG5TSTP,
/* SIGCONT 19 */		SIG5CONT,
/* SIGCHLD 20 */		SIG5CHLD,
/* SIGTTIN 21 */		SIG5TTIN,
/* SIGTTOU 22 */		SIG5TTOU,
/* SIGIO 23 */			SIG5IO,
/* SIGXCPU 24 */		SIG5XCPU,
/* SIGXFSZ 25 */		SIG5XFSZ,
/* ---- 26 */			SIGIOT, /* ugly */
/* SIGMSG  27 */		SIG5MSG,
/* SIGWINCH 28 */		SIG5WINCH,
/* SIGPWR 29 */			SIG5PWR,
/* SIGUSR1 30 */		SIG5USR1,
/* SIGUSR2 31 */		SIG5USR2,
/* SIGPROF 32 */		SIG5PROF,
/* SIGDANGER 33 */		SIGEMT,
/* SIGVTALRM 34 */		SIG5VTALRM,
/* SIGMIGRATE 35 */		SIG5MIGRATE,
/* ---- 36 */			SIGIOT,
/* ---- 37 */			SIGIOT,
/* ---- 38 */			SIGIOT,
/* ---- 39 */			SIGIOT,
/* ---- 40 */			SIGIOT,
/* ---- 41 */			SIGIOT,
/* ---- 42 */			SIGIOT,
/* ---- 43 */			SIGIOT,
/* ---- 44 */			SIGIOT,
/* ---- 45 */			SIGIOT,
/* ---- 46 */			SIGIOT,
/* ---- 47 */			SIGIOT,
/* ---- 48 */			SIGIOT,
/* ---- 49 */			SIGIOT,
/* ---- 50 */			SIGIOT,
/* ---- 51 */			SIGIOT,
/* ---- 52 */			SIGIOT,
/* ---- 53 */			SIGIOT,
/* ---- 54 */			SIGIOT,
/* ---- 55 */			SIGIOT,
/* ---- 56 */			SIGIOT,
/* ---- 57 */			SIGIOT,
/* ---- 58 */			SIGIOT,
/* SIGSAK  59 */		SIGIOT,
/* SIGGRANT  60 */		SIG5GRANT,
/* SIGRETRACT 61 */		SIG5RETRACT,
/* SIGSOUND  62 */		SIG5SOUND,
};
#endif	/* defined(LCC) || defined(DEVCOMPAT) */
 Ürb ÜkêÜµ   $        #,  P‰*®™ˆ*P‰*     ^ˆ#,  	              E  ./usr/include/sys/signal.h h   h#ifndef _POSIX_SOURCE
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)signal.h	16.21	AIX)	/* Modified 6/26/91 21:47:02 */
#endif /* NOT _POSIX_SOURCE */
/*
* 5713-AEQ COPYRIGHT IBM CORP 1989
* LICENSED MATERIAL - PROGRAM PROPERTY OF IBM
*/


#ifndef _H_SIGNAL  /* else we've already been included */
#define _H_SIGNAL

#include <sys/scontext.h>

/**********************************************************************
  SIGNAL NUMBERS
**********************************************************************/

#ifndef _POSIX_SOURCE
#define NSIG _NSIG
#endif /* ! _POSIX_SOURCE */

#define SIGHUP	1	/* hangup */
#define SIGINT	2	/* interrupt (probably user typed intr key) */
#define SIGQUIT	3	/* quit */
#define SIGILL	4	/* illegal instruction */
#define SIGTRAP	5	/* trace trap */

#ifndef _POSIX_SOURCE
#define SIGIOT	6	/* IOT instruction */
#endif	/* NOT _POSIX_SOURCE */

#define SIGABRT	6	/* used by abort, replacing old IOT in the future */
#define SIGEMT	7	/* EMT instruction */
#define SIGFPE	8	/* floating point exception */
#define SIGKILL	9	/* kill (may not be caught, blocked, or ignored) */
#define SIGBUS	10	/* bus error */
#define SIGSEGV	11	/* segmentation violation (bad access to data) */
#define SIGSYS	12	/* bad argument to system call */
#define SIGPIPE	13	/* write on a pipe with no one to read it */
#define SIGALRM	14	/* alarm clock */
#define SIGTERM	15	/* software termination signal */
/* signal 16 is also used by BSD in the vtrace system call */
#define SIGURG	16	/* urgent condition on IO channel */
#define SIGSTOP	17	/* stop (may not be caught, blocked, or ignored) */
#define SIGTSTP	18	/* interactive stop signal from TTY */
#define SIGCONT	19	/* continue if stopped (may not be ignored) */
#define SIGCHLD	20	/* A child has stopped or exited */

#ifndef _POSIX_SOURCE
#define SIGCLD	20	/* death of a child, Sys V style */
#endif	/* NOT _POSIX_SOURCE */

#define SIGTTIN	21	/* Read of control TTY attempted from background */
#define SIGTTOU	22	/* Write to control TTY attempted from background */
#define SIGIO	23	/* input/output possible or complete */

#ifndef _POSIX_SOURCE
#define SIGPOLL	SIGIO	/* selectable event pending (like SIGIO) */
#endif	/* NOT _POSIX_SOURCE */

#define SIGXCPU	24	/* exceeded CPU time limit */
#define SIGXFSZ	25	/* exceeded file size limit */

/* signal 26 reserved */

#define SIGMSG	27	/* HFT input data pending */
#define SIGWINCH 28	/* window size change */
#define SIGPWR	29	/* power failure imminent (save your data) */
#define SIGUSR1	30	/* user defined signal 1 */
#define SIGUSR2	31	/* user defined signal 2 */
#define SIGPROF	32	/* profiling time alarm */
#define SIGDANGER 33	/* system crash imminent */
#define SIGVTALRM 34	/* virtual time alarm */
#define SIGMIGRATE 35	/* migrate process to another CPU */
#define SIGPRE	36	/* programming error */

/* signals 37-59 reserved */

#define SIGGRANT 60	/* HFT monitor mode granted */
#define SIGRETRACT 61	/* HFT monitor mode retracted */
#define SIGSOUND 62	/* HFT sound sequence has completed */

/* signal 63 reserved */

#ifndef _POSIX_SOURCE
#define SIGAIO SIGIO	/* compatibility */
#define SIGIOINT SIGIO
#define SIGPTY SIGIO
#endif	/* NOT _POSIX_SOURCE */

/**********************************************************************
  COMPATIBILITY ASSISTANCE
**********************************************************************/


#if defined(_BSD) || defined(__RT) || defined(_KERNEL)
#define __SIGVOID int
#else /* new AIX */
#define __SIGVOID void
#endif	/* _BSD or __RT or _KERNEL */


/**********************************************************************
  SIGACTION STUFF
**********************************************************************/

#ifndef _POSIX_SOURCE
#define	SIGSETSZ	_SIGSETSZ
#endif

struct sigaction {		/* signal handlers are specified thus */
	__SIGVOID (*sa_handler)();
	int sa_flags;
	sigset_t sa_mask;
};


#ifndef _POSIX_SOURCE
				/*=== flag bits for sa_flags ===*/
#define SA_ONSTACK	0x1	/* handle signal on alternate stack */
#define SA_OLDSTYLE	0x2	/* reset handler, don't block while handling */
#define SA_RESTART	0x4	/* restart slow syscalls interrupted by sig */

#endif /* NOT _POSIX_SOURCE */


#define SA_NOCLDSTOP	0x8	/* receive SIGCLD only upon a child's death */
				/*=== sigprocmask() operation codes ===*/
#ifndef _POSIX_SOURCE
#define SA_SIGSETSTYLE 	0x80	/* for the SVR3 compatibility */
#endif /* NOT _POSIX_SOURCE */

#define SIG_BLOCK	0	/* add given signals to list of those blocked */
#define SIG_UNBLOCK	1	/* remove given signals from blocked list */
#define SIG_SETMASK	2	/* block (prevent delivery of) given signals */

#define SIG_ERR ((__SIGVOID(*)())-1)    /* error from signal() */
#define SIG_DFL ((__SIGVOID (*)())0)	/* default action */
#define SIG_IGN ((__SIGVOID (*)())1)	/* ignore signal */

#ifndef _POSIX_SOURCE
#define BADSIG  SIG_ERR
#endif /* NOT _POSIX_SOURCE */

#ifndef _KERNEL   /* ::::::::::::::::::::::::::::::::::::::::::::::::::: */
extern int sigaction(), sigprocmask(), sigsuspend();
extern int sigemptyset(), sigaddset(), sigdelset(), sigfillset();
extern int sigismember(), sigpending(), kill();


#ifndef _POSIX_SOURCE
extern int sigstack(), sigreturn(); /* applications shouldn't use sigreturn() */

#define siginitset sigemptyset	/* grunt */

#define SV_INTERRUPT 0x800   /* used by bsd compatibility routines */
#define SV_ONSTACK SA_ONSTACK

#define SIG_STK  SA_ONSTACK
#define SIG_STD  SA_OLDSTYLE	/* RT compatible */
#define sv_onstack sv_flags	/* ditto */


struct sigvec {
	__SIGVOID (*sv_handler)();  /* handler routine */
	int sv_mask;          /* mask while in handler */
	int sv_flags;         /* control flags #defined above */
};


extern int sigvec();        /* BSD/RT compatible sigvec() */
extern int sigblock();      /* BSD/RT compatible sigblock() */
extern int sigsetmask();    /* BSD/RT compatible sigsetmask() */
extern int sigpause();      /* BSD/RT compatible sigpause() */

extern void (*sigset())();/* SVR3 compatible sigset() */
extern int sighold();     /* SVR3 compatible sighold() */
extern int sigrelse();    /* SVR3 compatible sigrelse() */
extern int sigignore();   /* SVR3 compatible sigignore() */
extern void SIG_HOLD(); /* special placeholding library routine used
                           when blocking a signal in SVR3 compatible way */

extern __SIGVOID (*signal())();   /* BSD or SVR3 compatability interface */

extern int siginterrupt();  /* BSD43 compatible siginterrupt() */


#define sigmask(m)  (1L << ((m)-1))  /* signal number --> mask for sigblock */

#endif /* NOT _POSIX_SOURCE */

#endif /* NOT _KERNEL ::::::::::::::::::::::::::::::::::::::::::::::::::::: */

/**********************************************************************
  SIGNAL STACK AND HANDLER CONTEXT INFO
**********************************************************************/

/* Structure used in sigstack call.
 */
#ifndef _POSIX_SOURCE
struct	sigstack {
	char	*ss_sp;			/* signal stack pointer */
	int	ss_onstack;		/* current status */
};
#endif /* NOT _POSIX_SOURCE */


#ifndef _POSIX_SOURCE
/*
 * This  #define is for programs using the small signal interface
 * they only know about the element sc_mask, and only know about
 * the first 32 signals
 */
#define sc_mask	sc_smask.sigs[0]



typedef	struct ksigmask {	/* used in u struct */
	 unsigned long sigs[SIGSETSZ];
} ksigmask_t;


#ifdef  _KERNEL

#define	SIGNUMMASK	0377		/* to extract pure signal number */
#define SIGSPERLONG	32		/* number of signals represented */
					/* in a non-extended signal mask */

#undef sigmask
#define sigmask(m)  (1L << ((m)-1))     /* signal number --> mask */


/* u struct doesn't store 'setsize' field of sigset_t, just the mask words;
 * so we use this macro to make copying masks in and out of a sigset_t
 * easier.  ksigmask_t is used in the kernel only.
 *
 * (The various xxxSIGINMASK macros cleverly work with both sigset_t's
 * and ksigmask_t's, thanks to a not-entirely-accidental similarity of
 * field names.)
 */
#define MASKPART(x) (*((ksigmask_t*)((x).sigs)))



/***************************** Compatibility stuff soon to disappear... **/

#define xsigmask_t ksigmask_t
#define lowsigs sigs[0]
#define highsigs sigs[1]


struct sigvec {
	__SIGVOID (*sv_handler)();	/* handler routine */
	long sv_mask;		/* mask while in handler */
	int sv_flags;		/* control flags #defined above */
};


typedef struct xsigvec {	/* compatability, will disappear soon */
	__SIGVOID (*xsv_handler)();
	ksigmask_t xsv_mask;
	int xsv_flags;
} xsigvec_t;


extern int signew2old();
extern int masknew2old();
extern int maskold2new();

/**********************************************************************/

#endif /* _KERNEL */


/*
 * Macros for testing if a signal is set in an extended signal mask,
 * setting a signal in an extended signal mask, and clearing a signal
 * from an extended signal mask.  32 signals fit into a single long.
 *
 * These macros should NOT be used in new application code.  Applications
 * should use the siginitset(), sigaddset(), sigdelset(), sigfillset(),
 * and sigismember() functions.
 *
 * These SIGIN macros could be faster, but have been recoded this way to
 * pass through the metaware compiler without engendering silly and annoying
 * diagnostics about negative shift values in code which is never executed
 * and which could be elided at compile time in most cases (constant signal
 * numbers).
 *
 * Later... on the 386 the compiler was generating very prolix, slow
 * code for these macros, so assembly language kernel library support has
 * been added.  Perhaps we'll do this for other machines too.
 */

#if defined(_I386)  /* || others? */

#define SIGISINMASK(mask,sig)  _siginmask(&MASKPART(mask),(sig))
#define SETSIGINMASK(mask,sig)  _addinmask(&MASKPART(mask),(sig))
#define CLEARSIGINMASK(mask,sig)  _delinmask(&MASKPART(mask),(sig))

#else /* no library support */

#define SIGISINMASK(mask, sig) \
		((mask).sigs[(sig) > 32 ? 1 : 0] & \
			sigmask((sig) > 32 ? ((sig) - 32) : (sig)))

#define SETSIGINMASK(mask, sig) { \
	(mask).sigs[(sig) > 32 ? 1 : 0] |= \
		sigmask((sig) > 32 ? (sig)-32 : (sig)); \
}

#define CLEARSIGINMASK(mask, sig) { \
	(mask).sigs[(sig) > 32 ? 1 : 0] &= \
		~sigmask((sig) > 32 ? (sig)-32 : (sig)); \
}

#endif /* _I386 */


#define INITSIGMASK(mask) { \
	(mask).sigs[0] = 0L; \
	(mask).sigs[1] = 0L; \
}

#define ALLSIGMASK(mask) { \
	(mask).sigs[0]= 0xffffffffL; \
	(mask).sigs[1]= 0xffffffffL; \
}

#define COPYSIGMASK(mask1, mask2) { \
	(mask1).sigs[0] = (mask2).sigs[0]; \
	(mask1).sigs[1] = (mask2).sigs[1]; \
}

#define ANDSIGMASK(mask1, mask2) { \
	(mask1).sigs[0] &= (mask2).sigs[0]; \
	(mask1).sigs[1] &= (mask2).sigs[1]; \
}

#define AND3SIGMASK(mask0, mask1, mask2) { \
	(mask0).sigs[0] = (mask1).sigs[0]  & (mask2).sigs[0]; \
	(mask0).sigs[1] = (mask1).sigs[1] & (mask2).sigs[1]; \
}

#define ORSIGMASK(mask1, mask2) { \
	(mask1).sigs[0] |= (mask2).sigs[0]; \
	(mask1).sigs[1] |= (mask2).sigs[1]; \
}

#define OR3SIGMASK(mask0, mask1, mask2) { \
	(mask0).sigs[0] = (mask1).sigs[0]  | (mask2).sigs[0]; \
	(mask0).sigs[1] = (mask1).sigs[1] | (mask2).sigs[1]; \
}

#define ANDNOTSIGMASK(mask1, mask2) { \
	(mask1).sigs[0] &= ~((mask2).sigs[0]); \
	(mask1).sigs[1] &= ~((mask2).sigs[1]); \
}

#endif /* NOT _POSIX_SOURCE */

#endif /* NOT _H_SIGNAL */
irst kê,“   $        z  P‰*‘™ˆ*P‰*     bnz  	                  ./usr/include/sys/signet.h h   h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)signet.h	16.4	LCC)	/* Modified: 18:50:35 9/22/89 */
/* SCCSIDPUFF(@(#) signet.h 4.3 LM 00:27:34 6/21/85 C 00:27:41 6/21/85); */

#ifndef _h_SIGNET
#define _h_SIGNET

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif /* ~_h_PARAM */
/*
   Network signaling.
*/
struct nmsignal {
	PADOPEN(Nsig_lt)
	pid_t		Nsig_dlvrto;	/* Pid/pgrp being routed to	*/
	pid_t		Nsig_cpid;	/* Child proc id (SIGCHLD)	*/
	long		Nsig_arg;	/* Kill3(),get/setpgrp() argument */
	pid_t		Nsig_sesid;	/* Session ID */
	PADCLOSE(Nsig_lt, Nsig_ls, Nsig_lu)
#define	nsig_dlvrto	Nsig_lu.Nsig_ls.Nsig_dlvrto
#define	nsig_cpid	Nsig_lu.Nsig_ls.Nsig_cpid
#define	nsig_arg	Nsig_lu.Nsig_ls.Nsig_arg
#define nsig_sesid	Nsig_lu.Nsig_ls.Nsig_sesid
#define	NNSGLONGS	(sizeof(struct Nsig_lt) / sizeof(long))

	PADOPEN(Nsig_st)
	short		Nsig_uid;	/* User id		*/
	short		Nsig_ruid;	/* Real user id		*/
	short		Nsig_sig;	/* Signal number	*/
	siteno_t	Nsig_rrsite;	/* Site to reroute to	*/
	PADCLOSE(Nsig_st, Nsig_ss, Nsig_su)
#define	nsig_uid	Nsig_su.Nsig_ss.Nsig_uid
#define	nsig_ruid	Nsig_su.Nsig_ss.Nsig_ruid
#define	nsig_sig	Nsig_su.Nsig_ss.Nsig_sig
#define	nsig_rrsite	Nsig_su.Nsig_ss.Nsig_rrsite
	/* overlay this field */
#define nsig_killer	nsig_cpid
#define	NNSGSHORTS	(sizeof(struct Nsig_st) / sizeof(short))
};

#ifndef  NOCHECKS
/* If the following statement causes a compiler warning or error,
 * then the length of the nmsignal structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMSG, nmsignal);
#endif  /* ~NOCHECKS */

struct nmggroups {
	PADOPEN(Ng_lt)
	pid_t		Ng_pid;
	pid_t		Ng_sesid;
	pid_t		Ng_pgrp;
	PADCLOSE(Ng_lt, Ng_ls, Ng_lu)
#define ng_pid		Ng_lu.Ng_ls.Ng_pid
#define ng_sesid	Ng_lu.Ng_ls.Ng_sesid
#define ng_pgrp		Ng_lu.Ng_ls.Ng_pgrp
#define GGLONGS	(sizeof(struct Ng_lt) / sizeof(long))
	PADOPEN(Ng_st)
	siteno_t	Ng_rtrysite;
	PADCLOSE(Ng_st, Ng_ss, Ng_su)
#define ng_rtrysite	Ng_su.Ng_ss.Ng_rtrysite
#define GGSHORTS	(sizeof(struct Ng_st) / sizeof(short))
};

struct nminferior {
	PADOPEN(Ninf_lt)
	pid_t		Ninf_cpid;
	pid_t		Ninf_ppid;
	PADCLOSE(Ninf_lt, Ninf_ls, Ninf_lu)
#define	ninf_cpid	Ninf_lu.Ninf_ls.Ninf_cpid
#define	ninf_ppid	Ninf_lu.Ninf_ls.Ninf_ppid
#define	NINFLONGS	(sizeof(struct Ninf_lt) / sizeof(long))

	PADOPEN(Ninf_st)
	siteno_t	Ninf_rtrysite;
	PADCLOSE(Ninf_st, Ninf_ss, Ninf_su)
#define ninf_rtrysite	Ninf_su.Ninf_ss.Ninf_rtrysite
#define	NINFSHORTS	(sizeof(struct Ninf_st) / sizeof(short))
};

#ifndef  NOCHECKS
/* If the following statement causes a compiler warning or error,
 * then the length of the nminferior structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMINF, nminferior);
#endif  /* ~NOCHECKS */

/*
   Structure/definitions for Signal Daemon queue
*/

#define NRMTSIGS 40
		/* Array of remote signal requests for daemon to send.
		   There is probably a better representation for this,
		   such as a flag bit or pointer chain within proc structs. 
		*/

struct rsigreq
{
	pid_t g_dlvrto;	/* pgrp to receive signal at remote sites */
	pid_t g_cpid;	/* child pid (for SIGCHLD) */
	long  g_sig_arg;/* argument for kill3() */
	int   g_sig;	/* the signal: >0 means STOGA, =0 means STOWC */ 
	char  g_type;
};

/* the following defines are necessary because the names are non-unique
 *  in seven characters and are external;
 */
#define	rsigreqs	rsigrqs
#define	rsigreq1	rsigrq1
#define	rsigreqn	rsigrqn

extern struct rsigreq	rsigreqs[];

#endif /* ~_h_SIGNET */
******kê"v   $        X  P‰*®™ˆ*P‰*     %WX  	              Š  ./usr/include/sys/site.h h h   h/*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1988,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)site.h	16.5	LCC)	/* Modified: 13:07:57 12/11/89 */

#ifndef _h_SITE
#define _h_SITE

#ifndef _h_TYPES
#ifdef	KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */

/*
 * There is an entry in the site table for each site in the network.  This
 * table is used to store the status of each site and the messages which
 * are queued to go to that site.
 */
struct site
{
	struct site *si_next_site;	/* next site with work to do */
					/* for a given network interface */
	struct netmsg *si_head;		/* head of "normal" message queue */
	struct netmsg *si_tail;		/* tail of "normal" message queue */
	struct netmsg *si_ack_head;	/* head of "normal" waiting for */
					/* ack queue */
	struct netmsg *si_ack_tail;	/* tail of "normal" waiting for */
					/* ack queue */
	struct netmsg *si_s_head;	/* head of "special" message queue */
	struct netmsg *si_s_tail;	/* tail of "special" message queue */
	struct netmsg *si_SACHD;	/* head of "special" waiting for */
					/* ack queue */
	struct netmsg *si_SACTL;	/* tail of "special" waiting for */
					/* ack queue */
#define si_s_ack_head si_SACHD
#define si_s_ack_tail si_SACTL

	u_long si_Xacknum;		/* next ack number local site needs */
					/* to have acked		   */
	u_long si_Racknum;		/* last ack number we received from */
					/* foreign site that we need to ack */
	u_long si_Hacknum;		/* last ack number that the foreign */
					/* site Has acked		    */
	u_long si_s_Xacknum;		/* next ack number local site needs */
					/* to have acked		   */
	u_long si_s_Racknum;		/* last ack number we received from */
					/* foreign site that we need to ack */
	u_long si_s_Hacknum;		/* last ack number that the foreign */
					/* site Has acked		    */
	time_t	si_time;		/* channel open/close timestamp */
	unsigned short si_channel;	/* channel id */
	unsigned short si_block_size;	/* size of file system block */
	unsigned short si_timeout;	/* count until site transmission    */
					/* will time out		    */
	unsigned short si_max_timeout;	/* maximum timeout value	    */
	unsigned short si_s_timeout;	/* count until site transmission    */
					/* will time out (special)	    */
	unsigned short si_s_max_timeout;/* maximum timeout value (special)  */
	char si_window;			/* maximum number of "normal"	    */
					/* messages to have outstanding     */
	char si_s_window;		/* maximun number of special	    */
					/* messages to have outstanding     */
	char	si_status;		/* status of the site; see below */
	char	si_chanstat;		/* status of the channel; see below */
	char	si_flags;		/* flags that describe that site */
	char	si_retrans;		/* # of retransmissions attempted */
	char	si_max_retrans;		/* greatest # of retries to attempt */
	netno_t si_net;			/* which network it is on */
	u_long	si_last_ticks;		/* bootticks at last input */
	union {
		struct loc_larp_info *siu_larp;	/* Address resolution data */
		char	*siu_ptr;	/* pointer to network specific data */
		char	siu_array[sizeof(char *)];
	} si_netun;
#define	si_larp		si_netun.siu_larp
#define si_netspecp	si_netun.siu_ptr
#define si_netspeca	si_netun.siu_array
	struct netmsg *si_nmp;		/* reserved net message for CHOPENs */
					/* and NOPs			    */
	char	si_max_ackwait;		/* longest wait before sending ack  */
	char	si_ackwait;		/* how long before sending ack	    */
/* following fields used to react to QUENCH messages */
	long	si_quenched;		/* quench for this many ticks */
};

/*
 * status flags for si_status
 */
#define SI_DOWN		0x00
#define SI_UP		0x01
#define SI_IGNORE	0x10

/*
 * status flags for si_chanstat
 */
#define CHN_CLOSED	0
#define CHN_ATTEMPT	1
#define CHN_HOPEN	2
#define CHN_OPEN	3

/*
 * Site description in si_flags
 */

#define SI_SLOW		0x01	/* There is a slow link to get there */
#define SI_ONQUEUE	0x02	/* site is on network queue */
#define SI_NEEDS_NACK	0x04	/* should send a NACK (NOP w/ nack flag) */
#define SI_RETRANSSPECIAL 0x08  /* si_trans is counting retransmission of
				   special messages rather than non-special */
#define SI_NEEDS_QUENCH	0x10	/* should send a QUENCH (NOP w/ quench flag) */
#define SI_NEEDS_ACK	0x20	/* should send immediate normal NOP ack */
#define SI_NEEDS_S_ACK	0x40	/* should send immediate special NOP ack */
#define SI_CHECKSUM	0x80	/* msgs to this site should be checksummed */

#ifdef KERNEL
extern	struct site site[];
#endif /* KERNEL */

#endif /* ~_h_SITE */
kê(´ «  $        ¡  `‰*C–ˆ*`‰*     TÃ¡  
              ‹¶  ./usr/include/sys/socket.h h   h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)socket.h	16.3	LCC)	/* Modified: 19:26:57 9/15/89 */

#if ! defined(_h_SOCKET)
#define _h_SOCKET
/*
 * Copyright (c) 1982,1985, 1986 Regents of the University of California.
 * All rights reserved.  The Berkeley software License Agreement
 * specifies the terms and conditions for redistribution.
 *
 *	@(#)socket.h	7.1 (Berkeley) 6/4/86
 */

/*
 * Definitions related to sockets: types, address families, options.
 */

/*
 * Types
 */
#define	SOCK_STREAM	1		/* stream socket */
#define	SOCK_DGRAM	2		/* datagram socket */
#define	SOCK_RAW	3		/* raw-protocol interface */
#define	SOCK_RDM	4		/* reliably-delivered message */
#define	SOCK_SEQPACKET	5		/* sequenced packet stream */

/*
 * Option flags per-socket.
 */
#define	SO_DEBUG	0x0001		/* turn on debugging info recording */
#define	SO_ACCEPTCONN	0x0002		/* socket has had listen() */
#define	SO_REUSEADDR	0x0004		/* allow local address reuse */
#define	SO_KEEPALIVE	0x0008		/* keep connections alive */
#define	SO_DONTROUTE	0x0010		/* just use interface addresses */
#define	SO_BROADCAST	0x0020		/* permit sending of broadcast msgs */
#define	SO_USELOOPBACK	0x0040		/* bypass hardware when possible */
#define	SO_LINGER	0x0080		/* linger on close if data present */
#define	SO_OOBINLINE	0x0100		/* leave received OOB data in line */

/*
 * Additional options, not kept in so_options.
 */
#define SO_SNDBUF	0x1001		/* send buffer size */
#define SO_RCVBUF	0x1002		/* receive buffer size */
#define SO_SNDLOWAT	0x1003		/* send low-water mark */
#define SO_RCVLOWAT	0x1004		/* receive low-water mark */
#define SO_SNDTIMEO	0x1005		/* send timeout */
#define SO_RCVTIMEO	0x1006		/* receive timeout */
#define	SO_ERROR	0x1007		/* get error status and clear */
#define	SO_TYPE		0x1008		/* get socket type */

/*
 * Structure used for manipulating linger option.
 */
struct	linger {
	int	l_onoff;		/* option on/off */
	int	l_linger;		/* linger time */
};

/*
 * Level number for (get/set)sockopt() to apply to socket itself.
 */
#define	SOL_SOCKET	0xffff		/* options for socket level */

/*
 * Address families.
 */
#define	AF_UNSPEC	0		/* unspecified */
#define	AF_UNIX		1		/* local to host (pipes, portals) */
#define	AF_INET		2		/* internetwork: UDP, TCP, etc. */
#define	AF_IMPLINK	3		/* arpanet imp addresses */
#define	AF_PUP		4		/* pup protocols: e.g. BSP */
#define	AF_CHAOS	5		/* mit CHAOS protocols */
#define	AF_NS		6		/* XEROX NS protocols */
#define	AF_NBS		7		/* nbs protocols */
#define	AF_ECMA		8		/* european computer manufacturers */
#define	AF_DATAKIT	9		/* datakit protocols */
#define	AF_CCITT	10		/* CCITT protocols, X.25 etc */
#define	AF_SNA		11		/* IBM SNA */
#define AF_DECnet	12		/* DECnet */
#define AF_DLI		13		/* Direct data link interface */
#define AF_LAT		14		/* LAT */
#define	AF_HYLINK	15		/* NSC Hyperchannel */
#define	AF_APPLETALK	16		/* Apple Talk */
#define	AF_ARP		17		/* Address Resolution Protocol */

#define	AF_MAX		18

/*
 * Structure used by kernel to store most
 * addresses.
 */
struct sockaddr {
	u_short	sa_family;		/* address family */
	char	sa_data[14];		/* up to 14 bytes of direct address */
};

/*
 * Structure used by kernel to pass protocol
 * information in raw sockets.
 */
struct sockproto {
	u_short	sp_family;		/* address family */
	u_short	sp_protocol;		/* protocol */
};

/*
 * Protocol families, same as address families for now.
 */
#define	PF_UNSPEC	AF_UNSPEC
#define	PF_UNIX		AF_UNIX
#define	PF_INET		AF_INET
#define	PF_IMPLINK	AF_IMPLINK
#define	PF_PUP		AF_PUP
#define	PF_CHAOS	AF_CHAOS
#define	PF_NS		AF_NS
#define	PF_NBS		AF_NBS
#define	PF_ECMA		AF_ECMA
#define	PF_DATAKIT	AF_DATAKIT
#define	PF_CCITT	AF_CCITT
#define	PF_SNA		AF_SNA
#define PF_DECnet	AF_DECnet
#define PF_DLI		AF_DLI
#define PF_LAT		AF_LAT
#define	PF_HYLINK	AF_HYLINK
#define	PF_APPLETALK	AF_APPLETALK
#define	PF_ARP		AF_ARP

#define	PF_MAX		AF_MAX

/*
 * Maximum queue length specifiable by listen.
 */
#define	SOMAXCONN	5

/*
 * Message header for recvmsg and sendmsg calls.
 */
struct msghdr {
	caddr_t	msg_name;		/* optional address */
	int	msg_namelen;		/* size of address */
	struct	iovec *msg_iov;		/* scatter/gather array */
	int	msg_iovlen;		/* # elements in msg_iov */
	caddr_t	msg_accrights;		/* access rights sent/received */
	int	msg_accrightslen;
};

#define	MSG_OOB		0x1		/* process out-of-band data */
#define	MSG_PEEK	0x2		/* peek at incoming message */
#define	MSG_DONTROUTE	0x4		/* send without using routing tables */

#define	MSG_MAXIOVLEN	16

#endif /* ! defined(_h_SOCKET) */
ess famkêàs ª  $        õ  `‰*D–ˆ*`‰*     ³eõ  	              ·g  ./usr/include/sys/socketvar.h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)socketvar.h	16.3	LCC)	/* Modified: 19:27:48 9/15/89 */

/*
 * Copyright (c) 1982, 1986 Regents of the University of California.
 * All rights reserved.  The Berkeley software License Agreement
 * specifies the terms and conditions for redistribution.
 *
 *	@(#)socketvar.h	7.1 (Berkeley) 6/4/86
 */

/*
 * Kernel structure per socket.
 * Contains send and receive buffer queues,
 * handle on protocol and pointer to protocol
 * private data and error information.
 */
struct socket {
	short	so_type;		/* generic type, see socket.h */
	short	so_options;		/* from socket call, see socket.h */
	short	so_linger;		/* time to linger while closing */
	short	so_state;		/* internal state flags SS_*, below */
	caddr_t	so_pcb;			/* protocol control block */
	struct	protosw *so_proto;	/* protocol handle */
/*
 * Variables for connection queueing.
 * Socket where accepts occur is so_head in all subsidiary sockets.
 * If so_head is 0, socket is not related to an accept.
 * For head socket so_q0 queues partially completed connections,
 * while so_q is a queue of connections ready to be accepted.
 * If a connection is aborted and it has so_head set, then
 * it has to be pulled out of either so_q0 or so_q.
 * We allow connections to queue up based on current queue lengths
 * and limit on number of queued connections for this socket.
 */
	struct	socket *so_head;	/* back pointer to accept socket */
	struct	socket *so_q0;		/* queue of partial connections */
	short	so_q0len;		/* partials on so_q0 */
	struct	socket *so_q;		/* queue of incoming connections */
	short	so_qlen;		/* number of connections on so_q */
	short	so_qlimit;		/* max number queued connections */
/*
 * Variables for socket buffering.
 */
	struct	sockbuf {
		u_short	sb_cc;		/* actual chars in buffer */
		u_short	sb_hiwat;	/* max actual char count */
		u_short	sb_mbcnt;	/* chars of mbufs used */
		u_short	sb_mbmax;	/* max chars of mbufs to use */
		u_short	sb_lowat;	/* low water mark (not used yet) */
		short	sb_timeo;	/* timeout (not used yet) */
		struct	mbuf *sb_mb;	/* the mbuf chain */
		struct	proc *sb_sel;	/* process selecting read/write */
		short	sb_flags;	/* flags, see below */
	} so_rcv, so_snd;
#define	SB_MAX		65535L		/* max chars in sockbuf */
#define	SB_LOCK		0x01		/* lock on data queue (so_rcv only) */
#define	SB_WANT		0x02		/* someone is waiting to lock */
#define	SB_WAIT		0x04		/* someone is waiting for data/space */
#define	SB_SEL		0x08		/* buffer is selected */
#define	SB_COLL		0x10		/* collision selecting */
	short	so_timeo;		/* connection timeout */
	u_short	so_error;		/* error affecting connection */
	u_short	so_oobmark;		/* chars to oob mark */
	pid_t	so_pgrp;		/* pgrp for signals */
};

/*
 * Socket state bits.
 */
#define	SS_NOFDREF		0x001	/* no file table ref any more */
#define	SS_ISCONNECTED		0x002	/* socket connected to a peer */
#define	SS_ISCONNECTING		0x004	/* in process of connecting to peer */
#define	SS_ISDISCONNECTING	0x008	/* in process of disconnecting */
#define	SS_CANTSENDMORE		0x010	/* can't send more data to peer */
#define	SS_CANTRCVMORE		0x020	/* can't receive more data from peer */
#define	SS_RCVATMARK		0x040	/* at mark on input */

#define	SS_PRIV			0x080	/* privileged for broadcast, raw... */
#define	SS_NBIO			0x100	/* non-blocking ops */
#define	SS_ASYNC		0x200	/* async i/o notify */


/*
 * Macros for sockets and socket buffering.
 */

/* how much space is there in a socket buffer (so->so_snd or so->so_rcv) */
#define	sbspace(sb) \
    (MIN((long)((sb)->sb_hiwat - (sb)->sb_cc),\
	 (long)((sb)->sb_mbmax - (sb)->sb_mbcnt)))

/* do we have to send all at once on a socket? */
#define	sosendallatonce(so) \
    ((so)->so_proto->pr_flags & PR_ATOMIC)

/* can we read something from so? */
#define	soreadable(so) \
    ((so)->so_rcv.sb_cc || ((so)->so_state & SS_CANTRCVMORE) || \
	(so)->so_qlen || (so)->so_error)

/* can we write something to so? */
#define	sowriteable(so) \
    (sbspace(&(so)->so_snd) > 0 && \
	(((so)->so_state&SS_ISCONNECTED) || \
	  ((so)->so_proto->pr_flags&PR_CONNREQUIRED)==0) || \
     ((so)->so_state & SS_CANTSENDMORE) || \
     (so)->so_error)

/* adjust counters in sb reflecting allocation of m */
#define	sballoc(sb, m) { \
	(sb)->sb_cc += (m)->m_len; \
	(sb)->sb_mbcnt += MSIZE; \
	if ((m)->m_off > MMAXOFF) \
		(sb)->sb_mbcnt += CLBYTES; \
}

/* adjust counters in sb reflecting freeing of m */
#define	sbfree(sb, m) { \
	(sb)->sb_cc -= (m)->m_len; \
	(sb)->sb_mbcnt -= MSIZE; \
	if ((m)->m_off > MMAXOFF) \
		(sb)->sb_mbcnt -= CLBYTES; \
}

/* set lock on sockbuf sb */
#define sblock(sb) { \
	while ((sb)->sb_flags & SB_LOCK) { \
		(sb)->sb_flags |= SB_WANT; \
		sleep((caddr_t)&(sb)->sb_flags, PZERO+1); \
	} \
	(sb)->sb_flags |= SB_LOCK; \
}

/* release lock on sockbuf sb */
#define	sbunlock(sb) { \
	(sb)->sb_flags &= ~SB_LOCK; \
	if ((sb)->sb_flags & SB_WANT) { \
		(sb)->sb_flags &= ~SB_WANT; \
		wakeup((caddr_t)&(sb)->sb_flags); \
	} \
}

#define	sorwakeup(so)	sowakeup((so), &(so)->so_rcv)
#define	sowwakeup(so)	sowakeup((so), &(so)->so_snd)

#ifdef KERNEL
struct	socket *sonewconn();
#endif
0 qkêìß   $          P‰*’™ˆ*P‰*     ›“  	              ¦“  ./usr/include/sys/stat.h ar.h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */


#ifndef _POSIX_SOURCE
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)stat.h	16.7       LCC)    /* Modified: 19:52:20 1/11/90 */
#endif /* NOT _POSIX_SOURCE */

#ifndef _H_STAT
#define _H_STAT

#include <sys/types.h>

struct stat
{
	dev_t       st_dev;
	ino_t       st_ino;
	mode_t      st_mode;
	nlink_t     st_nlink;
	u_short_t   st_spare0;
	uid_t       st_uid;
	gid_t       st_gid;
	dev_t       st_rdev;
	off_t       st_size;
	time_t      st_atime;
	u_long_t    st_spare1;
	time_t      st_mtime;
	u_long_t    st_spare2;
	time_t      st_ctime;
	u_long_t    st_spare3;
	u_long_t    st_blksize;
	u_long_t    st_blocks;
	u_long_t    st_gen;
	u_long_t    st_type;
	u_long_t    st_vfs;
	u_long_t    st_flag;
	u_long_t    st_cmtcnt;
	fstore_t    st_fstore;
	u_long_t    st_version;
	siteno_t    st_css;
	siteno_t    st_ss;
	siteno_t    st_rdevsite;
	short       st_spare4;
	long        st_nid;
	uid_t       st_uid_raw;
	gid_t       st_gid_raw;
	u_long_t    st_uid_rev_tag;
	u_long_t    st_gid_rev_tag;
};

#ifndef _POSIX_SOURCE

/*
 * Type definitions
 */
#define	VNON	0
#define VBAD	1
#define VREG	2
#define VDIR	3	
#define VHDIR	4
#define VBLK	5
#define VCHR	6
#define VLNK	7
#define VSOCK	8
#define VFIFO	9
#define	VMPC	10

/*
 * Defines to tell whether or not a file or directory
 * is mounted upon, and whether it is local or remote.
 */
#define	FS_NOFLAG	0x0		/* Clear flag		*/
#define FS_VMP		0x1		/* Virtual mount point	*/
#define FS_REMOTE	0x2		/* Remote file primary copy
					 * not local */
#define FS_MOUNT	FS_VMP
#define FS_SHORT	0x4000

#define STATSIZE \
 (((int)(char *)&(((struct stat *)0)->st_spare4)) + (sizeof(short)))

/*
 * Definitions for rev_tags
 */
#define	IDTAG_CALLER	1
#define	IDTAG_OTHER	2
#define	IDTAG_SOMEONE	3
#define	IDTAG_NO_ONE	4

#define FULLSTATSIZE \
 (((int)(char *)&(((struct stat *)0)->st_gid_rev_tag)) + (sizeof(u_long)))

#define STX_LINK	0x0001
#define STX_MOUNT	0x0002
#define STX_HIDDEN	0x0004
#define STX_TRANS	0x0000
#define STX_TRANS_NONE	0x0008
#define STX_TRANS_OTHER	0x0010

#endif /* ! _POSIX_SOURCE */

#define	_S_IFMT   0x3000f000	/* type of file */
#define	_S_IFDIR  0x4000	/* directory */
#define S_ISDIR(m) (((m) & (_S_IFMT)) == (_S_IFDIR))
#define	_S_IFCHR  0x2000	/* character special */
#define S_ISCHR(m) (((m) & (_S_IFMT)) == (_S_IFCHR))
#define	_S_IFBLK  0x6000	/* block special */
#define S_ISBLK(m) (((m) & (_S_IFMT)) == (_S_IFBLK))
#define	_S_IFREG  0x8000	/* regular */
#define S_ISREG(m) (((m) & (_S_IFMT)) == (_S_IFREG))
#define	_S_IFIFO  0x1000	/* named pipe */
#define S_ISFIFO(m) (((m) & (_S_IFMT)) == (_S_IFIFO))

#ifndef _POSIX_SOURCE
#define	S_IFMT	_S_IFMT
#define	S_IFDIR	_S_IFDIR
#define	S_IFCHR	_S_IFCHR
#define	S_IFBLK	_S_IFBLK
#define	S_IFREG	_S_IFREG
#define	S_IFIFO	_S_IFIFO

#define	S_IFLNK 0xa000  	/* symbolic link */
#define S_ISLNK(m) (((m) & (S_IFMT)) == (S_IFLNK))
#define S_IFSOCK 0xc000		/* named socket */
#define S_ISSOCK(m) (((m) & (S_IFMT)) == (S_IFSOCK))
#define S_IFMPX (S_IFCHR|S_ISVTX)  /* multiplex character special file */
#define S_ISMPX(m) (((m) & (S_IFMT|S_ISVTX)) == (S_IFMPX))
#define S_IHIDDEN 0x8000000	/* hidden directory */
#define S_ISHIDDEN(m) (((m) & (S_IFMT|S_IHIDDEN)) == (S_IFDIR|S_IHIDDEN))

#endif /* ! _POSIX_SOURCE */


#define	S_ISUID	 04000		/* set user id on execution */
#define	S_ISGID	 02000		/* set group id on execution */

#ifndef _POSIX_SOURCE
#define S_ENFMT  S_ISGID        /* record locking enforcement flag */
#define	S_ISVTX	 01000		/* save swapped text even after use */
#define	S_IREAD	 00400		/* read permission, owner */
#define	S_IWRITE 00200		/* write permission, owner */
#define	S_IEXEC	 00100		/* execute/search permission, owner */

/*  /usr/group definitions  */
#define S_PERM	 00777		/* all permission fields */
#endif /* ! _POSIX_SOURCE */

#define S_IRWXU  00700          /* read,write,execute permission: owner */
#define S_IRUSR  00400          /* read permission: owner */
#define S_IWUSR  00200          /* write permission: owner */
#define S_IXUSR  00100          /* execute/search permission: owner */
#define S_IRWXG  00070          /* read,write,execute permission: group */
#define S_IRGRP  00040          /* read permission: group */
#define S_IWGRP  00020          /* write permission: group */
#define S_IXGRP  00010          /* execute/search permission: group */
#define S_IRWXO  00007          /* read,write,execute permission: other */
#define S_IROTH  00004          /* read permission: other */
#define S_IWOTH  00002          /* write permission: other */
#define S_IXOTH  00001          /* execute/search permission: other */

#ifndef _KERNEL
extern mode_t umask();                              
extern int mkdir(), mkfifo(), stat(), fstat(), chmod();
#endif	/* !_KERNEL */

#endif /* ~_H_STAT */
 kê.   $        b  Q‰*’™ˆ*Q‰*     •eb  	                  ./usr/include/sys/stermio.h h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)stermio.h	16.4	LCC)	/* Modified: 18:52:59 9/22/89 */
/* <@(#)stermio.h	6.1> */
/*      @(#)stermio.h	5.1 u370  source        */
/*
 * ioctl commands for control channels
 */
#define STSTART		1	/* start protocol */
#define STHALT		2	/* cease protocol */
#define STPRINT		3	/* assign device to printer */
#ifndef u370
#define STENABLE	4	/* enable polling */
#define STDISABLE	5	/* disable polling */
#define STPOLL		6	/* set polling rate */
#define STCNTRS		7	/* poke for status reports */
#define STTCHAN		8	/* set trace channel number */
#endif /* ~u370 */

/*
 * ioctl commands for terminal and printer channels
 */
#define STGET	(('X'<<8)|0)	/* get line options */
#define STSET	(('X'<<8)|1)	/* set line options */
#define	STTHROW	(('X'<<8)|2)	/* throw away queued input */
#define	STWLINE	(('X'<<8)|3)	/* get synchronous line # */
#ifndef u370
#define STTSV	(('X'<<8)|4)	/* get all line information */
#endif /* ~u370 */

struct stio {
	unsigned short	ttyid;
	char		row;
	char		col;
	char		orow;
	char		ocol;
	char		tab;
	char		aid;
	char		ss1;
	char		ss2;
	unsigned short	imode;
	unsigned short	lmode;
	unsigned short	omode;
};

/*
**	Mode Definitions.
*/
#define	STFLUSH	00400	/* FLUSH mode; lmode */
#define	STWRAP	01000	/* WRAP mode; lmode */
#define	STAPPL	02000	/* APPLICATION mode; lmode */

#ifndef  u370

struct sttsv {
	char	st_major;
	short	st_pcdnum;
	char	st_devaddr;
	int	st_csidev;
};

struct stcntrs {
	char	st_lrc;
	char	st_xnaks;
	char	st_rnaks;
	char	st_xwaks;
	char	st_rwaks;
	char	st_scc;
};

/* trace message definitions */

#define LOC	113	/* loss of carrier */
#endif /* ~u370 */
ns forkêe 
  $        &	  Q‰*’™ˆ*Q‰*     «ˆ&	  	                  ./usr/include/sys/storclass.h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)storclass.h	16.4	LCC)	/* Modified: 18:53:33 9/22/89 */
/* SCCSIDPUFF(@(#) storclass.h 4.1 LM 12:57:20 4/23/85 C 22:13:29 4/23/85); */

#ifndef	_h_STORCLASS
#define	_h_STORCLASS

/*	@(#)storclass.h	2.1	*/
/*
 *   STORAGE CLASSES
 */

#define  C_EFCN          -1    /* physical end of function */
#define  C_NULL          0
#define  C_AUTO          1     /* automatic variable */
#define  C_EXT           2     /* external symbol */
#define  C_STAT          3     /* static */
#define  C_REG           4     /* register variable */
#define  C_EXTDEF        5     /* external definition */
#define  C_LABEL         6     /* label */
#define  C_ULABEL        7     /* undefined label */
#define  C_MOS           8     /* member of structure */
#define  C_ARG           9     /* function argument */
#define  C_STRTAG        10    /* structure tag */
#define  C_MOU           11    /* member of union */
#define  C_UNTAG         12    /* union tag */
#define  C_TPDEF         13    /* type definition */
#define  C_USTATIC       14    /* undefined static */
#define  C_ENTAG         15    /* enumeration tag */
#define  C_MOE           16    /* member of enumeration */
#define  C_REGPARM       17    /* register parameter */
#define  C_FIELD         18    /* bit field */
#define  C_WKEXT         20    /* Fortran weak extern  */
#define  C_BLOCK         100   /* ".bb" or ".eb" */
#define  C_FCN           101   /* ".bf" or ".ef" */
#define  C_EOS           102   /* end of structure */
#define  C_FILE          103   /* file name */

        /*
         * The following storage class is a "dummy" used only by STS
         * for line number entries reformatted as symbol table entries
         */

#define  C_LINE          104
#define  C_ALIAS         105   /* duplicate tag */
#define  C_HIDDEN        106   /* special storage class for external */
                               /* symbols in dmert public libraries  */
#define  C_ENDINIT       107   /* special storage class for .bei and	*/
			       /* .fei sdb information			*/

#endif /* ~_h_STORCLASS */
#dkê*š ª  ÿ¡             x‰*x‰*x‰*          	                  ./usr/include/sys/svc.h ../rpc/svc.h /sykêÀÞ ¨  ÿ¡             x‰*x‰*x‰*          	                  ./usr/include/sys/svc_auth.h   h../rpc/svc_auth.h svc_aukêf³ 	  $        (  Q‰*“™ˆ*Q‰*     §“(  	                  ./usr/include/sys/svrproc.h    h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)svrproc.h	16.4	LCC)	/* Modified: 18:54:11 9/22/89 */
/* SCCSIDPUFF(@(#) svrproc.h 4.1 LM 12:57:29 4/23/85 C 22:13:30 4/23/85); */

#ifndef _h_SVRPROC
#define _h_SVRPROC

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */

/* table for server processes 
	indicating what sequence and sequence
	type they are processing */

struct sp_tab      {      
	struct sp_tab *sp_next; /* doubly linked list of busy/free svrprocs */
	struct sp_tab *sp_prev;

	struct netmsg *sp_nmp;	/* request buffer to process */
				/* Used to avoid search at wakeup. */
	funcp_t	sp_seqf;	/* sequence type, used only for comparisons,
				 * never called */
	long	sp_seq;		/* sequence being processed by a svrproc */
	char	sp_stat;	/* current status of server (see below) */
	char	sp_nmtype;	/* for debugging only */
};

					/* Values of sp_stat		*/
#define	SP_NOPROC	0		/* Svrproc does not exist	*/
#define SP_IDLE		1		/* Svrproc exists and is idle	*/
#define SP_BUSY		2		/* Svrproc exists and is active	*/
#define SP_LONGSLEEP	3		/* Svrproc is interruptible */
#define SP_STARTSVR	4		/* Svrproc newly created */

#ifdef KERNEL
extern  struct sp_tab sp_tab[];  /* the actual table */
#endif /* KERNEL */

#endif /* ~_h_SVRPROC */
kêTY r  $        J  h‰*µ™ˆ*h‰*       J  
                  ./usr/include/sys/swap.h .h    h/*
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1990 IBM Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)swap.h	1.2	LCC)	/* Modified: 14:17:49 11/20/90 */

#ifdef  _I386
#include  <sys/i386/swap.h>
#endif

#ifdef  _U370
#include  <sys/b370/swap.h>
#endif
89 */
kêF¹   $        †  Q‰*“™ˆ*Q‰*     £“†  	                  ./usr/include/sys/syconf.h     h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)syconf.h	16.4	LCC)	/* Modified: 18:54:48 9/22/89 */
/*
 * device driver configuration header file for sy.c
 *
 * This module is included by conf.c and is responsible for allocating
 * all data structures required by the device driver.  Three device
 * specific pre-processor defined symbols are available for our use:
 *
 *	B_xyz		block major device number (if any)
 *	C_xyz		character major device number (if any)
 *	N_xyz		number of configured controllers
 *	U_xyz		number of configured sub-units
 *
 * (where "xyz" is the device driver prefix)
 *
 */

int	sy_cmaj = C_sy;		/* need to know our major device number */
atkê†i   $        5  Q‰*”™ˆ*Q‰*     u–5  	              £  ./usr/include/sys/syms.h h     h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)syms.h	16.3	LCC)	/* Modified: 19:15:36 9/16/89 */
/* SCCSIDPUFF(@(#) syms.h 4.2 LM 00:28:13 6/21/85 C 00:28:19 6/21/85); */
/*	@(#)syms.h	2.4 2/28/83	*/

#ifndef	_h_SYMS
#define	_h_SYMS

/*		Storage Classes are defined in storclass.h  */
#include "storclass.h"

#ifndef SYMNMLEN
#define  SYMNMLEN	8	/*  Number of characters in a symbol name */
#endif /* ! SYMNMLEN */
#define  FILNMLEN	14	/*  Number of characters in a file name */
#define  DIMNUM		4	/*  Number of array dimensions in aux entry */

struct syment
{
	union
	{
		char		_n_name[SYMNMLEN];	/* old COFF version */
		struct
		{
			long	_n_zeroes;	/* new == 0 */
			long	_n_offset;	/* offset into string table */
		} _n_n;
		char		*_n_nptr[2];	/* allows for overlaying */
	} _n;
	unsigned
	long			n_value;	/* value of symbol */
	short			n_scnum;	/* section number */
	unsigned short		n_type;		/* type and derived type */
	char			n_sclass;	/* storage class */
	char			n_numaux;	/* number of aux. entries */
};
	
	
	
/*	This define causes major problems in "nlist.c" from libc.a */
#define n_name		_n._n_name
/**/
#define n_nptr		_n._n_nptr[1]
#define n_zeroes	_n._n_n._n_zeroes
#define n_offset	_n._n_n._n_offset

/*
   Relocatable symbols have a section number of the
   section in which they are defined.  Otherwise, section
   numbers have the following meanings:
*/
        /* undefined symbol */
#define  N_UNDEF	0
        /* value of symbol is absolute */
#define  N_ABS		-1
        /* special debugging symbol -- value of symbol is meaningless */
#define  N_DEBUG	-2
	/* indicates symbol needs transfer vector (preload) */
#define  N_TV		(unsigned short)-3

	/* indicates symbol needs transfer vector (postload) */

#define  P_TV		(unsigned short)-4

/*
   The fundamental type of a symbol packed into the low 
   4 bits of the word.
*/

#define  _EF	".ef"

#define  T_NULL     0
#define  T_ARG      1          /* function argument (only used by compiler) */
#define  T_CHAR     2          /* character */
#define  T_SHORT    3          /* short integer */
#define  T_INT      4          /* integer */
#define  T_LONG     5          /* long integer */
#define  T_FLOAT    6          /* floating point */
#define  T_DOUBLE   7          /* double word */
#define  T_STRUCT   8          /* structure  */
#define  T_UNION    9          /* union  */
#define  T_ENUM     10         /* enumeration  */
#define  T_MOE      11         /* member of enumeration */
#define  T_UCHAR    12         /* unsigned character */
#define  T_USHORT   13         /* unsigned short */
#define  T_UINT     14         /* unsigned integer */
#define  T_ULONG    15         /* unsigned long */

/*
 * derived types are:
 */

#define  DT_NON      0          /* no derived type */
#define  DT_PTR      1          /* pointer */
#define  DT_FCN      2          /* function */
#define  DT_ARY      3          /* array */

/*
 *   type packing constants
 */

#define  N_BTMASK     017
#define  N_TMASK      060
#define  N_TMASK1     0300
#define  N_TMASK2     0360
#define  N_BTSHFT     4
#define  N_TSHIFT     2

/*
 *   MACROS
 */

	/*   Basic Type of  x   */

#define  BTYPE(x)  ((x) & N_BTMASK)

	/*   Is  x  a  pointer ?   */

#define  ISPTR(x)  (((x) & N_TMASK) == (DT_PTR << N_BTSHFT))

	/*   Is  x  a  function ?  */

#define  ISFCN(x)  (((x) & N_TMASK) == (DT_FCN << N_BTSHFT))

	/*   Is  x  an  array ?   */

#define  ISARY(x)  (((x) & N_TMASK) == (DT_ARY << N_BTSHFT))

	/* Is x a structure, union, or enumeration TAG? */

#define ISTAG(x)  ((x)==C_STRTAG || (x)==C_UNTAG || (x)==C_ENTAG)

#define  INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(DT_PTR<<N_BTSHFT)|(x&N_BTMASK))

#define  DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))

/*
 *	AUXILIARY ENTRY FORMAT
 */

union auxent
{
	struct
	{
		long		x_tagndx;	/* str, un, or enum tag indx */
		union
		{
			struct
			{
				unsigned short	x_lnno;	/* declaration line number */
				unsigned short	x_size;	/* str, union, array size */
			} x_lnsz;
			long	x_fsize;	/* size of function */
		} x_misc;
		union
		{
			struct			/* if ISFCN, tag, or .bb */
			{
				long	x_lnnoptr;	/* ptr to fcn line # */
				long	x_endndx;	/* entry ndx past block end */
			} 	x_fcn;
			struct			/* if ISARY, up to 4 dimen. */
			{
				unsigned short	x_dimen[DIMNUM];
			} 	x_ary;
		}		x_fcnary;
		unsigned short  x_tvndx;		/* tv index */
	} 	x_sym;
	struct
	{
		char	x_fname[FILNMLEN];
	} 	x_file;
        struct
        {
                long    x_scnlen;          /* section length */
                unsigned short  x_nreloc;  /* number of relocation entries */
                unsigned short  x_nlinno;  /* number of line numbers */
        }       x_scn;
		
	struct
	{
		long		x_tvfill;	/* tv fill value */
		unsigned short	x_tvlen;	/* length of .tv */
		unsigned short	x_tvran[2];	/* tv range */
	}	x_tv;	/* info about .tv section (in auxent of symbol .tv)) */
};
		
#define	SYMENT	struct syment
#define	SYMESZ	18	/* sizeof(SYMENT) */
		
#define	AUXENT	union auxent
#define	AUXESZ	18	/* sizeof(AUXENT) */
		
/*	Defines for "special" symbols   */
		
	
	
	
#ifdef vax
#define _ETEXT	"_etext"
#define	_EDATA	"_edata"
#define	_END	"_end"
#else
#define _ETEXT	"etext"
#define _EDATA	"edata"
#define _END	"end"
#endif

#ifdef u370
#define _START	"_crt0"
#else
#define _START	"_start"
#endif

#define _TVORIG		"_tvorig"
#define _TORIGIN	"_torigin"
#define _DORIGIN	"_dorigin"
	
#define _SORIGIN	"_sorigin"
#endif /* ~_h_SYMS */
llokê¤c   $        ý  R‰*–™ˆ*R‰*     î”ý  	              žž  ./usr/include/sys/sysinfo.h    h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)sysinfo.h	16.3	LCC)	/* Modified: 19:16:28 9/16/89 */

#ifndef	_h_SYSINFO
#define	_h_SYSINFO

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */
/* @(#)sysinfo.h	1.1 */
struct sysinfo {
	time_t	cpu[4];
#define	CPU_IDLE	0
#define	CPU_USER	1
#define	CPU_KERNEL	2
#define	CPU_WAIT	3

	time_t	wait[3];
#define	W_IO	0
#define	W_SWAP	1
#define	W_PIO	2
	long	bread;		/* number of reads into buffer cache	*/
	long	bwrite;		/* number of writes into buffer cache	*/
	long	lread;		/* logical reads from buffer cache	*/
	long	lwrite;		/* logical writes into buffer cache	*/
	long	phread;		/* phyical reads from mass storage	*/
	long	phwrite;	/* phyical writes to mass storage	*/
	long	swapin;
	long	swapout;
	long	bswapin;
	long	bswapout;
	long	pswitch;	/* number of calls to swtch		*/
	long	syscall;	/* total number of system calls		*/
	long	sysread;	/* number of read system calls		*/
	long	syswrite;	/* number of write system calls		*/
	long	sysfork;	/* number of fork system calls		*/
	long	sysexec;	/* number of exec system calls		*/
	long	runque;		/* number of jobs on runque		*/
	long	runocc;		/* number of updates to runque		*/
	long	swpque;		/* number of elements on swap queue	*/
	long	swpocc;		/* number of updates to swpque		*/
	long	iget;		/* number of calls to iget		*/
	long	namei;		/* number of calls to namei		*/
	long	dirblk;		/* number of directory blocks read	*/
	long	readch;		/* number of characters read		*/
	long	writech;	/* number of characters written		*/
	long	rcvint;		/* number of receive interrupts		*/
	long	xmtint;		/* number of transmit interrupts	*/
	long	mdmint;		/* number of modem interrupts		*/
	long	rawch;		/* number of raw characters		*/
	long	canch;		/* number of cannonicalized characters	*/
	long	outch;		/* number of characters output to tty	*/
	long	msg;		/* SYS5IPC				*/
	long	sema;		/* SYS5IPC				*/
#ifdef	u370
/*   IH ADDITIONS  */

	long	ticks;		/* elapsed time				*/
#endif  /* (u370) End of IX/370 code */
	long	births;		/* process births at this site		*/
	long	deaths;		/* process deaths at this site		*/
	long	breada;		/* number of read aheads performed	*/
	long	sysmig;		/* count of migrate system calls	*/
	long	sysrun;		/* count of run system calls		*/
	long	rmtread;	/* count of reads to other sites	*/
	long	rmtwrite;	/* count of writes to other sites	*/
	long	rmtfork;	/* count of forks to other sites	*/
	long	rmtexec;	/* count of execs to other sites	*/
	long	rmtrun;		/* count of runs to other sites		*/
	long	rmtmig;		/* count of migrates to other sites	*/
	long	svrread;	/* count of reads from other sites	*/
	long	svrwrite;	/* count of writes from other sites	*/
	long	svrfork;	/* count of forks from other sites	*/
	long	svrexec;	/* count of execs from other sites	*/
	long	svrrun;		/* count of runs from other sites	*/
	long	svrmig;		/* count of migrates from other sites	*/
};

#ifdef  KERNEL
extern struct sysinfo sysinfo;
#endif  /* KERNEL */

struct syswait {
	short	iowait;
	short	swap;
	short	physio;
};

#ifdef  KERNEL
extern struct syswait syswait;
#endif  /* KERNEL */

struct syserr {
	long	inodeovf;
	long	fileovf;
	long	textovf;
	long	procovf;
	long	sbi[5];
#define	SBI_SILOC	0
#define	SBI_CRDRDS	1
#define	SBI_ALERT	2
#define	SBI_FAULT	3
#define	SBI_TIMEO	4
};

#ifdef  KERNEL
extern struct syserr syserr;
#endif  /* KERNEL */

struct minfo {
	long 	freemem; 	/* freemem in page */
	long	freeswap;	/* free swap space */
	long    vfault;  	/* translation fault */
	long    demand;		/*  demand zero and demand fill pages */
	long    swap;		/*  pages on swap */
	long    cache;		/*  pages in cache */
	long    file;		/*  pages on file */
	long    pfault;		/* protection fault */
	long    cw;		/*  copy on write */
	long    steal;		/*  steal the page */
	long    freedpgs;	/* pages are freed */
	long    unmodsw;	/* getpages finds unmodified pages on swap */
	long	unmodfl;	/* getpages finds unmodified pages in file */
};

#ifdef  KERNEL
extern struct minfo minfo;
#endif  /* KERNEL */

#endif /* ~_h_SYSINFO */
/* kê|Õ   $        V
  R‰*–™ˆ*R‰*     6WV
  	                  ./usr/include/sys/sysmacros.h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)sysmacros.h	16.4	LCC)	/* Modified: 18:55:27 9/22/89 */
/* SCCSID_PASC(@(#)sysmacros.h	1.4	PASC)	/* Modified: 22:31:03 3/4/87 */

#ifndef	_h_SYSMACS
#define	_h_SYSMACS


/* inumber to disk address and inumber to disk offset */
#	define	itod(x)	((daddr_t)((((unsigned)(x)+2*INOPB-1)/INOPB)))
#	define	itoo(x)	((int)(((x)+2*INOPB-1)%INOPB))

/*
 * Some macros for units conversion
 */
/* Core clicks (NBPG bytes) to segments and vice versa */
/* These macros are not used everywhere that they should be -- Beware */
#if	defined(u370) /* Start of IX/370 code */
#	ifdef  NCPSHIFT
#		define ctos(x) (((x)+(NCPS-1))>>NCPSHIFT)
#		define stoc(x) ((x)<<NCPSHIFT)
#	else  /* ~NCPSHIFT */
#		define ctos(x) (((x)+(NCPS-1))/NCPS)
#		define	stoc(x) ((x)*NCPS)
#	endif ~NCPSHIFT

	/* bytes to segment */
#	define btos(x) (ctos(btoc(x)))
	/* segment to bytes */
#	define stob(x) (ctob(stoc(x)))
#else  /* ~(u370)End of IX/370 code */
#	define	ctos(x)	(x)
#	define	stoc(x)	(x)
#endif /* ~(u370) */
#ifdef	vax
	/* Core clicks (512 bytes) to disk blocks */
#	define	ctod(x)	(x)
#	define	dtoc(x)	(x)
#	define	dtob(x)	((x) * DEV_BSIZE)
#	define	btod(x)	((x) / DEV_BSIZE)

	/* clicks to bytes */
#	define	ctob(x)	((x)<<9)

	/* bytes to clicks */
#	define	btoc(x)	((((unsigned)(x)+511)>>9))

	/* net to vax logical blocks */
#	define ntovlbn(x)	((x) >> 1)
#endif	/* vax */


#ifdef	i386
#	define	ctod(x)	(((x) << PGSHIFT) >> DEV_BSHIFT)
#	define	dtoc(x)	(((x) << DEV_BSHIFT) >> PGSHIFT)
#	define	dtob(x)	((x) << DEV_BSHIFT)
#	define	btod(x)	((x) >> DEV_BSHIFT)
#	define	ctob(x)	((long)(x)<<PGSHIFT)
#	define	btoc(x)	((unsigned)(((unsigned long)(x)+NBPG-1)>>PGSHIFT))
#endif	/* i386 */

#if	defined(RESSUP) /* Start of IX/370 code */
	/* Core clicks to disk blocks */
#	ifdef  NCPDSHIFT
#		define ctod(x) (((x)+(NCPD-1))>>NCPDSHIFT)
#	else  ~NCPDSHIFT
#		define	ctod(x) (((x)+(NCPD-1))/NCPD)
#	endif ~NCPDSHIFT

	/* clicks to bytes */
#	ifdef  BPCSHIFT
#		define ctob(x)	((x) << BPCSHIFT)
#	else  ~BPCSHIFT
#		define ctob(x)	((x) * NBPC)
#	endif ~BPCSHIFT

	/* bytes to clicks */
#	ifdef  BPCSHIFT
#		define	btoc(x)	(((unsigned)x+(NBPC-1))>>BPCSHIFT)
#		define	btoct(x)	((unsigned)(x)>>BPCSHIFT)
#	else  ~BPCSHIFT
#		define	btoc(x)	(((unsigned)x+(NBPC-1))/NBPC)
#		define	btoct(x)	((unsigned)(x)/NBPC)
#	endif ~BPCSHIFT
#endif  /* RESSUP End of IX/370 code */
#endif /* ~_h_SYSMACS */
f kêÎt   $          R‰*—™ˆ*R‰*     Ái  	                  ./usr/include/sys/syspest.h h  hH_SCCSID(@(#)syspest.h	16.3	LCC)	/* Modified: 19:18:08 9/16/89 */
/* @(#)syspest.h	7.1 - 87/06/15 - 23:45:33 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
 
#ifndef _h_SYSPEST
#define _h_SYSPEST
 
#ifdef DEBUG
 
	      /* suggested values for "DBUGL" */
#define BUGNFO 0x1       /* information: e.g., file open/close */
#define BUGACT 0x2       /* statement of program action */
#define BUGNTF 0x3       /* interfaces: names, data, return codes */
#define BUGNTA 0x4       /* interfaces for subordinate routines */
#define BUGNTX 0x5       /* detailed interface data */
#define BUGGID 0x99      /* gory internal detail */
 
#define BUGVDEF(bugvar,lev) \
    int bugvar = lev;
 
#define BUGXDEF(bugvar) \
    extern bugvar;
 
#define BUGPR(prspec) \
    {printf("[%s #%d]  ", __FILE__, __LINE__); \
     printf prspec;}
#define BUGLPR(bugvar,buglev,prspec) {if (buglev <= bugvar) \
    {printf("[%s #%d]  ", __FILE__, __LINE__); \
     printf prspec;}}
 
#define BUGC(expr,comnt) {if (!(expr)) \
    {printf("[%s #%d]  %s\n", \
    __FILE__, __LINE__,comnt);}}
#define BUGLC(bugvar,buglev,expr,comnt) {if ((!(expr)) && (buglev <= bugvar)) \
    {printf("[%s #%d]  %s\n", \
    __FILE__, __LINE__,comnt);}}
 
#define BUGX(expr,funct) {if (!(expr)) \
    {printf("[%s #%d]\n", \
    __FILE__, __LINE__);funct;}}
#define BUGLX(bugvar,buglev,expr,funct) {if ((!(expr)) && (buglev <= bugvar)) \
    {printf("[%s #%d]\n", \
    __FILE__, __LINE__);funct;}}
 
#define BUGCX(expr,comnt,funct) {if (!(expr)) \
    {printf("[%s #%d]  %s\n", \
    __FILE__, __LINE__,comnt);funct;}}
#define BUGLCX(bugvar,buglev,expr,comnt,funct) {if ((!(expr)) && (buglev <= bugv ar)) \
    {printf("[%s #%d]  %s\n", \
    __FILE__, __LINE__,comnt);funct;}}
 
#define BUGVT(variable,type)  \
    {printf("[%s #%d]  variable = %type\n", \
    __FILE__, __LINE__,variable);}
#define BUGLVT(bugvar,buglev,variable,type)  {if (buglev <= bugvar) \
    {printf("[%s #%d]  variable = %type\n", \
    __FILE__, __LINE__,variable);}}
 
#define BUGRT(comnt,variable,type)  \
    {printf("[%s #%d]  %s...variable = %type\n", \
    __FILE__, __LINE__,comnt,variable);}
#define BUGLRT(bugvar,buglev,comnt,variable,type)  {if (buglev <= bugvar) \
    {printf("[%s #%d]  %s...variable = %type\n", \
    __FILE__, __LINE__,comnt,variable);}}
 
#define BUGDM(comnt,dumpaddr,dumpl) \
    {printf("[%s #%d]  %s\n", \
    __FILE__, __LINE__,comnt);xdump(dumpaddr,dumpl);}
#define BUGLDM(bugvar,buglev,comnt,dumpaddr,dumpl) {if (buglev <= bugvar) \
    {printf("[%s #%d]  %s\n", \
    __FILE__, __LINE__,comnt);xdump(dumpaddr,dumpl);}}
 
#define	BUGS1(bugvar,buglev,s1) {if(buglev <= bugvar)\
	printf("[%s #%d] s1 =  %d\n", __FILE__, __LINE__, s1);}
 
#define	BUGS2(bugvar,buglev,s1,s2) {if(buglev <= bugvar)\
	printf("[%s #%d] s1 = %x s2 = %x\n", __FILE__, __LINE__, s1,s2);}
 
#define ASSERT(p) {if(!(p)){printf("[%s #%d]\n",__FILE__,__LINE__); panic("ASSER T(p)");}} 
	
#define BUGFUNCT(funct) {funct;}
#define BUGLFUNCT(bugvar,buglev,expr,funct) {if ((buglev <= bugvar)) funct;}
 
#else
 
#define BUGVDEF(bugvar,lev)
#define BUGXDEF(bugvar)
#define BUGPR(prspec)
#define BUGLPR(bugvar,buglev,prspec)
#define BUGC(expr,comnt)
#define BUGLC(bugvar,buglev,expr,comnt)
#define BUGX(expr,funct)
#define BUGLX(bugvar,buglev,expr,funct)
#define BUGVT(variable,type)
#define BUGLVT(bugvar,buglev,variable,type)
#define BUGRT(comnt,variable,type)
#define BUGLRT(bugvar,buglev,comnt,variable,type)
#define BUGCX(expr,comnt,funct)
#define BUGLCX(bugvar,buglev,expr,comnt,funct)
#define BUGDM(comnt,dumpaddr,dumpl)
#define BUGLDM(bugvar,buglev,comnt,dumpaddr,dumpl)
#define	BUGS1(bugvar,buglev,s1)
#define	BUGS2(bugvar,buglev,s1,s2)
#define ASSERT(p)
#define BUGFUNCT(funct)
#define BUGLFUNCT(bugvar,buglev,expr,funct)
 
 
#endif DEBUG
#endif _h_SYSPEST
/
	lkê’X   $        P%  R‰*˜™ˆ*R‰*     ¬“P%  	              xW  ./usr/include/sys/systm.h h h  h/*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	All Rights Reserved
 */


#include <sccs.h>
H_SCCSID(@(#)systm.h	1.2    IBM AIX)    /* Modified: 20:01:54 7/15/92 */

#ifndef _h_SYSTM
#define _h_SYSTM

#ifndef _h_TYPES
#ifdef KERNEL
#include <types.h>
#else /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */

/*
 * Random set of variables
 * used by more than one
 * routine.
 */
extern  time_t	hz;			/* frequency of the clock */
#ifdef	romp
extern	int	tick;
#endif	/* romp	*/
extern	int	usec_per_tick;		/* # of microseconds in clock tick */
#ifdef	KERNEL
extern  int	timezone;		/* minutes west from greenwich */
#endif	/* KERNEL */
extern  int	dstflag;		/* daylight savings time in effect? */

extern  char	canonb[];		/* buffer for erase and kill (#@) */

extern  char	version[];		/* system version */
extern  int	lbolt;			/* time of day in 60th not in time.
					 * (i.e. difference between actual time
					 * and "time" in 1/hz secs.
					 */
#ifdef	romp
int	endmem;			/* physical end of memory */
int	holestart;		/* start of hole in address space */
int	holelength;		/* length of hole in address space */
/* ishole is true if page is inside memory hole */
#define ishole(v) ((v) >= holestart && (v) < holestart+holelength)
#endif	/* romp */

#ifdef u370
/* on some machines, the time of day must be maintained by routines */
extern time_t Gettod();
#else /* !u370 */
#ifdef KERNEL
extern  time_t  time;			/* seconds since 1970 */
#endif
#define Gettod() 	time		/* macro to get the time of day */
#define Settod(t)	time = *(t)	/* macro to set the time of day */
#define etime()		(gettod() * hz + lbolt)	/* time of day in 1/HZ sec */
#endif /* !u370 */

extern int slewing_time;
extern time_t slewedtod();
#define	gettod()	(slewing_time?slewedtod():Gettod())

extern  time_t	bootime;		/* time at which booted */

	/* macro to convert time in 1/HZ sec to time in seconds */
#define hz2sec(t)	(((t) + (hz + 1)/2)/hz)

extern  struct inode *rootdir;		/* pointer to inode of root directory */
#if	defined(SWAPPING) || defined(PAGING)
extern  int	hand;			/* current index into coremap */
					/*  used by daemon */
#endif  /* (SWAPPING || PAGING) */

#if	defined(u370) 		/* Start of code from IX/370 */

#ifdef  VARY_PANIC
extern	int	dumpsymb;		/* Block# of symbols for this boot */
extern	int	dumpsyml;		/* Length of symbols for this boot */
extern	char	dumpopt;		/* Dump init options */
extern 	char	panicdmp;		/* Dump options for panic */
extern	char	conecdmp;		/* Dump options for vss connect */
extern 	char	coneckil;		/* Termination option for connect */
extern	char	dumpini;		/* Dump initialize - 1 = yes */
extern	char	yes, no;
#endif  /* VARY_PANIC */

#endif  /* (u370 ) End of code from IX/370 */

/*
 * Nblkdev is the number of entries
 * (rows) in the block switch. It is
 * set in binit/bio.c by making
 * a pass over the switch.
 * Used in bounds checking on major
 * device numbers.
 */
extern  int	nblkdev;

/*
 * Number of character switch entries.
 * Set by cinit/prim.c
 */
extern  int	nchrdev;

#if	defined(SVPAGING) && defined(b370)
extern	bool_t	sptmapwnt;		/* spt map want flag */
#endif	/* SVPAGING && b370 */

#if	defined(PAGING) || defined(SWAPPING)
extern  int	nswdev;			/* number of swap devices */
extern  char	kmapwnt;		/* kernel map want flag */
#endif   /* (SWAPPING || PAGING) */

extern	int	nswap;			/* size of a swap partition */
extern  pid_t	mpid;			/* generic for unique process id's */
extern  pid_t	lastkernelprocesspid;	/* last special proc pid. */
/* NEEDSWORK: should this be ifdef'd BSD_SCHED ? */
extern  char	runin;			/* scheduling flag */
extern  char	runout;			/* scheduling flag */
extern  int	runrun;			/* scheduling flag */
extern  char	curpri;			/* more scheduling */

extern  int	maxmem;			/* actual max memory per process */
extern  int	physmem;		/* physical memory on this CPU */

extern  int	updlock;		/* lock for sync */
extern  daddr_t	rablock;		/* block to be read ahead */

#ifndef NOINTRSTACK
extern	int intstack[];			/* stack for interrupts */
#endif  /* NOINTRSTACK */

/*
 * declarations for specific devices and their gfs's.  The initialization
 * of these variables is done in conf.c
 */
extern  dev_t	rootdev;		/* device of the root */
extern  gfs_t	rootgfs;		/* gfs of root device */
extern  dev_t	dumpdev;		/* device to take dumps on */
extern  daddr_t	dumplo;			/* offset into dumpdev */
extern  dev_t	swapdev;		/* swapping device */
extern  dev_t	argdev;			/* device for argument lists */
#ifdef	SVPAGING
extern	daddr_t	swplo;			/* block number of swap space */
#define arg_dev(swpi)	swaptab[swpi].st_dev
#else	/* ! SVPAGING */
#define arg_dev(swpi)	((dev_t) swpi)
#endif	/* ! SVPAGING */
extern  dev_t	pipedev;		/* pipe device */
extern  gfs_t	pipegfs;		/* gfs of pipes */
#ifdef NFS
extern	dev_t	nfsdev;			/* NFS device */
#define nfsdevmaj	major(nfsdev)
#endif
extern  dev_t   netdev;			/* network device */
#define	netdevmaj	major(netdev)

extern  int	tinyroot;

extern short sitetypes[];     /* cpu type number for each site */


/*
 * definition of which site this code is running on.  This variable is
 * set in a conf file which should be unique to the site the system
 * is generated for.
 */
extern 	siteno_t  loc_site;		/* site number of this site */
extern	int loc_cpu;			/* local cpu type */
extern  int  slow;			/* how slow are we this time */

extern	int icode[];		/* user init code */
extern	int szicode;			/* its size */


extern	daddr_t	bmap();
extern	daddr_t alloc();
extern	caddr_t	calloc();
extern	unsigned max();
extern	unsigned min();
extern	int uchar();
extern  int schar();
extern  int wakeup();
extern  char ss_policy();


#if	defined(PAGING) || defined(SWAPPING)
extern	int	memall();
extern	int	vmemall();
#ifdef  _NOTDEF_
extern	char	*wmemall();
#endif  /* _NOTDEF_ */
extern	swblk_t	vtod();
#endif  /* (PAGING || SWAPPING) */

extern	struct inode *getmdev();
extern	struct inode *ialloc();
extern	struct inode *owner();
extern	struct inode *namei();
extern	struct buf *geteblk();
extern	struct buf *bread();
extern	struct buf *blread();
extern	struct buf *brreada();
extern	struct buf *bmread();
extern	struct buf *bmreada();
extern	struct file *getf();
extern	struct file *falloc();
extern	unsigned short commitbits();	/* returns the commit bits map */



#define  STRUCTASSIGN( to,from )	(to) = (from)



extern	spl_t	spl0();
extern	spl_t	spl1();
extern	spl_t	spl2();
extern	spl_t	spl3();
extern	spl_t	spl4();
extern	spl_t	spl5();
extern	spl_t	spl6();
extern	spl_t	spl7();
extern	spl_t	spl18();
extern	splx();
#if ! defined(vax)
#if defined(__UNDEF__) || defined(i386)
#define	splnet()	spl2()
#define	splcmos()	spl2()
#define	splrtc()	spl2()
#else /* ! defined(__UNDEF__) || defined(i386) */
#define	splnet()	spl5()
#endif /* ! defined(__UNDEF__) || defined(i386) */
#define	splhigh()	spl18()
#endif /* ! defined(vax) */
#define	splblkio()	spl6()

#ifdef	SOFT_VAX
extern caddr_t uatoka();
#endif	/* SOFT_VAX */


extern  bool_t copyin();
extern  bool_t copyout();

#ifdef  SIXTEENBITS
extern  bool_t copyiout();
extern  bool_t copyiin();
#endif  /* SIXTEENBITS */

/*
 * Structure of the system-entry table
 */
extern struct sysent
{
#ifdef  PASSTHRUREGS
	char	SY_nargorsize;	/* number OR size of arguments, depending */
	char	sy_nrarg;		/* number of args in registers */
#else  /* ~PASSTHRUREGS */
	int	SY_nargorsize;	/* number OR size of arguments, depending */
#endif  /* PASSTHRUREGS */
#ifdef	IX_370
#define sy_argsize	SY_nargorsize	/* number of bytes of arguments */
#else	/* !IX_370 */
#define sy_narg		SY_nargorsize	/* total number of arguments */
#endif	/* !IX_370 */
	int	(*sy_call)();		/* handler */
#ifdef  SYSCALLNAMES
	char	*sy_name;		/* system call name for debugging */
#endif  /* SYSCALLNAMES */
} sysent[];

#if	defined(SWAPPING) || defined(PAGING)
extern char	vmmap[];		/* poor name! */
extern int	umbabeg,umbaend;	/* where sensitive vm begins/ends */
extern	int catcher[256];
#endif  /* (PAGING || SWAPPING) */
extern  char	*panicstr;
extern	int	panicme;	

extern  int	wantin;

extern  int	boothowto;	/* reboot flags, from console subsystem */
extern  int	selwait;	/* select code wait channel */
extern  int	remselwait;	/* select code remote wait channel */
extern  bool_t	noproc;		/* no one is running just now */

#ifdef	SOFT_VAX
struct  system
{
	struct pte	*s_p0br; /*  software copy of P0BR */
	int		s_p0lr; /*  software copy of P0LR */
	struct pte	*s_p1br; /*  software copy of P1BR */
	int		s_p1lr; /*  software copy of P1LR */
	int		s_pcbb; /*  software copy of PCBB */
	int		s_ipl; /*  software copy of IPL */
	int		s_tbia; /*  software copy of TBIA */
	int		s_tbis; /*  software copy of TBIS */
};
extern  struct system  system;

#endif	/* SOFT_VAX */

#ifdef  GLOBALSYNC
extern  pid_t	owner_kernel_lock;	/* pid of process with kernel lock */
extern	sema_t	kernel_lock;		/* global kernel lock */
#endif  /* GLOBALSYNC */

#ifdef vax
#define	processing_intr		1
#else /* ~vax */
extern u_short processing_intr;		/* See trap.c */
#endif /* ~vax */

/*
 * internal consistency panics and printfs: turn all of them to a single 
 * message with variable fields.  Automatically include the file name.
 */
#define ICPANIC(name, number)	icpanic(name, number, __FILE__, 0)

/*
 * Right now (12/86) ICPANIC2 is only called with the PC_RTRN flag,
 * so the system will continue running.
 */
#ifdef u370
#define ICPANIC2(name, number, panicflgs)  \
			icpanic(name, number, __FILE__, panicflgs)
#endif /* u370 */

#endif /* ~_h_SYSTM */
kêÖÈ   $        Ø  R‰*˜™ˆ*R‰*     åÁØ  	                  ./usr/include/sys/tabgrow.h h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)tabgrow.h	16.4	LCC)	/* Modified: 18:56:38 9/22/89 */
/* H_SCCSIDgen1(@(#)tabgrow.h	11.3	LCC)	/* Modified: 15:41:24 9/23/88 */

struct  system_data  {
	caddr_t	sd_base;		/* base of the data structure */
					/* (by convention)table key */
	bool_t	(*sd_allocator)();	/* allocates table space */
	int	(*sd_initializer)();	/* initialize the space */
	int	sd_related;		/* index to next related  */
					/* data structure */
	int	sd_flags;		/* flag field */
	char  *	sd_tablename;		/* character string table name */
};
#	define SD_NOTDYNAMIC	0x1	/* this table does not grow */
#	define SD_BUSY		0x2	/* Allocation in progress */
#	define SD_WANTED	0x4	/* Waiting for table to grow */
#	define SD_INITIALIZED	0x8	/* Done startup initialization */

/* 
 * These MUST be carefully inspected should the sysdata table change as
 * they are indices to particular table entries.  The order declared here
 * is the order in which allocation occurs.  For ex: entry 1, then
 * entry 2, then entry 0.  Next comes entry 4, and so on.
 */
#define  SD_BUFFERS	1
#define	 SD_BUFHASH	2		
#define  SD_BUF		0

#define  SD_EXTPROC	4
#define  SD_KLOCKS	12
#define  SD_PROC	3

#define  SD_SWSIZE	17
#define  SD_SWPFS	18
#define  SD_SWBUF	16
kêìF    $        ¸  R‰*šˆ*R‰*     –“¸  	                  ./usr/include/sys/table.h h h  hH_SCCSID(@(#)table.h	1.1	AIX)	/* Modified: 16:05:14 1/16/89 */
/* @(#)table.h	7.1 - 87/06/15 - 18:46:05 */

/* This is original "aix 2.2.1" source code */

struct table {
	char        **tb_base;      /* Pointer to ptr to space */
	ushort      tb_elsize;      /* Size of one element */
	int         tb_nel;         /* Number of elements */
};

#define INITTABLE(array,nel) \
	{ (char **)&array, sizeof(*array), nel }

extern char *extend();
kê> ÿ  $        É  S‰*šˆ*S‰*     ¿É  	                  ./usr/include/sys/tacct.h h h  hH_SCCSID(@(#)tacct.h	1.3	AIX)	/* Modified: 21:37:23 8/24/89 */
/* @(#)tacct.h	7.1 - 87/06/15 - 18:46:11 */
/*
 *	total accounting (for acct period), also for day
 */

/* This is original "aix 2.2.1" source code */

/* Float arrays below contain prime and non-prime components */
struct	tacct	{
	u_short		ta_uid;		/* userid */
	char		ta_name[8];	/* login name */
	float           ta_cpu[2];      /* cum. cpu time (mins) */
	float           ta_kcore[2];    /* cum kcore-mins */
	long            ta_io[2];       /* cum. chars xferred (512s) */
	long            ta_rw[2];       /* cum. blocks read/written */
	long            ta_con[2];      /* cum. connect time (mins) */
	long		ta_du;		/* cum. disk usage */
	long            ta_qsys;        /* queueing sys charges (pgs) */
	float		ta_fee; 	/* fee for special services */
	long		ta_pc;		/* count of processes */
	unsigned short	ta_sc;		/* count of login sessions */
	unsigned short	ta_dc;		/* count of disk samples */
};
SD_INITkêbË þ  $        ž  S‰*˜™ˆ*S‰*     
¾ž  	                  ./usr/include/sys/tape.h  h h  h#ifndef H_SCCSID
#include	<sccs.h>
#endif /* !H_SCCSID */
H_SCCSID(@(#)tape.h	16.3	LCC)	/* Modified: 19:20:44 9/16/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef	_h_TAPE
#define	_h_TAPE

#ifndef _h_TYPES
#include <sys/types.h>
#endif  /* ! _h_TYPES */

/* PS/2 Streaming tape control	- based on AIX/RT */
#define STIOC		('S'<<8)
#define	STIOCTOP	(STIOC|1)			/* do a mag tape op */
#define	STIOCGET	(STIOC|2)			/* get tape status */

/* structure for STIOCTOP - streaming tape op command */
struct	stop	{
	short	st_op;		/* operations defined below */
	daddr_t	st_count;	/* how many of them */
};

/* operation codes */
#define	STRESET 5	/* Reset device. */
#define STREW	6	/* rewind */
#define STERASE 7	/* erase tape, retension, leave at load point */
#define STRETEN 8	/* retension, leave at load point */
#define STNOP   9	/* no operation	*/
#define STWEOF  10	/* write an end-of-file record    */
#define STFSF	11	/* forward space file */
#define STFSR	13	/* forward space record */
#define STRAS1	15	/* drive self test 1 */
#define STRAS2	16	/* drive self test 2 */
#define STRAS3	17	/* drive self test 3 */
			/* this test (3) needs a an erased, */
			/* write-protected tape. */

/* structure for STIOCGET - streaming tape get status command */

struct	stget	{
	short	st_type;	/* type of device */
/* the following structure is grossly device dependent */
/* Ok for now, we only have one device. */
	struct dsreg {
		unsigned short ds_dstat;   /* drive status */
		unsigned short ds_soft;	   /* soft error count */
		unsigned short ds_under;   /* underrun count */
		unsigned char  ds_rcom;	   /* command recieved by adapter */
		unsigned char  ds_blk;	   /* adapter block count */
		unsigned char  ds_rstat;   /* status register */
		unsigned char  ds_code;    /* adapter completion code */
		unsigned char  ds_lcom;	   /* last command given to adapter */
		unsigned char  ds_lstcom;  /* last streaming tape device */
					   /* drive command */
		unsigned char  ds_res[4];  /* reserved */
	} st_dsreg;
/* end device-dependent structure */
};

/*
 * Constants for st_type byte
 */
#define	ST_ISST		0x01
#endif /* ~_h_TAPE */
cokê€z ¨  ÿ¡             `‰*`‰*`‰*                            ./usr/include/sys/tcp.h ../netinet/tcp.hkêˆ5 ¦  ÿ¡             `‰*`‰*`‰*                            ./usr/include/sys/tcp_debug.h  h../netinet/tcp_debug.h ekêâ ¤  ÿ¡             `‰*`‰*`‰*          	                  ./usr/include/sys/tcp_fsm.h h  h../netinet/tcp_fsm.h _fskêÄÀ ¢  ÿ¡             `‰*`‰*`‰*          	                  ./usr/include/sys/tcp_seq.h h  h../netinet/tcp_seq.h _sekêôÙ    ÿ¡             `‰*`‰*`‰*          	                  ./usr/include/sys/tcp_timer.h  h../netinet/tcp_timer.h ikêÒõ ž  ÿ¡             a‰*a‰*a‰*          	                  ./usr/include/sys/tcp_var.h h  h../netinet/tcp_var.h _vakêXˆ œ  ÿ¡             a‰*a‰*a‰*          
                  ./usr/include/sys/tcpip.h h h  h../netinet/tcpip.h cpip.kê|È ý  $        R  S‰*°™ˆ*S‰*     èÁR  	              ÞV  ./usr/include/sys/termio.h  h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)termio.h	16.12       LCC)    /* Modified: 19:14:23 1/11/90 */

#ifndef	_h_TERMIO
#define	_h_TERMIO

#ifdef i386
#include <sys/ioctl.h>
#endif /* i386 */
#ifdef NLS
#include <sys/ttmap.h> /* for struct tty_map: ioctl arg for TCGMAP/TCSMAP */
#endif

/* USG	termio.h	1.1 */

/*
   WARNING:  There is code in iocpack()/ioctl.c which depends upon
   the value of NCC being 8.  Search for NCC in ioctl.c to find it.
   (randy s.)
*/
#define	NCC	8

#if defined(KERNEL) || !defined(_POSIX_SOURCE)

#ifndef _h_TERMIOS /* include <termios.h> first if you need both */

/* control characters */
#define	VINTR	0
#define	VQUIT	1
#define	VERASE	2
#define	VKILL	3
#define	VEOF	4
#define	VEOL	5
#define	VEOL2	6
#define	VMIN	4
#define	VTIME	5
#define	VSWTCH	7

#endif /* ! _h_TERMIOS */

#endif /* NOT _POSIX_SOURCE */


/*
	Default control characters:
	Some of these defaults are duplicated in ioctl.h, namely,
	CUNDEF, CINTR, CQUIT, and CEOF.  If you change any of
	these (I really doubt that anyone will want to...), make sure
	that ioctl.h gets exact duplicates, otherwise cpp will complain
	about multiple definitions whenever we compile the kernel.
*/

#define	CNUL	0
#define	CDEL	0377

#define CUNDEF	0377
#define CEOL2	0
#define CMIN	1
#define CTIME	0

/* default control chars */

#define CERASE	010	/* cntl h */
#define CKILL	025	/* cntl u */
#define	CINTR	0177	/* DEL */
#define CQUIT	026	/* cntl v */
#define	CSTART	021	/* cntl q */
#define	CSTOP	023	/* cntl s */
#define	CEOF	04	/* cntl d */
#define	CEOL	CUNDEF
#define	CESC	'\\'

#ifdef RTPC_NO_NLS
#define	CQUIT	034	/* FS, cntl | */
#endif /* RTPC_NO_NLS */

#define	CSWTCH	032	/* cntl z */
#define	CNSWTCH	0


/* input modes */
#define	IGNBRK	0000001
#define	BRKINT	0000002
#define	IGNPAR	0000004
#define	PARMRK	0000010
#define	INPCK	0000020
#define	ISTRIP	0000040
#define	INLCR	0000100
#define	IGNCR	0000200
#define	ICRNL	0000400
#define	IUCLC	0001000
#define	IXON	0002000
#define	IXANY	0004000
#define	IXOFF	0010000
#define	ASCEDIT	0020000

/* output modes */
#define	OPOST	0000001
#define	OLCUC	0000002
#define	ONLCR	0000004
#define	OCRNL	0000010
#define	ONOCR	0000020
#define	ONLRET	0000040
#define	OFILL	0000100
#define	OFDEL	0000200
#define	NLDLY	0000400
#define	NL0	0
#define	NL1	0000400
#define	CRDLY	0003000
#define	CR0	0
#define	CR1	0001000
#define	CR2	0002000
#define	CR3	0003000
#define	TABDLY	0014000
#define	TAB0	0
#define	TAB1	0004000
#define	TAB2	0010000
#define	TAB3	0014000
#define	BSDLY	0020000
#define	BS0	0
#define	BS1	0020000
#define	VTDLY	0040000
#define	VT0	0
#define	VT1	0040000
#define	FFDLY	0100000
#define	FF0	0
#define	FF1	0100000


/* control modes */
#define	CBAUD	0000017
#define	B0	0
#define	B50	0000001
#define	B75	0000002
#define	B110	0000003
#define	B134	0000004
#define	B150	0000005
#define	B200	0000006
#define	B300	0000007
#define	B600	0000010
#define	B1200	0000011
#define	B1800	0000012
#define	B2400	0000013
#define	B4800	0000014
#define	B9600	0000015
#define	B19200	0000016
#define	EXTA	0000016
#define	EXTB	0000017
#define	CSIZE	0000060
#define	CS5	0
#define	CS6	0000020
#define	CS7	0000040
#define	CS8	0000060
#define	CSTOPB	0000100
#define	CREAD	0000200
#define	PARENB	0000400
#define	PARODD	0001000
#define	HUPCL	0002000
#define	CLOCAL	0004000
#define	LOBLK	0010000

/* line discipline 0 modes */
#define	ISIG	0000001
#define	ICANON	0000002
#define	XCASE	0000004
#define	ECHO	0000010
#define	ECHOE	0000020
#define	ECHOK	0000040
#define	ECHONL	0000100
#define	NOFLSH	0000200
#define XSCAN	0000400

#ifndef NO_AUSTIN_HOOKS
/* ************************** AUSTIN HOOK ************************** */
#define LTCKEP	0001000	/* AUSTIN HOOK */
/* ***************************************************************** */
#endif

#define SSPEED  13      /* default speed: 13 => 9600 baud */

/*
 * Ioctl control packet
 */
struct termio {
	unsigned short	c_iflag;	/* input modes */
	unsigned short	c_oflag;	/* output modes */
	unsigned short	c_cflag;	/* control modes */
	unsigned short	c_lflag;	/* line discipline modes */
	char	c_line;			/* line discipline */
	unsigned char	c_cc[NCC];	/* control chars */
};

/*
 * TTY(console) logging flags, chai
 */
#define TLOG_ON		01000000	/* terminal logging enabled */
#define TLOG_QID	0400000		/* valid msg id in tl_msgqid */
/*
 * TTY(console) logging, chai
 */
struct tlog {
	int     tl_flags;
	int	tl_msgqid;
};

/*
 *  Structure, defines for setting page length
 */
#define PAGE_SETL    04     /* Set Page Length (Ioctl TCSLEN) */
#define PAGE_MSK     03     /* Paging Ioctl Command Mask (TCSLEN) */
#define PAGE_ON      01     /* Enable Paging (TCSLEN), Paging Enabled (TCGLEN) */
#define PAGE_OFF     02     /* Disable Paging (TCSLEN) */
#ifndef PAGE_ENB
#define PAGE_ENB     PAGE_ON	/* For compatibility with older version */
#endif

struct  tty_page {
	char          tp_flags;
	unsigned char tp_slen;
};

#define	IOCTYPE		0xff00
#define	TIOC	('T'<<8)
#define	TCGETA	(TIOC|1)
#define	TCSETA	(TIOC|2)
#define	TCSETAW	(TIOC|3)
#define	TCSETAF	(TIOC|4)
#define	TCSBRK	(TIOC|5)
#define	TCXONC	(TIOC|6)
#define	TCFLSH	(TIOC|7)
#define TCGLEN  (TIOC|8)
#define TCSLEN  (TIOC|9)
#define TCLOG   (TIOC|10)
#define TCSVEC  (TIOC|12)
#define TCGVEC  (TIOC|13)

#ifdef NLS
#define TCSMAP  (TIOC|14)
#define TCGMAP  (TIOC|15)
#endif

#define TIONREAD (TIOC|16)

#define	TCDSET	(TIOC|32)
#define TCKEP   (TIOC|33)

#define	LDIOC	('D'<<8)
#define	LDOPEN	(LDIOC|0)
#define	LDCLOSE	(LDIOC|1)
#define	LDCHG	(LDIOC|2)
#define	LDGETT	(LDIOC|8)
#define	LDSETT	(LDIOC|9)
#define LDGETDT (LDIOC|10)
#define LDSETDT (LDIOC|11)

#if	defined(u370) /* Start of IX/370 code */
#define U370	('U'<<8)
#define U370TABS	(U370|1)
#define CNIOEMLON   (TIOC|34)
#define CNIOEMLOFF   (TIOC|35)
#endif  /* (u370)	 End of IX/370 code */

/* RESERVED: (TIOC | 36) and (TIOC | 37) */


/*
 * Terminal types
 */
#define	TERM_NONE	0	/* tty */
#define	TERM_TEC	1	/* TEC Scope */
#define	TERM_V61	2	/* DEC VT61 */
#define	TERM_V10	3	/* DEC VT100 */
#define	TERM_TEX	4	/* Tektronix 4023 */
#define	TERM_D40	5	/* TTY Mod 40/1 */
#define	TERM_H45	6	/* Hewlitt-Packard 45 */
#define	TERM_D42	7	/* TTY Mod 40/2B */

/*
 * Terminal flags
 */
#define TM_NONE		0000	/* use default flags */
#define TM_SNL		0001	/* special newline flag */
#define TM_ANL		0002	/* auto newline on column 80 */
#define TM_LCF		0004	/* last col of last row special */
#define TM_CECHO	0010	/* echo terminal cursor control */
#define TM_CINVIS	0020	/* do not send esc seq to user */
#define TM_SET		0200	/* must be on to set/res flags */

/*
 * structure of ioctl arg for LDGETT and LDSETT
 */
struct	termcb	{
	char	st_flgs;	/* term flags */
	char	st_termt;	/* term type */
	char	st_crow;	/* gtty only - current row */
	char	st_ccol;	/* gtty only - current col */
	char	st_vrow;	/* variable row */
	char	st_lrow;	/* last row */
};

/*
 * ioctl arg for TCGETDT/TCSETDT
 */
#define DTBSIZE 128             /* shdb <= TTXOHI */
struct dostmplt {
	char    *dt_tbuf;
	int     dt_tlen;
};

#endif /* ~_h_TERMIO */
000012kêÞ$ û  $        S	  S‰*°™ˆ*S‰*     ÂqS	  	                  ./usr/include/sys/text.h h  h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)text.h	16.4	LCC)	/* Modified: 18:57:47 9/22/89 */

#ifndef	_h_TEXT
#define	_h_TEXT

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */
/*
 * Text structure.
 * One allocated per pure
 * procedure on swap device.
 * Manipulated by text.c
 */
#if	defined(PAGING) || defined(SWAPPING)
#define	NXDAD	12		/* param.h:MAXTSIZ / dmap.h:DMTEXT */
#endif  /* (SWAPPING || PAGING) */

struct text
{
#if	defined(SWAPPING) || defined(PAGING)
	swblk_t	x_daddr[NXDAD];	/* disk addresses of DMTEXT-page segments */
	swblk_t	x_ptdaddr;	/* disk address of page table */
	short	x_poip;		/* page out in progress count */
	short	x_rssize;
	short	x_swrss;
#endif  /* (SWAPPING || PAGING) */
	/* TOTAL size of this text, including overlays */
	size_t	x_size;		/* size (clicks) */
#ifndef NOTEXTLINKS
	struct proc *x_caddr;	/* ptr to linked proc, if loaded */
#endif  /* NOTEXTLINKS */
	struct inode *x_iptr;	/* inode of prototype */
	struct text  *x_xnext;	/* pointer to next text entry */
				/* available to busy and active list */
	ushort	x_count;	/* reference count */
	ushort	x_ccount;	/* number of loaded references */
	char	x_flag;		/* traced, written flags */
	char	x_slptime;
};

#ifdef	KERNEL
extern struct text *text;

#define textNTEXT	v.ve_text	/* use value from struct var */
/* Pointer to the tail of a circular list of active texts */
/* New texts are inserted at the head of the list */
extern struct  text  * text_active;

extern  struct  text  * text_flist;	/* free list head */
#endif  /* KERNEL */

#define	XTRC	0x01		/* Text may be written, exclusive use */
#define	XWRIT	0x02		/* Text written into, must swap out */
#define	XLOAD	0x04		/* Currently being read from file */
#define	XLOCK	0x08		/* Being swapped in or out */
#define	XWANT	0x10		/* Wanted for swapping */
#define	XPAGI	0x20		/* Page in on demand from inode */
				/* May be ignore by some memory */
				/* management implementations.  */

#ifndef NOCHECKS
#define XSTICKY 0x40		/* this is a sticky text */
#endif /* ~NOCHECKS */

#endif /* ~_h_TEXT */
al nekêò% ú  $        S
  S‰*˜™ˆ*S‰*     3ˆS
  	                  ./usr/include/sys/time.h h  h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef _POSIX_SOURCE
#ifndef	H_SCCSID
#include <sccs.h>
#endif	/* ! H_SCCSID */
H_SCCSID(@(#)time.h	16.12	LCC)	/* Modified: 21:54:35 7/12/90 */
#endif /* NOT _POSIX_SOURCE */

#ifndef	_H_TIME
#define	_H_TIME

#ifndef _H_TYPES
#ifdef  _KERNEL
#include <types.h>
#else  /* ~_KERNEL */
#include <sys/types.h>
#endif /* ~_KERNEL */
#endif  /* _H_TYPES */

#ifndef _POSIX_SOURCE
/*
 * Structure returned by gettimeofday(2) system call,
 * and used in other calls.
 */
struct timeval {
	long	tv_sec;		/* seconds */
	long	tv_usec;	/* and microseconds */
};

struct timezone {
	int	tz_minuteswest;	/* minutes west of Greenwich */
	int	tz_dsttime;	/* type of dst correction */
};
#define	DST_NONE	0	/* not on dst */
#define	DST_USA		1	/* USA style dst */
#define	DST_AUST	2	/* Australian style dst */
#define	DST_WET		3	/* Western European dst */
#define	DST_MET		4	/* Middle European dst */
#define	DST_EET		5	/* Eastern European dst */
#define	DST_CAN		6	/* Canada */

/*
 * Operations on timevals.
 *
 * NB: timercmp does not work for >= or <=.
 */
#define	timerisset(tvp)		((tvp)->tv_sec || (tvp)->tv_usec)
#define	timercmp(tvp, uvp, cmp)	\
	((tvp)->tv_sec cmp (uvp)->tv_sec || \
	 (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
#define	timerclear(tvp)		(tvp)->tv_sec = (tvp)->tv_usec = 0

/*
 * Names of the interval timers, and structure
 * defining a timer setting.
 */
#define	ITIMER_REAL	0
#define	ITIMER_VIRTUAL	1
#define	ITIMER_PROF	2

struct	itimerval {
	struct	timeval it_interval;	/* timer interval */
	struct	timeval it_value;	/* current value */
};
#endif /* NOT _POSIX_SOURCE */

/*
 * Structure returned by gmtime and localtime calls (see ctime(3)).
 */
struct	tm {	/* see ctime(3) */
	int	tm_sec;
	int	tm_min;
	int	tm_hour;
	int	tm_mday;
	int	tm_mon;
	int	tm_year;
	int	tm_wday;
	int	tm_yday;
	int	tm_isdst;
};

#ifdef	_KERNEL
extern long timetohz();
#else	/* ! _KERNEL */
extern	struct tm *gmtime(), *localtime();
extern	char *asctime(), *ctime();
extern time_t time();                               
extern void tzset();
extern char *tzname[2];

#ifndef _POSIX_SOURCE
extern long timezone;
extern int daylight;

#if defined( NLS ) && !defined( RTPC_NO_NLS )
/*  Suggested default length of time/date buffer
 */
#define NLTBMAX	64

extern char *NLctime(), *NLasctime(), *NLstrtime();
#endif /* NLS && ! RTPC_NO_NLS */
#endif /* NOT _POSIX_SOURCE */

#endif  /* ! _KERNEL */

#endif	/* ! _H_TIME */
		020kêº‚ ø  $        å  T‰*›™ˆ*T‰*     ûnå  	                  ./usr/include/sys/timeb.h   h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)timeb.h	16.3	LCC)	/* Modified: 19:24:15 9/16/89 */
/* SCCSIDPUFF(@(#) timeb.h 4.1 LM 12:57:59 4/23/85 C 22:13:36 4/23/85); */

#ifndef _h_TIMEB
#define _h_TIMEB

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */

/*
 * Structure returned by ftime system call
 */
struct timeb
{
	time_t	time;
	u_short millitm;
	short	timezone;
	short	dstflag;
};

#endif /* ~_h_TIMEB */
d mkêT¸ ÷  $        &  T‰*›™ˆ*T‰*     rY&  	                  ./usr/include/sys/times.h   h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef _POSIX_SOURCE
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)times.h	16.6       LCC)    /* Modified: 18:12:31 7/6/90 */
#endif /* NOT _POSIX_SOURCE */

#ifndef _H_TIMES
#define _H_TIMES

#include <sys/types.h>

/*
 * Structure returned by times()
 */
struct tms {
	clock_t	tms_utime;		/* user time */
	clock_t	tms_stime;		/* system time */
	clock_t	tms_cutime;		/* user time, children */
	clock_t	tms_cstime;		/* system time, children */
};

#ifndef _KERNEL
extern clock_t times();                             
#endif /* NOT _KERNEL */

#endif /* NOT _H_TIMES */
inkêâ	 ö  $        C(  T‰*›™ˆ*T‰*     IOC(  	              ¾  ./usr/include/sys/tokens.h  h  h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)tokens.h	16.8	LCC)	/* Modified: 13:08:17 8/24/90 */

#ifndef _h_TOKENS
#define _h_TOKENS

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif /* ~_h_PARAM */

/*
 *  This data structure is used for passing the token
 *  control parameters during the open and close file protocols.
 *
 *  tkp_fdes and tkp_flag are only used by open while tkp_foffs
 *  is only used by close.  This structure used to be a union to
 *  make that explicit; however, operations like nami switch
 *  back and forth between open and close and would otherwise
 *  be setting and resetting the same fields over and over again.
 */
struct tok_parm {
	short	tkp_tcbdes;
	short	tkp_fdes;
	short	tkp_mgrsite;
	short	tkp_flag;
	off_t	tkp_foffs;
};

/* tkp_flag has one of the three values */
#define TK_NOTPRESENT 0x00
#define TK_PRESENT 0x01
#define TK_NOTSETUP 0x02

#define NULLTCB ((short)-1)
#define NULLFDES ((short)-1)
/* Inode tokens are needed only on regular files and block devices */
#define REQUIRE_TOK(mode) (((mode)&IFMT) == IFREG || ((mode)&IFMT) == IFBLK)
/*
 *  The following data structure describes the body
 *  of a token control block (TCB)
 */
struct tok_ctrlb
{
	struct inode	*tcb_iptr;	/* back pointer for fifos/inode tokens*/
	union {
		struct tok_loci *TCB_rqchn;	/* requests */
		struct tok_ctrlb *TCB_master;	/* pointer to master ctrl block
						 * when TCB_SLAVE is set */
	} tcb_lc;
	gfs_t	tcb_gfs;		/* gfs # of file */
	ino_t	tcb_inum;		/* inode # of file */
	short tcb_stat;			/* state of TCB (see below) */
	short tcb_flag;			/* flag bits (see below) */
	union {
		struct { /* fields used for file block tokens */
			off_t TCB_foff;		/* file pointer */
			struct tok_ctrlb *TCB_chain;	/* link to next TCB */
			long TCB_fflag;		/* flags in the file block */
		} tcb_ft;
		struct { /* fields used for inode tokens */
			sitemap_t TCB_rdmap;	/* sites with read inode token*/
			siteno_t TCB_modsite;	/* site with mod inode token */
		} tcb_it;
	} tcb_un;
};
#define tcb_master tcb_lc.TCB_master
#define tcb_rqchn  tcb_lc.TCB_rqchn
#define tcb_foff tcb_un.tcb_ft.TCB_foff
#define tcb_chain tcb_un.tcb_ft.TCB_chain
#define tcb_modsite tcb_un.tcb_it.TCB_modsite
#define tcb_rdmap tcb_un.tcb_it.TCB_rdmap
#define tcb_fflag tcb_un.tcb_ft.TCB_fflag

/* Values of the tcb_stat field */
#define TCB_FREE   0	/* free TCB slot */
#define TCB_IDLE   1	/* token not granted */
#define TCB_BUSY   2	/* token granted to token site(s) */
#define TCB_ALERT  3	/* token site notified to release token */

/* Flag bits in tcb_flag and ntk_flag fields */
#define TCB_INODE	1	/* TCB is for an inode token */
#define TCB_FORMOD	2	/* file block token open for mod */
#define TCB_RCLOSED	4	/* pipe reader has closed (NM_AWARDTOK) */
#define TCB_WANTED	8	/* when passing token, please give back */
#define TCB_SLAVE	0x40	/* non-primary fifo open block */
#define TCB_INUSE	0x80	/* temporary flag for tracking slave/master */
#define TCB_STATWAIT	0x1000	/* a tkmgr site proc waiting for offset info */

/* Want flag bits used in passing token(s). */
#define TCB_FREL	0x10	/* file pointer token wanted back */
#define TCB_CACHEOK	0x20	/* remote buffer cache valid */
#define TCB_IREL	TCB_WANTED	/* inode token wanted back */

/* passed from the SS with the token to * indicate an enforced lock on
 * the file.  When the the us accesses the file, it will check at the
 * CSS first. */
#define	TCB_ENFLOCK	0x40

/* passed to release_token, to only prepare for releasing token. */
#define TCB_PREPONLY	0x40

/* passed in NM_AWARDTOK and when file is changed and should be committed */
#define TCB_IUPD	0x80

/* passed to igrant_token indicates TCB_IREL bit shouldn't be sent */
#define TCB_NOIREL	0x100

/*
 *  This structure describes the list of sites which may
 *  reference the token,  this list doubles also as the
 *  token request queue (first part of the site list), 
 *  and holds the current TS as its top element(s).
 */
struct tok_loci {
	char	tlci_stat;
	char	tlci_site;	/* token site  */
	short	tlci_fdes;	/* file descriptor  */
	struct tok_loci *tlci_chain;  /* link field */
	struct tok_ctrlb *tlci_tcb; /* token control block (slavetcb) */
};

/* Values of the tlci_stat field */
#define LCI_UNUSED    0		/* Unallocated entry in table */
#define LCI_TOKEN     1		/* Token granted to this site */
#define LCI_REQUEST   2		/* Token requested by this site */
#define LCI_ELIGIBLE  3		/* Site neither requested nor has token */
#define LCI_FREQUEST  4		/* Token held, and re-requested */

#define LCI_MASK      7		/* Mask for the stat field above */
#define LCI_FORMOD    8		/* Only used for inode token ?? */
#define LCI_INFORMED  16	/* Granted unusable token once */

/* flag bits returned by init_tcb */
#define SLAVEMOD	0x01	/* tcb added for mod was not the first */
#define MASTERMOD	0x02	/* tcb added for mod was the first tcb */
#define SLAVEREAD	0x04	/* tcb added for read was not first tcb */
#define MASTERREAD	0x08	/* tcb added for read was the first tcb */
#define ONEOPEN		0x10	/* this is the first and only open (r or m) */
#define EXTRAOPEN	0x20	/* this was not the first open (r or m) */
#define NOWOPEN		0x40	/* this caused both sides of pipe to be open */
#define BOTHOPEN	0x80	/* both sides of pipe were already open */

#ifdef  KERNEL
extern  struct tok_ctrlb *tcb_destoptr();
extern  struct tok_ctrlb  * tcb_table;
extern  struct tok_ctrlb  * etcb_table;
extern  struct tok_loci  * tcb_loci;
extern  struct tok_loci  * etcb_loci;

	/* head of the token control block free list */
extern  struct tok_ctrlb  * tcb_flist;
	/* head of the site control block free list */
extern  struct tok_loci  * tcbl_flist;
extern struct tok_loci *find_rqsite();
extern struct tok_loci *tsite_alloc();
extern struct tok_ctrlb *tcb_alloc();
#endif  /* KERNEL */

/****************************************************************
 * The nmtokens structure is used to as the variant portion of
 * the netmsg for messages which control the passing and use
 * of file descriptor and inode tokens.  This includes the
 * following request messages:
 * 	NM_TOKINIT, NM_RQSTOK, NM_RELTOK, NM_AWARDTOK,
 *	NM_TOKRLSD, NM_CLRTOK
 * and the response to the following message:
 *	NM_TOKINIT
 ***************************************************************/
struct nmtoken {
	PADOPEN(NTKlongs)
	gfs_t		Ntk_gfs;	/* global file system number       */
	ino_t		Ntk_inum;	/* inode number within the gfs     */
	off_t		Ntk_isize;	/* file size (in bytes)            */
	off_t		Ntk_foff;	/* rd/wr offset or blocks (inode)  */
	off_t		Ntk_fxread;     /* FIFO read ptr or (inode) ctime  */
	time_t		Ntk_mtime;	/* mod time (inode) or pgrp (fifo) */
	long		Ntk_fflag;	/* flags in the file block         */
	PADCLOSE(NTKlongs, xNTKlongs, xUNTKlongs)
#define ntk_gfs		xUNTKlongs.xNTKlongs.Ntk_gfs
#define ntk_inum	xUNTKlongs.xNTKlongs.Ntk_inum
#define ntk_isize	xUNTKlongs.xNTKlongs.Ntk_isize
#define ntk_foff	xUNTKlongs.xNTKlongs.Ntk_foff
#define ntk_blocks	xUNTKlongs.xNTKlongs.Ntk_foff
#define ntk_fxread	xUNTKlongs.xNTKlongs.Ntk_fxread
#define ntk_ctime	xUNTKlongs.xNTKlongs.Ntk_fxread
#define ntk_mtime	xUNTKlongs.xNTKlongs.Ntk_mtime
#define ntk_pgrp	xUNTKlongs.xNTKlongs.Ntk_mtime
#define ntk_fflag	xUNTKlongs.xNTKlongs.Ntk_fflag
#define NNTKLONGS	(sizeof (struct NTKlongs) / sizeof (long))

	PADOPEN(NTKshorts)
	islot_t		Ntk_ssislot;	/* storage site incore inode slot  */
	short		Ntk_fdes;	/* file descriptor used by tokens  */
	short		Ntk_tcbdes;	/* token control block descriptor  */
	short		Ntk_flag;	/* token control flags; see above  */
	short		Ntk_iflag;	/* inode FIFO flags		   */
	PADCLOSE(NTKshorts, xNTKshorts, xUNTKshorts)
#define ntk_ssislot	xUNTKshorts.xNTKshorts.Ntk_ssislot
#define ntk_fdes	xUNTKshorts.xNTKshorts.Ntk_fdes
#define ntk_tcbdes	xUNTKshorts.xNTKshorts.Ntk_tcbdes
#define ntk_flag	xUNTKshorts.xNTKshorts.Ntk_flag
#define ntk_iflag	xUNTKshorts.xNTKshorts.Ntk_iflag
#define NNTKSHORTS	(sizeof (struct NTKshorts) / sizeof (short))
};

#ifndef  NOCHECKS
/* If the following statement causes a compiler warning or error,
 * then the length of the nmtoken structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMTK, nmtoken);
#endif /* ~NOCHECKS */

struct nmfifo {
	PADOPEN(NFIlongs)
	gfs_t	Nfi_gfs;		/* global file system number	*/
	ino_t	Nfi_inum;		/* inode number 		*/
	pid_t	Nfi_pgrp;		/* read/write process group	*/
	long 	Nfi_fflag;		/* file flags			*/
	PADCLOSE(NFIlongs, xNFIlongs, xUNFIlongs)
#define NNFILONGS	(sizeof (struct NFIlongs) / sizeof (long))
#define nfi_gfs		xUNFIlongs.xNFIlongs.Nfi_gfs
#define nfi_inum	xUNFIlongs.xNFIlongs.Nfi_inum
#define nfi_pgrp	xUNFIlongs.xNFIlongs.Nfi_pgrp
#define nfi_fflag	xUNFIlongs.xNFIlongs.Nfi_fflag
	PADOPEN(NFIshorts)
	islot_t		Nfi_ssislot;	/* storage site incore inode slot  */
	short		Nfi_iflag;	/* inode flags			*/
	PADCLOSE(NFIshorts, xNFIshorts, xUNFIshorts)
#define NNFISHORTS	(sizeof (struct NFIshorts) / sizeof (short))
#define nfi_iflag	xUNFIshorts.xNFIshorts.Nfi_iflag
#define nfi_ssislot	xUNFIshorts.xNFIshorts.Nfi_ssislot
};

/*
 * netmessage packet var overlay for NM_PIPESIZE netmessage
 */
struct nmpipesize {
	PADOPEN(nmpip_longs)
	gfs_t	Nmpip_gfs;	/* Gfs inode lives on */
	ino_t	Nmpip_inum;	/* inode of fifo to get size of */
	off_t	Nmpip_pipesize;	/* Total free blocks	*/
	PADCLOSE(nmpip_longs, nmpipLS, nmpipLU)
#define	nmpip_gfs	nmpipLU.nmpipLS.Nmpip_gfs
#define	nmpip_inum	nmpipLU.nmpipLS.Nmpip_inum
#define	nmpip_pipesize	nmpipLU.nmpipLS.Nmpip_pipesize
#define	NNPIPLONGS	(sizeof(struct nmpip_longs) / sizeof(long))
};

#ifndef  NOCHECKS
/* If the following statement causes a compiler warning or error,
 * then the length of the nmustat structure is larger than NMVARSIZE
 * and one or the other must be changed.
 */
CHECKNMVARSIZE(xNMPI, nmpipesize);
#endif  /* ~NOCHECKS */


#endif /* ~_h_TOKENS */
tcb_akêÆˆ È  íA            ‰*c‰*c‰*       €             
       ./usr/include/sys/tools kêð) –  $          b‰*ªšˆ*b‰*     Zˆ  	                  ./usr/include/sys/tools/corestat.h   h  /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)corestat.h	16.2	LCC)	/* Modified: 12:11:12 2/22/89 */
/* SCCSIDPUFF(@(#) corestat.h 10.20  LM: 02:03:51 9/12/86)  /* Created: 02:04:27 9/12/86 */

/*
 * This program goes through core dump files of the operating system
 * and pulls out useful information about the data structures.
 *
 * All virtual address references must be mapped to physical addresses
 * before we can retrieve data properly from the file.
 *
 * Modified from pstat and system source by bob.
 *
 * Made to work, with address mapping and user structure information,
 * by sean.
 *
 * Split into pieces by greg t.
 */

#ifndef _h_PARAM
#include <param.h>
#endif _h_PARAM
#ifndef _h_VAR
#include <var.h>
#endif _h_VAR

#include <vmread.h>

#ifndef TRUE
#define	TRUE	1
#define	FALSE	0
#endif

#ifdef	vax
#define	clear(x) ((int)(x)&~0x80000000)
#define follow(x) ((void)lseek(fc,(long)vtop((int)(x)),0))
#define sub(x,y) ((clear(x)-clear(y))/sizeof(*y))
#define add(x,y) ((clear(x)+(y)*sizeof(*(x)))|0x80000000)
#define	FLEXNAMES	1
#endif	vax
#ifdef	u370
#define	clear(x) ((int)(x))
#define follow(x) ((void)lseek(fc,(long)vtop((int)(x)),0))
#define sub(x,y) ((clear(x)-clear(y))/sizeof(*y))
#define add(x,y) ((clear(x)+(y)*sizeof(*(x))))
#endif	u370

#ifdef	M_I286
#define	clear(x) ((long)(x))
#define follow(x) ((void)lseek(fc,(long)(x),0))
#define sub(x,y) ((clear(x)-clear(y))/sizeof(*y))
#define add(x,y) ((clear(x)+clear(y)*sizeof(*(x))))
#endif	M_I286

#ifdef	i386
#define	clear(x) ((int)(x))
#define follow(x) ((void)lseek(fc,(long)(x),0))
#define sub(x,y) ((clear(x)-clear(y))/sizeof(*y))
#define add(x,y) ((clear(x)+clear(y)*sizeof(*(x))))
#endif	i386

extern long lseek();
extern int errno;

extern  char *calloc();
extern  char *malloc();

extern  char *alloc();
#define	ALLOC	alloc

extern  char *cmalloc();
#define	CMALLOC	cmalloc

extern	struct var var;

extern  bool_t  Debugs_on;
extern  int  flactive;		/* only active table entries */

/* symbol references for the corestat pieces. */
extern long SYSMAP;
extern long SYSSIZE;
extern long SACK_STAT;
extern long SACTSITE;
extern long SAL_NEXT;
extern long SAUSLOG;
extern long SBFREELIST;
extern long SBUF;
extern long SBUFFER;
extern long SBUFFREE;
extern long SBUFHASH;
extern long SDBG;
extern long SDBG_CNT;
extern long SDBG_SW;
extern long SDBGI;
extern long SDBGI_CNT;
extern long SDBGI_RCCNT;
extern long SDBGO_2RTXCNT;
extern long SDBGO_FR2AC2;
extern long SDBGO_RDCNT;
extern long SDBGO_BUSYLP;
extern long SDBGO_CNT;
extern long SDBGO_RCCNT;
extern long SDBGO_RTXCNT;
extern long SDCHEAD;
extern long SDCBUFP;
extern long SEINTSTACK;
extern long SFIRSTSP;
extern long SFORKUTL;
extern long SGFSHASH;
extern long SGMOUNT;
extern long SIAVLIST;
extern long SINODE;
extern long SINOHASH;
extern long SINPART;
extern long Kintstack;
extern long SMAXSP;
extern long SNETMSG;
extern long SNETSTATS;
extern long SNETSW;
extern long SNIAVLIST;
extern long SWANTSBUF;
extern long SWANTSNM;
extern long SNEWPARTSET;
extern long SNEWTOP;
extern long SNMFREELIST;
extern long SNMHDR;
extern long SPANIC_SAV;
extern long SPARTSET;
extern long SPLIST;
extern long SPLIST_FLIST;
extern long SPMOUNT;
extern long SPOLLSITE;
extern long SOSMLOG;
extern long SOSMCNT;
extern long SPROC;
extern long SPROC_ACTIVE;
extern long SPROC_FLIST;
extern long SPROPLIST;
extern long SRMT_SLP;
extern long SRMT_WAKEUP;
extern long SSITE;
extern long SSITEDATA;
extern long SSP_TAB;
extern long SSPFREEP;
extern long SSWAPUTL;
extern char **Ksysnxt;
extern long STOKCB;
extern long STOP_STAT;
extern struct user *Ku;
extern long SV;
extern long SVERSION;
extern long SKSTACK;
Ntkkê’Ó •  $        ï  b‰*«šˆ*b‰*     ‹‰ï  	              «Ž  ./usr/include/sys/tools/crash.h 
/*H_SCCSID(@(#)crash.h	16.7	LCC)	/* Modified: 17:29:44 4/24/92 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/************************************************************************
 * Crash for IX/370 Release 2
 *
 * 1. Include structure rearranged, param.h includes DOPTIONS.h which
 *    comes with types.h and so forth.
 * 2. GFLD constant added.
 * 3. INODE constant renamed.
 * 4. New external definitions for buffer hash chain and free list
 *    introduced.
 * 5. BUFHSH and BUFLIST added.
 * 6. OSM added.
 * 7. Constants for net message buffer (dbg) added.
 * 8. Constants for net switch and statistics added.
 * 9. Constants for net buffers and freelist added.
 * 10.Constants for siet table and data added.
 * 11.Constants for topology change variables added.
 * 12.Constants for server process table added.
 * 13.Constants for remote wakeup/sleep table added.
 * 14.Constants for propagation table added.
 * 15.Extern declaration for gfld structure added, need for osm.
 * 16. Type IsaCpy_t defined, IsaCopy defined.
 * 17. Added GfsHash, and SGFSHASH
 */
#ifdef	NLS
#define printf NLprintf
#define fprintf NLfprintf
#define sprintf NLsprintf
#define strcat NLstrcat
#define strcpy NLstrcpy
#define strlen NLstrlen
#define strcmp NLstrcmp
#endif	NLS

#include  <sys/param.h>
#include  <a.out.h>
#include  <symbol.h>
#include  <vmread.h>
#include  <sys/dir.h>
#include  <sys/user.h>
#include  <sys/var.h>
#include  <logs.h>
#include  <sys/utsname.h>
#include  <stdio.h>
#include  <sys/tty.h>
#include  <sys/psl.h>
#ifdef u370
#include  <sys/b370/dump.h>
#include <b370/page0.h>
#endif
#ifdef i386
#include <sys/i386/mmu386.h>
#endif

#ifndef TRUE
#define	TRUE	1
#define	FALSE	0
#endif

#ifdef u370
#ifdef b370
#define MEMDEV	"/dev/pmem"
#else
#define MEMDEV	"/dev/mem"
#endif
#else
#define MEMDEV	"/dev/kmem"
#endif

#ifdef M_XENIX
/*******************************************************************************
 * XENIX uses xlist rather than the nlist interface
 */
#define NLIST xlist
#define NM_NAME xl_name
#define NM_VALUE xl_value
#define NM_TYPE xl_type
#define XLIST 1

#else

/*******************************************************************************
 * the other machines use nlist
 */

#ifdef n_name
#undef n_name
#endif

#define NLIST nlist
#define NM_NAME n_name
#define NM_VALUE n_value
#define NM_TYPE n_type

/******************************************************************************/
#endif

/*
 * u3b warning:  nl[0] will be "proc" and nl[1] will be "_v"
 * regardless of what variables appear below.
 */

/******************************************************************************/

/******************************************************************************/

#define SYM_VALUE(ptr)		(ptr->nlist.NM_VALUE & ~HIGHBIT)

#define Db	if(dbflag)
#define DbON	static int dbflag = 1;
#define DbOFF	static int dbflag = 0;

#if defined(X_286) || defined(i386) || defined(b370)
extern struct symrec *hashtable[];
#endif

struct	frame	{
	unsigned  f_r5;
	unsigned  f_ret;
} ;

struct	dstk	{
	int	r13;
	int	r12;
	int	r11;
	int	r10;
	int	r9;
	int	r8;
	int	r7;
	int	r6;
	int	r5;
	int	r4;
	int	r3;
	int	r2;
	int	r1;
	int	r0;
	int	ipl;
	int	mapen;
	int	pcbb;
	int	stkptr;
} ;

struct	glop	{
	int	g_x0;
	int	g_x1;
	int	g_r0;
	int	g_r1;
	int	g_r2;
	int	g_r3;
	int	g_r4;
	int	g_r5;
	int	g_sp;
	unsigned  int  g_ka6;
} ;

struct	tsw	{
	char	*t_nm;
	int	t_sw;
	char	*t_dsc;
	char	*t_usage;
} ;

struct	prmode	{
	char	*pr_name;
	int	pr_sw;
} ;

#define VM	0	
#define	USIZ	(UPAGES * NBPG)
#define	UPGS	(UPAGES + x.u.u_pcb.pcb_szpt)
#define	STKHI	(sizeof(struct user))
#define MAXI	30

#define	NOPID		(-1)
#define	NOPROCSLOT	(-1)
#define	NOUAREA		(-1)

extern	int	allflag;
extern	struct	var	var;
extern	int	kmem;
extern	int	umem;
extern	long	ka6;
extern	int	vm_is_dump;			/* dump==true if "dumpfile" is a dump,
extern char *dumpfile;
extern char *kmemory;
extern char *memory;
extern char *cmdname;
			           	 * false if its a live mem device 
					 */

extern	int	dbflag;			/* Turns on/off debug output */

extern	union	uarea {
	struct user u;
#ifndef X_286
	char	stk[(UPAGES * NBPG)];		/* USIZE (UPAGES*NBPG) */
#else X_286
	char	stk[KSSIZE];		
#endif X_286
} x;


struct	nmsz	{
	char	nm[20];
	int	sz;
};
#define	NUMNM	40
extern	struct	nmsz	nmsz[NUMNM];

extern	long	SFILE, SINODE, SGFSHASH, SGMOUNT, SPMOUNT, SWAP, SPROC,
		SYS, STIME, SETEXT, STEXT, SV, SBUF, SBUFFER, SOSMLOG,
		SEND, SCALLOUT, SLBOLT, SDMPSTK, SUMAP, SUSRPT, SU, SFPT,
		SOSMlOG, SBUFHASH, SBUFFREE, SKINTSTACK,
		SDBGBUF, SDBGINDEX, SDBGICNT, SDBGOCNT, SDBGCNT,
		SSC_ACTIVE, SSC_FREE, SSITE, SSITEDATA, SNETSW, 
		SNETSTATS, SNETMSG, SNMHDR, SNMFREELIST,
		STOPSTAT, SACTSITE, SPOLLSITE, SINPART,
		SPARTSET, SNEWTOP,  SNEWPARTSET,
		SFIRSTSP, SMAXBUFS, SMINBUFS, SMAXSP, SSPTAB,
		SSPFREEP, SPLIST,   SPROPLIST,SPLISTFLIST,
		SRMTWAKE, SRMTSLEEP, SPANIC, SPANIC_SAV,
		SPROC_ACTIVE, SPROC_FLIST,
		SGENSW, SNFSDEV,
		STCADEV, STCATRTBL, STCATRACEENTRIES,
		SDCHEAD, SDCBUF,
		STOKCB,  STOKLCI
		;
#ifdef	b370
extern	long	SVSEGIPHSIZE, SVSEGIPHASH;
#endif

extern	struct	symrec	*File, *Inode, *GMount, *PMount, *Swap, *Proc,
			*Sys, *Time, *Panic, *Panic_Sav, *Etext, *V, 
			*Buf, *GfsHash,
			*End, *Callout, *Lbolt, *Dmpstk, *Umap, *U, *Upages,
			*Fpt, *OsmLog, *BufHash, *BufFree, *Kintstack,
			*DbgBuf, *DbgIndex, *DbgiCnt, *DbgoCnt, *DbgCnt,
			*Sc_active, *Sc_free, *Site, *Sitedata, *Maxbufs
			, *Minbufs, *Netsw, *Netstats, *Netmsg, *Nmhdr,
			*Nmfreelist, *Topstat, *Actsite, *Pollsite,
			*Inpart, *Partset, *Newtop,  *Newpartset,
			*Firstsp, *Maxsp,   *Sptab, *Spfreep,
			*Plist,   *Proplist,*PlistFlist,
			*RmtWake, *RmtSleep,
			*ProcActive, *ProcFlist,
			*Gensw, *Nfsdev,
			*TcaDev, *TcaTrTbl, *TcaTraceEntries,
			*Dchead, *Dcbuf,
			*TokCB,  *TokLCI
			;
#if	defined(MM_VSEGS)
extern struct symrec *Vseg_busylist;
#ifdef	b370
extern	struct	symrec	*Vsegiphsize;
extern	struct	symrec	*Vsegiphash;
#endif
#else
extern struct symrec *Text;
#endif

extern	int	flactive;		/* active flag	*/
extern	dev_t	nfsdev;

#define	STACK	1
#define	USER	2
#define	FILES	3
#define	TRACE	4
#define	QUIT	5
#define	KA6	6

#define	C_INODE	7

#define	MOUNT	8
#define	TTY	9
#define	Q	10
#if	!defined(MM_VSEGS)
#define	TEXT	11
#else
#define	VSEG	11
#define	PVSEG	12
#endif
#define	TS	13
#define	DATAS	14
#define	PROC	15
#define	STAT	16
#define	R_5	17
#define	BUFHDR	20
#define	BUFFER	21
#define	TOUT	22
#define	NM	23
#define	OD	24
#define	MAP	25
#define	VAR	28
#define BUFLOG	29
#define INOLOG 	30
#define SEMALOG	31
#define PVLG	32
#define VBLOG	33
#define ISA	34
#define PID	35
#define TERMLOG	36
#define FPTERM	37
#define	QUALIFY 38
#define	ADDR	39
#define SLOT	40
#define RDMLOG	41
#define	RDTABLE	42
#define	MHTABLE	43
#define NSC	44
#define	RDDLOG	45
#define MALL	46
#define	GFLD	47
#define	BUFHSH	48
#define	BUFLIST	49
#define	OSM	50
#define	NETLOG	51
#define	NETSW	52
#define	NETBUF	53
#define	NETLIST	54
#define	SITE	55
#define	TOPLOG	56
#define	SPTAB	57
#define	RMTSLP	58
#define	RMTWAKE	59
#define	PROP	60
#define	ACTIVE	61
#define	ALL	62
#define	DUMPDB	63
#define	MEMORY	64
#define	TCA	65
#define	DCACHE	66
#define	GENSW	67
#define	TOKEN	68
#define	TOKREQ	69
#define	SYSTAB	70
#define PCBLK	71
#define PAGE0	72
#define	USAGE	73
#define	DMPHEAD	74
#define VSHASH	75
#define MBLIST	76


#define	DIRECT	2
#define	OCTAL	3
#define	DECIMAL	4
#define	CHAR	5
#define	C_WRITE	6

#define	C_INODE	7

#define	BYTE	8
#define	SDEC	9
#define	SOCT	10
#define	HEX	11
#define SUPERBLK 12
#define STRING	13

/* Make local verson of atoi not conflict with "standard" version */
#define	atoi	cr_atoi
(kêŽ£ ”  $        ß  b‰*­šˆ*b‰*     ðÁß  	                  ./usr/include/sys/tools/klist.h /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef	TOOL_KLIST
#define	TOOL_KLIST

#ifndef	H_SCCSID
#include <sccs.h>
#endif H_SCCSID
H_SCCSID(@(#)klist.h	16.3	LCC)	/* Modified: 20:24:09 9/16/89 */
/* long variable names */
#define	PICK(a,b)	a
struct klist {
	char *kl_name;
	long *kl_var;
};

#endif	TOOL_KLIST
TkêF¢ “  $        ;  b‰*®šˆ*b‰*     W;  	                  ./usr/include/sys/tools/logs.h  /* SCCSID(@(#)logs.h	16.2	LCC)	/* Modified: 20:24:56 9/16/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*
 * These structures define the logs kept by various system functions.
 */

/*
 * buflog -	buffer activity recorded by routines in io/bio.c by calling
 *		ml/buflog.s
 */

struct	buflog  {
	unsigned int	: 0;		/* Align */
	char	bl_type;	/* type of log entry as described below. */
	char	bl_unu;		/* unused */
	pid_t	bl_tid;		/* The taskid of the caller */
	int	bl_bufp;	/* Pointer to the buffer being used */
	int	bl_rtrnp;	/* Return pointer to calling routine */
	int	bl_fcnt;	/* Free buffer count */
} ;

#define BLT_BRED	0
#define BLT_BREA	1
#define BLT_BWRITE	2
#define BLT_BDWRITE	3
#define BLT_BAWRITE	4
#define BLT_BRELSE	5
#define BLT_GETBLK	6
#define BLT_GETABLK	7
#define BLT_BFLUSH	8

#define BUFLOGSZ	4*16*256

/*
 * vbuflog - log of allocation and release of variable length system buffers.
 */
 
struct vbuflog {
	unsigned int	: 0;		/* Align */
	char	vb_type;	/* Type code as defined below. */
	char	vb_unu;		/* Unused, not defined below. */
	pid_t 	vb_pid;		/* The process id */
	int	vb_buf;		/* Address of the control word of buffer */
	int	vb_size;	/* Size of the buffer. */
	int	vb_rtrn;	/* Return ptr from malloc or mfree. */
} ;
 
#define VBUFLOGSZ	3*16*256

#define VBT_MALLOC	0	/* Called from malloc. */
#define VBT_MFREE	1	/* Called from mfree. */

/*
 * semalog - Log of semaphore activity.
 */

struct semalog {
	unsigned int	: 0;		/* Align */
	int	sl_caller;	/* Address of caller of semaphore routine. */
	pid_t	sl_pid;		/* Process id of caller. */
	short	sl_type;	/* Code for semaphore routine called. */
	int	sl_semad;	/* Address of semaphore. */
	int	sl_semval;	/* Value of semaphore on entry.	*/
} ;

#define SEMALOGSZ	9*16*256
#define PVLOGSZ		0*16*256

#define SLT_PSEMA	0
#define SLT_VSEMA	1
#define SLT_CPSEMA	2
#define SLT_CVSEMA	3
#define SLT_INITSEMA	4
#define SLT_PSNR	5
#define SLT_PSPSR	6
#define SLT_PSINT	7

/*
 * inolog - log of inode activity 
 */

struct	inolog {
	unsigned int	: 0;		/* Align */
	char	il_type;		/* inode function requesting logging */
	char	il_unu1;	/* Unused */
	pid_t	il_pid;		/* Process id of caller */
	int	il_iptr;	/* Pointer to inode */
	int	il_rtrn;	/* Address of call */
	short	il_unu2;	/* Unused */
	ushort	il_inum;	/* Inode Number */
};
#define	INOLOGSZ	4*16*256

/*
 * Termlog - log of Series/1 Terminal Activity
 */
struct	termlog {
	unsigned int	: 0;		/* Align */
	ushort	tl_nau;		/* SNA Network Address */
	pid_t	tl_pid;		/* Process id of caller */
	int	tl_tbl;		/* Ptr to ttyfpt table entry */
	char	tl_type;	/* Type of call as defined below */
	char	tl_unu1;	/* Unused */
	short	tl_len;		/* Record length including resp. hdr. */
	int	tl_unu2;	/* Unused */
	int	tl_rec[4];		/* SNA record or tii */
};
#define TLOGSZ	32*32*128
ne	NEkê¸ ’  $        ø  b‰*®šˆ*b‰*     üWø  	                  ./usr/include/sys/tools/stack.h /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef TOOL_STACK
#define	TOOL_STACK
#include <sccs.h>
#ifndef H_SCCSID
#endif /* ~H_SCCSID */
H_SCCSID(@(#)stack.h	16.3	LCC)	/* Modified: 20:25:46 9/16/89 */

typedef	int	stack_t;

#if	defined(vax)
#define	CS_FP	0
#define	REGMASK	1
#define	NEWFP	2
#define	NEWAP	3
#define	OLDPC	4
#define	REGS	5
#define	CS_AP	6
#define	NUMSTKSTUFF	7
#endif	defined(vax)

#if	defined(i386)
#define	STK_BP	0
#define	STK_CS	1
#define	STK_IP	2
#define	NUMSTKSTUFF	3
#endif	defined(i386)

#if	defined(b370)
extern	label_t stkstuff;
#else
extern	stack_t	*stkstuff[];
#endif

/* I'm going to define the offsets in my label_t once and for all,	*/
/* rather than everyplace just before I need them.  Others might want	*/
/* to do the same.							*/
/* Really this should be near the definition of a label_t in types.h	*/
#ifdef i386
#define	LABEL_SP	0
#define	LABEL_IP	1
#define	LABEL_BP	2
#define	LABEL_SI	3
#define	LABEL_DI	4
#define	LABEL_BX	5
#endif i386

#if	defined(b370)
#define	LABEL_R2	0
#define	LABEL_R3	1
#define	LABEL_R4	2
#define	LABEL_R5	3
#define	LABEL_R6	4
#define	LABEL_R7	5
#define	LABEL_R8	6
#define	LABEL_R9	7
#define	LABEL_R10	8
#define	LABEL_R11	9
#define	LABEL_R12	10
#define	LABEL_R13	11
#define	LABEL_R14	12
#define	LABEL_R15	13
#define	LABEL_UNUSED1	14
#define	LABEL_UNUSED2	15
#endif	/* b370 */

#endif	TOOL_STACK
kê˜G ‘  $        A  b‰*¯šˆ*b‰*     úyA  	                  ./usr/include/sys/tools/symbol.h h   h  /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef	TOOL_SYMBOL
#define	TOOL_SYMBOL
#ifndef H_SCCSID
#include <sccs.h>
#endif H_SCCSID
H_SCCSID(@(#)symbol.h	16.5	LCC)	/* Modified: 23:22:29 12/20/89 */

#if	defined(CC4) || defined(_BSD)
#include <a.out.h>
#else	/* !(CC4 || _BSD) */
#include <nlist.h>
#endif	/* !(CC4 || _BSD) */

#if	defined(CC4) || defined(_BSD)
#define NAME n_un.n_name
#else	/* !(CC4 || _BSD) */
#define NAME n_name
#endif	/* !(CC4 || _BSD) */
#define VALUE n_value
#define TYPE n_type

#ifdef	vax
typedef	struct nlist SYMTAB;
#endif vax

#if defined(u370) || defined(i386)
typedef  struct syment  SYMTAB;
#endif  u370

#endif	TOOL_SYMBOL

#if defined(X_286) || defined(i386) || defined(b370) || defined(vax)
struct symrec  {
	struct nlist nlist;
	struct symrec *next;
};
extern struct symrec *hashtable[];
#endif

#ifdef M_XENIX

#define KOFF(sym)	((long) (sotofar(sym->nlist.xl_seg,sym->nlist.xl_value)))

#endif 

#ifdef i386

#define KOFF(sym)	(sym->nlist.VALUE)
#define	VADDR(addr)	((unsigned)(addr))

#endif

#ifdef vax

#define KOFF(sym)	(sym->nlist.VALUE & 0x3fffffff)
#define	VADDR(addr)	((unsigned)(addr) & 0x3fffffff)

#endif

#if defined(u3b) 

#define KOFF(sym)	(sym->VALUE & ~HIGHBIT)
#define	VADDR(addr)	((unsigned)(addr) & ~HIGHBIT)

#endif

#ifdef u370

#define KOFF(sym)	(sym->nlist.VALUE & ~HIGHBIT)
#define	VADDR(addr)	((ulong)(addr) & ~HIGHBIT)

#endif

#define KISLOT(x)	SUB(x,(struct inode *)SINODE)

#define	CLEAR(x)	((int) x)
#define	SUB(x,y)	((CLEAR (x) - CLEAR (y)) / sizeof (*y))
#define	ADD(x,y)	((CLEAR (x) + (y)*sizeof (*(x))))


#define	HIGHBIT		(unsigned)0x80000000

extern long getsymaddr();
extern struct symrec *symsrch(),*search();

#definekê&€   $          c‰*¯šˆ*c‰*     Fƒ  	                  ./usr/include/sys/tools/tools.h 
H_SCCSID(@(#)tools.h	16.3	LCC)	/* Modified: 20:27:23 9/16/89 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#define	DIRECT	2
#define	OCTAL	3
#define	DECIMAL	4
#define	CHAR	5
#define	C_WRITE	6

#define	C_INODE	7

#define	BYTE	8
#define	SDEC	9
#define	SOCT	10
#define	HEX	11
#define SUPERBLK 12
#define STRING	13

#define	HIGHBIT		(unsigned)0x80000000

struct	prmode	{
	char	*pr_name;
	int	pr_sw;
} ;

extern	struct var var;

extern struct	prmode	prm[]; 
defkê$/   $        1  c‰*°šˆ*c‰*     u1  	                  ./usr/include/sys/tools/vmread.h h   h  /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef TOOL_VMREAD
#define	TOOL_VMREAD

#ifndef	H_SCCSID
#include <sccs.h>
#endif H_SCCSID
H_SCCSID(@(#)vmread.h	16.4.1.1	LCC)	/* Modified: 14:24:35 3/18/92 */

int vmread();
long vtop();
caddr_t getptr();
long getlong();
int getint();
short getshort();
int getbyte();
char *vmreadtab();

/* interface variables */
/* provided by client before call to vmopen */
#ifdef	u370
extern char **Ksysnxt;
extern char *symfile;	/* This is evil, and probably wastes time */
#endif	u370
#ifdef	vax
extern long SYSSIZE;
extern long SYSMAP;
extern long Kintstack;
#endif	vax

/* initialized by call to vmopen */
#ifdef vax
extern long slr;
extern struct pte *sbr;
#endif vax

extern int vm_is_dump;		/* true if this is a dump file */

/* The dump code has the ability to perform partial dumps that do not	*/
/* contain the stacks for the user processes.  no_ptod_msg is used to	*/
/* suppress the ptod() error message when ps tries to examine the user	*/
/* stacks.  The ps command already has code to allow correct operation	*/
/* in the event that the user stack are not available.			*/
extern int no_ptod_msg;

/* WARNING:  vm_fd is not for general use, and as soon as I build a set */
/* of subroutines to access /dev/mem, /dev/swap, and dumps of processes */
/* other than the panic process it will probably go away.		*/
extern int vm_fd;		/* fd of dump file */
#endif TOOL_VMREAD
,(struckêH) õ  $        /  T‰*ž™ˆ*T‰*     ùf/  	              y™  ./usr/include/sys/topchg.h ead.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)topchg.h	16.4	LCC)	/* Modified: 18:59:00 9/22/89 */

#ifndef _h_TOPCHG
#define _h_TOPCHG

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */

#ifndef _h_PARAM
#ifdef  KERNEL
#include <param.h>
#else  /* ~KERNEL */
#include <sys/param.h>
#endif /* ~KERNEL */
#endif /* ~_h_PARAM */

#ifndef _h_MOUNT
#ifdef  KERNEL
#include <mount.h>
#else  /* ~KERNEL */
#include <sys/mount.h>
#endif /* ~KERNEL */
#endif /* ~_h_MOUNT */

struct tp_pmount {
	PADOPEN(Tplongs)
	fstore_t	Tp_fstore;
	commitcnt_t	Tp_lwm;
	ino_t		Tp_oninum;
	gfs_t		Tp_gfs;
	gfs_t		Tp_ongfs;
	ino_t		Tp_tino;
	PADCLOSE(Tplongs, Tpl_ls, Tpl_lu)
#define	tp_fstore	Tpl_lu.Tpl_ls.Tp_fstore
#define	tp_lwm		Tpl_lu.Tpl_ls.Tp_lwm
#define	tp_oninum	Tpl_lu.Tpl_ls.Tp_oninum
#define	tp_gfs		Tpl_lu.Tpl_ls.Tp_gfs
#define	tp_ongfs	Tpl_lu.Tpl_ls.Tp_ongfs
#define	tp_gfsindex	Tpl_lu.Tpl_ls.Tp_gfs
#define	tp_ongfsindex	Tpl_lu.Tpl_ls.Tp_ongfs
#define tp_tino		Tpl_lu.Tpl_ls.Tp_tino
#define	NTPMLONGS	(sizeof(struct Tplongs) / sizeof(long))

	PADOPEN(Tpshorts)
	unsigned short	Tp_sbflags;
	pckno_t	Tp_gfspack;
	PADCLOSE(Tpshorts, xTpshorts, xUTpshort)
#define tp_sbflags	xUTpshort.xTpshorts.Tp_sbflags
#define tp_gfspack	xUTpshort.xTpshorts.Tp_gfspack
#define	NTPMSHORTS	(sizeof(struct Tpshorts) / sizeof(short))
};

#define	TP_PARTITION	1
#define	TP_CLEANUP	2
#define	TP_MERGE	3
#define	TP_NEWTOP	4
#define TP_RECOVERY	5
#define TP_CANCEL	6
#define	TP_WAIT		7
#define	TP_STABLE	8

#ifdef KERNEL
/* gsmount gsmntlwm are used as scratch space to build the new mount table.
   it is cleared from ...() at the start of merge at the active
   site, and built in addpmount(), called from merge and
   svrpmount(). */
extern 	long	gsmntlwm[];
/* sndslot stores the last inode slot accessed by the svrsndind
   routines.  It's initialized to zero in recover(), and used in
   makilist().  */
extern  short	sndslot[];
/* gs_partset records the sites that have responded to NEWTOP
   messages with PMOUNTs.  It is used to build the merged
   partition, to avoid sending extra messages to sites and to
   avoid using duplicate PMOUNT responses.  Its value is sent
   across the net in the newtop message, and it is used in
   recover() to generate the new site table. */
extern	sitemap_t	gs_partset;
/* partset includes all sites thought by the system to be members
   of the local partition.  All sites included in partset are
   considered UP.  All sites not in partset are down, or will be
   declared down before the cleanup phase of topchg finishes.
   Sites are added to partset in recover().  Sites are removed
   in svrsitedown, svrnewpartset, and partition.
   */
extern  sitemap_t	partset;
/* newpartset is used as a semaphore by partition() and
   svrnewpartset.  partition() clears it and waits to be awakened
   by svrnewpartset.  At the beginning of the cleanup phase, it
   contains the new partition set, which is transfered to "partset"
   It is also used by "merge" to record the union of all known
   partitions.  When a site joins the partition, it adds its own
   partition to that already in newpartset, and the result is
   compared with gs_partset to decide whether to wait for more
   sites to respond.
   */
extern  sitemap_t	newpartset;
/* dsitemap includes all sites for which the local site must run
   cleanup.  Sites are added in net_sitedown, when sites go down,
   and in partition(), when sites are deleted from partset.  The map
   is tested and cleared in sitedown().
 */
extern  sitemap_t	dsitemap;
/* process tracking variables, ask richard */
extern	sitemap_t	ptrkto;		/* sites I need to send orig data to */
extern	sitemap_t	ptrkfrom;	/* sites I need to receive data from */
extern	sitemap_t	ptrkall[];	/* 2-D bit array: for each site in the
					 * partition, to whom will it send
					 * data
					 */
/* used to identify GETTOP requests and PMOUNT repsonses. */
extern long cur_topseq;	/* the sequence number specified by the currently
			 * active site */
#define TOPSEQ_SHIFT 16	/* the active site will calculate "cur_topseq" from:
			 *	(loc_site << TOPSEQ_SHIFT) + next_topseq++
			 * ("next_topseq" is a static variable in merge()) */

extern int topchg_print;
#define TOPPRT(args)	if (topchg_print) ncprintf args
extern  siteno_t	actsite;
extern  siteno_t	rootsite;
extern  siteno_t	pollsite;
/* tells wht the topchg process is doing */
extern  char	top_stat;
/* inpart is TRUE when a site has responded to the SITEDOWN
message of an active site, or is itself an active site. */
extern  char	inpart;
/* used as a semaphore by sites waiting for the NEWTOP message.  */
extern  char	newtop;
/* generic exception flag */
extern	char	top_error;
extern	char	odata_valid;	/* Is our origin site data complete? */
#endif /* KERNEL */

#define TP_TIMEOUT	180

struct ilist {
	PADOPEN(Illongs)
	sitemap_t	Il_modmap;
	ino_t		Il_num;
	PADCLOSE(Illongs, Il_ls, Il_lu)
#define	il_modmap	Il_lu.Il_ls.Il_modmap
#define	il_num		Il_lu.Il_ls.Il_num
#define	NILLONGS	(sizeof(struct Illongs) / sizeof(long))
};

#define MAXILIST  ( N_BSIZE/sizeof(struct ilist) )

#endif /* ~_h_TOPCHG */
tkêüü ô  $        ½  U‰*ž™ˆ*U‰*     £‡½  	                  ./usr/include/sys/trace.h  ead.h#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)trace.h	16.9	AIX);	/* Modified 10/22/91 12:41:46 */

/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/*****************************************************************************
*                                                                            *
* Communication areas for trace driver                                       *
*
* Changes:      3/86 (vrb) rearrange fields in tr_struct; add t_struct
*****************************************************************************/

/*
 * TRACE SUBCHANNELS
 *	these must be defined, whether tracing is enabled or not, so that
 *	the symbols will be defined when instrumented modules are compiled
 */
#define TR_USER		(31<<11)
#define TR_SHM		(30<<11)
#define TR_MSGQ		(29<<11)
#define TR_SEM		(28<<11)
#define TR_SIG		(27<<11)
#define TR_TIM		(26<<11)
#define TR_FS		(25<<11)
#define TR_IO		(24<<11)
#define TR_DIR		(23<<11)
#define TR_PROC		(22<<11)
#define TR_MISC		(21<<11)
#define	TR_DD		(17<<11)

#ifdef AIXTRACE
extern int tracechan;

extern int (*trstorep)();

/* ioctl functions */
#define TRIOC   ('Z'<<8)
#define TRCSETC (TRIOC|0)
#define TRCGETC (TRIOC|1)
#define TRCSET  (TRIOC|2)
#define TRCRSET (TRIOC|3) 
#define TRCSTOP (TRIOC|4)
#define TRCFILTER (TRIOC|5) /* filters trsave() calls from the specified pid */
#define TRCNOFILTER (TRIOC|6) /* disables the filtering                      */

/* argument to ioctls */
struct tr_struct {
	unsigned operation;     /* TRCSET or TRCRSET for TRCSETC calls */
	unsigned channels;      /* enabled channels */
	ushort entsize;         /* length of trace entry */
	struct trace_event * bufaddr;   /* address of the buffer to use */
	ulong bufsize;          /* buffer size to use */
	union                   /* vrm operational flags */
	  {     ushort vm_quit;
		struct
		  {     char vmid;      /* 0 = current VM */
			unsigned intr_on_quit : 1;
			unsigned mpx_no : 7;
		  } xvf;
	  } vf;
};

/* define the interrupt flag for easy loading */
#define INTR_ON_QUIT vf.xvf.intr_on_quit

/* structure of an entry returned to the user */
struct trace_event {
	time_t  stamp;          /* time stamp */
	short   timeext;        /* time stamp extension */
	short   seqno[2];       /* two 16 bit sequence number digits */
	short   hookid;         /* channel number and trace event code */
	unsigned pid;           /* process id */
	short   iodn;           /* vrm iodn or -1 */
	short   iocn;           /* vrm iocn or -1 */
	union {
		char    xcdata[20];       /* more data, depending on code */
		int     xidata[5];
	} xdata;
};

#define Cdata   xdata.xcdata
#define Idata  xdata.xidata

/* struct returned to user by trc_start() */
struct t_struct
  {     int t_PID;                      /* process ID of new trace daemon */
	struct trace_event *buff_addr;  /* addr of allocated buffer */
	int buff_len;                   /* length of buffer */
	unsigned short channel_ID;      /* mask for allocated channel */
  };

/* dump a struct in hex */
#define TRCHXDMP(st,si)                                  \
{char * t_t_ptr; /* trace temp ptr */                   \
 int t_t_ctr;    /* trace temp counter */               \
 int t_t_size;   /* trace temp size */                  \
 for (t_t_size=(si),t_t_ptr=(char *)(&st);              \
      t_t_size; t_t_size--, t_t_ptr++)                  \
   printf("%x ", *t_t_ptr);                             \
   printf("\n");                                        \
}

/* macro to test whether tracing is enabled on some channel */
# define iftrace(chnum) (tracechan&(1<<(31-((chnum)>>11))))

/* macro to write out a trace record, if tracing is enabled */
# define trsave(chnum, len, data) \
	(iftrace(chnum) ? ((*trstorep)(chnum, len, data)) : 0)

#else
/* these versions of the macros are used if tracing is disabled */
# define iftrace(chnum) 	0	/* nothing is traced	*/
# define trsave(chnum, len, data)	/* nothing to do	*/
#endif /* AIXTRACE */

sitkêÞ¡ ó  $        À
  U‰* ™ˆ*U‰*     TOÀ
  	                  ./usr/include/sys/traceio.h ad.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)traceio.h	16.3	LCC)	/* Modified: 19:28:31 9/16/89 */
/* SCCSIDPUFF(@(#) trace.h 4.1 LM 12:58:16 4/23/85 C 22:13:39 4/23/85); */

#ifndef _h_TRACE
#define _h_TRACE

/*
 * File system buffer tracing points; all trace <dev, bn>
 */
#define	TR_BREADHIT	0	/* buffer read found in cache */
#define	TR_BREADMISS	1	/* buffer read not in cache */
#define	TR_BWRITE	2	/* buffer written */
#define	TR_BREADHITRA	3	/* buffer read-ahead found in cache */
#define	TR_BREADMISSRA	4	/* buffer read-ahead not in cache */
#define	TR_XFODMISS	5	/* exe fod read */
#define	TR_XFODHIT	6	/* exe fod read */
#define	TR_BRELSE	7	/* brelse */

/*
 * Memory allocator trace points; all trace the amount of memory involved
 */
#define	TR_MALL		10	/* memory allocated */

/*
 * Paging trace points: all are <vaddr, pid>
 */
#define	TR_INTRANS	20	/* page intransit block */
#define	TR_EINTRANS	21	/* page intransit wait done */
#define	TR_FRECLAIM	22	/* reclaim from free list */
#define	TR_RECLAIM	23	/* reclaim from loop */
#define	TR_XSFREC	24	/* reclaim from free list instead of drum */
#define	TR_XIFREC	25	/* reclaim from free list instead of fsys */
#define	TR_WAITMEM	26	/* wait for memory in pagein */
#define	TR_EWAITMEM	27	/* end memory wait in pagein */
#define	TR_ZFOD		28	/* zfod page fault */
#define	TR_EXFOD	29	/* exec fod page fault */
#define	TR_VRFOD	30	/* vread fod page fault */
#define	TR_CACHEFOD	31	/* fod in file system cache */
#define	TR_SWAPIN	32	/* drum page fault */
#define	TR_PGINDONE	33	/* page in done */

/*
 * System call trace points.
 */
#define	TR_VADVISE	40	/* vadvise occurred with <arg, pid> */

/*
 * Miscellaneous
 */
#define	TR_STAMP	50	/* user said vtrace(VTR_STAMP, value); */

/*
 * This defines the size of the trace flags array.
 */
#define	TR_NFLAGS	100	/* generous */

#define	TRCSIZ		4096

/*
 * Specifications of the vtrace() system call, which takes one argument.
 */
#define	VTRACE		64+51

#define	VTR_DISABLE	0		/* set a trace flag to 0 */
#define	VTR_ENABLE	1		/* set a trace flag to 1 */
#define	VTR_VALUE	2		/* return value of a trace flag */
#define	VTR_UALARM	3		/* set alarm to go off (sig 16) */
					/* in specified number of hz */
#define	VTR_STAMP	4		/* user specified stamp */

#ifdef KERNEL
#ifdef TRACE
char	traceflags[TR_NFLAGS];
struct	proc *traceproc;
int	tracebuf[TRCSIZ];
unsigned tracex;
int	tracewhich;
#define	trace(a,b,c)	if (traceflags[a]) trace1(a,b,c)
#endif /* TRACE */
#endif /* KERNEL */

#endif /* ~_h_TRACE */
kêÞd ò  $        4+  U‰*¡™ˆ*U‰*     ªp4+  	              ¨Ž  ./usr/include/sys/trap.h .h ad.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)trap.h	16.5.1.3      AIX)    /* Modified 10:17:46 4/28/92 */

#ifndef _h_TRAP
#define _h_TRAP
#if	defined(u370) /* only for  IX/370 code */
#include <sys/b370/events.h>
#endif	/* u370 */

/*
 * Trap type values
 */

#ifdef	vax
/* The first three constant values are known to the real world <signal.h> */
#define RESADFLT	0		/* reserved addressing fault */
#define PRIVINFLT	1		/* privileged instruction fault */
#define RESOPFLT	2		/* reserved operand fault */
/* End of known constants */
#define BPTFLT		3		/* bpt instruction fault */
#define XFCFLT		4		/* xfc instruction fault */
#define SYSCALL		5		/* chmk instruction (syscall trap) */
#define ARITHTRAP	6		/* arithmetic trap */
#define ASTFLT		7		/* software level 2 trap (ast deliv) */
#define SEGFLT		8		/* segmentation fault */
#define PROTFLT		9		/* protection fault */
#define TRCTRAP		10		/* trace trap */
#define COMPATFLT	11		/* compatibility mode fault */
#define PAGEFLT		12		/* page fault */
#define TABLEFLT	13		/* page table fault */
#endif	/* vax */

#ifdef	M68000
					/* interrupt and trap vectors */
#	define	PROTFLT		2	/* bus error */
#	define	ADDRFLT		3	/* address error */
#	define	ILLINSFLT	4	/* illegal instruction */
#	define	RESOPFLT	5	/* divide by zero */
#	define	CHKTRAP		6	/* CHK instruction */
#	define	VTRAP		7	/* TRAPV instruction */
#	define	PRIVINFLT	8	/* privilege violation */
#	define	TRCTRAP		9	/* trace trap */
#	define	TRAP1010	10	/* 1010 instruction */
#	define	TRAP1111	11	/* 1111 instruction */
#	define	AUTO1INT	25	/* autovectored interrupt 1 */
#	define	AUTO2INT	26	/* autovectored interrupt 2 */
#	define	AUTO3INT	27	/* autovectored interrupt 3 */
#	define	AUTO4INT	28	/* autovectored interrupt 4 */
#	define	AUTO5INT	29	/* autovectored interrupt 5 */
#	define	AUTO6INT	30	/* autovectored interrupt 6 */
#	define	AUTO7INT	31	/* autovectored interrupt 7 */
#	define	TRAP00		32	/* TRAP 0 instruction */
#	define	TRAP01		33
#	define	TRAP02		34
#	define	TRAP03		35
#	define	TRAP04		36
#	define	TRAP05		37
#	define	TRAP06		38
#	define	TRAP07		39
#	define	TRAP08		40
#	define	TRAP09		41
#	define	TRAP10		42
#	define	TRAP11		43
#	define	TRAP12		44
#	define	TRAP13		45
#	define	TRAP14		46
#	define	TRAP15		47

#endif	/* M68000 */
/*	Structure of signal frame used by sendsig and dorti	*/
 

#ifdef	M68000
struct	sigframe {
	int	sf_handler;		/* fake return address for user stack */
	int	sf_sig;			/* signal number */
	int	sf_code;		/* copy of u.u_code */
	int	sf_reg[16];		/* saved registers */
	int	sf_ps;			/* saved ps (made long) */
	int	sf_pc;			/* saved pc */
};
#endif	/* M68000 */
#if	defined(u370) /* Start of IX/370 code */
/*		PROGRAM INTERRUPT TABLE				*/

/*	The program interrupt table is located in trap.c.
 *	It is used by trap to process extended program interrupts.
 */

struct  pictbl {
	u_short	pt_pic ;	/* The program interrupt code	*/
				/* which this entry is for.  A	*/
				/* zero indicates the end of	*/
				/* the table.			*/
	u_short	pt_svc ;	/* The svc which gives this pic	*/
				/* code.			*/
	int	pt_rcd ;	/* The return code to be given	*/
				/* if the above svc gets the	*/
				/* indicated pic.		*/
	u_short	pt_reg ;	/* The register in which to	*/
				/* return the return code.	*/
};

#ifdef  KERNEL
extern struct  pictbl	pictbl[] ;
#endif  /* KERNEL */

/*	This code describes the format of the special block
 *	built on the stack by machdep370.c/sendsig when transfering
 *	control to a users signal handling routine.  Control is
 *	returned to the kernal from the signal handler by
 *	executing a "rfs" (return from signal) svc which was
 *	placed on the stack.  Upon receipt of this interrupt,
 *	control is tranfered to sendsig.c/rfs where this frame is
 *	popped off of the stack and control is returned to the
 *	user at the point of interruption.  The purpose of this
 *	stack frame is to hold the status information which must be
 *	restored after returning from the signal routine plus the
 *	rfs svc to be executed by the user program.  All of the
 *	information we save looks like extra arguments to the
 *	users signal routine which he just doesn't know about.
 *	Therefore, this stack frame should not cause any
 *	problems for debuggers like adb or sdb.
 */

#define	SS_NARGS	3	/* The number of arguments	*/
				/* passed to the users signal	*/
				/* handler.			*/
#define ES_NARGS        6       /* The number of words of arguments */
                                /* passed to the users event handler.   */

/*	The following is the structure built on the stack to save
 *	the signal interrupt status.
 */

struct sigframe {
#define frameDIFFW	(MINFRW-RGSVSZW)
#define frameDIFF	(4*frameDIFFW)
	/* ss_cframe actually has length MINFRW. It overlaps ss_cregsv*/
	int	ss_cframe[frameDIFFW] ;
	int	ss_cregsv[RGSVSZW] ;	/* C save its registers here	*/
	int	ss_signbr ;		/* The signal number.  This is	*/
					/* is only argument that a	*/
					/* system V program knows about	*/
	int	ss_param;		/* extra code about traps	*/
#ifdef _POSIX_SOURCE
	struct	__sigcontext *ss_scp;	/* pointer to return context	*/
	struct	__sigcontext *ss_scpcopy;/* copy of pointer to return	*/
#else
	struct	sigcontext *ss_scp;	/* pointer to return context	*/
	struct	sigcontext *ss_scpcopy;	/* copy of pointer to return	*/
#endif /* _POSIX_SOURCE */
					/* context.  The user routine	*/
					/* might change the other one.	*/
	char	ss_svc ;		/* The svc instruction sequence	*/
					/* will start here		*/
};

 /*
  *	The following is the structure built on the stack to save
  *	the event interrupt status.
  */
 
struct evtframe {
#define evtframeDIFFW	(MINFRW-RGSVSZW)
#define evtframeDIFF	(4*evtframeDIFFW)
 	/* es_cframe actually has length MINFRW. It overlaps es_cregsv*/
#if 0
 	int	es_cframe[evtframeDIFFW] ;
#endif
 	int	es_cframe[2] ;
 	int	es_cregsv[RGSVSZW] ;	/* C save its registers here	*/
 	void		*es_value;	/* value from event structure	*/
 	evt_class_t	es_class;	/* event class			*/
 	evtset_t	es_mask;	/* event class mask		*/
#ifdef _POSIX_SOURCE
 	struct	__evtcontext *es_ecp;	/* pointer to return context	*/
 	struct	__evtcontext *es_ecpcopy;/* copy of pointer to return	*/
#else
 	struct	evtcontext *es_ecp;	/* pointer to return context	*/
 	struct	evtcontext *es_ecpcopy;	/* copy of pointer to return	*/
#endif /* _POSIX_SOURCE */
 					/* context.  The user routine	*/
 					/* might change the other one.	*/
 	char	es_svc ;		/* The svc instruction sequence	*/
 					/* will start here		*/
};
#endif	/* u370 -- End of IX/370 code */

#ifdef b370

/* trap.h */

#define TR_PCK 2
#define TR_EXT 3
#define TR_MCK 4
#define TR_RST 8
#define TR_SVC 9
#define TR_IO  10

/*	When a program interrupt occurrs, the interrupt code in 
 *	tb_intcode indicates the cause of the interrupt as
 *	follows.
 *
 *	The following table was taken from IX/370 but the extra
 *	goodies which they invented have been removed.
 *
 */

#define	PI_OP		0x01		/* Operation.		*/
#define	PI_POP		0x02		/* Privileged operation.*/
#define	PI_EX		0x03		/* Execute.		*/
#define	PI_PROT		0x04		/* Protection.		*/
#define	PI_ADDR		0x05		/* Addressing.		*/
#define	PI_SPEC		0x06		/* Specification.	*/
#define	PI_DATA		0x07		/* Data.		*/
#define	PI_FXPOV	0x08		/* Fixed pt. overflow.	*/
#define	PI_FXPDV	0x09		/* Fixed point divide.	*/
#define	PI_DECOV	0x0a		/* Decimal overflow.	*/
#define	PI_DECDV	0x0b		/* Decimal divide.	*/
#define	PI_EXPOV	0x0c		/* Exponent overflow.	*/
#define	PI_EXPUN	0x0d		/* Exponent underflow.	*/
#define	PI_SIG		0x0e		/* Significance.	*/
#define	PI_FLTDV	0x0f		/* Floating pt. divide.	*/
#define	PI_SEGTR	0x10		/* Segment translation.	*/
#define	PI_PAGTR	0x11		/* Page translation.	*/
#define	PI_TRANS	0x12		/* Translation spec.	*/
#define	PI_SPCOP	0x13		/* Special operation.	*/
#define	PI_PAGEX	0x14		/* VM Pagex translation	*/
#define	PI_OPERAND	0x15		/* IO Operand exception	*/
#define	PI_TRACE	0x16		/* Trace table overflow	*/
#define PI_VECTOR	0x19		/* Vector operation exception */
#define PI_VUNNORM	0x1E		/* Unnormalized vector operand */
#define	PI_MON		0x40		/* Monitor event.	*/
#define	PI_PER		0x80		/* PER event.		*/




/*
 *	On entry to trap.c from LOCORE.s for an svc interrupt, the
 *	svc code is contained in tb_r1.
 *
 *      IX/370 presents a standard SVC interrupt, SC_STD (svc 10), and a special
 *      interrupt for a breakpoint SVC, SC_BPT (svc 11).
 *
 */

/*	The arguments for the svc are on the stack.  Their location is
 *	determined by the contents of a register plus a fixed
 *	offset.
 */

#define SC_STD 10
#define SC_BPT 11



/*
 *	On entry to trap.c from LOCORE.s for an external interrupt, the
 *	interrupt identifier is in tb_intcode with values as follows:
 *
 */


#define EXT_ITIMER	0x0080		/* Interval timer */
#define EXT_INTKEY	0x0040		/* Interrupt key */
#define EXT_SIGNAL2	0x0020		/* External signal 2 */
#define EXT_SIGNAL3	0x0010		/* External signal 3 */
#define EXT_SIGNAL4	0x0008		/* External signal 4 */
#define EXT_SIGNAL5	0x0004		/* External signal 5 */
#define EXT_SIGNAL6	0x0002		/* External signal 6 */
#define EXT_SIGNAL7	0x0001		/* External signal 7 */
#define EXT_MFALERT	0x1200		/* Malfunction alert */
#define EXT_EMERGENSIG	0x1201		/* Emergency signal */
#define EXT_CALL	0x1202		/* External call */
#define EXT_TODSYNCH	0x1003		/* TOD clock sync check */
#define EXT_CLKCOMPR	0x1004		/* Clock comparator */
#define EXT_CPUTIMER	0x1005		/* CPU timer */
#define EXT_SERVSIG	0x2401		/* Service signal */
#define EXT_LDSF	0x2402		/* LDSF interrupt */
#define EXT_IUCV	0x4000		/* IUCV interrupt */
#define EXT_VMCF	0x4001		/* VMCF interrupt */
#define EXT_HPPI        0x4002          /* HPPI data interrupt */
#define EXT_HPPI_EXC    0x4003          /* HPPI exception interrupt */

#define USER 0x80

#endif /* b370 */

#ifdef i386
/*
 * Intel reserved interrupt/exception vectors (trap numbers)
 */
#define V_div_err_fault		0	/* Integer divide by zero */
#define V_dbg_exception		1	/* Debug exceptions (HW brkpt/sstep) */
#define V_nmi			2	/* Non-maskable interrupt */
#define V_bkpt_trap		3	/* INT3 - SW breakpoint instruction */
#define V_ovflow_trap		4	/* Overflow: INT0 instr & OF flag set */
#define V_array_bound_fault	5	/* BOUND instructuction fault */
#define V_inval_op_fault	6	/* Invalid opcode */
#define V_dev_na_fault		7	/* Coprocessor not available */
#define V_double_fault		8	/* Double fault */
#define V_indy_fault		9	/* Coprocessor Segment Overrun */
#define V_inval_tss_fault	10	/* Invalid TSS fault */
#define	V_seg_fault		11	/* Segment not present */
#define V_stack_seg_fault	12	/* Stack exception */
#define V_gp_fault		13	/* General protection fault */
#define V_pg_fault		14	/* Page fault */
#define V_indy_fault2		15	/* Not used */
#define V_coproc_err_fault	16	/* Coprocessor error */
#define V_illegal_intr		48
#endif /* i386 */

#endif /* ~_h_TRAP */
de ikêžˆ ñ  $        N  U‰*¢™ˆ*U‰*     ªŽN  	                  ./usr/include/sys/ttmap.h h ad.h
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)ttmap.h	16.4	LCC)	/* Modified: 16:05:33 7/26/91 */

/* @(#)ttmap.h	4.1 - 86/10/14 - 21:26:57 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
#ifndef _h_TTMAP
#define _h_TTMAP

/* structures for Terminal Mapping support - NLS only */

#define TTMAPKEYLEN 14      /* length of a ttmap's name */
#define TTMAPBUFMAX 8       /* maximum number of buffered characters. */
#define TTMAPMAXSIZE 131072 /* maximum size of a tty map */

/* code values for tty_map.tm_type */
#define TM_INPUT  1         /* select input map */
#define TM_OUTPUT 2         /* select output map */
#define TM_RESET  0100      /* To reset a map to default state */
#define TM_RELOAD 0200      /* To force loading of a map even if loaded */

struct ttrule {
       short   tm_next;
       char    tm_pattern[14];
};

/* structure defining a single shared tty map */

struct ttmap {
       struct  ttmap *tm_next;          /* chain of maps */
       int     tm_len;                  /* length of this map */
       short   tm_count;                /* how many tty's use this map */
       char    tm_key[TTMAPKEYLEN];     /* map unique id */
       short   tm_lookup[128];          /* lookup table of rule indexes */
       struct  ttrule tm_rule[1];       /* variable size */
};

/* State information about a map in use.  Two of these per tty structure */

struct ttmapinfo {
	struct  ttmap *tm_map;          /* null if no mapping here */
	unsigned char	tm_state;       /* state: user byte */
	unsigned char	tm_bufindx;     /* state: buffer index */
	short   tm_rulindx;             /* state: rules index */
	char    tm_buffer[TTMAPBUFMAX]; /* Used internally */
};

/* structure for ioctls TCSMAP and TCGMAP */

struct tty_map {
	unsigned char tm_version;	/* Must be 0 */
	unsigned char tm_type;		/* TM_INPUT or TM_OUTPUT */
	char tm_key[TTMAPKEYLEN];       /* name of map */
	char *tm_addr;                  /* pointer to map in user space */
	int tm_len;                     /* length of map */
};

#endif /* _h_TTMAP */
 Vkêhë ð  $        G  V‰*£™ˆ*V‰*     'WG  	              Æ™  ./usr/include/sys/tty.h /*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)tty.h	16.17	AIX)	/* Modified: 13:14:07 11/9/90 */

#ifndef	_h_TTY
#define	_h_TTY

#if defined(NLS) && !defined(_h_TTMAP)
#include	<sys/ttmap.h>
#endif /* NLS && ~_h_TTMAP */

#ifndef _h_IOCTL
#include	<sys/ioctl.h>
#endif /* ~_h_IOCTL */

#ifndef _h_TERMIO
#include	<sys/termio.h>
#endif /* ~_h_TERMIO */

/* @(#)tty.h	1.2 */
/*
 * A clist structure is the head of a linked list queue of characters.
 * The routines getc* and putc* manipulate these structures.
 */
#ifndef	_h_CLIST
#include	<sys/clist.h>
#endif	/* ~_h_CLIST */

struct clist {
	int	c_cc;		/* character count */
	struct cblock *c_cf;	/* pointer to first */
	struct cblock *c_cl;	/* pointer to last */
};

/*
 * Macro to find the beginning of a cblock given pointer into it.
 * In some cases, the pointer passed to this macro will actually point
 * exactly at the beginning of the next cblock (because all the characters
 * in c_data have been 'used', and c_data is at the end of a cblock).
 * The '- 1' gets the pointer back into the structure we want to locate.
 */
#define CMATCH(cblockp) \
	(&cfree[(struct cblock *)((caddr_t)(cblockp) - 1) - cfree])

/* Character control block for interrupt level control	*/

struct ccblock {
	caddr_t	c_ptr;		/* buffer address	*/
	ushort	c_count;	/* character count	*/
	short	c_size;		/* buffer size		*/
};

/*
 *	User settable terminal control characters:
 *	This structure contains an intersection of control
 *	characters from System 5 and 4.Xbsd.  Characters that
 *	are exclusive to one version of unix are noted as such.
 *
 * In the latest battle in the never-ending war against the overlap between
 * VEOF and VEOL and VMIN and VTIME, I have moved all of the values OUT of
 * the beginning of the structure (where Sys5 put them).  A space-keeper
 * entry "tc_junk[2]" replaces them so that bcopy()ing c_cc structures still
 * works.  Anyplace which sets or retrieves these values uses ONLY the
 * applicable values - Berkeley calls generally only use t_eof and t_eol
 * (except for RAW and CBREAK simulation); Sys5 calls use t_eof and t_eol
 * if ICANON is set, and use t_min and t_time if not. [ hjb 01/20/86 ]
 */
struct ttychars {
	char	tc_intr;	/* interrupt */
	char	tc_quit;	/* quit */
	char	tc_erase;	/* erase last character */
	char	tc_kill;	/* erase entire line */
	char	tc_junk[2];	/* eof and eol chars OR min and time */
	char	tc_eol2;	/* Sys5: 2nd input delimiter sys5 only */
	char	tc_s5reserve;	/* Sys5: reserved for future use */
	char	tc_min;		/* Sys5: minimum chars per read (!ICANON) */
	char	tc_time;	/* Sys5: time before returning read (!ICANON) */
	char	tc_start;	/* 4bsd: start output */
	char	tc_stop;	/* 4bsd: stop output */
	char	tc_susp;	/* 4bsd: stop process signal */
	char	tc_dsusp;	/* 4bsd: delayed stop process signal */
	char	tc_rprnt;	/* 4bsd: reprint line */
	char	tc_flush;	/* 4bsd: flush output (toggles) */
	char	tc_weras;	/* 4bsd: word erase */
	char	tc_lnext;	/* 4bsd: literal next character */
	char	tc_stat;	/* ucla: report system load */
	char	tc_page;	/* ucla: display next page of output */
	char	tc_pgoff;	/* ucla: disable paging until next input */
	char	tc_eof;		/* eof char */
	char	tc_eol;		/* input delimiter like '\n' */
#define	tc_brk	tc_eol		/* brk is bsd's name for eol */
};

/* The structure below is used in a union in the tty struct.
 * If the device is using the second line discipline, this
 * struct will be used in place of ttychars to keep track of
 * the line printer. These field are redefined in lpdefs.h to
 * shorter easier to use fields.
 */

struct glp {
	ushort glpu_state;	/* generic lp - internal state	*/
	ushort glpu_oprflags;	/* optional line printer modes	*/
	ushort glpu_mcc;	/* # valid characters on line	*/
	ushort glpu_ccc;	/* current output column	*/
	ushort glpu_modes;	/* optional line printer modes	*/
	ushort glpu_timeout;	/* wait time for out completion */
	ushort glpu_mlc;	/* number of lines on page	*/
	struct proc *glpu_procp;/* process to receive t/o sigs	*/
};

#ifndef NOCHECKS
/* Check to make sure that struct lp fits in struct ttychars.
 * Compiler will blow up here if it doesn't fit.
 */
struct _check_size {
	char check_size[sizeof(struct ttychars) + 1 - sizeof(struct glp)];
};
#endif /* NOCHECKS */


/*
 * since the tty struct may not be extended to contain new fields (VAR, OEM
 * compatability restriction) -> we introduce a new struct. This new struct
 * may be referenced using the same tty ptr as before.  This struct is alloced
 * per tty at ttinit(tp) time.
 */
struct xtty {
	struct	callout	*xt_timeout; /* if set -> used to reset the timer. */
#ifdef _MBCS
	charlen_t xt_codeset[CODESIZE];	/* codeset information for tty */
	char	xt_mbchar[4];	/* storage area for partial multibyte char */
	u_char	xt_mblen;	/* length of incoming multibyte char */
	u_char	xt_mbcnt;	/* count bytes of multibyte char read so far */
	u_short	xt_mbcflag;	/* introduced for performance reasons */
#endif /* _MBCS */
};
#define	t_timeout t_xttyp->xt_timeout
#ifdef _MBCS
#define	t_codeset t_xttyp->xt_codeset
#define	t_mbchar  t_xttyp->xt_mbchar
#define	t_mblen   t_xttyp->xt_mblen
#define	t_mbcnt   t_xttyp->xt_mbcnt
#define	t_mbcflag t_xttyp->xt_mbcflag
#endif /* _MBCS */



#define TTYINTRS 5              /* Interrupt level for tty devices	      */
/*
	The tty structure holds all state information necessary to use
	a UNIX character device for normal terminal I/O.  Structure
	members have been arranged roughly in order of most-to-least
	interesting to ease examination with a debugger such as
	adb(1).  Care has also been taken to place things at offsets
	that correspond to their natural alignments.
*/
struct tty {
	struct	clist t_rawq;	/* raw input queue */
	struct	clist t_canq;	/* canonical queue */
	struct	clist t_outq;	/* output queue */
	struct	ccblock	t_tbuf;	/* transmit interrupt control block */
	struct	ccblock t_rbuf;	/* receive interrupt control block */
	ushort	t_iflag;	/* Sys5: input modes */
	ushort	t_oflag;	/* Sys5: output modes */
	ushort	t_cflag;	/* Sys5: control modes */
	ushort	t_lflag;	/* Sys5: line discipline modes */
	ulong	t_state;	/* Sys5: internal state */
	ushort	t_bflag;	/* 4bsd: newtty line discipline modes */
	ushort	t_bstate;	/* 4bsd: state for newtty */
	short	t_pend;		/* # of chars at tail of rawq for ttpend() */
	short	t_rocount;	/* chars input since a ttwrite() */
	short	t_rocol;	/* t_col when first input this line */
	short	t_col;		/* current column */
	short	t_delct;	/* delimiter count */
	pid_t	t_pgrp;		/* process group name */
	pid_t   t_sesid;	/* Associated Session */
#ifdef _POSIX_SOURCE
	struct	_Winsize t_winsize;	/* window size */
#else
	struct	winsize t_winsize;	/* window size */
#endif
 	short   kepflg;       	/* flag for kep processing */
#ifdef HFTHOOKS
 	/* Following are for HFT  - PB */
 	ushort  t_xiflag;	/* ext proc. input modes */
 	ushort  t_xoflag;	/* ext proc. output modes */
 	ushort  t_xcflag;	/* ext proc. control modes */
 	ushort  t_xlflag;	/* ext proc. line disc modes */
 	unsigned t_path;         /* path ID		   */
 	unsigned t_emask[16];    /* echo mask                */
        unsigned t_bmask[16];    /* break map		   */
 	ushort  t_vtnum;		/* Virt term no		   */
 	pid_t	t_monpid;	/*process id to be signaled. HFT. */
 	pid_t	t_sndpid;	/*process id to be signaled. HFT. */
 	struct	proc *t_readproc; /*last proc to read   */
 	struct	proc *t_monproc; /*process to be signaled. HFT. */
 	struct	proc *t_sndproc; /*process to be signaled. HFT. */
 	ushort  t_openct;        /* #opens HFT only */
	short   t_error;        /* Error code from VRM interrupt (HFT only) */
 	char    t_stat1;        /* Paging and Screen Manager Info */
 	char	*t_keymapptr;   /* Pointer to the Key map for VT */
 	char	*t_strptr;      /* Pointer to strings for the VT */
 	/*
 	 * What follows are stuff needed for monitor mode.
 	 * I am not sure whether these should go here, because ring
 	 * address and length are per process data as opposed to
 	 * per term data. Never the less, I am putting it here for
 	 * the lack of a better place. - PB.
 	 */
 	char *ring_start;       /* kernel virt address for the ring */
 	int  ring_length;       /* Size of the ring in bytes        */
 /* Flags for the t_stat1 field */
#define TTISMGR         0x20    /* This tty belongs to the Screen Mgr. */
#endif	/* HFTHOOKS */
#ifdef	TTYINTRCNT
/*
	Terminal Interrupt Counting:

	`1st' counters refer to what we will call `primary interrupt
	service' `2nd' counters refer to `secondary interrupt
	service'.  The tty interrupt code is written to service as many
	lines as are ready at the time that one line interrupts.  The
	line that actually causes the hardware interrupt resulting in
	the call to the interrupt handler is credited with a `primary
	interrpt service' and has its `1st' counter incremented when it
	is first serviced.  Any further services for additional ready
	lines are credited with `secondary interrupt service' and have
	their `2nd' counters incremented.

	In addition, we count the number of outgoing characters so that
	we can see the ratio of characters transmitted to interrupts
	serviced.  This ratio is expected to be lower for DMA devices,
	and non-DMA devices that have large output silos.

	We do not count in coming characters, as they are serviced
	strictly one at a time.  This count can be deduced by adding
	the `1st' and `2nd' recieve interrupt service counters.

	--Greg Mc--
*/
	long	t_xint1st;	/* count of primary xmit service */
	long	t_xint2nd;	/* count of secondary xmit service */
	long	t_rint1st;	/* count of primary recieve service */
	long	t_rint2nd;	/* count of secondary recieve service */
	long	t_outchars;	/* number of raw chars transmitted */
#endif	/* TTYINTRCNT */
#ifdef	TTYPAGE
	int	t_lpos;		/* current vertical position */
	char	t_length;	/* vertical screen length */
	char	t_pgflag;	/* paging and bell-ringing flags */
#endif	/* TTYPAGE */
	int	(*t_proc)();	/* routine for device functions */
	union {
		struct ttychars tu_cc;	/* settable control chars */
		struct glp tu_glp;      /* or support for the generic
					   line printer discipline */
	} t_un;
#define	t_cc	t_un.tu_cc
#define	t_glp	t_un.tu_glp

	char	t_delay;	/* length of delay */
	char	t_line;		/* line discipline */
#ifdef	SELECT
	struct	proc *t_rsel;	/* read select */
	struct	proc *t_wsel;	/* write select */
#endif	/* SELECT */
#ifdef NLS
	struct ttmapinfo t_mapin; /* input terminal map */
	struct ttmapinfo t_mapout; /* output terminal map */
#endif /* NLS */
	/*
	 * device dependent field for use at the driver's pleasure
	 * (to point to device dependent info, or whatever).
	 */
	caddr_t	t_dev;
	unsigned char kbdstate1;	/* used for scancode to ascii */
	unsigned char kbdstate2;	/* conversions (state machine) */
	ushort t_devtype;		/* GLP device type	*/
	struct	xtty	*t_xttyp;	/* ptr to xtty */
        int t_lmsgid;                   /* Terminal log msg id  */
};

/*	Handy short-hand notation for control characters	*/
#define t_intr	t_cc.tc_intr
#define t_quit	t_cc.tc_quit
#define t_erase	t_cc.tc_erase
#define t_kill	t_cc.tc_kill
#define t_eof	t_cc.tc_eof
#define t_eol	t_cc.tc_eol
#define	t_brk	t_cc.tc_brk
#define t_eol2	t_cc.tc_eol2
#define	t_min	t_cc.tc_min
#define	t_time	t_cc.tc_time
#define t_start	t_cc.tc_start
#define t_stop	t_cc.tc_stop
#define t_susp	t_cc.tc_susp
#define t_dsusp	t_cc.tc_dsusp
#define t_rprnt	t_cc.tc_rprnt
#define t_flush	t_cc.tc_flush
#define t_weras	t_cc.tc_weras
#define t_lnext	t_cc.tc_lnext
#define t_stat	t_cc.tc_stat
#define t_page	t_cc.tc_page
#define t_pgoff	t_cc.tc_pgoff



	
#ifdef	KERNEL
extern struct clist ttnulq;
extern int ttlowat[];	/* table of t_outq low-watermarks indexed by baud */
extern int tthiwat[];	/* table of t_outq high-watermarks indexed by baud */
#endif	/* KERNEL */

#define	QESC	0200	/* queue escape */
#define	HQEND	01	/* high queue end */

#define	TTIPRI	28	/* wakeup priority for sleeping on tty input */
#define	TTOPRI	29	/* wakeup priority for sleeping on tty output */

/* limits */
#define	TTYHOG	256	/* maximum chars we'll hold in t_rawq */
#define	TTXOLO	60	/* t_rawq low-watermark for T_UNBLOCK (IXOFF mode) */
#define	TTXOHI	180	/* t_rawq high-watermark for T_BLOCK (IXOFF mode) */
#define	TTECHI	80	/* ?? (not used) */

/* Hardware bits */
#define	DONE	0200
#define	IENABLE	0100
#define	OVERRUN	040000
#define	FRERROR	020000
#define	PERROR	010000

/* Internal state */
#define	TIMEOUT	0000001		/* Delay timeout in progress */
#define	WOPEN	0000002		/* Waiting for open to complete */
#define	ISOPEN	0000004		/* Device is open */
#define	TBLOCK	0000010		/* Output is blocked */
#define	CARR_ON	0000020		/* Software copy of carrier-present */
#define	BUSY	0000040		/* Output in progress */
#define	OASLP	0000100		/* Wakeup when output done */
#define	IASLP	0000200		/* Wakeup when input done */
#define	TTSTOP	0000400		/* Output stopped by ctl-s */
#define	EXTPROC	0001000		/* External processing */
#define	TACT	0002000		/* VTIME timeout in progress */
#define	CLESC	0004000		/* Last char escape */
#define	RTO	0010000		/* Raw Timeout */
#define	TTIOW	0020000		/* Someone is waiting for output to drain */
#define	TTXON	0040000		/* flow control */
#define	TTXOFF	0100000		/* flow control */
#define MMSIG   0200000		/* To enable monitor mode signals  PB */
#define TLOGQID 0400000         /* Msg qid is valid */
#define TLOGGING 01000000        /* Terminal logging is enabled */
#define POSTPOFF 02000000	 /* Turn off ONLCR,TAB3 in hft conswrite */

/* l_output status */
#define	CPRES	0100000		/* chars are present in t_tbuf */

/* device commands for t_proc */
#define	T_OUTPUT	0	/* start output */
#define	T_TIME		1	/* begin device timeout */
#define	T_SUSPEND	2	/* suspend output (after receiving t_stop) */
#define	T_RESUME	3	/* resume output (after receiving t_start) */
#define	T_BLOCK		4	/* send a t_stop to throttle sender */
#define	T_UNBLOCK	5	/* send a t_start to resume sender */
#define	T_RFLUSH	6	/* flush t_rbuf */
#define	T_WFLUSH	7	/* flush t_tbuf */
#define	T_BREAK		8	/* set break condition on the line */
#define	T_INPUT		9	/* start input (usually a no-op) */
#define	T_PARM		11
/* partab character types */
#define	PTB_CTYPE	007	/* char-type mask for partab[] entry */
#define	PTB_ORDINARY	000
#define	PTB_CONTROL	001
#define	PTB_BACKSP	002
#define	PTB_NEWLINE	003
#define	PTB_TAB		004
#define	PTB_VTAB	005
#define	PTB_RETURN	006
#define	PTB_FORMFEED	007

/*
 *	additional state information for 4.[12]bsd and terminal paging
 */
#define	LSBKSL		0000001	/* state bit for lowercase backslash work */
#define	LSERASE		0000002	/* within a \.../ for LPRTRUB */
#define	LSLNCH		0000004	/* next character is literal */
#define	LSTYPEN		0000010	/* retyping suspended input (LPENDIN) */
#define	NEWTTY		0000020	/* bsd ``new tty'' driver features are active */
#define	NBIO		0000040	/* non-blocking IO */
#define ASYNC		0000100 /* async i-o via SIGIO */
#define XCLUDE		0000200	/* exclusive use of channel */
#define	RCOLL		0000400	/* collision in read select */
#define	WCOLL		0001000	/* collision in write select */

/* 
 * state information regarding osm logging is maintained in the bstate field
 * as well.  Applications needing to enable/disable this do so via
 * TIOCOSM/TIOCNOSM ioctls
 */
#define	OSMLOG		0002000	/* we are logging to the osm for this tty */

#ifdef _MBCS
/*
 * state information regarding if ttin is currently processing a multibyte
 * character is maintained in the bstate field also. ttin() is the only routine
 * that should be using this value.
 */
#define LSMBCHR		0004000	/* processing multibyte char in ttin() */
#define	MB_INVALID	0xff	/* return value from kmblen if invalid char */
#define	LSMBFLAGS	0xf0	/* mask for multibyte flags */
#define	LSMBOUTCHR	0x20	/* processing multibyte char in ttwrite() */
#define	T_MBCSET	0x10	/* for one byte per character code set */
#endif /* _MBCS */

/*
 *	device report
 */
#define	L_BUF	0
#define	L_BREAK	3

/* 
 * Max. number ascii chars created by 1 scancode 
 */
#define	MAX_XLAT	10	

/* 
 * Scan code to ascii structure.  Contains a buffer of characters.  Normally
 * only 1 is present, > 1 means that there is an escape sequence.
 */
struct	scantoa {
	int len; 
	unsigned char chrs[MAX_XLAT];
};

/* Template data for DOS-style line editing */

/* dt_flags values */
#define DTINSMD 01              /* DOS edit "insert mode" on */
#define ENHEDST 8               /* number of templates retrievable      */

struct dostdat {
	char dt_idx;            /* template index */
	char dt_len;            /* length of valid contents */
	char dt_flags;          /* editing flags */
	char dt_fcol;           /* column where user input began */
	short dt_sta;           /* input state */
	short dt_cmd;           /* command entered */
	short dt_stick;		/* sticky function key */
	int   dt_plcount;	/* number of input chars pending */
	struct clist dt_colq;   /* rightward motion by each char in rawq */
	struct clist dt_uchq;   /* unechoed raw queue */
	struct dt_rtrv *bp;     /* pointer to the retrieve buffer */
	int rt_flag;            /* misc flags for template retrieve */
};

struct dt_rtrv {
	char dt_buf[ENHEDST][DTBSIZE];
	int beg;        /* beginning of buffer */
	int act;        /* active template     */
	int tos;        /* top o'stack */
	char len[ENHEDST];
};

/* definitions for rt_flag in dostdat struct    */

#define RINIT   0x0001          /* retrieve struct initialized ?*/
#define RCURUP  0x0002          /* cursor-up command            */
#define RCURDOW 0x0004          /* cursor-down command          */
#define RWRAPT  0x0008          /* retrieve buffer wrapped ?    */
#define RJBEG   0x0010          /* first time through buffer    */
#define RONCE   0x0020          /* first time cursor commands   */
#define RAGAIN  0x0040          /* multiple cursor commands     */

/*
 * The enhanced edit mode line discipline shares the following
 *  routines with the standard tty line discipline
 */
#define	ttdopen	ttopen
#define	ttdclose ttclose
#define	ttdread	ttread
#define	ttdwrite ttwrite
#define	ttdout	ttout

#endif /* ~_h_TTY */
FLUSH	7kêœ² î  $        ÿ&  V‰*£™ˆ*V‰*     4ˆÿ&  	              K  ./usr/include/sys/types.h h ad.h/*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */


#ifndef _POSIX_SOURCE
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)types.h	16.15	AIX)	/* Modified: 10/17/90 14:08:10 */
/*H_SCCSIDgen1(@(#)types.afp.h	11.20	AIX)	/* Modified 11/2/88 19:59:34 */
#endif /* NOT _POSIX_SOURCE */

#ifndef  _H_TYPES
#define  _H_TYPES

#ifndef _POSIX_SOURCE
#include <DOPTIONS.h>
#endif	/* !_POSIX_SOURCE */

/*
 * types.h: Basic system types and major/minor device
 * constructing/busting macros.
 */

typedef	unsigned short	u_short_t;
typedef	unsigned int	u_int_t;
typedef	unsigned long	u_long_t;

#ifndef _POSIX_SOURCE

/* Abbreviations for basic 'C' types with otherwise long names */
typedef	unsigned char	u_char;
typedef	unsigned short	u_short;
typedef	unsigned int	u_int;
typedef	unsigned long	u_long;
typedef int	(*funcp_t)();

/* System 5 compatability constants */
typedef	unsigned short	ushort;
typedef unsigned int	uint;
typedef	unsigned long	ulong;
#endif /* NOT _POSIX_SOURCE */

typedef	long		key_t;		/* SysV IPC keys */
typedef long		han_t;		/* SysV IPC handles */
typedef	unsigned long	vaddr_t;	/* User mode virtual address */
typedef	long		paddr_t;	/* Physical (real) as opposed to */
					/* virtual memory address.	 */

#ifndef _POSIX_SOURCE

/* This really should be "long", not "int".  But doing so would create tons
of extraneous lint output. */
typedef	struct { int r[1]; } *	physadr;

#endif /* ! _POSIX_SOURCE */

/*
 * The largest alignment requirement of all AIX machines.  If
 * sizeof(align_t) != 4 (on some future machines), lots of
 * reorganization may be necessary.
 */
typedef	long	align_t;	/* Type for strictest standard type alignment */

/* Miscellaneous kernel types */
typedef	long	  daddr_t;	/* Disk address */
typedef	char *	  caddr_t;	/* Kernel virtual address (char *) */
typedef	long	  size_t;	/* Number of mem allocation units (clicks) */
typedef	size_t	  click_t;	/* Number of mem allocation units (clicks) */
typedef	daddr_t	  swblk_t;	/* Swap block */
typedef	long	  time_t;	/* Time in seconds (since Jan. 1, 1970) */
typedef	time_t    clock_t;	/* Time in clock ticks */
typedef	u_long_t  dev_t;	/* Device numbers (major and minor together) */
typedef	long	  off_t;	/* File offset (e.g. for lseek()) */
typedef	long	  pid_t;	/* Process ID */
typedef u_int_t	  bcount_t;	/* Byte count: for buffer I/O (see bio.c) */
typedef	u_long_t  jrtime_t;	/* Microsecond time for journaling */
typedef	long	  igflag_t;	/* Namei/iget flags (flags.h) */
typedef	long	  rmap_t;	/* Counts for resource maps (map.h) */
typedef u_int_t	  spl_t;	/* What spl returns */
typedef long	  gfs_t;	/* Global File System number */
typedef short	  pckno_t;	/* Filesystem pack number */
typedef	short	  cnt_t;	/* Random count type */

/* Inode related types */
typedef	long 	  ino_t;	/* Inode number */
typedef	u_short_t s_ino_t;	/* Short (old) inode number (for conversion) */
typedef long	  ino_uniqid_t;	/* Inode unique identifier */
typedef	short	  islot_t;	/* Kernel Inode table index */
typedef	long	  iflag_t;	/* In-core inode flags */
typedef	short	  dflag_t;	/* Disk inode flags */
typedef	u_long_t  uid_t;	/* User ID */
typedef	u_short_t suid_t;	/* User ID */
typedef	u_long_t  gid_t;	/* Group ID */
typedef	u_short_t sgid_t;	/* Group ID */
typedef	u_long_t  mode_t;	/* File mode (permission) type */
typedef	u_short_t smode_t;	/* File mode (permission) type */
typedef	short	  nlink_t;	/* Number of links to an inode */
typedef long	  commitcnt_t;	/* Commit count */
typedef long	  fstore_t;	/* Fstore */

/* TCF related types */
typedef char	netno_t;	/* AIX TCF network number (netsw index) */
typedef short	siteno_t;	/* AIX TCF cluster site number */
typedef	short	netmap_t;	/* Mask identifying networks available */
typedef	long	sitemap_t;	/* Bit mask for cluster sites */


/* Sitepath support */
typedef u_short_t sitepath_t;	/* Sitepath element */

#ifndef _POSIX_SOURCE

#define SPATH_CPU	0x8000
#define SPATH_MASK	(SPATH_CPU - 1)

#ifdef	b370
typedef	short	ioaddr_t;	/* 370 IO address type */
#ifdef	SVPAGING
typedef u_short_t pgadr_t;
#endif	SVPAGING
#endif	/* b370 */

#if !defined(TRUE) || !defined(FALSE)
/* Define them both if either undefined to guarantee they're consistent */
#define  FALSE	(0)
#define  TRUE	(1)
#endif /* !(TRUE && FALSE) */

#ifdef _MBCS
#define	CODESIZE	256	/* size of character length table */
typedef char 	charlen_t;	/* defined to hold the codeset information to
				   interpret process code multibyte chars */
#ifdef KERNEL
/*
 * Like mblen(), this will return the number of bytes of the first character
 * in the string pointed to by chptr. See <mbcs.h> for more info.
 * Currently, _kmblen() only uses the first byte to index into the chlen_tbl
 * of the character table header, so it cannot detect bogus mbchars where the
 * first byte is a valid part of some character, but the second byte is invalid.
 * Notice that _kmblen has an array (codeset) passed in. This is to accomodate
 * both namei and dir routines, which use codeset info. from user structure and
 * tty routines which use codeset from tty structure.
 */
#define _kmblen(chptr, cset)\
	                (*((unsigned char *)(chptr)) == '\0' ? 0 : \
	                (unsigned)((cset)[*((unsigned char *)(chptr))]) )

/*
 * A macro for copying the codeset information between the user struct
 * (u.u_codeset) and a netmsg.  This should be in a header somewhere!
 */
struct __codeset__	/* Should be thus in user.h! */
{
	charlen_t codeset[CODESIZE];
};
#define	CODESET_COPY(from, to) \
	(*((struct __codeset__ *)(to)) = *((struct __codeset__ *)(from)))

/*
 * macros for initializing codeset information to default values
 */
#ifdef i386
#define CODESET_INIT(dest)\
	memsetlongs((dest), 0x01010101, (CODESIZE>>1)/sizeof(long))
#endif /* i386 */

#ifdef b370
#define CODESET_INIT(dest)\
	bfill((dest), CODESIZE>>1, 0x01)
#endif /* b370 */

#endif /* KERNEL */
#endif /* _MBCS */

/* the NULL value/pointer */
#ifndef NULL
#define NULL		0
#endif

/* major part of a device */
#define	major(x)	((int)(((x)>>16)&0xffff))

/* minor part of a device */
#define	minor(x)	((int)((x)&0xffff))

/* make a device number */
#define	makedev(x,y)	((dev_t)(((long)(x)<<16) | (y)))

/* Load average support */
#ifdef NOFLOATINGPOINT
typedef struct Float { long Flt_val[1]; } float_t;
typedef struct Double { long Dbl_val[2]; } double_t;
typedef u_long_t loadav_t;
#else
typedef	double	double_t;
typedef	float	float_t;
typedef double	loadav_t;
#endif /* NOFLOATINGPOINT */

/*
 * NULLSITE and NOSITE are each illegal site numbers, except that NULLSITE
 * refers to the local site in some network process operations.  NULLSITE
 * is used in most contexts.  NOSITE is used to terminate the site-path list.
 */
#define	NULLSITE	((siteno_t) 0)
#define	NOSITE		((sitepath_t) 127)

#endif /* ! _POSIX_SOURCE */


/* values to be used with getsites(2) */
typedef char	sitestat_t;
#ifndef _POSIX_SOURCE
#define	GS_UP		0x1
#endif /* ! _POSIX_SOURCE */

typedef	int	bool_t;		/* Boolean type: holds TRUE or FALSE */

/* values to be used with getxperm(2) */
typedef char	sitexperm_t;
#ifndef _POSIX_SOURCE
#define	GS_NOPERMISSION	0
#define	GS_PERMISSION	1

/* values to be used with setxuid(2E) */
#define GS_XUID	1
#define GS_XGID	2

#ifdef  u370
#	define  LABEL_SIZE	16	/* Only 14 in use with MW 2.0 CS */
#endif  /* u370 */
#ifdef	i386
#	define  LABEL_SIZE	6
#endif

union  label
{
	int	lb_label[LABEL_SIZE];
#ifdef  REPRESENTATION

#ifdef	u370
	{
		int	lb_r2;
		int	lb_r3;
		int	lb_r4;
		int	lb_r5;
		int	lb_r6;
		int	lb_r7;
		int	lb_r8;
		int	lb_r9;
		int	lb_r10;
		int	lb_r11;
		int	lb_r12;
		int	lb_r13;
		int	lb_r14;
		int	lb_r15;
		int	lb_unused1;
		int	lb_unused2;
	} lb_label_fields;
#endif /* u370 */

#ifdef i386
	{
		int	lb_sp;		/* saved stack pointer	     */
		int	lb_ip;		/* return address	     */
		int	lb_bp;		/* saved bp (frame pointer)  */
		int	lb_si;		/* saved si register	     */
		int	lb_di;		/* saved di register	     */
		int	lb_bx;		/* saved bx register	     */
	} lb_label_fields;
#endif	/* i386 */
#endif /* REPRESENTATION */
};

typedef	union label 	label_t;	/* Save/resume save structure */

#ifndef	FD_SETSIZE
#define	FD_SETSIZE	200
#endif
#ifndef	NBBY
#define	NBBY		8		/* number of bits in a byte */
#endif

typedef long	fd_mask;
#define NFDBITS	(sizeof(fd_mask) * NBBY)	/* bits per mask */
#ifndef howmany
#define	howmany(x, y)	(((x)+((y)-1))/(y))
#endif

typedef	struct fd_set {
	fd_mask	fds_bits[howmany(FD_SETSIZE, NFDBITS)];
} fd_set;

#define	FD_SET(n, p)	((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
#define	FD_CLR(n, p)	((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
#define	FD_ISSET(n, p)	((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
#define FD_ZERO(p)	bzero((char *)(p), sizeof(*(p)))

#define  roundup(x,y)	((((x)+((y)-1))/(y))*(y))

/*
 * Use these when you really want to shorten a long to int,
 * or int to short
 */
#define	INTCAST(val)	((int)(val))
#define	SHORTCAST(val)	((short)(val))
#define RDEVTODEV(dev)	((dev_t)(dev))	/* actually a noop now */

#ifdef	lint
#define ALIGNCAST(caddr)	aligncast((caddr_t)(caddr))
extern align_t *aligncast();
#else  /* ~lint */
#define ALIGNCAST(caddr)	((align_t *)(caddr))
#endif  /* ~lint */

#if defined(lint) && defined(KERNEL)
/* Have lint detect declarations of the form "register i;" */
#define	register
#endif /* (lint && KERNEL) */


/*
 * A use of the following macro should appear following each
 * declaration of an overlay to the variable portion of the netmsg.
 */
#define CHECKNMVARSIZE(tag, nmvtype) \
	struct tag { char xxnmxx[NMVARSIZE+1-sizeof(struct nmvtype)]; }

#if defined(KERNEL) && !defined(__UNDEF__)
/* Define away near/far keywords if not a 286 */
#define	far	/* */
#define	near	/* */
#endif /* (KERNEL && ~) */

#endif /* ! _POSIX_SOURCE */

#endif  /* ~_H_TYPES */
,kê¨‡ š  ÿ¡             a‰*a‰*a‰*          	                  ./usr/include/sys/udp.h ../netinet/udp.hkêŒë ˜  ÿ¡             a‰*a‰*a‰*          	                  ./usr/include/sys/udp_var.h ad.h../netinet/udp_var.h _vakêªÃ í  $        ã  V‰*£™ˆ*V‰*     º¶ã  	                  ./usr/include/sys/uio.h 
/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)uio.h	16.3	LCC)	/* Modified: 19:32:54 9/16/89 */
/* SCCSIDPUFF(@(#) uio.h 4.1 LM 12:58:43 4/23/85 C 22:13:46 4/23/85); */

#ifndef _h_UIO
#define _h_UIO

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */

struct iovec {
	caddr_t	iov_base;
	int	iov_len;
};

struct uio {
	struct	iovec *uio_iov;
	int	uio_iovcnt;
	int	uio_offset;
	int	uio_segflg;
	int	uio_resid;
};

enum	uio_rw { UIO_READ, UIO_WRITE };

/*
 * Segment flag values (should be enum).
 */
#define UIO_USERSPACE	0		/* from user data space */
#define UIO_SYSSPACE	1		/* from system space */
#define UIO_USERISPACE	2		/* from user I space */

#endif /* ~_h_UIO */
 a nokêèŸ ì  $        t  V‰*¤™ˆ*V‰*     ¾t  	                  ./usr/include/sys/un.h  
/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

/*	un.h	6.1	83/07/29	*/
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)un.h	16.3	LCC)	/* Modified: 19:34:35 9/16/89 */
/* SCCSIDPUFF(@(#) un.h 4.1 LM 12:58:49 4/23/85 C 22:13:47 4/23/85); */

/*
 * Definitions for UNIX IPC domain.
 */
struct	sockaddr_un {
	short	sun_family;		/* AF_UNIX */
	char	sun_path[108];		/* path name (gag) */
};

#ifdef KERNEL
int	unp_discard();
#endif /* KERNEL */


strkêææ —  $        ˜  b‰*G–ˆ*b‰*     ò½˜                    ./usr/include/sys/unpcb.h h ad.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)unpcb.h	16.3	LCC)	/* Modified: 20:00:37 9/15/89 */

/*
 * Copyright (c) 1982, 1986 Regents of the University of California.
 * All rights reserved.  The Berkeley software License Agreement
 * specifies the terms and conditions for redistribution.
 *
 *	@(#)unpcb.h	7.1 (Berkeley) 6/4/86
 */

/*
 * Protocol control block for an active
 * instance of a UNIX internal protocol.
 *
 * A socket may be associated with an inode in the
 * file system.  If so, the unp_inode pointer holds
 * a reference count to this inode, which should be irele'd
 * when the socket goes away.
 *
 * A socket may be connected to another socket, in which
 * case the control block of the socket to which it is connected
 * is given by unp_conn.
 *
 * A socket may be referenced by a number of sockets (e.g. several
 * sockets may be connected to a datagram socket.)  These sockets
 * are in a linked list starting with unp_refs, linked through
 * unp_nextref and null-terminated.  Note that a socket may be referenced
 * by a number of other sockets and may also reference a socket (not
 * necessarily one which is referencing it).  This generates
 * the need for unp_refs and unp_nextref to be separate fields.
 *
 * Stream sockets keep copies of receive sockbuf sb_cc and sb_mbcnt
 * so that changes in the sockbuf may be computed to modify
 * back pressure on the sender accordingly.
 */
struct	unpcb {
	struct	socket *unp_socket;	/* pointer back to socket */
	struct	inode *unp_inode;	/* if associated with file */
	ino_t	unp_ino;		/* fake inode number */
	struct	unpcb *unp_conn;	/* control block of connected socket */
	struct	unpcb *unp_refs;	/* referencing socket linked list */
	struct 	unpcb *unp_nextref;	/* link in unp_refs list */
	struct	mbuf *unp_addr;		/* bound address of socket */
	int	unp_cc;			/* copy of rcv.sb_cc */
	int	unp_mbcnt;		/* copy of rcv.sb_mbcnt */
};

#define	sotounpcb(so)	((struct unpcb *)((so)->so_pcb))
kê ë  $        zR  W‰*¤™ˆ*W‰*     NOzR  	              ¾  ./usr/include/sys/user.h  h ad.h/*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */


#ifndef H_SCCSID
#include <sccs.h>
#endif  /* H_SCCSID */
H_SCCSID(@(#)user.h	16.13.2.1	AIX)	/* Modified: 3/18/91 16:28:56 */

#ifndef	_h_USER
#define	_h_USER

#ifndef _h_RESOURCE
#include <sys/resource.h>
#endif /* ~_h_RESOURCE */

#ifndef _h_TIME
#include <sys/time.h>
#endif /* ~_h_TIME */

#ifndef _h_A_OUT
#include <sys/a.out.h>
#endif /* ~_h_A_OUT */

#ifndef _h_DIR
#include <sys/dir.h>
#endif /* ~_h_DIR */

#ifndef _h_PARAM
#include <sys/param.h>
#endif /* ~_h_PARAM */

#ifndef _h_SIGNAL
#include <sys/signal.h>
#endif /* ~_h_SIGNAL */

#if	!defined(_h_AOUTHDR)
#include <sys/aouthdr.h>
#endif /* ! _h_AOUTHDR */

#include <sys/pcb.h>
#include <sys/dmap.h>

#ifdef KERNEL
#include <errno.h>
#else /* ~KERNEL */
#include <sys/errno.h>
#endif /* ~KERNEL */

#if	defined(b370) && defined(SVPAGING) && !defined(_h_MM370)
#include  <sys/b370/mm370.h>
#endif  /* b370 && SVPAGING && !_h_MM370 */

#if defined(i386) && !defined(_h_REG)
#include <sys/reg.h>
#endif /*(i386) & !_h_REG*/

#if (defined(i386) && !defined(_h_TSS386))
#include <sys/i386/tss386.h>
#endif /* (i386 && !_h_TSS386) */

/*
 * userinfo-related declarations  (From AIX)
*/
#define UINFOSIZ        64      /* size of user info buffer             */
typedef char uinfo_t[UINFOSIZ];

/* command codes for usrinfo system call */
#define SETUINFO        1
#define GETUINFO        2

#ifdef FLOATREG
/* NEEDSWORK: this should be defined, when appropriate, in some machine
 * dependent file (e.g. reg.h)
 */
struct fpstate
{
#if defined(i386)
/* This isn't right for 386: need to add correct definition for 387 save...
 * For now, however, this is net compatible with older 286 systems.  */
	char	FP_fpsaved;	/* FP regs saved for this proc? how? */
	char	FP_fpused;	/* FP used by this process */
	short	FP_fper;	/* FP error register */
	struct fp87state FP_fps; /* see reg.h */
#endif /* i386 */
};
#endif /* FLOATREG */

/*
 *  The 'user_dta' structure collects those fields of the
 *  'user' structure that need to be transmitted to the
 *  remote site during a migrate or remote run, exec or fork system call.
 */

/*
   struct usr_fork

   Holds those elements of the u structure required only for
   netfork/migrate requests.  Only exchanged with homogeneous sites
   so no padding etc. required.
*/
struct usr_fork
{
	struct uprof {			/* profile arguments		*/
		caddr_t	pr_base;	/* buffer base			*/
		unsigned pr_size;	/* buffer size			*/
		unsigned pr_off;	/* pc offset			*/
		unsigned pr_scale;	/* pc scaling			*/
		caddr_t	pr_extension;	/* Implementation dependent extension */
	} UNX_prof;
	caddr_t	UNX_stkbase;	/* start or bottom of user stack */
#ifdef X286PROCS
	vaddr_t	UNX_286stk[2];	/* Fields for support of 286 procs. */
#endif /* X286PROCS */
	char	UNX_intsize;		/*   sizeof(int)	*/
	char	UNX_charptrsize;	/*   sizeof(char *)	*/
	char	UNX_dataptrsize;	/*   sizeof(int *)	*/
	char	UNX_textptrsize;	/*   sizeof(int (*)())	*/
#ifdef i386
	/* Floating point stuff for 386.  Sent across net only when needed.*/
	struct	fpstate UNX_fps;	/* floating regs and status	*/
#endif /* i386 */
};

/*
   struct usr_dta

   Holds those fields of the user structure required for all netproc
   requests.
   Heterogeneous exchangable structure.
*/
struct usr_dta
{
	PADOPEN(udLt)
	long	UNx_limit[8];		/* see <sys/vlimit.h>		*/
	long	UNx_slimit[6];		/* soft limits 			*/
	long	UNx_ldtype;		/* Load type, from getxheader	*/
	time_t	UNx_start;		/* Start time in gettod() units	*/
	time_t	UNx_ticks;		/* Start time in etime() units	*/
	sitemap_t UNx_xperm;		/* Valid execution site map	*/
	long	UNx_sigreturn;		/* 386 SVR3 signal return address */
	gfs_t	UNx_lcgfs;		/* gfs of "/local"		*/
	dev_t	UNx_ttyd;		/* controlling tty rdev		*/
	off_t 	UNx_ttyx;		/* channel for multiplex tty	*/
	ino_t	UNX_locino;		/* ino of "/local" */
	struct	rusage UNx_ru;		/* stats for this proc		*/
	struct	rusage UNx_cru;		/* sum of stats of reaped kids	*/
	struct	itimerval UNx_itim[2];	/* virtual and profiler timers	*/
	long	UNx_rttyp;		/* remote controlling tty pointer */
	PADCLOSE(udLt, udLs, udLu)
#define	UNX_limit	udLu.udLs.UNx_limit
#define	UNX_softlimit	udLu.udLs.UNx_slimit
#define	UNX_ldtype	udLu.udLs.UNx_ldtype
#define	UNX_start	udLu.udLs.UNx_start
#define	UNX_ticks	udLu.udLs.UNx_ticks
#define	UNX_xperm	udLu.udLs.UNx_xperm
#define	UNX_sigreturn	udLu.udLs.UNx_sigreturn
#define	UNX_lcgfs	udLu.udLs.UNx_lcgfs
#define	UNX_ttyd	udLu.udLs.UNx_ttyd
#define	UNX_ttyx	udLu.udLs.UNx_ttyx
#define	UNX_lcino	udLu.udLs.UNX_locino
#define	UNX_ru		udLu.udLs.UNx_ru
#define	UNX_cru		udLu.udLs.UNx_cru
#define	UNX_itim	udLu.udLs.UNx_itim
#define UNX_rttyp	udLu.udLs.UNx_rttyp
#define	UD_NLONGS	(sizeof(struct udLt) / sizeof(long))

	PADOPEN(udSt)
	short	UNX_Scmask;		/* mask for file creation	*/
	siteno_t UNX_Sttydsite;		/* controlling tty rdevsite	*/
	sitepath_t UNX_Sspath[SPATHLEN];/* Site list for namei/netprocs	*/
	PADCLOSE(udSt, udSs, udSu)

#define	UNX_cmask	udSu.udSs.UNX_Scmask
#define	UNX_ttydsite	udSu.udSs.UNX_Sttydsite
#define	UNX_spath	udSu.udSs.UNX_Sspath
#define	UD_NSHORTS	(sizeof (struct udSt) / sizeof (short))

	PADOPEN(udCt)
	char	UNX_Cnumcpy;		/* max # of copies of a file	*/
	char	UNX_Cflag;		/* Misc. flag bits, see below	*/
	char	UNX_Cacflag;		/* Accounting something		*/
	char	UNX_Cnonlocexec;	/* non local exec of 413	*/
	char	UNX_Clname[30];		/* string name of "/local"	*/
	uinfo_t UNX_Cuinfo;		/* usrinfo (see uinfo.h) */
	PADCLOSE(udCt, udCs, udCu)
#define	UNX_numcpy	udCu.udCs.UNX_Cnumcpy
#define	UNX_flag	udCu.udCs.UNX_Cflag
#define	UNX_acflag	udCu.udCs.UNX_Cacflag
#define	UNX_nonlocexec	udCu.udCs.UNX_Cnonlocexec
#define	UNX_lcname	udCu.udCs.UNX_Clname
#define	UNX_uinfo	udCu.udCs.UNX_Cuinfo

/*
 * ODIRSIZ is a local #define that is used to define the default command
 * name size and UVERS_SIZE.  This used to be DIRSIZ which is 14 for kernel
 * and non-bsd uses.  However, DIRSIZ is defined to be a macro dependent on
 * a variable, so DIRSIZ(x)  was expected when _BSD was used.  This caused
 * _BSD compiles including user.h to fail.
 */
#define ODIRSIZ 14
#define UVERS_SIZE (ODIRSIZ - 4)	/* must be able to at least append "i370" */

	PADOPEN(udHt)
	char	UNX_Huvers[UVERS_SIZE + 1];	/* hidden dir prefix	*/
					/*  "+1" for null-termination	*/
	PADCLOSE(udHt, udHs, udHu)
#define	UNX_uvers		udHu.udHs.UNX_Huvers

	PADOPEN(udNt)
	char	UNX_Ncomm[ODIRSIZ];	/* command Name			*/
	PADCLOSE(udNt, udNs, udNu)
#define	UNX_comm		udNu.udNs.UNX_Ncomm
};

/*
 * This data structure describes the credentials of a process
 */
struct ucred {
	PADOPEN(ucrLt)
	long	UCR_groups[NGROUPS];
	PADCLOSE(ucrLt, ucrLs, ucrLu)
#define	cr_groups	ucrLu.ucrLs.UCR_groups
#define	UCR_NLONGS	(sizeof (struct ucrLt) / sizeof (long))
	PADOPEN(ucrSt)
	short	UCR_ref;
	short	UCR_uid;
	short	UCR_gid;
	short	UCR_ruid;
	short   UCR_rgid;
	PADCLOSE(ucrSt, ucrSs, ucrSu)
#define	cr_ref		ucrSu.ucrSs.UCR_ref
#define	cr_uid		ucrSu.ucrSs.UCR_uid
#define	cr_gid		ucrSu.ucrSs.UCR_gid
#define	cr_ruid		ucrSu.ucrSs.UCR_ruid
#define	cr_rgid		ucrSu.ucrSs.UCR_rgid
#define	UCR_NSHORTS	(sizeof (struct ucrSt) / sizeof (short))
}; 

#define		u_uid		u_cred->cr_uid
#define		u_ruid		u_cred->cr_ruid
#define		u_gid		u_cred->cr_gid
#define		u_rgid		u_cred->cr_rgid
#define		u_groups	u_cred->cr_groups

#ifdef KERNEL
#define	crhold(cr)	(cr)->cr_ref++
struct ucred *crget();
struct ucred *crcopy();
struct ucred *crdup();
#endif KERNEL

/*
 *  This data structure describes the executable file, it is
 *  exported to the child site in its entirety.
 */

union usr_xdsc	{
	struct	exec Ux_A;		/* header of executable file */
#ifdef	u370
	struct pcchdr Ux_s5A;		/* PCC IX/370 aout header */
#else
	struct aouthdr Ux_s5A;		/* System 5 aout header */
#endif
};
#	define	ux_mag		Ux_A.a_magic
#	define	ux_tsize	Ux_A.a_text
#	define	ux_dsize	Ux_A.a_data
#	define	ux_bsize	Ux_A.a_bss
#	define	ux_ssize	Ux_A.a_syms
#	define	ux_entloc	Ux_A.a_entry
#	define  ux_aouthdr	Ux_s5A

/*
   Using this data structure, the parent exports parameters
   and argument counts call to the child site
   Heterogeneously exchangable structure.
*/
struct xarg_set
{
	PADOPEN(xs_Lt)
	swblk_t	Xrg_bkno;		/* Swapdev location of args/env	*/
	gfs_t	Xrg_igfs;		/* Gfs of executable file	*/
	ino_t	Xrg_inum;		/* I-number of executable file	*/
	PADCLOSE(xs_Lt, xs_Ls, xs_Lu)
#define	xrg_bkno	xs_Lu.xs_Ls.Xrg_bkno
#define	xrg_igfs	xs_Lu.xs_Ls.Xrg_igfs
#define	xrg_inum	xs_Lu.xs_Ls.Xrg_inum
#define	NXRLONGS	(sizeof(struct xs_Lt) / sizeof(long))

	PADOPEN(xs_St)
	short	xrg_Snchr;		/* Number of chars of args	*/
	short	xrg_Snarg;		/* Number of args		*/
	short	xrg_Snenv;		/* Number of env strings	*/
	PADCLOSE(xs_St, xs_Ss, xs_Su)
#define	xrg_nchr	xs_Su.xs_Ss.xrg_Snchr
#define	xrg_narg	xs_Su.xs_Ss.xrg_Snarg
#define	xrg_nenv	xs_Su.xs_Ss.xrg_Snenv
#define	NXRSHORTS	(sizeof(struct xs_St) / sizeof(short))
};


#ifdef i386
#define	NARGSMAX	8
#endif /* i386 */

#if	!defined(NARGSMAX)
#define NARGSMAX	6	/* max number of ints in args */
#endif	/* !NARGSMAX */

/*
 * The user structure.
 * One allocated per process.
 * Contains all per process data
 * that doesn't need to be referenced
 * while the process is swapped.
 * The user block is UPAGES*NBPG bytes
 * long; resides at virtual user
 * loc USRSTACK; contains the system
 * stack per user (on some machines); is cross referenced
 * with the proc structure for the
 * same process.
 */
 
struct	user
{
#if	defined(i386)
	label_t	u_rsav;			/* label while process switching. */
#endif	/* defined(i386) */
#if	defined(PAGING) || defined(SWAPPING) || defined(b370)
	struct	pcb u_pcb;
#endif  /* (PAGING || SWAPPING || b370) */
	int	u_arg[NARGSMAX];	/* arguments to current system call */
	label_t	u_qsav;			/* for non-local gotos on interrupts */
	short	u_error;		/* return error code */
	char	u_segflg;		/* 0:user D; 1:system; 2:user I */
#ifdef	DUALCALL
	char	u_calltype;		/* 0 = old calling sequence in use */
#endif	/* DUALCALL */
	char	u_nomigrates;		/* Forces local ops for IPC	*/
	char	u_nmlocks;		/* number of locked svrprocs */
	struct usr_fork	u_fdta;		/* Network fork only fields	*/

#define	u_prof		u_fdta.UNX_prof
#define u_stkbase	u_fdta.UNX_stkbase
#define u_intsize	u_fdta.UNX_intsize
#define u_charptrsize	u_fdta.UNX_charptrsize
#define u_dataptrsize	u_fdta.UNX_dataptrsize
#define u_textptrsize	u_fdta.UNX_textptrsize
#if	defined(i386)
#define u_fpsaved	u_fdta.UNX_fps.FP_fpsaved
#define u_fpused	u_fdta.UNX_fps.FP_fpused
#define u_fper		u_fdta.UNX_fps.FP_fper
#define u_fps		u_fdta.UNX_fps.FP_fps
#endif /* i386 */

#define	u_ldtype	u_nptx.UNX_ldtype


	struct usr_dta	u_nptx;		/* Fork/mig & exec/run fields	*/
#define		u_numcpy	u_nptx.UNX_numcpy
#define		u_flag		u_nptx.UNX_flag
#define		u_comm		u_nptx.UNX_comm
#define		u_uvers		u_nptx.UNX_uvers
#define		u_acflag	u_nptx.UNX_acflag
#if	defined(PAGING) || defined(SWAPPING)
#define		u_nonlocexec	u_nptx.UNX_nonlocexec
#endif  /* (PAGING || SWAPPING) */
#define		u_spath		u_nptx.UNX_spath
#define		u_cmask		u_nptx.UNX_cmask
#define		u_start		u_nptx.UNX_start
#define		u_ticks		u_nptx.UNX_ticks
#define		u_xperm		u_nptx.UNX_xperm
#define		u_sigreturn	u_nptx.UNX_sigreturn
#define		u_limit		u_nptx.UNX_limit
#define		u_softLimit	u_nptx.UNX_softlimit
#define		u_ru		u_nptx.UNX_ru
#define		u_cru		u_nptx.UNX_cru
#define		u_intervalTimer	u_nptx.UNX_itim
#define		u_locgfs	u_nptx.UNX_lcgfs
#define		u_locino	u_nptx.UNX_lcino
#define		u_locname	u_nptx.UNX_lcname
#define		u_uinfo		u_nptx.UNX_uinfo
#ifdef FASTPS
/* To minimize the code effect of keeping a copy of u_ttyd in the proc table,
 * we use the process table version except during network operations,
 * when we copy the process table version to/from u_nptx.UNX_ttyd.  */
#define		u_ttyd		u_procp->p_ttyd
#define		u_ttydsite	u_procp->p_ttydsite
#else /* ~FASTPS */
#define		u_ttyd		u_nptx.UNX_ttyd
#define		u_ttydsite	u_nptx.UNX_ttydsite
#endif /* ~FASTPS */
#define		u_ttyx		u_nptx.UNX_ttyx
#define		u_rttyp		u_nptx.UNX_rttyp
	char	u_eosys;		/* special action on end of syscall */
	struct	proc *u_procp;		/* pointer to proc structure */
	struct	ucred *u_cred;		/* Reserved by steve for Credentials */
	int	*u_ap;			/* pointer to arglist */
	union {				/* syscall return values */
		struct	{
			int	R_val1;
			int	R_val2;
		} u_rv;
#define	r_val1	u_rv.R_val1
#define	r_val2	u_rv.R_val2
#define u_rval1 u_r.r_val1
#define u_rval2 u_r.r_val2
		off_t	r_off;
		time_t	r_time;
#define	u_roff	u_r.r_off
#define	u_rtime	u_r.r_time
		long	r_long;
#define	u_rlong	u_r.r_long

#if	defined(SIXTEENBITS) && defined(LONGPID)
		pid_t	r_pid;
#else	/* ! (SIXTEENBITS && LONGPID) */
#define	r_pid	u_rv.R_val1
#endif	/* ! (SIXTEENBITS && LONGPID) */
	} u_r;
	long	u_fmode;		/* open mode of current file */
	caddr_t	u_base;			/* base address for IO */

#define	ubaseincr(x)	u.u_base += x
#define	ubasedecr(x)	ubaseincr(-(x))

	u_int   u_count;		/* bytes remaining for IO */
	off_t	u_offset;		/* offset in file for IO */
	u_int	u_icount;		/* init val of u_count in read/write */
					/* otherwise, it should be -1 */
	struct	inode *u_cdir;		/* pointer to current directory inode */
	struct	inode *u_rdir;		/* root directory of current process */
	caddr_t	u_dirp;			/* pathname pointer */
	short	u_namlen;		/* length of the current pathname
					 * component */
	struct specreq  * u_srptr;	/* pointer to a specific request
					   structure (used in specific open
					   and stat and access requests     */
	struct	file *u_ofile[NOFILE];	/* pointers to file structures of open files */
	char	u_pofile[NOFILE];	/* per-process flags of open files */
/* WARNING: if you change EXCLOSE be sure to change FD_CLOEXEC in <fcntl.h>! */
#define	EXCLOSE 01		/* auto-close on exec */
/*#define FD_CLOEXEC EXCLOSE 	/* synonym that allows for POSIX draft 12.3
				   sections 6.5.1.2 and 6.5.2.2. conformance */
/*The above define has been moved to <fcntl.h> as #define FD_CLOEXEC 01 */
	label_t u_ssav;			/* label variable for swapping */
	int	(*u_signal[NSIG])();	/* disposition of signals */
	ksigmask_t u_sigmask[NSIG];	/* signals to be blocked */
	ksigmask_t u_sigonstack;	/* signals to take on sigstack */
	ksigmask_t u_sigintr;		/* signals that interrupt syscalls */
	ksigmask_t u_oldmask;		/* saved mask from before sigpause */
	struct	sigstack u_sigstack;	/* sp & on stack state variable */
#define	u_onstack	u_sigstack.ss_onstack
#define	u_sigsp		u_sigstack.ss_sp

#ifdef SVPAGING
	long    u_mem;		/* from 5.2.  Never really used? */
#endif /* SVPAGING */
#if	defined(X286PROCS)
	/* Fields for the support of 286 mode processes. see user286.h. */
	ushort	u_286shorts[1];
	char	u_286chars[4];
#endif	/* (X286PROCS) */

	int	u_code;			/* ``code'' to trap */
/* on SIGILL code passes compatibility mode fault address  */
/* on SIGFPE code passes more specific kind of floating point fault */
	int	*u_ar0;			/* address of users saved R0 */
	struct trapblk	*u_trapblk;	/* trapblk saved on entry to kernel */
#ifdef	b370
/* 370 PER info */
	u_int	u_permask;		/* per mask register. */
					/* Loaded by resume, if necessary */
#define	PER_BR	0x80000000		/* Successful branch */
#define	PER_IF	0x40000000		/* Instruction fetch */
#define PER_SA	0x20000000		/* Storage allocation */
#define	PER_GRA	0x10000000		/* General register alteration */

	u_int	u_persaddr;		/* Start addr */
	u_int	u_pereaddr;		/* End addr */
#endif	/* b370 */

	struct	tty *u_ttyp;		/* controlling tty pointer */
	union	usr_xdsc u_exdata;	/* header of executable file... */
					/* ...Does not retain validity long */

	struct  xarg_set u_xcargs;	/* parameters for remote execution */

	/* depending upon SIXTEENBITS, size_t is either int or long */

	size_t	u_tsize;		/* text size (clicks) */
	size_t	u_dsize;		/* data size (clicks) */
	size_t	u_ssize;		/* stack size (clicks) */

#ifdef i386
	struct tss386 *u_tss;		/* pointer to user TSS */
	ushort u_tsslimit;		/* end of u_tss. */
#endif /* i386 */

#if	defined(PAGING) || defined(SWAPPING)
	struct	dmap u_dmap;		/* disk map for data segment */
	struct	dmap u_smap;		/* disk map for stack segment */
	struct	dmap u_cdmap, u_csmap;	/* shadows of u_dmap, u_smap, for
					   use of parent during fork */
	time_t	u_outime;		/* user time at last sample */
	size_t	u_odsize, u_ossize;	/* for (clumsy) expansion swaps */
#endif  /* (PAGING || SWAPPING) */
	long	u_ioch;			/* Number of I/O characters */

					/* RCD request netmsg filled in	*/
					/* in rcdsvr{r,w,io} and used	*/
					/* to send a WACK of the RCD	*/
					/* requests that cannot be	*/
        struct netmsg  *u_rcdnmp;	/* immediately completed	*/

#ifdef SMALLBLOCKS
	off_t	u_blkoff;	/* offset from start of block to useable data */
	off_t	u_blkavail;	/* number of bytes avail in the block */
#endif /* SMALLBLOCKS */
	short	u_lock;			/* process/text locking flags */
	struct pspair *u_pspfree;	/* per-proc pid-site pool free list */

	off_t u_mpxchan;		/* channel for multiplex devices */
	long u_delta_time;		/* time in microsec to compute the */
					/* integral of memory usage */
	long u_prev_xrss;		/* prev xrss value */
	long u_prev_drss;		/* prev drss value */
	long u_prev_srss;		/* prev srss value */
	long u_reserved[6];		/* reserved for future expansion */
#ifdef HFTHOOKS
 	char u_onice;			/* Store old pri for monitor mode */
#endif HFTHOOKS

#ifdef _MBCS
	charlen_t u_codeset[CODESIZE];	/* store codeset information here */
#endif /* _MBCS */

#if	defined(b370) && defined(SVPAGING)
	/* The uptes & segment table HAVE to be the last things in the
	 * u structure to insure proper alignment
	 */
#ifdef	S370
	/* Must have a multiple of four of these, and should have
	 * at least UPAGES + 1 ptes to include a red zone
	 */
	pte_t	u_uptes[((UPAGES/4+1)*4)];
#endif	/* S370 */
#ifdef	XA370
	pte_t	u_uptes[XASMALLESTPTETABLE];
#endif	/* XA370 */
	ste_t	u_st370[STSIZE];
#endif	(b370 && SVPAGING)
#if defined(vax) || defined(SOFT_VAX)
	/* 1 kernel stack per process,
	 * extends from u + UPAGES*512
	 * backward not to reach here */
	int	u_stack[1];
#endif  /* defined(vax) || defined(SOFT_VAX) */
/* SHOULD INSTEAD GROW STACK BACKWARDS ABOVE u. TOWARDS A VIRTUAL HOLE */
};

#ifdef i386
/*
 * Number of pages allocated for each process's ublock which includes
 * its kernel stack, u structure, ldt, tss and io-bitmap.
 */
#define	MINUPAGES \
	btoc(KSTACKSIZE + sizeof(struct user) + LDTSIZE + sizeof(struct tss386))

/*
 * Add enough for 65536 bits worth of I/O bit map.
 */
#define UPAGES	(MINUPAGES + 2)
#endif /* i386 */

/*
 * structure definition for specific requests for opens and stats.  No
 * storage is declared here but some is done in the specific open call
 * The u.u_srptr pointer points to an incarnation of this structure.
 */
struct specreq
{
	siteno_t sr_ssite;	/* a specific site */
};

/* u_eosys values */
#define	NORMALRETURN	0
#define	RESTARTSYS	1
#define	JUSTRETURN	2
#define NETFUNC		3	/* This must be the largest of these values. */
				/* See the tests in each trap/sysent file. */

/* user settable flag bits defined for u_flag */
#define U_COMMIT	1
	/* U_COMMIT is a user settable flag which determines the setting
	   of the inode flag bit ICOMMIT upon subsequent file opens.  The
	   flag in the inode tells if the file should be committed or
	   aborted in case of unexpected termination. */
#define	U_XUID		2
	/* U_XUID is a user settable execution parameter which determines if
	   the real user id will be used as both the real and effect
	   user id's in the next program invoked with exec or run. */
#define	U_XGID		4
	/* U_XGID is a user settable execution parameter which determines if
	   the real group id will be used as both the real and effect
	   group id's in the next program invoked with exec or run. */
#define U_NFSLOCK	8
	/* U_NFSLOCK is set whenever a process call nfs_lockf() - when this
           is set all NFS locks set in a US inode will be cleared upon
	  termination. (current caller is rpc.lockd. */		

#define U_SIGSET	16
	/* SVR3 compatibility for the proper sigreturn action */
	/* for more information please see P20863 */

#define	U_ALTCSET	32
	/* Codeset information is assumed to be default C locale. If */
	/* A new codeset is set by the user, then turn on this flag. */


#ifdef KERNEL

#ifdef	NOKMAP
struct usermap	{ struct pte * um_map; struct user ** um_uaddr; };
extern struct usermap umaps[];	/* used in vmaccess */
#endif	/* NOKMAP */

#ifdef i386
extern struct user near u;
#else
extern struct user u;
#endif

#if defined(i386)
extern char near	kstack[KSTACKSIZE];   /* kernel stack */
#endif /* i386 */

#if	defined(GOOD_UTL)
extern	struct user *swaputl;
extern	struct user *forkutl;
extern	struct user *xswaputl;
extern	struct user *xswap2utl;
extern	struct user *pushutl;
extern	struct user *vfutl;
#else	/* ~ defined(GOOD_UTL) */
extern	struct user swaputl;
extern	struct user forkutl;
extern	struct user xswaputl;
extern	struct user xswap2utl;
extern	struct user pushutl;
extern	struct user vfutl;
#endif	/* ~defined(GOOD_UTL) */

#endif	/* KERNEL */

#endif  /* ~_h_USER */
tiplexkêd¦ ê  $        x  W‰*¤™ˆ*W‰*     âµx  	                  ./usr/include/sys/ustat.h h ad.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)ustat.h	16.3	LCC)	/* Modified: 19:36:26 9/16/89 */

#ifndef	_h_USTAT
#define	_h_USTAT

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */

/*	@(#)ustat.h	1.1	*/
/*	3.0 SID #	1.1	*/
struct  ustat {
	daddr_t	f_tfree;	/* total free */
	ino_t	f_tinode;	/* total inodes free */
	char	f_fname[6];	/* filsys name */
	char	f_fpack[6];	/* filsys pack name */
};

#if defined(i386) && defined(X286PROCS)
/* ustat structure fields align the same, but 386 gets padded to 4 byte
** boundary at the end, so it's size is larger. 
*/

/* xustat is here just so ustat can figure out the right size for the structure
** to copy back to x286procs.
*/
struct xustat {
	char xustatc[6+6+sizeof(ino_t)+sizeof(daddr_t)];
};
#endif /* defined(i386) && defined(X286PROCS) */

#endif /* ~_h_USTAT */
kêÁ è  $        ›  W‰*¤™ˆ*W‰*     1`›  	                  ./usr/include/sys/utsname.h ad.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986 Microsoft Corporation
 *	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef _POSIX_SOURCE
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)utsname.h	16.7       LCC)    /* Modified: 23:28:21 1/12/90 */
#endif /* NOT _POSIX_SOURCE */

#ifndef	_H_UTSNAME
#define	_H_UTSNAME

#ifndef _POSIX_SOURCE
#include <sys/DOPTIONS.h>
#endif	/* !_POSIX_SOURCE */

#define _UTSNMLEN 32

#ifndef _POSIX_SOURCE
#define UTSNMLEN _UTSNMLEN
#endif /* ! POSIX_SOURCE */

struct utsname {
	char	sysname[_UTSNMLEN];
	char	nodename[_UTSNMLEN];
	char	release[_UTSNMLEN];
	char	version[_UTSNMLEN];
	char	machine[_UTSNMLEN];
};

#ifndef	_KERNEL
extern int uname();
#endif /* !_KERNEL */

#ifndef _POSIX_SOURCE
struct xutsname {
	unsigned long nid;	/* node id (TCF site number if TCF installed) */
	long reserved[3];
};

#ifdef  _KERNEL
extern struct utsname utsname;
extern struct xutsname xutsname;
#endif /* !_KERNEL */

#endif /* !_POSIX_SOURCE */

#endif /* ~_H_UTSNAME */
ment kê®j ç  $        b  W‰*¥™ˆ*W‰*     ¾b  	                  ./usr/include/sys/vadvise.h ad.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)vadvise.h	16.3	LCC)	/* Modified: 19:38:09 9/16/89 */
/* SCCSIDPUFF(@(#) vadvise.h 4.1 LM 12:59:10 4/23/85 C 22:13:51 4/23/85); */

#ifndef _h_VADVISE
#define _h_VADVISE

#if	defined(PAGING) || defined(SWAPPING)

/*
 * Parameters to vadvise() to tell system of particular paging
 * behaviour:
 *	VA_NORM		Normal strategy
 *	VA_ANOM		Sampling page behaviour is not a win, don't bother
 *			Suitable during GCs in LISP, or sequential or random
 *			page referencing.
 */
#define	VA_NORM	0
#define	VA_ANOM	1
#define	VA_SEQL	2

#endif  /* (PAGING || SWAPPING) */

#endif /* ~_h_VADVISE */

#endikê~N 6  $        ×  -‰*°™ˆ*-‰*     òy×  	              Ã  ./usr/include/sys/values.h  ad.h#if !defined(H_SCCSID)
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)values.h	16.6	LCC)	/* Modified: 17:53:09 9/19/90 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#if !defined(_h_VALUES)
#define _h_VALUES
/* These values work with any binary representation of integers
 * where the high-order bit contains the sign */

/* A number used normally for size of a shift */
#if defined(gcos)
#define BITSPERBYTE	9
#else
#define BITSPERBYTE	8
#endif
#define BITS(type)	(BITSPERBYTE * (int)sizeof(type))

/* Short, regular and long ints with only the high-order bit turned on */
#define HIBITS	((short)(1 << (BITS(short) - 1)))
#define HIBITI	(1 << (BITS(int) - 1))
#define HIBITL	(1L << (BITS(long) - 1))

/* Largest short, regular and long int */
#define MAXSHORT	((short)(~HIBITS))
#define MAXINT	(~HIBITI)
#define MAXLONG	(~HIBITL)

/* Various values which describe the binary floating-point representation
 * _EXPBASE	- The exponent base
 * DMAXEXP 	- The maximum exponent of a double (as returned by frexp())
 * FMAXEXP 	- The maximum exponent of a float  (as returned by frexp())
 * DMINEXP 	- The minimum exponent of a double (as returned by frexp())
 * FMINEXP 	- The minimum exponent of a float  (as returned by frexp())
 * MAXDOUBLE	- the largest double
#if defined(u370)
			((_EXPBASE ** DMAXEXP) * (1 - (_EXPBASE ** -DSIGNIF)))
#else  ~u370
			((_EXPBASE ** (DMAXEXP + 1)) - 1)
#endif ~u370
 * MAXFLOAT	- the largest float
#if defined(u370)
			((_EXPBASE ** FMAXEXP) * (1 - (_EXPBASE ** -FSIGNIF)))
#else  ~u370
			((_EXPBASE ** (FMAXEXP + 1)) - 1)
#endif ~u370
 * MINDOUBLE	- the smallest double (_EXPBASE ** (DMINEXP - 1))
 * MINFLOAT	- the smallest float (_EXPBASE ** (FMINEXP - 1))
 * DSIGNIF	- The number of significant bits in a double
 * FSIGNIF	- The number of significant bits in a float
 * DMAXPOWTWO	- The largest power of two exactly representable as a double
 * FMAXPOWTWO	- The largest power of two exactly representable as a float
 * _IEEE	- 1 if IEEE standard representation is used
 * _DEXPLEN	- The number of bits for the exponent of a double
 * _FEXPLEN	- The number of bits for the exponent of a float
 * _HIDDENBIT	- 1 if high-significance bit of mantissa is implicit
 * LN_MAXDOUBLE	- the natural log of the largest double  -- log(MAXDOUBLE)
 * LN_MINDOUBLE	- the natural log of the smallest double -- log(MINDOUBLE)
 */

#if defined(M_I86) || defined(M_I286) || defined(i386)
#define MAXDOUBLE	1.79769313486231570e+308
#if !defined(MAXFLOAT)
#define MAXFLOAT	((float)3.40282346638528860e+38)
#endif
#define MINDOUBLE	4.94065645841246544e-324
#define MINFLOAT	((float)1.40129846432481707e-45)
#define	_IEEE		1
#define _DEXPLEN	11
#define _HIDDENBIT	1
#define DMINEXP	(-(DMAXEXP + DSIGNIF - _HIDDENBIT - 3))
#define FMINEXP	(-(FMAXEXP + FSIGNIF - _HIDDENBIT - 3))
#else
#if !defined(FLOAT)
#define FLOAT
#endif
#endif

#if defined(u3b) || defined(u3b5)
#define MAXDOUBLE	1.79769313486231470e+308
#define MAXFLOAT	((float)3.40282346638528860e+38)
#define MINDOUBLE	4.94065645841246544e-324
#define MINFLOAT	((float)1.40129846432481707e-45)
#define	_IEEE		1
#define _DEXPLEN	11
#define _HIDDENBIT	1
#define DMINEXP	(-(DMAXEXP + DSIGNIF - _HIDDENBIT - 3))
#define FMINEXP	(-(FMAXEXP + FSIGNIF - _HIDDENBIT - 3))
#endif
#if defined(pdp11) || defined(vax)
#define MAXDOUBLE	1.701411834604692293e+38
#define MAXFLOAT	((float)1.701411733192644299e+38)
/* The following is kludged because the PDP-11 compilers botch the simple form.
   The kludge causes the constant to be computed at run-time on the PDP-11,
   even though it is still "folded" at compile-time on the VAX. */
#define MINDOUBLE	(0.01 * 2.938735877055718770e-37)
#define MINFLOAT	((float)MINDOUBLE)
#define _IEEE		0
#define _DEXPLEN	8
#define _HIDDENBIT	1
#define DMINEXP	(-DMAXEXP)
#define FMINEXP	(-FMAXEXP)
#endif
#if defined(gcos)
#define MAXDOUBLE	1.7014118346046923171e+38
#define MAXFLOAT	((float)1.7014118219281863150e+38)
#define MINDOUBLE	2.9387358770557187699e-39
#define MINFLOAT	((float)MINDOUBLE)
#define _IEEE		0
#define _DEXPLEN	8
#define _HIDDENBIT	0
#define DMINEXP	(-(DMAXEXP + 1))
#define FMINEXP	(-(FMAXEXP + 1))
#endif
#if defined(u370)
#define _LENBASE	4
#define _DEXPLEN	7
#define _HIDDENBIT	0
#define DMINEXP (-(DMAXEXP + _LENBASE))
#define FMINEXP (-(FMAXEXP + _LENBASE))
#define MAXDOUBLE	7.237005577332262113e75
#define MAXFLOAT	((float)7.237005145973115539e75)
#define MINDOUBLE	5.39760534693402789086e-79
#define MINFLOAT	((float)5.39760534693402789086e-79)
#define CUBRTHUGE	1.9342812729526891e25
#define INV_CUBRTHUGE	5.16987893117269075018e-26
#define _FEXPLEN	7
#define _IEEE		0
#else
#define _LENBASE	1
#define _FEXPLEN	8
#endif
#define _EXPBASE	(1 << _LENBASE)
#define DSIGNIF	(BITS(double) - _DEXPLEN + _HIDDENBIT - 1)
#define FSIGNIF	(BITS(float)  - _FEXPLEN + _HIDDENBIT - 1)
#define DMAXPOWTWO	((double)(1L << BITS(long) - 2) * \
				(1L << DSIGNIF - BITS(long) + 1))
#define FMAXPOWTWO	((float)(1L << FSIGNIF - 1))
#if defined(u370)
#define FMAXEXP	((((1 << (_FEXPLEN - 1)) - 1) * _LENBASE))
#define DMAXEXP	((((1 << (_DEXPLEN - 1)) - 1) * _LENBASE))
#else
#define FMAXEXP	((1 << _FEXPLEN - 1) - 1 + _IEEE)
#define DMAXEXP	((1 << _DEXPLEN - 1) - 1 + _IEEE)
#endif
#define LN_MINDOUBLE	(M_LN2 * (DMINEXP - 1))
#define LN_MAXDOUBLE	(M_LN2 * DMAXEXP)
#define H_PREC	(DSIGNIF % 2 ? (1L << DSIGNIF/2) * M_SQRT2 : 1L << DSIGNIF/2)
#define X_EPS	(1.0/H_PREC)
#define X_PLOSS	((double)(long)(M_PI * H_PREC))
#define X_TLOSS	(M_PI * DMAXPOWTWO)
#define M_LN2	0.69314718055994530942
#define M_PI	3.14159265358979323846
#define M_SQRT2	1.41421356237309504880
#define MAXBEXP	DMAXEXP /* for backward compatibility */
#define MINBEXP	DMINEXP /* for backward compatibility */
#define MAXPOWTWO	DMAXPOWTWO /* for backward compatibility */

#endif /* ! _h_VALUES */
MkêB ä  $        •  X‰*²™ˆ*X‰*     ¾•  	              ’e  ./usr/include/sys/var.h /*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)var.h	16.4	LCC)	/* Modified: 17:30:41 1/12/90 */

#ifndef	_h_VAR
#define	_h_VAR

/* @(#)var.h	1.2 */
struct var {
	/* sizes of variable size kernel tables */
	int		v_buf;		/* number of buffers 		*/
	int		v_call;		/* number of callouts 		*/
	int		v_clist;	/* number of clist buffers 	*/
	int		v_file;		/* size of the file table 	*/
	int		v_inode;	/* number of incore inodes 	*/
	int		v_lock;		/* number of file locks 	*/
	int		v_mount;	/* size of the mount tables 	*/
	int		v_netmsg;	/* current count of netmessages	*/
	int		v_pidsite;	/* remote process track records */
	int		v_plist;	/* size of propagate list	*/
	int		v_pmount;	/* real mounts for this site	*/
	int		v_proc;		/* size of the process table	*/
	int		v_rwake;	/* remote wakeup records 	*/
	int		v_rsleep;	/* remote sleep records 	*/
	int		v_sites;	/* # of sites in our network 	*/
	int		v_tcbtab;	/* I-node token control blocks 	*/
	int		v_tcbloci;	/* I-node token locations 	*/
	int		v_text;		/* size of the text table 	*/
	int		v_vbuf ;	/* size of the malloc area 	*/
	int		v_dcbuf;	/* number of dir. cache entries */
	int		v_pbuf;		/* buffers for physio		*/
	int		v_tblgrow[16];	/* growth for table sizes	*/

	/* sizes of hash pools and associated hash masks		*/
	int		v_hbuf;		/* number of buffer hash groups	*/
	int		v_hmask;	/* mask for buffer hashing	*/
	int		v_hino;		/* number of inode hash groups	*/
	int		v_himask;	/* mask for inode hashing	*/
	int		v_hproc;	/* number of proc hash groups	*/
	int		v_hpmask;	/* mask for process hashing	*/
	int		v_hsleep;	/* number of sleep hash groups	*/
	int		v_hsmask;	/* mask for sleep hashing	*/
	int		v_hdcbuf;	/* number dir. cache hash groups*/
	int		v_hdcmask;	/* mask for dir. cache hashing	*/
	int		v_rsel;		/* number of remote selects	*/
	int		v_hmount;	/* number of gmount hash groups */
	int		v_hmmask;	/* mask for gmount hashing	*/
	int		v_hshgrow[5];	/* growth for more hashed pools	*/

	/* assorted parameters that seemed to deserve being in here	*/
	int		v_maxup;	/* Max. processes per user	*/
	int		v_nswapmap;	/* max segmentation of the swap area */
	int		v_nswbuf;	/* number of buffers for swapping */
	int		v_pcklist;	/* number of packlist entries	*/
	int		v_unmount;	/* max # of gmount entries */
	int		v_unpmount;	/* max # of pmount entries */
	int		v_prmgrow[17];	/* growth for more parameters	*/

	/* table end pointers - here for largely historical reasons	*/
	struct inode	*ve_inode;	/* end of the inode table	*/
	struct file	*ve_file;	/* end of the file table	*/
	struct gmount   *ve_mount;	/* No longer used, filler       */
	struct proc	*ve_proc;	/* end of the process table	*/
	struct text	*ve_text;	/* end of the text table	*/
	/* table growth upper bounds on size - may or may not change	*/
	int		v_uncall;	/* max # of callouts enteries	*/
	int		v_unfile;	/* max # of file table enteries	*/
	int		v_uninode;	/* max # of inode entries	*/
	int		v_unproc;	/* max # of proc entries	*/
	int		v_untext;	/* max # of text entries	*/
	int		v_untcbtab;	/* max # of token entries	*/
	int		v_untcbloci;	/* max # of tok loc entries	*/
	int		v_unplist;	/* max # of prop entries	*/
	int		v_unrcmdp;	/* max # of recovery entries	*/
	int		v_unpsp;	/* max # of pidsitepool entries	*/
	/* machine type specific parameters				*/
#ifdef  b370
	int		v_ndevs;	/* number of devices		*/
#ifdef	SVPAGING
	int		v_vseg;		/* current count of vsegs	*/
	int		v_pvseg;	/* current count of procvsegs	*/
	int		v_pad[17];	/* pad the total out to 20	*/
#else	/* ~SVPAGING */
	int		v_pad[19];	/* pad the total out to 20	*/
#endif	/* ~SVPAGING */
#endif	/* b370 */

#if	defined(i386)
	int		v_cmapsiz;	/* max # frags of core map 	*/
	int		v_vseg;		/* current count of vsegs	*/
	int		v_pvseg;	/* current count of procvsegs	*/
	int		v_pad[16];	/* pad the total out to 20	*/
#endif	/* defined(i386) */
#ifdef  vax
	int		v_pad[20];	/* pad the total out to 20	*/
#endif  /* vax */

};

#ifdef  KERNEL
extern struct var v;
#endif  /* KERNEL */

#endif /* ~_h_VAR */
, 1kêœÃ ã  $          X‰*¦™ˆ*X‰*     Ac  
                  ./usr/include/sys/version.h ad.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)version.h	16.5.1.2	LCC)	/* Modified: 19:19:21 6/25/91 */
/* SCCSIDPUFF(@(#) version.h 4.1 LM 12:59:18 4/23/85 C 22:13:53 4/23/85); */

#ifndef SYS
#define	SYS	"AIX"
#endif SYS

#ifndef REL
#define	REL	"3.0"
#endif REL

#ifndef VER
#define	VER	"1"
#endif VER
numkêj× ¦  ÿ¡             x‰*x‰*x‰*          	                  ./usr/include/sys/vfs.h ../rpc/vfs.h /sykêÞ‰ â  $        ¬  X‰*¦™ˆ*X‰*     “c¬  	                  ./usr/include/sys/vlimit.h  ad.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)vlimit.h	16.4	LCC)	/* Modified: 19:41:33 9/16/89 */
/* SCCSIDPUFF(@(#) vlimit.h 4.1 LM 12:59:22 4/23/85 C 22:13:54 4/23/85); */

#ifndef _h_VLIMIT
#define _h_VLIMIT

/*
 * Limits for u.u_limit[i], per process, inherited.
 */
#define	LIM_NORAISE	0	/* if <> 0, can't raise limits */
#define	LIM_CPU		1	/* max secs cpu time */
#define	LIM_FSIZE	2	/* max size of file created */
#define	LIM_DATA	3	/* max growth of data space */
#define	LIM_STACK	4	/* max growth of stack */
#define	LIM_CORE	5	/* max size of ``core'' file */
#define	LIM_MAXRSS	6	/* max desired data+stack core usage */

#define	NLIMITS		6

#define	INFINITY	0x7fffffffL

#endif /* ~_h_VLIMIT */
e	*/kê–… á  $        ê  X‰*T–ˆ*X‰*     ¾ê  
                  ./usr/include/sys/vm.h t/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)vm.h	16.3	LCC)	/* Modified: 20:04:03 9/15/89 */
/* SCCSIDPUFF(@(#) vm.h 4.1 LM 12:37:44 4/23/85 C 22:00:43 4/23/85); */

/*
 *	#include "vm.h"
 * or	#include <vm.h>		 in a user program
 * is a quick way to include all the vm header files.
 */

#ifdef KERNEL
#include <vmparam.h>
#include <vmmac.h>
#include <vmmeter.h>
#include <vmsystm.h>
#else
#include <sys/vmparam.h>
#include <sys/vmmac.h>
#include <sys/vmmeter.h>
#include <sys/vmsystm.h>
#endif /* KERNEL */
ack */kêì$ à  $        è  X‰*T–ˆ*X‰*     ïÁè  	                  ./usr/include/sys/vmalloc.h ad.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)vmalloc.h	16.4	LCC)	/* Modified: 20:04:55 9/15/89 */

/* The following mnemonics are used on calls to the routines "[Gg]rowsysd",
 * Allocsysd() and kmemalloc() to specify the type of alignment required for
 * the allocated space.
 */
#define MA_ALIGN	0x000f		/* Alignment type mask. */
#define	MA_DBLWD	0x0000		/* Align on a double word boundary. */
#define	MA_SEG		0x0001		/* Align on a segment boundary.	*/
#define	MA_PAGE		0x0002		/* Align on a page boundary. */
#define	MA_DBLWDNOPAGE	0x0003		/* Align on a double word boundary, and
					 *   assure that kpagealloc() isn't
					 *   used */

/* The following mnemonics are used on calls to kmemalloc() to further
 * specify/describe the memory request.  Some of these can help the memory
 * allocator do smart things to avoid fragmentation, or allow the memory to
 * be freed back to the page pool when mfreed().
 */
#define	MA_DURATION	0x00f0		/* Field mask for estimated duration
					 * of need for this memory.
					 */
#define MA_LONGTERM	0x0000		/* Memory will not be freed for a long
					 * time (more than 10 minutes) and may
					 * not be freed at all.
					 */
#define MA_MIDTERM	0x0010		/* Memory will ultimately be freed, but
					 * it may be a short while (seconds to
					 * minutes).
					 */
#define MA_SHORTTERM	0x0020		/* Memory will be freed again soon (in
					 * a matter of seconds).
					 */

#define MA_OK2SLEEP	0x8000		/* OK 2 sleep on this request */

#if defined(SVPAGING)
/* pseudo-flag: if defined, its ok to call kmemalloc at interrupt time. */
#define MA_INTERRUPTOK
#endif /* SVPAGING */

#ifdef KERNEL
extern char * Growsysd();
extern char * Allocsysd();
extern char * kmemalloc();
extern char * malloc();
extern char * palloc();
#endif /* KERNEL */
kê´„ ß  $        ¶  X‰*W–ˆ*X‰*     Žˆ¶  	              ÊY  ./usr/include/sys/vmmac.h h ad.h/*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)vmmac.h	16.3	LCC)	/* Modified: 20:05:46 9/15/89 */

#ifndef	_h_VMMAC
#define	_h_VMMAC


#if	defined(PAGING) || defined(SWAPPING)

#if	defined(vax)
#define	newptes(pte,v,x)	tbiscl(v)
#endif	/* vax */

/*
 * Virtual memory related conversion macros
 */

/* Core clicks to number of pages of page tables needed to map that much */
#define	ctopt(x)	(((x)+NPTEPG-1)/NPTEPG)

/* Virtual page numbers to text|data|stack segment page numbers and back */
#define vtotp(p, v)     ((int) ((v) - LOWPAGES))
#define tptov(p, i)     ((unsigned)(i + LOWPAGES))

#ifdef	b370
#define vtodp(p, v)     ((int)((v) - stoc(ctos((p)->p_tsize)) - LOWPAGES))
#define dptov(p, i)     ((unsigned)(stoc(ctos((p)->p_tsize)) + LOWPAGES + (i)))
#else	/* ~b370 */
#define vtodp(p, v)     ((int)((v) - (p)->p_tsize - LOWPAGES))
#define dptov(p, i)     ((unsigned)((p)->p_tsize + LOWPAGES + (i)))
#endif	/* b370 */

#ifdef	XA370
#define vtosp(p, v)     ((int)(btop(p->p_flag & SXA31BITS ? XAUSRSTACK : USRSTACK)-1-(v)))
#define	sptov(p, i)	((unsigned)(btop(p->p_flag & SXA31BITS ? XAUSRSTACK : USRSTACK) - 1 - (i)))
#else	/* ~XA370 */
#define vtosp(p, v)     ((int)(btop(USRSTACK)-1-(v)))
#define	sptov(p, i)	((unsigned)(btop(USRSTACK) - 1 - (i)))
#endif	/* ~XA370 */

/* Tell whether virtual page numbers are in text|data|stack segment */
#ifdef	b370
#define isatsv(p, v)    (((v) < ((p)->p_tsize + LOWPAGES)) && ((v) >= LOWPAGES))

#ifdef	XA370
#       define  isassv(p, v)    ((v) < btop(p->p_flag & SXA31BITS ? XAUSRSTACK : USRSTACK) &&  ((v) >= btop(p->p_flag & SXA31BITS ? XAUSRSTACK : USRSTACK)-(p)->p_ssize))
#else	/* ~XA370 */
#       define  isassv(p, v)    ((v) < btop(USRSTACK) && ((v) >= btop(USRSTACK)-(p)->p_ssize))
#endif	/* ~XA370 */

#	define	isadsv(p, v)    ((v) >= (stoc(ctos((p)->p_tsize)) + LOWPAGES) && (v) < (stoc(ctos((p)->p_tsize)) + LOWPAGES + (p)->p_dsize))
#else	/* ~b370 */

#define isatsv(p, v)    ((v) < (p)->p_tsize)

#ifndef	vax
#       define  isassv(p, v)    ((v) >= ((p)->p_tsize + LOWPAGES + (p)->p_dsize))
#else	/* vax */
#	define	isassv(p, v)	((v) & P1TOP)
#endif	/* vax */

#	define	isadsv(p, v)    ((v) >= ((p)->p_tsize + LOWPAGES) && !isassv(p, v))
#endif	/* b370 */

/* Tell whether pte's are text|data|stack */
#define	isaspte(p, pte)		((pte) > sptopte(p, (p)->p_ssize))
#define	isatpte(p, pte)		((pte) < dptopte(p, 0))
#define	isadpte(p, pte)		(!isaspte(p, pte) && !isatpte(p, pte))

#ifdef	PTINU
#	define	PTUPAGES 0
#else	/* -PTINU */
#if	defined(b370)
#       define  PTUPAGES HIGHPAGES
#else
#	define	PTUPAGES UPAGES
#endif	/* defined(b370) */
#endif	/* -PTINU */

/* Text|data|stack pte's to segment page numbers and back */
#ifdef	b370
#define ptetotp(p, pte)         ((pte) - ((p)->p_p0br + LOWPAGES))
#define tptopte(p, i)           ((p)->p_p0br + LOWPAGES + (i))
#define ptetodp(p, pte)         ((pte) - ((p)->p_p0br + LOWPAGES + stoc(ctos((p)->p_tsize))))
#define dptopte(p, i)           ((p)->p_p0br + LOWPAGES + stoc(ctos((p)->p_tsize)) + (i))
#else	/* ~b370 */
#define	ptetotp(p, pte)		((pte) - (p)->p_p0br)
#define	tptopte(p, i)		((p)->p_p0br + (i))
#define	ptetodp(p, pte)		((pte) - ((p)->p_p0br + (p)->p_tsize))
#define	dptopte(p, i)		((p)->p_p0br + (p)->p_tsize + (i))
#endif	/* b370 */
#define	ptetosp(p, pte)	\
	(((p)->p_p0br + (p)->p_szpt*NPTEPG - PTUPAGES - 1) - (pte))

#define	sptopte(p, i) \
	(((p)->p_p0br + (p)->p_szpt*NPTEPG - PTUPAGES - 1) - (i))


#ifdef	b370
/* Text|data|stack 370 pte's to segment page numbers and back */
#define pte370totp(p, pte)	((pte) - ((p)->p_pt370 + LOWPAGES))
#define tptopte370(p, i)	((p)->p_pt370 + LOWPAGES + (i))
#define pte370todp(p, pte)	((pte) - ((p)->p_pt370 + LOWPAGES + stoc(ctos((p)->p_tsize))))
#define dptopte370(p, i)	((p)->p_pt370 + LOWPAGES + stoc(ctos((p)->p_tsize)) + (i))
#define	pte370tosp(p, pte)	\
		(((p)->p_pt370 + NUPTES - PTUPAGES - 1) - (pte))

#define	sptopte370(p, i) \
		(((p)->p_pt370 + NUPTES - PTUPAGES - 1) - (i))

#endif	/* b370 */

/* Bytes to pages without rounding, and back */
#define	btop(x)		(((unsigned)(x)) >> PGSHIFT)
#define	ptob(x)		((caddr_t)((x) << PGSHIFT))

/* Turn virtual addresses into kernel map indices */

#ifndef	NOKMAP

#define	kmxtob(a)	(usrpt + (a) * NPTEPG)
#define	btokmx(b)	(((b) - usrpt) / NPTEPG)

#ifdef	b370
#define	km3xtob(a)	(upt370 + (a) * PT370PG)
#define	btokm3x(b)	((((struct pte370 *)(b)) - upt370) / PT370PG)
#endif	/* b370 */

#endif	/* NOKMAP- */


/* User area address and pcb bases */

#ifdef	PTINU

#define	uaddr(p)	(&((p)->p_uptes[0]))
#else	/* ~PTINU */
#ifdef	XA370
#define uaddr(p)        (&((p)->p_p0br[btoc(UAREA)]))
#else	/* ~XA370 */
#define uaddr(p)        (&((p)->p_p0br[(p)->p_szpt * NPTEPG - UPAGES]))
#endif	/* ~XA370 */
#endif	/* ~PTINU */

#define	pcbb(p)		((p)->p_addr[0].pg_pfnum)

/* Average new into old with aging factor time */
#define	ave(smooth, cnt, time) \
	smooth = ((time - 1) * (smooth) + (cnt)) / (time)

/*
 * Page clustering macros.
 *
 * dirtycl(pte)			is the page cluster dirty?
 * anycl(pte,fld)		does any pte in the cluster has fld set?
 * zapcl(pte,fld) = val		set all fields fld in the cluster to val
 * distcl(pte)			distribute high bits to cluster; note that
 *				distcl copies everything but pg_pfnum,
 *				INCLUDING pg_m!!!
 *
 * In all cases, pte must be the low pte in the cluster, even if
 * the segment grows backwards (e.g. the stack).
 */
#define	H(pte)	((struct hpte *)(pte))

#if CLSIZE==1
#define	dirtycl(pte)	dirty(pte)
#define	anycl(pte,fld)	((pte)->fld)
#define	zapcl(pte,fld)	(pte)->fld
#define	distcl(pte)
#endif /* (CLSIZE == 1) */

#if CLSIZE==2
#define	dirtycl(pte)	(dirty(pte) || dirty((pte)+1))
#define	anycl(pte,fld)	((pte)->fld || (((pte)+1)->fld))
#define	zapcl(pte,fld)	(pte)[1].fld = (pte)[0].fld
#endif /* (CLSIZE == 2) */

#if CLSIZE==4
#define	dirtycl(pte) \
    (dirty(pte) || dirty((pte)+1) || dirty((pte)+2) || dirty((pte)+3))
#define	anycl(pte,fld) \
    ((pte)->fld || (((pte)+1)->fld) || (((pte)+2)->fld) || (((pte)+3)->fld))
#define	zapcl(pte,fld) \
    (pte)[3].fld = (pte)[2].fld = (pte)[1].fld = (pte)[0].fld
#endif /* (CLSIZE == 4) */

#ifndef distcl
#define	distcl(pte)	zapcl(H(pte),pg_high)
#endif /* ~distcl */

#endif  /* (PAGING || SWAPPING) */

#if defined(b370) && defined(SVPAGING)
/* Bytes to pages without rounding, and back */
#define	btop(x)		(((unsigned)(x)) >> PGSHIFT)
#define	ptob(x)		((x) << PGSHIFT)

/* Average new into old with aging factor time */
#define	ave(smooth, cnt, time) \
	smooth = ((time - 1) * (smooth) + (cnt)) / (time)

#endif /* defined(b370) && defined(SYPAGING) */

#endif	/* ~_h_VMMAC */
(bkêd Þ  $        
  Y‰*W–ˆ*Y‰*     [¶
  	                  ./usr/include/sys/vmmeter.h ad.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)vmmeter.h	16.3	LCC)	/* Modified: 20:06:37 9/15/89 */
/* SCCSIDPUFF(@(#) vmmeter.h 4.1 LM 12:38:08 4/23/85 C 22:00:46 4/23/85); */

/*
 * Virtual memory related instrumentation
 */

/* turn this into a signed long if your compiler doesn't support u_longs
 */
typedef	u_long vcount_t;

struct vmmeter
{
#define	v_first	v_swtch
	vcount_t v_swtch;	/* context switches */
	vcount_t v_trap;	/* calls to trap */
	vcount_t v_syscall;	/* calls to syscall() */
	vcount_t v_intr;	/* device interrupts */
	vcount_t v_pdma;	/* pseudo-dma interrupts */
	vcount_t v_pswpin;	/* pages swapped in */
	vcount_t v_pswpout;	/* pages swapped out */
	vcount_t v_pgin;	/* pageins */
	vcount_t v_pgout;	/* pageouts */
	vcount_t v_pgpgin;	/* pages paged in */
	vcount_t v_pgpgout;	/* pages paged out */
	vcount_t v_intrans;	/* intransit blocking page faults */
	vcount_t v_pgrec;	/* total page reclaims */
	vcount_t v_xsfrec;	/* found in free list rather than on swapdev */
	vcount_t v_xifrec;	/* found in free list rather than in filsys */
	vcount_t v_exfod;	/* pages filled on demand from executables */
	vcount_t v_zfod;	/* pages zero filled on demand */
	vcount_t v_vrfod;	/* fills of pages mapped by vread() */
	vcount_t v_nexfod;	/* number of exfod's created */
	vcount_t v_nzfod;	/* number of zfod's created */
	vcount_t v_nvrfod;	/* number of vrfod's created */
	vcount_t v_pgfrec;	/* page reclaims from free list */
	vcount_t v_faults;	/* total faults taken */
	vcount_t v_scan;	/* scans in page out daemon */
	vcount_t v_rev;		/* revolutions of the hand */
	vcount_t v_seqfree;	/* pages taken from sequential programs */
	vcount_t v_dfree;	/* pages freed by daemon */
#define	v_last v_dfree
	vcount_t v_swpin;	/* swapins */
	vcount_t v_swpout;	/* swapouts */
};

#ifdef KERNEL
extern  struct	vmmeter cnt;
extern  struct  vmmeter rate;
extern  struct  vmmeter sum;
#endif /* KERNEL */

/* systemwide totals computed every five seconds */
struct vmtotal
{
	short	t_rq;		/* length of the run queue */
	short	t_dw;		/* jobs in ``disk wait'' (neg priority) */
	short	t_pw;		/* jobs in page wait */
	short	t_sl;		/* jobs sleeping in core */
	short	t_sw;		/* swapped out runnable/short block jobs */
	vcount_t t_vm;		/* total virtual memory */
	vcount_t t_avm;		/* active virtual memory */
	short	t_rm;		/* total real memory in use */
	short	t_arm;		/* active real memory */
	vcount_t t_vmtxt;	/* virtual memory used by text */
	vcount_t t_avmtxt;	/* active virtual memory used by text */
	short	t_rmtxt;	/* real memory used by text */
	short	t_armtxt;	/* active real memory used by text */
	long	t_free;		/* free memory pages */
};

#ifdef KERNEL
extern  struct	vmtotal total;
#endif /* KERNEL */

/*
 * Optional instrumentation.
 */
#ifdef PGINPROF

#define	NDMON	128
#define	NSMON	128

#define	DRES	20
#define	SRES	5

#define	PMONMIN	20
#define	PRES	50
#define	NPMON	64

#define	RMONMIN	130
#define	RRES	5
#define	NRMON	64

/* data and stack size distribution counters */
vcount_t	dmon[NDMON+1];
vcount_t	smon[NSMON+1];

/* page in time distribution counters */
vcount_t	pmon[NPMON+2];

/* reclaim time distribution counters */
vcount_t	rmon[NRMON+2];

int	pmonmin;
int	pres;
int	rmonmin;
int	rres;

vcount_t rectime;		/* accumulator for reclaim times */
vcount_t pgintime;		/* accumulator for page in times */
#endif /* PGINOFF */
  Ýöÿkê‚S å  $        ú  W‰*¦™ˆ*W‰*     àVú  	                  ./usr/include/sys/vmount.h  ad.h
H_SCCSID(@(#)vmount.h	16.5	LCC)	/* Modified: 13:57:06 4/9/92 */
/* @(#)vmount.h	7.2 87/11/06 20:27:23 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef _h_VMOUNT
#define _h_VMOUNT

/*
 * Types of file systems understood by
 * Distributed Services.
 */
#define	MNT_AIX		0		/* AIX				*/
#define	MNT_DS		1		/* Distributed Services version	*/
					/*   of AIX (aka RAIX, for 	*/
					/*   "Remote AIX")		*/

/*
 * Flags to describe the attributes of
 * a mounted file system in the m_flag
 * field of an minfo structure.
 *
 * MNT_READONLY, MNT_NOSUID and MNT_REMOVABLE may be
 * used as flags for mount(2) and vmount(2)
 * calls.
 */
#define	MNT_READONLY	0x0001
#define	MNT_REMOVABLE	0x0002
#define	MNT_DEVICE	0x0004
#define	MNT_NOSUID	0x0008
#define MNT_SYNCW	0x0010
#define	MNT_REMOTE	0x0100

/*
 * Codes to flag whether caller entered common mount code
 * from umount(2) or uvmount(2).
 */
#define	UMOUNT	0
#define	UVMOUNT	1

#endif /* _h_VMOUNT */
count_kê@ê Ý  $        b#  Y‰*W–ˆ*Y‰*     ‚ˆb#  	              Ýf  ./usr/include/sys/vmparam.h ad.h/*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)vmparam.h	16.3	LCC)	/* Modified: 20:07:31 9/15/89 */


#ifndef	_h_VMPARAM
#define	_h_VMPARAM

#if	defined(i386)
/* largest allowable sizes of user virtual segments - values in clicks   */
#define	MAXDSIZ		(0x7FFFF)	/* max data size: ctob(MAXDSIZ) > 0 */
#define	MAXSSIZ		(0x00400)	/* max stack size: one vseg      */

/* Base of user stack */
#define	USRSTACK	u.u_stkbase
#endif	/* defined(i386) */

#if	defined(b370) && defined(SVPAGING)
/* largest allowable sizes of user virtual segments - values in clicks	*/
#ifdef	S370
#define	MAXDSIZ		(NUSEGS*NPPS)	/* max data size: ctob(MAXDSIZ) > 0 */
#define	MAXSSIZ		(NUSEGS*NPPS)	/* max stack size		*/
#endif	/* S370 */
#ifdef	XA370
#define	MAXDSIZ		(XANUSEGS*NPPS)
#define	MAXSSIZ		(XANUSEGS*NPPS)
#endif	/* XA370 */
#endif	/* b370 && SVPAGING */

#if     defined(vax) || defined(b370)
#ifndef	SVPAGING

/*
 * Machine dependent constants
 */


					/* number of ptes per page */
#ifdef	PTINU
#define	NPTEPG		(NUPT)
#else	/* PTINU- */
#define	NPTEPG		(NBPG/(sizeof (struct pte)))
#ifdef	b370
#define	PT370PG		(NBPG/(sizeof (struct pte370)))
#endif	/* b370 */
#endif	/* ~PTINU */

#ifdef	vax
#define	LOWPAGES	(0)
#define	HIGHPAGES	(UPAGES)
#ifndef	lint
#define	KVBASE		(0x80000000)	/* base address of kernel virt space */
#define	USRSTACK	(0x80000000-HIGHPAGES*NBPG) /* Start of user stack */
#define	P1TOP		0x200000	/* size of the P1 region in segments */
#else	/* lint */
#define	KVBASE		(0x8000)
#define	USRSTACK	(0x8000)	/* lint thinks 0x80... is a long */
#define	P1TOP		0x2000		/*   ditto   */
#endif	/* lint */
#define	uareabase(u)	((caddr_t) (u))
#define KERNGROWSIZE	(1024*1024)	/* Space for dynamic kernel growth */
#endif	/* vax */

#ifdef	b370
/* passed to LOCORE by genassyms */
#define	REAL0		(0x60000)	/* Where we are being loaded */
#ifdef	S370
/* passed to LOCORE by genassyms */
#define	KVBASE		(0x800000)	/* Keep it is sync with LOCORE */

#define	HIGHPAGES	(UPAGES)

#define VMSIZE	0x01000000	/* Virtual Memory Size (16M) */

#define	PSTL		(0x0f000000)	/* ST "length" for CR1 */
#define	NUSEGS		(KVBASE / NBPS)
#define	NUPTES		(NUSEGS * NPPS)
#define	NKSEGS		((VMSIZE - KVBASE) / NBPS)
#define	VUPTSEGS	4		/* Segments for VAX pte's */
#define	PT370PPP	2		/* 370 pte pages per process */
#define PT370SEGS	(PT370PPP*VUPTSEGS)
#define	STLEN		((NKSEGS+NUSEGS)*NBPW) /* ST length in bytes */
#define	EOU		KVBASE		/* U is below the Kernel */
#endif	/* S370 */

#ifdef	XA370
/* passed to LOCORE by genassyms */
#define	KVBASE		(0x30000000)	/* Virtual start of the kernel */
#define	VMSIZE		0x40000000	/* 30 bits of addressing */

#define	HIGHPAGES	(UPAGES)

#define	STLEN		(NBPG)		/* ST length in bytes */
#define	PSTL		(0x0000003f)	/* ST "length" for CR1 */
#define	NKSEGS		64		/* Mapped kernel segments */
#define	NUSEGS		8		/* 8 Meg for 24 bit mode */
#define	NUPTES		(NUSEGS * NPPS)
#define	XANUSEGS	768		/* 3/4Gigabyte for 31 bit mode */
#define	XANUPTES	(XANUSEGS * NPPS)
#define	PT370PPP	((STLEN/NBPG)+(NUPTES/PT370PG))	/* Five pages for 24 bit mode */
#define	XA370PPP	((STLEN/NBPG)+(XANUPTES/PT370PG)) /* pages for 31 bit mode */
#define	PT370SEGS	8		/* Segments for 370 pte's */
#define	VUPTSEGS	8		/* Segments for VAX pte's */
#define	EOU		UTXTORG
#define	XAUSRSTACK	((XANUSEGS*NBPS)-(HIGHPAGES*NBPG))
#endif	/* XA370 */

#define	LOWPAGES	(1 * NPPS3)		/* 1 370 Segment reserved */
#define	MINPT370	2			/* Allocate 2 pages for ST & PT */

#define UAREA           (EOU-UPAGES*NBPG)
#define U               (EOU-sizeof(struct user))
#define KERNSTACK       (U)
#define USRSTACK	((NUSEGS*NBPS)-(HIGHPAGES*NBPG)) /* 24 bit mode */
#ifdef XA370
#define KERNGROWSIZE	(4096*1024)	/* Space for dynamic kernel growth */
#define P1TOP		(XANUSEGS * NPPS)
#else /* ~XA370 */
#define KERNGROWSIZE	(2048*1024)	/* Space for dynamic kernel growth */
#define P1TOP		(NUSEGS * NPPS)
#endif /* ~XA370 */

#define uareabase(u)    ((caddr_t)(u)+sizeof(struct user)-UPAGES*NBPG)
#endif	/* b370 */

/*
 * Virtual memory related constants
 */

#ifdef	vax
#define	MAXSWAP	120		/* max clicks swapped at a time */
#define	SLOP	32
#define	MAXTSIZ		(6*2048-SLOP)		/* max text size (clicks) */
/*
 * make sure these next two match dmap.h
 * ((NDMAP + 1 -(log2(DMMAX)-log2(DMMIN))) * DMMAX) - DMMIN - SLOP)
 */
#define	MAXDSIZ		(20*1024-32-SLOP)	/* max data size (clicks) */
#define	MAXSSIZ		(20*1024-32-SLOP)	/* max stack size (clicks) */
/*
 * Sizes of the system and user portions of the system page table.
 */
/* SYSPTSIZE IS SILLY; IT SHOULD BE COMPUTED AT BOOT TIME */
#define	SYSPTSIZE	(40*NPTEPG)
#define	USRPTSIZE 	(8*NPTEPG)
#endif	/* vax */


#ifdef	b370
#define SLOP    32
#define MAXSWAP		15		/* max clicks swapped at a time. */
#define LOGDIFF		(DMMAXLOG2-DMMINLOG2)	/* for calculation below */
#define MAXTSIZ         ((NDMAP+1-LOGDIFF)*DMTEXT-SLOP) /* max text size (clicks) */
#define MAXDSIZ         ((NDMAP+1-LOGDIFF)*DMMAX-DMMIN-SLOP) /* max data size (clicks) */
#define MAXSSIZ         ((NDMAP+1-LOGDIFF)*DMMAX-DMMIN-SLOP) /* max stack size (clicks) */

/*
 * Sizes of the user portions of the system page table.
 */
#define	USRPTSIZE	(VUPTSEGS*NPPS)
#define	PT370SIZE	(PT370SEGS*NPPS)

#endif	/* b370 */
#endif	/* ~SVPAGING */

#ifdef	BSD_SCHED
/*
 * The size of the clock loop.
 */
#define	LOOPPAGES	(maxfree - firstfree)

/*
 * The time for a process to be blocked before being very swappable.
 * This is a number of seconds which the system takes as being a non-trivial
 * amount of real time.  You probably shouldn't change this;
 * it is used in subtle ways (fractions and multiples of it are, that is, like
 * half of a ``long time'', almost a long time, etc.)
 * It is related to human patience and other factors which don't really
 * change over time.
 */
#define	MAXSLP 		20

/*
 * A swapped in process is given a small amount of core without being bothered
 * by the page replacement algorithm.  Basically this says that if you are
 * swapped in you deserve some resources.  We protect the last SAFERSS
 * pages against paging and will just swap you out rather than paging you.
 * Note that each process has at least UPAGES+CLSIZE pages which are not
 * paged anyways (this is currently 8+2=10 pages or 5k bytes), so this
 * number just means a swapped in process is given around 25k bytes.
 * Just for fun: current memory prices are 4600$ a megabyte on VAX (4/22/81),
 * so we loan each swapped in process memory worth 100$, or just admit
 * that we don't consider it worthwhile and swap it out to disk which costs
 * $30/mb or about $0.75.
 */
#define	SAFERSS		32		/* nominal ``small'' resident set size
					   protected against replacement */

/*
 * DISKRPM is used to estimate the number of paging i/o operations
 * which one can expect from a single disk controller.
 */
#define	DISKRPM		60

/*
 * Klustering constants.  Klustering is the gathering
 * of pages together for pagein/pageout, while clustering
 * is the treatment of hardware page size as though it were
 * larger than it really is.
 *
 * KLMAX gives maximum cluster size in CLSIZE page (cluster-page)
 * units.  Note that KLMAX*CLSIZE must be <= DMMIN in dmap.h.
 */

#ifdef	vax
#define	KLMAX	(32/CLSIZE)
#define	KLSEQL	(16/CLSIZE)		/* in klust if vadvise(VA_SEQL) */
#define	KLIN	(8/CLSIZE)		/* default data/stack in klust */
#define	KLTXT	(4/CLSIZE)		/* default text in klust */
#define	KLOUT	(32/CLSIZE)
#endif	/* vax */

#if	defined(b370)
#define KLMAX   (CLSIZE)
#define KLSEQL  (CLSIZE)                /* in klust if vadvise(VA_SEQL) */
#define KLIN    (CLSIZE)                /* default data/stack in klust */
#define KLTXT   (CLSIZE)                /* default text in klust */
#define KLOUT   (CLSIZE)
#endif	/* b370 */

/*
 * KLSDIST is the advance or retard of the fifo reclaim for sequential
 * processes data space.
 */
#define	KLSDIST	3		/* klusters advance/retard for seq. fifo */

#if	defined(b370)
/*
 * Paging thresholds (see vm_sched.c).
 * Strategy of 4/22/81:
 *     lotsfree is 1/4 of memory free.
 *     desfree is 200k bytes, but at most 1/8 of memory
 *     minfree is 64k bytes, but at most 1/2 of desfree
 */
#define LOTSFREEFRACT   4
#define DESFREE         (200 * 1024)
#define DESFREEFRACT    8
#define MINFREE         (64 * 1024)
#define MINFREEFRACT    2

/*
 * Believed threshold (in megabytes) for which interleaved
 * swapping area is desirable.
 */
#define LOTSOFMEM       2

#endif	/* b370 */

#ifdef	KERNEL
extern	int     klseql;
extern	int     klsdist;
extern	int     klin;
extern	int     kltxt;
extern	int     klout;
#endif	/* KERNEL */
#endif	/* BSD_SCHED */

#endif  /* vax || b370 */

#ifdef	KERNEL
#ifdef	NO_PAGER
#define	wake_pager()	jab_sched()
#else	/* NO_PAGER- */
#define	wake_pager()	wakeup((caddr_t)&proc[PAGEPROC])
#endif	/* NO_PAGER- */
#endif	/* KERNEL */

#endif /* _h_VMPARAM */

#defikêÎü Ü  $        ž  Y‰*W–ˆ*Y‰*     zž  	                  ./usr/include/sys/vmsystm.h ad.h/*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)vmsystm.h	16.3	LCC)	/* Modified: 20:08:23 9/15/89 */

#if	defined(M68000) || defined(vax) || (defined(b370) && !defined(SVPAGING))

/*
 * Miscellaneous virtual memory subsystem variables and structures.
 */
#ifdef KERNEL
extern	long	freemem;		/* remaining blocks of free memory */
#ifdef	SWAPPING
extern	long	needmem;
extern	long	swapmem;		/* blocks reserved for process 0 */
#endif  /* SWAPPING */

#ifdef  PAGING
#define	swapmem		(0)
#endif  /* PAGING */

extern	long	avefree;	/* moving average of remaining free blocks */
extern	long	avefree30;	/* 30 sec (avefree is 5 sec) moving average */
extern	long	deficit;	/* estimate of needs of new swapped in procs */
extern	long	nscan;		/* number of scans in last second */
extern	long	desscan;	/* desired pages scanned per second */

/* writable copies of tunables */
extern	long	maxpgio;	/* max paging i/o per sec before start swaps */
extern	long	maxslp;		/* max sleep time before very swappable */
extern	long	lotsfree;	/* max free before clock freezes */
extern	long	minfree;	/* minimum free pages before swapping begins */
extern	long	desfree;	/* no of pages to try to keep free via daemon */
extern	long	saferss;	/* no pages not to steal; decays with slptime */
#endif /* KERNEL */

#endif  /* (vax || M68000 || b370) */

extern  long	multprog;		/* current multiprogramming degree */

/*
 * Fork/vfork accounting.
 */
struct	forkstat
{
	long	cntfork;
	long	cntvfork;
	long	sizfork;
	long	sizvfork;
};
#ifdef KERNEL
extern  struct	forkstat forkstat;
#endif /* KERNEL */

#if	defined(vax) || defined(M68000) || defined(b370)
/*
 * Swap kind accounting.
 */
struct	swptstat
{
	long	pteasy;		/* easy pt swaps */
	long	ptexpand;	/* pt expansion swaps */
	long	ptshrink;	/* pt shrinking swaps */
	long	ptpack;		/* pt swaps involving spte copying */
};
#ifdef KERNEL
extern  struct	swptstat swptstat;
#endif /* KERNEL */

#endif  /* (vax || M68000 || (b370 && ! SVPAGING)) */
u kêè/ Û  $        D  Y‰*§™ˆ*Y‰*     ‡D  	                  ./usr/include/sys/vtimes.h  ad.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986, 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)vtimes.h	16.3	LCC)	/* Modified: 19:43:09 9/16/89 */
/* SCCSIDPUFF(@(#) vtimes.h 4.1 LM 12:59:26 4/23/85 C 22:13:55 4/23/85); */

#ifndef _h_VTIMES
#define _h_VTIMES

#ifndef _h_TYPES
#ifdef  KERNEL
#include <types.h>
#else  /* ~KERNEL */
#include <sys/types.h>
#endif /* ~KERNEL */
#endif /* ~_h_TYPES */
/*
 * Structure returned by vtimes() and in vwait().
 * In vtimes() two of these are returned, one for the process itself
 * and one for all its children.  In vwait() these are combined
 * by adding componentwise (except for maxrss, which is max'ed).
 */
struct vtimes {
	long	vm_utime;		/* user time (60'ths) */
	long	vm_stime;		/* system time (60'ths) */
	/* divide next two by utime+stime to get averages */
	u_long vm_idsrss;		/* integral of d+s rss */
	u_long vm_ixrss;		/* integral of text rss */
	long	vm_maxrss;		/* maximum rss */
	long	vm_majflt;		/* major page faults */
	long	vm_minflt;		/* minor page faults */
	long	vm_nswap;		/* number of swaps */
	long	vm_inblk;		/* block reads */
	long	vm_oublk;		/* block writes */
};

#endif /* ~_h_VTIMES */
 begkê”Q Ú  $        Î  Y‰*§™ˆ*Y‰*     tÎ  	              J‰  ./usr/include/sys/wait.h h  ad.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1985, 1986, 1989 IBM Corp.
 *	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef _POSIX_SOURCE
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)wait.h	16.6.1.1       LCC)    /* Modified: 23:06:30 7/22/90 */
#endif /* NOT _POSIX_SOURCE */

#ifndef _H_WAIT
#define _H_WAIT

#include <sys/types.h>

#ifndef _POSIX_SOURCE
#include <DOPTIONS.h>

/*
 * This file holds definitions relevent to the wait system call.
 * Some of the options here are available only through the ``wait3''
 * entry point; the old entry point with one argument has more fixed
 * semantics, never returning status of unstopped children, hanging until
 * a process terminates if any are outstanding, and never returns
 * detailed information about process resource utilization (<vtimes.h>).
 *
 * Structure of the information in the first word returned by both
 * wait and wait3.  If w_stopval==WSTOPPED, then the second structure
 * describes the information returned, else the first.  See WUNTRACED below.
 */

union wait	{
	int	w_status;		/* used in syscall */
	/*
	 * Terminated process status.
	 */
	struct {
#ifdef	BITSHI
		unsigned int	w_Pad1:16;	/* pad to long */
		unsigned int	w_Retcode:8;	/* exit code if w_termsig==0 */
		unsigned int	w_Coredump:1;	/* core dump indicator */
		unsigned int	w_Termsig:7;	/* termination signal */
#else	/* BITSHI- */
		unsigned short	w_Termsig:7;	/* termination signal */
		unsigned short	w_Coredump:1;	/* core dump indicator */
		unsigned short	w_Retcode:8;	/* exit code if w_termsig==0 */
		unsigned int	w_Pad1:16;	/* pad to long */
#endif	/* BITSHI- */
	} w_T;
	/*
	 * Stopped process status.  Returned
	 * only for traced children unless requested
	 * with the WUNTRACED option bit.
	 */
	struct {
#ifdef	BITSHI
		unsigned int	w_Pad2:16;	/* pad to long */
		unsigned short	w_Stopsig:8;	/* signal that stopped us */
		unsigned short	w_Stopval:8;	/* == W_STOPPED if stopped */
#else	/* BITSHI- */
		unsigned short	w_Stopval:8;	/* == W_STOPPED if stopped */
		unsigned short	w_Stopsig:8;	/* signal that stopped us */
		unsigned int	w_Pad2:16;	/* pad to long */
#endif	/* BITSHI- */
	} w_S;
};
#define	w_termsig	w_T.w_Termsig
#define w_coredump	w_T.w_Coredump
#define w_retcode	w_T.w_Retcode
#define w_stopval	w_S.w_Stopval
#define w_stopsig	w_S.w_Stopsig

#define	WSTOPPED	0177	/* value of s.stopval if process is stopped */

#endif /* NOT _POSIX_SOURCE */

/*
 * Option bits for the second argument of wait3.  WNOHANG causes the
 * wait to not hang if there are no stopped or terminated processes, rather
 * returning an error indication in this case (pid==0).  WUNTRACED
 * indicates that the caller should receive status about untraced children
 * which stop due to signals.  If children are stopped and a wait without
 * this option is done, it is as though they were still running... nothing
 * about them is returned.
 */
#define WNOHANG		1	/* dont hang in wait */
#define WUNTRACED	2	/* tell about stopped, untraced children */


#ifdef _POSIX_SOURCE

/* The following macros are defined without the use of 'struct wait' because
 * that structure isn't to be visible to POSIX.  These macros return the same
 * values as their counterparts below.  In particular,
 *   WIFSTOPPED  returns TRUE if the low byte has the value 0177.
 *   WIFSIGNALED returns TRUE if the low byte is not 0177 and
 *		the next byte is non zero.
 *   WIFEXITED returns TRUE if the low byte is not 01777 and
 *              the next byte is zero.
 *   WTERMSIG returns the low 7 bits.
 *   WSTOPSIG returns the value of the low byte.
 *   WEXITSTATUS returns the value of the next byte.
 */
#define	_WSTOPPED	0177	/* value of s.stopval if process is stopped */

#define WIFSTOPPED(x)	((((int)(x))&0377) == _WSTOPPED)
#define WIFSIGNALED(x)	(!WIFSTOPPED(x) && (((int)(x))&0177) != 0)
#define WIFEXITED(x)	(!WIFSTOPPED(x) && (((int)(x))&0177) == 0)
#define WEXITSTATUS(x)	(((int)(x)>>8)&0377)
#define WTERMSIG(x)	(((int)(x))&0177)
#define WSTOPSIG(x)	(((int)(x)>>8)&0377)

#else	/* NOT _POSIX_SOURCE */

#define WIFSTOPPED(x)	((*(union wait *) &(x)).w_stopval == WSTOPPED)
#define WIFSIGNALED(x)	((*(union wait *) &(x)).w_stopval != WSTOPPED && (*(union wait *) &(x)).w_termsig != 0)
#define WIFEXITED(x)	((*(union wait *) &(x)).w_stopval != WSTOPPED && (*(union wait *) &(x)).w_termsig == 0)
#define WEXITSTATUS(x)	((*(union wait *) &(x)).w_T.w_Retcode)
#define WTERMSIG(x)	((*(union wait *) &(x)).w_T.w_Termsig)
#define WSTOPSIG(x)	((*(union wait *) &(x)).w_S.w_Stopsig)

#endif	/* NOT _POSIX_SOURCE */

#ifndef _KERNEL
extern pid_t  wait();                    
extern pid_t  waitpid();                    
#endif	/* NOT _KERNEL */
#endif	/* NOT _H_WAIT */
tikê°„ $  $           1‰*¨™ˆ*1‰*     ][   	              ü‰  ./usr/include/sys/x.out.h   ad.h/*
 *		IX/370
 *		5667-126
 *	LICENSED MATERIALS - PROPERTY OF IBM
*	(c) Copyright 1985, 1986, 1989 IBM Corp.
*	(c) Copyright 1983, 1984, 1985, 1986,  1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)x.out.h	16.3	LCC)	/* Modified: 19:03:35 9/22/89 */
/* SCCSIDPUFF(@(#) x.out.h 4.3 LM 00:31:02 6/21/85 C 00:31:07 6/21/85); */

#ifndef _h_X_OUT
#define _h_X_OUT

#ifdef	XENIX
/*
 *	<a.out.h> - Declarations for object file headers
 *		and nlist, xlist symbol table structures.
 *
 */

struct  xexec {			/* x.out header */
	unsigned short	x_magic;	/* magic number */
	unsigned short	x_ext;		/* size of header extension */
	long		x_text;		/* size of text segment */
	long		x_data;		/* size of initialized data */
	long		x_bss;		/* size of uninitialized data */
	long		x_syms;		/* size of symbol table */
	long		x_reloc;	/* relocation table length */
	long		x_entry;	/* entry point */
	char		x_cpu;		/* cpu type & byte/word order */
	char		x_relsym;	/* relocation & symbol format */
	unsigned short	x_renv;		/* run-time environment */
};


struct	xext {		/* x.out header extension */
	long	xe_trsize;	/* size of text relocation */
	long	xe_drsize;	/* size of data relocation */
	long	xe_tbase;	/* text relocation base */
	long	xe_dbase;	/* data relocation base */
	long	xe_stksize;	/* stack size (if XE_FS set) */
};


/*
 *      Definitions for xexec.x_magic, HEX (short).
 */

#define ARCMAGIC	0xff65	/* 0177545, archive, same as always */
#define X_MAGIC		0x0206	/* indicates x.out header */


/*
 *      Definitions for xexec.x_cpu, cpu type (char).
 *
 *	b       	set if high byte first in short
 *	 w              set if low word first in long
 *	  cccccc	cpu type
 */

	/* bytes/words are "swapped" if not stored in pdp11 ordering */
#define XC_BSWAP	0x80	/* bytes swapped */
#define XC_WSWAP	0x40	/* words swapped */

/*	See below for CPU types		*/

/*
 *	Definitions for xexec.x_relsym (char).
 *
 *	rrrr            relocation table format
 *	    ssss        symbol table format
 */

	/* relocation table format */
#define XR_RXOUT	0x00	/* x.out long form, linkable */
#define XR_RXEXEC	0x10	/* x.out short form, executable */
#define XR_RBOUT	0x20	/* b.out format */
#define XR_RAOUT	0x30	/* a.out format */
#define XR_R86REL	0x40	/* 8086 relocatable format */
#define XR_R86ABS	0x50	/* 8086 absolute format */
#define XR_R286ABS	0x60	/* 80286 absolute format */
#define XR_REL		0xf0	/* relocation format mask */

	/* symbol table format */
#define XR_SXOUT	0x00	/* trailing string, struct sym */
#define XR_SBOUT	0x01	/* trailing string, struct bsym */
#define XR_SAOUT	0x02	/* struct asym (nlist) */
#define XR_S86REL	0x03	/* 8086 relocatable format */
#define XR_S86ABS	0x04	/* 8086 absolute format */
#define XR_SUCBVAX	0x05	/* separate string table */
#define XR_SYM		0x0f	/* symbol format mask */


/*
 *      Definitions for xexec.x_renv (short).
 *
 *	vv                  version compiled for
 *	  xxxxxx            extra (zero)
 *
 *	        r           reserved
 *	         t          set if large model text
 *	          d         set if large model data
 *	           o        set if text overlay
 *                  f       set if fixed stack
 *	             p      set if text pure
 *	              s     set if separate I & D
 *		       e    set if executable
 */

#define XE_V2		0x4000		/* up to and including 2.3 */
#define XE_V3		0x8000		/* after version 2.3 */
#define XE_VERS		0xc000		/* version mask */

#define XE_RES		0x0080		/* reserved */
#define XE_LTEXT	0x0040		/* large model text */
#define XE_LDATA	0x0020		/* large model data */
#define XE_OVER		0x0010		/* text overlay */
#define XE_FS		0x0008		/* fixed stack */
#define XE_PURE		0x0004		/* pure text */
#define XE_SEP		0x0002		/* separate I & D */
#define XE_EXEC		0x0001		/* executable */


#define XEXTPOS(xp)	((long) sizeof(struct xexec))
#define XTEXTPOS(xp)	(XEXTPOS(xp) + (long) (xp)->x_ext)
#define XDATAPOS(xp)	(XTEXTPOS(xp) + (xp)->x_text)
#define XSYMPOS(xp)	(XDATAPOS(xp) + (xp)->x_data)
#define XRELPOS(xp)	(XSYMPOS(xp) + (xp)->x_syms)
#define XENDPOS(xp)	(XRELPOS(xp) + (xp)->x_reloc)

#define XRTEXTPOS(xp, ep)	(XRELPOS(xp))
#define XRDATAPOS(xp, ep)	(XRELPOS(xp) + (ep)->xe_trsize)




struct  aexec {			/* a.out header */
	unsigned short	xa_magic;       /* magic number */
	unsigned short	xa_text;        /* size of text segment */
	unsigned short	xa_data;        /* size of initialized data */
	unsigned short	xa_bss;         /* size of unitialized data */
	unsigned short	xa_syms;        /* size of symbol table */
	unsigned short	xa_entry;       /* entry point */
	unsigned short	xa_unused;      /* not used */
	unsigned short	xa_flag;        /* relocation info stripped */
};


/*
 *	Definitions for aexec.xa_magic, OCTAL, obsolete (short).
 */

#define FMAGIC		0407	/* normal */
#define NMAGIC		0410	/* pure, shared text */
#define IMAGIC		0411	/* separate I & D */
#define OMAGIC		0405	/* text overlays */
#define ZMAGIC		0413	/* demand load format */

#undef	A_MAGIC1
#undef	A_MAGIC2
#undef	A_MAGIC3
#define	A_MAGIC1	FMAGIC
#define	A_MAGIC2	NMAGIC
#define	A_MAGIC3	IMAGIC
#define	A_MAGIC4	OMAGIC


#define ATEXTPOS(ap)	((long) sizeof(struct aexec))
#define ADATAPOS(ap)	(ATEXTPOS(ap) + (long) (ap)->xa_text)
#define ARTEXTPOS(ap)	(ADATAPOS(ap) + (long) (ap)->xa_data)
#define ARDATAPOS(ap)	(ARTEXTPOS(ap) + ((long) \
			    ((ap)->xa_flag? 0 : (ap)->xa_text)))
#define ASYMPOS(ap)	(ATEXTPOS(ap) + \
			    (((ap)->xa_flag? 1L : 2L) * \
			((long) (ap)->xa_text + (long) (ap)->xa_data)))
#define AENDPOS(ap)	(ASYMPOS(ap) + (long) (ap)->xa_syms)




struct  bexec {		/* b.out header */
	long	xb_magic;	/* magic number */
	long	xb_text;	/* text segment size */
	long	xb_data;	/* data segment size */
	long	xb_bss;		/* bss size */
	long	xb_syms;	/* symbol table size */
	long	xb_trsize;	/* text relocation table size */
	long	xb_drsize;	/* data relocation table size */
	long	xb_entry;	/* entry point */
};


#define BTEXTPOS(bp)	((long) sizeof(struct bexec))
#define BDATAPOS(bp) 	(BTEXTPOS(bp) + (bp)->xb_text)
#define BSYMPOS(bp)	(BDATAPOS(bp) + (bp)->xb_data)
#define BRTEXTPOS(bp)	(BSYMPOS(bp) + (bp)->xb_syms)
#define BRDATAPOS(bp)	(BRTEXTPOS(bp) + (bp)->xb_trsize)
#define BENDPOS(bp)	(BRDATAPOS(bp) + (bp)->xb_drsize)




/*
 *	nlist symbol table structure, obsolete.
 *
 *	Used to provide compatibility with nlist(3).
 */

struct	nlist {
	char		n_name[8];	/* symbol name */
	int		n_type;		/* type flag */
	unsigned	n_value;	/* value */
};


/*
 *	xlist symbol table structure as used by xlist(3).
 */

struct xlist {
	unsigned short	xl_type;	/* symbol type */
	unsigned short	xl_pad;		/* for miscellaneous use */
	long		xl_value;	/* symbol value */
	char		*xl_name;	/* pointer to asciz name */
};

#endif	/* XENIX */

/*	CPU types	*/
#define XC_NONE		0x00	/* none */
#define XC_PDP11	0x01	/* pdp11 */
#define XC_23		0x02	/* 23fixed from pdp11 */
#define XC_Z8K		0x03	/* Z8000 */
#define XC_8086		0x04	/* I8086 */
#define XC_68K		0x05	/* M68000 */
#define XC_Z80		0x06	/* Z80 */
#define XC_VAX		0x07	/* VAX 780/750 */
#define XC_16032	0x08	/* NS16032 */
#define XC_286		0x09	/* iAPX 80286 */
#define XC_386		0x0a	/* IAPX 80386 */
#define XC_S370		0x0b	/* System/370 */
#define XC_CPU		0x3f	/* cpu mask */

#endif /* ~_h_X_OUT */
kê€‡ ¤  ÿ¡             y‰*y‰*y‰*          	                  ./usr/include/sys/xdr.h ../rpc/xdr.h /sykêº¶   $        4  ‰*Œ ˆ*‰*     Ùb4  	                  ./usr/include/sysconst.h    ad.h#ifndef H_SCCSID
#include <sccs.h>
#endif /* ~H_SCCSID */
H_SCCSID(@(#)sysconst.h	1.8	AIX)	/* Modified 9/17/89 01:42:25 */
/* H_SCCSID(@(#)sysconst.h	1.3	LCC)	/* Modified: 9/15/86 09:56:32 */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
/*
   sethpath(2) buffer sizes
	from `ipath.h 1.2' original
*/

#define	IPATHSZ		15		/* max length of ipath entry	*/
#define	IPATHLEN	8		/* max number of ipath entries	*/
#define	IBUFLEN		(IPATHLEN*IPATHSZ)	/* size of ipath buffer */


/*
   Paging system constants
	from `pagsiz.h 1.3' original
*/

#ifndef	BSIZE
#ifdef  u370
#define	BSIZE	4096
#define	BMASK	4095
#define	BSHIFT	12
#else  ~u370
#define	BSIZE	1024
#define	BMASK	1023
#define	BSHIFT	10
#endif ~u370
#endif ~BSIZE

#if vax
#define	NBPG	512
#define	CLSIZE	2
#endif

#ifdef	SRITEK
#define	NBPG	4096
#define	CLSIZE	1
#endif	SRITEK

#if	defined(NBPG) && defined(CLSIZE)
#define	PAGSIZ	(NBPG*CLSIZE)
#define	PAGRND	((PAGSIZ)-1)
#define	PGOFSET	(NBPG-1)	/* byte offset into page */
#define	CLOFSET	(CLSIZE*NBPG-1)
#endif	defined(NBPG) && defined(CLSIZE)


/*
   Local file system buffer size
	from `setlocal.h -- not checked in'
*/

#define	LOCALSZ		30		/* max length of /local entry */


/*
   Valign alignment constant
	from `valign.h 1.2' original
*/

#define	VALSIZ	1024
_flakêni E  $        ž   *‰*Œ ˆ**‰*       ž   	                  ./usr/include/sysdefs.h /* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */
#define LOCUS		1
#define PRIMSITE	1
#define SYS5		1
	/kêB* D  $        Š  +‰*Á ˆ*+‰*     QŠ  	              ¥  ./usr/include/sysexits.h    ad.h/* /* @(#)sysexits.h	7.1 87/06/22 16:31:40 */
/*
**  SYSEXITS.H -- Exit status codes for system programs.
**
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif
H_SCCSID(@(#)sysexits.h	1.17	AIX)	/* Modified 9/20/89 19:08:47 */

#ifdef _BSD
/*
 * 5799-CGZ (C) COPYRIGHT = NONE
 * LICENSED MATERIALS - PROPERTY OF IBM
 */
/* $Header:sysexits.h 9.0$ */
/* $ACIS:sysexits.h 9.0$ */
/* $Source: /ibm/acis/usr/src/include/RCS/sysexits.h,v $ */

#if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS)
static char *rcsidsysexits = "$Header:sysexits.h 9.0$";
#endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */
#endif /* _BSD */

/*
**	This include file attempts to categorize possible error
**	exit statuses for system programs, notably delivermail
**	and the Berkeley network.
**
**	Error numbers begin at EX__BASE to reduce the possibility of
**	clashing with other exit statuses that random programs may
**	already return.  The meaning of the codes is approximately
**	as follows:
**
**	EX_USAGE -- The command was used incorrectly, e.g., with
**		the wrong number of arguments, a bad flag, a bad
**		syntax in a parameter, or whatever.
**	EX_DATAERR -- The input data was incorrect in some way.
**		This should only be used for user's data & not
**		system files.
**	EX_NOINPUT -- An input file (not a system file) did not
**		exist or was not readable.  This could also include
**		errors like "No message" to a mailer (if it cared
**		to catch it).
**	EX_NOUSER -- The user specified did not exist.  This might
**		be used for mail addresses or remote logins.
**	EX_NOHOST -- The host specified did not exist.  This is used
**		in mail addresses or network requests.
**	EX_UNAVAILABLE -- A service is unavailable.  This can occur
**		if a support program or file does not exist.  This
**		can also be used as a catchall message when something
**		you wanted to do doesn't work, but you don't know
**		why.
**	EX_SOFTWARE -- An internal software error has been detected.
**		This should be limited to non-operating system related
**		errors as possible.
**	EX_OSERR -- An operating system error has been detected.
**		This is intended to be used for such things as "cannot
**		fork", "cannot create pipe", or the like.  It includes
**		things like getuid returning a user that does not
**		exist in the passwd file.
**	EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp,
**		etc.) does not exist, cannot be opened, or has some
**		sort of error (e.g., syntax error).
**	EX_CANTCREAT -- A (user specified) output file cannot be
**		created.
**	EX_IOERR -- An error occurred while doing I/O on some file.
**	EX_TEMPFAIL -- temporary failure, indicating something that
**		is not really an error.  In sendmail, this means
**		that a mailer (e.g.) could not create a connection,
**		and the request should be reattempted later.
**	EX_PROTOCOL -- the remote system returned something that
**		was "not possible" during a protocol exchange.
**	EX_NOPERM -- You did not have sufficient permission to
**		perform the operation.  This is not intended for
**		file system problems, which should use NOINPUT or
**		CANTCREAT, but rather for higher level permissions.
**		For example, kre uses this to restrict who students
**		can send mail to.
**	EX_DB -- A database, like the alias database, was not accessible
**		or was malformed and unusable.
**
**	Maintained by Eric Allman (eric@berkeley, ucbvax!eric) --
**		please mail changes to me.
**
/* **			@(#)sysexits.h	4.2		7/31/83
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

# define EX_OK		0	/* successful termination */

# define EX__BASE	64	/* base value for error messages */

# define EX_USAGE	64	/* command line usage error */
# define EX_DATAERR	65	/* data format error */
# define EX_NOINPUT	66	/* cannot open input */
# define EX_NOUSER	67	/* addressee unknown */
# define EX_NOHOST	68	/* host name unknown */
# define EX_UNAVAILABLE	69	/* service unavailable */
# define EX_SOFTWARE	70	/* internal software error */
# define EX_OSERR	71	/* system error (e.g., can't fork) */
# define EX_OSFILE	72	/* critical OS file missing */
# define EX_CANTCREAT	73	/* can't create (user) output file */
# define EX_IOERR	74	/* input/output error */
# define EX_TEMPFAIL	75	/* temp failure; user is invited to retry */
# define EX_PROTOCOL	76	/* remote error in protocol */
# define EX_NOPERM	77	/* permission denied */
# define EX_DB		78	/* database access error */
/usr/skêÚ C  $        Ÿ  +‰*Ž ˆ*+‰*     tŸ  	                  ./usr/include/syslink.m /*
 *		AIX/370
 *		5713-AFL
 *	LICENSED MATERIALS - PROPERTY OF IBM
 *	(c) Copyright 1989 IBM Corp.
 *	(c) Copyright 1989 Locus Computing Corporation
 *	All Rights Reserved
 */

#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)syslink.m	1.4	AIX)	/* Modified 3/7/90 15:37:29 */

*  This file will define the new macros expected
*  in support of AIX/370 linkage conventions as of
*  43/31/88.  These Macros are:
#include "linkage.m"
 
*     syscall - provides a standard invokation of ucall
*               with provision for minor variations:
*               - alternate result
*               - multiple entry points per 'program' with
*                 only 1 csect generated
 
	macro
&l	syscall &call,&csect=,&result=p,&error=,&return=
        gblb  &syscincsect
        gblc  &rtrn,&rslt,&rslt2,&dest,&pbr,&sp,&p1,&p2,&p3,&p4
        gblc  &sfn
        gbla  &sysc#       
        lclc  &ename
 	aif   ('&l' eq '').nolab
&ename  setc '&l'
 	ago   .didlab
.nolab  anop
&ename  setc '_&call'     Assume name from syscall type
.didlab aif  ('&call' ne '').havecc
 mnote 8,'system call type require operand missing'
	mexit
.havecc aif  (&syscincsect).didcsect
&syscincsect setb 1
&csect   csect
        ago  .donecsect
.didcsect aif ('&csect' eq '').donecsect   ok, no name
     mnote 8,'csect name only allowed on first syscall macro'
	mexit
.donecsect  anop 
          ds 0h            Force 1/2 word align, just in case
&sysc# seta &sysc#+1
	dc	x'ff02'     Minimal t2 trace table
&ename  ds    0H
        entry &ename
        ucall &call
        aif   ('&return' ne 'n').yesrtn
	mexit
.yesrtn aif   ('&error' ne 'n').yeserr
 	br	&rtrn       unconditional return
.yeserr	aif   ('&result'(1,1) eq 'a').altrtn  Alternate return
	bcr   8,&rtrn
        balr  &dest,0       Make a temporary base register
        using *,&dest
	ago   .comrtn
.altrtn anop 
  	balr   &dest,0
	using *,&dest
	bc    7,*+8
	    lr   &rslt,&rslt2     Copy the OK result
	    br   &rtrn
.comrtn anop 
        l  &dest,verrno&sysc#
	drop  &dest
	st    &rslt,0(&dest)      post error code for C routine
	sr    &rslt,&rslt         and return -1 value
	bctr  &rslt,&rtrn
 
verrno&sysc# dc  v(_errno)
 
        mend
rkê¬ B  $        Æ  +‰* ˆ*+‰*     $³Æ  	                  ./usr/include/tar.h k.m #ifndef _POSIX_SOURCE
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)tar.h	1.5       LCC)    /* Modified: 00:29:14 1/12/90 */
#endif /* NOT _POSIX_SOURCE */
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

/*	Header for POSIX tar	*/

#ifndef _H_TAR
#define _H_TAR

#define TMAGIC	"ustar" 	/*	ustar and a null	*/
#define TMAGLEN		6
#define TVERSION	"00"
#define TVERSLEN	2

/*	Values used in typeflag field	*/
#define REGTYPE		'0'	/* Regular file	*/
#define AREGTYPE	'\0'	/* Regular file	*/
#define LNKTYPE		'1'	/* Link		*/
#define SYMTYPE		'2'	/* Reserved	*/
#define CHRTYPE		'3'	/* Character special	*/
#define BLKTYPE		'4'	/* Block special*/
#define DIRTYPE		'5'	/* Directory	*/
#define FIFOTYPE	'6'	/* FIFO special	*/
#define CONTTYPE	'7'	/* Reserved	*/
/*	Values used in typeflag field -- AIX specific 	*/
#ifndef _POSIX_SOURCE
#define HDIRTYPE 	'H'	/* Hidden directory 	*/
#endif /* _POSIX_SOURCE */

/*	Bits used in the mode field - values in octal	*/
#define	TSUID		04000	/* Set UID on execution	*/
#define	TSGID		02000	/* Set GID on execution	*/
#define	TSVTX		01000	/* Reserved	*/
				/* File permissions	*/
#define	TUREAD		00400	/* read by owner	*/
#define	TUWRITE		00200	/* write by owner	*/
#define	TUEXEC		00100	/* execute/search by owner	*/
#define	TGREAD		00040	/* read by group	*/
#define	TGWRITE		00020	/* write by group	*/
#define	TGEXEC		00010	/* execute/search by group	*/
#define	TOREAD		00004	/* read by other	*/
#define	TOWRITE		00002	/* write by other	*/
#define	TOEXEC		00001	/* execute/search by other	*/

#ifndef _POSIX_SOURCE
#define TBLOCK 512
#define NAMSIZ	100

union hblock {
	char dummy[TBLOCK];      /* this just makes it be the right length */
	struct header {         /* this is the real info */
		char name[NAMSIZ];      /* pathname - rel. or abs. */
		char mode[8];           /* octal digits */
		char uid[8];
		char gid[8];
		char size[12];
		char mtime[12];
		char chksum[8];
		char typeflag;
		char linkname[NAMSIZ];
		char magic[TMAGLEN];
		char version[2];
		char uname[32];
		char gname[32];
		char devmajor[8];
		char devminor[8];
		char prefix[155];
	} dbuf;
} dblock;

#endif /* _POSIX_SOURCE */

#endif	/* tar.h	*/
**kê(» A  $        ün  +‰*¬‰*+‰*     Vün  	              n•  ./usr/include/term.h .m /*
 * term.h - this file is automatically made from caps and maketerm.ex.
 *
 * Guard against multiple includes.
 */

#ifndef auto_left_margin

#define	NUM_TI_BOOLS	(21)
#define	NUM_TI_NUMS	(8)
#define	NUM_TI_STRS	(295)

#define auto_left_margin	CUR Auto_left_margin
#define auto_right_margin	CUR Auto_right_margin
#define beehive_glitch	CUR Beehive_glitch
#define ceol_standout_glitch	CUR Ceol_standout_glitch
#define eat_newline_glitch	CUR Eat_newline_glitch
#define erase_overstrike	CUR Erase_overstrike
#define generic_type	CUR Generic_type
#define hard_copy	CUR Hard_copy
#define has_meta_key	CUR Has_meta_key
#define has_status_line	CUR Has_status_line
#define insert_null_glitch	CUR Insert_null_glitch
#define memory_above	CUR Memory_above
#define memory_below	CUR Memory_below
#define move_insert_mode	CUR Move_insert_mode
#define move_standout_mode	CUR Move_standout_mode
#define over_strike	CUR Over_strike
#define status_line_esc_ok	CUR Status_line_esc_ok
#define teleray_glitch	CUR Teleray_glitch
#define tilde_glitch	CUR Tilde_glitch
#define transparent_underline	CUR Transparent_underline
#define xon_xoff	CUR Xon_xoff
#define columns	CUR Columns
#define init_tabs	CUR Init_tabs
#define lines	CUR Lines
#define lines_of_memory	CUR Lines_of_memory
#define magic_cookie_glitch	CUR Magic_cookie_glitch
#define padding_baud_rate	CUR Padding_baud_rate
#define virtual_terminal	CUR Virtual_terminal
#define width_status_line	CUR Width_status_line
#define back_tab	CUR strs.Back_tab
#define bell	CUR strs.Bell
#define carriage_return	CUR strs.Carriage_return
#define change_scroll_region	CUR strs.Change_scroll_region
#define clear_all_tabs	CUR strs.Clear_all_tabs
#define clear_screen	CUR strs.Clear_screen
#define clr_eol	CUR strs.Clr_eol
#define clr_eos	CUR strs.Clr_eos
#define column_address	CUR strs.Column_address
#define command_character	CUR strs.Command_character
#define cursor_address	CUR strs.Cursor_address
#define cursor_down	CUR strs.Cursor_down
#define cursor_home	CUR strs.Cursor_home
#define cursor_invisible	CUR strs.Cursor_invisible
#define cursor_left	CUR strs.Cursor_left
#define cursor_mem_address	CUR strs.Cursor_mem_address
#define cursor_normal	CUR strs.Cursor_normal
#define cursor_right	CUR strs.Cursor_right
#define cursor_to_ll	CUR strs.Cursor_to_ll
#define cursor_up	CUR strs.Cursor_up
#define cursor_visible	CUR strs.Cursor_visible
#define delete_character	CUR strs.Delete_character
#define delete_line	CUR strs.Delete_line
#define dis_status_line	CUR strs.Dis_status_line
#define down_half_line	CUR strs.Down_half_line
#define enter_alt_charset_mode	CUR strs.Enter_alt_charset_mode
#define enter_blink_mode	CUR strs.Enter_blink_mode
#define enter_bold_mode	CUR strs.Enter_bold_mode
#define enter_ca_mode	CUR strs.Enter_ca_mode
#define enter_delete_mode	CUR strs.Enter_delete_mode
#define enter_dim_mode	CUR strs.Enter_dim_mode
#define enter_insert_mode	CUR strs.Enter_insert_mode
#define enter_secure_mode	CUR strs.Enter_secure_mode
#define enter_protected_mode	CUR strs.Enter_protected_mode
#define enter_reverse_mode	CUR strs.Enter_reverse_mode
#define enter_standout_mode	CUR strs.Enter_standout_mode
#define enter_underline_mode	CUR strs.Enter_underline_mode
#define erase_chars	CUR strs.Erase_chars
#define exit_alt_charset_mode	CUR strs.Exit_alt_charset_mode
#define exit_attribute_mode	CUR strs.Exit_attribute_mode
#define exit_ca_mode	CUR strs.Exit_ca_mode
#define exit_delete_mode	CUR strs.Exit_delete_mode
#define exit_insert_mode	CUR strs.Exit_insert_mode
#define exit_standout_mode	CUR strs.Exit_standout_mode
#define exit_underline_mode	CUR strs.Exit_underline_mode
#define flash_screen	CUR strs.Flash_screen
#define form_feed	CUR strs.Form_feed
#define from_status_line	CUR strs.From_status_line
#define init_1string	CUR strs.Init_1string
#define init_2string	CUR strs.Init_2string
#define init_3string	CUR strs.Init_3string
#define init_file	CUR strs.Init_file
#define insert_character	CUR strs.Insert_character
#define insert_line	CUR strs.Insert_line
#define insert_padding	CUR strs.Insert_padding
#define key_backspace	CUR strs.Key_backspace
#define key_catab	CUR strs.Key_catab
#define key_clear	CUR strs.Key_clear
#define key_ctab	CUR strs.Key_ctab
#define key_dc	CUR strs.Key_dc
#define key_dl	CUR strs.Key_dl
#define key_down	CUR strs.Key_down
#define key_eic	CUR strs.Key_eic
#define key_eol	CUR strs.Key_eol
#define key_eos	CUR strs.Key_eos
#define key_f0	CUR strs.Key_f0
#define key_f1	CUR strs.Key_f1
#define key_f10	CUR strs.Key_f10
#define key_f2	CUR strs.Key_f2
#define key_f3	CUR strs.Key_f3
#define key_f4	CUR strs.Key_f4
#define key_f5	CUR strs.Key_f5
#define key_f6	CUR strs.Key_f6
#define key_f7	CUR strs.Key_f7
#define key_f8	CUR strs.Key_f8
#define key_f9	CUR strs.Key_f9
#define key_home	CUR strs.Key_home
#define key_ic	CUR strs.Key_ic
#define key_il	CUR strs.Key_il
#define key_left	CUR strs.Key_left
#define key_ll	CUR strs.Key_ll
#define key_npage	CUR strs.Key_npage
#define key_ppage	CUR strs.Key_ppage
#define key_right	CUR strs.Key_right
#define key_sf	CUR strs.Key_sf
#define key_sr	CUR strs.Key_sr
#define key_stab	CUR strs.Key_stab
#define key_up	CUR strs.Key_up
#define keypad_local	CUR strs.Keypad_local
#define keypad_xmit	CUR strs.Keypad_xmit
#define lab_f0	CUR strs.Lab_f0
#define lab_f1	CUR strs.Lab_f1
#define lab_f10	CUR strs.Lab_f10
#define lab_f2	CUR strs.Lab_f2
#define lab_f3	CUR strs.Lab_f3
#define lab_f4	CUR strs.Lab_f4
#define lab_f5	CUR strs.Lab_f5
#define lab_f6	CUR strs.Lab_f6
#define lab_f7	CUR strs.Lab_f7
#define lab_f8	CUR strs.Lab_f8
#define lab_f9	CUR strs2.Lab_f9
#define meta_off	CUR strs2.Meta_off
#define meta_on	CUR strs2.Meta_on
#define newline	CUR strs2.Newline
#define pad_char	CUR strs2.Pad_char
#define parm_dch	CUR strs2.Parm_dch
#define parm_delete_line	CUR strs2.Parm_delete_line
#define parm_down_cursor	CUR strs2.Parm_down_cursor
#define parm_ich	CUR strs2.Parm_ich
#define parm_index	CUR strs2.Parm_index
#define parm_insert_line	CUR strs2.Parm_insert_line
#define parm_left_cursor	CUR strs2.Parm_left_cursor
#define parm_right_cursor	CUR strs2.Parm_right_cursor
#define parm_rindex	CUR strs2.Parm_rindex
#define parm_up_cursor	CUR strs2.Parm_up_cursor
#define pkey_key	CUR strs2.Pkey_key
#define pkey_local	CUR strs2.Pkey_local
#define pkey_xmit	CUR strs2.Pkey_xmit
#define print_screen	CUR strs2.Print_screen
#define prtr_off	CUR strs2.Prtr_off
#define prtr_on	CUR strs2.Prtr_on
#define repeat_char	CUR strs2.Repeat_char
#define reset_1string	CUR strs2.Reset_1string
#define reset_2string	CUR strs2.Reset_2string
#define reset_3string	CUR strs2.Reset_3string
#define reset_file	CUR strs2.Reset_file
#define restore_cursor	CUR strs2.Restore_cursor
#define row_address	CUR strs2.Row_address
#define save_cursor	CUR strs2.Save_cursor
#define scroll_forward	CUR strs2.Scroll_forward
#define scroll_reverse	CUR strs2.Scroll_reverse
#define set_attributes	CUR strs2.Set_attributes
#define set_tab	CUR strs2.Set_tab
#define set_window	CUR strs2.Set_window
#define tab	CUR strs2.Tab
#define to_status_line	CUR strs2.To_status_line
#define underline_char	CUR strs2.Underline_char
#define up_half_line	CUR strs2.Up_half_line
#define init_prog	CUR strs2.Init_prog
#define key_a1	CUR strs2.Key_a1
#define key_a3	CUR strs2.Key_a3
#define key_b2	CUR strs2.Key_b2
#define key_c1	CUR strs2.Key_c1
#define key_c3	CUR strs2.Key_c3
#define prtr_non	CUR strs2.Prtr_non
#define box_chars_1	CUR strs2.Box_chars_1
#define box_chars_2	CUR strs2.Box_chars_2
#define box_attr_1	CUR strs2.Box_attr_1
#define box_attr_2	CUR strs2.Box_attr_2
#define color_bg_0	CUR strs2.Color_bg_0
#define color_bg_1	CUR strs2.Color_bg_1
#define color_bg_2	CUR strs2.Color_bg_2
#define color_bg_3	CUR strs2.Color_bg_3
#define color_bg_4	CUR strs2.Color_bg_4
#define color_bg_5	CUR strs2.Color_bg_5
#define color_bg_6	CUR strs2.Color_bg_6
#define color_bg_7	CUR strs2.Color_bg_7
#define color_fg_0	CUR strs2.Color_fg_0
#define color_fg_1	CUR strs2.Color_fg_1
#define color_fg_2	CUR strs2.Color_fg_2
#define color_fg_3	CUR strs2.Color_fg_3
#define color_fg_4	CUR strs2.Color_fg_4
#define color_fg_5	CUR strs2.Color_fg_5
#define color_fg_6	CUR strs2.Color_fg_6
#define color_fg_7	CUR strs2.Color_fg_7
#define font_0	CUR strs2.Font_0
#define font_1	CUR strs2.Font_1
#define font_2	CUR strs2.Font_2
#define font_3	CUR strs2.Font_3
#define font_4	CUR strs2.Font_4
#define font_5	CUR strs2.Font_5
#define font_6	CUR strs2.Font_6
#define font_7	CUR strs2.Font_7
#define key_back_tab	CUR strs2.Key_back_tab
#define key_do	CUR strs2.Key_do
#define key_command	CUR strs2.Key_command
#define key_command_pane	CUR strs2.Key_command_pane
#define key_end	CUR strs2.Key_end
#define key_help	CUR strs2.Key_help
#define key_newline	CUR strs2.Key_newline
#define key_next_pane	CUR strs2.Key_next_pane
#define key_prev_cmd	CUR strs2.Key_prev_cmd
#define key_prev_pane	CUR strs2.Key_prev_pane
#define key_quit	CUR strs2.Key_quit
#define key_select	CUR strs2.Key_select
#define key_scroll_left	CUR strs2.Key_scroll_left
#define key_scroll_right	CUR strs2.Key_scroll_right
#define key_tab	CUR strs2.Key_tab
#define key_smap_in1	CUR strs2.Key_smap_in1
#define key_smap_out1	CUR strs2.Key_smap_out1
#define key_smap_in2	CUR strs2.Key_smap_in2
#define key_smap_out2	CUR strs2.Key_smap_out2
#define key_smap_in3	CUR strs2.Key_smap_in3
#define key_smap_out3	CUR strs2.Key_smap_out3
#define key_smap_in4	CUR strs2.Key_smap_in4
#define key_smap_out4	CUR strs2.Key_smap_out4
#define key_smap_in5	CUR strs2.Key_smap_in5
#define key_smap_out5	CUR strs2.Key_smap_out5
#define appl_defined_str	CUR strs2.Appl_defined_str
#define key_smap_in6	CUR strs2.Key_smap_in6
#define key_smap_out6	CUR strs2.Key_smap_out6
#define key_smap_in7	CUR strs2.Key_smap_in7
#define key_smap_out7	CUR strs2.Key_smap_out7
#define key_smap_in8	CUR strs2.Key_smap_in8
#define key_smap_out8	CUR strs2.Key_smap_out8
#define key_smap_in9	CUR strs2.Key_smap_in9
#define key_smap_out9	CUR strs2.Key_smap_out9
#define key_sf1	CUR strs2.Key_sf1
#define key_sf2	CUR strs2.Key_sf2
#define key_sf3	CUR strs2.Key_sf3
#define key_sf4	CUR strs2.Key_sf4
#define key_sf5	CUR strs2.Key_sf5
#define key_sf6	CUR strs2.Key_sf6
#define key_sf7	CUR strs2.Key_sf7
#define key_sf8	CUR strs2.Key_sf8
#define key_sf9	CUR strs2.Key_sf9
#define key_sf10	CUR strs2.Key_sf10
#define key_f11	CUR strs2.Key_f11
#define key_f12	CUR strs2.Key_f12
#define key_f13	CUR strs2.Key_f13
#define key_f14	CUR strs2.Key_f14
#define key_f15	CUR strs2.Key_f15
#define key_f16	CUR strs2.Key_f16
#define key_f17	CUR strs2.Key_f17
#define key_f18	CUR strs2.Key_f18
#define key_f19	CUR strs2.Key_f19
#define key_f20	CUR strs2.Key_f20
#define key_f21	CUR strs2.Key_f21
#define key_f22	CUR strs2.Key_f22
#define key_f23	CUR strs2.Key_f23
#define key_f24	CUR strs2.Key_f24
#define key_f25	CUR strs2.Key_f25
#define key_f26	CUR strs2.Key_f26
#define key_f27	CUR strs2.Key_f27
#define key_f28	CUR strs2.Key_f28
#define key_f29	CUR strs2.Key_f29
#define key_f30	CUR strs2.Key_f30
#define key_f31	CUR strs2.Key_f31
#define key_f32	CUR strs2.Key_f32
#define key_f33	CUR strs2.Key_f33
#define key_f34	CUR strs2.Key_f34
#define key_f35	CUR strs2.Key_f35
#define key_f36	CUR strs2.Key_f36
#define key_f37	CUR strs2.Key_f37
#define key_f38	CUR strs2.Key_f38
#define key_f39	CUR strs2.Key_f39
#define key_f40	CUR strs2.Key_f40
#define key_f41	CUR strs2.Key_f41
#define key_f42	CUR strs2.Key_f42
#define key_f43	CUR strs2.Key_f43
#define key_f44	CUR strs2.Key_f44
#define key_f45	CUR strs2.Key_f45
#define key_f46	CUR strs2.Key_f46
#define key_f47	CUR strs2.Key_f47
#define key_f48	CUR strs2.Key_f48
#define key_f49	CUR strs2.Key_f49
#define key_f50	CUR strs2.Key_f50
#define key_f51	CUR strs2.Key_f51
#define key_f52	CUR strs2.Key_f52
#define key_f53	CUR strs2.Key_f53
#define key_f54	CUR strs2.Key_f54
#define key_f55	CUR strs2.Key_f55
#define key_f56	CUR strs2.Key_f56
#define key_f57	CUR strs2.Key_f57
#define key_f58	CUR strs2.Key_f58
#define key_f59	CUR strs2.Key_f59
#define key_f60	CUR strs2.Key_f60
#define key_f61	CUR strs2.Key_f61
#define key_f62	CUR strs2.Key_f62
#define key_f63	CUR strs2.Key_f63
#define display_pc_char	CUR strs2.Display_pc_char
#define enter_pc_charset_mode	CUR strs2.Enter_pc_charset_mode
#define exit_pc_charset_mode	CUR strs2.Exit_pc_charset_mode
#define enter_scancode_mode	CUR strs2.Enter_scancode_mode
#define exit_scancode_mode	CUR strs2.Exit_scancode_mode
#define scancode_escape	CUR strs2.Scancode_escape
#define alt_scancode_esc	CUR strs2.Alt_scancode_esc
#define pc_term_options	CUR strs2.Pc_term_options
#define key_enter	CUR strs2.Key_enter
#define key_print	CUR strs2.Key_print
#define key_restart	CUR strs2.Key_restart
#define key_sic	CUR strs2.Key_sic
#define key_options	CUR strs2.Key_options
#define key_shome	CUR strs2.Key_shome
#define key_previous	CUR strs2.Key_previous
#define key_sdc	CUR strs2.Key_sdc
#define key_send	CUR strs2.Key_send
#define key_next	CUR strs2.Key_next
#define key_sleft	CUR strs2.Key_sleft
#define key_sright	CUR strs2.Key_sright
#define key_beg	CUR strs2.Key_beg
#define key_resume	CUR strs2.Key_resume
#define key_refresh	CUR strs2.Key_refresh
#define key_exit	CUR strs2.Key_exit
#define key_suspend	CUR strs2.Key_suspend

typedef char *charptr ;

struct strs {
    charptr
	Back_tab,	/* Back tab (P)*/
	Bell,	/* Audible signal (bell) (P)*/
	Carriage_return,	/* Carriage return (P*)*/
	Change_scroll_region,	/* change to lines #1 thru #2 (vt100) (PG)*/
	Clear_all_tabs,	/* Clear all tab stops. (P)*/
	Clear_screen,	/* Clear screen (P*)*/
	Clr_eol,	/* Clear to end of line (P)*/
	Clr_eos,	/* Clear to end of display (P*)*/
	Column_address,	/* Set cursor column (PG)*/
	Command_character,	/* Term. settable cmd char in prototype*/
	Cursor_address,	/* Cursor motion to row #1 col #2 (PG)*/
	Cursor_down,	/* Down one line*/
	Cursor_home,	/* Home cursor (if no cup)*/
	Cursor_invisible,	/* Make cursor invisible*/
	Cursor_left,	/* Move cursor left one space.*/
	Cursor_mem_address,	/* Memory relative cursor addressing.*/
	Cursor_normal,	/* Make cursor appear normal (undo vs/vi)*/
	Cursor_right,	/* Non-destructive space (cursor right)*/
	Cursor_to_ll,	/* Last line, first column (if no cup)*/
	Cursor_up,	/* Upline (cursor up)*/
	Cursor_visible,	/* Make cursor very visible*/
	Delete_character,	/* Delete character (P*)*/
	Delete_line,	/* Delete line (P*)*/
	Dis_status_line,	/* Disable status line*/
	Down_half_line,	/* Half-line down (forward 1/2 linefeed)*/
	Enter_alt_charset_mode,	/* Start alternate character set (P)*/
	Enter_blink_mode,	/* Turn on blinking*/
	Enter_bold_mode,	/* Turn on bold (extra bright) mode*/
	Enter_ca_mode,	/* String to begin programs that use cup*/
	Enter_delete_mode,	/* Delete mode (enter)*/
	Enter_dim_mode,	/* Turn on half-bright mode*/
	Enter_insert_mode,	/* Insert mode (enter);*/
	Enter_secure_mode,	/* Turn on blank mode (chars invisible)*/
	Enter_protected_mode,	/* Turn on protected mode*/
	Enter_reverse_mode,	/* Turn on reverse video mode*/
	Enter_standout_mode,	/* Begin stand out mode*/
	Enter_underline_mode,	/* Start underscore mode*/
	Erase_chars,	/* Erase #1 characters (PG)*/
	Exit_alt_charset_mode,	/* End alternate character set (P)*/
	Exit_attribute_mode,	/* Turn off all attributes*/
	Exit_ca_mode,	/* String to end programs that use cup*/
	Exit_delete_mode,	/* End delete mode*/
	Exit_insert_mode,	/* End insert mode;*/
	Exit_standout_mode,	/* End stand out mode*/
	Exit_underline_mode,	/* End underscore mode*/
	Flash_screen,	/* Visible bell (may not move cursor)*/
	Form_feed,	/* Hardcopy terminal page eject (P*)*/
	From_status_line,	/* Return from status line*/
	Init_1string,	/* Terminal initialization string*/
	Init_2string,	/* Terminal initialization string*/
	Init_3string,	/* Terminal initialization string*/
	Init_file,	/* Name of file containing is*/
	Insert_character,	/* Insert character (P)*/
	Insert_line,	/* Add new blank line (P*)*/
	Insert_padding,	/* Insert pad after character inserted (P*)*/
	Key_backspace,	/* Sent by backspace key*/
	Key_catab,	/* Sent by clear-all-tabs key.*/
	Key_clear,	/* Sent by clear screen or erase key.*/
	Key_ctab,	/* Sent by clear-tab key*/
	Key_dc,	/* Sent by delete character key.*/
	Key_dl,	/* Sent by delete line key.*/
	Key_down,	/* Sent by terminal down arrow key*/
	Key_eic,	/* Sent by rmir or smir in insert mode.*/
	Key_eol,	/* Sent by clear-to-end-of-line key.*/
	Key_eos,	/* Sent by clear-to-end-of-screen key.*/
	Key_f0,	/* Sent by function key f0.*/
	Key_f1,	/* Sent by function key f1.*/
	Key_f10,	/* Sent by function key f10.*/
	Key_f2,	/* Sent by function key f2.*/
	Key_f3,	/* Sent by function key f3.*/
	Key_f4,	/* Sent by function key f4.*/
	Key_f5,	/* Sent by function key f5.*/
	Key_f6,	/* Sent by function key f6.*/
	Key_f7,	/* Sent by function key f7.*/
	Key_f8,	/* Sent by function key f8.*/
	Key_f9,	/* Sent by function key f9.*/
	Key_home,	/* Sent by home key.*/
	Key_ic,	/* Sent by ins char/enter ins mode key.*/
	Key_il,	/* Sent by insert line.*/
	Key_left,	/* Sent by terminal left arrow key*/
	Key_ll,	/* Sent by home-down key*/
	Key_npage,	/* Sent by next-page key*/
	Key_ppage,	/* Sent by previous-page key*/
	Key_right,	/* Sent by terminal right arrow key*/
	Key_sf,	/* Sent by scroll-forward/down key*/
	Key_sr,	/* Sent by scroll-backward/up key*/
	Key_stab,	/* Sent by set-tab key*/
	Key_up,	/* Sent by terminal up arrow key*/
	Keypad_local,	/* Out of "keypad transmit" mode*/
	Keypad_xmit,	/* Put terminal in "keypad transmit" mode*/
	Lab_f0,	/* Labels on function key f0 if not f0*/
	Lab_f1,	/* Labels on function key f1 if not f1*/
	Lab_f10,	/* Labels on function key f10 if not f10*/
	Lab_f2,	/* Labels on function key f2 if not f2*/
	Lab_f3,	/* Labels on function key f3 if not f3*/
	Lab_f4,	/* Labels on function key f4 if not f4*/
	Lab_f5,	/* Labels on function key f5 if not f5*/
	Lab_f6,	/* Labels on function key f6 if not f6*/
	Lab_f7,	/* Labels on function key f7 if not f7*/
	Lab_f8;	/* Labels on function key f8 if not f8*/
};
struct strs2 {
    charptr
	Lab_f9,	/* Labels on function key f9 if not f9*/
	Meta_off,	/* Turn off "meta mode"*/
	Meta_on,	/* Turn on "meta mode" (8th bit)*/
	Newline,	/* Newline (behaves like cr followed by lf)*/
	Pad_char,	/* Pad character (rather than null)*/
	Parm_dch,	/* Delete #1 chars (PG*)*/
	Parm_delete_line,	/* Delete #1 lines (PG*)*/
	Parm_down_cursor,	/* Move cursor down #1 lines. (PG*)*/
	Parm_ich,	/* Insert #1 blank chars (PG*)*/
	Parm_index,	/* Scroll forward #1 lines. (PG)*/
	Parm_insert_line,	/* Add #1 new blank lines (PG*)*/
	Parm_left_cursor,	/* Move cursor left #1 spaces (PG)*/
	Parm_right_cursor,	/* Move cursor right #1 spaces. (PG*)*/
	Parm_rindex,	/* Scroll backward #1 lines. (PG)*/
	Parm_up_cursor,	/* Move cursor up #1 lines. (PG*)*/
	Pkey_key,	/* Prog funct key #1 to type string #2*/
	Pkey_local,	/* Prog funct key #1 to execute string #2*/
	Pkey_xmit,	/* Prog funct key #1 to xmit string #2*/
	Print_screen,	/* Print contents of the screen*/
	Prtr_off,	/* Turn off the printer*/
	Prtr_on,	/* Turn on the printer*/
	Repeat_char,	/* Repeat char #1 #2 times.  (PG*)*/
	Reset_1string,	/* Reset terminal completely to sane modes.*/
	Reset_2string,	/* Reset terminal completely to sane modes.*/
	Reset_3string,	/* Reset terminal completely to sane modes.*/
	Reset_file,	/* Name of file containing reset string.*/
	Restore_cursor,	/* Restore cursor to position of last sc.*/
	Row_address,	/* Like hpa but sets row. (PG)*/
	Save_cursor,	/* Save cursor position. (P)*/
	Scroll_forward,	/* Scroll text up (P)*/
	Scroll_reverse,	/* Scroll text down (P)*/
	Set_attributes,	/* Define the video attributes (PG9)*/
	Set_tab,	/* Set a tab in all rows, current column.*/
	Set_window,	/* Current window is lines #1-#2 cols #3-#4*/
	Tab,	/* Tab to next 8 space hardware tab stop.*/
	To_status_line,	/* Go to status line*/
	Underline_char,	/* Underscore one char and move past it*/
	Up_half_line,	/* Half-line up (reverse 1/2 linefeed)*/
	Init_prog,	/* Path name of program for init.*/
	Key_a1,	/* Upper left of keypad*/
	Key_a3,	/* Upper right of keypad*/
	Key_b2,	/* Center of keypad*/
	Key_c1,	/* Lower left of keypad*/
	Key_c3,	/* Lower right of keypad*/
	Prtr_non,	/* Turn on the printer for #1 bytes.*/
	Box_chars_1,	/* Box characters primary set*/
	Box_chars_2,	/* Box characters alternate set*/
	Box_attr_1,	/* Attributes for box_chars_1*/
	Box_attr_2,	/* Attributes for box_chars_2*/
	Color_bg_0,	/* Background color 0 black*/
	Color_bg_1,	/* Background color 1 red*/
	Color_bg_2,	/* Background color 2 green*/
	Color_bg_3,	/* Background color 3 brown*/
	Color_bg_4,	/* Background color 4 blue*/
	Color_bg_5,	/* Background color 5 magenta*/
	Color_bg_6,	/* Background color 6 cyan*/
	Color_bg_7,	/* Background color 7 white*/
	Color_fg_0,	/* Foreground color 0 black*/
	Color_fg_1,	/* Foreground color 1 red*/
	Color_fg_2,	/* Foreground color 2 green*/
	Color_fg_3,	/* Foreground color 3 brown*/
	Color_fg_4,	/* Foreground color 4 blue*/
	Color_fg_5,	/* Foreground color 5 magenta*/
	Color_fg_6,	/* Foreground color 6 cyan*/
	Color_fg_7,	/* Foreground color 7 white*/
	Font_0,	/* Select font 0*/
	Font_1,	/* Select font 1*/
	Font_2,	/* Select font 2*/
	Font_3,	/* Select font 3*/
	Font_4,	/* Select font 4*/
	Font_5,	/* Select font 5*/
	Font_6,	/* Select font 6*/
	Font_7,	/* Select font 7*/
	Key_back_tab,	/* Backtab key*/
	Key_do,	/* Do request key*/
	Key_command,	/* Command request key*/
	Key_command_pane,	/* Command pane key*/
	Key_end,	/* End key*/
	Key_help,	/* Help key*/
	Key_newline,	/* Newline key*/
	Key_next_pane,	/* Next pane key*/
	Key_prev_cmd,	/* Previous command key*/
	Key_prev_pane,	/* Previous pane key*/
	Key_quit,	/* Quit key*/
	Key_select,	/* Select key*/
	Key_scroll_left,	/* Scroll left*/
	Key_scroll_right,	/* Scroll right*/
	Key_tab,	/* Tab key*/
	Key_smap_in1,	/* input for special mapped key 1*/
	Key_smap_out1,	/* output for mapped key 1*/
	Key_smap_in2,	/* input for special mapped key 2*/
	Key_smap_out2,	/* output for mapped key 2*/
	Key_smap_in3,	/* input for special mapped key 3*/
	Key_smap_out3,	/* output for mapped key 3*/
	Key_smap_in4,	/* input for special mapped key 4*/
	Key_smap_out4,	/* output for mapped key 4*/
	Key_smap_in5,	/* input for special mapped key 5*/
	Key_smap_out5,	/* output for mapped key 5*/
	Appl_defined_str,	/* Application defined terminal string*/
	Key_smap_in6,	/* input for special mapped key 6*/
	Key_smap_out6,	/* output for mapped key 6*/
	Key_smap_in7,	/* input for special mapped key 7*/
	Key_smap_out7,	/* output for mapped key 7*/
	Key_smap_in8,	/* input for special mapped key 8*/
	Key_smap_out8,	/* output for mapped key 8*/
	Key_smap_in9,	/* input for special mapped key 9*/
	Key_smap_out9,	/* output for mapped key 9*/
	Key_sf1,	/* Special function key 1*/
	Key_sf2,	/* Special function key 2*/
	Key_sf3,	/* Special function key 3*/
	Key_sf4,	/* Special function key 4*/
	Key_sf5,	/* Special function key 5*/
	Key_sf6,	/* Special function key 6*/
	Key_sf7,	/* Special function key 7*/
	Key_sf8,	/* Special function key 8*/
	Key_sf9,	/* Special function key 9*/
	Key_sf10,	/* Special function key 10*/
	Key_f11,	/* Sent by function key f11.*/
	Key_f12,	/* Sent by function key f12.*/
	Key_f13,	/* Sent by function key f13.*/
	Key_f14,	/* Sent by function key f14.*/
	Key_f15,	/* Sent by function key f15.*/
	Key_f16,	/* Sent by function key f16.*/
	Key_f17,	/* Sent by function key f17.*/
	Key_f18,	/* Sent by function key f18.*/
	Key_f19,	/* Sent by function key f19.*/
	Key_f20,	/* Sent by function key f20.*/
	Key_f21,	/* Sent by function key f21.*/
	Key_f22,	/* Sent by function key f22.*/
	Key_f23,	/* Sent by function key f23.*/
	Key_f24,	/* Sent by function key f24.*/
	Key_f25,	/* Sent by function key f25.*/
	Key_f26,	/* Sent by function key f26.*/
	Key_f27,	/* Sent by function key f27.*/
	Key_f28,	/* Sent by function key f28.*/
	Key_f29,	/* Sent by function key f29.*/
	Key_f30,	/* Sent by function key f30.*/
	Key_f31,	/* Sent by function key f31.*/
	Key_f32,	/* Sent by function key f32.*/
	Key_f33,	/* Sent by function key f33.*/
	Key_f34,	/* Sent by function key f34.*/
	Key_f35,	/* Sent by function key f35.*/
	Key_f36,	/* Sent by function key f36.*/
	Key_f37,	/* Sent by function key f37.*/
	Key_f38,	/* Sent by function key f38.*/
	Key_f39,	/* Sent by function key f39.*/
	Key_f40,	/* Sent by function key f40.*/
	Key_f41,	/* Sent by function key f41.*/
	Key_f42,	/* Sent by function key f42.*/
	Key_f43,	/* Sent by function key f43.*/
	Key_f44,	/* Sent by function key f44.*/
	Key_f45,	/* Sent by function key f45.*/
	Key_f46,	/* Sent by function key f46.*/
	Key_f47,	/* Sent by function key f47.*/
	Key_f48,	/* Sent by function key f48.*/
	Key_f49,	/* Sent by function key f49.*/
	Key_f50,	/* Sent by function key f50.*/
	Key_f51,	/* Sent by function key f51.*/
	Key_f52,	/* Sent by function key f52.*/
	Key_f53,	/* Sent by function key f53.*/
	Key_f54,	/* Sent by function key f54.*/
	Key_f55,	/* Sent by function key f55.*/
	Key_f56,	/* Sent by function key f56.*/
	Key_f57,	/* Sent by function key f57.*/
	Key_f58,	/* Sent by function key f58.*/
	Key_f59,	/* Sent by function key f59.*/
	Key_f60,	/* Sent by function key f60.*/
	Key_f61,	/* Sent by function key f61.*/
	Key_f62,	/* Sent by function key f62.*/
	Key_f63,	/* Sent by function key f63.*/
	Display_pc_char,	/* Display PC character*/
	Enter_pc_charset_mode,	/* Enable PC character display mode.*/
	Exit_pc_charset_mode,	/* Disable PC character display mode.*/
	Enter_scancode_mode,	/* Enable PC scan code mode.*/
	Exit_scancode_mode,	/* Disable PC scan code mode.*/
	Scancode_escape,	/* Escape sequence start - spec term fcns.*/
	Alt_scancode_esc,	/* Alt esc seq start - spec term fcns.*/
	Pc_term_options,	/* PC terminal options.*/
	Key_enter,	/* AT Keyboard Enter key.*/
	Key_print,	/* AT Keyboard Print Screen key.*/
	Key_restart,	/* AT Keyboard Pause/Break key.*/
	Key_sic,	/* AT Keyboard Escape Key.*/
	Key_options,	/* AT Keyboard Sys Req key.*/
	Key_shome,	/* AT Keyboard Home key.*/
	Key_previous,	/* AT Keyboard PageUp key.*/
	Key_sdc,	/* AT Keyboard Delete key.*/
	Key_send,	/* AT Keyboard End key.*/
	Key_next,	/* AT Keyboard PageDn key.*/
	Key_sleft,	/* AT Keyboard Left Arrow key.*/
	Key_sright,	/* AT Keyboard Right Arrow key.*/
	Key_beg,	/* TopBottom Shift Screen*/
	Key_resume,	/* Fork a New Shell*/
	Key_refresh,	/* Redraw Screen*/
	Key_exit,	/* Kill DOS*/
	Key_suspend;	/* Suspend DOS*/
} ;

struct term {
    char
	Auto_left_margin,	/* cub1 wraps from column 0 to last column*/
	Auto_right_margin,	/* Terminal has automatic margins*/
	Beehive_glitch,	/* Beehive (f1=escape, f2=ctrl C)*/
	Ceol_standout_glitch,	/* Standout not erased by overwriting (hp)*/
	Eat_newline_glitch,	/* newline ignored after 80 cols (Concept)*/
	Erase_overstrike,	/* Can erase overstrikes with a blank*/
	Generic_type,	/* Generic line type (e.g. dialup, switch).*/
	Hard_copy,	/* Hardcopy terminal*/
	Has_meta_key,	/* Has a meta key (shift, sets parity bit)*/
	Has_status_line,	/* Has extra "status line"*/
	Insert_null_glitch,	/* Insert mode distinguishes nulls*/
	Memory_above,	/* Display may be retained above the screen*/
	Memory_below,	/* Display may be retained below the screen*/
	Move_insert_mode,	/* Safe to move while in insert mode*/
	Move_standout_mode,	/* Safe to move in standout modes*/
	Over_strike,	/* Terminal overstrikes*/
	Status_line_esc_ok,	/* Escape can be used on the status line*/
	Teleray_glitch,	/* Tabs destructive, magic so char (t1061)*/
	Tilde_glitch,	/* Hazeltine; can't print ~'s*/
	Transparent_underline,	/* underline character overstrikes*/
	Xon_xoff;	/* Terminal uses xon/xoff handshaking*/
    short
	Columns,	/* Number of columns in a line*/
	Init_tabs,	/* Tabs initially every # spaces.*/
	Lines,	/* Number of lines on screen or page*/
	Lines_of_memory,	/* Lines of memory if > lines.  0 => varies*/
	Magic_cookie_glitch,	/* Number blank chars left by smso or rmso*/
	Padding_baud_rate,	/* Lowest baud rate where padding needed*/
	Virtual_terminal,	/* Virtual terminal number (CB/Unix)*/
	Width_status_line;	/* # columns in status line*/

	struct strs strs;
	struct strs2 strs2;
	short Filedes;		/* file descriptor being written to */
#ifndef NONSTANDARD
	SGTTY Ottyb,		/* original state of the terminal */
	      Nttyb;		/* current state of the terminal */
#endif
};
#ifndef NONSTANDARD
extern struct term *cur_term;
#endif

#endif auto_left_margin

#ifdef SINGLE
extern struct term _first_term;
# define CUR	_first_term.
#else
# define CUR	cur_term->
#endif
	/* kêŠÂ ü  ÿ¡             S‰*S‰*S‰*          	                  ./usr/include/termio.h  sys/termio.h /tekêÞ¬ @  $        ú  ,‰* ˆ*,‰*     ¶tú  	              Þ[  ./usr/include/termios.h #ifndef _POSIX_SOURCE
#ifndef H_SCCSID
#include <sccs.h>
#endif /* ! H_SCCSID */
H_SCCSID(@(#)termios.h	1.12       LCC)    /* Modified: 15:08:10 11/9/90 */
#endif /* NOT _POSIX_SOURCE */
/* 
* Copyright (C)  1989, Locus Computing Corporation
 * All Rights Reserved
 */ 
/* 
 * (C) Copyright IBM Corp. 1989 
 * All Rights Reserved 
 * Licensed Materials - Property of IBM 
 */

#ifndef	_H_TERMIOS
#define	_H_TERMIOS

#include <sys/ioctl.h>

#ifndef _KERNEL

#if defined(_h_TERMIO) && !defined(_POSIX_SOURCE)
		/* if user includes both termio.h and termios.h,
		  * which is not allowed, cause an error here!
		  */
<<<< Use only one termioX.h file: struct termio already defined >>>>
#endif /* _h_TERMIO && NOT _POSIX_SOURCE */

#include <sys/types.h>

/* input modes, this is subset of input modes defined in <termio.h>
   make sure the bits are defined the same, otherwise the compile of 
   posix interface library routines will fail.			 */
#define	IGNBRK	0000001
#define	BRKINT	0000002
#define	IGNPAR	0000004
#define	PARMRK	0000010
#define	INPCK	0000020
#define	ISTRIP	0000040
#define	INLCR	0000100
#define	IGNCR	0000200
#define	ICRNL	0000400
#define	IXON	0002000
#define	IXOFF	0010000

/* output modes, this is subset of input modes defined in <termio.h> */
#define	OPOST	0000001

/* control modes */
#define	B0		0		/* speed 0 */
#define	B50		0000001		/* speed 1 */
#define	B75		0000002		/* speed 2 */
#define	B110		0000003		/* speed 3 */
#define	B134		0000004		/* speed 4 */
#define	B150		0000005		/* speed 5 */
#define	B200		0000006		/* speed 6 */
#define	B300		0000007		/* speed 7 */
#define	B600		0000010		/* speed 8 */
#define	B1200		0000011		/* speed 9 */
#define	B1800		0000012		/* speed 10 */
#define	B2400		0000013		/* speed 11 */
#define	B4800		0000014		/* speed 12 */
#define	B9600		0000015		/* speed 13 */
#define	B19200		0000016		/* speed 14 */
#define	B38400		0000017		/* speed 15 */

#ifndef _POSIX_SOURCE
#define	EXTA		0000016
#define	EXTB		0000017
#define	CBAUD		0000017
#endif	/* NOT _POSIX_SOURCE */

#define	CSIZE		0000060
#define	CS5		0
#define	CS6		0000020
#define	CS7		0000040
#define	CS8		0000060
#define	CSTOPB		0000100
#define	CREAD		0000200
#define	PARENB		0000400
#define	PARODD		0001000
#define	HUPCL		0002000
#define	CLOCAL		0004000

/* local modes, this is mostly subset of input modes defined in <termio.h>.
   Some bits are missing because they are defined to be something else in
   <termio.h>.
   New defines are IEXTEN and TOSTOP.  They are new for POSIX.  TOSTOP is
   Berkeley equivalent of LTOSTOP.  A different TOSTOP is defined in
   sgtty.h if BSD and !_KERNEL.  However, I don't think it ever gets used
   that way.  								*/

/* line discipline 0 modes */
#define	ISIG	0000001
#define	ICANON	0000002
#define	ECHO	0000010
#define	ECHOE	0000020
#define	ECHOK	0000040
#define	ECHONL	0000100
#define	NOFLSH	0000200
#define IEXTEN	0001000


/* Note:  some of these symbols would conflict with the System-V
 *        symbols in <sys/termio.h>, but since the POSIX interface
 *        is all-encompassing, the user will never need both these
 *        defines and the old ones at the same time.  The actual
 *        conflicts are called out in the comments
 */

#define	VINTR 		0	/* interrupt */
#define	VQUIT 		1	/* quit */
#define	VERASE		2	/* erase last character */
#define	VKILL		3	/* erase entire line */

/* NOTE: fields 4 and 5 are meaningless with POSIX interface */
#ifndef _POSIX_SOURCE
#define	VEOL2		6	/* Sys5: 2nd input delimiter sys5 only */
#define	VS5RESERVE	7	/* Sys5: reserved for future use */
#endif	/* NOT _POSIX_SOURCE */

/* NOTE: these "VMIN/TIME/EOF/EOL" defines do NOT match the SysV ones */
#define	VMIN		8	/* Sys5: minimum chars per read (!ICANON) */
#define	VTIME		9	/* Sys5: time before returning read (!ICANON) */
#define	VSTART		10	/* 4bsd: start output */
#define	VSTOP		11	/* 4bsd: stop output */
#define	VSUSP		12	/* 4bsd: stop process signal */

#ifndef _POSIX_SOURCE
#define	VDSUSP		13	/* 4bsd: delayed stop process signal */
#define	VRPRNT		14	/* 4bsd: reprint line */
#define	VFLUSH		15	/* 4bsd: flush output (toggles) */
#define	VWERASE		16	/* 4bsd: word erase */
#define	VLNEXT		17	/* 4bsd: literal next character */
#define	VSTAT		18	/* ucla: report system load */
#define	VPAGE		19	/* ucla: display next page of output */
#define	VPGOFF		20	/* ucla: disable paging until next input */

#define	VBRK		VEOL	/* brk is bsd's name for eol */
#endif	/* NOT _POSIX_SOURCE */
#define	VEOF		21	/* eof char */
#define	VEOL		22	/* input delimiter like '\n' */

#endif /* NOT _KERNEL */

#define	TOSTOP	0002000

typedef unsigned short	tcflag_t;
typedef unsigned char	cc_t;
#ifdef _MBCS
typedef unsigned int	speed_t;
#else	/* ~ _MBCS */
typedef unsigned short	speed_t;
#endif	/* ~ _MBCS */

/*
 * "POSIX" control structure; also TIOCxPSX Ioctl control packet
 */

#define	NCCS	23

struct termios {
/* posix minimum set (along with c_cc below) */
	tcflag_t 	c_iflag;	/* input modes */
	tcflag_t 	c_oflag;	/* output modes */
	tcflag_t 	c_cflag;	/* control modes */
	tcflag_t 	c_lflag;	/* SYSV local modes */
/* additional supported modes */
	tcflag_t	c_reserved[4];	/* for future expansion */
	tcflag_t	c_bflag;	/* 4bsd: newtty line discipline modes */
#ifdef _POSIX_SOURCE
	struct _Winsize c_winsize;	/* window size */
#else
	struct winsize	c_winsize;	/* window size */
#endif
	char		c_length;	/* vertical screen length */
	char		c_pgflag;	/* paging and bell-ringing flags */
	char		c_line;		/* line discipline */
	cc_t 		c_cc[NCCS];	/* control chars */
};


#ifndef _KERNEL

/*
 * BERKELEY newtty line discipline modes (c_bflag)
 */
#ifndef _POSIX_SOURCE
#define	LCRTBS	0000001		/* correct backspacing for crt */
#define	LPRTERA 0000002		/* printing terminal \ ... / erase */
#define	LTILDE	0000010		/* IIASA - hazeltine tilde kludge */
#define	LMDMBUF	0000020		/* IIASA - start/stop output on carrier intr */
#define	LLITOUT	0000040		/* IIASA - suppress any output translations */
#define	LFLUSHO	0000200		/* flush output sent to terminal */
#define	LETXACK 0001000		/* IIASA - diablo style buffer hacking */
#define	LCRTKIL	0002000		/* erase whole line on kill with "\b \b" */
#define	LPASS8  0004000		/* allow all 8 bits to pass through on input */ 
#define	LCTLECH	0010000		/* echo control characters as ^X */
#endif	/* NOT _POSIX_SOURCE */


#define TCSANOW		0
#define	TCSADRAIN	1
#define TCSAFLUSH	2

/* Queue selectors for tcflush routine */
#define TCIFLUSH	0
#define TCOFLUSH	1
#define TCIOFLUSH	2

/* TCFLOW actions */
#define	TCOOFF	0
#define	TCOON	1
#define	TCIOFF	2
#define	TCION	3

/* POSIX forward declarations. */
extern	int	tcgetattr();
extern	int	tcsetattr();
extern	int	tcsendbreak();
extern	int	tcdrain();
extern	int	tcflush();
extern	int	tcflow();
extern	speed_t	cfgetospeed();
extern	speed_t	cfgetispeed();
extern	int	cfsetospeed();
extern	int	cfsetispeed();

#endif /* NOT _KERNEL */

#endif /*_H_TERMIOS */
0040
#kêªd ù  $        V  T‰*Á ˆ*T‰*