subr_smp.c (147680) | subr_smp.c (151634) |
---|---|
1/*- 2 * Copyright (c) 2001 3 * John Baldwin <jhb@FreeBSD.org>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28 */ 29 30/* 31 * This module holds the global variables and machine independent functions 32 * used for the kernel SMP support. 33 */ 34 35#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001 3 * John Baldwin <jhb@FreeBSD.org>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 19 unchanged lines hidden (view full) --- 28 */ 29 30/* 31 * This module holds the global variables and machine independent functions 32 * used for the kernel SMP support. 33 */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/kern/subr_smp.c 147680 2005-06-30 03:38:10Z peter $"); | 36__FBSDID("$FreeBSD: head/sys/kern/subr_smp.c 151634 2005-10-24 21:04:19Z jhb $"); |
37 | 37 |
38#include "opt_kdb.h" 39 | |
40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> 43#include <sys/ktr.h> 44#include <sys/proc.h> 45#include <sys/bus.h> 46#include <sys/lock.h> 47#include <sys/mutex.h> --- 203 unchanged lines hidden (view full) --- 251 break; 252 } 253#endif 254 } 255 256 return 1; 257} 258 | 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/kernel.h> 41#include <sys/ktr.h> 42#include <sys/proc.h> 43#include <sys/bus.h> 44#include <sys/lock.h> 45#include <sys/mutex.h> --- 203 unchanged lines hidden (view full) --- 249 break; 250 } 251#endif 252 } 253 254 return 1; 255} 256 |
259#ifdef KDB_STOP_NMI 260int 261stop_cpus_nmi(cpumask_t map) 262{ 263 int i; 264 265 if (!smp_started) 266 return 0; 267 268 CTR1(KTR_SMP, "stop_cpus(%x)", map); 269 270 /* send the stop IPI to all CPUs in map */ 271 ipi_nmi_selected(map); 272 273 i = 0; 274 while ((atomic_load_acq_int(&stopped_cpus) & map) != map) { 275 /* spin */ 276 i++; 277#ifdef DIAGNOSTIC 278 if (i == 100000) { 279 printf("timeout stopping cpus\n"); 280 break; 281 } 282#endif 283 } 284 285 return 1; 286} 287#endif /* KDB_STOP_NMI */ 288 | |
289/* 290 * Called by a CPU to restart stopped CPUs. 291 * 292 * Usually (but not necessarily) called with 'stopped_cpus' as its arg. 293 * 294 * - Signals all CPUs in map to restart. 295 * - Waits for each to restart. 296 * --- 125 unchanged lines hidden --- | 257/* 258 * Called by a CPU to restart stopped CPUs. 259 * 260 * Usually (but not necessarily) called with 'stopped_cpus' as its arg. 261 * 262 * - Signals all CPUs in map to restart. 263 * - Waits for each to restart. 264 * --- 125 unchanged lines hidden --- |