[coreboot-gerrit] Change in coreboot[master]: cpu/x86: Add support to run function on single AP
Subrata Banik (Code Review)
gerrit at coreboot.org
Thu May 3 15:46:49 CEST 2018
Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/26034
Change subject: cpu/x86: Add support to run function on single AP
......................................................................
cpu/x86: Add support to run function on single AP
This patch ensures that user can select a specific AP to run
a function.
BUG=b:74436746
BRANCH=none
TEST=Able to run functions over APs with argument.
Change-Id: Iff2f34900ce2a96ef6ff0779b651f25ebfc739ad
Signed-off-by: Subrata Banik <subrata.banik at intel.com>
---
M src/cpu/x86/mp_init.c
M src/include/cpu/x86/mp.h
2 files changed, 23 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/26034/1
diff --git a/src/cpu/x86/mp_init.c b/src/cpu/x86/mp_init.c
index ba3f309..63e57f3 100644
--- a/src/cpu/x86/mp_init.c
+++ b/src/cpu/x86/mp_init.c
@@ -964,6 +964,26 @@
}
}
+static int ap_number;
+static mp_callback_t single_ap_callback;
+
+/* API to run a single function on a give AP with argument */
+static void run_on_single_aps(void *arg)
+{
+ if (cpu_index() != ap_number)
+ return;
+
+ single_ap_callback(arg);
+}
+
+int mp_run_on_this_ap(void (*func)(void *), void *arg, int ap, long expire_us)
+{
+ single_ap_callback = func;
+ /* Set callback AP number */
+ ap_number = ap;
+ return run_ap_work(run_on_single_aps, arg, expire_us);
+}
+
int mp_run_on_aps(void (*func)(void *), void *arg, long expire_us)
{
return run_ap_work(func, arg, expire_us);
diff --git a/src/include/cpu/x86/mp.h b/src/include/cpu/x86/mp.h
index e5bfdd3..df3d5b1 100644
--- a/src/include/cpu/x86/mp.h
+++ b/src/include/cpu/x86/mp.h
@@ -131,6 +131,9 @@
/* Like mp_run_on_aps() but also runs func on BSP. */
int mp_run_on_all_cpus(void (*func)(void *), void *arg, long expire_us);
+/* Like mp_run_on_aps() but only runs on single AP specific by AP number */
+int mp_run_on_this_ap(void (*func)(void *), void *arg, int ap, long expire_us);
+
/*
* Park all APs to prepare for OS boot. This is handled automatically
* by the coreboot infrastructure.
--
To view, visit https://review.coreboot.org/26034
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff2f34900ce2a96ef6ff0779b651f25ebfc739ad
Gerrit-Change-Number: 26034
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180503/4c5f7154/attachment.html>
More information about the coreboot-gerrit
mailing list