!
! IMP equivalent of the $SECDEF macro from SYS$LIBRARY:LIB.MLB
!
%record %format Sec Fm {Whatever it is} %c
      ( ( %integer Gsd %or %integer Ccb ),
        %short SecXFL, SecXBL,
        ( %integer VpxPfc %or %byte Unu1,Unu2,Unu3, Pfc ),
        %integer Window, Vbn,
        ( %integer Flags %or %byte Unu4, Amod, %short Unu5 ),
        %integer Refcnt, Pagcnt )

%const %integer SEC K MATALL  = 16_00000000, {all versions}
                SEC K MATEQU  = 16_00000001, {only equal version}
                SEC K MATLEQ  = 16_00000002  {minor version of sec >= us}

{_Flags} {**NB** uncommented ones have unknown function}

%const %integer SEC M GBL     = 16_00000001, {global section}
                SEC M CRF     = 16_00000002, {pages are copy-on-reference}
                SEC M DZRO    = 16_00000004, {pages are demand-zeroed}
                SEC M WRT     = 16_00000008, {read/write section}
                SEC M SHMGS   = 16_00000010,
                SEC M DELPEND = 16_00000020,
                SEC M WRTMOD  = 16_000000C0,
                SEC M AMOD    = 16_00000300,
                SEC M PERM    = 16_00004000, {permanent section}
                SEC M SYSGBL  = 16_00008000, {system global section}
                SEC M PFNMAP  = 16_00010000, {page frame section}
                SEC M EXPREG  = 16_00020000, {map into first available space}
                SEC M PROTECT = 16_00040000

%record %format Lims Fm ( %integer Start, Finish )
%record %format Id   Fm ( %integer A, B, C, D )

!
! Primary use of all the above is with the $CRMPSC service, which
! creates and maps a section.
!
%system %integer %function %spec CRMPSC ( %c
      %record(Limsfm) %name Inadr,      {requested address for map}
      %record(Limsfm) %name Retadr,     {returned address from map}
      %integer              Acmode,     {access mode for mapped pages}
      %integer              Flags,      {section type and characteristics}
      %record(Dsc Fm) %name Gsdnam,     {global section name string}
      %record(Id  Fm) %name Ident,      {match and version information}
      %integer              Relpag,     {first section page to map}
      %integer              Chan,       {channel file is open on}
      %integer              Pagcnt,     {no of pages in section}
      %integer              Vbn,        {first block in file for section}
      %integer              Prot,       {protection mask for section}
      %integer              Pfc         {page fault cluster size}          )

!
! $UPDSEC service
!
%system %integer %function %spec UPDSEC ( %c
      %record(Lims Fm) %name Inadr,    {area to be updated}
      %record(Lims Fm) %name Retadr,   {area actually written}
      %integer               Acmode,   {access mode for writes}
      %integer               Updflg,   {0=all, 1=just mine}
      %integer               Efn,      {normally 0}
      %record(*) %name       IOSB,     {I/O Status Block}
      %record(*) %name       ASTADR,   {AST routine}
      %integer               ASTPRM    {parameter for it}   )

%end %of %file
