diff options
| author | jruoho <jruoho@NetBSD.org> | 2010-04-20 04:53:22 +0000 |
|---|---|---|
| committer | jruoho <jruoho@NetBSD.org> | 2010-04-20 04:53:22 +0000 |
| commit | b9961a4e198466fe6fe1cba14efe6bb2e7f4e2ee (patch) | |
| tree | bfebfe66a6ccfd97ceb3253bd2843bb1ef5ef7cb /sys | |
| parent | ca8b6091c1ea802eb135fc6c737290cc71617742 (diff) | |
Instruct ACPICA to dynamically allocate the table descriptions in
AcpiInitializeTables() instead of pushing 128 statically allocated
descriptors. This will eliminate also the need to call
AcpiReallocateRootTable().
The rationale for the statically allocated table descriptors is to allow
initialization without virtual/dynamic memory. Later these should be copied
to dynamic memory via AcpiReallocateRootTable(). But since in NetBSD both
functions were called in the very same acpi_probe(), this dance was
completely unnecessary.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/dev/acpi/acpi.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 7051ebc74e6..a292a58aa33 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $NetBSD: acpi.c,v 1.177 2010/04/18 14:07:16 jruoho Exp $ */ +/* $NetBSD: acpi.c,v 1.178 2010/04/20 04:53:22 jruoho Exp $ */ /*- * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.177 2010/04/18 14:07:16 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.178 2010/04/20 04:53:22 jruoho Exp $"); #include "opt_acpi.h" #include "opt_pcifixup.h" @@ -114,8 +114,6 @@ MALLOC_DECLARE(M_ACPI); static int acpi_dbgr = 0x00; #endif -static ACPI_TABLE_DESC acpi_initial_tables[128]; - /* * This is a flag we set when the ACPI subsystem is active. Machine * dependent code may wish to skip other steps (such as attaching @@ -244,6 +242,9 @@ acpi_probe(void) acpi_osd_debugger(); #endif + CTASSERT(TRUE == true); + CTASSERT(FALSE == false); + AcpiGbl_AllMethodsSerialized = false; AcpiGbl_EnableInterpreterSlack = true; @@ -256,20 +257,17 @@ acpi_probe(void) goto fail; } - rv = AcpiInitializeTables(acpi_initial_tables, 128, 0); + /* + * Allocate space for RSDT/XSDT and DSDT, + * but allow resizing if more tables exist. + */ + rv = AcpiInitializeTables(NULL, 2, true); if (ACPI_FAILURE(rv)) { func = "AcpiInitializeTables()"; goto fail; } - rv = AcpiReallocateRootTable(); - - if (ACPI_FAILURE(rv)) { - func = "AcpiReallocateRootTable()"; - goto fail; - } - #ifdef ACPI_DEBUGGER if (acpi_dbgr & ACPI_DBGR_TABLES) acpi_osd_debugger(); |
