x86_64: init local apic on boot, or legacy pic/pit as fallback
This commit is contained in:
@@ -9,7 +9,7 @@ static struct acpi_rsdp_10 *search_for_rsdp(void)
|
||||
{
|
||||
uint64_t *start = vm_phys_to_virt(0x80000);
|
||||
uint64_t *end = vm_phys_to_virt(0xFFFFF);
|
||||
|
||||
|
||||
for (uint64_t *i = start; i < end; i++) {
|
||||
if (*i == ACPI_SIG_RSDP) {
|
||||
return (struct acpi_rsdp_10 *)i;
|
||||
@@ -24,7 +24,6 @@ static int init_rsdt(void)
|
||||
struct acpi_rsdp_10 *x = search_for_rsdp();
|
||||
|
||||
if (!x) {
|
||||
printk("acpi: not available");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -33,25 +32,23 @@ static int init_rsdt(void)
|
||||
for (unsigned int i = 0; i < sizeof *x; i++) {
|
||||
chksum += b[i];
|
||||
}
|
||||
|
||||
|
||||
if (chksum & 0xFF) {
|
||||
printk("acpi: not available");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (x->r_revision == 2) {
|
||||
chksum = 0;
|
||||
|
||||
|
||||
for (unsigned int i = sizeof *x; i < sizeof(struct acpi_rsdp_20); i++) {
|
||||
chksum += b[i];
|
||||
}
|
||||
|
||||
if (chksum & 0xFF) {
|
||||
printk("acpi: not available");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
memcpy(&rsdp.rsdp_20, x, sizeof rsdp.rsdp_20);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user