PFREE (Page-Free Request) Macro

The macro frees one or more pages previously PFIXed in real storage.

Each page in the virtual address area is assigned a 'PFIX counter'. If a page is not fixed - that is, if it is subject to normal page management - the counter is 0. Whenever a page is fixed using a PFIX macro its counter is increased by one. All pages whose counters are greater than 0 remain fixed in real storage.

The PFREE macro decrements the counter of a specified page by 1. If a PFREE is issued for a page whose counter is 0, that PFREE is ignored.

Format

You can code the macro in either of the following formats; with an explicitly provided fix list or, in the generation format, with the implicitly generated fix list in the macro expansion:
Read syntax diagramSkip visual syntax diagramnamePFREE ,beginaddr, endaddr
Read syntax diagramSkip visual syntax diagramname PFREE listname(1)

Requirements for the caller

AMODE:
24 (if SPLEVEL SET=1)

24 or 31 (if SPLEVEL SET>1)

RMODE:
24 (if SPLEVEL SET=1)

24 or ANY (if SPLEVEL SET>1)

ASC Mode:
Primary

Parameters

beginaddr
Points to the first byte of the area to be freed.
endaddr
Points to the last byte of the area to be freed.
listname | (1)
Is the name of a list of consecutive 8-byte entries as shown below. Register notation can also be used. The address of this parameter list and the addresses in the list are treated as 3-byte addresses if the macro is invoked in 24-bit mode and as 4-byte addresses if invoked in 31-bit mode.
24-bit addressing mode:
X'00' Address constant Length Minus 1
0 1 4
31-bit addressing mode:
Address constant Length Minus 1
0 4
where:
Address constant =
Address of the first byte of the area to be freed.
Length =
A binary constant that indicates the length of the area to be freed.

The end of the list is indicated by a nonzero byte following the last entry (for 24-bit mode). For 31-bit mode, a nonzero value in bit 0 of the byte following the last entry indicates the end of the list.

Exceptional Conditions

If PFREE is issued by a program that runs in real mode, the macro is ignored.

Return Codes in Register 15

0
The pages were successfully freed.
12
One of the specified addresses was invalid, or begin address was higher than end address, or a negative length was specified.
20
Inconsistent function/option code provided in register 15; no page is freed (not possible if macro interface is used).