• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
        • Program-execution
        • Sdm-instruction-set-summary
        • Tlb
        • Running-linux
        • Introduction
        • Asmtest
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
          • X86isa-state
          • Syscalls
          • Cpuid
          • Linear-memory
          • Rflag-specifications
          • Characterizing-undefined-behavior
          • Top-level-memory
          • App-view
          • X86-decoder
          • Physical-memory
          • Decoding-and-spec-utils
          • Instructions
          • Register-readers-and-writers
          • X86-modes
            • 64-bit-modep
            • X86-operation-mode
            • Segmentation
            • Other-non-deterministic-computations
            • Environment
            • Paging
          • Implemented-opcodes
          • To-do
          • Proof-utilities
          • Peripherals
          • Model-validation
          • Modelcalls
          • Concrete-simulation-examples
          • Utils
          • Debugging-code-proofs
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • X86-modes

    X86-operation-mode

    Returns the current mode of operation of the x86 machine

    Signature
    (x86-operation-mode x86) → mode
    Returns
    mode — Type (natp mode).

    We only support 64-bit, Compatibility, and 32-bit Protected Modes for now.

    See x86-modes.

    Definitions and Theorems

    Function: x86-operation-mode

    (defun x86-operation-mode (x86)
      (declare (xargs :stobjs (x86)))
      (declare (xargs :guard t))
      (let ((__function__ 'x86-operation-mode))
        (declare (ignorable __function__))
        (cond ((64-bit-modep x86) 0) (t 1))))

    Theorem: natp-of-x86-operation-mode

    (defthm natp-of-x86-operation-mode
      (b* ((mode (x86-operation-mode x86)))
        (natp mode))
      :rule-classes (:type-prescription :rewrite))

    Theorem: range-of-x86-operation-mode

    (defthm range-of-x86-operation-mode
      (b* ((?mode (x86-operation-mode x86)))
        (and (<= 0 mode) (< mode 5)))
      :rule-classes :linear)

    Theorem: x86-operation-mode-of-xw

    (defthm x86-operation-mode-of-xw
      (implies (and (not (equal fld :msr))
                    (not (equal fld :seg-hidden-attr)))
               (equal (x86-operation-mode (xw fld index value x86))
                      (x86-operation-mode x86))))

    Theorem: x86-operation-mode-of-write-user-rflags

    (defthm x86-operation-mode-of-write-user-rflags
      (equal (x86-operation-mode (write-user-rflags vector mask x86))
             (x86-operation-mode x86)))