Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi Instruct ACPICA to dynamically allocate the tab...



details:   https://anonhg.NetBSD.org/src/rev/a27a795da271
branches:  trunk
changeset: 754096:a27a795da271
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Tue Apr 20 04:53:22 2010 +0000

description:
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:

 sys/dev/acpi/acpi.c |  22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diffs (63 lines):

diff -r a05bc7d1cf84 -r a27a795da271 sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c       Tue Apr 20 02:01:13 2010 +0000
+++ b/sys/dev/acpi/acpi.c       Tue Apr 20 04:53:22 2010 +0000
@@ -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 @@
 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_osd_debugger();
 #endif
 
+       CTASSERT(TRUE == true);
+       CTASSERT(FALSE == false);
+
        AcpiGbl_AllMethodsSerialized = false;
        AcpiGbl_EnableInterpreterSlack = true;
 
@@ -256,20 +257,17 @@
                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();



Home | Main Index | Thread Index | Old Index