Ahh, okay. The way I have my configuration options setup is the following.
Defining a data type with all the options related to the RTOS kernel services, setting it to the most default options. FCFS scheduler algorithm with no stack, timer, intertask comm., etc. in the types.zig
file.
pub const RTOSConfig = struct {
...
// Sub-Configuration Data Structures
...
include_everything: bool = false,
scheduler: SchedulerConfig = SchedulerConfig {},
task: TaskConfig = TaskConfig {},
partition: PartitionConfig = PartitionConfig {},
mailbox: MailboxConfig = MailboxConfig {},
queue: QueueConfig = QueueConfig {},
semaphore: SemaphoreConfig = SemaphoreConfig {},
event: EventConfig = EventConfig {},
pipe: PipeConfig = PipeConfig {},
release: ReleaseConfig = ReleaseConfig {},
system: SystemConfig = SystemConfig {},
}
Import the data structure into the config.zig
file for user custom configuration.
const RTOSConfig = @import("types.zig").RTOSConfig;
pub const config = RTOSConfig {
// User Custom Configuration
}
Then importing the configuration to kernel service files in order to enable features, initialize data structures, and exclude code. For example, the scheduler
pun const scheduler(comptimer T: SchedulerType) void {
switch (T) {
.RTC => {
// Run to Completion Scheduling Algorithm
},
.RR, .TS, .PRIORITY {
// Logic for the three scheduling algorithms that need timers, stacks, context, etc
// Include/Exclude code depending on which scheduler has been chosen.
// Initializing data structures etc.
},
}
}
*Left out details for brevity.