#
# Copyright 2014, General Dynamics C4 Systems
#
# This software may be distributed and modified according to the terms of
# the GNU General Public License version 2. Note that NO WARRANTY is provided.
# See "LICENSE_GPLv2.txt" for details.
#
# @TAG(GD_GPL)
#

config PCI
    bool "PCI support"
        depends on PLAT_PC99
        default y
        help
            PCI support, normal should be yes for current
            x86 based PCs

config IOMMU
    bool "IOMMU support"
        depends on PLAT_PC99
        default y
        help
            IOMMU support for VT-d enabled chipset

choice
    prompt "IRQ Controller"
    depends on PLAT_PC99
    default IRQ_PIC
    help
        Select the IRQ controller seL4 will use. Code for others may
        still be included if needed to disable at run time
    config IRQ_PIC
        bool "PIC"
        help
            Use the legacy PIC controller
    config IRQ_IOAPIC
        bool "IOAPIC"
        help
            Use one or more IOAPIC controllers
endchoice

config MAX_NUM_IOAPIC
    prompt "Max supported IOAPICs"
    depends on PLAT_PC99
    int
    default 1
    help
        Configure the maximum number of IOAPIC controllers that can
        be supported. SeL4 will detect IOAPICs regardless of whether
        the IOAPIC will actually be used as the final IRQ controller

config PAE_PAGING
    bool "Use PAE Paging"
    depends on ARCH_IA32
    default n
    help
        PAE paging uses 4K/2M pages and has three levels of paging. If this
        is not used the old 32-bit paging with 4K/4M pages will be used

choice
    prompt "FPU state implementation"
    depends on ARCH_X86
    default FXSAVE
    help
        Choose the method that FPU state is stored in. This directly
        affects the method used to save and rrestore it
    config FXSAVE
        bool "FXSAVE"
        help
            This chooses the legacy 512-byte region used by the
            fxsave and fxrstor functions
    config XSAVE
        bool "XSAVE"
        help
            This chooses the variable xsave region, and enables the
            ability to use any of the xsave variants to save and
            restore. The actual size of the region is dependent on
            the features enabled.
endchoice

choice
    prompt "XSAVE variant"
    depends on XSAVE
    default XSAVE_XSAVEOPT
    help
        The XSAVE area supports multiple instructions to save
        and restore to it. These instructions are dependent upon
        specific CPU support. See Chapter 13 of Volume 1 of the
        Intel Architectures SOftware Developers Manual for
        discussion on the init and modified optimizations

    config XSAVE_XSAVE
        bool "XSAVE"
        help
            Original XSAVE instruction. This is the only XSAVE
            instruction that is guaranteed to exist if XSAVE
            is present
    config XSAVE_XSAVEC
        bool "XSAVEC"
        help
            Save state with compaction. This compaction has
            to do with minimizing the total size of XSAVE buffer,
            if using non contiguous features, XSAVEC will attempt
            to use the init optimization when saving
    config XSAVE_XSAVEOPT
        bool "XSAVEOPT"
        help
            Save state taking advantage of both the init
            optimization and modified optimization
    config XSAVE_XSAVES
        bool "XSAVES"
        help
            Save state taking advantage of the modified
            optimization. This instruction is only
            available in OS code, and is the preferred
            save method if it exists
endchoice

config XSAVE_FEATURE_SET
    int "XSAVE feature set"
    depends on XSAVE
    default 3
    help
        XSAVE can save and restore the state for various
        features through the use of the feature mask. This
        config option represents the feature mask that we
        want to support. The CPU must support all bits
        in this feature mask. Current known bits are
        0 - FPU
        1 - SSE
        2 - AVX
        FPU and SSE is guaranteed to exist if XSAVE exists

config XSAVE_SIZE
    int "XSAVE region size"
    depends on ARCH_X86
    default 576 if XSAVE
    default 512 if !XSAVE
    help
        The size of the XSAVE region. This is dependent
        upon the features in XSAVE_FEATURE_SET that have
        been requested. Default is 576 for the FPU and
        SSE state, unless XSAVE is not in use then it
        should be 512 for the legacy FXSAVE region

choice
    prompt "Setting FS/GS Base Addresses"
    depends on ARCH_X86
    default FSGSBASE_GDT
    help
        There are two ways to to set FS/GS base addresses:
        IA32_FS/GS_GDT and IA32_FS/GS_BASE_MSR.

    config FSGSBASE_GDT
        bool "IA32_FS/GS_GDT"
        depends on ARCH_IA32
        help
            Use GDT entries.

    config FSGSBASE_MSR
        bool "IA32_FS/GS_BASE MSRs"
        depends on ARCH_X86
        help
            Use MSRs to change base addresses.
endchoice
