        opt     -l
        ttl     OS9 Level 2 Pipe Definitions

*
*   Copyright 1988 by Microware Systems Corporation
*   All Rights Reserved
*
*   Named pipe equates by Burke & Burke.
*   All rights assigned to Microware Systems Corporation.
*
*   This file contains proprietary information of Microware Systems
*   Corporation.  Persons accessing this file will be held strictly
*   accountable for their use of the information herein.
*

*
*   OS9 Level 2 Pipe Definitions
*
*   Modification History
*   --------------------
*
*   Date        Who     Description
*   --------    ---     -----------------------------------------
*   12/03/88    cjb     Coded from new PIPEMAN comments
*

*
*   IOMan equates duplicated for PipeMan use
*

NPATHS  set     16      ;Maximum local paths per task -- must match IOMan
NameMax set     29      ;Maximum length of a file name

*
*   Device Driver Static Storage Layout
*
        org     V.User
V.List  rmb     2       ;Pointer to 1st pipe's pipe buffer
PManMem equ     .       ;Device driver memory (drive table equivalent)

*
*   Pipe Buffer Data Structure
*
        org     0
PP.PD   rmb     2       ;Pointer to shared path descriptor
PP.Next rmb     2       ;Pointer to next pipe buffer in system map
PP.Prev rmb     2       ;Pointer to previous pipe buffer in system map
PP.Rsrv rmb     2       ;Reserved
PP.Data equ     .       ;Data buffer begins at this offset

*
*   Unique Path Descriptor Variables
*
        org     PD.FST
*** PP.Read must have bit 4 clear; PP.Writ must be PP.Read XOR 4
PD.Read equ     .
PD.RPID rmb     1       ;Process ID of reader waiting on signal
PD.RCT  rmb     1       ;Number of blocked readers
PD.RSIG rmb     1       ;Signal to send reader
PD.REOR rmb     1       ;Read EOR character
PD.Writ equ     .
PD.WPID rmb     1       ;Process ID of writer waiting on signal
PD.WCT  rmb     1       ;Number of blocked writers
PD.WSIG rmb     1       ;Signal to send writer
PD.WEOR rmb     1       ;Write EOR character (dummy)
*** End of special section
PD.End  rmb     2       ;Pointer to end of pipe buffer
PD.NxtI rmb     2       ;Next in pointer
PD.NxtO rmb     2       ;Next out pointer
PD.RFlg rmb     1       ;"Ready" flag
PD.Wrtn rmb     1       ;"Written" flag
PD.BCnt rmb     2       ;# queue elements currently bufered
PD.Own  rmb     1       ;Process ID of pipe original creator
PD.Keep rmb     1       ;Non-zero if pipe has been kept open artificailly
PD.QSiz rmb     2       ;Max. elements in queue (copied from OPT section)

*
*   Path descriptor option section
*
*   Note that PD.Name overlaps with the last byte of PD.ECnt.
*   PD.ECnt is copied to PD.QSiz as part of OPEN or CREATE,
*   to make room for the pipe name.
*
        org     (PD.OPT+1)
PD.ESiz rmb     1       ;Size of each queue element
PD.ECnt rmb     2       ;Max. elements in queue (initial position)
        org     (PD.OPT+3)
PD.Name rmb     NameMax ;Name buffer for named pipe.

*
*   Device Descriptor definitions
*
IT.PDC  equ     $12     ;Pipe device class (like IT.DTP, IT.DVC)
        org     IT.PDC
        rmb     1       ;Leave room for device class
IT.ESiz rmb     1       ;Size of each queue element
IT.ECnt rmb     2       ;Max. elements in queue (initial position)

*   End of pipedefs

        opt     l

