1/*
2 * Copyright 2014, General Dynamics C4 Systems
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#pragma once
8
9/* Compile-time configuration parameters. Might be set by the build system. */
10
11#ifdef HAVE_AUTOCONF
12#include <autoconf.h>
13#endif
14
15/* size of the initial thread's root CNode (2^x slots, x >= 4) */
16#ifndef CONFIG_ROOT_CNODE_SIZE_BITS
17#define CONFIG_ROOT_CNODE_SIZE_BITS 12
18#endif
19
20/* number of timer ticks until a thread is preempted  */
21#ifndef CONFIG_KERNEL_MCS
22#ifndef CONFIG_TIME_SLICE
23#define CONFIG_TIME_SLICE 5
24#endif
25#endif
26
27#ifdef CONFIG_KERNEL_MCS
28#ifndef CONFIG_BOOT_THREAD_TIME_SLICE
29#define CONFIG_BOOT_THREAD_TIME_SLICE 5
30#endif
31
32#ifndef CONFIG_KERNEL_WCET_SCALE
33#define CONFIG_KERNEL_WCET_SCALE 1
34#endif
35#endif
36
37/* the number of scheduler domains */
38#ifndef CONFIG_NUM_DOMAINS
39#define CONFIG_NUM_DOMAINS 16
40#endif
41
42/* number of priorities per domain */
43#ifndef CONFIG_NUM_PRIORITIES
44#define CONFIG_NUM_PRIORITIES 256
45#endif
46
47/* maximum number of caps that can be created in one retype invocation */
48#ifndef CONFIG_RETYPE_FAN_OUT_LIMIT
49#define CONFIG_RETYPE_FAN_OUT_LIMIT 256
50#endif
51
52/* chunk size for memory clears during retype, in bits. */
53#ifndef CONFIG_RESET_CHUNK_BITS
54#define CONFIG_RESET_CHUNK_BITS 8
55#endif
56
57/* maximum number of iterations until we preempt a delete/revoke invocation */
58#ifndef CONFIG_MAX_NUM_WORK_UNITS_PER_PREEMPTION
59#define CONFIG_MAX_NUM_WORK_UNITS_PER_PREEMPTION 100
60#endif
61
62/* address range to flush per preemption work unit */
63#ifndef CONFIG_FLUSH_WORK_UNIT
64#define CONFIG_FLUSH_WORK_UNIT 64
65#endif
66
67/* maximum number of untyped caps in bootinfo */
68/* WARNING: must match value in libsel4! */
69/* CONSTRAINT: (16 * CONFIG_MAX_NUM_BOOTINFO_DEVICE_REGIONS) + (5 * CONFIG_MAX_NUM_BOOTINFO_UNTYPED_CAPS) <= 4036 */
70#ifndef CONFIG_MAX_NUM_BOOTINFO_UNTYPED_CAPS
71#define CONFIG_MAX_NUM_BOOTINFO_UNTYPED_CAPS 166
72#endif
73
74#ifndef CONFIG_KERNEL_MCS
75/* length of a timer tick in ms  */
76#ifndef CONFIG_TIMER_TICK_MS
77#define CONFIG_TIMER_TICK_MS 2
78#endif
79#endif
80
81/* maximum number of different tracepoints which can be placed in the kernel */
82#ifndef CONFIG_MAX_NUM_TRACE_POINTS
83#define CONFIG_MAX_NUM_TRACE_POINTS 0
84#endif
85
86/* maximum number of IOMMU RMRR entries we can record while ACPI parsing */
87#ifndef CONFIG_MAX_RMRR_ENTRIES
88#define CONFIG_MAX_RMRR_ENTRIES 32
89#endif
90
91/* maximum number of IOAPIC supported */
92#ifndef CONFIG_MAX_NUM_IOAPIC
93#define CONFIG_MAX_NUM_IOAPIC  1
94#endif
95
96/* Alias CONFIG_MAX_NUM_NODES > 1 to ENABLE_SMP_SUPPORT */
97#if CONFIG_MAX_NUM_NODES > 1
98#define ENABLE_SMP_SUPPORT
99#endif
100
101#ifdef CONFIG_ARM_HYPERVISOR_SUPPORT
102#ifdef CONFIG_ARM_PA_SIZE_BITS_40
103#define AARCH64_VSPACE_S2_START_L1
104#endif
105#endif
106
107/* Configurations requring the kernel log buffer */
108#if defined CONFIG_BENCHMARK_TRACK_KERNEL_ENTRIES || \
109    defined CONFIG_BENCHMARK_TRACEPOINTS
110#define CONFIG_KERNEL_LOG_BUFFER
111#endif
112