/* SPDX-License-Identifier: BSD-2-Clause */

#include <tilck/common/basic_defs.h>
#include <tilck/common/printk.h>

#include <tilck/kernel/sched.h>

#include "osl.h"
#include <3rd_party/acpi/acpi.h>
#include <3rd_party/acpi/acexcep.h>

void
early_init_acpi_module(void)
{
   ACPI_STATUS rc;

   rc = AcpiInitializeSubsystem();

   if (rc != AE_OK)
      panic("AcpiInitializeSubsystem() failed with: %d", rc);

   rc = AcpiInitializeTables(NULL, 0, true);

   if (rc != AE_OK)
      panic("AcpiInitializeTables() failed with: %d", rc);
}

/* SPDX-License-Identifier: BSD-2-Clause */

#include <tilck/common/basic_defs.h>
#include <tilck/common/printk.h>

#include <tilck/kernel/sched.h>

#include "osl.h"
#include <3rd_party/acpi/acpi.h>
#include <3rd_party/acpi/acexcep.h>

static ACPI_TABLE_DESC acpi_tables[16];

void
early_init_acpi_module(void)
{
   ACPI_STATUS rc;

   rc = AcpiInitializeSubsystem();

   if (rc != AE_OK)
      panic("AcpiInitializeSubsystem() failed with: %d", rc);

   rc = AcpiInitializeTables(acpi_tables, 16, false);

   if (rc != AE_OK)
      panic("AcpiInitializeTables() failed with: %d", rc);
}

--- 
+++ 
@@ -9,8 +9,6 @@
 #include <3rd_party/acpi/acpi.h>
 #include <3rd_party/acpi/acexcep.h>
 
-static ACPI_TABLE_DESC acpi_tables[16];
-
 void
 early_init_acpi_module(void)
 {
@@ -21,7 +19,7 @@
    if (rc != AE_OK)
       panic("AcpiInitializeSubsystem() failed with: %d", rc);
 
-   rc = AcpiInitializeTables(acpi_tables, 16, false);
+   rc = AcpiInitializeTables(NULL, 0, true);
 
    if (rc != AE_OK)
       panic("AcpiInitializeTables() failed with: %d", rc);
[acpi] Make AcpiInitializeTables to dynamically alloc tables
