X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;ds=sidebyside;f=mim%2Fdevelopment%2Fmim%2Fvax%2Fint.mud;fp=mim%2Fdevelopment%2Fmim%2Fvax%2Fint.mud;h=cd9d890ce827e1f9fc990c2b17ad6ad095b677c9;hb=d73ace3f3292e320b461b8fcd2e9f5dc5d9684d7;hp=0000000000000000000000000000000000000000;hpb=d530283ea60fb0ddcc28e9c5bd072456afe06e07;p=pdp10-muddle.git diff --git a/mim/development/mim/vax/int.mud b/mim/development/mim/vax/int.mud new file mode 100644 index 0000000..cd9d890 --- /dev/null +++ b/mim/development/mim/vax/int.mud @@ -0,0 +1,424 @@ + + + + + + + STRING + + + + FIX + >> + + CLASS + + FIX + ANY + >> + +) (CREATE? <>) (CHAN <>) + (NO-DEFER? <>) "AUX" CATM C) + #DECL ((CNAM) STRING (CATM CREATE?) (C) ANY + (PRI CHAN) ) + >> + + > CLASS>> + > + )> + )> + .C) + (.CREATE? + )> + > + >> + .CHAN .PRI .NO-DEFER?] CLASS>>)>> + + (C) ) + > + )>> + +>> + +) + > + )>> + + (C) CLASS (H) + (HP) FIX) + + > + > + > + + )> + .HAND) + ( + >> + + + .HAND) + (T + + >> + + + ) + (T + + >)>>)>) + (T + > + >>> + > + + + + .HAND>)> + .HAND) + ( + )>)>> + + + (C) CLASS (H) ) + + > + > + + >> + T) + (T + (LH) HANDLER) + >) + (<==? .H .HAND> + > + ) + (T + + >)>>)>) + (T + + >)> + + + >>> + >> + ) + > + <1 .V <>> + )>> + >> + .CC)>)>> + +) + + >) + (T + >)) + #DECL ((H) ) + >) + (<==? .H .HAND> ) + (T >)>>)>> + +%% + + + + + + > + +) "AUX" C) + #DECL ((CNAM) (APP) APPLICABLE + (LEV) FIX (ARG) ANY) + + > + > <> T .C>>) + (<=? .CNAM "INFERIOR"> + T ,M$$INFINT>>) + (T + + T ,M$$CONTINT>>) + (<=? .CNAM "PIPE"> + T ,M$$PIPEINT>>) + (<=? .CNAM "SOCKET"> + ; "SIGURG" + T ,M$$URGINT>>) + (<=? .CNAM "IOINT"> + T ,M$$IOINT>>) + (<=? .CNAM "STKINT"> + <> ,M$$STKINT>>)>)>)> + T> .APP .LEV .ARG <>] HANDLER>> + +) TC) + #DECL ((CNUM) (TUP) TUPLE (C) CLASS + (LEV OLEV) FIX + (LV) ANY) + + > + ) + (T .II>)>) + ( + > + ) + (T )> + + )> + + .OLEV> + ) + ( + ; "Not very useful to queue eval interrupts" + ) TL) + #DECL ((Q) LIST (P) FIX + (TL) >) + ; "Maintain a separate queue for each + interrupt level." + > + <2 .TL + ((.C !.TUP))>>>) + (T + ) + (NL (T (.C !.TUP)))) + #DECL ((OL) + (NL) LIST) + .P>> + .NL !.OL)> + ) + (<==? <1 .OL> .P> + <2 .OL + + ((.C !.TUP))>>> + )> + > + >>)>>)>) + (T + + + .GC-RUNNING!- > + ; "Don't run eval interrupts in GC" + .II>)> + >)> + > + + ) + ()> + .LV> + + )>>>)>)>> + +) + > + !.TUP>)>> + +) + > + )>> + +; "How interrupts are handled: +I$INTERRUPT compares the priority of the class it's called with to +M$$INT-LEVEL. If the interrupt cannot be run immediately, either it is +queued (from interrupt), or REAL-ERROR is called (from emergency). +If the interrupt can be run, RUN-INTERRUPT is called. It raises +the interrupt level to the class's priority, and wanders down its +chain of handlers, applying each in turn. Finally, +is called, lowering the interrupt level. +When INT-LEVEL is called to lower the interrupt level, it wanders +down M$$INT-QUEUE processing (via RUN-INTERRUPT) those queued interrupts +that can now be handled. Since RUN-INTERRUPT calls INT-LEVEL, this will +mostly happen recursively." + +)) + #DECL ((C) CLASS (OLEV) FIX (INTENDED-LEVEL) ) + > + .OLEV> + + >)> + ) + + + !.ARGS>> + >>> + )> + T)(T .LV)>>)>>)>> + + > + + (IL) + (C) CLASS (NLEV) FIX (MAIN-QUEUE) LIST) + + > + )> + > + ; "No interrupts with enough priority" + )> + > + > + + ; "No more queued interrupts at this level" + > + ; "Try it again" + )> + >>> + .LEV-RUN-QUEUE> + ; "Running last thing on this queue, so + make sure pointer doesn't get dropped" + <2 .RUN-QUEUE <3 .RUN-QUEUE>>)> + ; "Splice this interrupt out" + > + >> + ) + ( + )> + .OLEV> + + + ) + ( + )> + > + > + ) + ()>)> + > + + + + > + + + + > + + + + FIX>> + ; "Will return 1 if stack is already big" + ) + (> + ; "Say let stack become big" + )>)> + T> + + + + + + + + <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> + <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <>]> + >> + + > >> + + )> + > >> + + )> + > 6 T> + > 5 T> + + >)> + ,QUITTER>> + ,STOPPER>> + T> + + + > .OUTCHAN> + >> + )> + + > + )> + .OUTCHAN> + + .OUTCHAN> + + .OUTCHAN> + > + + + .OUTCHAN> + + > + )> + > + )> + + ) + ( " .OUTCHAN>)> + .OUTCHAN> + + .OUTCHAN> + > + + + + )> + +