Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions kernel/core/Kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ static InitResultT PXS2(void) {

// Initialize IDE driver
PrintKernel("Info: Initializing IDE driver...\n");
int ide_result = IdeInit();
const int ide_result = IdeInit();
if (ide_result == IDE_OK) {
PrintKernelSuccess("System: IDE driver initialized\n");

Expand Down Expand Up @@ -690,6 +690,5 @@ void KernelMainHigherHalf(void) {

while (1) { // redundant but added for worst case scenario, should not reach here
Yield();
__asm__ volatile("hlt");
}
}
6 changes: 3 additions & 3 deletions kernel/process/Process.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static uint64_t CalculateSecureChecksum(const SecurityToken* token, uint32_t pid
}

static inline int FindFreeSlotFast(void) {
if (UNLIKELY(active_process_bitmap == ~1ULL)) { // All slots except 0 taken
if (UNLIKELY(active_process_bitmap == ~1ULL)) { // All slots except 0 taken
return -1;
}

Expand Down Expand Up @@ -126,7 +126,7 @@ static void AddToTerminationQueueAtomic(uint32_t slot) {
}

termination_queue[tail] = slot;
__sync_synchronize(); // Memory barrier
__atomic_thread_fence(__ATOMIC_SEQ_CST);
term_queue_tail = new_tail;
AtomicInc(&term_queue_count);
}
Expand Down Expand Up @@ -258,7 +258,7 @@ void TerminateProcess(uint32_t pid, TerminationReason reason, uint32_t exit_code
}

proc->state = PROC_ZOMBIE; // Set state FIRST
__sync_synchronize(); // Full memory barrier
__atomic_thread_fence(__ATOMIC_SEQ_CST);
AddToTerminationQueueAtomic(slot); // Then add to queue
SpinLock(&pid_lock);
int idx = proc->pid / 64;
Expand Down