- Get 2 MB above the bar
- Page-fix the first 1 MB of that storage
- Page-unfix that first 1 MB
- Free the storage
The code is as follows:
SYSSTATE AMODE64=YES
**************************************************************
* Get storage above 2G *
**************************************************************
IARV64 REQUEST=GETSTOR,SEGMENTS=NUMSEG, *
ORIGIN=OUTORG,RETCODE=LRETCODE, *
RSNCODE=LRSNCODE,CONTROL=AUTH, *
MF=(E,V64L)
*
* Place code to check return/reason codes here
*
*
* Build the Range List for Pagefix
*
LG 1,OUTORG
STG 1,RLSTART
LG 1,ONEMEG Number of pages in 1-meg
STG 1,RLEND
LA 1,RL
LLGTR 1,1
STG 1,RLADDR
**************************************************************
* Page-fix that storage *
* Defaults to NUMRANGE=1. *
**************************************************************
*
IARV64 REQUEST=PAGEFIX,RANGLIST=RLADDR, *
RETCODE=LRETCODE,RSNCODE=LRSNCODE, *
MF=(E,V64L)
*
* Place code to check return/reason codes here
*
**************************************************************
* Page-unfix that storage *
* Defaults to NUMRANGE=1. *
**************************************************************
*
IARV64 REQUEST=PAGEUNFIX,RANGLIST=RLADDR, *
RETCODE=LRETCODE,RSNCODE=LRSNCODE, *
MF=(E,V64L)
*
* Place code to check return/reason codes here
*
**************************************************************
* Free the storage *
**************************************************************
IARV64 REQUEST=DETACH,MEMOBJSTART=OUTORG *
RETCODE=LRETCODE,RSNCODE=LRSNCODE, *
MF=(E,V64L)
*
* Place code to check return/reason codes here
*
NUMSEG DC AD(2)
ONEMEG DC AD((1024*1024)/4096) Num of pages in a megabyte
DYNAREA DSECT
LRETCODE DS F
LRSNCODE DS F
OUTORG DS AD
RLADDR DS 0D Start of 16-byte range list
RLSTART DS AD Address of memory object
RLEND DS AD Number of pages
IARV64 MF=(L,V64L)