anchor.diff:  (defstruct (ata-controller
                (:area :wired))
     ;; Taken when accessing the controller. Disables interrupts.
  -  (lock :unlocked) ; must be first slot.
  +  (access-lock :unlocked) ; must be first slot.
     ;; Taken while there's a command in progress. Does not disable interrupts.
  -  (use-lock :unlocked) ; must be second slot.
  +  (command-lock (make-mutex))
     command
     control
     irq
  
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:   t)
  
  (defun ata-detect-drive (controller channel)
    (let ((buf (sys.int::make-simple-vector 256)))
      (with-ata-spinlock (controller)
        ;; Select the device.
        (when (not (ata-select-device controller channel))
          (debug-write-line "Could not select ata device when probing.")
          (return-from ata-detect-drive nil))
        ;; Issue IDENTIFY.
        (setf (sys.int::io-port/8 (+ (ata-controller-command controller)
                                     +ata-register-command+))
  