}
/*
+ * Debugging/bug-avoidance. Enable ACPI subsystem components. Most
+ * components are enabled by default. The ones that are not have to be
+ * enabled via debug.acpi.enabled.
+ */
+int
+acpi_enabled(char *subsys)
+{
+ char *cp, *env;
+ int len;
+
+ if ((env = kgetenv("debug.acpi.enabled")) == NULL)
+ return (0);
+ if (strcmp(env, "all") == 0) {
+ kfreeenv(env);
+ return (1);
+ }
+
+ /* Scan the enable list, checking for a match. */
+ cp = env;
+ for (;;) {
+ while (*cp != '\0' && isspace(*cp))
+ cp++;
+ if (*cp == '\0')
+ break;
+ len = 0;
+ while (cp[len] != '\0' && !isspace(cp[len]))
+ len++;
+ if (strncmp(cp, subsys, len) == 0) {
+ kfreeenv(env);
+ return (1);
+ }
+ cp += len;
+ }
+ kfreeenv(env);
+
+ return (0);
+}
+
+/*
* Control interface.
*
* We multiplex ioctls for all participating ACPI devices here. Individual
char *acpi_name(ACPI_HANDLE handle);
int acpi_avoid(ACPI_HANDLE handle);
int acpi_disabled(char *subsys);
+int acpi_enabled(char *subsys);
int acpi_machdep_init(device_t dev);
void acpi_install_wakeup_handler(struct acpi_softc *sc);
int acpi_sleep_machdep(struct acpi_softc *sc, int state);