DEFINITION MODULE KIOnad;
FROM KERnad IMPORT
     	  cardinal16, cardinal32, bits16,
	  virtAddr, exceptionType, pBlock, seid;

EXPORT QUALIFIED fBlockNumber;

(*
    CPC:  KIO
    CP:   all
	
    B5 Specs: ???
    C Specs: ???
    AUTHOR:   J. Nagle
    VERSION:  1.14 of 6/17/80        (c) 1979 FACC

    Definitions from the I/O system which are required elsewhere in the
    Kernel.
    All definitions of I/O structures needed for kernel calls are here.

*)

		 (* @(#)KIOnad.mod	1.14  WHAT(I) level indicator *)

(*
	CPP definitions required for the assert mechanism
*)


TYPE
    asyncId = cardinal16;                 (* user's asynchronous identifier *)

    absAddress = cardinal32;

    relAddress = virtAddr;

    fBlockNumber = cardinal32;		(* block number within file *)

    ioStatus = RECORD                   (* I/O status of operation *)
	       devIndep : exceptionType;(* device-independent part *)
	       devDep   : bits16;         (* device-dependent part *)
	       END;

    ioFunction = (                      (* functions for K_device_function *)
		READ
	       ,WRITE
	       ,SETEOMCHARS
	       ,REWIND
	       ,UNLOAD
	       ,WRITEMARK
	       ,SETDENSITY
	       ,SETTERMMODES1		(* non-security-related *)
	       ,SETTERMMODES2		(* security-related *)
	       ,GETTERMMODES
	       ,SETFILESIZE
	       ,ERASEFILE
	       ,VOLUMEVALID
	       ,VOLUMEINVALID
	       ,INPUTWAIT
	       ,SETPATH
	       );

    transferDirection = (NOTRANSFER, INWARD, OUTWARD); (* for p_blocks *)

    transferBlock = RECORD                 (* p_block for I/O transfer *)
		    blk: pBlock;           (* where *)
		    dir: transferDirection;(* which way *)
		    abs: absAddress;        (* absolute address for internal *)
		    END;

    setOfOpenModes = RECORD             (* used on K_open requests *)
	       read: BOOLEAN;           (* if open for reading *)
	       write: BOOLEAN;          (* if open for writing *)
	       exclusiveRead: BOOLEAN; (* read exclusively *)
	       exclusiveWrite: BOOLEAN;(* write exclusively *)
	       END;

    fileStatBlock = RECORD            (* file status  *)
	fSize          : cardinal32;   (* file size    *)
	subtype         : seid;         (* file subtype *)
	timeLastMod   : cardinal32;   (* time of last mod *)
	openAtCrash   : BOOLEAN       (* if open at crash *)
    END;
(*
	Terminal mode bits for SETTERMMODES1 and GETTERMMODES

	To use the values in this list, coerce into cardinal and
	use as a bit subscript of the "blockNo" or "errs.devDep"
	argument to K_device_function.
*)
terminalModeBits =
		(breakOnAllCharacters,
		 suppressEcho,
		 suppressEchoOfBreakCharacter);
(*
	Text of Asynchronous I/O Completion Message
*)
    ioCompletionMessage = RECORD
	sender: seid;				(* seid of sender *)
	eventType: CHAR;			(* ***TEMP*** *)
	filler1: CHAR;				(* align for next word *)
	stat:  ioStatus;			(* status *)      
	byteCount: cardinal16;			(* length of transfer *)
	async: asyncId;				(* requestor's marker *)
	filler2: ARRAY [1..2] OF CHAR;		(* filler to 16 bytes *)
	END;
END KIOnad.
