# Kconfig - kernel configuration options

#
# Copyright (c) 2014-2015 Wind River Systems, Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1) Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2) Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3) Neither the name of Wind River Systems nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#

choice
prompt "Kernel Type"
default MICROKERNEL

config NANOKERNEL
	bool "Nano Kernel"

config MICROKERNEL
	bool "Micro Kernel"

endchoice

menu "General Kernel Options"

config SYS_CLOCK_TICKS_PER_SEC
	int
	prompt "System tick frequency (in ticks/second)"
	default 100
	depends on !NO_ISRS
	help
	This option specifies the frequency of the system clock in Hz.

config SYS_CLOCK_HW_CYCLES_PER_SEC
	int "System clock's h/w timer frequency"
	default 0
	help
	This option specifies the frequency of the hardware timer used for the
	system clock (in Hz). It is normally set by the platform's defconfig file
	and the user should generally avoid modifying it via the menu configuration.

config  SYS_CLOCK_EXISTS
	bool
	# omit prompt to signify a "hidden" option
	default n if (SYS_CLOCK_TICKS_PER_SEC = 0)
	default y
	help
	This option specifies that the kernel lacks timer support.

config  INIT_STACKS
	bool
	prompt "Initialize stack areas"
	default n
	help
	This option instructs the kernel to initialize stack areas with a
	known value (0xaa) before they are first used, so that the high
	water mark can be easily determined. This applies to the stack areas
	for both tasks and fibers, as well as for the K_swapper's command
	stack.

config  XIP
	bool
	prompt "Execute in place"
	help
	  This option allows the kernel to operate with its text and read-only
	  sections residing in ROM (or similar read-only memory). Not all platforms
	  support this option so it must be used with care; you must also
	  supply a linker command file when building your image. Enabling this
	  option increases both the code and data footprint of the image.

config ENHANCED_SECURITY
	bool
	prompt "Enhanced security features"
	default y if ARCH="x86"
	default n
	help
	This option enables all security features supported by the kernel,
	including those that can have a significant impact on system
	footprint or performance; it also prevents the use of certain kernel
	features that have known security risks.

	Users can customize these settings using the CUSTOM_SECURITY option
	in the "Security Options" menu.

menu "Security Options"
	depends on ENHANCED_SECURITY

config CUSTOM_SECURITY
	bool
	prompt "Customized security"
	default n
	help
	This option allow users to disable enhanced security features they do
	not wish to use or enable the use of features with security exposures.

config STACK_CANARIES
	bool
	prompt "Compiler stack canaries" if CUSTOM_SECURITY
	default n
	help
	This option enables compiler stack canaries support on most functions
	in the kernel. (Kernel functions that reside in LKMs do NOT have
	stack canary support, due to limitations of the LKM technology.)

	If stack canaries are supported by the compiler, it will emit
	extra code that inserts a canary value into the stack frame when
	a function is entered and validates this value upon exit.
	Stack corruption (such as that caused by buffer overflow) results
	in a fatal error condition for the running entity.
	Enabling this option can result in a significant increase
	in footprint and an associated decrease in performance.

	If stack canaries are not supported by the compiler, enabling this
	option has no effect.
endmenu

endmenu
source "kernel/nanokernel/Kconfig"

config TICKLESS_IDLE
	bool
	prompt "Tickless idle"
	default y
	depends on ADVANCED_POWER_MANAGEMENT
	help
	This option suppresses periodic system clock interrupts whenever the
	kernel becomes idle. This permits the system to remain in a power
	saving state for extended periods without having to wake up to
	service each tick as it occurs.

config TICKLESS_IDLE_THRESH
	int
	prompt "Tickless idle threshold"
	default 3
	depends on TICKLESS_IDLE && MICROKERNEL
	help
	This option disables clock interrupt suppression when the kernel idles
	for only a short period of time. It specifies the minimum number of
	ticks that must occur before the next kernel timer expires in order
	for suppression to happen.

if MICROKERNEL
source "kernel/microkernel/Kconfig"
endif
