FORKCNTRL       - FORK PROCESS CONTROL                           21-AUG-1978 19:48:34   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (1)      35  CREATE I/O DRIVER FORK PROCESS

   (2)      57  CREATE FORK PROCESS

   (3)      85  SOFTWARE INTERRUPT FORK DISPATCHER

FORKCNTRL       - FORK PROCESS CONTROL                           21-AUG-1978 19:48:34   VAX-11 MACRO X0.3-11               Page   1

01                                                                                                                               (1)



                                     0000     1 	.TITLE	FORKCNTRL - FORK PROCESS CONTROL

                                     0000     2 	.IDENT	/01/

                                     0000     3  

                                     0000     4 ;

                                     0000     5 ; COPYRIGHT (C) 1976

                                     0000     6 ; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

                                     0000     7 ;

                                     0000     8 ; THIS SOFTWARE IS FURNISHED UNDER  A LICENSE FOR USE ONLY  ON  A

                                     0000     9 ; SINGLE COMPUTER SYSTEM AND MAY BE  COPIED ONLY WITH  THE INCLU-

                                     0000    10 ; SION OF  THE  ABOVE  COPYRIGHT NOTICE.  THIS SOFTWARE,  OR  ANY

                                     0000    11 ; OTHER COPIES THEREOF, MAY NOT BE  PROVIDED  OR  OTHERWISE  MADE

                                     0000    12 ; AVAILABLE TO ANY OTHER PERSON EXCEPT  FOR  USE  ON  SUCH SYSTEM

                                     0000    13 ; AND TO  ONE WHO AGREES  TO  THESE LICENSE  TERMS.  TITLE TO AND

                                     0000    14 ; OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.

                                     0000    15 ;

                                     0000    16 ; THE INFORMATION IN THIS SOFTWARE  IS  SUBJECT TO CHANGE WITHOUT

                                     0000    17 ; NOTICE AND SHOULD NOT BE CONSTRUED  AS  A COMMITMENT BY DIGITAL

                                     0000    18 ; EQUIPMENT CORPORATION.

                                     0000    19 ;

                                     0000    20 ; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS

                                     0000    21 ; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

                                     0000    22 ;

                                     0000    23 ; D. N. CUTLER 9-AUG-76

                                     0000    24 ;

                                     0000    25 ; MODIFIED BY R.HEINEN ON 13-OCT-76; ALLOW FORK TO IPL 6

                                     0000    26 ; FORK CREATION AND DISPATCHING

                                     0000    27 ;

                                     0000    28 ; MACRO LIBRARY CALLS

                                     0000    29 ;

                                     0000    30  

                                     0000    31 	$FKBDEF				;DEFINE FKB OFFSETS

                                     0000    32 	$PRDEF				;DEFINE PROCESSOR REGISTERS

                                     0000    33 	$UCBDEF				;DEFINE UCB OFFSETS

FORKCNTRL       - FORK PROCESS CONTROL                           21-AUG-1978 19:48:34   VAX-11 MACRO X0.3-11               Page   2

01              CREATE I/O DRIVER FORK PROCESS                                                                                   (1)



                                     0000    35 	.SBTTL	CREATE I/O DRIVER FORK PROCESS

                                     0000    36 ;+

                                     0000    37 ; EXE$IOFORK - CREATE I/O DRIVER FORK PROCESS

                                     0000    38 ;

                                     0000    39 ; THIS ROUTINE IS CALLED BY AN I/O DRIVER TO CREATE A FORK PROCESS.

                                     0000    40 ;

                                     0000    41 ; INPUTS:

                                     0000    42 ;

                                     0000    43 ;	00(SP) = RETURN ADDRESS OF CALLER.

                                     0000    44 ;	04(SP) = RETURN ADDRESS OF CALLER'S CALLER.

                                     0000    45 ;

                                     0000    46 ;	R5 = UCB ADDRESS OF DEVICE UNIT.

                                     0000    47 ;

                                     0000    48 ; OUTPUTS:

                                     0000    49 ;

                                     0000    50 ;	***TBS***

                                     0000    51 ;-

                                     0000    52  

                                 00000000    53 	.PSECT	A$EXENONPAGED,LONG

                                     0000    54 EXE$IOFORK::				;CREATE I/O DRIVER FORK PROCESS

         58 A5            00     E5  0000    55 	BBCC	#UCB$V_TIM,UCB$W_STS(R5),EXE$FORK ;DISABLE TIMEOUT

                          00         0004       

FORKCNTRL       - FORK PROCESS CONTROL                           21-AUG-1978 19:48:34   VAX-11 MACRO X0.3-11               Page   3

01              CREATE FORK PROCESS                                                                                              (2)



                                     0005    57 	.SBTTL	CREATE FORK PROCESS

                                     0005    58 ;+

                                     0005    59 ; EXE$FORK - CREATE FORK PROCESS

                                     0005    60 ;

                                     0005    61 ; THIS ROUTINE IS CALLED TO CREATE A FORK PROCESS.

                                     0005    62 ;

                                     0005    63 ; INPUTS:

                                     0005    64 ;

                                     0005    65 ;	00(SP) = RETURN ADDRESS OF CALLER.

                                     0005    66 ;	04(SP) = RETURN ADDRESS OF CALLER'S CALLER.

                                     0005    67 ;

                                     0005    68 ;	R5 = ADDRESS OF FORK BLOCK.

                                     0005    69 ;

                                     0005    70 ; OUTPUTS:

                                     0005    71 ;

                                     0005    72 ;	***TBS***

                                     0005    73 ;-

                                     0005    74  

                                     0005    75 EXE$FORK::				;CREATE FORK PROCESS

         10 A5            53     7D  0005    76 	MOVQ	R3,FKB$L_FR3(R5)	;SAVE REGISTERS R3 AND R4

                       0C A5   8ED0  0009    77 	POPL	FKB$L_FPC(R5)		;SET FORK PROCESS PC

            54         0B A5     9A  000D    78 	MOVZBL	FKB$B_FIPL(R5),R4	;GET FORK IPL

            53       FFD0'CF44   7E  0011    79 	MOVAQ	W^SWI$GL_FQFL-<6*8>[R4],R3 ;GET ADDRESS OF FORK QUEUE LISTHEAD

         04 B3            65     0E  0017    80 	INSQUE	(R5),@4(R3)		;INSERT FORK BLOCK IN FORK QUEUE

                          03     12  001B    81 	BNEQ	10$			;IF NEQ NOT FIRST ENTRY IN QUEUE

                                     001D    82 	SOFTINT	R4			;INITIATE SOFTWARE INTERRUPT

                                 05  0020    83 10$:	RSB				;

FORKCNTRL       - FORK PROCESS CONTROL                           21-AUG-1978 19:48:34   VAX-11 MACRO X0.3-11               Page   4

01              SOFTWARE INTERRUPT FORK DISPATCHER                                                                               (3)



                                     0021    85 	.SBTTL	SOFTWARE INTERRUPT FORK DISPATCHER

                                     0021    86 ;+

                                     0021    87 ; EXE$FORKDSPTH - SOFTWARE INTERRUPT FORK DISPATCHER

                                     0021    88 ;

                                     0021    89 ; THIS ROUTINE IS AUTOMATICALLY VECTORED TO WHEN THE SOFTWARE INTERRUPT

                                     0021    90 ; PRIORITY ARBITRATION LOGIC IN THE CENTRAL PROCESSOR DETECTS A PENDING

                                     0021    91 ; INTERRUPT AT LEVEL 6, 7, 8, 9, 10, OR 11 AND THE CURRENT PRIORITY LEVEL IS

                                     0021    92 ; LOWER THAN THE PENDING LEVEL. THE STATE OF THE STACK ON ENTRY IS:

                                     0021    93 ;

                                     0021    94 ;	00(SP) = INTERRUPT PC.

                                     0021    95 ;	04(SP) = INTERRUPT PSL.

                                     0021    96 ;

                                     0021    97 ; FOR EACH OF THE LEVELS 6, 7, 8, 9, 10, AND 11, THERE EXISTS A QUEUE OF FORK

                                     0021    98 ; BLOCKS WAITING TO BE PROCESSED. WHEN A FORK BLOCK IS ENTERED IN ITS 

                                     0021    99 ; CORRESPONDING QUEUE AND IT IS THE FIRST TO BE ENTERED (I. E. THE QUEUE

                                     0021   100 ; WAS PREVIOUSLY EMPTY), A SOFTWARE INTERRUPT IS REQUESTED FOR THAT LEVEL.

                                     0021   101 ; THE FORK DISPATCHER GAINS CONTROL AND EMPTIES THE QUEUE ONE ENTRY AT A

                                     0021   102 ; TIME. AS EACH FORK IS DISPATCHED, REGISTERS R3 AND R4 ARE RESTORED FROM

                                     0021   103 ; THE FORK BLOCK AND THE FORK PROCESS IS CALLED VIA A JSB INSTRUCTION.

                                     0021   104 ; ON RETURN, THE FORK DISPATCHER RETRIEVES THE NEXT ENTRY FROM THE QUEUE

                                     0021   105 ; AND REPEATS THE DISPATCHING OPERATION. THIS PROCESS CONTINUES UNTIL

                                     0021   106 ; THERE ARE NO MORE FORKS TO DISPATCH AT WHICH TIME THE INTERRUPT IS

                                     0021   107 ; DISMISSED.

                                     0021   108 ;-

                                     0021   109  

                                     0021   110 	.ALIGN	LONG

                                     0024   111 EXE$FORKDSPTH::				;SOFTWARE INTERRUPT FORK DISPATCHER

                          3F     BB  0024   112 	PUSHR	#^M<R0,R1,R2,R3,R4,R5>	;SAVE FORK PROCESS REGISTER SET

            50            12     DB  0026   113 10$:	MFPR	#PR$_IPL,R0		;READ CURRENT IPL

            51       FFD0'CF40   7E  0029   114 	MOVAQ	W^SWI$GL_FQFL-<6*8>[R0],R1 ;GET ADDRESS OF FORK QUEUE LISTHEAD

            55            91     0F  002F   115 	REMQUE	@(R1)+,R5		;REMOVE NEXT ENTRY FROM FORK QUEUE

                          1A     1D  0032   116 	BVS	20$			;IF VS NO ENTRY REMOVED

            53         10 A5     7D  0034   117 	MOVQ	FKB$L_FR3(R5),R3	;RESTORE REGISTERS R3 AND R4

                                     0038   118  

                                     0038   119 ;

                                     0038   120 ; DISPATCH FORK PROCESS WITH:

                                     0038   121 ;

                                     0038   122 ;	R0 THRU R2 = SCRATCH REGISTERS.

                                     0038   123 ;	R3 AND R4 = RESTORED FROM FORK BLOCK.

                                     0038   124 ;	R5 = ADDRESS OF FORK BLOCK.

                                     0038   125 ;

                                     0038   126  

            51         0C A5     D0  0038   127 	MOVL	FKB$L_FPC(R5),R1	;SAVE DISPATCH ADDRESS

                          03     BB  003C   128 	PUSHR	#^M<R0,R1>		;SAVE IPL AND DISPATCH ADDRESS

                          61     16  003E   129 	JSB	(R1)			;DISPATCH FORK

                          03     BA  0040   130 	POPR	#^M<R0,R1>		;RESTORE IPL, DISPATCH ADDRESS

            52            12     DB  0042   131 	MFPR	#PR$_IPL,R2		;GET EXIT IPL

            52            50     D1  0045   132 	CMPL	R0,R2			;EXIT IPL MUST EQUAL ENTRY

                          DC     13  0048   133 	BEQL	10$			;GO AGAIN

                                     004A   134 

                                     004A   135 	BUG_CHECK BADFORKIPL,FATAL	;BAD FORK EXIT INTERRUPT PRIORITY LEVEL

                          3F     BA  004E   136 20$:	POPR	#^M<R0,R1,R2,R3,R4,R5>	;RESTORE FORK PROCESS REGISTER SET

                                 02  0050   137 	REI				;

                                     0051   138  

                                     0051   139 	.END

FORKCNTRL       - FORK PROCESS CONTROL                           21-AUG-1978 19:48:34   VAX-11 MACRO X0.3-11               Page   5

SYMBOL TABLE                                                                                                                     (3)



BIT...         = 00000000            SWI$GL_FQFL      ********   X   03   UCB$L_OPCNT      00000060            

BUG$_BADFORKIPL  ********   X   03   UCB$B_AMOD       00000053            UCB$L_OWNUIC     0000001C            

EXE$FORK         00000005 RG    03   UCB$B_CEX        00000077            UCB$L_PID        00000028            

EXE$FORKDSPTH    00000024 RG    03   UCB$B_CM1        0000004A            UCB$L_RQBL       00000004            

EXE$IOFORK       00000000 RG    03   UCB$B_CM2        0000004B            UCB$L_RQFL       00000000            

FKB$B_FIPL       0000000B            UCB$B_DEVCLASS   00000038            UCB$L_SVAPTE     00000068            

FKB$B_TYPE       0000000A            UCB$B_DEVTYPE    00000039            UCB$L_SVPN       00000064            

FKB$C_LENGTH     00000018            UCB$B_DIPL       00000052            UCB$L_TTCHAR     0000003C            

FKB$K_LENGTH     00000018            UCB$B_DX_SCTCNT  000000A6            UCB$L_VCB        00000030            

FKB$L_FPC        0000000C            UCB$B_ERTCNT     00000070            UCB$M_BACKP    = 00000020            

FKB$L_FQBL       00000004            UCB$B_ERTMAX     00000071            UCB$M_BSY      = 00000100            

FKB$L_FQFL       00000000            UCB$B_ESCAPE     0000004B            UCB$M_CANCEL   = 00000008            

FKB$L_FR3        00000010            UCB$B_FEX        00000076            UCB$M_DEADMO   = 00000400            

FKB$L_FR4        00000014            UCB$B_FIPL       0000000B            UCB$M_DELMBX   = 00000002            

FKB$W_SIZE       00000008            UCB$B_LOCSRV     0000003C            UCB$M_DIAGBUF  = 00000002            

GBL...         = 00000000            UCB$B_OFFNDX     00000094            UCB$M_DX_WRITE = 00000008            

PR$_ACCR       = 00000029            UCB$B_OFFRTC     00000095            UCB$M_ECC      = 00000001            

PR$_ACCS       = 00000028            UCB$B_REMSRV     0000003D            UCB$M_ERLOGIP  = 00000004            

PR$_ASTLVL     = 00000013            UCB$B_SECTORS    0000003C            UCB$M_INT      = 00000002            

PR$_ESP        = 00000001            UCB$B_SLAVE      00000074            UCB$M_INTTYPE  = 00000080            

PR$_ICCS       = 00000018            UCB$B_SPR        00000075            UCB$M_JOB      = 00000001            

PR$_ICR        = 0000001A            UCB$B_STATE      00000052            UCB$M_MOUNTING = 00000200            

PR$_IPL        = 00000012            UCB$B_TRACKS     0000003D            UCB$M_NOCNVRT  = 00000004            

PR$_ISP        = 00000004            UCB$B_TYPE       0000000A            UCB$M_NT_BFROVF= 00000004            

PR$_KSP        = 00000000            UCB$B_VERTSZ     0000003F            UCB$M_NT_BREAK = 00000020            

PR$_MAPEN      = 00000038            UCB$C_LENGTH     00000074            UCB$M_NT_NAME  = 00000010            

PR$_NICR       = 00000019            UCB$C_LOGLNK   = 00000001            UCB$M_ONLINE   = 00000010            

PR$_P0BR       = 00000008            UCB$K_LENGTH     00000074            UCB$M_POWER    = 00000020            

PR$_P0LR       = 00000009            UCB$L_AMB        00000054            UCB$M_PRMMBX   = 00000001            

PR$_P1BR       = 0000000A            UCB$L_ASTQBL     00000010            UCB$M_TIM      = 00000001            

PR$_P1LR       = 0000000B            UCB$L_ASTQFL     0000000C            UCB$M_TIMOUT   = 00000040            

PR$_PCBB       = 00000010            UCB$L_CPID       0000005C            UCB$M_TT_NOTIF = 00000004            

PR$_PME        = 0000003D            UCB$L_CRB        00000020            UCB$M_TT_TIMO  = 00000002            

PR$_RXCS       = 00000020            UCB$L_DDB        00000024            UCB$M_UNLOAD   = 00001000            

PR$_RXDB       = 00000021            UCB$L_DEVCHAR    00000034            UCB$M_VALID    = 00000800            

PR$_SBIER      = 00000034            UCB$L_DEVDEPEND  0000003C            UCB$S_LNKPRI   = 00000002            

PR$_SBIFS      = 00000030            UCB$L_DPC        00000080            UCB$S_LTYPE    = 00000002            

PR$_SBIMT      = 00000033            UCB$L_DUETIM     0000005C            UCB$T_PARTNER    0000000C            

PR$_SBIQC      = 00000036            UCB$L_DX_BFPNT   0000009C            UCB$V_BACKP    = 00000005            

PR$_SBIS       = 00000031            UCB$L_DX_BUF     00000098            UCB$V_BSY      = 00000008            

PR$_SBISC      = 00000032            UCB$L_DX_RXDB    000000A0            UCB$V_CANCEL   = 00000003            

PR$_SBITA      = 00000035            UCB$L_EMB        00000078            UCB$V_DEADMO   = 0000000A            

PR$_SBR        = 0000000C            UCB$L_FIRST      00000014            UCB$V_DELMBX   = 00000001            

PR$_SCBB       = 00000011            UCB$L_FPC        0000000C            UCB$V_DIAGBUF  = 00000001            

PR$_SID        = 0000003E            UCB$L_FQBL       00000004            UCB$V_DX_WRITE = 00000003            

PR$_SIRR       = 00000014            UCB$L_FQFL       00000000            UCB$V_ECC      = 00000000            

PR$_SISR       = 00000015            UCB$L_FR3        00000010            UCB$V_ERLOGIP  = 00000002            

PR$_SLR        = 0000000D            UCB$L_FR4        00000014            UCB$V_INT      = 00000001            

PR$_SSP        = 00000002            UCB$L_IOQBL      00000044            UCB$V_INTTYPE  = 00000007            

PR$_TBIA       = 00000039            UCB$L_IOQFL      00000040            UCB$V_JOB      = 00000000            

PR$_TBIS       = 0000003A            UCB$L_IRP        0000004C            UCB$V_LNKPRI   = 00000006            

PR$_TODR       = 0000001B            UCB$L_LINK       0000002C            UCB$V_LTYPE    = 00000000            

PR$_TXCS       = 00000022            UCB$L_LOGADR     00000064            UCB$V_MOUNTING = 00000009            

PR$_TXDB       = 00000023            UCB$L_MAXBLOCK   00000084            UCB$V_MSGACK   = 00000004            

PR$_USP        = 00000003            UCB$L_MEDIA      0000008C            UCB$V_MSGFLO   = 00000003            

PR$_WCSA       = 0000002C            UCB$L_NT_DATSSB  00000074            UCB$V_NOCNVRT  = 00000002            

PR$_WCSD       = 0000002D            UCB$L_NT_INTSSB  00000078            UCB$V_NT_BFROVF= 00000002            

FORKCNTRL       - FORK PROCESS CONTROL                           21-AUG-1978 19:48:34   VAX-11 MACRO X0.3-11               Page   6

SYMBOL TABLE                                                                                                                     (3)



UCB$V_NT_BREAK = 00000005            

UCB$V_NT_NAME  = 00000004            

UCB$V_ONLINE   = 00000004            

UCB$V_POWER    = 00000005            

UCB$V_PRMMBX   = 00000000            

UCB$V_SEGFLO   = 00000002            

UCB$V_TIM      = 00000000            

UCB$V_TIMOUT   = 00000006            

UCB$V_TT_NOTIF = 00000002            

UCB$V_TT_TIMO  = 00000001            

UCB$V_UNLOAD   = 0000000C            

UCB$V_VALID    = 0000000B            

UCB$W_BCNT       0000006E            

UCB$W_BCR        00000096            

UCB$W_BOFF       0000006C            

UCB$W_BUFQUO     00000018            

UCB$W_BYTESTOGO  0000003E            

UCB$W_CHARGE     0000004A            

UCB$W_CYLINDERS  0000003E            

UCB$W_DA         0000008C            

UCB$W_DC         0000008E            

UCB$W_DEVBUFSIZ  0000003A            

UCB$W_DEVSTS     0000005A            

UCB$W_DIRSEQ     00000088            

UCB$W_DSTADDR    00000018            

UCB$W_DX_BCR     000000A4            

UCB$W_EC1        00000090            

UCB$W_EC2        00000092            

UCB$W_ERRCNT     00000072            

UCB$W_FUNC       0000007E            

UCB$W_MB_SEED    FFFFFFFC            

UCB$W_MSGCNT     00000016            

UCB$W_MSGMAX     00000014            

UCB$W_NT_CHAN    0000007C            

UCB$W_OFFSET     0000008A            

UCB$W_REFC       00000050            

UCB$W_SIZE       00000008            

UCB$W_SRCADDR    0000001A            

UCB$W_STS        00000058            

UCB$W_UNIT       00000048            

UCB$W_VPROT      0000001A            





PROGRAM SECTION SYNOPSIS



.  ABS  .        00000000      00     NOPIC   USR   CON   ABS   LCL NOSHR NOEXE NORD  NOWRT BYTE  

. BLANK .        00000000      01     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  

$ABS$            FFFFFFFE      02     NOPIC   USR   CON   ABS   LCL NOSHR   EXE   RD    WRT BYTE  

A$EXENONPAGED    00000051      03     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT LONG  





THERE WERE NO ERRORS OR WARNINGS.

18376. BYTES LEFT IN FREE MEMORY POOL.

3674. BYTES OF RECLAIMED MEMORY.

OBJ$:FORKCNTRL,LIS$:FORKCNTRL/-SP=EXECML$/ML,SRC$:FORKCNTRL

4 MLB DIR RDS - 399 GETS TO DEFINE 14 MACROS. 22 INTER. FILE WRITES. 

