Trailing-Edge
-
PDP-10 Archives
-
CFS_TSU04_19910205_1of1
-
update/t20src/dynlib.r36
There are 4 other files named dynlib.r36 in the archive. Click here to see a list.
! DYNLIB definitions for BLISS-36 users
!
! COPYRIGHT (C) DIGITAL EQUIPMENT CORPORATION 1984, 1986.
! ALL RIGHTS RESERVED.
!
! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND
! COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH
! THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR
! ANY OTHER COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE
! AVAILABLE TO ANY OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE
! SOFTWARE IS HEREBY TRANSFERRED.
!
! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT
! NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL
! EQUIPMENT CORPORATION.
!
! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF
! ITS SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY DIGITAL.
!
! Edit History
! Version 1.0
! Version 1.1
!.EDIT 50 Formally go to version 1.1, update copyright, insert V1.1
! development changes (formally V2)
! DDB,15-Jan-85,SPR:NONE
!.EDIT 54 Fix mistake in DYNLIB.R36 routine linkage declarations.
! DDB,5-JUN-85,SPR:NONE
!.EDIT 55 Add RL$2BG -- convert two-word byte-pointer to OWG.
! DDB,10-JUN-85,SPR:NONE
REQUIRE 'BLI:TENDEF';
! Field definitions for condition-handling data structures
FIELD
SIG$HN_FIELDS =
SET
SIG$HN_HANDLER = [0,0,%BPVAL,0],
SIG$HN_ENABLE_MASK = [1,0,%BPVAL,0],
SIG$HN_CHAR_MASK = [2,0,%BPVAL,0],
SIG$HN_USER_DATA = [3,0,%BPVAL,0]
TES,
SIG$SG_FIELDS =
SET
SIG$SG_CONDITION = [0,0,%BPVAL,0],
SIG$SG_NEXT = [1,0,%BPVAL,0],
SIG$SG_FAC_NAME = [2,0,%BPVAL,0],
SIG$SG_COND_NAME = [3,0,%BPVAL,0],
SIG$SG_MESSAGE = [4,0,%BPVAL,0],
SIG$SG_PC = [5,0,%BPVAL,0],
SIG$SG_CLASS_MASK = [6,0,%BPVAL,0],
SIG$SG_FLAGS = [7,0,%BPVAL,0],
SIG$SG_USER_DATA = [8,0,%BPVAL,0]
TES,
SIG$CC_FIELDS =
SET
SIG$CC_ID = [0,31,29,0],
SIG$CC_SEVERITY = [0, 2, 3, 0],
SIG$CC_SUCCESS = [0, 0, 1, 0],
SIG$CC_FACILITY = [0, 31, 14, 0],
SIG$CC_FACILITY_CUST_DEF = [0, 31, 1, 0],
SIG$CC_MESSAGE_ID = [0, 17, 15, 0],
SIG$CC_MESSAGE_CUST_DEF = [0, 17, 1, 0]
TES;
MACRO
SIG$HN = BLOCK [4] FIELD (SIG$HN_FIELDS) %,
SIG$SG = BLOCK [9] FIELD (SIG$SG_FIELDS) %,
SIG$CC = BLOCK [1] FIELD (SIG$CC_FIELDS) %;
LITERAL
SIG$K_CLASS_UNWIND = 1 ^ 35,
SIG$K_CLASS_APR_TRAP = 1 ^ 34,
SIG$K_CLASS_DATA_ERROR = 1 ^ 33,
SIG$K_CLASS_DISK_QUOTA = 1 ^ 32,
SIG$K_CLASS_EOF = 1 ^ 31,
SIG$K_CLASS_ILL_INST = 1 ^ 30,
SIG$K_CLASS_ILL_READ = 1 ^ 29,
SIG$K_CLASS_ILL_WRITE = 1 ^ 28,
SIG$K_CLASS_INF_STOP = 1 ^ 27,
SIG$K_CLASS_NONEX_PAGE = 1 ^ 26,
SIG$K_CLASS_PDL_OVERFLOW = 1 ^ 25,
SIG$K_CLASS_SOFTWARE = 1 ^ 24,
SIG$K_CLASS_SYSTEM_RESOURCE = 1 ^ 23,
SIG$K_CLASS_CHAR = 1 ^ 22,
SIG$K_CLASS_TERM = 1 ^ 21;
MACRO
MASKB ( ! Make bit-mask from HO to LO
ho, ! High-order bit in MACRO format
! (highest-order bit is 0)
lo ! Low-order bit in MACRO format
) =
((1^(35-ho)-1+1^(35-ho)) AND (-(1^(35-lo))))
%;
LITERAL
SG$ID=MASKB(4,32), ! Condition ID
SG$SEV=MASKB(33,35), ! Severity
SG$SUC=MASKB(35,35), ! Success
SG$FAC=MASKB(4,17), ! Facility code (including SG$FCD)
SG$FCD=MASKB(4,4), ! Set if facility is customer-defined
SG$MSG=MASKB(18,32), ! Message ID (including SG$MCD)
SG$MCD=MASKB(18,18); ! Customer-defined message flag
LITERAL
SIG$K_WARNING = 0,
SIG$K_SUCCESS = 1,
SIG$K_ERROR = 2,
SIG$K_INFO = 3,
SIG$K_SEVERE = 4;
! Macro to support run-time comparison of two condition codes
! Returns true if they are equal.
MACRO
$CMCC (cc1, cc2) =
((cc1 AND SG$ID) EQL (cc2 AND SG%ID))
%;
LINKAGE
! Linkage for a DYNLIB condition handling routine
DYN$HANDLER_LINKAGE = PUSHJ (REGISTER = 1, REGISTER = 2;
REGISTER = 1, REGISTER = 2) :
NOPRESERVE (0,1,2,3,4,5,6,7,8,9,10,11,12,13)
LINKAGE_REGS (15,14,0),
! Linkage for calling SIGEST/SIGREM
DYN$CLEAN_STACK_LINKAGE = PUSHJ (STANDARD) :
PRESERVE (0,1,2,3,4,5,6,7,8,9,10,11,12,13)
LINKAGE_REGS (15,14,0),
! Linkage for calling destructive routines
DYN$DESTRUCTIVE_LINKAGE = PUSHJ (
REGISTER = 1, REGISTER = 2, REGISTER = 3, REGISTER = 4, REGISTER = 5;
REGISTER = 1, REGISTER = 2) :
NOPRESERVE (0,1,2,3,4,5,6,7,8,9,10,11,12,13)
LINKAGE_REGS (15,14,0),
! Linkage for calling particularly clean routines
DYN$CLEAN_LINKAGE = PUSHJ (
REGISTER = 1, REGISTER = 2, REGISTER = 3, REGISTER = 4, REGISTER = 5;
REGISTER = 1, REGISTER = 2) :
PRESERVE (0,1,2,3,4,5,6,7,8,9,10,11,12,13)
LINKAGE_REGS (15,14,0),
! Linkage for calling normal routines
DYN$LINKAGE = PUSHJ (
REGISTER = 1, REGISTER = 2, REGISTER = 3, REGISTER = 4, REGISTER = 5;
REGISTER = 1, REGISTER = 2) :
PRESERVE (6,7,8,9,10,11,12,13)
NOPRESERVE (0,1,2,3,4,5)
LINKAGE_REGS (15,14,0),
! [55] Linkage for calling ME$MEM and maybe others
DYN$123_LINKAGE = PUSHJ (
REGISTER = 1, REGISTER = 2;
REGISTER = 3) :
PRESERVE (4,5,6,7,8,9,10,11,12,13)
NOPRESERVE (0,1,2,3)
LINKAGE_REGS (15,14,0)
;
! Routines user may want to call
! [54] Corrected syntax
! [55] Aphabetized
EXTERNAL ROUTINE
DY$MIN: DYN$DESTRUCTIVE_LINKAGE NOVALUE,
ME$ALM: DYN$LINKAGE NOVALUE,
ME$DLM: DYN$LINKAGE NOVALUE,
ME$DMC: DYN$LINKAGE NOVALUE,
ME$MEM: DYN$123_LINKAGE NOVALUE, ! [55]
RL$2BG: DYN$LINKAGE, ! [55]
RL$FAO: DYN$LINKAGE NOVALUE,
RL$LBG: DYN$LINKAGE, ! [55]
SG$DLG: DYN$LINKAGE NOVALUE,
SG$DMG: DYN$LINKAGE NOVALUE,
SG$LES: DYN$CLEAN_LINKAGE NOVALUE,
SG$LRM: DYN$LINKAGE NOVALUE,
SG$PEM: DYN$LINKAGE NOVALUE,
SG$SIG: DYN$CLEAN_LINKAGE NOVALUE
;
! Galactic variables user may need
MACRO
SG$ENS = %NAME ('SG.ENS') % ,
SG$LER = %NAME ('SG.LER') % ,
SG$OUT = %NAME ('SG.OUT') % ,
SG$LEV = %NAME ('SG.LEV') % ,
SG$PFX = %NAME ('SG.PFX') % ,
SG$SFX = %NAME ('SG.SFX') % ,
SG$DPX = %NAME ('SG.DPX') % ,
SG$DSX = %NAME ('SG.DSX') % ;
EXTERNAL
SG$ENS, SG$LER, SG$OUT, SG$LEV, SG$PFX, SG$SFX, SG$DPX, SG$DSX;
! DYNLIB-condition handler action code values
LITERAL
SIG$K_RESIGNAL = 0,
SIG$K_CONTINUE = 1,
SIG$K_UNWIND = 2;
! Hack to make stack temporarily global while calling routines
MACRO
GLOBAL_STACK [] =
BEGIN
BUILTIN MACHOP;
LITERAL
P=15,
XHLLI=%O'501',
MOVEM=%O'202',
MOVE=%O'200';
LOCAL OLD_P;
MACHOP (MOVEM, P, OLD_P); ! Save current stack pointer
IF .OLD_P LSS 0 THEN
MACHOP (XHLLI, P, 1000); ! Make global to this section
BEGIN
%REMAINING ! Do whatever the user wanted
END;
IF .OLD_P LSS 0 THEN
MACHOP (MOVE, P, OLD_P); ! Restore old stack pointer
END
% ;
! Condition code definitions
MACRO
$SIG$COND_CODE (facility_code, msg_code, severity_code) =
BEGIN
LOCAL CC: SIG$CC INITIAL (0);
CC [SIG$CC_FACILITY] = facility_code;
CC [SIG$CC_MESSAGE_ID] = msg_code;
CC [SIG$CC_SEVERITY] = severity_code;
.CC
END
%,
COND_CODE (facility_code, msg_code, severity_code) =
(%EXPAND FLD(facility_code,SG$FAC)
OR %EXPAND FLD(msg_code,SG$MSG)
OR %EXPAND FLD(severity_code,SG$SEV))
%,
MSGDEF (facility, msg_code, severity) =
%IF NOT %DECLARED (DYN$K_MAX_FACILITY) %THEN
COMPILETIME DYN$K_MAX_FACILITY = 0;
%FI
%IF NOT %DECLARED (%NAME (facility, '$K_FACILITY_CODE')) %THEN
COMPILETIME %NAME (facility, '$K_FACILITY_CODE') =
DYN$K_MAX_FACILITY + 1,
%NAME (facility, '$K_MAX_ERROR') = 0;
%ASSIGN (DYN$K_MAX_FACILITY, DYN$K_MAX_FACILITY + 1)
%FI
%ASSIGN (%NAME (facility, '$K_MAX_ERROR'),
%NAME (facility, '$K_MAX_ERROR') + 1)
LITERAL %NAME (facility, '$', msg_code) = COND_CODE (
%NAME (facility, '$K_FACILITY_CODE'),
%NAME (facility, '$K_MAX_ERROR'),
severity);
%;
MSGDEF (DY, FLL, SIG$K_ERROR) !"Failed to load library of class !AZ!/ from file !AZ"
MSGDEF (DY, UPC, SIG$K_INFO) !"Requested from user PC !OH"
MSGDEF (DY, DYV, SIG$K_ERROR) !"Caller built for outdated DYNLIB version !VER"
MSGDEF (DY, SEC, SIG$K_ERROR) !"No section available to load library into"
MSGDEF (DY, CLS, SIG$K_ERROR) !"Library service class spcecified not provided in library file specified"
MSGDEF (DY, LBV, SIG$K_ERROR) !"Library found build for outdated DYNLIB version !VER"
MSGDEF (DY, VER, SIG$K_ERROR) !"Version of library found (!VER) not good enough for caller (!VER)"
MSGDEF (DY, EPC, SIG$K_INFO) !"JSYS error occurred at PC !OH"
MSGDEF (DY, CTV, SIG$K_ERROR) !"Error processing customer transfer vector"
MSGDEF (DY, DTV, SIG$K_ERROR) !"Error processing DIGITAL transfer vector"
MSGDEF (DY, DGV, SIG$K_ERROR) !"Error processing DIGITAL galactic vector"
MSGDEF (DY, CGV, SIG$K_ERROR) !"Error processing customer galactic vector"
MSGDEF (DY, BOF, SIG$K_ERROR) !"Invalid offset into LTVEC called"
MSGDEF (DY, JER, SIG$K_ERROR) !"JSYS error:!/ !JER"
MSGDEF (DY, MIE, SIG$K_ERROR) !"Master INIT of library failed, returning error code !SW"
MSGDEF (DY, MIA, SIG$K_ERROR) !"DYNMIN failed to initialize !AA"
MSGDEF (DY, NYI, SIG$K_SEVERE) !"Feature called from !OH not yet implemented"
MSGDEF (ME, IMC, SIG$K_ERROR) !"Insufficient memory in chunk !SW to allocate !SW word!%s"
MSGDEF (ME, NAL, SIG$K_SEVERE) !"Attempt to free unallocated block at !OH"
MSGDEF (ME, NCA, SIG$K_SEVERE) !"No chunk available to manage addresses !OH to !OH"
MSGDEF (SG, UNW, SIG$K_INFO) !"Unwind -- computer use only"
MSGDEF (SG, FRM, SIG$K_INFO) !"Signal originated at PC !OH"
MSGDEF (SG, ROS, SIG$K_ERROR) !"Attempt to remove handler other than most recently established: !OH"
MSGDEF (SG, TRP, SIG$K_SEVERE) !"Trap occurred within trap handler at PC !OH"
MSGDEF (SG, IOV, SIG$K_WARNING) !"Integer overflow at PC !OH"
MSGDEF (SG, IDC, SIG$K_WARNING) !"Integer divide check at PC !OH"
MSGDEF (SG, FOV, SIG$K_WARNING) !"Floating point overflow at PC !OH"
MSGDEF (SG, FDC, SIG$K_WARNING) !"Floating point divide check at PC !OH"
MSGDEF (SG, FUN, SIG$K_WARNING) !"Floating point underflow at PC !OH"
MSGDEF (MT, ERR, SIG$K_WARNING) !"Math library error -- NUM1 = !SW, NUM2 = !SW"
MSGDEF (MT, OEM, SIG$K_INFO) !"Original error message: "
MSGDEF (RL, IBF, SIG$K_ERROR) !"Illegal byte pointer format: !BP"
MSGDEF (RL, IBS, SIG$K_ERROR) !"Illegal byte size in !BP"
MSGDEF (RL, IBP, SIG$K_ERROR) !"Illegal byte position in !BP"
UNDECLARE
%QUOTE COND_CODE,
%QUOTE FLD,
%QUOTE MSGDEF,
$CHLFD, $CHCRT, $CHFFD;