Author: jkim
Date: Wed Nov  3 23:16:35 2010
New Revision: 214765
URL: http://svn.freebsd.org/changeset/base/214765

Log:
  Adjust a comment to clarify why \_SB_ and \_TZ_ are defined as device type
  in ACPICA.  Reshuffle the code a bit to make sure this kludge only applies
  to these two specical cases and to make it cleaner.

Modified:
  head/sys/dev/acpica/acpi.c

Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c  Wed Nov  3 22:21:21 2010        (r214764)
+++ head/sys/dev/acpica/acpi.c  Wed Nov  3 23:16:35 2010        (r214765)
@@ -1673,38 +1673,36 @@ acpi_probe_child(ACPI_HANDLE handle, UIN
     ACPI_OBJECT_TYPE type;
     ACPI_HANDLE h;
     device_t bus, child;
+    char *handle_str;
     int order;
-    char *handle_str, **search;
-    static char *scopes[] = {"\\_PR_", "\\_TZ_", "\\_SI_", "\\_SB_", NULL};
 
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
+    if (acpi_disabled("children"))
+       return_ACPI_STATUS (AE_OK);
+
     /* Skip this device if we think we'll have trouble with it. */
     if (acpi_avoid(handle))
        return_ACPI_STATUS (AE_OK);
 
     bus = (device_t)context;
     if (ACPI_SUCCESS(AcpiGetType(handle, &type))) {
+       handle_str = acpi_name(handle);
        switch (type) {
        case ACPI_TYPE_DEVICE:
-       case ACPI_TYPE_PROCESSOR:
-       case ACPI_TYPE_THERMAL:
-       case ACPI_TYPE_POWER:
-           if (acpi_disabled("children"))
-               break;
-
            /*
             * Since we scan from \, be sure to skip system scope objects.
-            * At least \_SB and \_TZ are detected as devices (ACPI-CA bug?)
+            * \_SB_ and \_TZ_ are defined in ACPICA as devices to work around
+            * BIOS bugs.  For example, \_SB_ is to allow \_SB._INI to be run
+            * during the intialization and \_TZ_ is to support Notify() on it.
             */
-           handle_str = acpi_name(handle);
-           for (search = scopes; *search != NULL; search++) {
-               if (strcmp(handle_str, *search) == 0)
-                   break;
-           }
-           if (*search != NULL)
+           if (strcmp(handle_str, "\\_SB_") == 0 ||
+               strcmp(handle_str, "\\_TZ_") == 0)
                break;
-
+           /* FALLTHROUGH */
+       case ACPI_TYPE_PROCESSOR:
+       case ACPI_TYPE_THERMAL:
+       case ACPI_TYPE_POWER:
            /* 
             * Create a placeholder device for this node.  Sort the
             * placeholder so that the probe/attach passes will run
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to