--******************************************************************************************************************** -- Created: 9-Mar-2021 22:28:28 by OpenVMS SDL EV3-3 -- Source: 30-JUL-2002 11:37:07 $1$DGA8085:[LIB_ADA.LIS]JIBDEF.SDL;1 --******************************************************************************************************************** with SYSTEM; use SYSTEM; with STARLET; use STARLET; with CONDITION_HANDLING; use CONDITION_HANDLING; package JIBDEF is -- module $JIBDEF --+ -- Job Information Block - Structure containing common context for a set -- of related processes. -- -- Note: The Executive module SYSCREPRC assumes that the job mount list head -- preceeds the username field in the JIB. -- -- JIB Synchronization: -- -- The JIB is a shared structure across a subprocess tree. Synchronization -- is complex because many of the quota and limit fields have no functional -- relationship whatsoever. So a number of methods of synchronization are -- used, based on exactly what is being manipulated. Below is a list of -- fields with their methods of synch. -- -- Field Synchronization Method -- ----- ---------------------- -- BYTCNT/BYTLM Interlocked arithmetic sequences. Should never be manually -- manipulated: use the EXE$DEBIT/CREDIT routines in the -- EXSUBROUT module. -- -- TQCNT/TQLM Interlocked arithmetic sequences. When waiting because of a -- lack of TQCNT, the JIB FLAGS bit TQCNT_WAITERS must be set; -- the JIB address is the EFWM and the process should be -- placed in the MWAIT queue. When TQCNT is incremented, -- the TQCNT_WAITERS bit must be interrogated. If it is set, -- then waiting process should be made executable via a call -- to EXE$JIB_AVAIL or similar inline code. -- -- PGFLCNT Interlocked arithmetic sequences. Should never be manually -- manipulated to charge for pagefile quota: use $more_pgflquota -- macro. Macros $init_pgflquota and $ret_pgflquota are also -- available. -- -- PGFLQUOTA MMG spinlock. -- -- MTLFL/MTLBL SCH$IOLOCK/UNLOCK. -- -- FILCNT/FILLM, Interlocked arithmetic sequences. These fields are never increased -- ENQCNT/ENQLM, or decreased by more than 1 at a time, and are never waited on. -- PRCCNT/PRCLM --- JIB_C_DETACHED : constant := 0; JIB_C_NETWORK : constant := 1; JIB_C_BATCH : constant := 2; JIB_C_LOCAL : constant := 3; JIB_C_DIALUP : constant := 4; JIB_C_REMOTE : constant := 5; JIB_M_BYTCNT_WAITERS : constant := 16#00000001#; JIB_M_TQCNT_WAITERS : constant := 16#00000002#; JIB_M_MEDDLE : constant := 16#00000004#; JIB_K_LENGTH : constant := 140; -- Structure length JIB_C_LENGTH : constant := 140; -- Structure length JIB_S_JIBDEF : constant := 140; -- Old JIB sized for compatability type JIB_FLAGS_TYPE is -- FLAG bits record BYTCNT_WAITERS : BOOLEAN; -- Processes are waiting on BYTCNT TQCNT_WAITERS : BOOLEAN; -- Processes are waiting on TQCNT MEDDLE : BOOLEAN; -- Job table has been altered FILLER_1 : UNSIGNED_29; end record; for JIB_FLAGS_TYPE use record BYTCNT_WAITERS at 0 range 0 .. 0; TQCNT_WAITERS at 0 range 1 .. 1; MEDDLE at 0 range 2 .. 2; FILLER_1 at 0 range 3 .. 31; end record; for JIB_FLAGS_TYPE'SIZE use 32; JIB_FLAGS_TYPE_INIT : constant JIB_FLAGS_TYPE := (BYTCNT_WAITERS => FALSE, TQCNT_WAITERS => FALSE, MEDDLE => FALSE, FILLER_1 => 0); type JIB_TYPE is record MTLFL : ADDRESS; -- Job mounted volume list head forward link MTLBL : ADDRESS; -- Job mounted volume list head back link SIZE : UNSIGNED_WORD; -- Size of structure in bytes TYP : UNSIGNED_BYTE; -- Structure type code DAYTYPES : UNSIGNED_BYTE; -- Set bits 0-6 flag non-prime days of week USERNAME : STRING(1 .. 12); -- User name for easy access ACCOUNT : STRING(1 .. 8); -- Account name for resident access BYTCNT : UNSIGNED_LONGWORD; -- Buffered I/O byte count avail BYTLM : UNSIGNED_LONGWORD; -- Original value for Byte count PBYTCNT : UNSIGNED_LONGWORD; -- Paged pool byte count remaining PBYTLIM : UNSIGNED_LONGWORD; -- Paged pool byte limit FILCNT : UNSIGNED_LONGWORD; -- Open File count remaining FILLM : UNSIGNED_LONGWORD; -- Open file limit TQCNT : UNSIGNED_LONGWORD; -- Timer queue entry count remaining TQLM : UNSIGNED_LONGWORD; -- Timer queue entry limit PGFLQUOTA : UNSIGNED_LONGWORD; -- Paging file quota PGFLCNT : INTEGER_32; -- Paging file limit *** signed *** CPULIM : UNSIGNED_LONGWORD; -- CPU time quota remaining PRCCNT : UNSIGNED_LONGWORD; -- Count of subprocesses existing PRCLIM : UNSIGNED_LONGWORD; -- Limit on number of subprocesses SHRFCNT : UNSIGNED_WORD; -- Shared file block count remaining SHRFLIM : UNSIGNED_WORD; -- Shared file count limit ENQCNT : UNSIGNED_LONGWORD; -- Enqueue count avail ENQLM : UNSIGNED_LONGWORD; -- Enqueue limit MAXJOBS : UNSIGNED_WORD; -- Max jobs limit on user MAXDETACH : UNSIGNED_WORD; -- Max detached processes for user MPID : UNSIGNED_LONGWORD; -- PID of master process JLNAMFL : ADDRESS; -- Forward link for job-wide logical names JLNAMBL : ADDRESS; -- Back link for job-wide logical names PDAYHOURS : UNSIGNED_LONGWORD; -- Field describing primary day access ODAYHOURS : UNSIGNED_LONGWORD; -- Field describing off day access JOBTYPE : UNSIGNED_LONGWORD; -- Job origin type FLAGS : JIB_FLAGS_TYPE; -- FLAG bits ORG_BYTLM : UNSIGNED_LONGWORD; -- Original BYTLM ORG_PBYTLM : UNSIGNED_LONGWORD; -- Original PBYTLM JTQUOTA : UNSIGNED_LONGWORD; -- Job table quota end record; for JIB_TYPE use record MTLFL at 0 range 0 .. 31; MTLBL at 4 range 0 .. 31; SIZE at 8 range 0 .. 15; TYP at 10 range 0 .. 7; DAYTYPES at 11 range 0 .. 7; USERNAME at 12 range 0 .. 95; ACCOUNT at 24 range 0 .. 63; BYTCNT at 32 range 0 .. 31; BYTLM at 36 range 0 .. 31; PBYTCNT at 40 range 0 .. 31; PBYTLIM at 44 range 0 .. 31; FILCNT at 48 range 0 .. 31; FILLM at 52 range 0 .. 31; TQCNT at 56 range 0 .. 31; TQLM at 60 range 0 .. 31; PGFLQUOTA at 64 range 0 .. 31; PGFLCNT at 68 range 0 .. 31; CPULIM at 72 range 0 .. 31; PRCCNT at 76 range 0 .. 31; PRCLIM at 80 range 0 .. 31; SHRFCNT at 84 range 0 .. 15; SHRFLIM at 86 range 0 .. 15; ENQCNT at 88 range 0 .. 31; ENQLM at 92 range 0 .. 31; MAXJOBS at 96 range 0 .. 15; MAXDETACH at 98 range 0 .. 15; MPID at 100 range 0 .. 31; JLNAMFL at 104 range 0 .. 31; JLNAMBL at 108 range 0 .. 31; PDAYHOURS at 112 range 0 .. 31; ODAYHOURS at 116 range 0 .. 31; JOBTYPE at 120 range 0 .. 31; FLAGS at 124 range 0 .. 31; ORG_BYTLM at 128 range 0 .. 31; ORG_PBYTLM at 132 range 0 .. 31; JTQUOTA at 136 range 0 .. 31; end record; for JIB_TYPE'SIZE use 1120; JIB_TYPE_INIT : constant JIB_TYPE := (MTLFL => ADDRESS_ZERO, MTLBL => ADDRESS_ZERO, SIZE => 0, TYP => 0, DAYTYPES => 0, USERNAME => (others => ASCII.NUL), ACCOUNT => (others => ASCII.NUL), BYTCNT => 0, BYTLM => 0, PBYTCNT => 0, PBYTLIM => 0, FILCNT => 0, FILLM => 0, TQCNT => 0, TQLM => 0, PGFLQUOTA => 0, PGFLCNT => 0, CPULIM => 0, PRCCNT => 0, PRCLIM => 0, SHRFCNT => 0, SHRFLIM => 0, ENQCNT => 0, ENQLM => 0, MAXJOBS => 0, MAXDETACH => 0, MPID => 0, JLNAMFL => ADDRESS_ZERO, JLNAMBL => ADDRESS_ZERO, PDAYHOURS => 0, ODAYHOURS => 0, JOBTYPE => 0, FLAGS => JIB_FLAGS_TYPE_INIT, ORG_BYTLM => 0, ORG_PBYTLM => 0, JTQUOTA => 0); end JIBDEF;