Skip to content

Commit 1537513

Browse files
authored
Merge pull request #89 from assembler-0/Development
Development
2 parents aa5e116 + 08b5479 commit 1537513

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

kernel/core/Kernel.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ static InitResultT PXS2(void) {
584584

585585
// Initialize IDE driver
586586
PrintKernel("Info: Initializing IDE driver...\n");
587-
int ide_result = IdeInit();
587+
const int ide_result = IdeInit();
588588
if (ide_result == IDE_OK) {
589589
PrintKernelSuccess("System: IDE driver initialized\n");
590590

@@ -690,6 +690,5 @@ void KernelMainHigherHalf(void) {
690690

691691
while (1) { // redundant but added for worst case scenario, should not reach here
692692
Yield();
693-
__asm__ volatile("hlt");
694693
}
695694
}

kernel/process/Process.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static uint64_t CalculateSecureChecksum(const SecurityToken* token, uint32_t pid
9494
}
9595

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

@@ -126,7 +126,7 @@ static void AddToTerminationQueueAtomic(uint32_t slot) {
126126
}
127127

128128
termination_queue[tail] = slot;
129-
__sync_synchronize(); // Memory barrier
129+
__atomic_thread_fence(__ATOMIC_SEQ_CST);
130130
term_queue_tail = new_tail;
131131
AtomicInc(&term_queue_count);
132132
}
@@ -258,7 +258,7 @@ void TerminateProcess(uint32_t pid, TerminationReason reason, uint32_t exit_code
258258
}
259259

260260
proc->state = PROC_ZOMBIE; // Set state FIRST
261-
__sync_synchronize(); // Full memory barrier
261+
__atomic_thread_fence(__ATOMIC_SEQ_CST);
262262
AddToTerminationQueueAtomic(slot); // Then add to queue
263263
SpinLock(&pid_lock);
264264
int idx = proc->pid / 64;

0 commit comments

Comments
 (0)