diff --git a/src/kern/wait.zig b/src/kern/wait.zig index f83eddf..a6b0715 100644 --- a/src/kern/wait.zig +++ b/src/kern/wait.zig @@ -9,7 +9,7 @@ const ke = b.ke; /// Header for waitable objects. /// This must be added to any structured which is considered waitable. pub const DispatchHeader = struct { - pub const Kind = enum { + pub const Type = enum { /// When signaled, `signaled` is kept high and all waiters are woken up. Notification, /// When signaled, `signaled` is decreased until 0, and a single waiter is woken up. @@ -18,23 +18,23 @@ pub const DispatchHeader = struct { /// List of WaitBlocks. waitblocks: rtl.List, - /// Kind of object. - kind: Kind, + /// Type of object. + type: Type, /// Lock protecting the object. lock: ke.SpinLock, /// Signaled count. signaled: u32, /// Initialize a waitable object. - pub fn init(obj: *DispatchHeader, kind: Kind) void { - obj.kind = kind; + pub fn init(obj: *DispatchHeader, kind: Type) void { + obj.type = kind; obj.lock = ke.SpinLock.init(); obj.signaled = 0; obj.waitblocks.init(); } fn consume(self: *DispatchHeader) void { - switch (self.kind) { + switch (self.type) { .Synchronization => self.signaled -= 1, .Notification => { // Object remains signaled. @@ -192,7 +192,7 @@ pub fn wait_any(objects: []*DispatchHeader, timeout: ?b.Nanoseconds, waitblocks: /// Satisfy a wait on an object. pub fn satisfy_wait(obj: *DispatchHeader) void { - const all = obj.kind == .Notification; + const all = obj.type == .Notification; // Go through (potentially) all wait blocks and try to satisfy them. while (!obj.waitblocks.is_empty() and obj.signaled > 0) { diff --git a/src/platform/root.zig b/src/platform/root.zig index bd24b9d..39fdeb0 100644 --- a/src/platform/root.zig +++ b/src/platform/root.zig @@ -41,7 +41,7 @@ pub const BootInfo = struct { pub const MemMap = struct { /// A memory map entry. pub const Entry = struct { - pub const Kind = enum { + pub const Type = enum { Free, Reserved, LoaderReclaimable, @@ -50,7 +50,7 @@ pub const BootInfo = struct { Kernel, }; - kind: Kind, + type: Type, base: usize, size: usize, }; diff --git a/src/platform/um/impl.zig b/src/platform/um/impl.zig index 36f43bf..5e965b9 100644 --- a/src/platform/um/impl.zig +++ b/src/platform/um/impl.zig @@ -81,7 +81,7 @@ pub fn early_init() linksection(b.init) void { global_state.boot_info.memory_map.entry_count = 1; global_state.boot_info.memory_map.entries[0].base = phys_base; global_state.boot_info.memory_map.entries[0].size = global_state.params.mem_size; - global_state.boot_info.memory_map.entries[0].kind = .Free; + global_state.boot_info.memory_map.entries[0].type = .Free; global_state.phys_memory_memfd = memfd; global_state.phys_base = phys_base;