$ EJECT
; type definitions and values for PI-3 monitor and IMC as described
; in the reference manuals

; Revision history:
; @(#)pi3.dcl	1.1 ((c) RC International) 11/7/89
; 840208: Archived on RC890-ARK-01 as PI3DCL.01
; 840320: fault codes added for arithmetic errors
; 840530: Archived on RC890-ARK-003 as PI3DCL.02
; 840604: shielded type shared added
; 840820: Archived on RC890-ARK-004 as PI3DCL.03
; 840918: handling of local references added (larger process descriptor)
; 850205: Archived on RC890-ARK-005 as PI3DCL.04
; 850215: cleanup fields for heap added to process descriptor (only if RTP)
; 850510: fault code F_NEWMEM added
; 850619: file renamed as PI3X.DCL after introduction of RTP switch
; 850619: Archived on RC890-ARK-007 as PI3XDCL.01
; 850704: test on RTP switch removed and name changed back to PI3.DCL
; 850829: Archived on RC890-ARK-007 as PI3DCL.06
; 860226: New faultcode F_MEMERROR
; 860304: Change in process structure: prev_process renamed to PI3mode
;         forward and backward inserted as 2 words
; 860306: Archived on RC890-ARK-010 as PI3DCL.07
; 860602: PI3mode split to 2 byte variables MB_window and PI3mode
; 860825: New type for poolparam values: pp_
; 861022: Archived on RC890-ARK-012 as PI3DCL.08
; 881028: fault code F_OPENREJECT added (ASA)
; 891107: First SCCS version

chains         STRUC
  forward        DW ?
  backward       DW ?
chains         ENDS

mailbox        STRUC
  mbx            DW 0
  s              DW 0
  m_next         DD ?
mailbox        ENDS

reference      STRUC
  topbuf         DW 0
  locked         DW -1
  r_next         DD ?
reference      ENDS

local_ref      STRUC
                 DB 8 DUP (?)
  r_mark         DW ?
local_ref      ENDS

$ EJECT
chain          STRUC
  curbuf         DW 0
  c_locked       DW -1
  stpoint        DW ?
  c_length       DW ?
  c_next         DD ?
chain          ENDS

semaphore      STRUC
  sem            DW 0
  s_s            DW 0
  s_next         DD ?
semaphore      ENDS

pool           STRUC
  p_mbx          DW 0
  p_s            DW 0
  p_size         DW -1
  mem            DB ?
  p_bufs         DW ?
  p_next         DD ?
pool           ENDS

process        STRUC
  procvar        DW 0
  pr_next        DD ?
process        ENDS

port           STRUC
  prt            DW 0
  prt_state      DB 0
  prt_next       DD ?
port           ENDS

shared         STRUC
  dataptr        DD ?
  c              DW 0
  sh_next        DD ?
shared         ENDS

$ EJECT
internal_LBDR  STRUC
  entrypoint     DW ?
  linetable      DW 0
  globalsize     DW 0
  appetite       DW 0
internal_LBDR  ENDS

external_LBDR  STRUC
                 DW ?
                 DW 0
                 DW ?
                 DW ?
  segsize        DW ?
  linkcount      DB 0
  LBDR_next      DD ?
  blname         DB 12
                 DB '            '
  blkind         DB 1
external_LBDR  ENDS

program_descriptor STRUC
  s_state        DB ?
  paramdesc      DD ?
  poolparam      DB 0
  LBDR           DD ?
  prgname        DB 12
                 DB '            '
  sp_count       DW 0
  paramptr       DD ?
  noparams       DB ?
  sp_next        DD ?
program_descriptor ENDS

$ EJECT
process_descriptor STRUC
                 DW 0 ; forward
                 DW 0 ; backward
  p_state        DB 0
  actvtn         DB 0
  waitref        DD 0
  waitmbx        DD 0
  timerlink      DW 0
  timer          DW 0
  faultcode      DW 0
  callframe      DW 0
  excentry       DD 0
  stacksize      DW 0
  stackbound     DW 0
  SPt            DW 0
  prog           DW 0
  parent         DW 0
  procname       DB 4,'    '
  priority       DB 0
  next_process   DW 0
  MB_window      DB 0
  PI3mode        DB 0
; the remaining fields are heads of cleanup chains
  mbxshead       DD 0
  refshead       DD 0
  locrefshead    DD 0
  locrefsmark    DW 0
  chainshead     DD 0
  semaphshead    DD 0
  poolshead      DD 0
  procshead      DD 0
  portshead      DD 0
  subprogshead   DD 0
  shareshead     DD 0
  newshead	 DW 0
  newssmall	 DW 0
  imc_ref        DB SIZE reference DUP(0)
process_descriptor ENDS

$ EJECT
attribute_part STRUC
                 DB  SIZE chains DUP(?)
  datasize       DW ?
  dataoffset     DW ?
  datapart       DW ?
  top            DW ?
  bytecount      DW ?
  returnaddr     DD ?
  home           DD ?
  eventkind      DB ?
  index          DB ?
  creditcount    DB ?
  reason         DB ?
  u1             DB ?
  u2             DB ?
  u3             DB ?
  u4             DB ?
  stack          DW ?
  depth          DW ?
  bufcount       DW ?
  b_next         DW ?
                 DB  5 DUP(?)
  wb             DB ?
  w1             DW ?
  w2             DW ?
attribute_part ENDS

$ EJECT
; fault codes

F_NIL        EQU 1
F_NOTNIL     EQU 2
F_LOCKED     EQU 3
F_EMPTY      EQU 4
F_ALREADY    EQU 5
F_NOTINIT    EQU 6
F_UNLINKED   EQU 7
F_POOL       EQU 8
F_DEEP       EQU 9
F_BADLEVEL   EQU 11
F_STSIZE     EQU 12
F_DIV0       EQU 13
F_OVERFLOW   EQU 14
F_MEMERROR   EQU 15
F_NEWMEM     EQU 18
F_CEPRANGE   EQU 21
F_CEPSTATE   EQU 22
F_STRING     EQU 23
F_CONS       EQU 24
F_AREA       EQU 25
F_NOTRCVALL  EQU 26
F_ROOM       EQU 27
F_OPENREJECT EQU 28
F_STACK      EQU 41

$ EJECT
; results from PI-3 calls

; results from combined waits

a_buffer    EQU 0
a_mailbox   EQU 0
a_timeout   EQU 1
a_delay     EQU 1
a_semaphore EQU 2
a_interrupt EQU 3

; results from load

LOAD_OK     EQU 0
LOAD_FILE   EQU 1
LOAD_FORMAT EQU 2
LOAD_MEMORY EQU 3
LOAD_SEARCH EQU 4

; results from link

LINK_OK      EQU 0
LINK_ALREADY EQU 5
LINK_PROGRAM EQU 6

; results from unlink

UNLINK_OK        EQU 0
UNLINK_NOTLINKED EQU 1
UNLINK_INCSEXIST EQU 2

; results from create

CREATE_OK     EQU 0
CREATE_MEMORY EQU 1

; program states

unlinked   EQU 0
linked     EQU 1
internal   EQU 2

$ EJECT
; memory kinds

MEM_PRIVATE        EQU 0
MEM_DUALPORT       EQU 1
MEM_BOARD          EQU 2

; event kinds

NOT_EVENT          EQU   0
MESSAGE_EVENT      EQU   1
ANSWER_EVENT       EQU   2
REMOVED_EVENT      EQU   3
PORT_CLOSED        EQU   4
DISCONNECTED       EQU   5
LETTER_SENT        EQU   6
LETTER_ARRIVED     EQU   7
LOCAL_CONNECT      EQU   8
REMOTE_CONNECT     EQU   9
RESET_INDICATION   EQU  10
RESET_COMPLETION   EQU  11
CREDIT             EQU  12
DATA_SENT          EQU  13
DATA_ARRIVED       EQU  14
DATA_OVERRUN       EQU  15
DUMMY_LETTER       EQU  16
DUMMY_LCNCT        EQU  17
DUMMY_RCNCT        EQU  18
DUMMY_RINDIC       EQU  19
DUMMY_RCMPL        EQU  20
DUMMY_CREDIT       EQU  21
DUMMY_SENT         EQU  22
DUMMY_ARRIVED      EQU  23
MSL_message        EQU  24
MSL_answer         EQU  25
TEST_event         EQU  26

$ EJECT
; event reasons

R_OK               EQU   0
R_NAME             EQU   1
R_RESOURCE         EQU   2
R_CLOSED           EQU   3
R_NETWORK          EQU   4

mslopen            EQU   0
mslreceive         EQU   1
mslsend            EQU   2
mslmessage         EQU   5
mslreturn          EQU   6
mslchange          EQU   1

anonymous          EQU   0
local              EQU   1
regional           EQU   2
global             EQU   3

st_closed          EQU   0
st_open            EQU   1
st_closing         EQU   2

; connection service

cs_normal          EQU   0
cs_high            EQU   1

pp_pool            EQU   1
pp_namer           EQU   2
