diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2000-11-28 23:52:36 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2000-11-28 23:52:36 +0000 |
| commit | 8d9888d37a63f1f8c8ffcc9dad4b47fa6bbff39a (patch) | |
| tree | d561c023fa15b67b532ad8e0f5fd486d29dda061 /sys/amd64/include | |
| parent | bf8bfade992616d46bb6ad88a61cf4a715d34fcb (diff) | |
Notes
Diffstat (limited to 'sys/amd64/include')
| -rw-r--r-- | sys/amd64/include/mptable.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h index 4788ee47e24f..0c1fc03c3f2d 100644 --- a/sys/amd64/include/mptable.h +++ b/sys/amd64/include/mptable.h @@ -2275,15 +2275,23 @@ invltlb(void) int stop_cpus(u_int map) { + int count = 0; + if (!smp_started) return 0; /* send the Xcpustop IPI to all CPUs in map */ selected_apic_ipi(map, XCPUSTOP_OFFSET, APIC_DELMODE_FIXED); - while ((stopped_cpus & map) != map) + while (count++ < 100000 && (stopped_cpus & map) != map) /* spin */ ; +#ifdef DIAGNOSTIC + if ((stopped_cpus & map) != map) + printf("Warning: CPUs 0x%x did not stop!\n", + (~(stopped_cpus & map)) & map); +#endif + return 1; } @@ -2304,14 +2312,23 @@ stop_cpus(u_int map) int restart_cpus(u_int map) { + int count = 0; + if (!smp_started) return 0; started_cpus = map; /* signal other cpus to restart */ - while ((stopped_cpus & map) != 0) /* wait for each to clear its bit */ + /* wait for each to clear its bit */ + while (count++ < 100000 && (stopped_cpus & map) != 0) /* spin */ ; +#ifdef DIAGNOSTIC + if ((stopped_cpus & map) != 0) + printf("Warning: CPUs 0x%x did not restart!\n", + (~(stopped_cpus & map)) & map); +#endif + return 1; } |
