;;; XX:GTDOM.USR.6, 22-May-87 14:46:29, Edit by SRA ;;; -*- MACRO -*- Stuff to make GTDOM.MAC run in user context. ;;; For the benefit of this code, all usage of the AC saving routines ;;; should be coded as SAVEAC macros. This will be optimized correctly ;;; with the definitions in PROLOG, and will at least assemble correctly ;;; with the MACSYM definitions. ;;; Fake out UMOVE and friends. Define more iff needed. DEFINE XCTU DEFINE XCTBU ;; Dummy for EA.ENT DEFINE $EAENT <.+1> ;; Dummy for this too MSEC1==:0 ;; Make sure we don't try to use external IP routines DHPRSW==-1 ;; Enter "monitor context". Save all ACs except T1->T4. DEFINE MCENT < SAVEAC > ;; Returns from "monitor context" DEFINE SMRETN DEFINE RETERR(FOO) ;; Make us work like rel 5 no matter what version of PROLOG we use DEFINE XSWAPCD ;; use regular SWAPCD DEFINE XNENT(NAME,G) < ;; and do SWAPCD entry points. SWAPCD NAME: IFNB , >;DEFINE XNENT ;; Nop out these bits for testing porposes IP%INT==0 IP%CFB==0 ;; Offset into fake special PID table .SPRSV==0 ;; Fake out scheduler stuff DEFINE EDMSH <.+1> DEFINE EDMS0 <.+1> DEFINE NOINT <> DEFINE OKINT <> INTQSP==0 NIQ==40 ;; The following is from MACSYM. It is here to make ;; it override the optimized version in PROLOG.MAC. ; SUBTTL SAVEAC - Save AC List ;SAVEAC is a macro to generate a JSP .SAC,xxx call to an AC saving ;co-routine and to generate the routine also, if necessary. SAVEAC ;generates the routines as literals so that MACRO will compress as ;many as possible. SAVEAC sorts the arguments so that routines which ;save the same ACs will always look the same to MACRO. ;When the there are four or more ACs to be saved, SAVEAC assumes that ;at least two of them will be adjacent and changes from multiple ;PUSHes and POPs to and ADJSP and MOVEMs or, if possible, DMOVEMs for ;efficiency. ;If .SAC is among the ACs being saved, it is saved before the JSP ;.SAC,xxx and then restored in the co-routine literal. ;ACs may be refered to by any currently valid name and in any order. ;A given set of ACs will always be recognized if its literal code has ;been generated before or if it is a special set handled by a system ;routine. ;If an AC is mentioned more than once, it will only be saved/restored ;once. ;Provision is made for detecting standard AC sets which are handled by ;user or system routines. The routines, if defined, must be entered ;with JSP .SAC,xxx. For example, SAVEAC will call the system ;routine .SAV2 instead of generating local code to do the same thing. ;See SPCMAC below. By redefining the macro USRSAV, the user can ;control the tests made for standard routines. DEFINE USRSAV,<> ;DEFAULT TO NO SPECIAL-CASE ROUTINES DEFINE SAVEAC(ACS),< ..DONE==0 ..SACC==0 ..NAC==0 ..MASK==0 IRP ,< IFG ACS-^D15, IFE ACS-.SAC,<..SACC==1> ..SYAC==ACS IFN ACS-.SAC,,< ..MASK==..MASK!1B<..SYAC> ..NAC==..NAC+1>> > IFE ..SACC, ;;..DONE SET BY SPCSAV IF IT SUCCEEDS IFE ..DONE,< IFLE ..SACC, IFG ..SACC, IFG ..NAC-3, IFLE ..NAC-3,> PUSHJ P,(.SAC) TRNA AOS -..NAC-..SACC(P) IFG ..NAC-3, IFLE ..NAC-3,> IFG ..SACC, POPJ P,] > PURGE ..NAC,..TNAC,..MASK,..TMSK,..SACC,..NUM,..SMSK,..DONE,..SYAC >;END OF DEFINE SAVEAC ;Helper macros for SAVEAC DEFINE SPCSAV(ADDR,ACS),< IFE ..DONE,< ..SMSK==0 IRP ,< ..SYAC==ACS ..SMSK==..SMSK!1B<..SYAC>> IFE ..MASK-..SMSK, > >;END OF SPCSAV DEFINE DSAVAC,< IFG ..NAC, ..TMSK==..MASK ..TNAC==..NAC-1 REPEAT ..NAC,< IFN ..TMSK,< ..NUM==^L<..TMSK> ..TMSK==..TMSK-1B<..NUM> IFE ..TMSK & 1B<..NUM+1>,< MOVEM ..NUM,-..TNAC(P) ..TNAC==..TNAC-1> IFN ..TMSK & 1B<..NUM+1>,< DMOVEM ..NUM,-..TNAC(P) ..TNAC==..TNAC-2 ..TMSK==..TMSK-1B<..NUM+1>> >> >;END OF DEFINE DSAVAC DEFINE DRSTAC,< ..TMSK==..MASK ..TNAC==..NAC-1 REPEAT ..NAC,< IFN ..TMSK,< ..NUM==^L<..TMSK> ..TMSK==..TMSK-1B<..NUM> IFE ..TMSK & 1B<..NUM+1>,< MOVE ..NUM,-..TNAC(P) ..TNAC==..TNAC-1> IFN ..TMSK & 1B<..NUM+1>,< DMOVE ..NUM,-..TNAC(P) ..TNAC==..TNAC-2 ..TMSK==..TMSK-1B<..NUM+1>> >> IFG ..NAC, >;END OF DEFINE DRSTAC DEFINE PSAVAC,< ..TMSK==..MASK REPEAT ..NAC,< ..NUM==^L<..TMSK> ..TMSK==..TMSK-1B<..NUM> PUSH P,..NUM > > DEFINE PRSTAC,< ..NUM==^D15 REPEAT ^D16,< IFN ..MASK & 1B<..NUM>,< POP P,..NUM> ..NUM==..NUM-1 > >