<< LINES .001/.009 ARE RESERVED FOR SYSTEMS INTEGRATION>>               00000001
$CONTROL MAP,CODE,USLINIT                                               00002000
<<CACHESEG : MODULE 5E>>                                       <<jb.03>>00003000
$CONTROL PRIVILEGED,SEGMENT=CACHESEG,MAIN=CACHESEG                      00004000
                                                                        00005000
COMMENT                                                                 00006000
                                                                        00007000
This version of CACHESEG (5E) is used to statisfy all unresolved        00008000
caching related procedures for those systems where disc caching         00009000
was not purchased.                                                      00010000
                                                                        00011000
;                                                                       00012000
                                                                        00013000
BEGIN                                                                   00014000
                                                                        00015000
<< Cache status returns >>                                              00016000
                                                                        00017000
EQUATE                                                                  00018000
   stat'ok                = 0,                                          00019000
   stat'no'dst            = 1,                                          00020000
   stat'int'error         = 2,                                          00021000
   stat'ldev'cached       = 3,                                          00022000
   stat'cdt'overflow      = 4,                                          00023000
   stat'dev'not'cachable  = 5,                                          00024000
   stat'sys'not'cachable  = 6;                                          00025000
                                                                        00026000
                                                                        00027000
$page "PROCEDURE IsSysCachable"                                         00028000
LOGICAL PROCEDURE IsSysCachable;                                        00029000
OPTION PRIVILEGED,UNCALLABLE;                                           00030000
                                                                        00031000
COMMENT                                                                 00032000
                                                                        00033000
If the customer purchases disc caching, then this procedure    <<*kim*>>00034000
and the full complement of procedures in this module will be   <<*kim*>>00035000
installed into SL.PUB.SYS. However, if they did not purchase   <<*kim*>>00036000
disc caching, this procedure would always return false and     <<*kim*>>00037000
this module would be "stubbed" out.                            <<*kim*>>00038000
                                                                        00039000
;                                                                       00040000
                                                                        00041000
BEGIN                                                                   00042000
                                                                        00043000
                                                               <<*kim*>>00044000
                                                                        00045000
IsSysCachable := FALSE;                                                 00046000
                                                                        00047000
END;  <<Procedure IsSysCachable>>                                       00048000
                                                                        00049000
$page "PROCEDURE IsDevCachable"                                         00050000
LOGICAL PROCEDURE IsDevCachable(ldev);                                  00051000
VALUE ldev;                                                             00052000
INTEGER ldev;                                                           00053000
OPTION PRIVILEGED,UNCALLABLE;                                           00054000
BEGIN                                                                   00055000
                                                                        00056000
IsDevCachable := FALSE;                                                 00057000
                                                                        00058000
END;  <<Procedure IsDevCachable>>                                       00059000
$page "PROCEDURE CDT'GET'ENTRY"                                         00060000
integer procedure CDT'GET'ENTRY;                                        00061000
option privileged,uncallable;                                           00062000
begin                                                                   00063000
                                                                        00064000
end;  << of procedure GET'CDT'ENTRY >>                                  00065000
$page "CDT'FREE'ENTRY procedure"                                        00066000
procedure CDT'FREE'ENTRY(CDT'ENTRY);                                    00067000
value CDT'ENTRY;                                                        00068000
integer CDT'ENTRY;                                                      00069000
option privileged,uncallable;                                           00070000
begin                                                                   00071000
                                                                        00072000
end;  << of procedure CDT'FREE'ENTRY >>                                 00073000
$page "CDT'SET'BIT CDT'GET'BIT procedure executor"                      00074000
logical procedure CDT'SET'BIT(CDT'ENTRY,BIT'NUMBER,BIT'VALUE);          00075000
value CDT'ENTRY,BIT'NUMBER,BIT'VALUE;                                   00076000
integer CDT'ENTRY,BIT'NUMBER;                                           00077000
logical BIT'VALUE;                                                      00078000
option privileged,uncallable;                                           00079000
begin                                                                   00080000
                                                                        00081000
ENTRY CDT'GET'BIT;                                                      00082000
                                                                        00083000
CDT'GET'BIT:                                                            00084000
                                                                        00085000
end;   << of procedure CDT'SET'BIT >>                                   00086000
$page "Procedure CDT'SET'WORD / CDT'GET'WORD / CDT'ADD'WORD"            00087000
integer procedure CDT'SET'WORD(CDT'ENTRY,WORD'NUMBER,WORD'VALUE);       00088000
value CDT'ENTRY,WORD'NUMBER,WORD'VALUE;                                 00089000
integer CDT'ENTRY,WORD'NUMBER,WORD'VALUE;                               00090000
option privileged,uncallable;                                           00091000
begin                                                                   00092000
                                                                        00093000
ENTRY CDT'ADD'WORD, CDT'GET'WORD;                                       00094000
                                                                        00095000
CDT'ADD'WORD:                                                           00096000
CDT'GET'WORD:                                                           00097000
                                                                        00098000
end;  << of procedure CDT'SET'WORD >>                                   00099000
$page "Procedure CDT'SET'DOUBLE / CDT'GET'DOUBLE / CDT'ADD'DOUBLE"      00100000
double procedure CDT'SET'DOUBLE(CDT'ENTRY,WORD'NUMBER,WORD'VALUE);      00101000
value CDT'ENTRY,WORD'NUMBER,WORD'VALUE;                                 00102000
integer CDT'ENTRY,WORD'NUMBER;                                          00103000
double WORD'VALUE;                                                      00104000
option privileged,uncallable;                                           00105000
begin                                                                   00106000
                                                                        00107000
ENTRY CDT'ADD'DOUBLE, CDT'GET'DOUBLE;                                   00108000
                                                                        00109000
CDT'ADD'DOUBLE:                                                         00110000
CDT'GET'DOUBLE:                                                         00111000
                                                                        00112000
end;  << of procedure CDT'SET'DOUBLE >>                                 00113000
$page "CDT'GET'MD'ENTRY"                                                00114000
integer procedure CDT'GET'MD'ENTRY(LDEV'ENTRY,CD'BASE'SECTOR,           00115000
                                   MD'INDEX);                           00116000
value LDEV'ENTRY,CD'BASE'SECTOR,MD'INDEX;                               00117000
integer LDEV'ENTRY,MD'INDEX;                                            00118000
double CD'BASE'SECTOR;                                                  00119000
option privileged,uncallable,internal;                         <<jb.03>>00120000
begin                                                                   00121000
                                                                        00122000
end; << of procedure CDT'GET'MD'ENTRY >>                                00123000
$page "CDT'REL'MD'ENTRY"                                                00124000
procedure CDT'REL'MD'ENTRY(LDEV'ENTRY,CDT'ENTRY);                       00125000
value LDEV'ENTRY,CDT'ENTRY;                                             00126000
integer LDEV'ENTRY,CDT'ENTRY;                                           00127000
option privileged,uncallable,internal;                         <<jb.03>>00128000
begin                                                                   00129000
                                                                        00130000
end;  << of procedure CDT'REL'MD'ENTRY >>                               00131000
$page "CDT'QUEUE'LDR"                                                   00132000
procedure CDT'QUEUE'LDR(CDT'ENTRY,LDR'INDEX,QUEUE);                     00133000
value CDT'ENTRY,LDR'INDEX,QUEUE;                                        00134000
integer CDT'ENTRY,LDR'INDEX,QUEUE;                                      00135000
option privileged,uncallable;                                           00136000
begin                                                                   00137000
                                                                        00138000
                                                                        00139000
end;  << of procedure CDT'QUEUE'REQUEST >>                              00140000
$page "CDT'DEQUEUE'LDR"                                                 00141000
procedure CDT'DEQUEUE'LDR(CDT'ENTRY,LDR'INDEX,QUEUE);                   00142000
value CDT'ENTRY,LDR'INDEX,QUEUE;                                        00143000
integer CDT'ENTRY,LDR'INDEX,QUEUE;                                      00144000
option privileged,uncallable;                                           00145000
begin                                                                   00146000
                                                                        00147000
                                                                        00148000
end;  << of procedure CDT'DEQUEUE'LDR >>                                00149000
$page "CDT'FIND'DE"                                                     00150000
integer procedure CDT'FIND'DE(LDEV);                                    00151000
value LDEV;                                                             00152000
integer LDEV;                                                           00153000
option privileged,uncallable;                                           00154000
begin                                                                   00155000
                                                                        00156000
end;  << of procedure CDT'FIND'DE >>                                    00157000
$page "CDT'FORCE'LDR'COMPLETION"                                        00158000
procedure CDT'FORCE'LDR'COMPLETION(LDR'INDEX);                          00159000
value LDR'INDEX;                                                        00160000
integer LDR'INDEX;                                                      00161000
option privileged,uncallable;                                           00162000
begin                                                                   00163000
                                                                        00164000
ENTRY CDT'FORCE'CDT'COMPLETION;                                         00165000
                                                                        00166000
CDT'FORCE'CDT'COMPLETION:                                               00167000
                                                                        00168000
end;  << of procedure CDT'FORCE'LDR'COMPLETION >>                       00169000
$page "CDT'LOCK'RANGE"                                                  00170000
integer procedure CDT'LOCK'RANGE(LDEV'ENTRY,LDR'ADR,UPPER'LDR'ADR);     00171000
value LDEV'ENTRY,LDR'ADR,UPPER'LDR'ADR;                                 00172000
integer LDEV'ENTRY;                                                     00173000
double LDR'ADR,UPPER'LDR'ADR;                                           00174000
option privileged,uncallable;                                           00175000
begin                                                                   00176000
end;  << of procedure CDT'LOCK'RANGE >>                                 00177000
$page "Procedure CDT'STRATEGY"                                          00178000
procedure CDT'STRATEGY(CDT'ENTRY,DISCREQ);                              00179000
value CDT'ENTRY,DISCREQ;                                                00180000
integer CDT'ENTRY,DISCREQ;                                              00181000
option privileged,uncallable,internal;                         <<jb.03>>00182000
begin                                                                   00183000
                                                                        00184000
end;  << of procedure CDT'STRATEGY >>                                   00185000
$page "CDT'INITIATOR / CDT'COMPLETOR procedure"                         00186000
procedure CDT'INITIATOR(CDT'ENTRY,DISC'REQ);                            00187000
value CDT'ENTRY,DISC'REQ;                                               00188000
integer CDT'ENTRY,DISC'REQ;                                             00189000
option privileged,uncallable,internal;                         <<jb.03>>00190000
begin                                                                   00191000
                                                                        00192000
entry CDT'COMPLETOR;                                                    00193000
                                                                        00194000
CDT'COMPLETOR:                                                          00195000
                                                                        00196000
                                                                        00197000
end;  << of procedure CDT'INITIATOR and CDT'COMPLETOR >>                00198000
$page "Procedure REQUEST'CACHE"                                         00199000
logical procedure REQUEST'CACHE(DISCREQ);                               00200000
value DISCREQ;                                                          00201000
integer DISCREQ;                                                        00202000
option privileged,uncallable,internal;                         <<jb.03>>00203000
begin                                                                   00204000
                                                                        00205000
end;  << of procedure REQUEST'CACHE >>                                  00206000
$page "Procedure FLUSH'CACHE"                                           00207000
integer procedure FLUSH'CACHE(LDEV,START'ADDR,LIMIT'ADDR);     <<jb.03>>00208000
value LDEV,START'ADDR,LIMIT'ADDR;                              <<jb.03>>00209000
integer LDEV;                                                           00210000
double START'ADDR,LIMIT'ADDR;                                  <<jb.03>>00211000
option uncallable, privileged;                                          00212000
begin                                                                   00213000
                                                                        00214000
FLUSH'CACHE := 0;                                                       00215000
end;   << of procedure FLUSH'CACHE >>                                   00216000
$page "CDT'ATTACHIO"                                                    00217000
DOUBLE PROCEDURE CDT'ATTACHIO(LDEV,QMISC,DSTX,ADDR,FNCT,                00218000
                              CNT,P1,P2,FLAGS,                          00219000
                              EXTBASE,EXTSIZE);                         00220000
                                                                        00221000
VALUE                       LDEV, QMISC, DSTX, ADDR, FNCT,              00222000
                            EXTBASE, EXTSIZE,                           00223000
                            CNT, P1, P2, FLAGS;                         00224000
                                                                        00225000
INTEGER                     LDEV, QMISC, DSTX, ADDR, FNCT,              00226000
                            CNT, P1, P2, FLAGS;                         00227000
                                                                        00228000
DOUBLE                      EXTBASE;                                    00229000
                                                                        00230000
LOGICAL                     EXTSIZE;                                    00231000
                                                                        00232000
OPTION PRIVILEGED,UNCALLABLE;                                           00233000
BEGIN                                                                   00234000
                                                                        00235000
END;      <<  CDT'ATTACHIO >>                                           00236000
$page "Cached Region Management Procedures : Link Cached Region"        00237000
PROCEDURE LinkCachedRegion ( regionbase );                              00238000
VALUE regionbase;                                                       00239000
DOUBLE regionbase;                                                      00240000
OPTION PRIVILEGED,UNCALLABLE;                                           00241000
                                                                        00242000
BEGIN                                                                   00243000
                                                                        00244000
END; <<LinkCachedDomain>>                                               00245000
                                                                        00246000
$page "Cached Region Management Procedures : Unlink Cached Region"      00247000
PROCEDURE UnlinkCachedRegion ( regionbase );                            00248000
VALUE regionbase;                                                       00249000
DOUBLE regionbase;                                                      00250000
OPTION PRIVILEGED,UNCALLABLE;                                           00251000
                                                                        00252000
BEGIN                                                                   00253000
END;  <<UnlinkCachedDomain>>                                            00254000
$page "Cache Management Utilities : Zap Cached Domain"                  00255000
PROCEDURE ZapCachedDomain(regionbase);                                  00256000
VALUE regionbase;                                                       00257000
DOUBLE regionbase;                                                      00258000
OPTION PRIVILEGED,UNCALLABLE;                                           00259000
                                                                        00260000
BEGIN                                                                   00261000
                                                                        00262000
END;  <<ZapCachedDomain>>                                               00263000
$page "Cache Utilities : CDT'MAP'CACHED'DOMAIN"                         00264000
LOGICAL PROCEDURE CDT'MAP'CACHED'DOMAIN(devcdtentry,start'addr,         00265000
                                        limit'addr,new'cdt,    <<ak.01>>00266000
                                        ldr'entry'index);      <<ak.01>>00267000
VALUE devcdtentry,start'addr,limit'addr,new'cdt,               <<ak.01>>00268000
      ldr'entry'index;                                                  00269000
INTEGER devcdtentry,new'cdt;                                            00270000
LOGICAL ldr'entry'index;                                       <<ak.01>>00271000
DOUBLE start'addr,limit'addr;                                           00272000
OPTION PRIVILEGED,UNCALLABLE,INTERNAL;                         <<jb.03>>00273000
BEGIN                                                                   00274000
                                                                        00275000
ENTRY CDT'FLUSH'CACHE;                                                  00276000
                                                                        00277000
CDT'FLUSH'CACHE:                                                        00278000
                                                                        00279000
END;  <<Map'Cached'Domain>>                                             00280000
$page "Cache Management Utilities : CDT'Unmap'Region"                   00281000
PROCEDURE CDT'Unmap'Region(devcdtentry,regcdtentry);                    00282000
VALUE devcdtentry,regcdtentry;                                          00283000
INTEGER devcdtentry,regcdtentry;                                        00284000
OPTION PRIVILEGED,UNCALLABLE,INTERNAL;                         <<jb.03>>00285000
                                                                        00286000
BEGIN                                                                   00287000
                                                                        00288000
END;  <<PROCEDURE CDT'Unmap'Region>>                                    00289000
                                                                        00290000
$Page "Cache/Mem Mgr Interfaces : Cache Transfer Completor"             00291000
                                                                        00292000
PROCEDURE CacheXferComp(ldr'entry'index,iostatus);                      00293000
VALUE ldr'entry'index,iostatus;                                         00294000
INTEGER ldr'entry'index,iostatus;                                       00295000
OPTION PRIVILEGED, UNCALLABLE, INTERNAL;                       <<jb.03>>00296000
                                                                        00297000
BEGIN                                                                   00298000
                                                                        00299000
END;  <<Procedure CacheXferComp>>                                       00300000
$PAGE "Cache Write Completor"                                           00301000
PROCEDURE CacheWriteComp(CDTEntryNumber,XferStatus);                    00302000
VALUE CDTEntryNumber,XferStatus;                                        00303000
INTEGER CDTENTRYNumber,XferStatus;                                      00304000
OPTION PRIVILEGED,UNCALLABLE;                                           00305000
BEGIN                                                                   00306000
                                                                        00307000
END;  <<CacheWriteComp>>                                                00308000
$PAGE "Process CDT Disc Request Queue"                                  00309000
PROCEDURE ProcessCDTLogReqQueue (cdtentrynum, iostatus, xfercnt);       00310000
VALUE cdtentrynum,iostatus,xfercnt;                                     00311000
INTEGER cdtentrynum, iostatus,xfercnt;                                  00312000
OPTION PRIVILEGED,UNCALLABLE;                                           00313000
                                                                        00314000
BEGIN                                                                   00315000
                                                                        00316000
END;  <<Procedure  ProcessCDTReqQ>>                                     00317000
$PAGE "DISC CACHE ENABLE / DISABLE CONTROL : CACHE'LDEV  "     <<jb.03>>00318000
procedure CACHE'LDEV(LDEV,STAT);                               <<jb.03>>00319000
value LDEV;                                                    <<jb.03>>00320000
integer LDEV,STAT;                                             <<jb.03>>00321000
option privileged,uncallable;                                  <<jb.03>>00322000
begin                                                          <<jb.03>>00323000
                                                               <<jb.03>>00324000
STAT := stat'sys'not'cachable;                                          00325000
                                                                        00326000
END;  << of procedure CACHE'LDEV >>                            <<jb.03>>00327000
$PAGE "DISC CACHE ENABLE / DISABLE CONTROL : UNCACHE'LDEV  "   <<jb.03>>00328000
procedure UNCACHE'LDEV(LDEV,STATR);                            <<jb.03>>00329000
value LDEV;                                                    <<jb.03>>00330000
integer LDEV,STATR ;                                           <<jb.03>>00331000
option privileged,uncallable;                                  <<jb.03>>00332000
begin                                                          <<jb.03>>00333000
                                                                        00334000
STATR := stat'sys'not'cachable;                                         00335000
                                                                        00336000
end;   << of procedure UNCACHE'LDEV >>                         <<jb.03>>00337000
$page "CDT'DISPLAY'LDEVS"                                      <<ak.01>>00338000
procedure CDT'DISPLAY'LDEVS(RESET'TTLS,RSTAT);                 <<ak.01>>00339000
value RESET'TTLS;                                              <<ak.01>>00340000
logical RESET'TTLS;                                            <<ak.01>>00341000
integer RSTAT;                                                 <<ak.01>>00342000
option privileged,uncallable;                                  <<ak.01>>00343000
begin                                                          <<ak.01>>00344000
                                                               <<ak.01>>00345000
RSTAT := stat'sys'not'cachable;                                         00346000
                                                                        00347000
end;  << of procedure CDT'DISPLAY'DISCS >>                     <<ak.01>>00348000
$page "CDT'SET'SEQ / CDT'SET'RND / CDT'SET'POST procedure"     <<ak.01>>00349000
procedure CDT'SET'SEQ(PARM,RSTAT);                             <<ak.01>>00350000
value PARM;                                                    <<ak.01>>00351000
integer PARM,RSTAT;                                            <<ak.01>>00352000
option privileged,uncallable;                                  <<ak.01>>00353000
begin                                                          <<ak.01>>00354000
                                                                        00355000
ENTRY CDT'SET'POST, CDT'SET'RND;                                        00356000
                                                                        00357000
CDT'SET'POST:                                                           00358000
CDT'SET'RND:                                                            00359000
                                                                        00360000
RSTAT := stat'sys'not'cachable;                                         00361000
                                                                        00362000
end;                                                           <<ak.01>>00363000
                                                               <<jb.03>>00364000
$CONTROL SEGMENT = MAIN                                        <<jb.03>>00365000
END.  <<CACHESEG>>                                             <<jb.03>>00366000
