anchor.diff:          t)))
   
   (defun ata-write (device lba count mem-addr)
  -  (let ((controller (ata-device-controller device)))
  -    (assert (>= lba 0))
  -    (assert (>= count 0))
  -    (assert (< (+ lba count) (ata-device-sector-count device)))
  -    (when (> count 256)
  -      (debug-write-line "Can't do writes of more than 256 sectors.")
  -      (return-from ata-write (values nil :too-many-sectors)))
  -    (when (eql count 0)
  -      (return-from ata-write t))
  -    (cond ((and (<= +physical-map-base+ mem-addr)
  -                ;; 4GB limit.
  -                (< mem-addr (+ +physical-map-base+ (* 4 1024 1024 1024))))
  -           (ata-write-dma controller device lba count (- mem-addr +physical-map-base+)))
  -          ((<= (* count (ata-device-block-size device)) +4k-page-size+)
  -           ;; Transfer is small enough that the bounce page can be used.
  -           (let* ((bounce-frame (ata-controller-bounce-buffer controller))
  -                  (bounce-phys (ash bounce-frame 12))
  -                  (bounce-virt (+ +physical-map-base+ bounce-phys)))
  -             (%fast-page-copy bounce-virt mem-addr)
  -             (ata-write-dma controller device lba count bounce-phys)))
  -          (t ;; Give up and do a slow PIO transfer.
  -           (ata-write-pio controller device lba count mem-addr))))
  -  t)
  +  (ata-read-write device lba count mem-addr
  +                  :write #'ata-write-dma #'ata-write-pio))
   
   (defun ata-irq-handler (interrupt-frame irq)
     (declare (ignore interrupt-frame))
  
positive.code:                                                                                                 (:read +ata-bmr-direction-read/write+)
                                                                                                  (:write 0)))))
  
  (defun ata-read-pio (controller device lba count mem-addr)
    (when (not (ata-issue-lba28-command device lba count +ata-command-read-sectors+))
      (return-from ata-read-pio (values nil :device-error)))
  
negative.code:         t)))
  
  (defun ata-read (device lba count mem-addr)
    (ata-read-write device lba count mem-addr
                    :read #'ata-read-dma #'ata-read-pio))
  
  (defun ata-write-pio (controller device lba count mem-addr)
    (when (not (ata-issue-lba28-command device lba count +ata-command-write-sectors+))
  