reboot.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. #include <linux/module.h>
  2. #include <linux/reboot.h>
  3. #include <linux/init.h>
  4. #include <linux/pm.h>
  5. #include <linux/efi.h>
  6. #include <acpi/reboot.h>
  7. #include <asm/io.h>
  8. #include <asm/apic.h>
  9. #include <asm/desc.h>
  10. #include <asm/hpet.h>
  11. #include <asm/pgtable.h>
  12. #include <asm/proto.h>
  13. #include <asm/reboot_fixups.h>
  14. #include <asm/reboot.h>
  15. #include <asm/pci_x86.h>
  16. #ifdef CONFIG_X86_32
  17. # include <linux/dmi.h>
  18. # include <linux/ctype.h>
  19. # include <linux/mc146818rtc.h>
  20. #else
  21. # include <asm/iommu.h>
  22. #endif
  23. #include <mach_ipi.h>
  24. /*
  25. * Power off function, if any
  26. */
  27. void (*pm_power_off)(void);
  28. EXPORT_SYMBOL(pm_power_off);
  29. static const struct desc_ptr no_idt = {};
  30. static int reboot_mode;
  31. enum reboot_type reboot_type = BOOT_KBD;
  32. int reboot_force;
  33. #if defined(CONFIG_X86_32) && defined(CONFIG_SMP)
  34. static int reboot_cpu = -1;
  35. #endif
  36. /* This is set by the PCI code if either type 1 or type 2 PCI is detected */
  37. bool port_cf9_safe = false;
  38. /* reboot=b[ios] | s[mp] | t[riple] | k[bd] | e[fi] [, [w]arm | [c]old] | p[ci]
  39. warm Don't set the cold reboot flag
  40. cold Set the cold reboot flag
  41. bios Reboot by jumping through the BIOS (only for X86_32)
  42. smp Reboot by executing reset on BSP or other CPU (only for X86_32)
  43. triple Force a triple fault (init)
  44. kbd Use the keyboard controller. cold reset (default)
  45. acpi Use the RESET_REG in the FADT
  46. efi Use efi reset_system runtime service
  47. pci Use the so-called "PCI reset register", CF9
  48. force Avoid anything that could hang.
  49. */
  50. static int __init reboot_setup(char *str)
  51. {
  52. for (;;) {
  53. switch (*str) {
  54. case 'w':
  55. reboot_mode = 0x1234;
  56. break;
  57. case 'c':
  58. reboot_mode = 0;
  59. break;
  60. #ifdef CONFIG_X86_32
  61. #ifdef CONFIG_SMP
  62. case 's':
  63. if (isdigit(*(str+1))) {
  64. reboot_cpu = (int) (*(str+1) - '0');
  65. if (isdigit(*(str+2)))
  66. reboot_cpu = reboot_cpu*10 + (int)(*(str+2) - '0');
  67. }
  68. /* we will leave sorting out the final value
  69. when we are ready to reboot, since we might not
  70. have set up boot_cpu_id or smp_num_cpu */
  71. break;
  72. #endif /* CONFIG_SMP */
  73. case 'b':
  74. #endif
  75. case 'a':
  76. case 'k':
  77. case 't':
  78. case 'e':
  79. case 'p':
  80. reboot_type = *str;
  81. break;
  82. case 'f':
  83. reboot_force = 1;
  84. break;
  85. }
  86. str = strchr(str, ',');
  87. if (str)
  88. str++;
  89. else
  90. break;
  91. }
  92. return 1;
  93. }
  94. __setup("reboot=", reboot_setup);
  95. #ifdef CONFIG_X86_32
  96. /*
  97. * Reboot options and system auto-detection code provided by
  98. * Dell Inc. so their systems "just work". :-)
  99. */
  100. /*
  101. * Some machines require the "reboot=b" commandline option,
  102. * this quirk makes that automatic.
  103. */
  104. static int __init set_bios_reboot(const struct dmi_system_id *d)
  105. {
  106. if (reboot_type != BOOT_BIOS) {
  107. reboot_type = BOOT_BIOS;
  108. printk(KERN_INFO "%s series board detected. Selecting BIOS-method for reboots.\n", d->ident);
  109. }
  110. return 0;
  111. }
  112. static struct dmi_system_id __initdata reboot_dmi_table[] = {
  113. { /* Handle problems with rebooting on Dell E520's */
  114. .callback = set_bios_reboot,
  115. .ident = "Dell E520",
  116. .matches = {
  117. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  118. DMI_MATCH(DMI_PRODUCT_NAME, "Dell DM061"),
  119. },
  120. },
  121. { /* Handle problems with rebooting on Dell 1300's */
  122. .callback = set_bios_reboot,
  123. .ident = "Dell PowerEdge 1300",
  124. .matches = {
  125. DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
  126. DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1300/"),
  127. },
  128. },
  129. { /* Handle problems with rebooting on Dell 300's */
  130. .callback = set_bios_reboot,
  131. .ident = "Dell PowerEdge 300",
  132. .matches = {
  133. DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
  134. DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 300/"),
  135. },
  136. },
  137. { /* Handle problems with rebooting on Dell Optiplex 745's SFF*/
  138. .callback = set_bios_reboot,
  139. .ident = "Dell OptiPlex 745",
  140. .matches = {
  141. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  142. DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
  143. },
  144. },
  145. { /* Handle problems with rebooting on Dell Optiplex 745's DFF*/
  146. .callback = set_bios_reboot,
  147. .ident = "Dell OptiPlex 745",
  148. .matches = {
  149. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  150. DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
  151. DMI_MATCH(DMI_BOARD_NAME, "0MM599"),
  152. },
  153. },
  154. { /* Handle problems with rebooting on Dell Optiplex 745 with 0KW626 */
  155. .callback = set_bios_reboot,
  156. .ident = "Dell OptiPlex 745",
  157. .matches = {
  158. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  159. DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 745"),
  160. DMI_MATCH(DMI_BOARD_NAME, "0KW626"),
  161. },
  162. },
  163. { /* Handle problems with rebooting on Dell Optiplex 330 with 0KP561 */
  164. .callback = set_bios_reboot,
  165. .ident = "Dell OptiPlex 330",
  166. .matches = {
  167. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  168. DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 330"),
  169. DMI_MATCH(DMI_BOARD_NAME, "0KP561"),
  170. },
  171. },
  172. { /* Handle problems with rebooting on Dell 2400's */
  173. .callback = set_bios_reboot,
  174. .ident = "Dell PowerEdge 2400",
  175. .matches = {
  176. DMI_MATCH(DMI_SYS_VENDOR, "Dell Computer Corporation"),
  177. DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 2400"),
  178. },
  179. },
  180. { /* Handle problems with rebooting on Dell T5400's */
  181. .callback = set_bios_reboot,
  182. .ident = "Dell Precision T5400",
  183. .matches = {
  184. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  185. DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation T5400"),
  186. },
  187. },
  188. { /* Handle problems with rebooting on HP laptops */
  189. .callback = set_bios_reboot,
  190. .ident = "HP Compaq Laptop",
  191. .matches = {
  192. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  193. DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq"),
  194. },
  195. },
  196. { }
  197. };
  198. static int __init reboot_init(void)
  199. {
  200. dmi_check_system(reboot_dmi_table);
  201. return 0;
  202. }
  203. core_initcall(reboot_init);
  204. /* The following code and data reboots the machine by switching to real
  205. mode and jumping to the BIOS reset entry point, as if the CPU has
  206. really been reset. The previous version asked the keyboard
  207. controller to pulse the CPU reset line, which is more thorough, but
  208. doesn't work with at least one type of 486 motherboard. It is easy
  209. to stop this code working; hence the copious comments. */
  210. static const unsigned long long
  211. real_mode_gdt_entries [3] =
  212. {
  213. 0x0000000000000000ULL, /* Null descriptor */
  214. 0x00009b000000ffffULL, /* 16-bit real-mode 64k code at 0x00000000 */
  215. 0x000093000100ffffULL /* 16-bit real-mode 64k data at 0x00000100 */
  216. };
  217. static const struct desc_ptr
  218. real_mode_gdt = { sizeof (real_mode_gdt_entries) - 1, (long)real_mode_gdt_entries },
  219. real_mode_idt = { 0x3ff, 0 };
  220. /* This is 16-bit protected mode code to disable paging and the cache,
  221. switch to real mode and jump to the BIOS reset code.
  222. The instruction that switches to real mode by writing to CR0 must be
  223. followed immediately by a far jump instruction, which set CS to a
  224. valid value for real mode, and flushes the prefetch queue to avoid
  225. running instructions that have already been decoded in protected
  226. mode.
  227. Clears all the flags except ET, especially PG (paging), PE
  228. (protected-mode enable) and TS (task switch for coprocessor state
  229. save). Flushes the TLB after paging has been disabled. Sets CD and
  230. NW, to disable the cache on a 486, and invalidates the cache. This
  231. is more like the state of a 486 after reset. I don't know if
  232. something else should be done for other chips.
  233. More could be done here to set up the registers as if a CPU reset had
  234. occurred; hopefully real BIOSs don't assume much. */
  235. static const unsigned char real_mode_switch [] =
  236. {
  237. 0x66, 0x0f, 0x20, 0xc0, /* movl %cr0,%eax */
  238. 0x66, 0x83, 0xe0, 0x11, /* andl $0x00000011,%eax */
  239. 0x66, 0x0d, 0x00, 0x00, 0x00, 0x60, /* orl $0x60000000,%eax */
  240. 0x66, 0x0f, 0x22, 0xc0, /* movl %eax,%cr0 */
  241. 0x66, 0x0f, 0x22, 0xd8, /* movl %eax,%cr3 */
  242. 0x66, 0x0f, 0x20, 0xc3, /* movl %cr0,%ebx */
  243. 0x66, 0x81, 0xe3, 0x00, 0x00, 0x00, 0x60, /* andl $0x60000000,%ebx */
  244. 0x74, 0x02, /* jz f */
  245. 0x0f, 0x09, /* wbinvd */
  246. 0x24, 0x10, /* f: andb $0x10,al */
  247. 0x66, 0x0f, 0x22, 0xc0 /* movl %eax,%cr0 */
  248. };
  249. static const unsigned char jump_to_bios [] =
  250. {
  251. 0xea, 0x00, 0x00, 0xff, 0xff /* ljmp $0xffff,$0x0000 */
  252. };
  253. /*
  254. * Switch to real mode and then execute the code
  255. * specified by the code and length parameters.
  256. * We assume that length will aways be less that 100!
  257. */
  258. void machine_real_restart(const unsigned char *code, int length)
  259. {
  260. local_irq_disable();
  261. /* Write zero to CMOS register number 0x0f, which the BIOS POST
  262. routine will recognize as telling it to do a proper reboot. (Well
  263. that's what this book in front of me says -- it may only apply to
  264. the Phoenix BIOS though, it's not clear). At the same time,
  265. disable NMIs by setting the top bit in the CMOS address register,
  266. as we're about to do peculiar things to the CPU. I'm not sure if
  267. `outb_p' is needed instead of just `outb'. Use it to be on the
  268. safe side. (Yes, CMOS_WRITE does outb_p's. - Paul G.)
  269. */
  270. spin_lock(&rtc_lock);
  271. CMOS_WRITE(0x00, 0x8f);
  272. spin_unlock(&rtc_lock);
  273. /* Remap the kernel at virtual address zero, as well as offset zero
  274. from the kernel segment. This assumes the kernel segment starts at
  275. virtual address PAGE_OFFSET. */
  276. memcpy(swapper_pg_dir, swapper_pg_dir + KERNEL_PGD_BOUNDARY,
  277. sizeof(swapper_pg_dir [0]) * KERNEL_PGD_PTRS);
  278. /*
  279. * Use `swapper_pg_dir' as our page directory.
  280. */
  281. load_cr3(swapper_pg_dir);
  282. /* Write 0x1234 to absolute memory location 0x472. The BIOS reads
  283. this on booting to tell it to "Bypass memory test (also warm
  284. boot)". This seems like a fairly standard thing that gets set by
  285. REBOOT.COM programs, and the previous reset routine did this
  286. too. */
  287. *((unsigned short *)0x472) = reboot_mode;
  288. /* For the switch to real mode, copy some code to low memory. It has
  289. to be in the first 64k because it is running in 16-bit mode, and it
  290. has to have the same physical and virtual address, because it turns
  291. off paging. Copy it near the end of the first page, out of the way
  292. of BIOS variables. */
  293. memcpy((void *)(0x1000 - sizeof(real_mode_switch) - 100),
  294. real_mode_switch, sizeof (real_mode_switch));
  295. memcpy((void *)(0x1000 - 100), code, length);
  296. /* Set up the IDT for real mode. */
  297. load_idt(&real_mode_idt);
  298. /* Set up a GDT from which we can load segment descriptors for real
  299. mode. The GDT is not used in real mode; it is just needed here to
  300. prepare the descriptors. */
  301. load_gdt(&real_mode_gdt);
  302. /* Load the data segment registers, and thus the descriptors ready for
  303. real mode. The base address of each segment is 0x100, 16 times the
  304. selector value being loaded here. This is so that the segment
  305. registers don't have to be reloaded after switching to real mode:
  306. the values are consistent for real mode operation already. */
  307. __asm__ __volatile__ ("movl $0x0010,%%eax\n"
  308. "\tmovl %%eax,%%ds\n"
  309. "\tmovl %%eax,%%es\n"
  310. "\tmovl %%eax,%%fs\n"
  311. "\tmovl %%eax,%%gs\n"
  312. "\tmovl %%eax,%%ss" : : : "eax");
  313. /* Jump to the 16-bit code that we copied earlier. It disables paging
  314. and the cache, switches to real mode, and jumps to the BIOS reset
  315. entry point. */
  316. __asm__ __volatile__ ("ljmp $0x0008,%0"
  317. :
  318. : "i" ((void *)(0x1000 - sizeof (real_mode_switch) - 100)));
  319. }
  320. #ifdef CONFIG_APM_MODULE
  321. EXPORT_SYMBOL(machine_real_restart);
  322. #endif
  323. #endif /* CONFIG_X86_32 */
  324. static inline void kb_wait(void)
  325. {
  326. int i;
  327. for (i = 0; i < 0x10000; i++) {
  328. if ((inb(0x64) & 0x02) == 0)
  329. break;
  330. udelay(2);
  331. }
  332. }
  333. void __attribute__((weak)) mach_reboot_fixups(void)
  334. {
  335. }
  336. static void native_machine_emergency_restart(void)
  337. {
  338. int i;
  339. /* Tell the BIOS if we want cold or warm reboot */
  340. *((unsigned short *)__va(0x472)) = reboot_mode;
  341. for (;;) {
  342. /* Could also try the reset bit in the Hammer NB */
  343. switch (reboot_type) {
  344. case BOOT_KBD:
  345. mach_reboot_fixups(); /* for board specific fixups */
  346. for (i = 0; i < 10; i++) {
  347. kb_wait();
  348. udelay(50);
  349. outb(0xfe, 0x64); /* pulse reset low */
  350. udelay(50);
  351. }
  352. case BOOT_TRIPLE:
  353. load_idt(&no_idt);
  354. __asm__ __volatile__("int3");
  355. reboot_type = BOOT_KBD;
  356. break;
  357. #ifdef CONFIG_X86_32
  358. case BOOT_BIOS:
  359. machine_real_restart(jump_to_bios, sizeof(jump_to_bios));
  360. reboot_type = BOOT_KBD;
  361. break;
  362. #endif
  363. case BOOT_ACPI:
  364. acpi_reboot();
  365. reboot_type = BOOT_KBD;
  366. break;
  367. case BOOT_EFI:
  368. if (efi_enabled)
  369. efi.reset_system(reboot_mode ?
  370. EFI_RESET_WARM :
  371. EFI_RESET_COLD,
  372. EFI_SUCCESS, 0, NULL);
  373. reboot_type = BOOT_KBD;
  374. break;
  375. case BOOT_CF9:
  376. port_cf9_safe = true;
  377. /* fall through */
  378. case BOOT_CF9_COND:
  379. if (port_cf9_safe) {
  380. u8 cf9 = inb(0xcf9) & ~6;
  381. outb(cf9|2, 0xcf9); /* Request hard reset */
  382. udelay(50);
  383. outb(cf9|6, 0xcf9); /* Actually do the reset */
  384. udelay(50);
  385. }
  386. reboot_type = BOOT_KBD;
  387. break;
  388. }
  389. }
  390. }
  391. void native_machine_shutdown(void)
  392. {
  393. /* Stop the cpus and apics */
  394. #ifdef CONFIG_SMP
  395. /* The boot cpu is always logical cpu 0 */
  396. int reboot_cpu_id = 0;
  397. #ifdef CONFIG_X86_32
  398. /* See if there has been given a command line override */
  399. if ((reboot_cpu != -1) && (reboot_cpu < NR_CPUS) &&
  400. cpu_online(reboot_cpu))
  401. reboot_cpu_id = reboot_cpu;
  402. #endif
  403. /* Make certain the cpu I'm about to reboot on is online */
  404. if (!cpu_online(reboot_cpu_id))
  405. reboot_cpu_id = smp_processor_id();
  406. /* Make certain I only run on the appropriate processor */
  407. set_cpus_allowed_ptr(current, &cpumask_of_cpu(reboot_cpu_id));
  408. /* O.K Now that I'm on the appropriate processor,
  409. * stop all of the others.
  410. */
  411. smp_send_stop();
  412. #endif
  413. lapic_shutdown();
  414. #ifdef CONFIG_X86_IO_APIC
  415. disable_IO_APIC();
  416. #endif
  417. #ifdef CONFIG_HPET_TIMER
  418. hpet_disable();
  419. #endif
  420. #ifdef CONFIG_X86_64
  421. pci_iommu_shutdown();
  422. #endif
  423. }
  424. static void native_machine_restart(char *__unused)
  425. {
  426. printk("machine restart\n");
  427. if (!reboot_force)
  428. machine_shutdown();
  429. machine_emergency_restart();
  430. }
  431. static void native_machine_halt(void)
  432. {
  433. /* stop other cpus and apics */
  434. machine_shutdown();
  435. /* stop this cpu */
  436. stop_this_cpu(NULL);
  437. }
  438. static void native_machine_power_off(void)
  439. {
  440. if (pm_power_off) {
  441. if (!reboot_force)
  442. machine_shutdown();
  443. pm_power_off();
  444. }
  445. }
  446. struct machine_ops machine_ops = {
  447. .power_off = native_machine_power_off,
  448. .shutdown = native_machine_shutdown,
  449. .emergency_restart = native_machine_emergency_restart,
  450. .restart = native_machine_restart,
  451. .halt = native_machine_halt,
  452. #ifdef CONFIG_KEXEC
  453. .crash_shutdown = native_machine_crash_shutdown,
  454. #endif
  455. };
  456. void machine_power_off(void)
  457. {
  458. machine_ops.power_off();
  459. }
  460. void machine_shutdown(void)
  461. {
  462. machine_ops.shutdown();
  463. }
  464. void machine_emergency_restart(void)
  465. {
  466. machine_ops.emergency_restart();
  467. }
  468. void machine_restart(char *cmd)
  469. {
  470. machine_ops.restart(cmd);
  471. }
  472. void machine_halt(void)
  473. {
  474. machine_ops.halt();
  475. }
  476. #ifdef CONFIG_KEXEC
  477. void machine_crash_shutdown(struct pt_regs *regs)
  478. {
  479. machine_ops.crash_shutdown(regs);
  480. }
  481. #endif
  482. #if defined(CONFIG_SMP)
  483. /* This keeps a track of which one is crashing cpu. */
  484. static int crashing_cpu;
  485. static nmi_shootdown_cb shootdown_callback;
  486. static atomic_t waiting_for_crash_ipi;
  487. static int crash_nmi_callback(struct notifier_block *self,
  488. unsigned long val, void *data)
  489. {
  490. int cpu;
  491. if (val != DIE_NMI_IPI)
  492. return NOTIFY_OK;
  493. cpu = raw_smp_processor_id();
  494. /* Don't do anything if this handler is invoked on crashing cpu.
  495. * Otherwise, system will completely hang. Crashing cpu can get
  496. * an NMI if system was initially booted with nmi_watchdog parameter.
  497. */
  498. if (cpu == crashing_cpu)
  499. return NOTIFY_STOP;
  500. local_irq_disable();
  501. shootdown_callback(cpu, (struct die_args *)data);
  502. atomic_dec(&waiting_for_crash_ipi);
  503. /* Assume hlt works */
  504. halt();
  505. for (;;)
  506. cpu_relax();
  507. return 1;
  508. }
  509. static void smp_send_nmi_allbutself(void)
  510. {
  511. cpumask_t mask = cpu_online_map;
  512. cpu_clear(safe_smp_processor_id(), mask);
  513. if (!cpus_empty(mask))
  514. send_IPI_mask(mask, NMI_VECTOR);
  515. }
  516. static struct notifier_block crash_nmi_nb = {
  517. .notifier_call = crash_nmi_callback,
  518. };
  519. /* Halt all other CPUs, calling the specified function on each of them
  520. *
  521. * This function can be used to halt all other CPUs on crash
  522. * or emergency reboot time. The function passed as parameter
  523. * will be called inside a NMI handler on all CPUs.
  524. */
  525. void nmi_shootdown_cpus(nmi_shootdown_cb callback)
  526. {
  527. unsigned long msecs;
  528. local_irq_disable();
  529. /* Make a note of crashing cpu. Will be used in NMI callback.*/
  530. crashing_cpu = safe_smp_processor_id();
  531. shootdown_callback = callback;
  532. atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1);
  533. /* Would it be better to replace the trap vector here? */
  534. if (register_die_notifier(&crash_nmi_nb))
  535. return; /* return what? */
  536. /* Ensure the new callback function is set before sending
  537. * out the NMI
  538. */
  539. wmb();
  540. smp_send_nmi_allbutself();
  541. msecs = 1000; /* Wait at most a second for the other cpus to stop */
  542. while ((atomic_read(&waiting_for_crash_ipi) > 0) && msecs) {
  543. mdelay(1);
  544. msecs--;
  545. }
  546. /* Leave the nmi callback set */
  547. }
  548. #else /* !CONFIG_SMP */
  549. void nmi_shootdown_cpus(nmi_shootdown_cb callback)
  550. {
  551. /* No other CPUs to shoot down */
  552. }
  553. #endif