.th ipc_block IIa 4/21/86
.sh NAME
ipc_block - inter-process communication messages
.sh SYNOPSIS
.nf
 msg_limit  = 11;  

 msg_struct = ARRAY 0:msg_limit OF char; 

 ipc_block = RECORD

       ipc_seid: seid;        
       ipc_msg : msg_struct   
 END;
.fi
.sh DESCRIPTION
An ipc_block is the general form for all the different types of
inter-process communication messages (e.g.  signals and IPC's).
Messages can be generated by the Kernel, by the users process or by other
processes.
.s2
The ipc_seid contains the seid of the process which sent the ipc_block.
.s2
The ipc_msg contains the text of the ipc_block.
.s2
The first byte of the ipc_msg, by convention, is the event type.  This
field and the ipc_seid determine the message type.  The following
event types are predefined and can not be used for other purposes.  All
other event type numbers can be used by cooperating processes as they
wish.

.ta 0.5i 2.5iR 3.0i
.Ct     null_event         0     ""
.Ct     memerr_event       1     "memory error"
.Ct     bpt_event          2     "break point trap instruction"
.Ct     iot_event          3     "input output trap instruction"
.Ct     cpuerror_event     4     "cpu error          "
.Ct     illinst_event      5     "illegal instruction "
.Ct     mm_event           6     "memory management    "
.Ct     fltpnt_event       7     "floating point processor"
.Ct     ttoggle_event      10    "timer toggle   "
.Ct     talarm_event       11    "timer alarm     "
.Ct     baselevel_event    12    "reserved        "
.Ct     iocomplete_event   13    "I/O completion  "
.dt

.sh "Kernel Generated Messages"
.s3
This type of message can only be generated by the Kernel.
These messages
always come through the hardware pseudo-interrupt-channel.
The
seid
field contains the Kernel seid.
The event type must be one of the following:

.ta 2.5i
.Ct     memerr_event
.Ct        bpt_event
.Ct        iot_event
.Ct        cpuerror_event
.Ct        illinst_event
.Ct        mm_event
.Ct        fltpnt_event
.dt

The time of the pseudo-interrupt is placed in the last four bytes of the
ipc_msg.
.s2
The floating point processor message also
has its status register stored in bytes
2 and 3 of the
ipc_msg.
.sh "Messages on the Behalf of Your Process"
.s3
These messages can only be generated by some action to or by your
process.
.s2
The
seid
field contains the Kernel seid except I/O completion which
contains the process seid.
Messages of this type have the following event types:

.ta 2.5i
.Ct     ttoggle_event
.Ct     talarm_event
.Ct     iocomplete_event
.dt
.s3
The timer and I/O completion come through their respective
pseudo-interrupt vectors.
.s2
An I/O completion message occurs asynchronously after your process
initiates an I/O requesting such a message.
The timer messages can be caused either by your process or by
another process setting the timer related fields in the
process status block.
.s2
The last four bytes of the timer messages
contain the time that the pseudo-interrupt occurred.

The I/O completion message has the following structure:
.nf
.ft BM

	RECORD
	    event_type : char;
	    stat       : ioStatus
	    byteCount  : cardinal;
	    async      : cardinal;
	    filler     : ARRAY 1:2 OF char;
	END;
.ft R
.fi
where :
.s3
.lp 20 14
.In event_type
has the value of
iocomplete_event.
.s3
.lp 20 14
.In stat.devIndep
contains the device independent completion status.  This
field is valid for all I/O completion messages.
.s3
.lp 20 14
.In stat.devDep
contains the device dependent completion status.  This
field is valid only for special devices.  The meaning of
this field can be found with the supported device manual
pages.
.s3
.lp 20 14
.In byteCount
is the number of characters transferred by this asynchronous
request.
.s3
.lp 20 14
.In async
is the user supplied asynchronous identifier.
.i0
.sh "Messages generated by Processes"
.s3
Messages of this type are sent using
K_signal
or
K_post
and are received either through the pseudo-interrupt vectors or by
K_receive.
The seid field contains the sending process seid.
The
ipc_msg
record can contain anything.  By convention,
the first byte contains the event
type.
.sh "SEE ALSO"
ioStatus (IIa),
Seid (IIa),
Pseudo_int_vector (IIa),
K_post (II),
K_signal (II),
K_receive (II)
