$CONTROL USLINIT,MAP,LIST,CODE                                          00010000
<< MEASSEG - MODULE 96 >>                                               00012000
<< HP32002C MPE SOURCE C.00.00 >>                                       00014000
$COPYRIGHT     "(C) COPYRIGHT HEWLETT-PACKARD CO. 1980. ",            & 00016000
$     "THIS PROGRAM MAY BE USED WITH ONE COMPUTER SYSTEM AT A ",      & 00018000
$     "TIME AND SHALL NOT OTHERWISE BE RECORDED, TRANSMITTED OR ",    & 00020000
$     "STORED IN A RETRIEVAL SYSTEM.  COPYING OR OTHER REPRODUCTION ",& 00022000
$     "OF THIS PROGRAM EXCEPT FOR ARCHIVAL PURPOSES IS PROHIBITED ",  & 00024000
$     "WITHOUT THE PRIOR WRITTEN CONSENT OF HEWLETT-PACKARD COMPANY."   00026000
$CONTROL PRIVILEGED,SEGMENT=MEASSEG,MAIN=MEASSEG                        00028000
$TITLE "  MPE IV MEASUREMENT INTERFACE "                                00030000
$PAGE "           MPE IV MEASUREMENT SUPPORT "                          00032000
<<*************************************************************<<04114>>00034000
*                                                             *<<04114>>00036000
*                                                             *<<04114>>00038000
*                 MPE IV Measurement Support                  *<<04114>>00040000
*                                                             *<<04114>>00042000
*                                                             *<<04114>>00044000
*************************************************************>><<04114>>00046000
<<                                                                      00048000
                                                                        00050000
I. Introduction                                                         00052000
                                                                        00054000
Regarding supported performance measurement and analysis tools,         00056000
the ideal direction from investment, support, and reliability           00058000
standpoints is towards having all such tools designed in an oper-       00060000
ating system invariant manner and executing nonprivileged.  This        00062000
would enable us to maintain consistency in the user interface,          00064000
cut support and overlapping development costs, and improve relia-       00066000
bility by reducing the amount of privileged code running on the         00068000
systems.  An attainable direction for 3000 family performance           00070000
tools is to make current tools and future designs operating             00072000
system version invariant, and to provide in MPE the mechanisms,         00074000
structures and interfacing so that code relying on MPE internal         00076000
structures and behavior is within the MPE domain.  Extracting MPE       00078000
structure and strategy dependent code will facilitate the               00080000
development of the next major operating system versions.                00082000
                                                                        00084000
Performance measurement and analysis tools require cooperation          00086000
from the system under test. The tools need not however be               00088000
dependent on the system's particular characteristics.  The system       00090000
can instead provide the basic mechanisms to acquire the data and        00092000
an interface to control the mechanisms and access the data so           00094000
that the specific characteristics are transparent.                      00096000
                                                                        00098000
Limiting performance tool control/access of hardware and OS             00100000
mechanisms to that provided by a well-defined interface improves        00102000
the extensibility and maintainability of both the operating             00104000
system and the measurement tools.  With respect to the                  00106000
operating system : (i). the areas and extent of impact of               00108000
proposed operating system changes can be more easily and                00110000
accurately estimated; and (ii). the implementation of modifi-           00112000
cations is simplified since changes affecting the mechanisms will       00114000
need to be reflected only in MPE and not in each performance            00116000
tool.  With respect to performance tools: (i). such tools will be       00118000
assured of the continuing external appearence of the fundamental        00120000
mechanisms; and (ii). maintenance of the mechanisms as well as          00122000
the interface will be the joint responsibility of MPE and the           00124000
performance group.                                                      00126000
                                                                        00128000
MPE IV measurement support aims at the above achievable                 00130000
direction.  Approaching this direction requires that :                  00132000
                                                                        00134000
  (i). the operating system provide the basic mechanisms and            00136000
       necessary support structures, control procedures, and            00138000
       access procedures required to support current and planned        00140000
       tools; and                                                       00142000
                                                                        00144000
 (ii). measurement tools limit their access of MPE internal data        00146000
       structures and mechanism controls to that provided by the        00148000
       interface.  If access is required to other information or        00150000
       additional support routines are required, these will be          00152000
       incorporated into the operating system, and access proce-        00154000
       dures or procedure extensions will be added to the               00156000
       measurement subsystem interface.                                 00158000
                                                                        00160000
This document provides a statement of objectives and the specifi-       00162000
cation of MPEIV measurement support.  A new MPE mechanism, the          00164000
MPE statistics gathering facility, is introduced, and the               00166000
associted interface data structures and access and control proce-       00168000
dures are defined.                                                      00170000
                                                                        00172000
$PAGE                                                                   00174000
II. Objectives and Requirements                                         00176000
                                                                        00178000
                                                                        00180000
The objectives and requirements of MPEIV measurement support are:       00182000
                                                                        00184000
   A. Service                                                           00186000
                                                                        00188000
      The mechanisms, their support structures, and the access          00190000
      and control procedures of the interface are to provide the        00192000
      information and the access to the information required by         00194000
      existent and planned performance measurement and analysis         00196000
      tools.  In particular, the kernel statistics required for         00198000
      the RTM, DSA and Monitor tools as well as the accounting          00200000
      extensions which will be supported by the released MPE IV         00202000
      operating system are to be supported by the interface.            00204000
                                                                        00206000
   B. Transparency                                                      00208000
                                                                        00210000
      Eliminate dependencies of measurement tools on MPE internal       00212000
      data structures and strategies by restricting access to           00214000
      that provided by the standard interface.                          00216000
                                                                        00218000
   C. Extensibility                                                     00220000
                                                                        00222000
      The basic mechanisms, the interface data structures, and          00224000
      the interface control and access procedures are to be             00226000
      sufficiently flexible so that future requirements for             00228000
      measurement support can be easily satisfied by extending          00230000
      the original specification.                                       00232000
                                                                        00234000
   D. Low Overhead                                                      00236000
                                                                        00238000
      The system support code implementing the basic mechanisms         00240000
      should minimally degrade performance. Performance of the          00242000
      access and control procedures, though a definite concern,         00244000
      is a secondary concern.                                           00246000
                                                                        00248000
   E. Maintenance                                                       00250000
                                                                        00252000
      For ease of maintenance by both MPE and the performance           00254000
      groups, control and access procedures relating to MPE's           00256000
      basic measurement mechanisms, as well as privileged code          00258000
      dependent on MPE structures and strategies, will be grad-         00260000
      ually collected into isolated segments and maintained             00262000
      jointly by MPE and the performance groups.                        00264000
$PAGE                                                                   00266000
III. MPE IV's Statistics Gathering Mechanism                            00268000
                                                                        00270000
Classes of statistics are useful in characterizing aspects of           00272000
system performance.  Due to their nature, these statistics can          00274000
only be generated with the operating system's cooperation.  A           00276000
standard, extensible scheme for generating and accessing such           00278000
statistics is required.                                                 00280000
                                                                        00282000
MPE IV has a mechanism which, when enabled, updates supported           00284000
classes of statistics into an extra data segments.  Intrinsics to       00286000
control the mechanism and to access the information are also            00288000
provided.  The currently supported statistics classes,                  00290000
subclasses, and items are given in Appendix 1.  The assignments         00292000
will be maintained along with the master tables.                        00294000
                                                                        00296000
The statistics gathering mechanism is enabled/disabled via the          00298000
control procedures STARTSTATISTICS and STOPSTATISTICS defined           00300000
below.  These procedures manipulate a primary sysglob cell called       00302000
GCLASSENABLEDMASK, and some counters in a resident measurement          00304000
control table.  GCLASSENABLEDMASK is a bitmask of the statistics        00306000
classes that are currently enabled.  The counters keep track for        00308000
each class of the number of processes which currently desire that       00310000
statistics in that class be gathered.                                   00312000
                                                                        00314000
When GCLASSENABLEDMASK is non-zero, one or more processes is re-        00316000
questing that one or more statistics classes be updated by MPE.         00318000
An extra data segment has been acquired, formatted, locked and          00320000
frozen for this purpose. In some cases seperate data segments           00322000
will be maintained for different classes of statistics. Specific        00324000
name assignments for currently defined classes of statistics are        00326000
as follows:                                                             00328000
                                                                        00330000
           CLASS NO.     XDS NAME          TYPE OF DATA                 00332000
                                                                        00334000
                  0      MEASSTATXDS       Global statistics            00336000
                 14      IOSTATXDS         I/O stats data               00338000
                 15      MEASPROCXDS       Process level data           00340000
                                                                        00342000
                                                                        00344000
When the class 0 bit of GCLASSENABLEDMASK is found to be                00346000
non-zero, and an event occurs which effects a statistic which is        00348000
maintained in the class 0 portion of the measurement XDS, the           00350000
statistic is directly updated by in-line OS code, the same is           00352000
true for classes 14 and 15. For statiscitcs in other classes,           00354000
updating is performed by calling the procedure:                         00356000
                                                                        00358000
Integer Procedure UPDATESTATISTICS(Class,Subclass,Subclassentry,        00360000
   Startingitem,Newvalueflag,Valuechange,Doubleitemflag);               00362000
   Value Class,Subclass,Subclassentry,Startingitem,Newvalueflag,        00364000
         Valuechange,Doubleitemflag;                                    00366000
   Integer Class,Subclass,Subclassentry,Startingitem;                   00368000
   Double Valuechange;                                                  00370000
   Logical Newvalueflag,Doubleitemflag;                                 00372000
   Option External,Uncallable,Privileged;                               00374000
                                                                        00376000
UPDATESTATISTICS performs class, subclass, entry,and item range         00378000
checking.                                                               00380000
                                                                        00382000
     CC=CCL ==> bad parameter;                                          00384000
     CC=CCE ==> ok;                                                     00386000
     CC=CCG not used                                                    00388000
                                                                        00390000
     UPDATESTATISTICS = 0 ==> ok                                        00392000
                      = 1 ==> stats not enabled                         00394000
                      = 2 ==> bad startingitem parameter                00396000
                      = 3 ==> bad subclassentry parameter               00398000
                      = 4 ==> bad subclass parameter                    00400000
                      = 5 ==> bad class parameter                       00402000
                                                                        00404000
The Newvalueflag parameter, when true, indicates that the               00406000
Valuechange parameter is to replace the old item, and, when             00408000
false, indicates that the valuechange parameter is to be added to       00410000
the old item value.                                                     00412000
                                                                        00414000
The Doubleitemflag parameter, when true, indicates that the             00416000
Valuechange parameter contains a double item value to be up-            00418000
dated, when false, it indicates that the Valuechange parameter          00420000
contains a single item value to be updtated.                            00422000
                                                                        00424000
The current set of classes, subclasses and items are given in           00426000
Appendix 1.  This set can be easily extended for custom measure-        00428000
ments.                                                                  00430000
                                                                        00432000
In addition to the protection provided by this updating                 00434000
procedure, using it saves the user from having to know the              00436000
structure of the measurement XDS.  It provides a centralized            00438000
updating procedure which saves code and makes for easy                  00440000
maintenance when changes in the format of the measurement XDS           00442000
come about.                                                             00444000
                                                                        00446000
UPDATESTATISTICS has an entry point FUPDATESTATISTICS (fast             00448000
update) which can be used when the code has been debugged and           00450000
performance is of significant concern. FUPDATESTATISTICS performs       00452000
the same functions as UPDATESTATISTICS, but omits the parameter         00454000
range checking.  The return value is always zero.                       00456000
                                                                        00458000
$PAGE                                                                   00460000
IV.  Interface Description                                              00462000
                                                                        00464000
                                                                        00466000
The measurement subsystem interface consists of data structures,        00468000
mechanism control procedures, and data access procedures.               00470000
Portions of MPE code know about the current specification of the        00472000
interface, and support its definition by gathering and storing          00474000
the supported information into the appropriate buffers.  The            00476000
information is gathered as events occur, or during sampling or          00478000
trace trap interrupts.                                                  00480000
                                                                        00482000
There are presently 3 classes of statistics gathered: GLOBAL,           00484000
PROCESS, and I/O statistics. The distinction of 3 seperate              00486000
classes was made for the reasons listed below with regard to            00488000
PROCESS statistics which can be applied to the other 2 classes.         00490000
                                                                        00492000
Process level instrumentation has been implemented as a separate        00494000
class (class 15) of statistics. Due to the increased overhead           00496000
incurred during data gathering, the definition of a seperate            00498000
class allows the user to minimize the performance degradation           00500000
when only one class of statistics is required to produce the            00502000
desired information.                                                    00504000
                                                                        00506000
Due to the space requirements for process level counters (52            00508000
words per configured PCB) the class 15 counters will be main-           00510000
tained in a separate extra data segment from that of the global         00512000
counters. Again this will help minimize the performance degra-          00514000
dation of data gathering by reducing the memory space require-          00516000
ments when only one class of statistics is enabled.                     00518000
                                                                        00520000
  A. Interface Data Structures                                          00522000
                                                                        00524000
     The interface data structures consist of :                         00526000
                                                                        00528000
        (i). Control Data Structures                                    00530000
                                                                        00532000
             MEASINFOTAB, a core resident table configured              00534000
             during system generation in which global control           00536000
             information required by the interface is maintained;       00538000
                                                                        00540000
             A block of pcbx fixed cells for maintaining process        00542000
             related control information required for interface         00544000
             support;                                                   00546000
                                                                        00548000
       (ii). Information Storage Structures                             00550000
                                                                        00552000
                                                                        00554000
             Extra data segments into which events are logged,          00556000
             gathered information stored, and in which cumulative       00558000
             statistics are updated;                                    00560000
                                                                        00562000
             PCBX fixed cells containing process specific               00564000
             measurement information.                                   00566000
$PAGE                                                                   00568000
        (i). Control Data Structures                                    00570000
                                                                        00572000
             MEASINFOTAB                                                00574000
                                                                        00576000
             The primary sysglob cells previously used for              00578000
             Measio, Monitor, RTM, DSA, Tracer, and Sampler have        00580000
             been made availble for operating system pointers to        00582000
             new tables (so that future structures can be ac-           00584000
             cessed with the LST instruction).  The measurement         00586000
             control information previously maintained in primary       00588000
             sysglob cells are kept instead in the MEASINFOTAB, a       00590000
             core resident table created for this purpose.  Its         00592000
             structure provides extensibility for both future           00594000
             tools and enhancements to current tools.  There is a       00596000
             pointer to MEASINFOTAB in the primary sysglob area         00598000
             so that the information can be efficiently accessed        00600000
             with the LST instruction.                                  00602000
                                                                        00604000
             The MPE III sysglob assignments related to                 00606000
             measurement tools, and the sampling, event logging         00608000
             and tracing mechanisms, will be supported as in MPE        00610000
             III.  This will permit a gradual conversion to             00612000
             interface requirements.                                    00614000
                                                                        00616000
             %1261 = MEASINFOTABPTR                                     00618000
                   = Sysbase relative index of base of                  00620000
                     MEASINFOTAB                                        00622000
                                                                        00624000
             MEASINFOTAB DST # = 59 (%73)                               00626000
                                                                        00628000
            |--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|              00630000
          0 |                                            |              00632000
            |     Reserved for MEASIO Control Info       |              00634000
          7 |                                            |              00636000
            |--------------------------------------------|              00638000
         10 |                                            |              00640000
          . | Reserved for Performance Tuning Parameters |              00642000
         17 |                                            |              00644000
            |--------------------------------------------|              00646000
         20 |                                            |              00648000
          . | Reserved for Statistics Gathering Mechanism|              00650000
          . |        Control Information                 |              00652000
         57 |                                            |              00654000
            |--------------------------------------------|              00656000
         60 |                                            |              00658000
            |  Reserved for Shared Clock Interface User  |              00660000
            |        Control Information                 |              00662000
         67 |                                            |              00664000
            |--------------------------------------------|              00666000
         70 |                                            |              00668000
            |  Reserved for Shared Clock Interface       |              00670000
            |        Control Information                 |              00672000
         77 |                                            |              00674000
            |--------------------------------------------|              00676000
        100 |                                            |              00678000
            |  Reserved for Event Logging Control Info   |              00680000
        117 |                                            |              00682000
            |--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|              00684000
                                                                        00686000
$PAGE                                                                   00688000
                                                                        00690000
       The data area for MMSTAT enabling and other MONITOR con-         00692000
       trol will be reserved in the event logging portion of            00694000
       MEASINFOTAB (NOTE: MEASFLAG ABS(%1267) has not been              00696000
       moved).                                                          00698000
                                                                        00700000
       The current assignments for MEASINFOTAB can be found in          00702000
       the SYSTEM TABLES manual in chapter 17.                          00704000
                                                                        00706000
       In addition to these control cells, three primary SYSGLOB        00708000
       cells have been reserved for use by the kernel in low            00710000
       overhead detection of statistics gathering enabled and low       00712000
       overhead access to the statistics information structure.         00714000
       These are :                                                      00716000
                                                                        00718000
       |--------------------------------------------|                   00720000
       |         GCLASSENABLEDMASK                  |%1262              00722000
       |--------------------------------------------|                   00724000
       |         MEASSTATXDSBANK                    |%1263              00726000
       |--------------------------------------------|                   00728000
       |         MEASSTATXDSBASE                    |%1264              00730000
       |--------------------------------------------|                   00732000
                                                                        00734000
                                                                        00736000
                                                                        00738000
 PCBX Fixed Cells for Measurement Control Info                          00740000
                                                                        00742000
       Words %100 through %102 in the pcbx fixed area of a              00744000
       process' stack are reserved for process specific                 00746000
       measurement control information.                                 00748000
                                                                        00750000
       The currently assigned fields of these words are :               00752000
                                                                        00754000
       word %100   PCLASSENABLEDMASK                                    00756000
                                                                        00758000
               .(j:1)=1 ==>  process has enabled and not                00760000
                             disabled statistics class J                00762000
                                                                        00764000
       word %101   MEASSTOPREASON                                       00766000
                                                                        00768000
               = 1 STOPPED, SEGMENT FAULT                               00770000
               = 2 STOPPED, DISC WAIT                                   00772000
               = 3 STOPPED, NON-TERMINAL BLOCKED I/O                    00774000
               = 4 STOPPED, TERM READ                                   00776000
               = 5 STOPPED, IMPEDED                                     00778000
               = 6 STOPPED, ACTIVE (QUANTUM EXPIRATION)                 00780000
                                                                        00782000
       Assignments related to these PXFIXED cells are                   00784000
       coordinated with the master tables.  If additional               00786000
       PXFIXED cells are required, the PXFIXED area can be              00788000
       extended.                                                        00790000
$PAGE                                                                   00792000
      (ii). Information Structures For Measurement Storage              00794000
                                                                        00796000
      Extra Data Segment For the MPE Statistics Gathering               00798000
      Mechanism Global Structure                                        00800000
                                                                        00802000
                                                                        00804000
       |--------------------------------------------|                   00806000
     +-|         MEASSTATXDSBANK                    |%1263              00808000
+----+ |--------------------------------------------|                   00810000
|    +-|         MEASSTATXDSBASE                    |%1264              00812000
|      |--------------------------------------------|                   00814000
|                                                                       00816000
|                                                                       00818000
+----> |--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|                   00820000
   0   |                 .                          |                   00822000
   .   | Seg rel offsets to item0 counters for ldevs|                   00824000
   .   |           indexed by ldev                  |                   00826000
  255  |                 .                          |                   00828000
       |--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|                   00830000
       |             # of Classes                   |                   00832000
       |--------------------------------------------|    XDS            00834000
    +--|             Class 0 Offset                 |                   00836000
    |  |--------------------------------------------|    For            00838000
+---|--|             Class 1 Offset                 |                   00840000
|   |  |--------------------------------------------| Statistics        00842000
|   |  |                 .                          |                   00844000
|   |  |                 .                          | Gathering         00846000
|   |  |--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|                   00848000
|   +->|             # of Subclasses                |                   00850000
|      |--------------------------------------------|                   00852000
|   +--|             Subclass 0 Offset              |                   00854000
|   |  |--------------------------------------------|                   00856000
| +-|--|             Subclass 1 Offset              |                   00858000
| | |  |--------------------------------------------|                   00860000
| | |  |                 .                          |                   00862000
| | |  |                 .                          |                   00864000
| | |  |--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|                   00866000
| | +->|                                            |                   00868000
| |    |             Subclass                       |                   00870000
| |    |              Format                        |                   00872000
| |    |                 .                          |                   00874000
| |    |                 .                          |                   00876000
| |    |--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|                   00878000
| +--->|                                            |                   00880000
|      |             Subclass                       |                   00882000
|      |              Format                        |                   00884000
|      |                 .                          |                   00886000
|      |                 .                          |                   00888000
|      |--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|                   00890000
+----->|                 .                          |                   00892000
       |                 .                          |                   00894000
       |--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|                   00896000
$PAGE                                                                   00898000
      XDS Subclass Structure                                            00900000
                                                                        00902000
                                                                        00904000
       |--------------------------------------------|                   00906000
       |                                            |                   00908000
+------| Class Offset (Segment Relative)            |                   00910000
|      |                                            |                   00912000
|      |--------------------------------------------|                   00914000
|                                                                       00916000
|                                                                       00918000
|      |--------------------------------------------|                   00920000
|----->|                                            |                   00922000
 +-----| Subclass Offset (Class relative)           |                   00924000
 |     |                                            |                   00926000
 |     |--------------------------------------------|                   00928000
 |                                                                      00930000
 |                                                                      00932000
 +---> |--|--|--|--|--|--|--|--|--|--|--|--|--|--|--|    -              00934000
       |      # of entries in subclass              |                   00936000
       |--------------------------------------------|  Entry 0          00938000
       |      # of words per subclass entry         |                   00940000
       |--------------------------------------------|                   00942000
       |      # of words in entry 0                 |                   00944000
       |--------------------------------------------|    -              00946000
       |              item 0                        |                   00948000
       |--------------------------------------------|                   00950000
       |              item 1                        |  Entry 1          00952000
       |--------------------------------------------|                   00954000
       |                 .                          |                   00956000
       |                 .                          |                   00958000
       |--------------------------------------------|                   00960000
       |              last item                     |                   00962000
       |--------------------------------------------|    -              00964000
       |              item 0                        |                   00966000
       |--------------------------------------------|                   00968000
       |              item 1                        |  Entry 2          00970000
       |--------------------------------------------|                   00972000
       |                 .                          |                   00974000
       |                 .                          |                   00976000
       |--------------------------------------------|                   00978000
       |              last item                     |                   00980000
       |--------------------------------------------|    -              00982000
                         .                                              00984000
                         .                                              00986000
                         .                                              00988000
$PAGE                                                                   00990000
   Extra Data Segment for the Process Level Counters                    00992000
                                                                        00994000
     MEASINFOTABPTR = ABS(%1261)                                        00996000
                                                                        00998000
                 MEASINFOTAB DST(%73)                                   01000000
                                                                        01002000
         |--------------------------------------------|                 01004000
     %0  |                                            |                 01006000
         |--------------------------------------------|                 01008000
      .  |                                            |                 01010000
         |--------------------------------------------|                 01012000
      .  |                                            |                 01014000
         |--------------------------------------------|                 01016000
 +---%21 |            MEASPROCXDSBANK                 |                 01018000
 |       |--------------------------------------------|                 01020000
 +---%22 |            MEASPROCXDSBASE                 |                 01022000
 |       |--------------------------------------------|                 01024000
 |   %23 |            MEASPROCXDSNUM                  |                 01026000
 |       |--------------------------------------------|                 01028000
 |                                                                      01030000
 |                                                                      01032000
 |                                                                      01034000
 |                                                                      01036000
 |       |--------------------------------------------|                 01038000
 +---%0  |               Entry Size                   |                 01040000
         |--------------------------------------------|                 01042000
     %1  |         Number of configured PCB's         |                 01044000
         |--------------------------------------------|                 01046000
     %2  |         Time Sampling Started  (MSW)       |                 01048000
         |--------------------------------------------|                 01050000
     %3  |         Time Sampling Started  (LSW)       |                 01052000
         |--------------------------------------------|                 01054000
     %4  |      1st char       |      2nd char        | MPE Version     01056000
         (base)                                                         01058000
         |--------------------------------------------|                 01060000
     %5  |      1st char       |      2nd char        | MPE Update      01062000
         (base)                                                         01064000
         |--------------------------------------------|                 01066000
     %6  |      1st char       |      2nd char        | MPE Fix         01068000
         (base)                                                         01070000
         |--------------------------------------------|                 01072000
     %7  |      1st char       |      2nd char        | MPE Version     01074000
         (actual)                                                       01076000
         |--------------------------------------------|                 01078000
     %10 |      1st char       |      2nd char        | MPE Update      01080000
     (actual)                                                           01082000
         |--------------------------------------------|                 01084000
     %11 |      1st char       |      2nd char        | MPE Fix         01086000
     (actual)                                                           01088000
         |--------------------------------------------|                 01090000
     %12 |      Memory used by MPE in words (MSW)     |                 01092000
         |--------------------------------------------|                 01094000
     %13 |      Memory used by MPE in words (LSW)     |                 01096000
         |--------------------------------------------|                 01098000
     %14 |      Memory available in words (MSW)       |                 01100000
         |--------------------------------------------|                 01102000
     %15 |      Memory available in words (LSW)       |                 01104000
         |--------------------------------------------|                 01106000
$PAGE                                                                   01108000
      .                                                                 01110000
      .                                                                 01112000
      .                                                                 01114000
         |--------------------------------------------|                 01116000
     %62 |                                            |                 01118000
         |--------------------------------------------|     -           01120000
         |                 Item 0                     |                 01122000
         |--------------------------------------------|                 01124000
         |                 Item 1                     |                 01126000
         |--------------------------------------------|                 01128000
         |                    .                       |  Entry 1        01130000
         |                                            |                 01132000
         |                    .                       |                 01134000
         |--------------------------------------------|                 01136000
         |               Last Item                    |                 01138000
         |--------------------------------------------|     -           01140000
         |                 Item 0                     |                 01142000
         |--------------------------------------------|                 01144000
         |                 Item 1                     |                 01146000
         |--------------------------------------------|                 01148000
         |                    .                       |  Entry 2        01150000
         |                                            |                 01152000
         |                    .                       |                 01154000
         |--------------------------------------------|                 01156000
         |               Last Item                    |                 01158000
         |--------------------------------------------|     -           01160000
         |                 Item 0                     |                 01162000
         |--------------------------------------------|                 01164000
         |                 Item 1                     |                 01166000
         |--------------------------------------------|                 01168000
         |                    .                       |  Entry 3        01170000
         |                                            |                 01172000
         |                    .                       |                 01174000
         |--------------------------------------------|                 01176000
         |               Last Item                    |                 01178000
         |--------------------------------------------|     -           01180000
         |                 Item 0                     |                 01182000
         |--------------------------------------------|                 01184000
         |                 Item 1                     |                 01186000
         |--------------------------------------------|                 01188000
         |                    .                       |  Entry 4        01190000
         |                                            |                 01192000
         |                    .                       |                 01194000
         |--------------------------------------------|                 01196000
         |               LAST ITEM                    |                 01198000
         |--------------------------------------------|     -           01200000
                              .                                         01202000
                              .                                         01204000
                              .                                         01206000
           Last entry number = highest configured PCB                   01208000
                                                                        01210000
           Indexed by PCB number                                        01212000
$PAGE                                                                   01214000
  B. Interface Control Procedures                                       01216000
                                                                        01218000
     Interface control procedures provide the services required         01220000
     for measurement specification, initiation, and termination.        01222000
     Each measurement tool has its own set of control procedures.       01224000
     These tool specific control procedures call general control        01226000
     procedures which set up the measurement environment and            01228000
     enable/disable the measurement activity.                           01230000
                                                                        01232000
     (i).  Controlling the MPE Statistics Gathering Mechanism           01234000
                                                                        01236000
           When statistics gathering has been enabled, MPE code         01238000
           has the responsibility of updating cumulative                01240000
           statistics which are being maintained in an extra data       01242000
           segment acquired, locked and frozen for that                 01244000
           purpose.                                                     01246000
                                                                        01248000
           This Statistics gathering is enabled by calling:             01250000
                                                                        01252000
              Integer Procedure STARTSTATISTICS(Classmask);             01254000
              Value Classmask;                                          01256000
              Logical Classmask;                                        01258000
              Option External,Privileged;                               01260000
                                                                        01262000
              Return Values:                                            01264000
                                                                        01266000
              CC=CCL ==> could not obtain data segment                  01268000
              CC=CCE ==> ok;                                            01270000
              CC=CCG not used                                           01272000
                                                                        01274000
              STARTSTATISTICS = 0 ==> ok                                01276000
                              = 1 ==> no vmem for data segment          01278000
                              = 2 ==> no dst entry avail                01280000
                              = 3 ==> could not lock data seg           01282000
                                                                        01284000
           and disabled by calling :                                    01286000
                                                                        01288000
              Procedure STOPSTATISTICS(Classmask);                      01290000
              Value Classmask;                                          01292000
              Logical Classmask;                                        01294000
              Option External,Privileged;                               01296000
                                                                        01298000
              Return Values:                                            01300000
                                                                        01302000
              CC=CCL ==> bad parameter;                                 01304000
              CC=CCE ==> ok;                                            01306000
              CC=CCG not used                                           01308000
                                                                        01310000
$PAGE                                                                   01312000
           A sysglob cell, called GCLASSENABLEDMASK and currently       01314000
           assigned absolute %1262, is used by MPE to know which        01316000
           statistics classes are currently enabled.                    01318000
                                                                        01320000
           STARTSTATISTIC's Classmask parameter indicates the           01322000
           classes of statistics which the caller wishes to             01324000
           enable.  This mask will be ORed with PCLASSENABLEDMASK       01326000
           in the process' pcbx.  For any classes newly enabled         01328000
           by the process, the corresponding bit in the sysglob         01330000
           cell GCLASSENABLEDMASK will be set, and the                  01332000
           corresponding class counter in MEASINFOTAB will be           01334000
           incremented.                                                 01336000
                                                                        01338000
           STOPSTATISTICS decrements the MEASINFOTAB counter for        01340000
           processes which have enabled a statistics class for          01342000
           each bit which is on in the Classmask parameter and on       01344000
           in the calling process' PCLASSENABLEDMASK.  If a class       01346000
           enabled counter falls to zero, the corresponding bit         01348000
           in GCLASSENABLEDMASK is cleared.  When a process call        01350000
           to STARTSTATISTICS changes GCLASSENABLEDMASK from a          01352000
           zero state, STARTSTATISTICS acquires, formats, locks         01354000
           and freezes an extra data segment into which the stat-       01356000
           istics will be updated.  When a call to STOPSTATISTICS       01358000
           changes GCLASSENABLEDMASK from a nonzero state to            01360000
           zero, STARTSTATISTICS unfreezes, unlocks and releases        01362000
           the extra data segment which was acquired for statis-        01364000
           tics gathering.  If a terminating process'                   01366000
           PCLASSENABLEDMASK is nonzero, the procedure                  01368000
           STOPSTATISTICS will be called on its stack as part of        01370000
           its resource cleanup.                                        01372000
                                                                        01374000
           STARTSTATISTICS and STOPSTATISTICS acquire a new sir         01376000
           called the MEASSIR.  This sir insures that only              01378000
           one process modifies the environment for statistics          01380000
           gathering, and that while the environment is being           01382000
           modified that calls to these procedures will impede          01384000
           the caller until the environment is setup/destroyed.         01386000
                                                                        01388000
           When GCLASSENABLEDMASK is found to be non-zero, system       01390000
           code updates the supported statistics as events              01392000
           effecting them occur.                                        01394000
                                                                        01396000
           Notice that the above specifications limit the number        01398000
           of statistics classes to 16.                                 01400000
                                                                        01402000
$PAGE                                                                   01404000
                                                                        01406000
    Control procedures for the following basic MPE                      01408000
    mechanisms are to be separated from tools which use the             01410000
    mechanisms, and are to be collected into isolated segments.         01412000
                                                                        01414000
    (ii).  Controlling the kernel event logging mechanism               01416000
   (iii).  Controlling the segment trace mechanism                      01418000
    (iv).  Controlling the sampling mechanism                           01420000
                                                                        01422000
                                                                        01424000
$PAGE                                                                   01426000
  C. Interface Access Procedures                                        01428000
                                                                        01430000
     (i). Accessing the Global Statistics updated by MPE's              01432000
          Statistics Updating Mechanism                                 01434000
                                                                        01436000
           The general statistics access procedure is :                 01438000
                                                                        01440000
                Integer Procedure GETSTATISTICS(Class,Subclass,         01442000
                   Startingitem,Wordcount,Where);                       01444000
                Value Class,Subclass,Startingitem,Wordcount;            01446000
                Integer Class,Subclass,Startingitem,Wordcount;          01448000
                Integer Array Where;                                    01450000
                Option External,Privileged;                             01452000
                                                                        01454000
           This procedure may not be called in split stack mode.        01456000
                                                                        01458000
           Desired statistics, expected count, and destination          01460000
           array are identified by the calling parameters.              01462000
                                                                        01464000
           The measurement class, subclass and startingitem             01466000
           parameters, together with the wordcount parameter,           01468000
           identify the desired statistics.  The class, subclass,       01470000
           and item assignments are specified in Appendix 1.            01472000
                                                                        01474000
           The Wordcount value parameter indicates the number of        01476000
           words to be transferred beginning with the subclass          01478000
           word specified by the class, subclass, and starting-         01480000
           item parameters.  The value of wordcount is based on         01482000
           the current definition of the subclasses.  The number        01484000
           of subclass entries and the number of words in each          01486000
           entry can be discovered by calling GETSTATISTICS with        01488000
           a startingitem parameter of -3 for a wordcount of 3.         01490000
           This serves several purposes :                               01492000
                                                                        01494000
              (i). The necessary array size can be determined;          01496000
             (ii). The number of devices of a given type can be         01498000
                   determined in cases where a subclass contains        01500000
                   statistics for all devices in a given class;         01502000
            (iii). Adding statistics to a subclass entry can be         01504000
                   supported in an upward compatible fashion.           01506000
                                                                        01508000
           Reasonability Checking is performed on the incoming          01510000
           parameters, and status is returned through the               01512000
           condition code and procedure value as follows :              01514000
                                                                        01516000
           CC=CCL ==> bad parameter;                                    01518000
           CC=CCE ==> ok;                                               01520000
           CC=CCG not used                                              01522000
                                                                        01524000
           GETSTATISTICS = 0 ==> ok                                     01526000
                         = 1 ==> stats gathering not enabled            01528000
                         = 2 ==> array out of bounds                    01530000
                         = 3 ==> wordcount out of range.                01532000
                         = 4 ==> bad startingitem parameter             01534000
                         = 5 ==> bad subclass parameter                 01536000
                         = 6 ==> bad class parameter                    01538000
                                                                        01540000
                                                                        01542000
           GETSTATISTICS will have an entry point FGETSTATISTICS which  01544000
           can be used when the code has been debugged and performance  01546000
           is of significant concern. FGETSTATISTICS performs the same  01548000
           functions as GETSTATISTICS, but omits the parameter range    01550000
           checking.  The return value is always zero.                  01552000
$PAGE                                                                   01554000
          ***********************************************************   01556000
          *                    NOT IMPLEMENTED                      *   01558000
          ***********************************************************   01560000
     (ii). Accessing the Per Process Statistics updated by MPE's        01562000
           Statistics Updating Mechanism                                01564000
                                                                        01566000
           Per process statistics updated in the process statistics xds 01568000
           by the MPE statistics gathering mechanism are accessed via   01570000
           the procedure :                                              01572000
                                                                        01574000
                Integer Procedure GETPROCSTATS(Allpins,Pin,Firstitem,   01576000
                                               Wordcount,Where);        01578000
                Value Allpins,Pin,Firstitem,Wordcount;                  01580000
                Logical Allpins;                                        01582000
                Integer Pin,Firstitem,Wordcount;                        01584000
                Integer Array Where;                                    01586000
                Option Privileged,Uncallable,External;                  01588000
                                                                        01590000
           This procedure may not be called in split-stack mode.        01592000
                                                                        01594000
           The calling parameters identify a process or all processes,  01596000
           the set of desired statistics, and the destination array.    01598000
           Allpins when set to true, requests information for all pins. 01600000
           The user should expect to retrieve data for both active and  01602000
           inactive pins. That is, it will be the callers responsibilty 01604000
           to determine if the information returned is that of a live   01606000
           process (creation time non-zero and termination time equal to01608000
           zero), or a recently terminated process (creation and term-  01610000
           ination times non-zero), or finally a process which has not  01612000
           yet been created (creation and termination times both equal  01614000
           to zero).  Pin is the process identification number.  To com-01616000
           pute the necessarry size of the output array Where before    01618000
           requesting ALLPINS, the user can first request the first 2   01620000
           items of PIN 0 (header information) which are entry size and 01622000
           number of entrys.  Firstitem and Wordcount parameters relate 01624000
           to the current assignments of process specific measurement   01626000
           items.  The currently supported process statistics and their 01628000
           item assignments are presented in Appendix 2.                01630000
                                                                        01632000
           Reasonability Checking is performed on the incoming param-   01634000
           eters, and status is returned through the condition code and 01636000
           procedure value as follows :                                 01638000
                                                                        01640000
           CC=CCL ==> bad parameter; CC=CCE ==> ok; CC=CCG not used     01642000
                                                                        01644000
           GETPROCSTATS  = 0 ==> ok                                     01646000
                         = 1 ==> stats not enabled                      01648000
                         = 2 ==> array out of bounds                    01650000
                         = 3 ==> bad wordcount                          01652000
                         = 4 ==> bad startingitem parm                  01654000
                         = 5 ==> bad pin parm                           01656000
                                                                        01658000
                                                                        01660000
           GETPROCSTATS will have an entry point FGETPROCSTATS (fast    01662000
           get) which can be used when the code has been debugged and   01664000
           performance is of significant concern. FGETPROCSTATS performs01666000
           the same functions as GETPROCSTATS, but omits the parameter  01668000
           range checking.  The return value is always zero.            01670000
           **********************************************************   01672000
           **********************************************************   01674000
$PAGE                                                                   01676000
Appendix I :  Statistics Class and Subclass Assignments                 01678000
                                                                        01680000
                                                                        01682000
COMMENT : Subclass item numbers for supported items begin with          01684000
          zero and remain static.  Subclass items beginning with        01686000
          1000 are not permanent and are for use by lab tools.          01688000
          Class, subclass and item assignments are to be kept           01690000
          updated in the master tables.                                 01692000
                                                                        01694000
Class  0  Global Statistics (low over-head updating)                    01696000
                                                                        01698000
   Subclass 0 :  Single Word Fixed Counters                             01700000
                                                                        01702000
    # entries = 1                                                       01704000
    entry length = 100                                                  01706000
     item #                                                             01708000
                                                                        01710000
     << items 0-29 reserved for process launch/stop info >>             01712000
                                                                        01714000
       0   #launches                                                    01716000
       1   #stops on blocked disc i/o                                   01718000
       2   #stops on unblocked disc i/o                                 01720000
       3   #stops on sl faults                                          01722000
       4   #sl fault recoveries                                         01724000
       5   #stops on pbx faults                                         01726000
       6   #pbx recoveries                                              01728000
       7   #stops on data absence                                       01730000
       8   #data absence recoveries                                     01732000
       9   #stops on terminal reads                                     01734000
      10   #stops on terminal I/O,not read                              01736000
      11   #stops on stack overflows                                    01738000
      12   #stops on busy sir                                           01740000
      13   #stops on impede                                             01742000
      14   #dl size expansion stops                                     01744000
      15   #dl contractions                                             01746000
      16   #pxfile expansion stops                                      01748000
      17   #pxfile contractions                                         01750000
      18   #db-z expansion stops                                        01752000
      19   #db-z contractions                                           01754000
      20   # data seg expansion stops                                   01756000
      21   # data seg contractions                                      01758000
      22   # timed-out stops                                            01760000
      23   #premptions                                                  01762000
      24   #stops on misc blocked i/o                                   01764000
                                                                        01766000
     << items 30-39 reserved for pause related info >>                  01768000
                                                                        01770000
      30   # pauses with nothing to do                                  01772000
      31   # pauses for disc                                            01774000
      32   # pauses for swap                                            01776000
      33   # pauses for both disc and swap                              01778000
      34   # of attempts at garbage collection                          01780000
$PAGE                                                                   01782000
                                                                        01784000
     << items 40-59 reserved for swap-in info >>                        01786000
                                                                        01788000
      40   # process swap-ins                                           01790000
      41   # memory allocations                                         01792000
      42   # times segment in motion in                                 01794000
      43   # recoveries of overlay candidates                           01796000
      44   # times at process queues                                    01798000
      45   # deferrals                                                  01800000
      46   # swapouts from swapq                                        01802000
      47   # swapouts from dispq                                        01804000
      48   # chops of locality of allocated process                     01806000
      49   # code segments released from main memory                    01808000
      50   # data segments released from main memory                    01810000
      51   # swapq delays                                               01812000
      52   # overlay candidates made recoverable overlay candidates     01814000
      53   # giveups due to more urgent activity pending                01816000
      54   # hardrequests                                               01818000
      55   # times found free space                                     01820000
      56   # swapq successes                                            01822000
      57   # dispq successes                                            01824000
                                                                        01826000
     << items 60-79 reserved for miscellaneous counters                 01828000
                                                                        01830000
      60   # lock requests                                              01832000
      61   # freeze requests                                            01834000
      62   # cancel msgs not processed                                  01836000
      63   # cancel msgs processed                                      01838000
      64   # garbage moves, background                                  01840000
      65   # garbage moves, allocate                                    01842000
      66   # garbage move giveups, preempted                            01844000
      67   # overlap seeks issued                                       01846000
      68   # clock cycles                                               01848000
      69   # makeroom succeses                                          01850000
                                                                        01852000
     << items 80-99 reserved for cpu time consumption info>>            01854000
                                                                        01856000
     80-81  cumulative time paused, idle                                01858000
     82-83  cumulative time paused, swap                                01860000
     84-85  cumulative time paused, disc                                01862000
     86-87  cumulative time paused, swap and disc                       01864000
     88-89  cumulative cpu time on processes                            01866000
     90-91  cumulative cpu time on memory allocation                    01868000
     92-93  cumulative cpu time on garbage collection                   01870000
     94-95  cumulative cpu time on garbage collection, allocation       01872000
$PAGE                                                                   01874000
   Subclass 1 : Disc Subsystem Activity Profile                         01876000
                                                                        01878000
    # entries = # of configured disc's                                  01880000
    entry length = 21                                                   01882000
                                                                        01884000
   item # in each entry                                                 01886000
                                                                        01888000
      0     logical device number                                       01890000
      1     #code segment read completions from this device             01892000
      2     #data segment read completions from this device             01894000
      3     #forced segment write completions to this device            01896000
      4     #background segment write completions to this device        01898000
      5     #blocked disc reads completed against this device           01900000
      6     #blocked disc writes completed to this device               01902000
      7     #unblocked,awake not set disc reads completed               01904000
      8     #unblocked,awake not set disc writes completed              01906000
      9     #unblocked,awake set disc reads completed                   01908000
     10     #unblocked,awake set disc writes completed                  01910000
     11     #buffer traps against this device                           01912000
     12     #times controller busy                                      01914000
     13     #control operations on this device                          01916000
     14     #times queue length = 0                                     01918000
     15     #times queue length = 1                                     01920000
     16     #times queue length = 2                                     01922000
     17     #times queue length = 3                                     01924000
     18     #times queue length = 4                                     01926000
     19     #times queue length = 5                                     01928000
     20     #times queue length = 6                                     01930000
                                                                        01932000
   Subclass 2 : Line Printer Activity Profile                           01934000
                                                                        01936000
    # entries = # of configured line printer's                          01938000
    entry length = 4                                                    01940000
                                                                        01942000
   item # in each entry                                                 01944000
                                                                        01946000
      0     logical device number                                       01948000
      1     #device reads                                               01950000
      2     #device writes                                              01952000
      3     #device control operations                                  01954000
   Subclass 3 : Mag Tape Activity Profile                               01956000
                                                                        01958000
    # entries = # of configured tape drives                             01960000
    entry length = 4                                                    01962000
                                                                        01964000
   item # in each entry                                                 01966000
                                                                        01968000
      0     logical device number                                       01970000
      1     #device reads                                               01972000
      2     #device writes                                              01974000
      3     #device control operations                                  01976000
$PAGE                                                                   01978000
Class 15 : Process Statistics                                           01980000
                                                                        01982000
 Subclass 0                                                             01984000
                                                                        01986000
   Entry Length = 52                                                    01988000
                                                                        01990000
   # entries = # of configured pcb entries                              01992000
                                                                        01994000
 item assignments for each subclass entry                               01996000
  0-3  program name                                                     01998000
  4-7  program group name                                               02000000
  8-11 program account name                                             02002000
  12   job or session number                                            02004000
  13   reason last stopped                                              02006000
  14   #stops sl faults                                                 02008000
  15   #stops, pbx faults                                               02010000
  16   #stops, data seg faults                                          02012000
  17   #stops, segment expansion                                        02014000
  18   #stops, blocked disc i/os issued                                 02016000
  19   #stops, unblocked disc i/os issued                               02018000
  20  #stops, blocked i/os waited on                                    02020000
  21  #stops, terminal read                                             02022000
  22  #stops, impeded)                                                  02024000
  23  #stops, time out (quantum expiration)                             02026000
  24  #stops, preempted                                                 02028000
  25  #stops, rin wait                                                  02030000
  26  # launches                                                        02032000
  27  #swapins                                                          02034000
  28  #overlays caused                                                  02036000
  29  #segment contractions                                             02038000
  30  #disc reads                                                       02040000
  31  #disc writes                                                      02042000
                                                                        02044000
  << items 32-52 reserved for double word counters >>                   02046000
                                                                        02048000
32-33 creation time of process                                          02050000
34-35 termination time of process                                       02052000
36-38 cumulative cpu time used                                          02054000
38-39 cumulative time paused, swap                                      02056000
40-41 cumulative time paused, disc                                      02058000
42-43 cumulative time paused, non-terminal i/o                          02060000
44-45 cumulative time paused, terminal read                             02062000
46-47 cumulative time paused, impeded                                   02064000
48-49 cumulative time paused, active (impeded, preempted)               02066000
50-51 cumulative words transfered, discs                                02068000
***************************************************************         02070000
*                                                             *         02072000
*                                                             *         02074000
*************************************************************>>         02076000
                                                                        02078000
BEGIN                                                                   02080000
                                                                        02082000
$INCLUDE INCLMEAS                                              <<04112>>02084000
$INCLUDE INCLMIFT                                              <<04112>>02086000
                                                                        02088000
INTRINSIC TIMER;                                               <<01741>>02090000
                                                               <<01741>>02092000
                                                               <<01741>>02094000
INTEGER STATUS = Q-1,                                                   02096000
        X = X,                                                 <<01836>>02098000
        S0 = S-0;                                                       02100000
                                                                        02102000
INTEGER POINTER CSTI = 1,                                               02104000
                DSTI = 2,                                      <<01741>>02106000
                PCBB = 3,                                      <<01741>>02108000
                IOQTBPTR = 5,                                  <<01836>>02110000
                DISCREQTBPTR = %31,                            <<01836>>02112000
                SYSGLOBEXT = %377;                             <<01741>>02114000
                                                                        02116000
                                                               <<01836>>02120000
EQUATE CCG = 0, <<GREATER THAN COND CODE>>                              02122000
       CCL = 1, <<LESS THAN COND CODE   >>                              02124000
       CCE = 2; <<EQUAT TO COND CODE    >>                              02126000
                                                                        02128000
EQUATE VDT'SIZE           = 11,  << ARRAY SIZE >>              <<03107>>02130000
       VDT'ENTRY0'SIZE    = 2,                                 <<03107>>02132000
       VDT'ENTRY'SIZE     = 2,                                 <<03107>>02134000
       VDT'NUM'DISCS      = 5,   << # OF KNOWN VALID DISCS >>  <<03107>>02136000
       VDT'NUM'TAPES      = 2,   << # OF KNOWN VALID TAPES >>  <<03107>>02138000
       VDT'NUM'LPS        = 1,   << # OF KNOWN VALID LPS >>    <<03107>>02140000
       VDT'NUM'ENT'IDX    = 0,                                 <<03107>>02142000
       VDT'ENT'SIZ'IDX    = 1,                                 <<03107>>02144000
       VDT'DEV'TYP'IDX    = 0,                                 <<03107>>02146000
       VDT'DEV'SUB'IDX    = 1,                                 <<03107>>02148000
       CS80'DISC'TYPE     = 3, << DEVICE TYPE FOR CS80 DISCS >><<03107>>02150000
       CS80'TAPE'TYPE     = 3, << DEVICE TYPE FOR CS80 TAPES >><<03107>>02152000
       CS80'7911'SUBTYPE  = 1,                                 <<03107>>02154000
       CS80'7912'SUBTYPE  = 2,                                 <<03107>>02156000
       CS80'7935'SUBTYPE  = 8,                                 <<03107>>02158000
       CS80'LINUS'SUBTYPE = 0,                                 <<03107>>02160000
       STD'DISC'TYPE      = 0,                                 <<03107>>02162000
       STD'TAPE'TYPE      = 24,                                <<03107>>02164000
       STD'LP'TYPE        = 32,                                <<03107>>02166000
       STD'FLOPPY'TYPE    = 2;                                 <<03107>>02168000
                                                               <<03107>>02170000
DEFINE ES    = (0:8)#,  << ENTRY SIZE FIELD OF VDT >>          <<03107>>02172000
       EZS   = (8:8)#,  << ENTRY0 SIZE FIELD OF VDT >>         <<03107>>02174000
       NMI   = (0:1)#,  << NEEDMOREINFO FLAG OF A VDT ENTRY >> <<03107>>02176000
       DTFLD = (1:15)#, << DEV TYPE OF VDT >>                  <<03107>>02178000
       WPE   = (0:8)#;  << WORDS PER ENTRY FIELD >>            <<03107>>02180000
                                                               <<03107>>02182000
DEFINE ABS               = ABSOLUTE#,                                   02184000
       ASMB              = ASSEMBLE#,                                   02186000
       CC                = STATUS.(6:2)#,                               02188000
       PDISABLE          = ASMB(PSDB)#,                                 02190000
       PENABLE           = ASMB(PSEB)#,                                 02192000
       TRAPOFF           = PUSH(STATUS);                                02194000
                           TOS.(2:1) := 0;                              02196000
                           SET(STATUS)#,                                02198000
       ENABLE            = ASMB(SED 1)#,                                02200000
       DISABLE           = ASMB(SED 0)#;                                02202000
                                                                        02204000
DEFINE CLASS0'SUB'OVHD   = CLASS0'SUBCLASSCNT+1+                        02206000
                           CLASS0'SUBCLASSCNT*                          02208000
                           STD'SUBCLASS'OVHD#,                          02210000
       CLASS1'SUB'OVHD   = CLASS1'SUBCLASSCNT+1+                        02212000
                           CLASS1'SUBCLASSCNT*                          02214000
                           STD'SUBCLASS'OVHD#,                          02216000
       CLASS0SIZE = CLASS0'SUB'OVHD+CLASS0'SUB0SIZE+                    02218000
                    CLASS0'SUB1SIZE*NUM'DISCS+                          02220000
                    CLASS0'SUB2SIZE*NUM'LPS+                            02222000
                    CLASS0'SUB3SIZE*NUM'TAPES#,                         02224000
                                                                        02226000
       CLASS1SIZE = CLASS1'SUB'OVHD+CLASS1'SUB0SIZE+                    02228000
                                    CLASS1'SUB1SIZE+                    02230000
                                    CLASS1'SUB2SIZE+                    02232000
                                    CLASS1'SUB3SIZE+                    02234000
                                    CLASS1'SUB4SIZE+                    02236000
                                    CLASS1'SUB5SIZE#,                   02238000
       CLASS15SIZE = (PCBB(0)+1)*CLASS15'SUB0SIZE#,            <<01741>>02240000
                                                                        02244000
       <<THIS IS USED TO GET PCLASSMASK OUT OF PXFIXED AREA>>  <<01741>>02246000
                                                                        02248000
       GETPCLASSMASK = PUSH(Q,DL);    <<GET REGISTERS>>                 02250000
                        ASMB(XCH;LSUB); <<-QREL OFFSET TO DL>> <<04313>>02252000
                       X := S0 - 2;   <<GET DL-B VALUE>>                02254000
                       TOS := PCBXFIXED(X); <<BASE PCBXFIXED>>          02256000
                        ASMB (LSUB);                           <<04313>>02258000
                       PCLASSMASK'IDX:=TOS+%100#, <<-QREL IDX>>         02260000
                                                                        02262000
       PCLASSENABLEMASK = PCBXFIXED(PCLASSMASK'IDX)#,                   02264000
                                                                        02266000
       NUM'DEVICETYPES  = TOTAL'DEVICES(0)#,                            02268000
       NUM'DISCS        = TOTAL'DEVICES(1)#,                            02270000
       NUM'LPS          = TOTAL'DEVICES(2)#,                            02272000
       NUM'TAPES        = TOTAL'DEVICES(3)#,                            02274000
       NUM'TERMS        = TOTAL'DEVICES(4)#;                            02276000
                                                               <<01741>>02278000
DEFINE GLOBALMASK = (0:1)#,                                    <<01741>>02280000
       PROCMASK   = (15:1)#,                                   <<01741>>02282000
       GLOBALSTATSENBLD = GCLASSENABLEDMASK.GLOBALMASK <> 0#,  <<01741>>02284000
       GLOBALSTATREQ    = CLASSMASK.GLOBALMASK <> 0#,          <<01741>>02286000
       PROCSTATSENBLD   = GCLASSENABLEDMASK.PROCMASK <> 0#,    <<01741>>02288000
       PROCSTATREQ      = CLASSMASK.PROCMASK <> 0#;            <<01741>>02290000
<< EXTERNAL PROCEDURE DECLARATIONS >>                                   02294000
                                                                        02296000
PROCEDURE FREEZE(EN,TEST,PINX);                                         02298000
   VALUE      EN,TEST,PINX;                                             02300000
   INTEGER    EN,PINX;                                                  02302000
   LOGICAL    TEST;                                                     02304000
   OPTION     UNCALLABLE,PRIVILEGED,EXTERNAL;                           02306000
                                                                        02308000
INTEGER PROCEDURE GETDATASEG(MEMSIZE,VDSIZE);                           02310000
   VALUE      MEMSIZE,VDSIZE;                                           02312000
   INTEGER    MEMSIZE,VDSIZE;                                           02314000
   OPTION     UNCALLABLE,PRIVILEGED,EXTERNAL;                           02316000
                                                                        02318000
PROCEDURE LOCKSEG(EN,TEST,PINX);                                        02320000
   VALUE      EN,TEST,PINX;                                             02322000
   INTEGER    EN,PINX;                                                  02324000
   LOGICAL    TEST;                                                     02326000
   OPTION     UNCALLABLE,PRIVILEGED,EXTERNAL;                           02328000
                                                                        02330000
PROCEDURE UNFREEZE(EN,TEST,PINX);                                       02332000
   VALUE      EN,TEST,PINX;                                             02334000
   INTEGER    EN,PINX;                                                  02336000
   LOGICAL    TEST;                                                     02338000
   OPTION     UNCALLABLE,PRIVILEGED,EXTERNAL;                           02340000
                                                                        02342000
PROCEDURE UNLOCKSEG(EN,TEST,PINX);                                      02344000
   VALUE      EN,TEST,PINX;                                             02346000
   INTEGER    EN,PINX;                                                  02348000
   LOGICAL    TEST;                                                     02350000
   OPTION     UNCALLABLE,PRIVILEGED,EXTERNAL;                           02352000
                                                                        02354000
PROCEDURE RELDATASEG(EN);                                               02356000
   VALUE      EN;                                                       02358000
   INTEGER    EN;                                                       02360000
   OPTION     UNCALLABLE,PRIVILEGED,EXTERNAL;                           02362000
                                                                        02364000
LOGICAL PROCEDURE GETSIR(N);                                            02366000
   VALUE      N;                                                        02368000
   LOGICAL    N;                                                        02370000
   OPTION     EXTERNAL;                                                 02372000
                                                                        02374000
PROCEDURE RELSIR(N,T);                                                  02376000
   VALUE      N,T;                                                      02378000
   LOGICAL    N,T;                                                      02380000
   OPTION     EXTERNAL;                                                 02382000
                                                                        02384000
LOGICAL PROCEDURE EXCHANGEDB(IDX);                                      02386000
   VALUE IDX;                                                           02388000
   INTEGER IDX;                                                         02390000
   OPTION EXTERNAL,PRIVILEGED;                                          02392000
                                                                        02394000
PROCEDURE HELP;                                                         02396000
   OPTION EXTERNAL;                                                     02398000
                                                                        02400000
INTEGER PROCEDURE GETENTRY(TYPE);                                       02402000
   VALUE TYPE;                                                          02404000
   INTEGER TYPE;                                                        02406000
   OPTION EXTERNAL;                                                     02408000
                                                                        02410000
PROCEDURE DELAY(T);                                                     02412000
   VALUE T;                                                             02414000
   DOUBLE T;                                                            02416000
   OPTION EXTERNAL;                                                     02418000
                                                                        02420000
                                                                        02422000
INTEGER PROCEDURE BUILDSEGID(SEGTYPE, SEGNUMBER, PIN);                  02424000
   VALUE SEGTYPE, SEGNUMBER, PIN;                                       02426000
   INTEGER SEGTYPE, SEGNUMBER, PIN;                                     02428000
   OPTION EXTERNAL;                                                     02430000
                                                                        02432000
INTEGER PROCEDURE CONVSEGIDTOSTINX(SEGIDENTIFIER);                      02434000
   VALUE SEGIDENTIFIER;                                                 02436000
   LOGICAL SEGIDENTIFIER;                                               02438000
   OPTION EXTERNAL;                                                     02440000
DOUBLE PROCEDURE ATTACHIO(LDEV,QMISC,DSTX,ADDR,FUNC,CNT,       <<01741>>02442000
                          P1,P2,FLAGS);                        <<01741>>02444000
  <<CONSTRUCT IOQ ENTRY FOR DISC I/O REQUEST>>                 <<01741>>02446000
  VALUE LDEV,QMISC,DSTX,ADDR,FUNC,CNT,P1,P2,FLAGS;             <<01741>>02448000
  INTEGER  ADDR,   <<OFFSET TO DATA IN DATA SEGMENT,         >><<01741>>02450000
                   <<OFFSET TO DATA FROM DB IN CALLERS STACK,>><<01741>>02452000
                    <<OR INDEX TO A SYSTEM NAMEBUF           >><<01741>>02454000
            CNT,    <<DATA TRANSFER COUNT, + => WORDS,>>       <<01741>>02456000
                    <<                     - => BYTES >>       <<01741>>02458000
           DSTX,    <<DST NUMBER OF DATA SEGMENT>>             <<01741>>02460000
           FUNC,    <<I/O FUCNTION CODE, 0:READ, 1:WRITE>>     <<01741>>02462000
          FLAGS,    <<CONTROL AND SPECIFICATION FLAGS>>        <<01741>>02464000
           LDEV,    <<LOGICAL DEVICE NUMBER>>                  <<01741>>02466000
          QMISC,    <<MISC. PARAMETER FOR THE DEVICE>>         <<01741>>02468000
             P1,    <<DEVICE DEP. PARM -- HODA FOR DISC>>      <<01741>>02470000
             P2;    <<DEVICE DEP. PARM -- LODA FOR DISC>>      <<01741>>02472000
  OPTION UNCALLABLE,PRIVILEGED;                                <<01741>>02474000
  OPTION EXTERNAL;    <<LOCATED IN MPE SEGMENT "HARDRES" (55)>><<01741>>02476000
                                                               <<01741>>02478000
LOGICAL PROCEDURE CHECKALIVE(PIN);                             <<01741>>02480000
   VALUE PIN;                                                  <<01741>>02482000
   INTEGER PIN;                                                <<01741>>02484000
   OPTION PRIVILEGED,EXTERNAL;                                 <<01741>>02486000
                                                               <<01741>>02488000
$PAGE "MPE IV MEASUREMENT INTERFACE (INITVDT)"                 <<03107>>02490000
PROCEDURE INITVDT(TYPE,VDT);                                   <<03107>>02492000
   VALUE TYPE;                                                 <<03107>>02494000
   INTEGER TYPE;                                               <<03107>>02496000
   LOGICAL ARRAY VDT;                                          <<03107>>02498000
   OPTION PRIVILEGED;                                          <<03107>>02500000
                                                               <<03107>>02502000
                                                               <<03107>>02504000
COMMENT                                                        <<03107>>02506000
*************************************************************  <<03107>>02508000
INITVDT will initialize the logical array VDT (VALID DEVICE    <<03107>>02510000
TABLE) with entries of "valid" device TYPES and SUBTYPES.      <<03107>>02512000
The definition of "valid" are those devices the measurement    <<03107>>02514000
interface knows about when measuring I/O performance. In ad-   <<03107>>02516000
dition to type and subtype entries INITVDT will also set a     <<03107>>02518000
flag  (NEEDMOREINFO) true to indicate to the user of the       <<03107>>02520000
table that the device TYPE entry is not sufficient info to     <<03107>>02522000
terminate a search through remainder of VDT (example: type 0   <<03107>>02524000
for devices in DISC class is sufficient info to determine      <<03107>>02526000
whether or not the searcher has found a "valid" device and     <<03107>>02528000
therefore NEEDMOREINFO will be false). It is imperative        <<03107>>02530000
that this procedure be modified any time a new device          <<03107>>02532000
is supported by MPE and falls into the DISC, MAGTAPE,          <<03107>>02534000
or LP device class.                                            <<03107>>02536000
                                                               <<03107>>02538000
Input Parameters:                                              <<03107>>02540000
                                                               <<03107>>02542000
   TYPE:    1=DISC,                                            <<03107>>02544000
            2=LP,                                              <<03107>>02546000
            3=MAGTAPE,                                         <<03107>>02548000
                                                               <<03107>>02550000
Output Parameters: VDT                                         <<03107>>02552000
                                                               <<03107>>02554000
       +-----------------------------+                         <<03107>>02556000
  --   |      # OF ENTRIES           | VDT'NUM'ENT'IDX         <<03107>>02558000
ENTRY0 |-----------------------------|                         <<03107>>02560000
  --   | #WORDS/ENTRY | ENTRY 0 SIZE ! VDT'ENT'SIZ'IDX         <<03107>>02562000
       |-----------------------------|                         <<03107>>02564000
  --   |N|      DEVICE TYPE          | VDT'DEV'TYP'IDX         <<03107>>02566000
ENTRY1 |-----------------------------|                         <<03107>>02568000
  --   |      DEVICE SUBTYPE         | VDT'DEV'SUB'IDX         <<03107>>02570000
       |-----------------------------|                         <<03107>>02572000
  --   |N|      DEVICE TYPE          |                         <<03107>>02574000
ENTRY2 |-----------------------------|                         <<03107>>02576000
  --   |      DEVICE SUBTYPE         |                         <<03107>>02578000
       |-----------------------------|                         <<03107>>02580000
                    .                                          <<03107>>02582000
                    .                                          <<03107>>02584000
       |-----------------------------|                         <<03107>>02586000
LAST-  |N|      DEVICE TYPE          |                         <<03107>>02588000
ENTRY  |-----------------------------|                         <<03107>>02590000
       |      DEVICE SUBTYPE         |                         <<03107>>02592000
       +-----------------------------+                         <<03107>>02594000
                                                               <<03107>>02596000
        N = (0:1) = 1 ==>NEEDMOREINFO                          <<03107>>02598000
                  = 0 ==>DEVICE TYPE IS                        <<03107>>02600000
                         ENOUGH INFO                           <<03107>>02602000
                                                               <<03107>>02604000
                                                               <<03107>>02606000
OPERATION:                                                     <<03107>>02608000
                                                               <<03107>>02610000
INITVDT will initialize the table based on the input           <<03107>>02612000
parameter TYPE. The appropriate initialization will be         <<03107>>02614000
done via a case statement on TYPE. The array size of           <<03107>>02616000
the VDT (VDT'SIZE) will be fixed at the size required          <<03107>>02618000
to table the class of devices with the most known              <<03107>>02620000
valid devices.                                                 <<03107>>02622000
                                                               <<03107>>02624000
*************************************************************  <<03107>>02626000
;                                                              <<03107>>02628000
                                                               <<03107>>02630000
BEGIN                                                          <<03107>>02632000
                                                               <<03107>>02634000
INTEGER I;        << USED AS ENTRY IDX TO VDT >>               <<03107>>02636000
I := 0;                                                        <<03107>>02638000
VDT(VDT'ENT'SIZ'IDX).WPE := VDT'ENTRY'SIZE;                    <<03107>>02640000
VDT(VDT'ENT'SIZ'IDX).EZS  := VDT'ENTRY0'SIZE;                  <<03107>>02642000
                                                               <<03107>>02644000
CASE TYPE OF                                                   <<03107>>02646000
BEGIN                                                          <<03107>>02648000
   ;     << 0 >>                                               <<03107>>02650000
   BEGIN << 1 >>                                               <<03107>>02652000
   VDT(VDT'NUM'ENT'IDX)    := VDT'NUM'DISCS;                   <<03107>>02654000
                                                               <<03107>>02656000
   I := I+VDT'ENTRY'SIZE;  << ENTRY 1 >>                       <<03107>>02658000
   VDT(I)     := STD'DISC'TYPE;                                <<03107>>02660000
   VDT(I).NMI := 0;                                            <<03107>>02662000
   VDT(I+1)   := 0;        << SUBTYPE IS NOT NEEDED >>         <<03107>>02664000
                                                               <<03107>>02666000
   I := I+VDT'ENTRY'SIZE;  << ENTRY 2 >>                       <<03107>>02668000
   VDT(I)     := STD'FLOPPY'TYPE;                              <<03107>>02670000
   VDT(I).NMI := 0;                                            <<03107>>02672000
   VDT(I+1)   := 0;        << SUBTYPE IS NOT NEEDED >>         <<03107>>02674000
                                                               <<03107>>02676000
   I := I+VDT'ENTRY'SIZE;  << ENTRY 3 >>                       <<03107>>02678000
   VDT(I)     := CS80'DISC'TYPE;                               <<03107>>02680000
   VDT(I).NMI := 1;        << NEED MORE INFO >>                <<03107>>02682000
   VDT(I+1)   := CS80'7911'SUBTYPE;                            <<03107>>02684000
                                                               <<03107>>02686000
   I := I+VDT'ENTRY'SIZE;  << ENTRY 4 >>                       <<03107>>02688000
   VDT(I)     := CS80'DISC'TYPE;                               <<03107>>02690000
   VDT(I).NMI := 1;        << NEED MORE INFO >>                <<03107>>02692000
   VDT(I+1)   := CS80'7912'SUBTYPE;                            <<03107>>02694000
                                                               <<03107>>02696000
   I := I+VDT'ENTRY'SIZE;  << ENTRY 5 >>                       <<03107>>02698000
   VDT(I)     := CS80'DISC'TYPE;                               <<03107>>02700000
   VDT(I).NMI := 1;        << NEED MORE INFO >>                <<03107>>02702000
   VDT(I+1)   := CS80'7935'SUBTYPE;                            <<03107>>02704000
   END; << CASE 1 >>                                           <<03107>>02706000
                                                               <<03107>>02708000
   BEGIN << CASE 2 = LP DEVICES >>                             <<03107>>02710000
   VDT(VDT'NUM'ENT'IDX) := VDT'NUM'LPS;                        <<03107>>02712000
   I := I+VDT'ENTRY'SIZE;  << ENTRY 1 >>                       <<03107>>02714000
   VDT(I)     := STD'LP'TYPE;                                  <<03107>>02716000
   VDT(I).NMI := 0;                                            <<03107>>02718000
   VDT(I+1)   := 0;        << SUBTYPE NOT NEEDED >>            <<03107>>02720000
   END; << CASE 2 >>                                           <<03107>>02722000
                                                               <<03107>>02724000
   BEGIN << CASE 3 = MAGTAPE DEVICES >>                        <<03107>>02726000
   VDT(VDT'NUM'ENT'IDX) := VDT'NUM'TAPES;                      <<03107>>02728000
   I := I+VDT'ENTRY'SIZE;  << ENTRY 1 >>                       <<03107>>02730000
   VDT(I)     := STD'TAPE'TYPE;                                <<03107>>02732000
   VDT(I).NMI := 0;                                            <<03107>>02734000
   VDT(I+1)   := 0;        << SUBTYPE IS NOT NEEDED >>         <<03107>>02736000
   I := I+VDT'ENTRY'SIZE;  << ENTRY 2 >>                       <<03107>>02738000
   VDT(I)     := CS80'TAPE'TYPE;                               <<03107>>02740000
   VDT(I).NMI := 1;        << NEED MORE INFO >>                <<03107>>02742000
   VDT(I+1)   := CS80'LINUS'SUBTYPE;                           <<03107>>02744000
   END; << CASE 3 >>                                           <<03107>>02746000
END; << CASE CODE >>                                           <<03107>>02748000
END; << INITVDT >>                                             <<03107>>02750000
$PAGE "MPE IV MEASUREMENT INTERFACE (FINDDEVICES)"                      02752000
PROCEDURE FINDDEVICES(TYPE,LDEV'NO);                                    02754000
  VALUE TYPE;                                                           02756000
  INTEGER TYPE;                                                <<02535>>02758000
  INTEGER ARRAY LDEV'NO;  <<(0:1)=no. of devs(1:nn)=ldev no's>>         02760000
  OPTION PRIVILEGED, UNCALLABLE;                               <<04113>>02762000
                                                                        02764000
COMMENT                                                        <<02535>>02766000
***************************************************************<<02535>>02768000
**   FINDDEVICES: Find # of and ldev no's of requested class **         02770000
-------------------------------------------------------------**         02772000
** This procedure examines the logical-physical device table **         02774000
** and the logical device table to find the #of devices and  **         02776000
** ldev #'s of the devices in the requested class (TYPE).This**         02778000
** info is passed backed to the caller in LDEV'NO.           **         02780000
** INPUT PARAMETER:                                          **<<02535>>02782000
**                                                           **<<02535>>02784000
**   TYPE: = 1 ==> DISC                                      **<<02535>>02786000
**         = 2 ==> LP                                        **<<02535>>02788000
**         = 3 ==> MAGTAPE                                   **<<02535>>02790000
**         = 4 ==> TERMINAL                                  **<<02535>>02792000
**         = 5 ==> INP                                       **<<02535>>02794000
**         = 6 ==> DS                                        **<<02535>>02796000
**         = 7 ==> MRJE                                      **<<02535>>02798000
**         = 8 ==> HSI                                       **<<02535>>02800000
**         = 9 ==> SSLC                                      **<<02535>>02802000
**                                                           **<<02535>>02804000
***************************************************************<<02535>>02806000
;                                                              <<02535>>02808000
                                                                        02810000
BEGIN                                                                   02812000
EQUATE    DEVTYPEOFFSET  = 2,                                           02814000
          DEVSUBOFFSET   = 1,  <<IDX TO LPDT>>                 <<03107>>02816000
          LDTMOVECOUNT   = 128,                                         02818000
          LOCLDTSIZE     = LDTMOVECOUNT-1,                              02820000
          LDTDSTNUMBER   = 14, << LOGICAL DEVICE TABLE DST # >>         02822000
          LPDT'PTR       = %10, <<PTR TO LPDT>>                         02824000
          LPDTENTRYSIZE  = 2;                                           02826000
                                                                        02828000
DEFINE    ADJ'LDEV       = (LDEV-LDTBASEENTRY)#,                        02830000
          DEV'TYPE       = (10:6)#,                                     02832000
          SUB'TYPE       = (12:4)#, << FIELD IN LPDT >>        <<03107>>02834000
          DIT'POINTER    = LPDTWORD.(1:15)#,                            02836000
          DISC'DEVICE    = 0#,                                          02838000
          LINEPRINTER'DEVICE = 32#,                                     02840000
          MAGTAPE'DEVICE  = 24#,                                        02842000
          TERMINAL'DEVICE = 16#,                                        02844000
          INP'DEVICE      = 17#,                               <<02535>>02846000
          DS'DEVICE       = 41#,                               <<02535>>02848000
          MRJE'DEVICE     = 22#,                               <<02535>>02850000
          HSI'DEVICE      = 19#,                               <<02535>>02852000
          SSLC'DEVICE     = 18#,                               <<02535>>02854000
          MAX'LDEV        = INTEGER(LPDT(0).(0:8))#,                    02856000
          NUM'DEVICES     = LDEV'NO#,                                   02858000
          VIRTUAL'DEVICE  = LPDTWORD.(0:1)#,                            02860000
          VALID'ENTRY     = NOT VIRTUAL'DEVICE AND                      02862000
                            DIT'POINTER <> 0#;                          02864000
                                                                        02866000
LOGICAL   ERROR,    <<TRUE: UNABLE TO EXAMINE ALL DEVICES>>             02868000
          VALIDDEVICE, << TRUE, FOUND ENTRY IN VDT >>          <<03107>>02870000
          LPDTWORD; <<WORD FROM LOGICAL PHYSICAL DEVICE TABLE>>         02872000
                                                                        02874000
INTEGER   DEVICETYPE,      <<DEVICE TYPE FIELD FROM LDT ENTRY>>         02876000
          DEVICESUBTYPE,  << DEVICE SUBTYPE FROM LDT ENTRY >>  <<03107>>02878000
          LDEV,            <<LOOP VARIABLE>>                            02880000
          LDTBASEENTRY,    <<1ST LDT ENTRY IN LOCAL COPY>>              02882000
          LDTENTRYSIZE,    <<SIZE OF LDT ENTRY>>                        02884000
          LDTLASTENTRY,    <<LAST LDT ENTRY IN LOCAL COPY>>             02886000
          I,                                                   <<03107>>02888000
          REQUESTED'DEVICE'TYPE;  << "DEVICE TYPE" OF CLASS  >>         02890000
                                                                        02892000
LOGICAL ARRAY VDT(0:VDT'SIZE);    << PASSED TO INITVDT >>      <<03107>>02894000
LOGICAL ARRAY LDT(0:LOCLDTSIZE);  <<LOCAL COPY OF LDT TABLE>>           02896000
LOGICAL POINTER LPDT = LPDT'PTR;  <<POINTER TO LPDT>>                   02898000
INTEGER ARRAY IVDT(*) = VDT;  <<INTEGER OF VDT>>               <<03107>>02900000
                                                                        02902000
LDEV'NO:=0;                                                             02904000
NUM'DEVICES:=0;                                                         02906000
IF NOT (1 <= TYPE <= 3)  THEN  RETURN;                         <<03107>>02908000
                                                                        02910000
TOS := @LDT;           << SET UP MOVE FOR MFDS, LOCAL COPY >>           02912000
TOS := LDTDSTNUMBER;   << DST # OF LDT >>                               02914000
TOS := 0;              << OFFSET INTO DST >>                            02916000
TOS := LDTMOVECOUNT;   << LENGTH OF MOVE >>                             02918000
ASSEMBLE(MFDS 4);      << COPY IN LDT >>                                02920000
                                                                        02922000
LDTENTRYSIZE := LDT(0).(8:8);                                           02924000
LDTBASEENTRY := 0;                                                      02926000
LDTLASTENTRY := LDTMOVECOUNT/LDTENTRYSIZE;                              02928000
                                                                        02930000
<< INITIALIZE VDT FOR THIS CLASS OF DEVICES >>                 <<03107>>02934000
INITVDT(TYPE,VDT);                                             <<03107>>02936000
                                                                        02938000
<<SCAN LPDT AND LDT TO FIND ALL DISCS, MAG TAPES, & LP'S>>              02940000
FOR LDEV := 1 UNTIL MAX'LDEV DO                                         02942000
  BEGIN                                                                 02944000
  LPDTWORD := LPDT(LDEV*LPDTENTRYSIZE);                                 02946000
  IF VALID'ENTRY THEN                                                   02948000
      BEGIN                                                             02950000
      <<GUARANTEE LDT ENTRY IS IN LOCAL COPY OF TABLE>>                 02952000
      IF LDEV >= LDTLASTENTRY THEN                                      02954000
        BEGIN                                                           02956000
        TOS := @LDT;              << SET UP MOVE FOR MFDS,>>            02958000
        TOS := LDTDSTNUMBER;      << DST # OD LDT >>                    02960000
        TOS := LDEV*LDTENTRYSIZE; << OFFSET INTO DST >>                 02962000
        TOS := LDTMOVECOUNT;      << LENGTH OF MOVE >>                  02964000
        ASSEMBLE(MFDS 4);       << COPY IN LDT >>                       02966000
        LDTBASEENTRY := LDEV;                                           02968000
        LDTLASTENTRY := LDTBASEENTRY+LDTMOVECOUNT/LDTENTRYSIZE;         02970000
        END;                                                   <<02530>>02972000
     <<DETERMINE IF LDEV IS A DEVICE OF INTEREST>>             <<02530>>02976000
     DEVICETYPE := LDT(ADJ'LDEV*LDTENTRYSIZE+                  <<02530>>02978000
                       DEVTYPEOFFSET).DEV'TYPE;                <<02530>>02980000
     DEVICESUBTYPE := LPDT(LDEV*LPDTENTRYSIZE+                 <<03107>>02982000
                            DEVSUBOFFSET).SUB'TYPE;            <<03107>>02984000
      I := 0;                                                  <<03107>>02986000
      DO BEGIN                                                 <<03107>>02988000
         VALIDDEVICE := FALSE;                                 <<03107>>02990000
         I := I + VDT'ENTRY'SIZE;                              <<03107>>02992000
         IF DEVICETYPE = IVDT(I+VDT'DEV'TYP'IDX).DTFLD THEN    <<03107>>02994000
            BEGIN << HAVE A VALID DEVICE TYPE >>               <<03107>>02996000
            IF VDT(I+VDT'DEV'TYP'IDX).NMI THEN                 <<03107>>02998000
               BEGIN << NEED MORE INFO ON SUBTYPE >>           <<03107>>03000000
               IF DEVICESUBTYPE = IVDT(I+VDT'DEV'SUB'IDX) THEN <<03107>>03002000
                  VALIDDEVICE := TRUE;                         <<03107>>03004000
               END                                             <<03107>>03006000
             ELSE                                              <<03107>>03008000
               VALIDDEVICE := TRUE;                            <<03107>>03010000
            IF VALIDDEVICE THEN                                <<03107>>03012000
               LDEV'NO(NUM'DEVICES:=NUM'DEVICES+1):=LDEV;      <<03107>>03014000
            END;                                               <<03107>>03016000
                                                               <<03107>>03018000
         END                                                   <<03107>>03020000
      UNTIL VALIDDEVICE LOR                                    <<03107>>03022000
            (I >= IVDT(VDT'NUM'ENT'IDX)*VDT'ENTRY'SIZE);       <<03107>>03024000
      END;                                                              03030000
  END;                                                                  03032000
END;  <<FINDDEVICES>>                                                   03034000
$PAGE "MPE IV MEASUREMENT INTERFACE  (GETPCBXMEASINFO)"        <<01741>>03036000
PROCEDURE GETPCBXMEASINFO(PIN,PCBXMEASINFO);                   <<01741>>03038000
   VALUE PIN;                                                  <<01741>>03040000
   LOGICAL ARRAY PCBXMEASINFO;                                 <<01741>>03042000
   INTEGER PIN;                                                <<01741>>03044000
   OPTION PRIVILEGED, UNCALLABLE;                              <<04113>>03046000
                                                               <<01741>>03048000
                                                               <<01741>>03050000
COMMENT                                                        <<01741>>03052000
************************************************************** <<01741>>03054000
THIS PROCEDURE WILL RETRIEVE INFORMATION FOR A PIN FROM THE    <<01741>>03056000
PROCESSES PCB ENTRY AND THE PCBX FIXED AREA. IT WILL NOT       <<01741>>03058000
RETRIEVE ANY DATA FROM THE PCBX AREA FOR SYSTEM PROCESSES.     <<01741>>03060000
                                                               <<01741>>03062000
INPUT PARAMETERS:                                              <<01741>>03064000
                                                               <<01741>>03066000
   PIN: PIN FOR WHICH INFORMATION IS REQUESTED OF              <<01741>>03068000
                                                               <<01741>>03070000
OUTPUT PARAMETER:                                              <<01741>>03072000
                                                               <<01741>>03074000
   PCBXMEASINFO: ARRAY IN WHICH INFORMATION IS RETURNED        <<01741>>03076000
     (0) = JOB/SESSIO NUMBER FROM PCB, (0:2)=1>SESSION         <<01741>>03078000
                                            =2>JOB             <<01741>>03080000
     (1).(0:4) = PROCESESS QUEUE, (0:1)=1 ==> L, (1:1)=1 ==> C <<01741>>03082000
                                  (2:1)=1 ==> D, (3:1)=1 ==> E <<01741>>03084000
     (1).(4:12) = STOPTYPE FROM PCBXFIXED(%101-REASON STOPPED) <<01741>>03086000
     (2) = STOPTIME FROM PCBXFIXED(%102)  TIME PROCESS STOPPED <<01741>>03088000
           DOUBLE WORD FROM TIMER                              <<01741>>03090000
                                                               <<01741>>03092000
RETURN VALUES:                                                 <<01741>>03094000
                                                               <<01741>>03096000
     CC = CCL ==> NOT A VALID PROCESS                          <<01741>>03098000
     CC = CCE ==> OK                                           <<01741>>03100000
     CC = CCG ==> NOT USED                                     <<01741>>03102000
                                                               <<01741>>03104000
OPERATION:                                                     <<01741>>03106000
                                                               <<01741>>03108000
THIS PROCEDURE WILL RETURN THE NECESSARY INFORMATION REQUIRED  <<01741>>03110000
TO INITIALIZE AN ENTRY IN THE PROCESS LEVEL MEASUREMENT XDS.   <<01741>>03112000
THE PROCEDURE WILL ONLY RETURN INFO FROM THE PCBX FOR A        <<01741>>03114000
NON-SYSTEM PROCESS,SINCE MOST INFORMATION IS NOT MAINTAINED    <<01741>>03116000
FOR SYSTEM PROCESSES. THIS PROCEDURE IS ONLY CALLED FROM       <<01741>>03118000
FORMATPROCSEG.THE PROCEDURES REQUIRES BOTH, THAT PIN IS A VALID<<01741>>03120000
PCB ENTRY NUMBER VERIFED BY CHECKALIVE, AND THAT THE CALLER IS <<01741>>03122000
HOLDING THE PCB SIR SO AS TO PREVENT THE PROCESS FROM DYING.   <<01741>>03124000
YOU MAY NOT BE PDISABLED WHEN CALLING THIS PROCEDURE DUE TO THE<<01741>>03126000
POSIBILITY OF TRAPPING ON A STACK.                             <<01741>>03128000
                                                               <<01741>>03130000
************************************************************** <<01741>>03132000
;                                                              <<01741>>03134000
                                                               <<01741>>03136000
BEGIN                                                          <<01741>>03138000
                                                               <<01741>>03140000
EQUATE PXGLOBSIZE   = %10, <<PCB EQUATES>>                     <<01741>>03142000
       PCB03        = 3,                                       <<01741>>03144000
       PCB09        = 9,                                       <<01741>>03146000
       PCB05        = 5,                                       <<01741>>03148000
       PCB13        = 13,                                      <<01741>>03150000
       PXF23        = %23,                                     <<01741>>03152000
       DPXF41       = %41, <<DOUBLE POINITER>>                 <<01741>>03154000
       PXF101       = %101,                                    <<01741>>03156000
       PXFIXEDSIZE  = %117;                                    <<01741>>03158000
                                                               <<01741>>03160000
LOGICAL ARRAY PCBXFBUFF(0:PXFIXEDSIZE-1); <<LOCAL COPY>>       <<01741>>03162000
                                                               <<01741>>03164000
DOUBLE ARRAY  DPCBXFBUFF(*) = PCBXFBUFF,  <<LOCAL COPY, DBL>>  <<01741>>03166000
              DPCBXMEASINFO(*) = PCBXMEASINFO;                 <<01741>>03168000
                                                               <<01741>>03170000
DEFINE JSNUMBER    = PCBXMEASINFO(0)#,                         <<01741>>03172000
       PROCQUEUE   = PCBXMEASINFO(1).(0:4)#,                   <<01741>>03174000
       STOPTYPE    = PCBXMEASINFO(1).(4:12)#,                  <<01741>>03176000
       STOPTIME    = DPCBXMEASINFO(1)#,                        <<01741>>03178000
       STKFLD      = (1:10)#,                                  <<01741>>03180000
       PTYPEFLD    = (6:3)#,  <<PROCESS TYPE>>                 <<01741>>03182000
       PCBSIZE     = PCBB(1)#,<<ENTRY SIZE>>                   <<01741>>03184000
       STACKDST    = PCBB(PIN*PCBSIZE+PCB03).STKFLD#,          <<01741>>03186000
       FSPTR       = PCBB(PIN*PCBSIZE+PCB05)#,                 <<01741>>03188000
       PROCESSTYPE =INTEGER(PCBB(PIN*PCBSIZE+PCB09).PTYPEFLD)#,<<01741>>03190000
       NOTSYSTEMPROCESS = PROCESSTYPE<>4 AND PROCESSTYPE <> 6#;<<01741>>03192000
                                                               <<01741>>03194000
<<***********************************************************>><<01741>>03196000
                                                               <<01741>>03198000
CC:=CCE;                                                       <<01741>>03200000
MOVE PCBXMEASINFO:=4(0);                                       <<01741>>03202000
MOVE PCBXFBUFF:=PXFIXEDSIZE(0);                                <<01741>>03204000
                                                               <<01741>>03206000
IF FSPTR <> 0 THEN                                             <<01741>>03208000
   BEGIN <<HAVE A VALID PROCESS>>                              <<01741>>03210000
   PROCQUEUE:=PCBB(PIN*PCBSIZE+PCB13).(1:4);                   <<01741>>03212000
   IF NOTSYSTEMPROCESS THEN                                    <<01741>>03214000
      BEGIN <<COPY PCBX>>                                      <<01741>>03216000
      TOS:=@PCBXFBUFF;                                         <<01741>>03218000
      TOS:=STACKDST;                                           <<01741>>03220000
      TOS:=PXGLOBSIZE;                                         <<01741>>03222000
      TOS:=PXFIXEDSIZE;                                        <<01741>>03224000
      ASMB(MFDS 4);                                            <<01741>>03226000
      JSNUMBER:=PCBXFBUFF(PXF23);                              <<01741>>03228000
      STOPTYPE:=PCBXFBUFF(PXF101);                             <<01741>>03230000
      STOPTIME:=DPCBXFBUFF(DPXF41);                            <<01741>>03232000
      END;                                                     <<01741>>03234000
   END                                                         <<01741>>03236000
ELSE                                                           <<01741>>03238000
   CC:=CCL; <<NOT A VALID PROCESS>>                            <<01741>>03240000
END;                                                           <<01741>>03242000
$PAGE "MPE IV MEASUREMENT INTERFACE    (FORMATSEG)"                     03244000
PROCEDURE FORMATSEG(MEASSTATXDS'SIZE,TOTAL'DEVICES,LDEVTAB);            03246000
  VALUE MEASSTATXDS'SIZE;                                               03248000
  INTEGER MEASSTATXDS'SIZE;                                             03250000
  INTEGER ARRAY TOTAL'DEVICES;                                          03252000
  LOGICAL ARRAY LDEVTAB;                                                03254000
  OPTION PRIVILEGED,UNCALLABLE;                                         03256000
                                                                        03258000
COMMENT                 FORMATSEG                                       03260000
*************************************************************           03262000
                                                                        03264000
  This procedure is used to intitialize and format the xds used         03266000
  for statistics gathering. This procedure is called only from          03268000
  STARTSTATISTICS.                                                      03270000
                                                                        03272000
  INPUT PARAMETERS:                                                     03274000
                                                                        03276000
                                                                        03278000
     MEASSTATXDS'SIZE:  SIZE OF THE DATA SEG TO BE FORMATTED            03280000
     TOTAL'DEVICES: (0:1) IS THE TOTAL # OF DEVICE TYPES THE            03282000
                    INTERFACE KNOWS ABOUT.                              03284000
                    (1) IS THE TOTAL # OF DISCS CONFIGURED              03286000
                    (2) IS THE TOTAL # OF LP'S CONFIG                   03288000
                    (3) IS THE TOTAL # OF TAPES CONFIG                  03290000
                    (4) WILL BE THE TOTAL # OF TERM CONFIG              03292000
     LDEVTAB: 256 WORD ARRAY INDEXED BY LDEV, CONTAING A                03294000
              MAPPING OF LDEVS TO A CLASS, SUBCLASS AND                 03296000
              ENTRY. IT IS FIRST USED TO COMPUTE THE ABS ADDR           03298000
              OF ITEM 0 (LDEVNUMBER) FOR EVERY LDEV ENTRY, ONCE         03300000
              THE LDEV NUMBER IS STORED AWAY, THE SEGMENT               03302000
              RELATIVE OFFSET TO THAT ITEM IS WRITTEN OVER              03304000
              THE ORIGINAL VALUE OF LDEVTAB. AFTER THIS IS              03306000
              DONE FOR ALL DEVICES A MTDS INSTRUCTION IS                03308000
              USED TO COPY THE NEW TABLE TO THE FIRST 256               03310000
              WORDS OF THE DATA SEGMENT.                                03312000
                                                                        03314000
  To avoid the possibity of stack overflow occuring to the              03316000
  calling process, an unbounded local array is defined to               03318000
  start at DB+0 and then DB is set to the xds, intialization is         03320000
  then done by indexing the the local array.                            03322000
*************************************************************           03324000
;                                                                       03326000
                                                                        03328000
BEGIN                                                                   03330000
                                                                        03332000
LOGICAL ARRAY MEASSTAT'XDS(*)=DB+0;  <<USED TO INIT POINTERS>>          03334000
                                                                        03336000
INTEGER DISCCNT,                                                        03338000
        LPCNT,                                                          03340000
        TAPECNT,                                                        03342000
        LOCALCLASS0,                                                    03344000
        CLASSBASE,     <<SEG REL OFFSET>>                               03346000
        SUBBASE,       <<SEG REL OFFSET TO ITEM0>>                      03348000
        ENTRYSIZE,                                                      03350000
        I;     <<UTILITY>>                                              03352000
                                                                        03354000
DEFINE STATBASE         = LDEVTABSIZE#, <<BASE OF STATS IN DS>>         03356000
       NUMCLASS'IDX     = STATBASE+0#,  <<IDX OF CLASS COUNT>>          03358000
       CLASS            = LDEVTAB(I).CFIELD#,                           03360000
       SUBCLASS         = LDEVTAB(I).SFIELD#,                           03362000
       ENTRYNUM         = LDEVTAB(I).EFIELD#,                           03364000
       CLASSBASE'IDX    = CLASS+1#,  <<OFFSET TO CLASS>>                03366000
       SUBBASE'IDX      = SUBCLASS+1#, <<OFFSET TO SUBCLASS>>           03368000
       INT              = INTEGER#,                                     03370000
                                                                        03372000
       << BEGIN CLASS0 DEFINITION >>                                    03374000
                                                                        03376000
       CLASS0'IDX       = STATBASE+1#,  <<INDEX OF CLASS0 PTR>>         03378000
       C0BASE           = MEASSTAT'XDS(CLASS0'IDX)+STATBASE#,           03380000
       C0'SUBCNT'IDX    = C0BASE#,                                      03382000
       C0'SUB0'IDX      = C0BASE+1#,                                    03384000
       C0'SUB1'IDX      = C0BASE+2#,                                    03386000
       C0'SUB2'IDX      = C0BASE+3#,                                    03388000
       C0'SUB3'IDX      = C0BASE+4#,                                    03390000
       C0'SUB0'ENTCNT   = MEASSTAT'XDS(C0'SUB0'IDX)+C0BASE#,            03392000
       C0'SUB0'ENTSIZE  = MEASSTAT'XDS(C0'SUB0'IDX)+C0BASE+1#,          03394000
       C0'SUB0'ENT0SIZE = MEASSTAT'XDS(C0'SUB0'IDX)+C0BASE+2#,          03396000
       C0'SUB1'ENTCNT   = MEASSTAT'XDS(C0'SUB1'IDX)+C0BASE#,            03398000
       C0'SUB1'ENTSIZE  = MEASSTAT'XDS(C0'SUB1'IDX)+C0BASE+1#,          03400000
       C0'SUB1'ENT0SIZE = MEASSTAT'XDS(C0'SUB1'IDX)+C0BASE+2#,          03402000
       C0'SUB2'ENTCNT   = MEASSTAT'XDS(C0'SUB2'IDX)+C0BASE#,            03404000
       C0'SUB2'ENTSIZE  = MEASSTAT'XDS(C0'SUB2'IDX)+C0BASE+1#,          03406000
       C0'SUB2'ENT0SIZE = MEASSTAT'XDS(C0'SUB2'IDX)+C0BASE+2#,          03408000
       C0'SUB3'ENTCNT   = MEASSTAT'XDS(C0'SUB3'IDX)+C0BASE#,            03410000
       C0'SUB3'ENTSIZE  = MEASSTAT'XDS(C0'SUB3'IDX)+C0BASE+1#,          03412000
       C0'SUB3'ENT0SIZE = MEASSTAT'XDS(C0'SUB3'IDX)+C0BASE+2#,          03414000
                                                                        03416000
       << BEGIN CLASS 1 DEFINITION >>                                   03418000
                                                                        03420000
       CLASS1'IDX       = STATBASE+2#,  <<INDEX OF CLASS1 PTR>>         03422000
       C1BASE           = MEASSTAT'XDS(CLASS1'IDX)+STATBASE#,           03424000
       C1'SUBCNT'IDX    = C1BASE#,                                      03426000
       C1'SUB0'IDX      = C1BASE+1#,                                    03428000
       C1'SUB1'IDX      = C1BASE+2#,                                    03430000
       C1'SUB2'IDX      = C1BASE+3#,                                    03432000
       C1'SUB3'IDX      = C1BASE+4#,                                    03434000
       C1'SUB4'IDX      = C1BASE+5#,                                    03436000
       C1'SUB5'IDX      = C1BASE+6#,                                    03438000
       C1'SUB0'ENTCNT   = MEASSTAT'XDS(C1'SUB0'IDX)+C1BASE#,            03440000
       C1'SUB0'ENTSIZE  = MEASSTAT'XDS(C1'SUB0'IDX)+C1BASE+1#,          03442000
       C1'SUB0'ENT0SIZE = MEASSTAT'XDS(C1'SUB0'IDX)+C1BASE+2#,          03444000
       C1'SUB1'ENTCNT   = MEASSTAT'XDS(C1'SUB1'IDX)+C1BASE#,            03446000
       C1'SUB1'ENTSIZE  = MEASSTAT'XDS(C1'SUB1'IDX)+C1BASE+1#,          03448000
       C1'SUB1'ENT0SIZE = MEASSTAT'XDS(C1'SUB1'IDX)+C1BASE+2#,          03450000
       C1'SUB2'ENTCNT   = MEASSTAT'XDS(C1'SUB2'IDX)+C1BASE#,            03452000
       C1'SUB2'ENTSIZE  = MEASSTAT'XDS(C1'SUB2'IDX)+C1BASE+1#,          03454000
       C1'SUB2'ENT0SIZE = MEASSTAT'XDS(C1'SUB2'IDX)+C1BASE+2#,          03456000
       C1'SUB3'ENTCNT   = MEASSTAT'XDS(C1'SUB3'IDX)+C1BASE#,            03458000
       C1'SUB3'ENTSIZE  = MEASSTAT'XDS(C1'SUB3'IDX)+C1BASE+1#,          03460000
       C1'SUB3'ENT0SIZE = MEASSTAT'XDS(C1'SUB3'IDX)+C1BASE+2#,          03462000
       C1'SUB4'ENTCNT   = MEASSTAT'XDS(C1'SUB4'IDX)+C1BASE#,            03464000
       C1'SUB4'ENTSIZE  = MEASSTAT'XDS(C1'SUB4'IDX)+C1BASE+1#,          03466000
       C1'SUB4'ENT0SIZE = MEASSTAT'XDS(C1'SUB4'IDX)+C1BASE+2#,          03468000
       C1'SUB5'ENTCNT   = MEASSTAT'XDS(C1'SUB5'IDX)+C1BASE#,            03470000
       C1'SUB5'ENTSIZE  = MEASSTAT'XDS(C1'SUB5'IDX)+C1BASE+1#,          03472000
       C1'SUB5'ENT0SIZE = MEASSTAT'XDS(C1'SUB5'IDX)+C1BASE+2#,          03474000
       STD'ENTRYCNT     = 2#; <<1 FOR ENTRY 0, 1 FOR DATA>>             03476000
                                                                        03478000
EQUATE CLASS0'OVHD = CLASS0'SUBCLASSCNT+1,                              03480000
       CLASS1'OVHD = CLASS1'SUBCLASSCNT+1,                              03482000
       ENTCNTIDX   = 0, <<WORD 0 OF ITEM 0>>                            03484000
       ENTSIZEIDX  = 1, <<WORD 1 OF ITEM 0>>                            03486000
       ENT0SIZEIDX = 2; <<WORD 2 OF ITEM 0>>                            03488000
                                                                        03490000
                                                                        03492000
<<INITIALIZE LOCAL VARIABLES ,THAT ARE STACK DB REL>>                   03494000
                                                                        03496000
LOCALCLASS0:=CLASS0SIZE;                                                03498000
DISCCNT:=NUM'DISCS;                                                     03500000
LPCNT  :=NUM'LPS;                                                       03502000
TAPECNT:=NUM'TAPES;                                                     03504000
                                                                        03506000
<<PUT DB TO BASE OF XDS>>                                               03508000
                                                                        03510000
EXCHANGEDB(MEASSTATXDS'NUM);    << POINT TO XDS >>                      03512000
                                                                        03514000
MEASSTAT'XDS(0) := 0;           <<MOVE 0 TO 1ST WORD OF XDS>>           03516000
TOS := 1;                       <<TARGET IN XDS FOR MOVE>>              03518000
TOS := 0;                       <<SOURCE IN XDS FOR MOVE>>              03520000
TOS := MEASSTATXDS'SIZE-1;      <<COUNT FOR MOVE>>                      03522000
ASMB(MOVE 3);                   <<ZERO OUT XDS>>                        03524000
                                                                        03526000
<<NOW INTITIALIZE ALL POINTERS IN XDS>>                                 03528000
                                                                        03530000
MEASSTAT'XDS(NUMCLASS'IDX)    := CLASSCOUNT;                            03532000
MEASSTAT'XDS(CLASS0'IDX)      := CLASSCOUNT+1;                          03534000
MEASSTAT'XDS(CLASS1'IDX)      := CLASSCOUNT+1+LOCALCLASS0;              03536000
MEASSTAT'XDS(C0'SUBCNT'IDX)   := CLASS0'SUBCLASSCNT;                    03538000
MEASSTAT'XDS(C0'SUB0'IDX)     := CLASS0'OVHD;                           03540000
MEASSTAT'XDS(C0'SUB1'IDX)     := CLASS0'SUB0SIZE+                       03542000
                                 STD'SUBCLASS'OVHD+                     03544000
                                 CLASS0'OVHD;                           03546000
MEASSTAT'XDS(C0'SUB2'IDX)     := CLASS0'SUB0SIZE+                       03548000
                                 CLASS0'SUB1SIZE*DISCCNT+               03550000
                                 STD'SUBCLASS'OVHD*2+                   03552000
                                 CLASS0'OVHD;                           03554000
MEASSTAT'XDS(C0'SUB3'IDX)     := CLASS0'SUB0SIZE+                       03556000
                                 CLASS0'SUB1SIZE*DISCCNT+               03558000
                                 CLASS0'SUB2SIZE*LPCNT+                 03560000
                                 STD'SUBCLASS'OVHD*3+                   03562000
                                 CLASS0'OVHD;                           03564000
MEASSTAT'XDS(C0'SUB0'ENTCNT)  := STD'ENTRYCNT;                          03566000
MEASSTAT'XDS(C0'SUB0'ENTSIZE) := CLASS0'SUB0SIZE;                       03568000
MEASSTAT'XDS(C0'SUB0'ENT0SIZE):= STD'SUBCLASS'OVHD;                     03570000
MEASSTAT'XDS(C0'SUB1'ENTCNT)  := 1+1*DISCCNT;                           03572000
MEASSTAT'XDS(C0'SUB1'ENTSIZE) := CLASS0'SUB1SIZE;                       03574000
MEASSTAT'XDS(C0'SUB1'ENT0SIZE):= STD'SUBCLASS'OVHD;                     03576000
MEASSTAT'XDS(C0'SUB2'ENTCNT)  := 1+1*LPCNT;                             03578000
MEASSTAT'XDS(C0'SUB2'ENTSIZE) := CLASS0'SUB2SIZE;                       03580000
MEASSTAT'XDS(C0'SUB2'ENT0SIZE):= STD'SUBCLASS'OVHD;                     03582000
MEASSTAT'XDS(C0'SUB3'ENTCNT)  := 1+1*TAPECNT;                           03584000
MEASSTAT'XDS(C0'SUB3'ENTSIZE) := CLASS0'SUB3SIZE;                       03586000
MEASSTAT'XDS(C0'SUB3'ENT0SIZE):= STD'SUBCLASS'OVHD;                     03588000
                                                                        03590000
<< INTITIALIZE CLASS1 POINTERS >>                                       03592000
                                                                        03594000
MEASSTAT'XDS(C1'SUBCNT'IDX):=CLASS1'SUBCLASSCNT;                        03596000
MEASSTAT'XDS(C1'SUB0'IDX):=CLASS1'OVHD;                                 03598000
MEASSTAT'XDS(C1'SUB1'IDX):=CLASS1'SUB0SIZE+                             03600000
                           STD'SUBCLASS'OVHD+                           03602000
                           CLASS1'OVHD;                                 03604000
MEASSTAT'XDS(C1'SUB2'IDX):=CLASS1'SUB0SIZE+                             03606000
                           CLASS1'SUB1SIZE+                             03608000
                           STD'SUBCLASS'OVHD*2+                         03610000
                           CLASS1'OVHD;                                 03612000
MEASSTAT'XDS(C1'SUB3'IDX):=CLASS1'SUB0SIZE+                             03614000
                           CLASS1'SUB1SIZE+                             03616000
                           CLASS1'SUB2SIZE+                             03618000
                           STD'SUBCLASS'OVHD*3+                         03620000
                           CLASS1'OVHD;                                 03622000
MEASSTAT'XDS(C1'SUB4'IDX):=CLASS1'SUB0SIZE+                             03624000
                           CLASS1'SUB1SIZE+                             03626000
                           CLASS1'SUB2SIZE+                             03628000
                           CLASS1'SUB3SIZE+                             03630000
                           STD'SUBCLASS'OVHD*4+                         03632000
                           CLASS1'OVHD;                                 03634000
MEASSTAT'XDS(C1'SUB5'IDX):=CLASS1'SUB0SIZE+                             03636000
                           CLASS1'SUB1SIZE+                             03638000
                           CLASS1'SUB2SIZE+                             03640000
                           CLASS1'SUB3SIZE+                             03642000
                           CLASS1'SUB4SIZE+                             03644000
                           STD'SUBCLASS'OVHD*5+                         03646000
                           CLASS1'OVHD;                                 03648000
MEASSTAT'XDS(C1'SUB0'ENTCNT)   :=  STD'ENTRYCNT;                        03650000
MEASSTAT'XDS(C1'SUB0'ENTSIZE)  :=  CLASS1'SUB0SIZE;                     03652000
MEASSTAT'XDS(C1'SUB0'ENT0SIZE) :=  STD'SUBCLASS'OVHD;                   03654000
MEASSTAT'XDS(C1'SUB1'ENTCNT)   :=  STD'ENTRYCNT;                        03656000
MEASSTAT'XDS(C1'SUB1'ENTSIZE)  :=  CLASS1'SUB1SIZE;                     03658000
MEASSTAT'XDS(C1'SUB1'ENT0SIZE) :=  STD'SUBCLASS'OVHD;                   03660000
MEASSTAT'XDS(C1'SUB2'ENTCNT)   :=  STD'ENTRYCNT;                        03662000
MEASSTAT'XDS(C1'SUB2'ENTSIZE)  :=  CLASS1'SUB2SIZE;                     03664000
MEASSTAT'XDS(C1'SUB2'ENT0SIZE) :=  STD'SUBCLASS'OVHD;                   03666000
MEASSTAT'XDS(C1'SUB3'ENTCNT)   :=  STD'ENTRYCNT;                        03668000
MEASSTAT'XDS(C1'SUB3'ENTSIZE)  :=  CLASS1'SUB3SIZE;                     03670000
MEASSTAT'XDS(C1'SUB3'ENT0SIZE) :=  STD'SUBCLASS'OVHD;                   03672000
MEASSTAT'XDS(C1'SUB4'ENTCNT)   :=  STD'ENTRYCNT;                        03674000
MEASSTAT'XDS(C1'SUB4'ENTSIZE)  :=  CLASS1'SUB4SIZE;                     03676000
MEASSTAT'XDS(C1'SUB4'ENT0SIZE) :=  STD'SUBCLASS'OVHD;                   03678000
MEASSTAT'XDS(C1'SUB5'ENTCNT)   :=  STD'ENTRYCNT;                        03680000
MEASSTAT'XDS(C1'SUB5'ENTSIZE)  :=  CLASS1'SUB5SIZE;                     03682000
MEASSTAT'XDS(C1'SUB5'ENT0SIZE) :=  STD'SUBCLASS'OVHD;                   03684000
                                                                        03686000
EXCHANGEDB(0);                                                          03688000
                                                                        03690000
<<FINALLY PUT LDEV #'S IN APPROPRIATE ENTRYS>>                          03692000
                                                                        03694000
I:=-1; <<INITIALIZE>>                                                   03696000
WHILE (I:=I+1) < 256 DO                                                 03698000
   BEGIN                                                                03700000
   IF LDEVTAB(I) <> 0 THEN                                              03702000
      BEGIN                                                             03704000
      TOS:=MEASSTATXDSBANK;                                             03706000
      TOS:=MEASSTATXDSBASE+LDEVTABSIZE;  <<GET BEYOND LDEVTAB>>         03708000
      TOS:=TOS+CLASSBASE'IDX;     <<ABS ADDR OF CLASSBASE PTR>>         03710000
      ASMB(LSEA);                 <<PULL OUT OFFSET TO CLASS >>         03712000
      CLASSBASE:=TOS;                                                   03714000
                                                                        03716000
      <<NOW GET SEGRELOFF FOR SUBCLASS>>                                03718000
                                                                        03720000
      TOS:=CLASSBASE-INT(CLASSBASE'IDX)+INT(SUBBASE'IDX);               03722000
      ASMB(LADD;LSEA);       <<ABS ADDR OF CLASSBASE PTR>>              03724000
      SUBBASE:=TOS+CLASSBASE;<<SEGREL OFFSET TO BASE OF SUB>>           03726000
                                                                        03728000
      TOS:=SUBBASE-CLASSBASE-INT(SUBBASE'IDX)+ENTSIZEIDX;               03730000
      ASMB(LADD;LSEA);                                                  03732000
      ENTRYSIZE:=TOS;                                                   03734000
                                                                        03736000
      TOS:=(INT(ENTRYNUM)-1)*ENTRYSIZE+ENT0SIZEIDX;                     03738000
      ASMB(LADD); <<TOS NOW HAS ABS ADDR OF ITEM0>>                     03740000
      TOS:=I;     <<LDEV NUM>>                                          03742000
      ASMB(SSEA);                                                       03744000
      TOS:=MEASSTATXDSBASE;                                             03746000
      ASMB(LSUB); <<TOS HAS SEGRELATIVE OFFSET FOR ITEM 0>>             03748000
      LDEVTAB(I):=TOS; <<DONT NEED ORIGINAL INFO OF LDEVTAB>>           03750000
      ASMB(DEL); <<BANK>>                                               03752000
                                                                        03754000
      END;                                                              03756000
   END;                                                                 03758000
                                                                        03760000
<<LDEVTAB NOW CONTAINS SEGMENT RELATIVE OFFSETS TO ITEM 0>>             03762000
<<FOR ALL DEVICES THE INTERFACE KNOWS ABOUT >>                          03764000
                                                                        03766000
<<MOVE LDEVTAB TO 1ST 256 WORDS OF SEGMENT>>                            03768000
                                                                        03770000
TOS:=MEASSTATXDS'NUM;                                                   03772000
TOS:=0;               <<START AT WORD 0>>                               03774000
TOS:=@LDEVTAB;        <<SOURCE ADDRESS>>                                03776000
TOS:=LDEVTABSIZE;     <<WORD COUNT FOR MOVE>>                           03778000
ASMB(MTDS 4);                                                           03780000
                                                                        03782000
END;                                                                    03784000
$PAGE  "MPE IV MEASUREMENT INTERFACE    (FORMATPROCSEG)"       <<01741>>03786000
PROCEDURE FORMATPROCSEG(MEASPROCXDS'SIZE);                     <<01741>>03788000
   VALUE MEASPROCXDS'SIZE;                                     <<01741>>03790000
   INTEGER MEASPROCXDS'SIZE;                                   <<01741>>03792000
   OPTION PRIVILEGED,UNCALLABLE;                               <<01741>>03794000
                                                               <<01741>>03796000
COMMENT                                                        <<01741>>03798000
************************************************************** <<01741>>03800000
                                                               <<01741>>03802000
THIS PROCEDURE IS USED TO INITIALIZE AND FORMAT THE PROCESS    <<01741>>03804000
LEVEL STATISTICS XDS AND IS CALLED ONLY FROM STARTSTATISTICS   <<01741>>03806000
                                                               <<01741>>03808000
INPUT PARAMETER:                                               <<01741>>03810000
    MEASPROCXDS'SIZE: SIZE OF XDS TO BE FORMATTED              <<01741>>03812000
                                                               <<01741>>03814000
OPERATION:                                                     <<01741>>03816000
                                                               <<01741>>03818000
  FORMATPROCSEG WILL GRAB THE LOADER AND PCB SIRS TO PREVENT   <<01741>>03820000
  ANY INCONSISTENCY BETWEEN THE PCB AND LSTDIR TABLES DURRING  <<01741>>03822000
  INITIALIZATION. AFTER THE XDS IS ZEROED OUT, EXCHANGEDB IS   <<01741>>03824000
  CALLED TO SET DB TO THE LSTDIR TABLE. WHEN A SHARER          <<01741>>03826000
  ENTRY IS FOUND ATTACHIO IS USED TO MOVE THE PROGRAM NAME     <<01741>>03828000
  DIRECTLY INTO THE XDS. THE DISC ADDR FOR ATTACHIO IS OB-     <<01741>>03830000
  TAINED FROM THE FID FIELD OF THE SHARER ENTRY. NEXT, ALL     <<01741>>03832000
  ENTRIES FOR CURRENTLY ACTIVE PINS ARE TIMESTAMPED, PROCESSES <<01741>>03834000
  NOT RUNNUNG A PROGRAM ARE NAMED AS EITHER 'CI' OR 'SP' PRO-  <<01741>>03836000
  CESSES DEPENDING ON THE PROCESS TYPE FIELD IN THE PCB TABLE. <<01741>>03838000
  NEXT, THE NAMES OF SYSTEM PROCESSES CREATED BY PROGEN ARE    <<01741>>03840000
  MOVED TO THE XDS. THIS IS DONE BY PULLING OUT PCB ENTRY #'S  <<01741>>03842000
  FROM SYSGLOB CELLS WHICH CORRESPOND TO SPECIFIC SP'S.        <<01741>>03844000
  FINNALY, ENTRY0 (CONTROL INFO) IS INTITIALIZED.              <<01741>>03846000
                                                               <<01741>>03848000
************************************************************** <<01741>>03850000
;                                                              <<01741>>03852000
                                                               <<01741>>03854000
BEGIN                                                          <<01741>>03856000
                                                               <<01741>>03858000
EQUATE LSTDIRDST = %22,                                        <<01741>>03860000
       LOADERSIR = 1,                                          <<01741>>03862000
       SHARER    = 6,        <<LST ENTRY TYPE>>                <<01741>>03864000
       SYSPINSBASE  = %1141, <<SYSGLOB>>                       <<01741>>03866000
       PCBSIR    = 34,                                         <<01836>>03868000
       SYSPINSLIMIT = %1154, <<SYSGLOB>>                       <<01741>>03870000
       FIRSTADDR    = 2,     <<OF LINKED MEMORY>>              <<01741>>03872000
       LASTBANKADDR = %1362, <<SYSGLOB>>                       <<01741>>03874000
       REGHEADSIZE  = 9,                                       <<01741>>03876000
       SUBREGHEADSIZE = 10,                                    <<01741>>03878000
       ENTRYSIZEX   = 0, <<** ENTRY 0 INDICES **>>             <<01741>>03880000
       NUMENTRYSX   = 1,                                       <<01741>>03882000
       DCREATETIMEX = 1, <<DOUBLE IDX>>                        <<01741>>03884000
       BASEVERX     = 4, <<BASE==> FROM SYSGLOB EXT AREA>>     <<01741>>03886000
       BASEUPDX     = 5,                                       <<01741>>03888000
       BASEFIXX     = 6,                                       <<01741>>03890000
       ACTVERX      = 7, <<ACT==> FROM SYSGLOB AREA>>          <<01741>>03892000
       ACTUPDX      = 8,                                       <<01741>>03894000
       ACTFIXX      = 9,                                       <<01741>>03896000
       MPEMEMX      = 5, <<DOUBLE IDX>>                        <<01741>>03898000
       AVAILMEMX    = 6, <<DOUBLE IDX, *END ENTRY 0 INDICES*>> <<01741>>03900000
       DSTOPTIMEX   = 1, <<DOUBLE IDX, FOR PCBXMEASINFO>>      <<01741>>03902000
       CIPROCESS    = 2; <<PROCESS TYPE IN PCB>>               <<01741>>03904000
                                                               <<01741>>03906000
INTEGER BASE, <<CURRENT POINTER IN LSTDIR>>                    <<01741>>03908000
        PIN:=0,  <<LOOP VARIABLE=PIN NUMBER>>                  <<01741>>03910000
        SYSPINSBASEX:=%1140,                                   <<01741>>03912000
        LSTDIRLIMIT,                                           <<01741>>03914000
        PCBSIZE;                                               <<01741>>03916000
                                                               <<01741>>03918000
INTEGER ARRAY ESIZE(*)=PB:= <<LST DIRECTORY ENTRY SIZES>>      <<01741>>03920000
          0,    <<GARBAGE ENTRY -- SIZE IN 2ND WORD OF ENTRY>> <<01741>>03922000
         16,    <<SL FILE>>                                    <<01741>>03924000
         20,    <<PROGRAM FILE DIRECTORY>>                     <<01741>>03926000
          3,    <<LOADING>>                                    <<01741>>03928000
          5,    <<WAITER>>                                     <<01741>>03930000
          5,    <<LOADED>>                                     <<01741>>03932000
          4,    <<SHARER>>                                     <<01741>>03934000
         14;    <<EXTENSION>>                                  <<01741>>03936000
                                                               <<01741>>03938000
DOUBLE CREATETIME;                                             <<01741>>03940000
                                                               <<01741>>03942000
LOGICAL MYSIR,     <<USED FOR LOADER SIR>>                     <<01741>>03944000
        MYSIR2;    <<USED FOR PCB SIR>>                        <<01741>>03946000
                                                               <<01741>>03948000
LOGICAL ARRAY LSTDIR(*) = DB+0,      <<USED FOR EXCHANGEDB>>   <<01741>>03950000
              MEASPROCXDS(*) = DB+0, <<USED TO INIT XDS TO 0>> <<01741>>03952000
              ENTRY0(0:CLASS15'SUB0SIZE), <<TO INIT ENTRY0>>   <<01741>>03954000
              PCBXMEASINFO(0:3);  <<(0)=JSNUM>>                <<01741>>03956000
                                  <<(1)= STOPWORD>>            <<01741>>03958000
                                  <<(2:2)=STOPTIME>>           <<01741>>03960000
                                                               <<01741>>03962000
DOUBLE ARRAY DENTRY0(*)=ENTRY0,                                <<01741>>03964000
             DPCBXMEASINFO(*)=PCBXMEASINFO,                    <<01741>>03966000
             STOPTIME(*)=DPCBXMEASINFO(DSTOPTIMEX);            <<01741>>03968000
                                                               <<01741>>03970000
BYTE ARRAY PROCNAMES(*)=PB:=  <<NAMES OF SYSTEM PROCESSES>>    <<01741>>03972000
  "PROGEN    ",                                                <<01741>>03974000
  "          ",                                                <<01741>>03976000
  "UCOP      ",                                                <<01741>>03978000
  "PFAIL     ",                                                <<01741>>03980000
  "DEVREC    ",                                                <<01741>>03982000
  "DRUSG     ",                                                <<01741>>03984000
  "STMSG     ",                                                <<01741>>03986000
  "LOG       ",                                                <<01741>>03988000
  "LOAD      ",                                                <<01741>>03990000
  "IOMESSPROC",                                                <<01741>>03992000
  "SYSIOPROC ",                                                <<01741>>03994000
  "MEMLOGP   ";                                                <<01741>>03996000
                                                               <<01741>>03998000
ARRAY NAMEBUF(0:12), <<FILE NAME BUFFER>>                      <<01741>>04000000
      CINAME(0:1),                                             <<01741>>04002000
      SPNAME(0:1);                                             <<01741>>04004000
                                                               <<01741>>04006000
BYTE ARRAY BNAMEBUF(*)=NAMEBUF;                                <<01741>>04008000
                                                               <<01741>>04010000
DEFINE ETYPE = LSTDIR(BASE).(13:3)#,  <<LSTDIR DEFINES>>       <<01741>>04012000
       PINN  = LSTDIR(BASE+1).(8:8)#,                          <<01741>>04014000
       LDEV  = LSTDIR(BASE+2).(0:8)#,                          <<01741>>04016000
       HODA  = LSTDIR(BASE+2).(8:8)#,                          <<01741>>04018000
       LODA  = LSTDIR(BASE+3)#;                                <<01741>>04020000
                                                               <<01741>>04022000
DEFINE SYSGLOBVER   = ABS(%1116)#,                             <<01741>>04024000
       SYSGLOBUPD   = ABS(%1114)#,                             <<01741>>04026000
       SYSGLOBFIX   = ABS(%1115)#,                             <<01741>>04028000
       BASEVER      = SYSGLOBEXT(%74)#,                        <<01741>>04030000
       BASEUPD      = SYSGLOBEXT(%75)#,                        <<01741>>04032000
       BASEFIX      = SYSGLOBEXT(%76)#,                        <<01741>>04034000
       FULLBANKSIZE = 65536D#,                                 <<01741>>04036000
       NBANKS       = ABS(%1047)#; <<NUMBER OF CONFIG BANKS>>  <<01741>>04038000
                                                               <<01741>>04040000
DEFINE LINKMEMSTART = SYSGLOBEXT(FIRSTADDR)-                   <<01741>>04042000
                      (REGHEADSIZE+SUBREGHEADSIZE)#,           <<01741>>04044000
       LASTBANKSIZE = DOUBLE(LOGICAL(ABS(LASTBANKADDR)))+1D#;  <<01741>>04046000
                                                               <<01741>>04048000
DEFINE PCBENTRYSIZE = PCBB(1)#,                                <<01741>>04050000
       PROCESSTYPE = PCBB(PIN*PCBSIZE+9).(6:3)#,               <<01741>>04052000
       SYSTEMPROCESS = (PROCESSTYPE = 4 OR PROCESSTYPE = 6)#,  <<01741>>04054000
       MAXCONFIGPCB  = PCBB(0)#;                               <<01741>>04056000
                                                               <<01741>>04058000
MOVE CINAME:="CI";                                             <<01741>>04060000
MOVE SPNAME:="SP";                                             <<01741>>04062000
                                                               <<01741>>04064000
<<INITIALIZE PROCESS STATS DATA SEG>>                          <<01741>>04066000
EXCHANGEDB(MEASPROCXDSNUM);                                    <<01741>>04068000
MEASPROCXDS(0):=0; <<MOVE 0 TO 1ST WORD OF XDS>>               <<01741>>04070000
TOS:=1;            <<TARGET FOR MOVE>>                         <<01741>>04072000
TOS:=0;            <<SOURCE IN XDS FOR MOVE>>                  <<01741>>04074000
TOS:=MEASPROCXDS'SIZE-1; <<NUM WORDS TO MOVE>>                 <<01741>>04076000
ASMB(MOVE 3);      <<ZERO OUT XDS>>                            <<01741>>04078000
EXCHANGEDB(0);     <<GET BACK TO STACK>>                       <<01741>>04080000
                                                               <<01741>>04082000
<<GET LOADER SIR AND PDISABLE TO PREVENT CHGS TO LSTDIR>>      <<01741>>04084000
                                                               <<01741>>04086000
MYSIR:=GETSIR(LOADERSIR);                                      <<01741>>04088000
MYSIR2:=GETSIR(PCBSIR);                                        <<01741>>04090000
                                                               <<01741>>04092000
<<SEARCH TROUGH THE LSTDIR AND FIND ALL SHARER ENTRIES>>       <<01741>>04094000
                                                               <<01741>>04096000
EXCHANGEDB(LSTDIRDST);                                         <<01741>>04098000
                                                               <<01741>>04100000
BASE:=LSTDIR(2); <<BASE OF DIR ENTRIES>>                       <<01741>>04102000
LSTDIRLIMIT:=LSTDIR(1)+LOGICAL(BASE);                          <<01741>>04104000
PCBSIZE:=PCBENTRYSIZE;                                         <<01741>>04106000
TRAPOFF;   <<*** TURN TRAPS OFF  FOR ATTACHIO CALL ***>>       <<01741>>04108000
                                                               <<01741>>04110000
WHILE BASE < LSTDIRLIMIT DO                                    <<01741>>04112000
   BEGIN <<FIND SHARER ENTRY>>                                 <<01741>>04114000
   IF ETYPE = SHARER THEN                                      <<01741>>04116000
      BEGIN <<CALL ATACHIO AND MOVE PROG NAME TO ENTRY>>       <<01741>>04118000
      TOS:=ATTACHIO(LDEV,0,MEASPROCXDSNUM,                     <<01741>>04120000
                    PINN*CLASS15'SUB0SIZE,0,12,HODA,LODA,1);   <<01741>>04122000
      DEL;                                                     <<01741>>04124000
      IF TOS.(8:8) <> 1 THEN                                   <<01741>>04126000
         BEGIN <<ATTACHIO FAILED>>                             <<01741>>04128000
         MOVE NAMEBUF:=12(" ");                                <<01741>>04130000
         TOS:=MEASPROCXDSNUM;                                  <<01741>>04132000
         TOS:=PINN*CLASS15'SUB0SIZE;                           <<01741>>04134000
         TOS:=@NAMEBUF;                                        <<01741>>04136000
         TOS:=12; <<12 WORDS FOR PROG FILE NAME>>              <<01741>>04138000
         ASMB(MTDS 4);                                         <<01741>>04140000
         END; <<ERROR>>                                        <<01741>>04142000
      END; <<FOUND SHARER>>                                    <<01741>>04144000
   BASE:=IF ETYPE <> 0 THEN BASE+ESIZE(ETYPE)                  <<01741>>04146000
                       ELSE BASE+INTEGER(LSTDIR(BASE+1));      <<01741>>04148000
   END; <<WHILE LOOP>>                                         <<01741>>04150000
                                                               <<01741>>04152000
EXCHANGEDB(0); <<GET BACK TO STACK FOR REST OF INIT>>          <<01741>>04154000
                                                               <<01741>>04156000
<<FOR EVERY ACTIVE PROCESS, STUFF AWAY CREATION TIME,>>        <<01741>>04158000
<<IF PROCESS IS A CI OR SYSTEM PROCESS THEN PUT EITHER>>       <<01741>>04160000
<<"SP" OR "CI" IN NAME FIELD>>                                 <<01741>>04162000
                                                               <<01741>>04164000
CREATETIME:=TIMER;                                             <<01741>>04166000
WHILE (PIN:=PIN+1) <= MAXCONFIGPCB DO                          <<01741>>04168000
   BEGIN                                                       <<01741>>04170000
   IF CHECKALIVE(PIN) THEN                                     <<01741>>04172000
      BEGIN <<FOUND ACTIVE PROCESS>>                           <<01741>>04174000
      GETPCBXMEASINFO(PIN,PCBXMEASINFO);                       <<01741>>04176000
      IF STOPTIME = 0D THEN                                    <<01741>>04178000
         STOPTIME:=CREATETIME;                                 <<01741>>04180000
      TOS:=MEASPROCXDSNUM;                                     <<01741>>04182000
      TOS:=PIN*CLASS15'SUB0SIZE+CP'JOBSESSIONNUM;              <<01741>>04184000
      TOS:=@PCBXMEASINFO;                                      <<01741>>04186000
      TOS:=2; <<MOVE JOB/SESSION NUM AND STOPWORD>>            <<01741>>04188000
      ASMB(MTDS 4);                                            <<01741>>04190000
      TOS:=MEASPROCXDSNUM;                                     <<01741>>04192000
      TOS:=PIN*CLASS15'SUB0SIZE+CP'CREATETIME;                 <<01741>>04194000
      TOS:=@STOPTIME;                                          <<01741>>04196000
      TOS:=2;                                                  <<01741>>04198000
      ASMB(MTDS 4); <<MOVE CREATETIME OR STOPTIME>>            <<01741>>04200000
      IF PROCESSTYPE = CIPROCESS OR SYSTEMPROCESS THEN         <<01741>>04202000
         BEGIN <<INIT WITH APPROPIATE NAME>>                   <<01741>>04204000
         TOS:=MEASPROCXDSNUM;                                  <<01741>>04206000
         TOS:=PIN*CLASS15'SUB0SIZE;                            <<01741>>04208000
         TOS:=IF PROCESSTYPE = CIPROCESS THEN @CINAME          <<01741>>04210000
                                         ELSE @SPNAME;         <<01741>>04212000
         TOS:=1;                                               <<01741>>04214000
         ASMB(MTDS 4);                                         <<01741>>04216000
         END;<<CI OR SP>>                                      <<01741>>04218000
      END; <<ACTIVE PROCESS>>                                  <<01741>>04220000
   END; <<WHILE LOOP>>                                         <<01741>>04222000
                                                               <<01741>>04224000
<<NOW INTIALIZE ALL SYS PROC CREATED BY PROGEN>>               <<01741>>04226000
                                                               <<01741>>04228000
WHILE (SYSPINSBASEX:=SYSPINSBASEX+1) <= SYSPINSLIMIT DO        <<01741>>04230000
   BEGIN                                                       <<01741>>04232000
   IF ABS(SYSPINSBASEX) <> 0 THEN                              <<01741>>04234000
      BEGIN <<FOUND A SYSTEM PROCESS ENTRY IN SYS GLOB CELL>>  <<01741>>04236000
      MOVE BNAMEBUF:=                                          <<01741>>04238000
             PROCNAMES((SYSPINSBASEX-SYSPINSBASE)*10),(10);    <<01741>>04240000
      TOS:=MEASPROCXDSNUM;                                     <<01741>>04242000
      TOS:=(ABS(SYSPINSBASEX)/PCBSIZE)*CLASS15'SUB0SIZE;       <<01741>>04244000
      TOS:=@NAMEBUF;                                           <<01741>>04246000
      TOS:=5;                                                  <<01741>>04248000
      ASMB(MTDS 4);                                            <<01741>>04250000
      END;                                                     <<01741>>04252000
   END;                                                        <<01741>>04254000
                                                               <<01741>>04256000
<<FINNALY, INITIALIZE ENTRY0 WITH CONTROL INFO>>               <<01741>>04258000
                                                               <<01741>>04260000
MOVE ENTRY0:=CLASS15'SUB0SIZE(0); <<ZERO>>                     <<01741>>04262000
ENTRY0(ENTRYSIZEX) := CLASS15'SUB0SIZE;                        <<01741>>04264000
ENTRY0(NUMENTRYSX) := MAXCONFIGPCB;                            <<01741>>04266000
DENTRY0(DCREATETIMEX) := CREATETIME;                           <<01741>>04268000
ENTRY0(BASEVERX) := BASEVER;                                   <<01741>>04270000
ENTRY0(BASEUPDX) := BASEUPD;                                   <<01741>>04272000
ENTRY0(BASEFIXX) := BASEFIX;                                   <<01741>>04274000
ENTRY0(ACTVERX)  := SYSGLOBVER;                                <<01741>>04276000
ENTRY0(ACTUPDX)  := SYSGLOBUPD;                                <<01741>>04278000
ENTRY0(ACTFIXX)  := SYSGLOBFIX;                                <<01741>>04280000
DENTRY0(MPEMEMX) := DOUBLE(LOGICAL(LINKMEMSTART));             <<01741>>04282000
DENTRY0(AVAILMEMX) := DOUBLE(NBANKS)*FULLBANKSIZE-             <<01741>>04284000
                      DENTRY0(MPEMEMX)+LASTBANKSIZE;           <<01741>>04286000
                                                               <<01741>>04288000
TOS:=MEASPROCXDSNUM;                                           <<01741>>04290000
TOS:=0; <<WORD 0 OF ENTRY0>>                                   <<01741>>04292000
TOS:=@ENTRY0;                                                  <<01741>>04294000
TOS:=CLASS15'SUB0SIZE;                                         <<01741>>04296000
ASMB(MTDS 4);                                                  <<01741>>04298000
                                                               <<01741>>04300000
<<INITIALIZATION IS COMPLETE>>                                 <<01741>>04302000
                                                               <<01741>>04304000
RELSIR(PCBSIR,MYSIR2);                                         <<01741>>04306000
RELSIR(LOADERSIR,MYSIR);                                       <<01741>>04308000
                                                               <<01741>>04310000
                                                               <<01741>>04312000
END;                                                           <<01741>>04314000
$PAGE "MPE IV MEASUREMENT INTERFACE (FORMATIOSTATSEG)"         <<01836>>04316000
PROCEDURE FORMATIOSTATSEG(IOSTATXDS'SIZE);                     <<02532>>04318000
  VALUE IOSTATXDS'SIZE;                                        <<02532>>04320000
  INTEGER IOSTATXDS'SIZE;                                      <<02532>>04322000
  OPTION UNCALLABLE;                                           <<04113>>04324000
                                                               <<01836>>04326000
 COMMENT                                                       <<01836>>04328000
 **************************************************************<<01836>>04330000
                                                               <<01836>>04332000
 THIS PROCEDURE IS USED TO INITIALIZE AND FORMAT THE IOSTAT XDS<<01836>>04334000
 AND IS CALLED ONLY FROM STARTSTATISTICS.  THERE ARE ONLY TWO  <<01836>>04336000
 WORDS ARE INITIALIZED IN ENTRY 0, NAMELY, WORD(0), WHICH IS   <<01836>>04338000
 THE ENTRY INDEX # OF THE CURRENT AVAILABLE ENTRY AND WORD(1), <<01836>>04340000
 WHICH IS THE NUMBER OF ENTRIES, WHICH IS SET TO BE ONE AND    <<01836>>04342000
 HALF TIMES THE SUM OF IOQ ENTRIES AND DISCREQ ENTRIES WITH    <<01836>>04344000
 MINIMUM OF 255 ENTRIES.                                       <<01836>>04346000
 **************************************************************<<01836>>04348000
 ;                                                             <<01836>>04350000
                                                               <<01836>>04352000
 BEGIN                                                         <<01836>>04354000
    ARRAY  DATA(0:15);                                         <<01836>>04356000
                                                               <<01836>>04358000
    MOVE  DATA := 16(0);                                       <<01836>>04360000
    DATA := 1;                                                 <<01836>>04362000
    DATA(1) := IOSTATXDS'SIZE; << SIZE OF XDS >>               <<01836>>04364000
    MOVE  DATA(8) := "I/O STAT";    << IDENTIFIER >>           <<01836>>04366000
    TOS := TIMER;                   << TIME >>                 <<01836>>04368000
    DATA(15) := TOS;                                           <<01836>>04370000
    DATA(14) := TOS;                                           <<01836>>04372000
                                                               <<01836>>04374000
    TOS := IOSTATXDSNUM;                                       <<01836>>04376000
    TOS := 0;                                                  <<01836>>04378000
    TOS := @DATA;                                              <<01836>>04380000
    TOS := 16;                                                 <<01836>>04382000
    ASMB(MTDS);                                                <<01836>>04384000
 END;                                                          <<01836>>04386000
PROCEDURE ENABLECLASS(CLASSNUMBER);                                     04388000
  VALUE   CLASSNUMBER;                                                  04390000
  LOGICAL CLASSNUMBER;                                                  04392000
  OPTION PRIVILEGED,UNCALLABLE;                                         04394000
                                                                        04396000
COMMENT                                                                 04398000
                                                                        04400000
THIS PROCEDURE WILL TURN ON CLASSMASK BITS AND INCREMENT                04402000
COUNTERS. THIS PROCEDURE IS CALLED FROM STARTSTATISTICS.                04404000
                                                                        04406000
INPUT PARAMETER:                                                        04408000
                                                                        04410000
   CLASSNUMBER IS THE NUMBER OF THE CLASS TO BE ENABLED.                04412000
                                                                        04414000
FIRST IT WILL TURN ON BIT 15 OF THE PROCCES'S PCLASSMASK, THEN          04416000
IT WILL TURN ON THE CORRESPONDING CLASS BIT. IF THE PROCESS DID         04418000
NOT ALREADY HAVE THAT CLASS ENABLED, THE ENABLED COUNTER FOR            04420000
THAT CLASS GETS INCREMENTED. FINALLY THE GLCLASSENABLEDMASK             04422000
IS SET.                                                                 04424000
;                                                                       04426000
                                                                        04428000
BEGIN                                                                   04430000
                                                                        04432000
LOGICAL ARRAY PCBXFIXED(*) = Q+0;                                       04434000
INTEGER X=X,                                                            04436000
        S0 = S-0,                                                       04438000
        PCLASSMASK'IDX;                                                 04440000
                                                                        04442000
GETPCLASSMASK;         <<OUT OF PCBXFIXED+%100)>>                       04444000
TOS:=PCLASSENABLEMASK;                                                  04446000
                                                                        04448000
X:=CLASSNUMBER;                                                         04450000
ASMB(TSBC 0,X);        <<SET MASK BIT FOR PROCESS>>                     04452000
                                                                        04454000
IF = THEN              <<NOT ALREADY ON FOR THIS PROCESS>>              04456000
  BEGIN                <<BUMP CLASSXENABLED COUNTER>>                   04458000
  CASE CLASSNUMBER OF                                                   04460000
    BEGIN                                                               04462000
    CLASS0COUNT  := CLASS0COUNT+1;                                      04464000
    CLASS1COUNT  := CLASS1COUNT+1;                                      04466000
    CLASS2COUNT  := CLASS2COUNT+1;                                      04468000
    CLASS3COUNT  := CLASS3COUNT+1;                                      04470000
    CLASS4COUNT  := CLASS4COUNT+1;                                      04472000
    CLASS5COUNT  := CLASS5COUNT+1;                                      04474000
    CLASS6COUNT  := CLASS6COUNT+1;                                      04476000
    CLASS7COUNT  := CLASS7COUNT+1;                                      04478000
    CLASS8COUNT  := CLASS8COUNT+1;                                      04480000
    CLASS9COUNT  := CLASS9COUNT+1;                                      04482000
    CLASS10COUNT := CLASS10COUNT+1;                                     04484000
    CLASS11COUNT := CLASS11COUNT+1;                                     04486000
    CLASS12COUNT := CLASS12COUNT+1;                                     04488000
    CLASS13COUNT := CLASS13COUNT+1;                                     04490000
    CLASS14COUNT := CLASS14COUNT+1;                                     04492000
    CLASS15COUNT := CLASS15COUNT+1;                            <<01741>>04494000
    END;                                                                04496000
  TOS:=GCLASSENABLEDMASK;                                               04498000
  X:=CLASSNUMBER;                                                       04500000
  ASMB(TSBC 0,X);                                                       04502000
  GCLASSENABLEDMASK:=TOS;                                               04504000
  END;                                                                  04506000
                                                                        04508000
PCLASSENABLEMASK:=TOS;                                                  04510000
                                                                        04512000
END;                                                                    04514000
$PAGE "MPE IV MEASUREMENT INTERFACE    (STARTSTATISTICS)"               04516000
                                                                        04518000
INTEGER PROCEDURE STARTSTATISTICS(CLASSMASK);                           04520000
  VALUE CLASSMASK;                                                      04522000
  LOGICAL CLASSMASK;                                                    04524000
  OPTION PRIVILEGED,UNCALLABLE;                                         04526000
                                                                        04528000
                                                                        04530000
COMMENT                                                                 04532000
*************************************************************           04534000
                                                                        04536000
This procedure is used to initiate statistics gathering                 04538000
for performance measurement and system debugging.                       04540000
                                                                        04542000
INPUT PARAMETERS:                                                       04544000
                                                                        04546000
      CLASSMASK: A bit mask of statistic classes to be enabled.         04548000
                                                                        04550000
RETURN VALUES:                                                          04552000
                                                                        04554000
      CC = CCL ==> COULD NOT OBTAIN DATASEGMENT                         04556000
      CC = CCE ==> OK                                                   04558000
      CC = CCG ==> NOT USED                                             04560000
                                                                        04562000
      STARTSTATISTICS = 0 ==> NO ERROR                                  04564000
                      = 1 ==> NO VMEM FOR DATA SEG                      04566000
                      = 2 ==> NO DST ENTRY AVAIL                        04568000
                      = 3 ==> COULD NOT LOCK DATA SEG                   04570000
                                                                        04572000
OPERATION:                                                              04574000
                                                                        04576000
The first thing STARTSTATISTICS does is to get the MEASSIR,             04578000
this will avoid the possibility of two users updating sys glob          04580000
cells at the same time. If sys global cell GCLASSENABLEDMASK            04582000
equal to zero then it will obtain, lock, freeze, and format             04584000
the data segment to be used for statistics gathering. It will           04586000
then turn on corresponding bits in both the sys global cell,            04588000
and the proceses PCLASSENABLEDMASK (PXFIXED(%100)).                     04590000
                                                                        04592000
*************************************************************           04594000
;                                                                       04596000
                                                                        04598000
BEGIN                                                                   04600000
                                                                        04602000
LOGICAL BITWORD,           <<LOOP VARIABLE FOR SETTING MASKS>>          04604000
        BASE,              <<BASE OF STATS XDS>>                        04606000
        DSTBASE,                                                        04608000
        MYSIR,             <<USED AS 2ND PARM FOR RELSIR>>              04610000
        SAVEX;                                                          04612000
INTEGER DISC:=0,           <<PARM FOR FINDDEVICES,TYPE 0=DISC>>         04614000
        I,                 <<UTILITY>>                                  04616000
        X=X,                                                            04618000
        TYPE,            <<LOOP VARIABLE, NUM OF TYPES>>                04620000
        MEASDSTNUM,      <<LOCAL COPY OF DSTNUM>>                       04622000
        MEASSTATXDS'SIZE,<<SIZE TO CREATE XDS WITH>>                    04624000
        MEASPROCXDS'SIZE, <<SIZE TO CREATE PROC XDS>>          <<01741>>04626000
        IOSTATXDS'SIZE,  <<SIZE OF I/O XDS>>                   <<02532>>04628000
        ERROR:=0,        <<LOCAL ERROR VALUE>>                          04630000
        STATUS=Q-1,      <<STATUS REGISTER  >>                          04632000
        SAVECC:=CCE;     <<LOCAL USE OF COND CODE>>                     04634000
INTEGER ARRAY LDEV'NO(0:255), <<PARM FOR FINDDEVICES>>                  04636000
              TOTAL'DEVICES(0:20),  <<0:1 = TOTAL # DEV TYPES>>         04638000
                                    <<1:1 = # OF DISCS>>                04640000
                                    <<2:1 = # OF LP'S >>                04642000
                                    <<3:1 = # OF TAPES>>                04644000
                                    <<4:1 = # OF TERM >>                04646000
                                    <<4:1 = # OF TERMS>>                04648000
                                                                        04650000
                                                                        04652000
              LDEVTAB(0:255),       <<LDEV TO ENTRY MAP>>               04654000
              ENTCNTTAB(0:10);      <<COUNTER FOR LDEVS>>               04656000
                                                                        04658000
EQUATE DSTBASEPTR=2,        <<ABS LOC OF DST BASE>>                     04660000
       VMEMERR=1,           <<NO VMEM FOR XDS>>                         04662000
       DSTENTERR=2,         <<NO AVAIL DST ENT>>                        04664000
       LOCKERR=3;           <<UNABLE TO LOCK XDS>>                      04666000
                                                                        04668000
                                                                        04670000
MOVE TOTAL'DEVICES:=21(0);    <<INITIALIZE>>                            04672000
MOVE ENTCNTTAB:=10(0);                                                  04674000
MOVE LDEVTAB:=256(0);                                                   04676000
TRAPOFF;                    << TO PREVENT INTEGER OVER FLOW >> <<04497>>04678000
MYSIR:=GETSIR(MEASSIR);    <<INSURE ONLY ONE ACCESS AT A TIME>>         04680000
                                                               <<01741>>04682000
<<***********************************************************>><<01741>>04684000
<<  ACQUISITION OF GLOBAL STATISTICS XDS                     >><<01741>>04686000
<<***********************************************************>><<01741>>04688000
IF NOT (GLOBALSTATSENBLD) AND GLOBALSTATREQ THEN               <<01741>>04690000
  BEGIN <<GLOBAL STAT GATHERING NOT ENABLED>>                  <<01741>>04692000
  FOR TYPE:=1 UNTIL NUMDEVTYPES DO <<# OF DEV TYPES MONITORED>>         04694000
    BEGIN                                                               04696000
    FINDDEVICES(TYPE,LDEV'NO);  <<FIND OUT NO OF DEVS CONFIG>>          04698000
    FOR I := 1 UNTIL LDEV'NO DO                                         04700000
       BEGIN <<BUILD ENTRY IN LDEVTAB>>                                 04702000
       ENTCNTTAB(TYPE):=ENTCNTTAB(TYPE)+1;                              04704000
       LDEVTAB(LDEV'NO(I)).CFIELD:=0;                                   04706000
       LDEVTAB(LDEV'NO(I)).SFIELD:=TYPE;                                04708000
       LDEVTAB(LDEV'NO(I)).EFIELD:=ENTCNTTAB(TYPE);                     04710000
       END;                                                             04712000
    TOTAL'DEVICES(TYPE):=LDEV'NO;   <<# DEVS OF THIS TYPE>>             04714000
    END;                                                                04716000
  TOTAL'DEVICES(0) := NUMDEVTYPES; <<# OF DEV TYPES MONITORED>>         04718000
  MEASSTATXDS'SIZE:=LDEVTABSIZE+CLASSCOUNT+                             04720000
                    CLASS0SIZE+CLASS1SIZE;                              04722000
  MEASDSTNUM := GETDATASEG(MEASSTATXDS'SIZE,MEASSTATXDS'SIZE);          04724000
  IF = THEN                                                             04726000
    BEGIN <<GOT THE DATA SEG>>                                          04728000
    MEASSTATXDS'NUM := MEASDSTNUM;                                      04730000
    LOCKSEG(MEASSTATXDS'NUM,%3,0);                                      04732000
    IF = THEN                                                           04734000
      BEGIN <<LOCKED THE DATA SEGMENT>>                                 04736000
      FREEZE(MEASSTATXDS'NUM,1,0);    <<FREEZE THE SEGMENT >>           04738000
      <<DETERMINE THE BANK NUMBER, AND ADDRESS OF THE XDS>>             04740000
      DSTBASE:=ABS(DSTBASEPTR);    <<DETERMINE BASE OF DST>>            04742000
      BASE:=DSTBASE+LOGICAL(MEASSTATXDS'NUM)*4; <<BASE OF XDS>>         04744000
       MEASSTATXDSBANK:=ABS(BASE+2);                           <<04313>>04746000
      MEASSTATXDSBASE:=ABS(BASE+3);                                     04748000
      FORMATSEG(MEASSTATXDS'SIZE,TOTAL'DEVICES,LDEVTAB);                04750000
      END   <<SUCCESFULL ACQUISITION OF DATA SEGMENT>>                  04752000
    ELSE ERROR:=LOCKERR;  <<UNABLE TO LOCK DATA SEGMENT>>               04754000
    END                                                                 04756000
  ELSE                                                                  04758000
    BEGIN <<UNABLE TO GET DATASEG>>                                     04760000
    IF < THEN ERROR:=DSTENTERR                                          04762000
    ELSE ERROR:=VMEMERR;                                                04764000
    END;                                                                04766000
  END; <<ACQUISITION OF DATA SEGMENT>>                                  04768000
                                                               <<01741>>04770000
<<***********************************************************>><<01741>>04772000
<<  ACQUISITION OF PROCESS LEVEL INSTRUMENTATION XDS         >><<01741>>04774000
<<***********************************************************>><<01741>>04776000
                                                                        04778000
IF NOT (PROCSTATSENBLD) AND PROCSTATREQ THEN                   <<01741>>04780000
   BEGIN <<PROCESS STAT GATHERING NOT ENABLED>>                <<01741>>04782000
   MEASPROCXDS'SIZE := CLASS15SIZE;                            <<01741>>04784000
   MEASDSTNUM := GETDATASEG(MEASPROCXDS'SIZE,MEASPROCXDS'SIZE);<<01741>>04786000
   IF = THEN                                                   <<01741>>04788000
      BEGIN << GOT THE DATA SEG >>                             <<01741>>04790000
      MEASPROCXDSNUM := MEASDSTNUM;                            <<01741>>04792000
      LOCKSEG(MEASPROCXDSNUM,3,0);                             <<01741>>04794000
      IF = THEN                                                <<01741>>04796000
         BEGIN                                                 <<01741>>04798000
         FREEZE(MEASPROCXDSNUM,1,0);                           <<01741>>04800000
         <<DETERMINE THE BANK NUMBER AND ADDRESS OF XDS>>      <<01741>>04802000
         DSTBASE:=ABS(DSTBASEPTR);                             <<01741>>04804000
         BASE:=DSTBASE+LOGICAL(MEASPROCXDSNUM)*4;              <<01741>>04806000
          MEASPROCXDSBANK:=ABS(BASE+2);                        <<04313>>04808000
         MEASPROCXDSBASE:=ABS(BASE+3);                         <<01741>>04810000
         FORMATPROCSEG(MEASPROCXDS'SIZE);                      <<01741>>04812000
         END                                                   <<01741>>04814000
      ELSE ERROR:=LOCKERR;                                     <<01741>>04816000
      END                                                      <<01741>>04818000
   ELSE                                                        <<01741>>04820000
      BEGIN <<UNABLE TO GET DATA SEG>>                         <<01741>>04822000
      IF < THEN ERROR:=DSTENTERR                               <<01741>>04824000
      ELSE ERROR:=VMEMERR;                                     <<01741>>04826000
      END;                                                     <<01741>>04828000
   END; <<ACQUISITION OF PROCESS XDS>>                         <<01741>>04830000
                                                               <<01741>>04832000
                                                               <<01836>>04834000
<<***********************************************************>><<01836>>04836000
<<  ACQUISITION OF I/O STATISTIC INSTRUMENTATION XDS         >><<01836>>04838000
<<***********************************************************>><<01836>>04840000
                                                               <<01836>>04842000
 IF  NOT (IOSTATSENBLD) AND IOSTATREQ  THEN                    <<01836>>04844000
 BEGIN           << I/O STATISTIC GATHERING NOT ENABLED >>     <<01836>>04846000
    IOSTATXDS'SIZE :=                                          <<01836>>04848000
       ((IOQTBPTR(0).(0:8) + DISCREQTBPTR(0).(0:8))*3 + 1)/2;  <<01836>>04850000
    IF  IOSTATXDS'SIZE < 255  THEN  IOSTATXDS'SIZE := 255;     <<01836>>04852000
    I:=(IOSTATXDS'SIZE+1)&LSL(4); << 16 WORDS FOR EACH ENTRY >><<01836>>04854000
    MEASDSTNUM := GETDATASEG(I, I);                            <<01836>>04856000
    IF  =  THEN                                                <<01836>>04858000
    BEGIN                                                      <<01836>>04860000
       LOCKSEG(MEASDSTNUM, 3, 0);                              <<01836>>04862000
       IF  =  THEN                                             <<01836>>04864000
       BEGIN                                                   <<01836>>04866000
          FREEZE(MEASDSTNUM, 1, 0);                            <<01836>>04868000
          IOSTATXDSNUM := MEASDSTNUM;                          <<01836>>04870000
          DSTBASE := ABS(DSTBASEPTR);                          <<01836>>04872000
          BASE := DSTBASE + LOGICAL(MEASDSTNUM)&LSL(2);        <<01836>>04874000
          IOSTATXDSBANK := ABS(BASE+2);                        <<01836>>04876000
          IOSTATXDSBASE := ABS(BASE+3);                        <<01836>>04878000
          FORMATIOSTATSEG(IOSTATXDS'SIZE);                     <<02532>>04880000
       END  ELSE  ERROR := LOCKERR;                            <<01836>>04882000
    END  ELSE                                                  <<01836>>04884000
       ERROR :=  IF <  THEN  DSTENTERR  << NO DST SEG >>       <<01836>>04886000
                 ELSE  VMEMERR;                                <<01836>>04888000
 END;           << ACQUISITION OF I/O STAT XDS >>              <<01836>>04890000
                                                               <<01836>>04892000
IF ERROR = 0 THEN                                                       04894000
  BEGIN       <<SET GCLASSENABLEDMASK AND PCLASSENABLED MASK>>          04896000
  SAVEX:=-1;                   <<USED TO INITIALIZE X REG>>             04898000
  BITWORD:=CLASSMASK;          <<LOOP VARIABLE>>                        04900000
  WHILE BITWORD <> 0 DO                                                 04902000
    BEGIN                                                               04904000
    TOS:=BITWORD;                                                       04906000
    X:=SAVEX;                                                           04908000
    ASMB(SCAN,X);                                                       04910000
    SAVEX:=X;                <<FOR USE IN NEXT SCAN>>                   04912000
    BITWORD:=TOS;            <<SCAN BITSHIFTS LEFT UNTIL 0>>            04914000
    ENABLECLASS(SAVEX);      <<TURN ON GLOBAL AND PROC MASKS>>          04916000
    END;                                                                04918000
  END                                                                   04920000
ELSE                                                                    04922000
  SAVECC:=CCL;                                                          04924000
RELSIR(MEASSIR,MYSIR);                                                  04926000
STARTSTATISTICS:=ERROR;                                                 04928000
CC:=SAVECC;                                                             04930000
END;                                                                    04932000
                                                                        04934000
$PAGE "MPE IV MEASUREMENT INTERFACE      GETSTATISTICS"                 04936000
INTEGER PROCEDURE GETSTATISTICS(CLASS,SUBCLASS,STARTINGITEM,            04938000
                                 WORDCOUNT,WHERE);                      04940000
  VALUE CLASS,SUBCLASS,STARTINGITEM,WORDCOUNT;                          04942000
  INTEGER CLASS,SUBCLASS,STARTINGITEM,WORDCOUNT;                        04944000
  INTEGER ARRAY WHERE;                                                  04946000
  OPTION PRIVILEGED,UNCALLABLE;                                         04948000
                                                                        04950000
                                                                        04952000
COMMENT                                                                 04954000
*************************************************************           04956000
                                                                        04958000
GETSTATISTICS WILL RETREIVE MEASUREMENT DATA FROM THE XDS               04960000
UPDATED BY THE MPE'S STATISTICS UPDATING MECHANISM.                     04962000
                                                                        04964000
         INPUT PARAMETERS                                               04966000
                                                                        04968000
         CLASS,          CLASS NUMBER OF DESIRED STATS                  04970000
         SUBCLASS,       SUBCLASS NUMBER OF CLASS                       04972000
         STARTINGITEM,   BEGINING ITEM NUMBER OF SUBCLASS               04974000
         WORDCOUNT,      LENGTH OF TRANSFER                             04976000
                                                                        04978000
    OUTPUT PARAMETER:                                                   04980000
                                                                        04982000
         WHERE,          TARGET ARRAY                                   04984000
                                                                        04986000
RETURN VALUES:                                                          04988000
                                                                        04990000
       CC = CCL ==> BAD PARAMETER                                       04992000
       CC = CCE ==> OK                                                  04994000
       CC = CCG ==> NOT USED                                            04996000
                                                                        04998000
       GETSTATISTICS = 0 ==>OK                                          05000000
                     = 1 ==> NOT ENABLED                                05002000
                     = 2 ==> ARRAY OUT OF BOUNDS                        05004000
                     = 3 ==> BAD WORDCOUNT PARM                         05006000
                     = 4 ==> BAD STARTINGITEM PARM                      05008000
                     = 5 ==> BAD SUBCLASS PARM                          05010000
                     = 6 ==> BAD CLASS PARM                             05012000
                                                                        05014000
OPERATION:                                                              05016000
                                                                        05018000
GETSTATISTICS WILL FIRST USE ABSOLUTE ADDRESSING TO COMPUTE THE         05020000
BASE OF THE REQUESTED SUBCLASS (ENTRY0) AND RETREIVE THE ENTRY          05022000
COUNT FROM ENTRY0. THIS IS DONE BEFORE PARAMETER CHECKING BE-           05024000
CAUSE NUMBER OF ENTRIES IS USED IN PARAMETER CHECKING.                  05026000
SUBROUTINES ARE USED TO DO RANGE CHECKING ON INCOMING PARMS,            05028000
IF NO ERRORS ARE ENCOUNTERED THEN THE MFDS INSTRUCTION IS USED          05030000
TO TRNASFER THE DATA TO THE TARGET ARRAY.                               05032000
*************************************************************           05034000
;                                                                       05036000
                                                                        05038000
                                                                        05040000
BEGIN                                                                   05042000
                                                                        05044000
EQUATE  NOTENBLD       = 1,  <<STATISTICS GATH NOT ENBLD>>              05046000
        BOUNDS'ERROR   = 2,  <<ARRAY OUT OF BOUNDS   >>                 05048000
        WORDCNT'ERROR  = 3,  <<WORDCOUNT OUT OF RANGE>>                 05050000
        STARTITEM'ERROR  = 4,  <<STARTINGITEM OUT OF RANGE>>            05052000
        SUBCLASS'ERROR = 5,  <<SUBCLASS OUT OF RANGE>>                  05054000
        CLASS'ERROR    = 6;  <<CLASS OUT OF RANGE>>                     05056000
                                                                        05058000
INTEGER ERROR:=NOTENBLD,                                                05060000
        SAVECC:=CCE,         <<TEMP COND CODE>>                         05062000
        STATUS=Q-1;          <<STATUS REGISTER>>                        05064000
                                                                        05066000
INTEGER ARRAY C0'SUBSIZES(*) = PB:= CLASS0'SUB0SIZE,                    05068000
                                    CLASS0'SUB1SIZE,                    05070000
                                    CLASS0'SUB2SIZE,                    05072000
                                    CLASS0'SUB3SIZE;                    05074000
                                                                        05076000
INTEGER ARRAY C1'SUBSIZES(*) = PB:= CLASS1'SUB0SIZE,                    05078000
                                    CLASS1'SUB1SIZE,                    05080000
                                    CLASS1'SUB2SIZE,                    05082000
                                    CLASS1'SUB3SIZE,                    05084000
                                    CLASS1'SUB4SIZE,                    05086000
                                    CLASS1'SUB5SIZE;                    05088000
                                                                        05090000
INTEGER CLASSBASE,       <<OFFSET TO REQUESTED CLASS>>                  05092000
        SUBBASE,         <<SEG REL OFFSET TO REQ SUBCLASS>>             05094000
        ACTUAL'ENTRIES,  <<NUM ENTRIES LESS ENTRY 0>>                   05096000
        WHERE'ADDR=Q-4,   <<USED TO DETERMINE IF MAX POSSIBLE>>         05098000
        LASTADDR,                                                       05100000
        Q,                <<ARRAY SIZE WILL FIT WITHIN THE  >>          05102000
        DL,               <<USERS STACK                     >>          05104000
        X=X;              <<X REG>>                                     05106000
                                                                        05108000
LOGICAL ARRAY MEASSTAT'XDS(*)=DB+0;                                     05110000
                                                                        05112000
DEFINE CLASSBASE'IDX   = (CLASS+1)#,  <<OFFSET TO CLASS>>               05114000
       SUBBASE'IDX     = (SUBCLASS+1)#, <<OFFSET TO SUBCLASS>>          05116000
       ITEM'NUM        = (STARTINGITEM+3)#;<<GET PAST ENTRY 0>>         05118000
                                                                        05120000
LOGICAL FGET:=FALSE;                                                    05122000
                                                                        05124000
ENTRY FGETSTATISTICS;        <<WILL BYPASS PARM CHECKING>>              05126000
                                                                        05128000
<<***************SUBROUTINES*********************>>                     05130000
                                                                        05132000
LOGICAL SUBROUTINE GOODSUBCLASS;                                        05134000
BEGIN  <<CHECK FOR VALID SUBCLASS>>                                     05136000
GOODSUBCLASS:=TRUE;                                                     05138000
CASE CLASS OF                                                           05140000
   BEGIN                                                                05142000
   <<CLASS0>>                                                           05144000
   IF SUBCLASS < 0 OR SUBCLASS >= CLASS0'SUBCLASSCNT THEN               05146000
      GOODSUBCLASS:=FALSE;                                              05148000
   <<CLASS1>>                                                           05150000
   IF SUBCLASS < 0 OR SUBCLASS >= CLASS1'SUBCLASSCNT THEN               05152000
      GOODSUBCLASS:=FALSE;                                              05154000
   END; <<CASE>>                                                        05156000
END; <<GOODSUBCLASS>>                                                   05158000
                                                                        05160000
                                                                        05162000
LOGICAL SUBROUTINE GOODWORDCNT;                                         05164000
BEGIN << CHECK FOR VALID WORDCOUNT>>                                    05166000
GOODWORDCNT:=TRUE;                                                      05168000
CASE CLASS OF                                                           05170000
   BEGIN <<CLASS0>>                                                     05172000
   IF WORDCOUNT < 0 OR                                                  05174000
   WORDCOUNT + STARTINGITEM >                                           05176000
   C0'SUBSIZES(SUBCLASS)*ACTUAL'ENTRIES THEN                            05178000
      GOODWORDCNT:=FALSE;                                               05180000
   <<CLASS1>>                                                           05182000
   IF WORDCOUNT < 0 OR                                                  05184000
   WORDCOUNT + STARTINGITEM >                                           05186000
   C1'SUBSIZES(SUBCLASS)*ACTUAL'ENTRIES THEN                            05188000
      GOODWORDCNT:=FALSE;                                               05190000
   END; <<CASE>>                                                        05192000
END;<<GOODWORDCNT>>                                                     05194000
                                                                        05196000
                                                                        05198000
LOGICAL SUBROUTINE GOODSTARTITEM;                                       05200000
BEGIN <<CHECK FOR GOOD STARTINGITEM>>                                   05202000
GOODSTARTITEM:=TRUE;                                                    05204000
IF STARTINGITEM < -3 THEN <<DONT ALLOW ACCESS ABOVE ENTRY 0>>           05206000
   GOODSTARTITEM:=FALSE                                                 05208000
ELSE                                                                    05210000
   CASE CLASS OF                                                        05212000
     BEGIN                                                              05214000
     <<CLASS0>>                                                         05216000
     IF STARTINGITEM>=C0'SUBSIZES(SUBCLASS)*ACTUAL'ENTRIES THEN         05218000
        GOODSTARTITEM:=FALSE;                                           05220000
     <<CLASS1>>                                                         05222000
     IF STARTINGITEM>=C1'SUBSIZES(SUBCLASS)*ACTUAL'ENTRIES THEN         05224000
        GOODSTARTITEM:=FALSE;                                           05226000
     END; <<CASE>>                                                      05228000
END; <<GOODSTARTITEM>>                                                  05230000
                                                                        05232000
                                                                        05234000
LOGICAL SUBROUTINE GOODCLASS;                                           05236000
BEGIN << CHECK FOR VALID CLASS>>                                        05238000
GOODCLASS:=TRUE;                                                        05240000
IF CLASS < 0 OR CLASS >= CLASSCOUNT THEN                                05242000
   GOODCLASS:=FALSE;                                                    05244000
END; <<GOODCLASS>>                                                      05246000
                                                                        05248000
<<******************END OF SUBROUTINES******************>>              05250000
                                                                        05252000
GOTO MAIN;                                                              05254000
                                                                        05256000
FGETSTATISTICS:                                                         05258000
                                                                        05260000
FGET:=TRUE;                                                             05262000
                                                                        05264000
MAIN:                                                                   05266000
                                                                        05268000
  TRAPOFF;        << TO PREVENT INTEGER OVER FLOW >>           <<04497>>05270000
  PDISABLE;     <<MAKE SURE NO ONE CHANGES GATHERING STATUS>>           05272000
                                                                        05274000
TOS:=GCLASSENABLEDMASK;   <<IS CURRENTLY ENABLED           >>           05276000
X:=CLASS;                 <<CHECK TO SEE IF REQUESTED CLASS>>           05278000
ASMB(TBC 0,X);                                                          05280000
IF <> THEN                                                              05282000
  BEGIN                   <<CLASS WAS ENABLED>>                         05284000
                                                                        05286000
  ERROR:=0;                                                             05288000
                                                                        05290000
  TOS:=MEASSTATXDSBANK;                                                 05292000
  TOS:=MEASSTATXDSBASE+LDEVTABSIZE;                                     05294000
  TOS:=TOS+CLASSBASE'IDX;       <<ABS ADDR OF CLASSBASE PTR>>           05296000
  ASMB(LSEA);                   <<PULL OUT OFFSET TO CLASS >>           05298000
  CLASSBASE:=TOS;                                                       05300000
                                                                        05302000
  <<NOW GET SEGRELOFF FOR SUBCLASS>>                                    05304000
                                                                        05306000
  TOS:=CLASSBASE-CLASSBASE'IDX+SUBBASE'IDX; <<ADD SEGREL OFF>>          05308000
  ASMB(LADD;LSEA);       <<ADD TO ABS ADDR OF CLASSBASE PTR>>           05310000
  SUBBASE:=TOS+CLASSBASE;  <<STATS BASE REL OFFSET>>                    05312000
                                                                        05314000
  <<FINALLY PULL OUT NUMBER OF ENTRIES IN SUBCLASS>>                    05316000
                                                                        05318000
  TOS:=SUBBASE-CLASSBASE-SUBBASE'IDX;                                   05320000
  ASMB(LADD);                                                           05322000
  ASMB(LSEA);                                                           05324000
  ACTUAL'ENTRIES:=TOS-1;   <<SUB 1 FOR ENTRY 0>>                        05326000
  DDEL;                                                                 05328000
                                                                        05330000
  IF NOT FGET THEN                                                      05332000
    BEGIN               <<PARAMETER CHECKING>>                          05334000
                                                                        05336000
    IF NOT GOODCLASS THEN                                               05338000
       ERROR := CLASS'ERROR                                             05340000
    ELSE                                                                05342000
       IF NOT GOODSUBCLASS THEN                                         05344000
          ERROR := SUBCLASS'ERROR                                       05346000
       ELSE                                                             05348000
          IF NOT GOODSTARTITEM THEN                                     05350000
             ERROR := STARTITEM'ERROR                                   05352000
          ELSE                                                          05354000
             IF NOT GOODWORDCNT THEN                                    05356000
                ERROR := WORDCNT'ERROR;                                 05358000
                                                                        05360000
  <<CHECK TO SEE IF MAX POSSIBLE ARRAY SIZE WILL FIT IN STACK>>         05362000
                                                                        05364000
      TRAPOFF; <<PREVENT INTEGER OVERFLOW>>                    <<01836>>05366000
    LASTADDR:=WHERE'ADDR+WORDCOUNT;                                     05368000
    PUSH(DL,Q);                                                         05370000
    DL:=TOS;                                                            05372000
    Q:=TOS-10;   <<-10 SO USER CANT CLOBBER PARMS OR MARKER>>           05374000
    IF NOT (DL<=LASTADDR<=Q) THEN                                       05376000
      ERROR:=BOUNDS'ERROR;                                              05378000
    END;   <<PARAMETER CHECKING>>                                       05380000
  END;     <<CLASS WAS ENABLED>>                                        05382000
                                                                        05384000
IF ERROR = 0 THEN                                                       05386000
   BEGIN                                                                05388000
   TOS:=@WHERE;                                                         05390000
   TOS:=MEASSTATXDS'NUM;                                                05392000
   TOS:=SUBBASE+ITEM'NUM+LDEVTABSIZE;                                   05394000
   TOS:=WORDCOUNT;                                                      05396000
   ASMB(MFDS 4);                                                        05398000
   END                                                                  05400000
                                                                        05402000
ELSE                                                                    05404000
                                                                        05406000
   SAVECC:=CCL;                                                         05408000
                                                                        05410000
PENABLE;   <<ALL DONE>>                                                 05412000
                                                                        05414000
GETSTATISTICS:=ERROR;                                                   05416000
CC:=SAVECC;                                                             05418000
END;                                                                    05420000
$PAGE    "          SHARED CLOCK INTERFACE - USER'S GUIDE "             05424000
 << ***********************************************************         05426000
                                                                        05428000
                    GUIDE TO USE THE CLOCK INTERFACE                    05430000
                                                                        05432000
                                                                        05434000
    ****************************   IMPORTANT   *********************    05436000
    THIS INTERFACE IS NOT FOR THE CASUAL USER.  IT IS PRIVILEGED AND    05438000
    UNCALLABLE FOR GOOD REASON.  THE USER MUST KNOW ENOUGH ABOUT MPE    05440000
    AND THE HP3000 TO WRITE AN EXTERNAL INTERRUPT HANDLER AND           05442000
    DEBUGGING, OF COURSE, MUST BE DONE IN A SUITABLE ENVIROMENT AS      05444000
    THERE WILL UNDOUBTEDLY BE A FEW SYSTEM FAILURES.                    05446000
    ****************************************************************    05448000
                                                                        05450000
I.    Introduction                                                      05452000
                                                                        05454000
Collecting measurement data via the interrupt driven method is one way  05456000
to collect data about a computer system.  Although it does not yield as 05458000
accurate data as the event driven method, flexibility and low overhead  05460000
are its main advantages.  However, due to the difficuity in installing  05462000
an extra clock in the system, there were few tools available to the Lab 05464000
and field that used clock interrupts as a source of external interrupts.05466000
One of them, SAMPLER, used an extra clock and hence its use was limited 05468000
to the Lab and a few field offices.  Additionally, spare clocks cannot  05470000
be installed in HPIB systems.                                           05472000
                                                                        05474000
To overcome this difficulty and enhance applicability in this area, an  05476000
MPE interface is available so that one can "share" the system clock with05478000
MPE in an easy and low overhead fashion.  For details of the interface, 05480000
please refer to the mini-project document.  In this user's guide, we    05482000
shall restrict our attention to the data collection procedure that is   05484000
supplied by the user.                                                   05486000
                                                                        05488000
II.   Brief Summary of the Clock Interface                              05490000
                                                                        05492000
If no user is "sharing" the clock, it runs at the normal interrupt rate 05494000
of 100 ms.  When a user issues a request through GETCLOCK, one of the   05496000
parameters is the requested interrupt interval and another is the       05498000
program label of the data collection procedure.  After checking that no 05500000
other user is currently using the clock, GETCLOCK then obtains a        05502000
sharable CST entry to be used by the data collection procedure and then 05504000
locks and freezes its segment in memory.  Also it sets the clock        05506000
interrupt rate according to the user's request and calls the data       05508000
collection procedure at the specified interval.  After the data         05510000
collection is done, the user calls GIVECLOCK to release the data        05512000
collection procedure and the clock.  For details of these procedures and05514000
the meaning of the condition and error codes returned, please refer to  05516000
Appendix B of this document.                                            05518000
                                                                        05520000
III.  Data collection procedure                                         05522000
                                                                        05524000
It is paramont to have an efficient data collection procedure.  Since it05526000
operates on the ICS, the time spent in the procedure should be keep as  05528000
short as possible, preferably within 1 ms.  Also, since the size of the 05530000
ICS is usually smaller than most user stacks and non-expandable, extra  05532000
data segments should be used for data storage and the instructions MFDS 05534000
and MTDS should be used to move only the necessary data from and to the 05536000
extra data segment.                                                     05538000
                                                                        05540000
When entering the data collection procedure, DB is set in Bank 0 of the 05542000
memory and because code is executed on the ICS, the user should be      05544000
extremely careful when using DB-relative address so that it is done in a05546000
proper way.  Before leaving the procedure, make sure to set DB back to  05548000
the value it had entering the procedure.                                05550000
                                                                        05552000
When the procedure is entered, interrupts are enabled.  If the data the 05554000
user collects might be changed, he should disable interrupts during that05556000
period of time.  However, he should keep this time as short as possible.05558000
                                                                        05560000
The data collection procedure can reside in, and be compiled along with,05562000
the user's program.  It must be in a segment by itself and it must not  05564000
call any procedures of non-resident segments.                           05566000
                                                                        05568000
Since the data collection procedure is called by the procedure "TICK" of05570000
HARDRES.  It is considered to be a "pseudo" interrupt receiver, hence an05572000
"EXIT" should be used when leaving the data collection procedure.       05574000
{NEVER} uses "IXIT" for it will crash the system.                       05576000
                                                                        05578000
IV.   Data Storage                                                      05580000
                                                                        05582000
      It is advisable to use extra data segments to store the data.     05584000
      However, several important precautions have to be mentioned:      05586000
                                                                        05588000
      1.  The extra data segments should be locked and frozen in memory 05590000
          before data collection begins.  This can be done easily by    05592000
          calling the system intrinsic GETDSEG or system procedure      05594000
          GETDATASEG and using the returned DST number as a input value 05596000
          to GETCLOCK.  It then stores the DST numbers of those XDS in  05598000
          words %71 and %72 of MEASINFOTAB.  It will also lock and      05600000
          freeze those XDS's.  At process termination time MORGUE will  05602000
          call GIVECLOCK if the user failed to do so and dispose of the 05604000
          XDS's.                                                        05606000
                                                                        05608000
      2.  The initialization of the extra data segment should be done   05610000
          before data collection.  This will simplify the coding of the 05612000
          data collection procedure as well as minimize the time spent  05614000
          in the data collection procedure.                             05616000
                                                                        05618000
      The user can call GETCLOCK and enter the parameter INTRATE=0.     05620000
      This will perform all the functions of GETCLOCK except set the    05622000
      clock interrupt rate and call the user data collection procedure. 05624000
      Hence it will enable the user to initialize his data segments     05626000
      before actual data collection begins.                             05628000
                                                                        05630000
V.    Caveats                                                           05632000
                                                                        05634000
The Shared Clock Interface is a useful tool in the Lab as well as in the05636000
field.  However, potential destruction of the integrity of the system   05638000
exits if one does not use great care.  Here is a list of some of the    05640000
dangrous areas and some of the possible solutions:                      05642000
                                                                        05644000
      A.  NEVER modify absolute words %17 or %21 in the low memory and  05646000
          words %70 to %77 in the MEASINFOTAB directly.  Use only       05648000
          GETCLOCK and GIVECLOCK to set and reset these words and the   05650000
          system clock.                                                 05652000
                                                                        05654000
      B.  When entering the data collection procedure, always set the DB05656000
          register to an appropriate value even if you think you never  05658000
          use the DB register.  Reset the DB register before exiting.   05660000
          Never assume that DB is pointing at certain location.  NEVER  05662000
          USE PROCEDURE EXCHANGEDB, USE THE INSTRUCTION XCHD INSTEAD!   05664000
                                                                        05666000
      C.  Since the data collection procedure runs on the ICS, no       05668000
          boundary checking is done on behalf of the user.  Use extra   05670000
          data segments for data storage.  Never use any storage in the 05672000
          user process stack.                                           05674000
                                                                        05676000
      D.  Too frequent clock interrupts may impose a large amount of    05678000
          overhead on the system and perturb the data collected.  It is 05680000
          also true that a large interrupt interval will yield          05682000
          unreliable data.  Hence it is suggested that several          05684000
          experiments with different interrupt intervals be conducted so05686000
          that a feasible interval can be determined.                   05688000
                                                                        05690000
      E.  It is also suggested that the user set aside a few bits in the05692000
          available MEASINFOTAB words to synchronize the beginning and  05694000
          terminating of the data collection with the user process that 05696000
          calls GIVECLOCK(see Appendix A.).  DO NOT CALL GIVECLOCK FROM 05698000
          THE DATA COLLECTION PROCEDURE!                                05700000
                                                                        05702000
      F.  After each set of data are collected, be sure to call         05704000
          GIVECLOCK even if you intend to collect another set of data   05706000
          later.  You can specify a PLABEL of 0 to GIVECLOCK if you     05708000
          intend to collect another set of data a short while later but 05710000
          don't wish to release the clock to the system or to release   05712000
          the data collection procedure.  In doing so, the system clock 05714000
          will run at its normal interrupt rate of 100 ms during the    05716000
          transition time and reduce the overhead of the system.        05718000
                                                                        05720000
      G.  Finally, make sure to call GIVECLOCK again with the PLABEL of 05722000
          the data collection procedure as the input so that the clock  05724000
          will be released and other users will be able to share the    05726000
          system clock.  If you locked and froze any segments without   05728000
          GETCLOCK, be sure to unlock and unfreeze them!                05730000
$PAGE    "          SHARED CLOCK INTERFACE - PROCEDURES "               05732000
                          INTERFACE PROCEDURES                          05734000
I.   GETCLOCK                                                           05736000
Declaration:                                                            05738000
                                                                        05740000
     PROCEDURE GETCLOCK(INTRATE,PLABEL,ERRORN,XDS1,XDS2);               05742000
               VALUE PLABEL,XDS1,XDS2; INTEGER INTRATE, PLABEL,         05744000
               ERRORN,XDS1,XDS2; OPTION VARIABLE, PRIVILEGED,           05746000
               UNCALLABLE;                                              05748000
                                                                        05750000
Function:                                                               05752000
                                                                        05754000
     GETCLOCK will set-up the clock interrupt rate and lock and freeze  05756000
     the user data collection procedure.                                05758000
                                                                        05760000
Parameters:                                                             05762000
                                                                        05764000
     INTRATE(REQUIRED):  The input value is the requested interrupt     05766000
                         interval and the granted interval is the       05768000
                         returned value.  The returned value is         05770000
                         calculated as the largest divisor of 100 which 05772000
                         is within 10% of the requested value.  The     05774000
                         units are ms.                                  05776000
                                                                        05778000
                         A 0 INTRATE indicates initialization.  It will 05780000
                         cause all of the functions of GETCLOCK to be   05782000
                         performed except setting the new clock         05784000
                         interrupt rate and calling the user data       05786000
                         collection procedure.  Then the next call to   05788000
                         GETCLOCK with 0 PLABEL and correct INTRATE will05790000
                         start the data collection.                     05792000
                                                                        05794000
     PLABEL(REQUIRED):   The P-label is that of the user data collection05796000
                         procedure.  It can also be 0 if the user       05798000
                         already has his code segment locked and frozen 05800000
                         by a previous call to GETCLOCK.  He can then   05802000
                         call GIVECLOCK and GETCLOCK alternatively with 05804000
                         PLABEL set to zero to alter the clock interrupt05806000
                         rate or suspend data collection without losing 05808000
                         control of the clock.                          05810000
                                                                        05812000
     ERRORN(REQUIRED):   The returned value indicates the error         05814000
                         encountered.                                   05816000
                                                                        05818000
     XDS'S(OPTIONAL):    The DST index value returned by GETDSEG so that05820000
                         the XDSs will be locked and frozen in memory.  05822000
                                                                        05824000
Condition Codes and Returned Values:                                    05826000
                                                                        05828000
     CCE:      Request granted.  ERRORN = 0, INTRATE will be the granted05830000
               interrupt rate and the system clock is enabled to        05832000
               interrupt at that rate.  (NOTE:  If a non-zero INTRATE is05834000
               entered, then the system clock will be set at the new    05836000
               interrupt rate and the user's data collection procedure  05838000
               will be called at the specified interval. It is user's   05840000
               responsibility to synchronize the data collection        05842000
               activity and the clock from that point on.)              05844000
                                                                        05846000
     CCL:      Request denied.  The parameter ERRORN indicates the      05848000
               reason:                                                  05850000
                                                                        05852000
               1 --  missing parameter in GETCLOCK.                     05854000
               2 --  system clock is currently used by someone else.    05856000
               3 --  interrupt rate requested out of range.             05858000
               4 --  invalid P-label (if PLABEL is 0, this means that   05860000
                     GETCLOCK has not previously locked and frozen a    05862000
                     data collection procedure for this caller.)        05864000
               5 --  cannot lock or freeze code segment.                05866000
               6 --  cannot lock or freeze data segment.                05868000
               7 --  the user's data collection procedure is calling a  05870000
                     non-resident segment.                              05872000
               8 --  unable to obtain a sharable CST entry.             05874000
                                                                        05876000
     CCG:      Not returned by this procedure.                          05878000
                                                                        05880000
Comments:                                                               05882000
                                                                        05884000
    When the user data collection procedure is called, interrupts are   05886000
    enabled.  Hence it is user's responsibility to disable the          05888000
    interrupts if so he desires.  Also, every time his procedure is     05890000
    called, he should set the DB register upon entry and reset the DB   05892000
    register before exiting.                                            05894000
II.  GIVECLOCK                                                          05896000
Declaration:                                                            05898000
                                                                        05900000
     PROCEDURE GIVECLOCK(PLABEL);                                       05902000
               VALUE PLABEL;                                            05904000
               INTEGER PLABEL;                                          05906000
               OPTION PRIVILEGED,UNCALLABLE;                            05908000
                                                                        05910000
Function:                                                               05912000
                                                                        05914000
     GIVECLOCK will make sure that the caller is also the one who "owns"05916000
     the clock.  Then it unlocks and unfreezes the user data collection 05918000
     procedure and releases the sharable CST entry it occupied.  It also05920000
     unlocks and unfreezes the extra data segments, if any.  It then    05922000
     resets the clock interrupt rate back to the normal rate of 100 ms. 05924000
     However, if PLABEL is 0, then only the resetting of the clock      05926000
     interrupt rate is done.  In this case, the user can set and reset  05928000
     the clock without fear losing control of the clock and without     05930000
     relocking and freezing the data collection procedure.              05932000
                                                                        05934000
Parameters:                                                             05936000
                                                                        05938000
     PLABEL: This is the program label of the user's data collection    05940000
             procedure.  It is 0 if the user wants only to reset the    05942000
             clock but not to release control of the clock.             05944000
                                                                        05946000
Condition codes:                                                        05948000
                                                                        05950000
     CCE:  Request granted.                                             05952000
                                                                        05954000
     CCG:  Request denied.  The user does not "own" the clock.          05956000
                                                                        05958000
     CCL:  Request denied.  Can not unlock or unfreeze either the code  05960000
**********************************************************************>>05962000
 PROCEDURE GETINTRATE(IMS,INT,QN);                                      05964000
 INTEGER IMS,INT,QN;                                                    05966000
 OPTION UNCALLABLE;                                            <<04113>>05968000
 BEGIN                                                                  05970000
                                                                        05972000
<< THIS PROCEDURE RECEIVES THE REQUEST FROM THE USER.  >>               05974000
<< IMS IS THE REQUESTED INTERRUPT INTERVAL.  IT THEN   >>               05976000
<< COMPUTES THE LARGEST DIVISOR OF 100 SHCH THAT IT    >>               05978000
<< IS WITHIN 10% OF THE REQUESTED VALUE.  THE RETURNED >>               05980000
<< IS AS FOLLOWS:                                      >>               05982000
<<       IMS:  GRANTED INTERRUPT INTERVAL              >>               05984000
<<       INT:  CLOCK INTERRUPT RATE                    >>               05986000
<<       QN:   QUOTIENT = IMS/INT                      >>               05988000
                                                                        05990000
    INTEGER I,J,K,QI,TK;                                                05992000
    INTEGER ARRAY BASE(0:5) =PB := 100,50,25,20,10,5;                   05994000
                                                                        05996000
    IF 5 <= IMS <= 7  OR  13 <= IMS <= 17  THEN                         05998000
    BEGIN                                                               06000000
       INT := 5;                                                        06002000
       QN := (IMS+2)/5;                                                 06004000
       GOTO EXIT;                                                       06006000
    END;                                                                06008000
    IF 8 <= IMS <= 12  OR  IMS = 30  OR  IMS = 70  THEN                 06010000
    BEGIN                                                               06012000
       INT := 10;                                                       06014000
       QN := (IMS+2)/10;                                                06016000
       GOTO EXIT;                                                       06018000
    END;                                                                06020000
    IF 18 <= IMS <= 22  THEN                                            06022000
    BEGIN                                                               06024000
       INT := 20;                                                       06026000
       QN := 1;                                                         06028000
       GOTO EXIT;                                                       06030000
    END;                                                                06032000
    TK := IF IMS < 60  THEN  5  ELSE  IMS/10; << 10% OF IMS >>          06034000
    I := -1;                                                            06036000
    WHILE (I := I + 1) < 6  DO                                          06038000
    BEGIN                                                               06040000
       QI := IMS/BASE(I);                                               06042000
       J := IMS - QI*BASE(I);                                           06044000
       K := BASE(I) - J;                                                06046000
       IF J <= TK OR K < TK  THEN                                       06048000
       BEGIN                                                            06050000
          INT := BASE(I);                                               06052000
          QN := IF J <= K  THEN  QI  ELSE  QI+1;                        06054000
          GOTO EXIT;                                                    06056000
       END;                                                             06058000
    END;                                                                06060000
 EXIT:                                                                  06062000
    IMS := INT*QN;                                                      06064000
 END;                                                                   06066000
$PAGE    "          ******      CSTENTRY        ******"                 06068000
 INTEGER PROCEDURE CSTENTRY(INDEX,PLABEL);                              06070000
 VALUE INDEX,PLABEL;                                                    06072000
 INTEGER INDEX,PLABEL;                                                  06074000
 OPTION PRIVILEGED,UNCALLABLE;                                          06076000
 BEGIN                                                                  06078000
                                                                        06080000
<< THIS PROCEDURE GETS A SHARABLE CST ENTRY AND THEN   >>               06082000
<< COPY THE CONTENTS OF THE USER CSTX ENTRY INTO THAT  >>               06084000
<< SHARABLE ENTRY.  THE RETURNING VALUE IS THE NEW     >>               06086000
<< USER'S PROGRAM LABEL.                               >>               06088000
                                                                        06090000
    INTEGER I,CSTE;                                                     06092000
                                                                        06094000
    CSTENTRY := 0;                                                      06096000
    TOS := GETENTRY(1);                                                 06098000
    IF = THEN  RETURN  ELSE  CSTE := TOS&LSL(2);;                       06100000
    FOR I := 0  UNTIL  3  DO                                            06102000
        CSTI(CSTE + I) := DSTI(INDEX + I);                              06104000
    CSTENTRY:=LOGICAL(PLABEL.(0:8)&LSL(8)) LOR LOGICAL(CSTE/4);         06106000
 END;                                                                   06108000
$PAGE    "          ******      CHECKCST        ******"                 06110000
 PROCEDURE CHECKCST(INDEX);                                             06112000
 VALUE INDEX;                                                           06114000
 INTEGER INDEX;                                                         06116000
 OPTION PRIVILEGED,UNCALLABLE;                                          06118000
 BEGIN                                                                  06120000
                                                                        06122000
<< THIS PROCEDURE CHECKS THE USER CODE SEGMENT STT AREA TO >>           06124000
<< MAKE SURE THAT THE USER DOES NOT PCAL ANY NON-RESIDENT  >>           06126000
<< MPE SEGMENTS OR UN-FROZEN MEASIO.                       >>           06128000
                                                                        06130000
    INTEGER SEG, STTSIZE;                                               06132000
    DEFINE CORERESBIT=(7:1)#,    << CORE RESIDENT SEGMENT >>            06134000
           FREEZE=(6:1)#;        << SEGMENT FROZEN BIT >>               06136000
                                                                        06138000
     TOS := DSTI(INDEX+2);                << STACK BANK # >>   <<04313>>06140000
    TOS := DSTI(INDEX+3) - 1;                                           06142000
    TOS := DSTI(INDEX).(4:12)&LSL(2);    << STACK SIZE >>               06144000
     ASMB(LADD;LSEA); << GET # OF STT'S AT THE END OF STACK >> <<04313>>06146000
    STTSIZE := TOS.(8:8) + 1;                                           06148000
    WHILE (STTSIZE := STTSIZE - 1) > 0  DO  << CHECK ALL STT >>         06150000
    BEGIN                                                               06152000
       TOS := TOS - 1;                                                  06154000
       ASMB(LSEA);                                                      06156000
       IF S0 < 0  THEN      << EXTERNAL PCAL >>                         06158000
       BEGIN                                                            06160000
          IF S0.(8:8) > %300  THEN   << USER SEGMENT - NO NO >>         06162000
          BEGIN                                                         06164000
             CC := CCL;                                                 06166000
             RETURN;                                                    06168000
          END;                                                          06170000
          SEG := TOS.(8:8)&LSL(2);      << FOR CSTX ENTRY >>            06172000
          IF  NOT LOGICAL(CSTI(SEG+1)).CORERESBIT  THEN                 06174000
          BEGIN                                                         06176000
             TOS := CSTI(SEG+2);                                        06178000
             TOS := CSTI(SEG+3) - 19;                                   06180000
             ASMB(LSEA);                                                06182000
             IF  NOT TOS.FREEZE  THEN                                   06184000
             BEGIN                                                      06186000
                CC := CCG;                                              06188000
                RETURN;                                                 06190000
             END  ELSE  ASMB(DDEL);                                     06192000
          END;                                                          06194000
       END  ELSE  ASMB(DEL);                                            06196000
    END;                                                                06198000
    CC := CCE;                                                          06200000
 END;                                                                   06202000
$PAGE    "          ******      SETBIT          ******"        <<01836>>06204000
 PROCEDURE SETBIT(FLAG);                                       <<01836>>06206000
 VALUE FLAG;                                                   <<01836>>06208000
 LOGICAL FLAG;                                                 <<01836>>06210000
 OPTION PRIVILEGED,UNCALLABLE;                                 <<01836>>06212000
 BEGIN                                                         <<01836>>06214000
                                                               <<01836>>06216000
<< THIS PROCEDURE SET OR RESET(ACCORDING TO THE LOGICAL >>     <<01836>>06218000
<< VALUE OF FLAG) BIT 2 OF PXFIXED(%26).  THIS IS DONE  >>     <<01836>>06220000
<< BEFORE THE USER WAS GRANTED THE USE OF THE SYSTEM    >>     <<01836>>06222000
<< CLOCK.  THIS BIT WILL BE CHECK BY GIVECLOCK.         >>     <<01836>>06224000
                                                               <<01836>>06226000
    ARRAY QVAR(*) = Q+0;                                       <<01836>>06228000
                                                               <<01836>>06230000
    PUSH(Q,DL);                                                <<01836>>06232000
     ASMB(XCH; LSUB);               << Q - DL >>               <<04313>>06234000
    X := S0 - 2;                                               <<01836>>06236000
    TOS := QVAR(X);               << FIND PXFIXED AREA >>      <<01836>>06238000
     ASMB(LSUB);                                               <<04313>>06240000
    X := TOS + %26;             << PXFIXED(%26) >>             <<01836>>06242000
    STATUS.(6:2) := CCE;                                       <<01836>>06244000
    IF FLAG THEN QVAR(X):=QVAR(X) LOR %20000 ELSE              <<01836>>06246000
    BEGIN                                  << CLEAR BIT >>     <<01836>>06248000
       TOS := QVAR(X);                                         <<01836>>06250000
       ASMB(TRBC 2);                         << RESET BIT >>   <<01836>>06252000
       IF  =  THEN  STATUS.(6:2) := CCL      << BIT WAS SET>>  <<01836>>06254000
              ELSE  QVAR(X) := TOS;                            <<01836>>06256000
    END;                                                       <<01836>>06258000
 END;                                                          <<01836>>06260000
$PAGE    "          ******      GETCLOCK        ******"        <<01836>>06262000
 PROCEDURE GETCLOCK(INTRATE,PLABEL,ERRORN,XDS1,XDS2);          <<01836>>06264000
 VALUE PLABEL,XDS1,XDS2;                                       <<01836>>06266000
 INTEGER INTRATE,PLABEL,ERRORN,XDS1,XDS2;                      <<01836>>06268000
 OPTION VARIABLE,PRIVILEGED,UNCALLABLE;                        <<01836>>06270000
 BEGIN                                                         <<01836>>06272000
                                                               <<01836>>06274000
<< THIS PROCEDURE IS CALLED BY A USER TO REQUEST THE CHANGE >> <<01836>>06276000
<< OF SYSTEM CLOCK INTERRUPT INTERVAL.  IT ALSO MAKES SURE  >> <<01836>>06278000
<< THAT NO ONE IS CURRENTLY SHARING THE CLOCK.  ALSO, IT    >> <<01836>>06280000
<< LOCKS AND FREEZES THE CODE SEGMENT AND, IF ANY, DATA     >> <<01836>>06282000
<< SEGMENTS THAT WAS SUPPLIED BY THE USER VIA THE PRAMETERS.>> <<01836>>06284000
<< IT THEN ENABLES THE CLOCK TO RUN AT THE REQUESTED RATE.  >> <<01836>>06286000
                                                               <<01836>>06288000
    EQUATE  PCBSIZE = 16;                                      <<01836>>06290000
    INTEGER I, LP, INT, QN, CSTN, PIN, PINX, INDEX,            <<01836>>06292000
            CLKCOUNT, NEWLABEL, V := 1;                        <<01836>>06294000
    LOGICAL MASK = Q-4;                                        <<01836>>06296000
    POINTER P;                                                 <<01836>>06298000
                                                               <<01836>>06300000
    CC := CCL;                                                 <<01836>>06302000
    TOS := MASK.(11:3);                                        <<01836>>06304000
    IF S0 < 7  THEN            << MISSING PARAMETERS >>        <<01836>>06306000
    BEGIN                                                      <<01836>>06308000
       ERRORN := 1;                                            <<01836>>06310000
       RETURN;                                                 <<01836>>06312000
    END;                                                       <<01836>>06314000
                                                               <<01836>>06316000
    ASMB(PCN);  << PUSH PCB # >>                               <<01836>>06318000
    LP :=  IF TOS <= 2  THEN  %17  ELSE  17;                   <<01836>>06320000
    IF  PLABEL <> 0  THEN    << FIRST TIME USER >>             <<01836>>06322000
    BEGIN                                                      <<01836>>06324000
       IF  PLABEL > 0 OR PLABEL.(8:8) = 0  THEN                <<01836>>06326000
       BEGIN     << INVALID PLABEL >>                          <<01836>>06328000
          ERRORN := 4;                                         <<01836>>06330000
          RETURN;                                              <<01836>>06332000
       END;                                                    <<01836>>06334000
       PDISABLE;         << CHECK AVAILIBILITY OF THE CLOCK >> <<01836>>06336000
       IF  ABS(LP).(1:15) > 0  THEN  GOTO  BUSYCLOCK;          <<01836>>06338000
       FOR  I := 56 UNTIL 63  DO                               <<01836>>06340000
       IF  MEASINFOTABPTR(I) <> 0  THEN                        <<01836>>06342000
       BEGIN                                                   <<01836>>06344000
 BUSYCLOCK:                                                    <<01836>>06346000
          PENABLE;                                             <<01836>>06348000
          ERRORN := 2;                                         <<01836>>06350000
          RETURN;                                              <<01836>>06352000
          HELP;              << DUMMY CALL FOR DEBUG >>        <<01836>>06354000
       END;                                                    <<01836>>06356000
       SETBIT(TRUE);           << SET  PXFIXED(%26).(2:1) >>   <<01836>>06358000
       DLABEL := PLABEL.(1:15);  << TO GET HOLD OF THE CLOCK >><<01836>>06360000
       PENABLE;                                                <<01836>>06362000
    END  ELSE                                                  <<01836>>06364000
    BEGIN                                                      <<01836>>06366000
       PUSH(DL);        << MAKE SURE THIS GUY HAS THE CLOCK >> <<01836>>06368000
       @P := TOS;                                              <<01836>>06370000
       @P := @P - INTEGER(P(-2)) + %26; << PXFIXED WORD %26 >> <<01836>>06372000
       IF  NOT P.(2:1)  THEN    << HE TRIES TO SNEAK IN >>     <<01836>>06374000
       BEGIN                                                   <<01836>>06376000
          ERRORN := 9;                                         <<01836>>06378000
          RETURN;                                              <<01836>>06380000
       END;                                                    <<01836>>06382000
    END;                                                       <<01836>>06384000
                                                               <<01836>>06386000
    IF INTRATE = 0  THEN                                       <<01836>>06388000
    BEGIN         << INITIALIZATION >>                         <<01836>>06390000
       QN := 0;                                                <<01836>>06392000
       CLKCOUNT := 0;                                          <<01836>>06394000
       V := 0;                                                 <<01836>>06396000
       PLABEL := PLABEL.(1:15);                                <<01836>>06398000
       GOTO LOCKCST;                                           <<01836>>06400000
    END;                                                       <<01836>>06402000
                                                               <<01836>>06404000
    IF  ABS(LP).(1:15) > 0 OR DLABEL = 0  THEN                 <<01836>>06406000
    BEGIN           << CANNOT RESET RATE IF CLOCK IN USE >>    <<01836>>06408000
       ERRORN := 10;                                           <<01836>>06410000
       RETURN;                                                 <<01836>>06412000
    END;                                                       <<01836>>06414000
    IF  NOT (5 <= INTRATE <= 1000)  THEN                       <<01836>>06416000
    BEGIN  << INTERRUPT RATE OUT OF RANGE >>                   <<01836>>06418000
       ERRORN := 3;                                            <<01836>>06420000
       IF  PLABEL = 0  THEN  RETURN  ELSE  GOTO  SIMPLE'EXIT;  <<01836>>06422000
    END;                                                       <<01836>>06424000
    GETINTRATE(INTRATE,INT,QN);<< GET OPTIMAL INTERRUPT RATE >><<01836>>06426000
    CLKCOUNT := 100/INT;                                       <<01836>>06428000
    IF PLABEL=0  THEN                                          <<01836>>06430000
    BEGIN                                                      <<01836>>06432000
       NEWLABEL := DLABEL LOR %100000;                         <<01836>>06434000
       GOTO DONE;                                              <<01836>>06436000
    END;                                                       <<01836>>06438000
                                                               <<01836>>06440000
 LOCKCST:                                                      <<01836>>06442000
    CSTN := PLABEL.(8:8);                                      <<01836>>06444000
    IF =  THEN                                                 <<01836>>06446000
    BEGIN                                                      <<01836>>06448000
       ERRORN := 4;                                            <<01836>>06450000
       GOTO  SIMPLE'EXIT;                                      <<01836>>06452000
    END;                                                       <<01836>>06454000
    LOCKSEG(CSTN,0,0);                                         <<01836>>06456000
    IF <>  THEN                                                <<01836>>06458000
    BEGIN                                                      <<01836>>06460000
       ERRORN := 5;                                            <<01836>>06462000
       GOTO  SIMPLE'EXIT;                                      <<01836>>06464000
    END;                                                       <<01836>>06466000
    FREEZE(CSTN,0,0);                                          <<01836>>06468000
    IF <>  THEN                                                <<01836>>06470000
    BEGIN                                                      <<01836>>06472000
       ERRORN := 5;                                            <<01836>>06474000
       GOTO EXIT;                                              <<01836>>06476000
    END;                                                       <<01836>>06478000
    IF MASK  THEN                                              <<01836>>06480000
    BEGIN                   << LOCK AND FREEZE SECOND EDS >>   <<01836>>06482000
       LOCKSEG(XDS2,1,0);                                      <<01836>>06484000
       IF <>  THEN                                             <<01836>>06486000
       BEGIN                                                   <<01836>>06488000
          ERRORN := 6;                                         <<01836>>06490000
          GOTO EXIT;                                           <<01836>>06492000
       END;                                                    <<01836>>06494000
       FREEZE(XDS2,1,0);                                       <<01836>>06496000
       IF <>  THEN                                             <<01836>>06498000
       BEGIN                                                   <<01836>>06500000
          ERRORN := 6;                                         <<01836>>06502000
          GOTO EXIT;                                           <<01836>>06504000
       END;                                                    <<01836>>06506000
    END  ELSE  XDS2 := 0;                                      <<01836>>06508000
    IF MASK&LSR(1)  THEN    << LOCK AND FREEZE FIRST EDS >>    <<01836>>06510000
    BEGIN                                                      <<01836>>06512000
       LOCKSEG(XDS1,1,0);                                      <<01836>>06514000
       IF <>  THEN                                             <<01836>>06516000
       BEGIN                                                   <<01836>>06518000
          ERRORN := 6;                                         <<01836>>06520000
          GOTO EXIT;                                           <<01836>>06522000
       END;                                                    <<01836>>06524000
       FREEZE(XDS1,1,0);                                       <<01836>>06526000
       IF <>  THEN                                             <<01836>>06528000
       BEGIN                                                   <<01836>>06530000
          ERRORN := 6;                                         <<01836>>06532000
          GOTO EXIT;                                           <<01836>>06534000
       END;                                                    <<01836>>06536000
    END  ELSE  XDS1 := 0;                                      <<01836>>06538000
                                                               <<01836>>06540000
    PINX := ABS(4) - ABS(3);                                   <<01836>>06542000
    PIN := PINX/PCBSIZE;                                       <<01836>>06544000
    TOS := BUILDSEGID(2, CSTN, PIN); << GET SEG IDENTIFIER >>  <<01836>>06546000
    INDEX := CONVSEGIDTOSTINX(*);  << COMPUTE CSTX INDEX >>    <<01836>>06548000
    CHECKCST(INDEX);       << CHECK USER STT AREA >>           <<01836>>06550000
    IF <>  THEN                                                <<01836>>06552000
    BEGIN                                                      <<01836>>06554000
       ERRORN := 7;                                            <<01836>>06556000
       GOTO EXIT;                                              <<01836>>06558000
    END;                                                       <<01836>>06560000
    IF CSTN > %300  THEN << USER CODE, NEED A SHARABLE ENTRY >><<01836>>06562000
    BEGIN                                                      <<01836>>06564000
       NEWLABEL := CSTENTRY(INDEX,PLABEL);                     <<01836>>06566000
       IF  =  THEN                                             <<01836>>06568000
       BEGIN                                                   <<01836>>06570000
          ERRORN := 8;                                         <<01836>>06572000
    EXIT:                                                      <<01836>>06574000
          IF  MASK  THEN                                       <<01836>>06576000
          BEGIN                                                <<01836>>06578000
             UNFREEZE(XDS2,1,0);                               <<01836>>06580000
             UNLOCKSEG(XDS2,1,0);                              <<01836>>06582000
          END;                                                 <<01836>>06584000
          IF  MASK&LSR(1)  THEN                                <<01836>>06586000
          BEGIN                                                <<01836>>06588000
             UNFREEZE(XDS1,1,0);                               <<01836>>06590000
             UNLOCKSEG(XDS1,1,0);                              <<01836>>06592000
          END;                                                 <<01836>>06594000
          UNFREEZE(CSTN,0,PINX);                               <<01836>>06596000
          UNLOCKSEG(CSTN,0,PINX);                              <<01836>>06598000
 SIMPLE'EXIT:                                                  <<01836>>06600000
          DLABEL := 0;                                         <<01836>>06602000
          SETBIT(FALSE);                                       <<01836>>06604000
          RETURN;                                              <<01836>>06606000
       END;                                                    <<01836>>06608000
    END  ELSE  NEWLABEL := PLABEL;                             <<01836>>06610000
                                                               <<01836>>06612000
    ABS(LP) := %100000; << INDICATES SHARED CLOCK HAS USED >>  <<01836>>06614000
    XDS1INDEX := XDS1;                                         <<01836>>06616000
    XDS2INDEX := XDS2;                                         <<01836>>06618000
 DONE:                                                         <<01836>>06620000
    CC := CCE;                                                 <<01836>>06622000
    ERRORN := 0;                                               <<01836>>06624000
    DISABLE;     << ENABLE THE CLOCK WITH NEW RATE >>          <<01836>>06626000
    DCOUNT := V;                                               <<01836>>06628000
    DLIMIT := QN;                                              <<01836>>06630000
    TCOUNT := V;                                               <<01836>>06632000
    TLIMIT := CLKCOUNT;                                        <<01836>>06634000
    DLABEL := NEWLABEL;                                        <<01836>>06636000
    ENABLE;                                                    <<01836>>06638000
    DELAY(200D);                                               <<01836>>06640000
 END;                                                          <<01836>>06642000
$CONTROL SEGMENT=MAIN                                          <<01836>>06644000
END.                                                           <<01836>>06646000
