;COMPARISON OF SSY:<5-4-MONITOR>IPCF.MAC.2 AND SSY:<5-4-MONITOR>IPCF.MAC.4 ;OPTIONS ARE /B /E /L /3 **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 1-1 (0) ;Edit 3134 to IPCF.MAC by SHTIL on Thu 28-Jun-84 **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 1-1 (0) ;[MIT-SPEECH]SSY:<5-4-MONITOR>IPCF.MAC.3, 3-Aug-87 21:05:58, Edit by SRA ;M60 Changes to support IPCF messages to domain resolver: ; Fix bad test so paged mode works in extended addressing. ; Add PDWTCK (PiD WaiT ChecK, check and setup for dismiss on PDFKTB). ; Add PDWTCL (PiD WaiT CLeanup, clean up for PDWTCK). ; Make changes to allow paged IPCF from monitor context, from VAF@CMU. ; Various other small changes/fixes from CMU: ; Fix incorrect comment, MUTSPS is funtion 31, not 27. ; Have setting [SYSTEM]INFO's pid with .MUSPT work right. ; Test PD%JWP, not (IP%JWP), at CREPD1:+2. ; Don't complain in VALAR1 if .IPCFL word contains garbage, ; flags returned by a previous MSEND%, in the right half. ;-------------------------MIT EDITS ABOVE------------------------- ;Edit 3134 to IPCF.MAC by SHTIL on Thu 28-Jun-84 *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 5-17 (16222) AFTER .MRECV: HRLI T1,.FHSLF ;YES, SEE IF PAGE EXISTS IN DEST PAGE **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 5-17 (17011) AFTER .MRECV: IFE MITSW,< ;M60 HRLI T1,.FHSLF ;YES, SEE IF PAGE EXISTS IN DEST PAGE *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 5-24 (16540) AFTER .MRECV: MOVE P5,T1 ;SAVE IDENTIFIER **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 5-25 (17349) AFTER .MRECV: >;IFE MITSW ;M60 IFN MITSW,< ;M60 MOVEI T1,(P4) ;M60 Get user page number LSH T1,^D9 ;M60 Make it a virtual address TXNN P1,IP%INT ;M60 Internal call? TXO T1,TWUSR ;M60 No - specify user context CALL FPTA ;M60 Get ID for this page JUMPE T1,[RETERR (ARGX23)] ;M60 Section table non existant >;IFN MITSW ;M60 MOVE P5,T1 ;SAVE IDENTIFIER *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 17-6 (35818) AFTER MESTO1: ; P4/ PAGE NUMBER TO SEND FROM **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 17-6 (36961) AFTER MESTO1: ;M60 P1/ IPCF call flags ; P4/ PAGE NUMBER TO SEND FROM *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 17-13 (36037) AFTER SNDPAG: HRLI T1,.FHSLF ;T1/ (THIS FORK,,PAGE NUMBER) **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 17-14 (37206) AFTER SNDPAG: IFE MITSW,< ;M60 HRLI T1,.FHSLF ;T1/ (THIS FORK,,PAGE NUMBER) *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 17-18 (36202) AFTER SNDPAG: MOVEM T1,SNDPGP ;SAVE PTN.PN **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 17-20 (37391) AFTER SNDPAG: >;IFE MITSW ;M60 IFN MITSW,< ;M60 Handle internal pages too MOVEI T1,(P4) ;M60 Get page number in this process LSH T1,^D9 ;M60 Make it a virtual address TXNN P1,IP%INT ;M60 Internal call? TXO T1,TWUSR ;M60 No - flag user page CALL FPTA ;M60 Get PTN,,PN of page to send JUMPE T1,[RETBAD (ARGX23)] ;M60 Section table non-existant >;IFN MITSW ;M60 MOVEM T1,SNDPGP ;SAVE PTN.PN *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 30-4 (52226) AFTER MUTPI1: MUTDFI: SKIPE INFOPD ;ALREADY HAVE A PID FOR INFO? **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 30-4 (53787) AFTER MUTPI1: IFE MITSW,< ;M60 MUTDFI: SKIPE INFOPD ;ALREADY HAVE A PID FOR INFO? *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 30-7 (52352) AFTER MUTDFI: CALL VALPID ;VALIDATE IT **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 30-8 (53933) AFTER MUTDFI: >;IFE MITSW ;M60 IFN MITSW,< ;M60 MUTDFI: UMOVE T1,1(Q2) ;M60 GET NEW PID MUTDF1: SKIPE INFOPD ;M60 ALREADY HAVE A PID FOR INFO? RETBAD (IPCF23) ;M60 YES, THIS IS AN ERROR >;IFN MITSW ;M60 CALL VALPID ;VALIDATE IT *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 30-14 (52546) AFTER MUTDFI: ;MUTIL FUNCTION 24 AD 25 - SET AND READ SYSTEM PID TABLE **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 30-21 (54332) AFTER MUTDF1: ;MUTIL FUNCTIONS 24 AND 25 - SET AND READ SYSTEM PID TABLE *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 30-22 (52849) AFTER MUTSPT: MOVEM T1,SPIDTB(T2) ;YES, STORE NEW PID **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 30-29 (54637) AFTER MUTSPT: IFN MITSW,< ;M60 CAIN T2,.SPINF ;M60 SETTING [SYSTEM]INFO ? JRST MUTDF1 ;M60 YES, DO IT RIGHT FOR THEM >;IFN MITSW ;M60 MOVEM T1,SPIDTB(T2) ;YES, STORE NEW PID *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 30-45 (53629) AFTER MUTMPS: **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 30-56 (55549) AFTER MUTMPS: ;M60 Actually, this is function 31, not function 27 *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 32-20 (55145) AFTER VALARG: TXZ P1,IP%INT+IP%CFZ ;[2643]Clear impossible bits UMOVE P2,.IPCFS(Q2) ;GET SENDER'S PID **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 32-20 (57118) AFTER VALARG: IFE MITSW,< ;M60 TXZ P1,IP%INT+IP%CFZ ;[2643]Clear impossible bits >;IFE MITSW ;M60 IFN MITSW,< ;M60 TXZ P1,IP%CFZ ;M60 [2643]Clear impossible bits IFXN. P1,IP%INT ;M60 Internal call specified? CALL CKMMOD ;M60 Monitor context? TXZ P1,IP%INT ;M60 Nope. Clear this one, too ENDIF. ;M60 >;IFN MITSW ;M60 UMOVE P2,.IPCFS(Q2) ;GET SENDER'S PID *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 32-32 (55623) AFTER VALARG: TRNE P4,777000 ;IS THE PAGE NUMBER LEGAL? RETBAD (IPCF31) ;NO TLNE P1,(IP%TTL) ;TRUNCATE IF TOO LONG? **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 32-41 (57880) AFTER VALARG: IFE MITSW,< ;M60 Handle extended PN correctly TRNE P4,777000 ;IS THE PAGE NUMBER LEGAL? RETBAD (IPCF31) ;NO >;IFE MITSW ;M60 Supposedly this is fixed IFN MITSW,< ;M60 in Rel-6, oh well IFXN. P1,IP%EPN ;M60 Extended page number? TRNE P4,740000 ;M60 Yes, check proper bits RETBAD (IPCF31) ;M60 Bad page number ELSE. ;M60 Not extended, use old test TRNE P4,777000 ;M60 RETBAD (IPCF31) ;M60 ENDIF. ;M60 >;IFN MITSW ;M60 TLNE P1,(IP%TTL) ;TRUNCATE IF TOO LONG? *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 32-41 (56022) AFTER VALAR1: TXNN P1,IP%CFP+IP%CFC+IP%CFM ;[2641][2643] NO, PRIVELEGED FUNCTION? **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 32-61 (58674) AFTER VALAR1: IFE MITSW,< ;M60 TXNN P1,IP%CFP+IP%CFC+IP%CFM ;[2641][2643] NO, PRIVELEGED FUNCTION? *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 32-44 (56176) AFTER VALAR1: **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 32-65 (58848) AFTER VALAR1: >;IFE MITSW ;M60 IFN MITSW,< ;M60 ;M60 Don't use DEC's fix here, just zero the information that ; the user didn't bother to clean up. It is still a problem that ; the user could receive a message with IP%CFP on, send a message ; later with it still on, and get an error, but that is what is ; documented to happen. It doesn't say that the other fields ; return an error, just that you need privileges to set them. ; Perhaps it should say that IP%CFP will be ignored if set by ; non-privileged users, but that is for someone else to decide, ; this code just does what is documented in the nicest way ; possible. IFNSK. ;M60 If the caller wasn't privileged TXNE P1,IP%CFP ;M60 But privileged function was requested RET ;M60 Then give an error return TXZ P1,IP%CFE!IP%CFC!IP%CFM ;M60 Else turn extra fields off ENDIF. ;M60 And continue with a good return RETSKP ;M60 Return ok >;IFN MITSW ;M60 *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 36-2 (58712) AFTER ENDWT1: ;ROUTINE TO GET BOTH THE FORK LOCK AND THE PID LOCK **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 36-2 (62349) AFTER ENDWT1: IFN MITSW,< ;M60 Begin addition. ; Accessor routine to allow external routines to dismiss with PDFKTB ; bit as (one of) their wakeup conditions. We can dismiss only if ; this PID is valid for this fork and this PID does not have any ; messages already pending. To avoid races, we have to hold the PID ; lock when we clear the PDFKTB bit. ; ;Accepts in AC1: PID ; CALL PDWTCK ;Returns +1: AC1 contains error code, or zero to indicate that ; PID already has message pending, don't dismiss. ; +2: No message pending, PDFKTB bit cleared, ok to dismiss, ; AC1 trashed. ; ;NB: If you change this routine, be sure locks are released on all exits. PDWTCK::SAVEAC ; Preserve all ACs except T1 CALL GTLCKS ; Snarf all locks we need CALL VALPDJ ; Check PID, can this job use it? IFSKP. ; Yes CALL CHKNOA ; Make sure this particular fork can use it ANSKP. ; It can CALL CHKPDW ; See if we are allowed to hang on this PID ANSKP. ; Yup SETZ T1, ; Set up flag for non-empty queue LOAD T3,PIDRC,(T2) ; Get receive count ANDE. T3 ; Any messages pending? MOVE T1,FORKX ; No, we can dismiss STOR T1,PIDFW,(T2) ; Say that we're going to be waiting CALL GETMSK ; Clear our bit in PDFKTB ANDCAM T2,PDFKTB(T1) AOS (P) ; Arrange for skip return ENDIF. ; All exits must unlock! UNLOKK PIDLKK ; Free locks in correct order OKINT CALL FUNLK RET ; Return, skipping if appropriate ; Companion routine to clean up. Does the cleanup operations MWAIT ; would do for us if we were using the normal IPCF scheduler test. ; ; I think there's a timing screw here, in that if we never execute ; this code we leave PIDFW set, which prevents an inferior fork from ; being able to hang on this PID. DEC's code has the same problem ; (see MWAIT). If anybody ever fixes this problem in MWAIT, the fix ; should be copied to this routine too. ; ; No arguments ; CALL PDWTCL ; Returns +1, always, preserving all ACs. PDWTCL::SAVEAC CALL GTLCKS ; Snarf locks CALL ENDWAT ; Clear PIDFW UNLOKK PIDLKK ; Free locks in correct order OKINT CALL FUNLK RET ; Done >;IFN MITSW ;M60 End addition. ;ROUTINE TO GET BOTH THE FORK LOCK AND THE PID LOCK *************** **** FILE SSY:<5-4-MONITOR>IPCF.MAC.2, 43-28 (67755) AFTER CREPD1: TLNE T4,(IP%JWP) ;JOB WIDE PID WANTED? MOVEM T3,CREFKO ;YES, STORE FORK NUMBER OF TOP FORK **** FILE SSY:<5-4-MONITOR>IPCF.MAC.4, 44-28 (73619) AFTER CREPD1: IFE MITSW,< ;M60 TLNE T4,(IP%JWP) ;JOB WIDE PID WANTED? >;IFE MITSW ;M60 IFN MITSW,< ;M60 Test the right flag TRNE T4,PD%JWP ;M60 JOB WIDE PID WANTED? >;IFN MITSW ;M60 MOVEM T3,CREFKO ;YES, STORE FORK NUMBER OF TOP FORK ***************