anchor.diff:    (ps/2-read-char *ps/2-key-fifo*))
   
   (defun keyboard-listen (fifo)
  -  (loop (when (eql (ps/2-fifo-head fifo)
  -                   (ps/2-fifo-tail fifo))
  -          (return nil))
  -     (let* ((scancode (aref (ps/2-fifo-buffer fifo) (ps/2-fifo-head fifo)))
  -            (key (svref (if *ps/2-keyboard-shifted*
  -                            *gb-keymap-high*
  -                            *gb-keymap-low*)
  -                        (logand scancode #x7F))))
  -       (when *ps/2-keyboard-extended-key*
  -         (setf *ps/2-keyboard-extended-key* nil)
  -         (let ((extended-key (assoc (logand scancode #x7F) *extended-key-alist*)))
  -           (cond ((null extended-key)
  -                  (setf key nil))
  -                 ((and *ps/2-keyboard-shifted* (third extended-key))
  -                  (setf key (third extended-key)))
  -                 (t (setf key (second extended-key))))))
  -       (cond ((= scancode +extended-scan-code+)
  -              (setf *ps/2-keyboard-extended-key* t))
  -             ((logtest scancode #x80)
  -              ;; Key release.
  -              (case key
  -                ((:shift :left-shift :right-shift) (setf *ps/2-keyboard-shifted* nil))
  -                ((:control :left-control :right-control) (setf *ps/2-keyboard-ctrled* nil))
  -                ((:meta :left-meta :right-meta) (setf *ps/2-keyboard-metaed* nil))
  -                ((:super :left-super :right-super) (setf *ps/2-keyboard-supered* nil))
  -                ((:hyper :left-hyper :right-hyper) (setf *ps/2-keyboard-hypered* nil))))
  -             (t ;; Key press.
  -              (cond ((member key '(:shift :left-shift :right-shift))
  -                     (setf *ps/2-keyboard-shifted* t))
  -                    ((member key '(:control :left-control :right-control))
  -                     (setf *ps/2-keyboard-ctrled* t))
  -                    ((member key '(:meta :left-meta :right-meta))
  -                     (setf *ps/2-keyboard-metaed* t))
  -                    ((member key '(:super :left-super :right-super))
  -                     (setf *ps/2-keyboard-supered* t))
  -                    ((member key '(:hyper :left-hyper :right-hyper))
  -                     (setf *ps/2-keyboard-hypered* t))
  -                    ((characterp key)
  -                     (return t)))))
  -       (incf (ps/2-fifo-head fifo))
  -       (when (>= (ps/2-fifo-head fifo) (length (ps/2-fifo-buffer fifo)))
  -         (setf (ps/2-fifo-head fifo) 0)))))
  +  (not (ps/2-fifo-empty fifo)))
   
   (defmethod sys.gray:stream-listen ((stream ps/2-keyboard-stream))
     (keyboard-listen *ps/2-key-fifo*))
  
positive.code:        (when (eql data #x01)
           (signal-break-from-interrupt
            *isa-pic-interrupted-stack-group*)))))
    (setf x (1+ (ps/2-fifo-tail fifo)))
    (when (>= x (length (ps/2-fifo-buffer fifo)))
      (setf x 0))
    ;; When next reaches head, the buffer is full.
    (unless (= x (ps/2-fifo-head fifo))
      (setf (aref (ps/2-fifo-buffer fifo) (ps/2-fifo-tail fifo)) data
            (ps/2-fifo-tail fifo) x))
    't)
  
  (defvar *ps/2-key-fifo*)
  
negative.code:   (head 0 :type fixnum)
    (tail 0 :type fixnum)
    (buffer (make-array 500 :element-type '(unsigned-byte 8) :area :static)
            :read-only t)
    (semaphore (make-semaphore :name "PS/2 FIFO count" :area :static)
               :read-only t)
    (lock (make-spinlock :name "PS/2 FIFO lock" :area :static)
          :read-only t))
  
  (defconstant +ps/2-data-port+ #x60)
  (defconstant +ps/2-control-port+ #x64)
  