Useful patch for ACPI

Antony T Curtis antony.t.curtis at ntlworld.com
Fri Mar 12 14:42:33 PST 2004


Hi guys,

I have a small patch here which allows additional modules be loaded at
boot time along with acpi... Useful for including acpi_video and
acpi_toshiba, just by having:

acpi_modules="acpi_video,acpi_toshiba"

--- 1.4/src/sys/boot/i386/libi386/i386_module.c Tue Aug 26 01:13:21 2003
+++ ?/i386_module.c     Fri Mar 12 22:47:59 2004
@@ -60,6 +60,17 @@

     if (getenv("acpi_load") && (!disabled)) {
        error = mod_load("acpi", NULL, 0, NULL);
+       if (!error && ((rv = getenv("acpi_modules")) != NULL)) {
+           char *nv = index(rv, ',');
+           if ( nv != NULL )
+               *(nv++) = (char) 0;
+           while ( rv != NULL ) {
+               mod_load(rv, NULL, 0, NULL);
+               if ((rv = nv) != NULL)
+               if ((nv = index(rv, ',')) != NULL)
+                   *(nv++) = (char) 0;
+           }
+       }
        if (error != 0)
            printf("ACPI autoload failed - %s\n", strerror(error));


-- 
Antony T Curtis BSc     Unix Analyst Programmer
http://homepage.ntlworld.com/antony.t.curtis/



More information about the freebsd-current mailing list