anchor.diff:          (let ((data (sys.int::io-port/16 (+ (ata-controller-command controller)
                                               +ata-register-data+))))
             (setf (svref buf i) (logior (ash (logand data #xFF) 8)
  -                                      (ash data -8)))))
  -      (setf *ata-devices*
  -            (sys.int::cons-in-area
  -             (make-ata-device :controller controller
  -                              :channel channel
  -                              ;; Check for large sector drives.
  -                              :block-size (if (and (logbitp 14 (svref buf 106))
  -                                                   (not (logbitp 13 (svref buf 106))))
  -                                              (logior (ash (svref buf 117) 16)
  -                                                      (svref buf 118))
  -                                              512)
  -                              ;; TODO: LBA48 support.
  -                              :sector-count (logior (ash (svref buf 60) 16)
  -                                                    (svref buf 61)))
  -             *ata-devices*
  -             :wired)))))
  +                                      (ash data -8))))))
  +    (setf *ata-devices*
  +          (sys.int::cons-in-area
  +           (make-ata-device :controller controller
  +                            :channel channel
  +                            ;; Check for large sector drives.
  +                            :block-size (if (and (logbitp 14 (svref buf 106))
  +                                                 (not (logbitp 13 (svref buf 106))))
  +                                            (logior (ash (svref buf 117) 16)
  +                                                    (svref buf 118))
  +                                            512)
  +                            ;; TODO: LBA48 support.
  +                            :sector-count (logior (ash (svref buf 60) 16)
  +                                                  (svref buf 61)))
  +           *ata-devices*
  +           :wired))))
   
   (defun ata-issue-lba28-command (device lba count command)
     (let ((controller (ata-device-controller device)))
  
positive.code:                                          ,current-thread))
             (sys.int::cpu-relax))
           (multiple-value-prog1 (progn ,@body)
             (setf (sys.int::%struct-slot ,controller-sym 1) :unlocked))))))
  
  (defmacro with-ata-use-lock ((controller) &body body)
    (let ((current-thread (gensym))
          (controller-sym (gensym)))
      `(let ((,controller-sym ,controller))
         (without-interrupts
           (let ((,current-thread (sys.int::current-thread)))
             (do ()
                 ((sys.int::%cas-struct-slot ,controller-sym 2
                                             :unlocked
                                             ,current-thread))
               (sys.int::cpu-relax))))
         (multiple-value-prog1 (progn ,@body)
           (setf (sys.int::%struct-slot ,controller-sym 2) :unlocked)))))
  
  (defun ata-alt-status (controller)
    "Read the alternate status register."
  
negative.code: (defstruct (ata-controller
               (:area :wired))
    ;; Taken when accessing the controller. Disables interrupts.
    (access-lock :unlocked) ; must be first slot.
    ;; Taken while there's a command in progress. Does not disable interrupts.
    (command-lock (make-mutex))
    command
    control
    irq
  