.TITLE MISC_USER_SERVICES - Misc. user system services .IDENT /V02.00/ ;++USRSERVES.MAR ; ; Facility: ; Fermilab Accelerator Control System - ACNET. ; FERMIUSS user-written system services privileged image. ; ; Abstract: ; This module contains several user-written system service routines. ; Some of these routines are from DEC (the original USSDISP.MAR). ; ; Overview: ; User written system services are contained in privileged shareable ; images that are linked into user program images in exactly the ; same fashion as any shareable image. This module contains several ; small service routines. It must be linked with the kernal and ; executive mode dispatchers (in FERMIDISP.MAR). ; ;-- ; ; Modification History: ; ; This file was originated from the DEC-supplied file USSDISP.MAR found in ; [SYSHLP.EXAMPLES]. Modifications are listed below: ; ; V01.00 06-Nov-81 FJN Created from USSDISP.MAR, GET_TODR and SET_PFC ; services dropped. ; V01.01 08-Jan-82 FJN Headers editted and pseudo-code added ; V02.00 13-May-83 FJN Prepared for FERMIUSS image, GETODR restored. ; Help text added. ; .PAGE .SBTTL Declarations and Equates ; ; Include Files ; .LIBRARY "SYS$LIBRARY:LIB.MLB" ; Macro library for system structure ; definitions ; ; Macro Definitions ; ; ; Equated Symbols ; .NOCROSS $PHDDEF ; Define process header offsets $PLVDEF ; Define PLV offsets and values $PRDEF ; Define processor register numbers $SSDEF ; Define completion condition codes .CROSS ; ; Program section for user service routines ; .PSECT USER_SERVICES,BYTE,NOWRT,EXE,RD,PIC,CON,LCL,SHR .PAGE .SBTTL Get Interval Count Register Value ;+0USER_GETICR ; ; Functional Description: ; This routine reads the contents of the hardware interval timer count ; processor register and stores the resulting value at the ; specified address. ; ; Calling Sequence: ; status = USER_GETICR(icr-return) ; ; Input Parameters: ; 04(AP) - Address to return interval count value ; R4 - Address of current PCB ; ; Output Parameters: ; @04(AP) - Returned interval count value ; R0 - Completion Status Code ; ; Condition Codes: ; SS$_NORMAL if successful. ; SS$_ACCVIO if argument list or return location inaccessible. ;- ;+ USER_GETICR ; Reads the contents of the processor's interval timer count register. ; ; status.wlc.v = USER_GETICR( icrret.wl.r ) ; ; status completion status code ; SS$_NORMAL success ; SS$_ACCVIO argument list or return location inaccessible ; ; icrret longword in which the interval count value is returned. ;- .ENTRY USER_GETICR,^M MOVL 4(AP),R1 ; Get address to store interval count IFNOWRT #4,(R1),ACCVIO ; Branch if not writable MFPR #PR$_ICR,(R1) ; Return current interval count MOVZWL #SS$_NORMAL,R0 ; Set normal completion status RET ; and return ACCVIO: MOVZWL #SS$_ACCVIO,R0 ; Indicate access violation RET ; .PAGE .SBTTL Get Time-of-Day Register Value ;+0USER_GETODR ; ; Functional Description: ; This routine reads the contents of the hardware time of day ; processor register and stores the resulting value at the ; specified address. ; ; Calling Sequence: ; status = USER_GETODR(todr-return) ; ; Input Parameters: ; 04(AP) - Address to return time of day register value ; R4 - Address of current PCB ; ; Output Parameters: ; @04(AP) - Returned time of day register value ; R0 - Completion Status Code ; ; Condition Codes: ; SS$_NORMAL if successful. ; SS$_ACCVIO if argument list or return location inaccessible. ;- ;+ USER_GETODR ; Reads the contents of the processor's time of day register. ; ; status.wlc.v = USER_GETODR( todrret.wl.r ) ; ; status completion status code ; SS$_NORMAL success ; SS$_ACCVIO argument list or return location inaccessible ; ; todrret longword in which the time of day value is returned. ;- .ENTRY USER_GETODR,^M MOVL 4(AP),R1 ; Get address to store interval count IFNOWRT #4,(R1),ACCVIO ; Branch if not writable MFPR #PR$_TODR,(R1) ; Return current interval count MOVZWL #SS$_NORMAL,R0 ; Set normal completion status RET ; and return .PAGE .SBTTL Null Service ;+0USER_NULL ; ; Functional Description: ; This routine does absolutely nothing. It only serves to provide ; a fake executive-mode service routine until a real one is written. ; ; Calling Sequence: ; status = USER_NULL() ; ; Input Parameters: ; NONE ; ; Output Parameters: ; R0 - Completion Status code ; ; Condition Codes: ; SS$_NORMAL only. ; ;- .ENTRY USER_NULL,^M<> ; Entry definition MOVZWL #SS$_NORMAL,R0 ; Set normal completion status RET ; and return .END