]> Zhao Yanbai Git Server - minix.git/commitdiff
Kernel exports DSDP and apic_enabled in machine structure
authorTomas Hruby <tom@minix3.org>
Thu, 2 Sep 2010 15:43:56 +0000 (15:43 +0000)
committerTomas Hruby <tom@minix3.org>
Thu, 2 Sep 2010 15:43:56 +0000 (15:43 +0000)
- kernel exports DSDP (the root pointer where ACPI parsing starts) and
  apic_enabled in the machine structure.

- ACPI driver uses DSDP to locate ACPI in memory. acpi_enabled tell
  PCI driver to query ACPI for IRQ routing information.

include/minix/type.h
kernel/arch/i386/acpi.c
kernel/arch/i386/memory.c
kernel/arch/i386/proto.h

index 97f59dfe75aecc566d9be1762f0dbfb77d12a2c8..c88d8de2e02383df5814a1b9c18bbb7e0df41c71 100644 (file)
@@ -127,6 +127,8 @@ struct machine {
   int padding; /* used to be protected */
   int vdu_ega;
   int vdu_vga;
+  int apic_enabled; /* does the kernel use APIC or not? */
+  phys_bytes   acpi_rsdp; /* where is the acpi RSDP */
 };
 
 struct io_range
index 5e58d764f14ac4529377cc7364112220db65c79a..a3342214c450cab6f84f2ff2ba9f445c00d804ce 100644 (file)
@@ -247,15 +247,19 @@ PRIVATE int get_acpi_rsdp(void)
        if (ebda) {
                ebda <<= 4;
                if(platform_tbl_ptr(ebda, ebda + 0x400, 16, &acpi_rsdp,
-                                       sizeof(acpi_rsdp), acpi_rsdp_test))
+                                       sizeof(acpi_rsdp), &machine.acpi_rsdp,
+                                       acpi_rsdp_test))
                        return 1;
        } 
 
        /* try BIOS read only mem space */
        if(platform_tbl_ptr(0xE0000, 0x100000, 16, &acpi_rsdp,
-                               sizeof(acpi_rsdp), acpi_rsdp_test))
+                               sizeof(acpi_rsdp), &machine.acpi_rsdp,
+                               acpi_rsdp_test))
                return 1;
-
+       
+       machine.acpi_rsdp = 0; /* RSDP cannot be found at this address therefore
+                                 it is a valid negative value */
        return 0;
 }
 
index 51a6d121d6b22e88418c362c8be81f3788d0b8ba..d1d08082cdd7a6130051840a925b6667d2443b10 100644 (file)
@@ -1089,14 +1089,18 @@ PUBLIC int platform_tbl_ptr(phys_bytes start,
                                        unsigned increment,
                                        void * buff,
                                        unsigned size,
+                                       phys_bytes * phys_addr,
                                        int ((* cmp_f)(void *)))
 {
        phys_bytes addr;
 
        for (addr = start; addr < end; addr += increment) {
                phys_copy (addr, vir2phys(buff), size);
-               if (cmp_f(buff))
+               if (cmp_f(buff)) {
+                       if (phys_addr)
+                               *phys_addr = addr;
                        return 1;
+               }
        }
        return 0;
 }
index 7fb05f1b3e8ca57c13f6c586723947fd68d62d18..aa92394cbe357b0ef9f72bda8fd79c32c47947af 100644 (file)
@@ -167,6 +167,7 @@ _PROTOTYPE(int platform_tbl_ptr, (phys_bytes start,
                                        unsigned increment,
                                        void * buff,
                                        unsigned size,
+                                       phys_bytes * phys_addr,
                                        int ((* cmp_f)(void *))));
 
 /* breakpoints.c */