Browse Source

ACPI: Turn off more prints, return 1 for ThreadId, get the MADT.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Ronald G. Minnich 7 years ago
parent
commit
47d71bcbb5
1 changed files with 10 additions and 2 deletions
  1. 10 2
      sys/src/9/amd64/devacpi.c

+ 10 - 2
sys/src/9/amd64/devacpi.c

@@ -222,6 +222,7 @@ AcpiOsTerminate (
 int
 acpiinit(void)
 {
+	ACPI_TABLE_HEADER *h;
 	int status;
 	status = AcpiInitializeSubsystem();
         if (ACPI_FAILURE(status))
@@ -244,6 +245,10 @@ acpiinit(void)
         if (ACPI_FAILURE(status))
 		panic("Can't Initialize ACPI objects");
 
+	status = AcpiGetTable(ACPI_SIG_MADT, 1, &h);
+        if (ACPI_FAILURE(status))
+		panic("Can't find a MADT");
+
 	return 0;
 }
 
@@ -522,7 +527,7 @@ void
 AcpiOsFree (
     void *                  Memory)
 {
-	print("%s\n", __func__);
+	//print("%s\n", __func__);
 	free(Memory);
 }
 
@@ -530,7 +535,7 @@ void *
 AcpiOsAllocate (
     ACPI_SIZE               Size)
 {
-	print("%s\n", __func__);
+	//print("%s\n", __func__);
 	return malloc(Size);
 }
 
@@ -708,6 +713,9 @@ ACPI_THREAD_ID
 AcpiOsGetThreadId (
     void)
 {
+	/* What to do here? ACPI won't take 0 for an answer.
+	 * I guess tell it we're 1? What do we do? */
+	return 1;
 	//print("%s\n", __func__);
 	Proc *up = externup();
 	return up->pid;