summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cpu/x86/mp_init.c6
-rw-r--r--src/include/cpu/x86/mp.h3
2 files changed, 7 insertions, 2 deletions
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c
index f99abaf245..585a54b86d 100644
--- a/src/cpu/x86/mp_init.c
+++ b/src/cpu/x86/mp_init.c
@@ -907,7 +907,9 @@ static int run_ap_work(mp_callback_t func, long expire_us)
mfence();
/* Wait for all the APs to signal back that call has been accepted. */
- stopwatch_init_usecs_expire(&sw, expire_us);
+ if (expire_us > 0)
+ stopwatch_init_usecs_expire(&sw, expire_us);
+
do {
cpus_accepted = 0;
@@ -920,7 +922,7 @@ static int run_ap_work(mp_callback_t func, long expire_us)
if (cpus_accepted == global_num_aps)
return 0;
- } while (!stopwatch_expired(&sw));
+ } while (expire_us <= 0 || !stopwatch_expired(&sw));
printk(BIOS_ERR, "AP call expired. %d/%d CPUs accepted.\n",
cpus_accepted, global_num_aps);
diff --git a/src/include/cpu/x86/mp.h b/src/include/cpu/x86/mp.h
index f6afc84f35..8331956f8a 100644
--- a/src/include/cpu/x86/mp.h
+++ b/src/include/cpu/x86/mp.h
@@ -121,6 +121,9 @@ int mp_init_with_smm(struct bus *cpu_bus, const struct mp_ops *mp_ops);
* After APs are up and PARALLEL_MP_AP_WORK is enabled one can issue work
* to all the APs to perform. Currently the BSP is the only CPU that is allowed
* to issue work. i.e. the APs should not call any of these functions.
+ *
+ * Input parameter expire_us <= 0 to specify an infinite timeout.
+ *
* All functions return < 0 on error, 0 on success.
*/
int mp_run_on_aps(void (*func)(void), long expire_us);