Type ASSEMBLE
Source Lines : 1,253
Fixes Applied : 5
Most Recent Version : Thursday, December 7, 1978
Last Fix ID : [R13421DK]
Module
DMKMCC
Function
TO HANDLE MONITOR CONTROL COMMANDS
Attributes
REENTRANT, PAGEABLE, CALLED VIA SVC
Operation
MONITOR COMMAND PROCESSING CALL DMKSCNFD TO LOCATE AN ARGUMENT. IF NONE IS FOUND THEN EXIT WITH AN APPROPRIATE ERROR MESSAGE. IF THE ARGUMENT IS DISPLAY THEN GO TO DISPLAY. IF THE ARGUMENT IS ENABLE THEN GO TO ENABLE. IF THE ARGUMENT IS INTERVAL THEN GO TO INTERVAL. IF THE ARGUMENT IS START THEN GO TO START. IF THE ARGUMENT IS TIME THEN GO TO TIME IF THE ARGUMENT IS CLOSE THEN GO TO CLOSE IF THE ARGUMENT IS STOP THEN GO TO STOP. IF THE ARGUMENT IS NONE OF THESE THEN EXIT WITH AN APPROPRIATE ERROR MESSAGE. DISPLAY: OBTRAIN A REPLY BUFFER FROM FREE STORAGE AND OUTPUT A REPLY HEADER VIA A CALL TO DMKQCNWT. SCAN THE MONITOR CLASS TABLE AND MOVE THE CLASS NUMBER AND KEYWORD INTO THE REPLY BUFFER. IN PARALLEL WITH THE SCAN OF THE CLASS TABLE, SCAN THE CURRENT CONTROL REGISTER 8 IN DMKPRGC8. IF THE BIT IN THE MASK IS ONE THEN MOVE 'ENABLED' INTO THE REPLY BUFFER. IF THE BIT IS ZERO THEN MOVE 'DISABLED' INTO THE REPLY BUFFER. OUTPUT THE MESSAGE VIA A CALL TO DMKQCNWT AND LOOP BACK UNTIL ALL ENTRIES HAVE BEEN EXAMINED. FINALLY, RELEASE THE REPLY BUFFER AND EXIT. ENABLE: SCAN THE REMAINING ARGUMENTS OF THE COMMAND LINE. SEARCH THE CLASS TABLE FOR EACH ARGUMENT. IF A MATCHING ENTRY IS NOT FOUND THEN EXIT WITH AN APPROPRIATE ERROR MESSAGE. WHEN A MATCHING ENTRY IS FOUND IN THE CLASS TABLE, SET THE CORRESPONDING MONITOR CALL CLASS BIT IN THE WORK REG BEING CONSTRUCTED FOR CR8. SAVE THE NEW CR8 VALUE IN DMKPRGC8 AND EXIT. INTERVAL: CALL THE COMMAND PROCESSOR EXTENSION, DMKMCD, TO PROCESS CALL DMKSCNFD TO GET THE INTERVAL VALUE. IF NONE WAS GIVEN THEN EXIT WITH AN APPROPRIATE ERROR MESSAGE. IF THE INTERVAL WAS GIVEN THEN CALL DMKCVTDB TO CONVERT IT TO BINARY. CALL DMKSCNFD TO LOCATE THE NEXT ARGUMENT. IF IT IS 'SEC' THEN GO TO STEP 13. IF IT IS 'MIN' THEN MULTIPLY THE INTERVAL BY 60 TO CONVERT IT TO SECONDS. IF THE SPECIFIED VALUE IS LESS THAN 30 SECONDS OR MORE THAN 9 HOURS, THEN EXIT WITH AN APPROPRIATE ERROR MESSAGE. OTHERWISE, STORE THE INTERVAL IN DMKPRGTI AND EXIT WITH AN ACKNOWLEDGMENT MESSAGE. START: CALL DMKSCNFD TO LOCATE THE NEXT ARGUMENT. IF IT IS 'CPTRACE' THEN GO TO START CPTRACE. IF IT IS 'TAPE' THEN GO TO START TAPE. IF IT IS NEITHER OF THESE THEN EXIT WITH AN APPROPRIATE ERROR MESSAGE. AS OF RELEASE 5, SPOOL IS ALSO A VALID ARGUMENT START CPTRACE: IF THE INTERNAL TRACE TABLE IS ACTIVE THEN EXIT WITH AN APPROPRIATE ERROR MESSAGE. OTHERWISE, START ALL FLAVORS OF INTERNAL TRACING AND EXIT. START TAPE OR SPOOL: IF THE MONITOR IS ALREADY ACTIVE THEN EXIT WITH AN APPROPRIATE ERROR MESSAGE. IF NO CLASSES ARE ENABLED THEN EXIT WITH AN APPROPRIATE ERROR MESSAGE. CALL DMKSCNFD TO LOCATE THE TAPE DRIVE ADDRESS FIELD. IF NO ARGUMENT WAS FOUND THEN EXIT WITH AN APPROPRIATE ERROR MESSAGE. CHECK THE VALIDITY OF THE ADDRESS, CONVERT IT TO BINARY, LOCATE REAL DEVICE BLOCK, AND CHECK THE AVAILABILITY AND SUITABILITY OF THE DEVICE. IF ANY OF THESE CHECKS FAIL, THEN EXIT WITH AN APPROPRIATE ERROR MESSAGE. CALL DMKSCNFD TO SEARCH FOR A MODE OR BUFFS SPECIFICATION. IF EITHER IS FOUND, CHECK VALIDITY. EXIT WITH APPROPRIATE ERROR MESSAGE IF INVALID INPUT HAS BEEN SPECIFIED. IF NO MODE IS SPECIFIED, SET THE DEFAULT TO THE RESET VALUE (X'C3' = 1600 BPI). IF NO BUFFS VALUE IS SPECIFIED, SET THE DEFAULT BUFFS VALUE ACCORDING TO THE CPU MODEL (2 FOR 135-145, 3 FOR 148-158, AND 4 FOR 168). IF ALL OF THE CHECKS ARE PASSED, THEN RESERVE THE DEVICE FOR SYSTEM USE. OBTAIN STORAGE FOR THE MONITOR COMMUNICATIONS AREA (MONCOM) AND SAVE ITS ADDRSS IN DMKPRGMC. CALL DMKPTR TO PAGE IN AND LOCK THE DMKMON MODULE. SAVE ITS ADDRESS IN DMKPRGMI. OBTAIN STORAGE FOR AN IOBLOK TO BE USED FOR THE TAPE I/O REQUESTS. FINISH INITIALIZING THE IOBLOK AND BUILD THE CHANNEL PROGRAMS TO BE USED BY THE MONITOR. OBTAIN STORAGE FOR A CPEXBLOK FOR DEFERED CALLS TO IOS BY DMKMON. OBTAIN TWO PAGES OF FLIP FLOP DATA COLLECTION BY CALLS TO DMKPTRFR. IF ANY TIMER DATA COLLECTION CLASSES ARE ENABLED THEN OBTAIN, INITIALIZE AND SCHEDULE A TRQBLOK. AT THE SAME TIME, INITIALIZE DMKPRGTI IF IT ISN'T ALREADY. CALL DMKMNITH TO ISSUE THE INITIAL CCW SEQUENCE. THE I/O INTERRUPT ASSOCIATED WITH THE INITIAL CCW'S WILL COMPLETE THE INITIATION OF THE MONITOR, INCLUDING THE COLLECTION OF THE HEADER RECORDS, WITHIN DMKMON. EXIT AFTER SENDING THE 'COMMAND COMPLETE' MESSAGE. STOP: CALL THE COMMAND PROCESSOR EXTENSION, DMKMCD, TO PROCESS CALL DMKSCNFD TO LOCATE THE NEXT ARGUMENT. IF IT IS 'CPTRACE' THEN GO TO STOP CPTRACE. IF IT IS 'TAPE' THEN GO TO STOP TAPE. IF IT IS NEITHER OF THESE THEN EXIT WITH AN APPROPRIATE ERROR MESSAGE. AS OF RELEASE 5, SPOOL IS ALSO A VALID ARGUMENT STOP CPTRACE: IF CP INTERNAL TRACING IS NOT ACTIVE THEN EXIT WITH AN APPROPRIATE ERROR MESSAGE. OTHERWISE, SET THE TRACE FLAGS TO ZEROES AND EXIT AFTER SENDING THE 'COMMAND COMPLETE' MESSAGE. STOP TAPE OR SPOOL: IF MONITORING IS CURRENTLY INACTIVE THEN EXIT WITH AN APPROPRIATE ERROR MESSAGE. IF THE MONITOR IS CURRENTLY IN ERROR RECOVERY OR PROCESSING A 'MONITOR STOP TAPE' COMMAND THEN EXIT WITH AN APPROPRIATE ERROR MESSAGE. CLEAR CONTROL REGISTER 8 TO INHIBIT FURTHER MONITOR CALL INTERRUPTS. INDICATE THAT A 'MONITOR STOP TAPE' COMMAND IS BEING PROCESSED. OBTAIN STORAGE FOR AND INITIALIZE A CPEXBLOK. 'STACK' THE CPEXBLOK ON THE COMMUNICATIONS AREA. IF THE MONITOR TAPE IS CURRENTLY BUSY THEN SKIP THE NEXT STEP. CALL DMKMNISH TO COMPLETE MONITOR SHUTDOWN PROCESSING. WHEN CONTROL RETURNS FROM DMKMNI, EXIT AFTER ISSUING THE 'COMMAND COMPLETE' MESSAGE. SET THE RETURN ADDRESS IN THE CPEXBLOK TO THE 'COMMAND COMPLETE' MESSAGE ROUTINE AND GO TO THE DISPATCHER. SINCE THE TAPE IS BUSY AND THE CFSTOP FLAG HAS BEEN SET, THE MONITOR WILL BE SHUT DOWN WHEN THE NEXT TAPE I/O INTERRUPT OCCURS. FOLLOWING THAT, THE CPEXBLOK WILL BE 'UNSTACKED' AND RETURN WILL BE MADE TO THIS ROUTINE TO TYPE OUT THE 'COMMAND COMPLETE' MESSAGE. TIME CALL THE COMMAND PROCESSOR EXTENSION, DMKMCD, TO PROCESS LIMIT CALL THE COMMAND PROCESSOR EXTENSION, DMKMCD, TO PROCESS CLOSE CALL DMKMIACC TO CLOSE THE CURRENT SPOOL FILE
Calls to Other Routines
DMKSCNFD - TO LOCATE NEXT FIELD IN INPUT LINE DMKQCNWT - TO SEND A MESSAGE TO THE TERMINAL DMKERMSG - TO SEND CANNED ERROR MESSAGE TO TERMINAL DMKPTRFR - TO OBTAIN A PAGE OF STORAGE FOR MONITOR DATA DMKMONSH - MONITOR STOP ROUTINE DMKCVTHB - TO CONVERT DEVICE ADDRESS TO BINARY DMKCVTDB - TO CONVERT INTERVAL TO BINARY DMKSCNRU - TO OBTAIN RDEVBLK ADDRESS FROM DEV. ADDRESS DMKFREE - TO OBTAIN STORAGE FOR MESSAGES DMKFRET - TO RELEASE STORAGE USED FOR MESSAGES DMKSCHST - TO ENQUEUE A TIMER RQST. BLOCK FOR MONITORING DMKSCHRT - TO REMOVE A TIMER RQST. BLOCK FROM QUEUE DMKMONTH - TAPE HEADER ROUTINE