(FILECREATED "18-Apr-85 15:29:46" {DSK}<LISPFILES>HTHOMPSON>DSL>BUSUTIL.;5 10585 changes to: (FNS BUSDMA.FASTUPDATEADDR BUSDMA.SLOWUPDATEADDR BUSDMA.UPDATEADDR) (VARS BUSUTILCOMS) (MACROS BUSDMA.FASTUPDATEADDR BUSDMA.UPDATEADDR) previous date: "14-Apr-85 16:53:52" {DSK}<LISPFILES>HTHOMPSON>DSL>BUSUTIL.;3) (* Copyright (c) 1985 by Henry Thompson. All rights reserved.) (PRETTYCOMPRINT BUSUTILCOMS) (RPAQQ BUSUTILCOMS [(FNS BUS.READWORD BUS.WRITEWORD BUSDMA.FASTUPDATEADDR BUSDMA.SLOWUPDATEADDR BUSDMA.UPDATEADDR FetchArray StoreArray TestArray) (PROP DOPVAL \BUSBLTCHECK \BUSBLTCHECKBYTES \BUSBLTCHECKSWAPBYTES) (MACROS BUSDMA.FASTUPDATEADDR BUSDMA.UPDATEADDR) (DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDVARS (NLAMA) (NLAML BUSDMA.UPDATEADDR) (LAMA]) (DEFINEQ (BUS.READWORD [LAMBDA (hiAddr loWordAddr mode) (* ht: " 9-Apr-85 10:37") ([LAMBDA (first second) (SELECTQ mode ((NIL STRAIGHT) (LLSH first 8) +second) (SWAP (LLSH second 8) +first) (SHOULDNT "bad mode"] (BUS.READHL hiAddr (LLSH loWordAddr 1)) (BUS.READHL hiAddr (LLSH loWordAddr 1)+ 1]) (BUS.WRITEWORD [LAMBDA (hiAddr loWordAddr word mode) (* ht: " 9-Apr-85 10:37") ([LAMBDA (lo hi) (SELECTQ mode ((NIL STRAIGHT) (BUS.WRITEHL hiAddr (LLSH loWordAddr 1) hi) (BUS.WRITEHL hiAddr (LLSH loWordAddr 1)+ 1 lo)) (SWAP (BUS.WRITEHL hiAddr (LLSH loWordAddr 1) lo) (BUS.WRITEHL hiAddr (LLSH loWordAddr 1)+ 1 hi)) (SHOULDNT "bad mode"] (LOGAND word 255) (LRSH word 8]) (BUSDMA.FASTUPDATEADDR [LAMBDA (dmaChannelName currentAddressName wrappedName) (* ht: "18-Apr-85 15:26") (* * faster unsafe version of BUSDMA.SLOWUPDATEADDR - meant to be used as macro) (LET ((dmaChannel (EVAL dmaChannelName))) (PROGN (BX.OUTPUT 12 7) (BX.OUTPUT 8 4) (BX.OUTPUT 0 5)) (SET currentAddressName (LOGOR (LRSH (PROGN (BX.OUTPUT (LLSH dmaChannel 1) 7) (BX.OUTPUT 4 4) (BX.OUTPUT 0 5) (BX.INPUT 5)) 1) (LLSH (PROGN (BX.OUTPUT (LLSH dmaChannel 1) 7) (BX.OUTPUT 4 4) (BX.OUTPUT 0 5) (BX.INPUT 5)) 7))) (* * Check the TC bit for this channel - open coded for speed) (if (EVAL wrappedName) then (if [NOT (ZEROP (LOGAND (PROGN (BX.OUTPUT 8 7) (BX.OUTPUT 4 4) (BX.OUTPUT 0 5) (BX.INPUT 5)) (LLSH 1 dmaChannel] then (HELP "double wrap 1") else T) else (if [SET wrappedName (NOT (ZEROP (LOGAND (PROGN (BX.OUTPUT 8 7) (BX.OUTPUT 4 4) (BX.OUTPUT 0 5) (BX.INPUT 5)) (LLSH 1 dmaChannel] then (* * read address again to be sure to get past the end) (PROGN (BX.OUTPUT 12 7) (BX.OUTPUT 8 4) (BX.OUTPUT 0 5)) (SET currentAddressName (LOGOR (LRSH (PROGN (BX.OUTPUT (LLSH dmaChannel 1) 7) (BX.OUTPUT 4 4) (BX.OUTPUT 0 5) (BX.INPUT 5)) 1) (LLSH (PROGN (BX.OUTPUT (LLSH dmaChannel 1) 7) (BX.OUTPUT 4 4) (BX.OUTPUT 0 5) (BX.INPUT 5)) 7))) (* * if we%'ve wrappedName again already, that means we were not paying attention for a long time before the current round, and things are in bad shape) (if [NOT (ZEROP (LOGAND (PROGN (BX.OUTPUT 8 7) (BX.OUTPUT 4 4) (BX.OUTPUT 0 5) (BX.INPUT 5)) (LLSH 1 dmaChannel] then (HELP "double wrap 2") else T]) (BUSDMA.SLOWUPDATEADDR [LAMBDA (dmaChannelName currentAddrName wrappedName) (* ht: "18-Apr-85 15:26") (* * update the address and wrapped flags safely) (LET ((channel (EVAL dmaChannelName))) (BUSDMA.MASK channel) (SET currentAddrName (BUSDMA.READADDRESS channel)) (PROG1 (if (EVAL wrappedName) then (if (BUSDMA.READTCBIT channel T) then (HELP "double wrap 1") else T) else (SET wrappedName (BUSDMA.READTCBIT channel T))) (BUSDMA.UNMASK channel]) (BUSDMA.UPDATEADDR [NLAMBDA (&dmaChannel ¤tAddress &wrapped fastFlg) (* ht: "18-Apr-85 15:06") (APPLY* (if fastFlg then (FUNCTION BUSDMA.FASTUPDATEADDR) else (FUNCTION BUSDMA.SLOWUPDATEADDR)) &dmaChannel ¤tAddress &wrapped]) (FetchArray [LAMBDA (array pcWordOffset count mode arrayIndex pcBase) (* ht: "11-Apr-85 09:31") (SELECTQ mode ((NIL STRAIGHT) (\BUSBLTINBYTES (if arrayIndex then (\ADDBASE (ARRAYBASE array) (IDIFFERENCE arrayIndex (ARRAYORIG array))) else (ARRAYBASE array)) (OR pcBase 1) (LLSH pcWordOffset 1) count)) (SWAP (\BUSBLTINSWAPBYTES (if arrayIndex then (\ADDBASE (ARRAYBASE array) (IDIFFERENCE arrayIndex (ARRAYORIG array))) else (ARRAYBASE array)) (OR pcBase 1) (LLSH pcWordOffset 1) count)) (SHOULDNT "bad mode"]) (StoreArray [LAMBDA (array pcWordOffset count mode arrayIndex pcBase) (* ht: "11-Apr-85 10:57") (SELECTQ mode ((NIL STRAIGHT) (\BUSBLTOUTBYTES (if arrayIndex then (\ADDBASE (ARRAYBASE array) (IDIFFERENCE arrayIndex (ARRAYORIG array))) else (ARRAYBASE array)) (OR pcBase 1) (LLSH pcWordOffset 1) count)) (SWAP (\BUSBLTOUTSWAPBYTES (if arrayIndex then (\ADDBASE (ARRAYBASE array) (IDIFFERENCE arrayIndex (ARRAYORIG array))) else (ARRAYBASE array)) (OR pcBase 1) (LLSH pcWordOffset 1) count)) (SHOULDNT "bad mode"]) (TestArray [LAMBDA (array pcWordOffset count mode arrayIndex pcBase) (* ht: "14-Apr-85 16:48") (SELECTQ mode ((NIL STRAIGHT) (\BUSBLTCHECKBYTES (if arrayIndex then (\ADDBASE (ARRAYBASE array) (IDIFFERENCE arrayIndex (ARRAYORIG array))) else (ARRAYBASE array)) (OR pcBase 1) (LLSH pcWordOffset 1) count)) (SWAP (\BUSBLTCHECKSWAPBYTES (if arrayIndex then (\ADDBASE (ARRAYBASE array) (IDIFFERENCE arrayIndex (ARRAYORIG array))) else (ARRAYBASE array)) (OR pcBase 1) (LLSH pcWordOffset 1) count)) (SHOULDNT "bad mode"]) ) (PUTPROPS \BUSBLTCHECK DOPVAL (4 BUSBLT 20)) (PUTPROPS \BUSBLTCHECKBYTES DOPVAL (4 BUSBLT 21)) (PUTPROPS \BUSBLTCHECKSWAPBYTES DOPVAL (4 BUSBLT 22)) (DECLARE: EVAL@COMPILE (PUTPROPS BUSDMA.FASTUPDATEADDR MACRO [(dmaChannel currentAddress wrapped fastFlg) (PROGN (* ht: "18-Apr-85 14:46") (* * Open coded all the way - see fn defn for description) (PROGN (BX.OUTPUT 12 7) (BX.OUTPUT 8 4) (BX.OUTPUT 0 5)) (SETQ currentAddress (LOGOR (LRSH (PROGN (BX.OUTPUT (CONSTANT (LLSH dmaChannel 1)) 7) (BX.OUTPUT 4 4) (BX.OUTPUT 0 5) (BX.INPUT 5)) 1) (LLSH (PROGN (BX.OUTPUT (CONSTANT (LLSH dmaChannel 1)) 7) (BX.OUTPUT 4 4) (BX.OUTPUT 0 5) (BX.INPUT 5)) 7))) (* * Check the TC bit for this channel - open coded for speed) (if wrapped then (if [NOT (ZEROP (LOGAND (PROGN (BX.OUTPUT 8 7) (BX.OUTPUT 4 4) (BX.OUTPUT 0 5) (BX.INPUT 5)) (CONSTANT (LLSH 1 dmaChannel] then (HELP "double wrap 1") else T) else (if wrapped←[NOT (ZEROP (LOGAND (PROGN (BX.OUTPUT 8 7) (BX.OUTPUT 4 4) (BX.OUTPUT 0 5) (BX.INPUT 5)) (CONSTANT (LLSH 1 dmaChannel] then (* * read address again to be sure to get past the end) (PROGN (BX.OUTPUT 12 7) (BX.OUTPUT 8 4) (BX.OUTPUT 0 5)) (SETQ currentAddress (LOGOR (LRSH (PROGN (BX.OUTPUT (CONSTANT (LLSH dmaChannel 1)) 7) (BX.OUTPUT 4 4) (BX.OUTPUT 0 5) (BX.INPUT 5)) 1) (LLSH (PROGN (BX.OUTPUT (CONSTANT (LLSH dmaChannel 1)) 7) (BX.OUTPUT 4 4) (BX.OUTPUT 0 5) (BX.INPUT 5)) 7))) (* * if we%'ve wrapped again already, that means we were not paying attention for a long time before the current round, and things are in bad shape) (if [NOT (ZEROP (LOGAND (PROGN (BX.OUTPUT 8 7) (BX.OUTPUT 4 4) (BX.OUTPUT 0 5) (BX.INPUT 5)) (CONSTANT (LLSH 1 dmaChannel] then (HELP "double wrap 2") else T]) (PUTPROPS BUSDMA.UPDATEADDR MACRO (X (PROGN (* ht: "18-Apr-85 14:46") (CONS (if (CADDDR X) then 'BUSDMA.FASTUPDATEADDR else 'BUSDMA.SLOWUPDATEADDR) X)))) ) (DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDTOVAR NLAMA ) (ADDTOVAR NLAML BUSDMA.UPDATEADDR) (ADDTOVAR LAMA ) ) (PUTPROPS BUSUTIL COPYRIGHT ("Henry Thompson" 1985)) (DECLARE: DONTCOPY (FILEMAP (NIL (850 7482 (BUS.READWORD 860 . 1263) (BUS.WRITEWORD 1265 . 1771) (BUSDMA.FASTUPDATEADDR 1773 . 4187) (BUSDMA.SLOWUPDATEADDR 4189 . 4782) (BUSDMA.UPDATEADDR 4784 . 5075) (FetchArray 5077 . 5882) (StoreArray 5884 . 6661) (TestArray 6663 . 7480))))) STOP