static void wakeup_ap (void) { u8 buf[5]; u8 *p; /* Put a "ljmpw" instruction to the physical address 0 to avoid the alignment restriction of the SIPI. */ p = mapmem_hphys (0, 5, MAPMEM_WRITE); memcpy (buf, p, 5); p[0] = 0xEA; /* ljmpw */ p[1] = wakeup_entry_addr & 0xF; p[2] = 0; p[3] = wakeup_entry_addr >> 4; p[4] = wakeup_entry_addr >> 12; ap_start_addr (0, wakeup_ap_loopcond, NULL); memcpy (p, buf, 5); unmapmem (p, 5); }
static void wakeup_ap (void) { u8 buf[5]; u8 *p; /* Do nothing if no APs were started before suspend. It is * true when there is only one logical processor for real or * the guest OS uses BSP only on UEFI systems. */ if (num_of_processors + 1 == 1) return; /* Put a "ljmpw" instruction to the physical address 0 to avoid the alignment restriction of the SIPI. */ p = mapmem_hphys (0, 5, MAPMEM_WRITE); memcpy (buf, p, 5); p[0] = 0xEA; /* ljmpw */ p[1] = wakeup_entry_addr & 0xF; p[2] = 0; p[3] = wakeup_entry_addr >> 4; p[4] = wakeup_entry_addr >> 12; ap_start_addr (0, wakeup_ap_loopcond, NULL); memcpy (p, buf, 5); unmapmem (p, 5); }