[coreboot-gerrit] Change in ...coreboot[master]: arch/x86/acpigen.c: Add a method to notify all CPU cores

Arthur Heymans (Code Review) gerrit at coreboot.org
Wed Nov 28 13:36:51 CET 2018


Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/29895


Change subject: arch/x86/acpigen.c: Add a method to notify all CPU cores
......................................................................

arch/x86/acpigen.c: Add a method to notify all CPU cores

Change-Id: If8b07fdcec51c344a82309d4af3b6127ad758baf
Signed-off-by: Arthur Heymans <arthur at aheymans.xyz>
---
M src/arch/x86/acpigen.c
M src/arch/x86/include/arch/acpigen.h
M src/cpu/intel/speedstep/acpi.c
3 files changed, 19 insertions(+), 11 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/95/29895/1

diff --git a/src/arch/x86/acpigen.c b/src/arch/x86/acpigen.c
index 426a542..2bc9b69 100644
--- a/src/arch/x86/acpigen.c
+++ b/src/arch/x86/acpigen.c
@@ -369,6 +369,23 @@
 	acpigen_pop_len();
 }
 
+/* Method to notify all CPU cores */
+void acpigen_write_processor_cnot(const unsigned int number_of_cores)
+{
+	int coreID;
+
+	acpigen_write_method("\\_PR.CNOT", 1);
+	for (coreID = 0; coreID < cores_per_package; coreID++) {
+		char buffer[DEVICE_PATH_MAX];
+		snprintf(buffer, sizeof(buffer), "\\_PR.CP%c%c",
+			 '0' + coreID / 10, '0' + coreID % 10);
+		acpigen_emit_byte(NOTIFY_OP);
+		acpigen_emit_namestring(buffer);
+		acpigen_emit_byte(ARG0_OP);
+	}
+	acpigen_pop_len();
+}
+
 /*
  * Generate ACPI AML code for OperationRegion
  * Arg0: Pointer to struct opregion opreg = OPREGION(rname, space, offset, len)
diff --git a/src/arch/x86/include/arch/acpigen.h b/src/arch/x86/include/arch/acpigen.h
index a27bd6f..d9379eb 100644
--- a/src/arch/x86/include/arch/acpigen.h
+++ b/src/arch/x86/include/arch/acpigen.h
@@ -277,6 +277,7 @@
 void acpigen_write_processor_package(const char *name,
 				     unsigned int first_core,
 				     unsigned int core_count);
+void acpigen_write_processor_cnot(const unsigned int number_of_cores);
 void acpigen_write_TSS_package(int entries, acpi_tstate_t *tstate_list);
 void acpigen_write_TSD_package(u32 domain, u32 numprocs, PSD_coord coordtype);
 void acpigen_write_mem32fixed(int readwrite, u32 base, u32 size);
diff --git a/src/cpu/intel/speedstep/acpi.c b/src/cpu/intel/speedstep/acpi.c
index 0feaa2f..b5e2c9e9 100644
--- a/src/cpu/intel/speedstep/acpi.c
+++ b/src/cpu/intel/speedstep/acpi.c
@@ -166,15 +166,5 @@
 	   of the first and only package. */
 	acpigen_write_processor_package("PPKG", 0, cores_per_package);
 
-	/* Add a method to notify processor nodes */
-	acpigen_write_method("\\_PR.CNOT", 1);
-	for (coreID = 0; coreID < cores_per_package; coreID++) {
-		char buffer[DEVICE_PATH_MAX];
-		snprintf(buffer, sizeof(buffer), "\\_PR.CP%c%c",
-			'0' + coreID / 10, '0' + coreID % 10);
-		acpigen_emit_byte(NOTIFY_OP);
-		acpigen_emit_namestring(buffer);
-		acpigen_emit_byte(ARG0_OP);
-	}
-	acpigen_pop_len();
+	acpigen_write_processor_cnot(cores_per_package);
 }

-- 
To view, visit https://review.coreboot.org/c/coreboot/+/29895
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: If8b07fdcec51c344a82309d4af3b6127ad758baf
Gerrit-Change-Number: 29895
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur at aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur at aheymans.xyz>
Gerrit-Reviewer: Patrick Rudolph <siro at das-labor.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181128/e4fcabed/attachment-0001.html>


More information about the coreboot-gerrit mailing list