BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / commit / c738dbb1e7e7a46a98436326234826eef71083e2 / task / time.c

// Related

Nucleus

Barry CPU specific segment c738dbb (3 years, 2 months ago)
diff --git a/task/time.c b/task/time.c
index 3f5a50a..d6a47d9 100644
--- a/task/time.c
+++ b/task/time.c
@@ -15,16 +15,16 @@ uint8_t slice[MAX_CPUS] = {0};
 void
 timer_handler(struct InterruptFrame *frame)
 {
-	if (CPUID == 0)
+	if (cpu->id == 0)
 		monotonic++;
 
 	if (!current)
 		return;
-	slice[CPUID]++;
+	slice[cpu->id]++;
 
 	/* Call scheduler */
-	if (slice[CPUID] < (current->priority * 10))
+	if (slice[cpu->id] < (current->priority * 10))
 		return;
-	slice[CPUID] = 0;
+	slice[cpu->id] = 0;
 	schedule();
 }