• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
        • Program-execution
        • Introduction
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
          • Syscalls
          • Cpuid
          • X86isa-state
          • Linear-memory
          • Rflag-specifications
          • Characterizing-undefined-behavior
          • Top-level-memory
          • App-view
          • X86-decoder
          • Physical-memory
          • Decoding-and-spec-utils
          • Instructions
          • X86-modes
          • Segmentation
            • Ea-to-la
            • Segment-base-and-bounds
            • Ia32e-segmentation
            • Eas-to-las
            • Ia32-segmentation
              • Ia32-valid-code-segment-descriptor-p
            • Register-readers-and-writers
            • Other-non-deterministic-computations
            • Environment
            • Paging
          • Implemented-opcodes
          • Proof-utilities
          • To-do
          • Concrete-simulation-examples
          • Model-validation
          • Utils
          • Debugging-code-proofs
        • Execloader
        • Axe
      • Testing-utilities
      • Math
    • Ia32-segmentation

    Ia32-valid-code-segment-descriptor-p

    Recognizer for a valid code segment descriptor in 32-bit mode

    Signature
    (ia32-valid-code-segment-descriptor-p descriptor) → (mv * *)

    Definitions and Theorems

    Function: ia32-valid-code-segment-descriptor-p

    (defun
     ia32-valid-code-segment-descriptor-p
     (descriptor)
     (declare (type (unsigned-byte 64) descriptor))
     (let
      ((__function__ 'ia32-valid-code-segment-descriptor-p))
      (declare (ignorable __function__))
      (b*
       (((when
          (not
            (equal (code-segment-descriptorbits->msb-of-type descriptor)
                   1)))
         (mv nil
             (cons :invalid-segment-type descriptor)))
        ((when (not (equal (code-segment-descriptorbits->s descriptor)
                           1)))
         (mv nil
             (cons :invalid-segment-type descriptor)))
        ((when (not (equal (code-segment-descriptorbits->p descriptor)
                           1)))
         (mv nil
             (cons :segment-not-present descriptor)))
        ((when (not (equal (code-segment-descriptorbits->l descriptor)
                           0)))
         (mv nil (cons :ia32e-mode-off descriptor))))
       (mv t 0))))