# Kconfig - nanokernel configuration options

#
# Copyright (c) 2014-2015 Wind River Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

menu "Nanokernel Options"

config BOOT_BANNER
	bool
	prompt "Boot banner"
	default n
	select PRINTK
	depends on EARLY_CONSOLE
	help
	This option outputs a banner to the console device during boot up. It
	also embeds a date & time stamp in the kernel and in each USAP image.

config BUILD_TIMESTAMP
	bool
	prompt "Build Timestamp"
	help
	Build timestamp and add it to the boot banner.

config INT_LATENCY_BENCHMARK
	bool
	prompt "Interrupt latency metrics [EXPERIMENTAL]"
	default n
	depends on ARCH="x86"
	help
	This option enables the tracking of interrupt latency metrics;
	the exact set of metrics being tracked is board-dependent.
	Tracking begins when int_latency_init() is invoked by an application.
	The metrics are displayed (and a new sampling interval is started)
	each time int_latency_show() is called thereafter.

config MAIN_STACK_SIZE
	int
	prompt "Background task stack size (in bytes)"
	default 1024
	help
	This option specifies the size of the stack used by the kernel's
	background task, whose entry point is main().

config ISR_STACK_SIZE
	int
	prompt "ISR and initialization stack size (in bytes)"
	default 2048
	help
	This option specifies the size of the stack used by interrupt
	service routines (ISRs), and during nanokernel initialization.

config THREAD_CUSTOM_DATA
	bool
	prompt "Task and fiber custom data"
	default n
	help
	This option allows each task and fiber to store 32 bits of custom data,
	which can be accessed using the sys_thread_custom_data_xxx() APIs.

config NANO_TIMEOUTS
	bool
	prompt "Enable timeouts on nanokernel objects"
	default n
	depends on SYS_CLOCK_EXISTS
	help
	Allow fibers and tasks to wait on nanokernel objects with a timeout, by
	enabling the nano_xxx_wait_timeout APIs, and allow fibers to sleep for a
	period of time, by enabling the fiber_sleep API.

config NANO_TIMERS
	bool
	prompt "Enable nanokernel timers"
	default y if NANOKERNEL
	default n
	depends on SYS_CLOCK_EXISTS
	help
	Allow fibers and tasks to wait on nanokernel timers, which can be
	accessed using the nano_timer_xxx() APIs.

config NANOKERNEL_TICKLESS_IDLE_SUPPORTED
	bool
	default n
	help
	To be selected by an architecture if it does support tickless idle in
	nanokernel systems.

config ERRNO
	bool
	prompt "Enable errno support"
	default y
	help
	Enable per-thread errno in the kernel. Application and library code must
	include errno.h provided by the C library (libc) to use the errno symbol.
	The C library must access the per-thread errno via the _get_errno() symbol.

config NANO_WORKQUEUE
	bool "Enable nano workqueue support"
	default n
	help
	Nano workqueues allow scheduling work items to be executed in a fiber
	context. Typically such work items are scheduled from ISRs, when the
	work cannot be executed in interrupt context.

config SYSTEM_WORKQUEUE
	bool "Start a system workqueue"
	default y
	depends on NANO_WORKQUEUE
	help
	Start a system-wide nano_workqueue that can be used by any system
	component.

config SYSTEM_WORKQUEUE_STACK_SIZE
	int "System workqueue stack size"
	default 1024
	depends on SYSTEM_WORKQUEUE

config SYSTEM_WORKQUEUE_PRIORITY
	int "System workqueue priority"
	default 10
	depends on SYSTEM_WORKQUEUE

config ATOMIC_OPERATIONS_BUILTIN
	bool
	help
	Use the compiler builtin functions for atomic operations. This is
	the preferred method. However, support for all arches in GCC is
	incomplete.

config ATOMIC_OPERATIONS_CUSTOM
	bool
	help
	Use when there isn't support for compiler built-ins, but you have
	written optimized assembly code under arch/ which implements these.

config ATOMIC_OPERATIONS_C
	bool
	help
	Use atomic operations routines that are implemented entirely
	in C by locking interrupts. Selected by architectures which either
	do not have support for atomic operations in their instruction
	set, or haven't been implemented yet during bring-up, and also
	the compiler does not have support for the atomic __sync_* builtins.

endmenu
