-- --**************************************************************************** --* * --* Copyright (c) 2001 * --* by DIGITAL Equipment Corporation, Maynard, Mass. * --* * --* This software is furnished under a license and may be used and copied * --* only in accordance with the terms of such license and with the * --* inclusion of the above copyright notice. This software or any other * --* copies thereof may not be provided or otherwise made available to any * --* other person. No title to and ownership of the software is hereby * --* transferred. * --* * --* The information in this software is subject to change without notice * --* and should not be construed as a commitment by DIGITAL Equipment * --* Corporation. * --* * --* DIGITAL assumes no responsibility for the use or reliability of its * --* software on equipment which is not supplied by DIGITAL. * --* * --**************************************************************************** --******************************************************************************************************************** -- Created: 15-MAR-2001 22:52:39 by OpenVMS SDL EV1-33 -- Source: 29-FEB-1996 15:18:01 $11$DUA933:[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 JIB spinlock. Should never be manually taken or released: -- use the EXE$DEBIT/CREDIT routines in the EXSUBROUT module. -- -- TQCNT/TQLM ADAWI. 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/PGFLQUOTA MMG spinlock. -- -- MTLFL/MTLBL SCH$IOLOCK/UNLOCK. -- -- FILCNT/FILLM, ADAWI. These fields are never increased or decreased by more -- ENQCNT/ENQLM, 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_K_LENGTH : constant := 148; -- Structure length JIB_C_LENGTH : constant := 148; -- Structure length type JIB_FLAGS_TYPE is -- FLAG bits record BYTCNT_WAITERS : BOOLEAN; -- Processes are waiting on BYTCNT TQCNT_WAITERS : BOOLEAN; -- Processes are waiting on TQCNT FILLER_1 : UNSIGNED_6; end record; for JIB_FLAGS_TYPE use record BYTCNT_WAITERS at 0 range 0 .. 0; TQCNT_WAITERS at 0 range 1 .. 1; FILLER_1 at 0 range 2 .. 7; end record; for JIB_FLAGS_TYPE'SIZE use 8; JIB_FLAGS_TYPE_INIT : constant JIB_FLAGS_TYPE := (BYTCNT_WAITERS => FALSE, TQCNT_WAITERS => FALSE, FILLER_1 => 0); type JIB_TYPE is record MTLFL : UNSIGNED_LONGWORD; -- Job mount list head forward link MTLBL : UNSIGNED_LONGWORD; -- Job mount 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_WORD; -- Open File count remaining FILLM : UNSIGNED_WORD; -- Open file limit TQCNT : UNSIGNED_WORD; -- Timer queue entry count remaining TQLM : UNSIGNED_WORD; -- Timer queue entry limit PGFLQUOTA : UNSIGNED_LONGWORD; -- Paging file quota PGFLCNT : UNSIGNED_LONGWORD; -- Paging file limit CPULIM : UNSIGNED_LONGWORD; -- CPU time quota remaining PRCCNT : UNSIGNED_WORD; -- Count of subprocesses existing PRCLIM : UNSIGNED_WORD; -- Limit on number of subprocesses SHRFCNT : UNSIGNED_WORD; -- Shared file block count remaing SHRFLIM : UNSIGNED_WORD; -- Shared file count limit ENQCNT_OLD : UNSIGNED_WORD; -- Enqueue count avail (old) ENQLM_OLD : UNSIGNED_WORD; -- Enqueue limit (old) MAXJOBS : UNSIGNED_WORD; -- Max jobs limit on user MAXDETACH : UNSIGNED_WORD; -- Max detached processes for user MPID : UNSIGNED_LONGWORD; -- PID of master process JLNAMFL : UNSIGNED_LONGWORD; -- Forward link for job-wide logical names JLNAMBL : UNSIGNED_LONGWORD; -- 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_BYTE; -- Job origin type FLAGS : JIB_FLAGS_TYPE; -- FLAG bits FILLER_1 : UNSIGNED_BYTE_ARRAY (1 .. 2); ORG_BYTLM : UNSIGNED_LONGWORD; -- Original BYTLM ORG_PBYTLM : UNSIGNED_LONGWORD; -- Original PBYTLM SPARE : UNSIGNED_LONGWORD; -- ...spare... CWPS_TIME : UNSIGNED_LONGWORD; -- Temp for CWPS CWPS_COUNT : UNSIGNED_LONGWORD; -- Temp for CWPS CWPS_SPARE : UNSIGNED_QUADWORD; -- Temp for CWPS ENQCNT : UNSIGNED_LONGWORD; -- Enqueue count avail ENQLM : UNSIGNED_LONGWORD; -- Enqueue limit 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 .. 15; FILLM at 50 range 0 .. 15; TQCNT at 52 range 0 .. 15; TQLM at 54 range 0 .. 15; PGFLQUOTA at 56 range 0 .. 31; PGFLCNT at 60 range 0 .. 31; CPULIM at 64 range 0 .. 31; PRCCNT at 68 range 0 .. 15; PRCLIM at 70 range 0 .. 15; SHRFCNT at 72 range 0 .. 15; SHRFLIM at 74 range 0 .. 15; ENQCNT_OLD at 76 range 0 .. 15; ENQLM_OLD at 78 range 0 .. 15; MAXJOBS at 80 range 0 .. 15; MAXDETACH at 82 range 0 .. 15; MPID at 84 range 0 .. 31; JLNAMFL at 88 range 0 .. 31; JLNAMBL at 92 range 0 .. 31; PDAYHOURS at 96 range 0 .. 31; ODAYHOURS at 100 range 0 .. 31; JOBTYPE at 104 range 0 .. 7; FLAGS at 105 range 0 .. 7; FILLER_1 at 106 range 0 .. 15; ORG_BYTLM at 108 range 0 .. 31; ORG_PBYTLM at 112 range 0 .. 31; SPARE at 116 range 0 .. 31; CWPS_TIME at 120 range 0 .. 31; CWPS_COUNT at 124 range 0 .. 31; CWPS_SPARE at 128 range 0 .. 63; ENQCNT at 136 range 0 .. 31; ENQLM at 140 range 0 .. 31; JTQUOTA at 144 range 0 .. 31; end record; for JIB_TYPE'SIZE use 1184; JIB_TYPE_INIT : constant JIB_TYPE := (MTLFL => 0, MTLBL => 0, 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_OLD => 0, ENQLM_OLD => 0, MAXJOBS => 0, MAXDETACH => 0, MPID => 0, JLNAMFL => 0, JLNAMBL => 0, PDAYHOURS => 0, ODAYHOURS => 0, JOBTYPE => 0, FLAGS => JIB_FLAGS_TYPE_INIT, FILLER_1 => (others => 0), ORG_BYTLM => 0, ORG_PBYTLM => 0, SPARE => 0, CWPS_TIME => 0, CWPS_COUNT => 0, CWPS_SPARE => (0, 0), ENQCNT => 0, ENQLM => 0, JTQUOTA => 0); end JIBDEF;