SWAPFILE        - SWAP FILE ALLOCATION/DEALLOCATION              21-AUG-1978 20:12:12   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (1)    4100  DECLARATIONS

   (1)   12200  SWP$ALLOC - ALLOCATE SWAP FILE SLOT

   (1)   17300  SWP$DALLOC - DEALLOCATE SWAP FILE SLOT

SWAPFILE        - SWAP FILE ALLOCATION/DEALLOCATION              21-AUG-1978 20:12:12   VAX-11 MACRO X0.3-11               Page   1

02                                                                                                                               (1)



                                     0000   100 	.TITLE	SWAPFILE - SWAP FILE ALLOCATION/DEALLOCATION

                                     0000   200 	.IDENT	/02/

                                     0000   300 

                                     0000   400 ;

                                     0000   500 ; COPYRIGHT (C) 1978

                                     0000   600 ; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS 01754

                                     0000   700 ;

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

                                     0000   900 ; COMPUTER  SYSTEM AND  MAY BE  COPIED ONLY WITH  THE INCLUSION OF THE

                                     0000  1000 ; ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE, OR ANY OTHER COPIES THEREOF,

                                     0000  1100 ; MAY NOT BE PROVIDED OR  OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON

                                     0000  1200 ; EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE

                                     0000  1300 ; TERMS.  TITLE TO AND  OWNERSHIP OF THE  SOFTWARE  SHALL AT ALL TIMES

                                     0000  1400 ; REMAIN IN DEC.

                                     0000  1500 ;

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

                                     0000  1700 ; AND SHOULD  NOT BE CONSTRUED  AS A COMMITMENT  BY DIGITAL  EQUIPMENT

                                     0000  1800 ; CORPORATION.

                                     0000  1900 ;

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

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

                                     0000  2200 ;

                                     0000  2300 

                                     0000  2400 ;++

                                     0000  2500 ; FACILITY: EXECUTIVE, SWAPPER

                                     0000  2600 ;

                                     0000  2700 ; ABSTRACT:

                                     0000  2800 ;	SWAPFILE ALLOCATES AND DEALLOCATES SPACE IN THE SWAPPING FILE.

                                     0000  2900 ;

                                     0000  3000 ;

                                     0000  3100 ; ENVIRONMENT:

                                     0000  3200 ;	MODE=KERNEL	NON-PAGED

                                     0000  3300 ;

                                     0000  3400 ; AUTHOR: R. I. HUSTVEDT 	CREATION DATE: 21-MAR-77

                                     0000  3500 ;

                                     0000  3600 ; MODIFIED BY:

                                     0000  3700 ;

                                     0000  3800 ;	, : VERSION

                                     0000  3900 ; 01	- 

                                     0000  4000 ;--

                                     0000  4100 	.SBTTL	DECLARATIONS

                                     0000  4200 ;

                                     0000  4300 ; INCLUDE FILES:

                                     0000  4400 ;

                                     0000  4500 	$DYNDEF				; DEFINE DYNAMIC DATA STRUCTURE TYPES

                                     0000  4600 	$PFLDEF				; DEFINE PAGE FILE CONTROL BLOCK

                                     0000  4700 	$PTRDEF				; DEFINE POINTER CONTROL BLOCK

                                     0000  4800 	$SFTDEF				; DEFINE SWAP FILE TABLE OFFSETS

                                     0000  4900 	$SGNDEF				; DEFINE SYSGEN VALUES

                                     0000  5000 

                                     0000  5100 ;

                                     0000  5200 ; MACROS:

                                     0000  5300 ;

                                     0000  5400 

                                     0000  5500 ;

                                     0000  5600 ; EQUATED SYMBOLS:

                                     0000  5700 ;

SWAPFILE        - SWAP FILE ALLOCATION/DEALLOCATION              21-AUG-1978 20:12:12   VAX-11 MACRO X0.3-11               Page   2

02              DECLARATIONS                                                                                                     (1)



                                     0000  5800 

                                     0000  5900 ;

                                     0000  6000 ; OWN STORAGE:

                                     0000  6100 ;

                                 00000000  6200 	.PSECT	$$$220,LONG		; SWAPPER/SCHEDULER DATA

                                     0000  6300 	.ALIGN	LONG			;

                                     0000  6400 

                                     0000  6500 	ASSUME	PFL$C_LENGTH EQ SFT$C_LENGTH

                                     0000  6600 	ASSUME	PFL$L_WINDOW EQ SFT$L_WINDOW

                                     0000  6700 	ASSUME	PFL$L_VBN EQ SFT$L_VBN

                                     0000  6800 

                                     0000  6900 SWP$GL_SFTBAS::				; BASE OF SFT ENTRIES

                                     0000  7000 	.REPT	SGN$C_SFTMAX		; NUMBER OF SWAP FILE ENTRIES

                                     0000  7100 	.BYTE	0			; SLOT COUNT

                                     0000  7200 	.BYTE	127			; I/O SIZE LIMIT

                                     0000  7300 	.WORD	SGN$C_MAXWSCNT		; SIZE OF SLOT

                                     0000  7400 	.BLKL	1

                                     0000  7500 	.WORD	SFT$C_LENGTH

                                     0000  7600 	.BYTE	DYN$C_SFT

                                     0000  7700 	.BYTE	0

                                     0000  7800 	.BLKB	SFT$C_LENGTH-12

                                     0000  7900 	.ENDR				;

                                     0060  8000 

                                     0060  8100 MMG$A_PAGFIL::				; PAGING FILE ARRAY BASE

                           00000064' 0060  8200 	.LONG	10$			; BITMAP POINTER

                           00000000  0064  8300 10$:	.LONG	0			; STARTING BYTE

                               0020' 0068  8400 	.WORD	PFL$C_LENGTH

                                 23' 006A  8500 	.BYTE	DYN$C_PFL

                                 00  006B  8600 	.BYTE	0			; PAGE FAULT CLUSTER

                           00000000  006C  8700 	.LONG	0			; WINDOW POINTER

                           00000000  0070  8800 	.LONG	0			; VBN

                           00000001  0074  8900 	.LONG	1			; BITMAP SIZE

                           FFFFFFFF  0078  9000 	.LONG	-1			; FREPAGCNT

                           FFFFFFFF  007C  9100 	.LONG	-1			; RESERVATION COUNT

                                     0080  9200 

                           00000084' 0080  9205 	.LONG	20$			; BITMAP LOCATION

                           00000000  0084  9210 20$:	.LONG	0			; STARTING BYTE

                               0020' 0088  9215 	.WORD	PFL$C_LENGTH		;STRUCTURE LENGTH

                                 23' 008A  9220 	.BYTE	DYN$C_PFL		; AND TYPE CODE

                                 00  008B  9225 	.BYTE	0			; PAGE FAULT CLUSTER

                           00000000  008C  9230 	.LONG	0			; WINDOW POINTER

                           00000000  0090  9235 	.LONG	0			; BASE VBN

                           00000001  0094  9240 	.LONG	1 			; BITMAP SIZE IN BYTES

                           FFFFFFFF  0098  9245 	.LONG	-1			; FREPAGCNT

                           FFFFFFFF  009C  9250 	.LONG	-1			; RESERVATION COUNT

                                     00A0  9255 

                                     00A0  9300 

                           00000003  00A0  9400 SGN$C_PFLIBAS==SGN$C_SFTMAX		; BASE INDEX FOR PAGING FILES

                           00000002  00A0  9500 SGN$C_PAGFILCNT==2			; COUNT OF PAGING FILES

                                     00A0  9600 

                                     00A0  9700 ;

                                     00A0  9800 ; POINTER TO VECTOR OF PAGE/SWAP FILE CONTROL BLOCKS

                                     00A0  9900 ;

                           00000005  00A0 10000 	PTR...=SGN$C_SFTMAX+SGN$C_PAGFILCNT

                                     00A0 10050 

                                     00A0 10100 MMG$GL_PAGSWPVC::

                           000000B4' 00A0 10200 	.LONG	10$

SWAPFILE        - SWAP FILE ALLOCATION/DEALLOCATION              21-AUG-1978 20:12:12   VAX-11 MACRO X0.3-11               Page   3

02              DECLARATIONS                                                                                                     (1)



                                     00A4 10300 ;

                                     00A4 10400 ; DEFINE A POINTER CONTROL BLOCK

                                     00A4 10500 ;

                           000000AC  00A4 10600 	.BLKL	2

                               0024  00AC 10700 	.WORD	PTR...*4+16

                                 25  00AE 10800 	.BYTE	DYN$C_PTR

                                 24  00AF 10900 	.BYTE	DYN$C_SFT		;POINTS TO SFT'S AND PFL'S

                           00000005  00B0 11000 	.LONG	PTR...

                                     00B4 11100 ;

                                     00B4 11200 ; GENERATE THE VECTOR

                                     00B4 11300 ;

                                     00B4 11400 10$:

                           00000000  00B4 11500 	CNT...=0

                                     00B4 11600 	.REPT	PTR...

                                     00B4 11700 	.LONG	SWP$GL_SFTBAS+<CNT...*SFT$C_LENGTH>

                                     00B4 11800 	CNT...=CNT...+1

                                     00B4 11900 	.ENDR

                                     00C8 12000 

SWAPFILE        - SWAP FILE ALLOCATION/DEALLOCATION              21-AUG-1978 20:12:12   VAX-11 MACRO X0.3-11               Page   4

02              SWP$ALLOC - ALLOCATE SWAP FILE SLOT                                                                              (1)



                                     00C8 12200 	.SBTTL	SWP$ALLOC - ALLOCATE SWAP FILE SLOT

                                     00C8 12300 ;++

                                     00C8 12400 ; FUNCTIONAL DESCRIPTION:

                                     00C8 12500 ;	SWP$ALLOC SCANS THE SET OF SWAP FILE TABLES AND ALLOCATES THE FIRST

                                     00C8 12600 ;	AVAILABLE SLOT IN THE FIRST NON-EMPTY SWAPPING FILE.

                                     00C8 12700 ;

                                     00C8 12800 ; CALLING SEQUENCE:

                                     00C8 12900 ;	BSB/JSB	SWP$ALLOC

                                     00C8 13000 ;

                                     00C8 13100 ; INPUT PARAMETERS:

                                     00C8 13200 ;	NONE

                                     00C8 13300 ;

                                     00C8 13400 ; IMPLICIT INPUTS:

                                     00C8 13500 ;	NONE

                                     00C8 13600 ;

                                     00C8 13700 ; OUTPUT PARAMETERS:

                                     00C8 13800 ;	R2 - SWAP FILE NUMBER, STARTING VBN

                                     00C8 13900 ;

                                     00C8 14000 ; IMPLICIT OUTPUTS:

                                     00C8 14100 ;	NONE

                                     00C8 14200 ;

                                     00C8 14300 ; COMPLETION CODES:

                                     00C8 14400 ;	NONE

                                     00C8 14500 ;

                                     00C8 14600 ; SIDE EFFECTS:

                                     00C8 14700 ;	NONE

                                     00C8 14800 ;

                                     00C8 14900 ;--

                                     00C8 15000 

                                 00000000 15100 	.PSECT	$AEXENONPAGED		;

                                     0000 15200 

                                     0000 15300 SWP$ALLOC::				; ALLOCATE SWAP FILE SLOT

            50       0000'CF     DE  0000 15400 	MOVAL	W^SWP$GL_SFTBAS,R0	; POINT TO FIRST SWAP FILE TABLE

                          52     7C  0005 15500 	CLRQ	R2			; INIT SWAP FILE NUMBER AND BIT NO.

            20            52     EA  0007 15600 10$:	FFS	R2,#32,SFT$L_BITMAP(R0),R2	; FIND AN AVAILABLE SLOT

            52         14 A0         000A       

                          18     13  000D 15700 	BEQL	30$			; NONE SO FAR

         14 A0            52     E5  000F 15800 	BBCC	R2,SFT$L_BITMAP(R0),30$	; MARK SLOT ALLOCATED

                          13         0013       

            51         02 A0     3C  0014 15900 20$:	MOVZWL	SFT$W_SLOTSZ(R0),R1	; GET SIZE OF SLOT IN BLOCKS

            52            51     C4  0018 16000 	MULL	R1,R2			; CONVERT SLOT NUMBER TO BLOCK NUMBER

                          52     D6  001B 16100 	INCL	R2			; AND MAKE ONE ORIGIN

            18            53     F0  001D 16200 	INSV	R3,#24,#8,R2		; INSERT SWAP FILE NUMBER

            52            08         0020       

                     0000'CF     D7  0022 16250 	DECL	W^SWP$GL_SLOTCNT	; ONE LESS AVAILABLE SLOT

                                 05  0026 16300 	RSB				; AND RETURN

                                     0027 16400 

            60            52     91  0027 16500 30$:	CMPB	R2,SFT$B_SLTCNT(R0)	; ANY MORE IN THIS FILE?

                          DB     1F  002A 16600 	BLSSU	10$			; YES,

                          52     D4  002C 16700 	CLRL	R2			; RESET BIT POINTER FOR NEXT SWAPFILE

            50            20     C0  002E 16800 	ADDL	#SFT$C_LENGTH,R0	; POINT TO NEXT SWAP FILE TABLE

            53            03     F2  0031 16900 	AOBLSS	S^#SGN$C_SFTMAX,R3,10$	; TRY ALL SWAP FILES FOR SPACE

                          D2         0034       

                                 05  0035 17000 	RSB				; FAILURE RETURN

                                     0036 17100 

SWAPFILE        - SWAP FILE ALLOCATION/DEALLOCATION              21-AUG-1978 20:12:12   VAX-11 MACRO X0.3-11               Page   5

02              SWP$DALLOC - DEALLOCATE SWAP FILE SLOT                                                                           (1)



                                     0036 17300 	.SBTTL	SWP$DALLOC - DEALLOCATE SWAP FILE SLOT

                                     0036 17400 ;++

                                     0036 17500 ;

                                     0036 17600 ; FUNCTIONAL DESCRIPTION:

                                     0036 17700 ;	SWP$DALLOC DEALLOCATES A SWAP FILE SLOT AND MAKES ITS SPACE

                                     0036 17800 ;	AVAILABLE FOR SUBSEQUENT USE.

                                     0036 17900 ;

                                     0036 18000 ; CALLING SEQUENCE:

                                     0036 18100 ;	BSB/JSB	SWP$DALLOC

                                     0036 18200 ;

                                     0036 18300 ; INPUT PARAMETERS:

                                     0036 18400 ;	R2 - SWAP FILE NUMBER, SWAP FILE VBN

                                     0036 18500 ;

                                     0036 18600 ; OUTPUT PARAMETERS:

                                     0036 18700 ; 	NONE

                                     0036 18800 ;

                                     0036 18900 ; IMPLICIT OUTPUTS:

                                     0036 19000 ;	SFT SPECIFIED BY THE INPUT SWAP FILE ADDRESS WILL HAVE A BIT

                                     0036 19100 ;	SET TO INDICATE THE AVAILABILITY OF THE SWAP SLOT.

                                     0036 19200 ;

                                     0036 19300 ;--

                                     0036 19400 

                                     0036 19500 SWP$DALLOC::				; DEALLOCATE SWAP FILE SLOT

            08            18     EF  0036 19600 	EXTZV	#24,#8,R2,R1		; GET SWAP FILE NUMBER

            51            52         0039       

            51            20     C4  003B 19700 	MULL	#SFT$C_LENGTH,R1	; COMPUTE OFFSET TO SFT ENTRY

            50       0000'CF41   9E  003E 19800 	MOVAB	W^SWP$GL_SFTBAS[R1],R0	; BASE OF PROPER SWAP FILE TABLE

                          52     D7  0044 19900 	DECL	R2			; REMOVE VBN BIAS FOR 1 ORIGIN

            18            00     EF  0046 20000 	EXTZV	#0,#24,R2,R1		; EXTRACT BLOCK NUMBER

            51            52         0049       

            53         02 A0     3C  004B 20100 	MOVZWL	SFT$W_SLOTSZ(R0),R3	; GET SLOT SIZE

            51            53     C6  004F 20200 	DIVL	R3,R1			; COMPUTE BIT NUMBER IN SFT BITMAP

         14 A0            51     E2  0052 20300 	BBSS	R1,SFT$L_BITMAP(R0),10$	; MARK BIT AVAILABLE

                          05         0056       

                     0000'CF     D6  0057 20350 	INCL	W^SWP$GL_SLOTCNT	; ONE MORE AVAILABLE SLOT

                                 05  005B 20400 	RSB				; AND RETURN

                                     005C 20500 

                                     005C 20600 10$:	BUG_CHECK DOUBLDALOC,FATAL	; DOUBLE DEALLOCATION OF SWAP FILE SPACE

                                     0060 20700 

                                     0060 20800 	.END

SWAPFILE        - SWAP FILE ALLOCATION/DEALLOCATION              21-AUG-1978 20:12:12   VAX-11 MACRO X0.3-11               Page   6

SYMBOL TABLE                                                                                                                     (1)



BIT...         = 00000000            PTR$B_TYPE       0000000A            

BUG$_DOUBLDALOC  ********   X   04   PTR$L_PTR0       00000010            

CNT...         = 00000005            PTR$L_PTRCNT     0000000C            

DYN$C_ACB      = 00000002            PTR$W_SIZE       00000008            

DYN$C_ADP      = 00000001            PTR...         = 00000005            

DYN$C_AQB      = 00000003            SFT$B_IOSZ       00000001            

DYN$C_BRDCST   = 0000001A            SFT$B_PFC        0000000B            

DYN$C_BUFIO    = 00000013            SFT$B_SLTCNT     00000000            

DYN$C_CEB      = 00000004            SFT$B_TYPE       0000000A            

DYN$C_CRB      = 00000005            SFT$C_LENGTH     00000020            

DYN$C_CXB      = 0000001B            SFT$K_LENGTH     00000020            

DYN$C_DDB      = 00000006            SFT$L_BITMAP     00000014            

DYN$C_DPT      = 0000001E            SFT$L_VBN        00000010            

DYN$C_FCB      = 00000007            SFT$L_WINDOW     0000000C            

DYN$C_FRK      = 00000008            SFT$W_SIZE       00000008            

DYN$C_GSD      = 00000015            SFT$W_SLOTSZ     00000002            

DYN$C_IDB      = 00000009            SGN$C_BALSETCNT= 00000018            

DYN$C_IRP      = 0000000A            SGN$C_DFWSCNT  = 00000064            

DYN$C_JPB      = 0000001F            SGN$C_DFWSQUOTA= 00000078            

DYN$C_KFH      = 00000026            SGN$C_GBLSECCNT= 00000028            

DYN$C_KFI      = 00000018            SGN$C_MAXGPGCNT= 00000800            

DYN$C_LOG      = 0000000B            SGN$C_MAXPAGCNT= 00004000            

DYN$C_MTL      = 00000019            SGN$C_MAXPGFL  = 00001000            

DYN$C_MVL      = 00000016            SGN$C_MAXPSTCNT= 00000005            

DYN$C_NDB      = 0000001C            SGN$C_MAXVPGCNT= 00002000            

DYN$C_NET      = 00000017            SGN$C_MAXWSCNT = 00000400            

DYN$C_PBH      = 00000020            SGN$C_MINWSCNT = 0000000A            

DYN$C_PCB      = 0000000C            SGN$C_NPAGEDYN = 00006800            

DYN$C_PDB      = 00000021            SGN$C_NPROCS   = 00000040            

DYN$C_PFL      = 00000023            SGN$C_PAGEDYN  = 00004000            

DYN$C_PIB      = 00000022            SGN$C_PAGFILCNT= 00000002  G         

DYN$C_PQB      = 0000000D            SGN$C_PFLIBAS  = 00000003  G         

DYN$C_PTR      = 00000025            SGN$C_PHYPAGCNT= 00001000            

DYN$C_RVT      = 0000000E            SGN$C_SFTMAX   = 00000003            

DYN$C_SFT      = 00000024            SGN$C_SYSDWSCNT= 00000028            

DYN$C_SSB      = 0000001D            SGN$C_SYSVECPGS= 00000003            

DYN$C_TQE      = 0000000F            SGN$C_SYSWSCNT = 00000060            

DYN$C_TYPAHD   = 00000014            SWP$ALLOC        00000000 RG    04   

DYN$C_UCB      = 00000010            SWP$DALLOC       00000036 RG    04   

DYN$C_VCB      = 00000011            SWP$GL_SFTBAS    00000000 RG    03   

DYN$C_WCB      = 00000012            SWP$GL_SLOTCNT   ********   X   04   

GBL...         = 00000000            

MMG$A_PAGFIL     00000060 RG    03   

MMG$GL_PAGSWPVC  000000A0 RG    03   

PFL$B_PFC        0000000B            

PFL$B_TYPE       0000000A            

PFL$C_LENGTH     00000020            

PFL$K_LENGTH     00000020            

PFL$L_BITMAP     00000000            

PFL$L_BITMAPSIZ  00000014            

PFL$L_FREPAGCNT  00000018            

PFL$L_RESERVCNT  0000001C            

PFL$L_STARTBYTE  00000004            

PFL$L_VBN        00000010            

PFL$L_WINDOW     0000000C            

PFL$W_SIZE       00000008            

PTR$B_PTRTYPE    0000000B            

SWAPFILE        - SWAP FILE ALLOCATION/DEALLOCATION              21-AUG-1978 20:12:12   VAX-11 MACRO X0.3-11               Page   7

PROGRAM SECTION SYNOPSIS                                                                                                         (1)







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$            00000020      02     NOPIC   USR   CON   ABS   LCL NOSHR   EXE   RD    WRT BYTE  

$$$220           000000C8      03     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT LONG  

$AEXENONPAGED    00000060      04     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  





THERE WERE NO ERRORS OR WARNINGS.

23926. BYTES LEFT IN FREE MEMORY POOL.

822. BYTES OF RECLAIMED MEMORY.

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

2 MLB DIR RDS - 209 GETS TO DEFINE 14 MACROS. 12 INTER. FILE WRITES. 

