Kernel exports DSDP and apic_enabled in machine structure

- 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.
This commit is contained in:
Tomas Hruby 2010-09-02 15:43:56 +00:00
parent 344e9221ec
commit 2440ffae49
4 changed files with 15 additions and 4 deletions

View 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

View 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;
}

View 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;
}

View 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 */