From 8b4e2a08febc8b957b44732dbc7da831479a0005 Mon Sep 17 00:00:00 2001 From: rtm Date: Sat, 1 Jul 2006 21:26:01 +0000 Subject: swtch saves callee-saved registers swtch idles on per-CPU stack, not on calling process's stack fix pipe bugs usertest.c tests pipes, fork, exit, close --- proc.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'proc.h') diff --git a/proc.h b/proc.h index 14164db..e371f7d 100644 --- a/proc.h +++ b/proc.h @@ -37,3 +37,14 @@ struct proc{ extern struct proc proc[]; extern struct proc *curproc[NCPU]; + +#define MPSTACK 512 + +struct cpu { + uint8_t apicid; // Local APIC ID + int lintr[2]; // Local APIC + char mpstack[MPSTACK]; // per-cpu start-up stack, only used to get into main() +}; + +extern struct cpu cpus[NCPU]; +extern int ncpu; -- cgit v1.2.3