summaryrefslogtreecommitdiff
path: root/proc.h
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2016-09-02 08:31:13 -0400
committerFrans Kaashoek <[email protected]>2016-09-02 08:31:13 -0400
commitae15515d80559ff95b315e3342c3baa00b87be1c (patch)
treeb61b17981cce96f0b66efc77a7ce479e3e66a843 /proc.h
parent37939f24c2fbb12a57a628fedd024a4865741e74 (diff)
downloadxv6-labs-ae15515d80559ff95b315e3342c3baa00b87be1c.tar.gz
xv6-labs-ae15515d80559ff95b315e3342c3baa00b87be1c.tar.bz2
xv6-labs-ae15515d80559ff95b315e3342c3baa00b87be1c.zip
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.
Diffstat (limited to 'proc.h')
-rw-r--r--proc.h2
1 files changed, 1 insertions, 1 deletions
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