From ae15515d80559ff95b315e3342c3baa00b87be1c Mon Sep 17 00:00:00 2001 From: Frans Kaashoek Date: Fri, 2 Sep 2016 08:31:13 -0400 Subject: APIC IDs may not be consecutive and start from zero, so we cannot really use it as a direct index into cpus. Record apicid in struct cpu and have cpunum() look for it. Replace cpu->id with cpunum() everywhere, and replace cpu->id with cpu->apicid. Thanks to Xi Wang. --- proc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'proc.h') diff --git a/proc.h b/proc.h index d1597cf..7352805 100644 --- a/proc.h +++ b/proc.h @@ -1,6 +1,6 @@ // Per-CPU state struct cpu { - uchar id; // Local APIC ID; index into cpus[] below + uchar apicid; // Local APIC ID struct context *scheduler; // swtch() here to enter scheduler struct taskstate ts; // Used by x86 to find stack for interrupt struct segdesc gdt[NSEGS]; // x86 global descriptor table -- cgit v1.2.3