diff options
author | jhb <jhb@FreeBSD.org> | 2001-12-11 23:33:44 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-12-11 23:33:44 +0000 |
commit | 21b6b26912b00bb37f9f16080ba7d49241814935 (patch) | |
tree | c785835e70070309148a72c55669ff0bf043a20a /sys/kern/kern_idle.c | |
parent | 279222ba62c185d7d7ec09017bb3e7760fd333f0 (diff) | |
download | FreeBSD-src-21b6b26912b00bb37f9f16080ba7d49241814935.zip FreeBSD-src-21b6b26912b00bb37f9f16080ba7d49241814935.tar.gz |
Overhaul the per-CPU support a bit:
- The MI portions of struct globaldata have been consolidated into a MI
struct pcpu. The MD per-CPU data are specified via a macro defined in
machine/pcpu.h. A macro was chosen over a struct mdpcpu so that the
interface would be cleaner (PCPU_GET(my_md_field) vs.
PCPU_GET(md.md_my_md_field)).
- All references to globaldata are changed to pcpu instead. In a UP kernel,
this data was stored as global variables which is where the original name
came from. In an SMP world this data is per-CPU and ideally private to each
CPU outside of the context of debuggers. This also included combining
machine/globaldata.h and machine/globals.h into machine/pcpu.h.
- The pointer to the thread using the FPU on i386 was renamed from
npxthread to fpcurthread to be identical with other architectures.
- Make the show pcpu ddb command MI with a MD callout to display MD
fields.
- The globaldata_register() function was renamed to pcpu_init() and now
init's MI fields of a struct pcpu in addition to registering it with
the internal array and list.
- A pcpu_destroy() function was added to remove a struct pcpu from the
internal array and list.
Tested on: alpha, i386
Reviewed by: peter, jake
Diffstat (limited to 'sys/kern/kern_idle.c')
-rw-r--r-- | sys/kern/kern_idle.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/kern_idle.c b/sys/kern/kern_idle.c index b37e27a..92e5cb3 100644 --- a/sys/kern/kern_idle.c +++ b/sys/kern/kern_idle.c @@ -37,18 +37,18 @@ static void idle_setup(void *dummy) { #ifdef SMP - struct globaldata *gd; + struct pcpu *pc; #endif struct proc *p; int error; #ifdef SMP - SLIST_FOREACH(gd, &cpuhead, gd_allcpu) { + SLIST_FOREACH(pc, &cpuhead, pc_allcpu) { error = kthread_create(idle_proc, NULL, &p, - RFSTOPPED | RFHIGHPID, "idle: cpu%d", gd->gd_cpuid); - gd->gd_idlethread = &p->p_thread; - if (gd->gd_curthread == NULL) - gd->gd_curthread = gd->gd_idlethread; + RFSTOPPED | RFHIGHPID, "idle: cpu%d", pc->pc_cpuid); + pc->pc_idlethread = &p->p_thread; + if (pc->pc_curthread == NULL) + pc->pc_curthread = pc->pc_idlethread; #else error = kthread_create(idle_proc, NULL, &p, RFSTOPPED | RFHIGHPID, "idle"); |