From 1919b8efdc8c19344a0d9a1e992480a121c2cbbd Mon Sep 17 00:00:00 2001 From: Ivan Baravy Date: Tue, 27 Oct 2020 19:32:57 +0000 Subject: [PATCH] fix r8111: Map acpi_apic_base page before access. git-svn-id: svn://kolibrios.org@8119 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/acpi/acpi.inc | 5 +++++ kernel/trunk/kernel.asm | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/kernel/trunk/acpi/acpi.inc b/kernel/trunk/acpi/acpi.inc index da86817925..a91fa09b80 100644 --- a/kernel/trunk/acpi/acpi.inc +++ b/kernel/trunk/acpi/acpi.inc @@ -229,6 +229,11 @@ check_acpi: mov ecx, [eax+ACPI_MADT.Local_IC_Addr] mov [acpi_lapic_base], ecx + push eax + stdcall map_io_mem, ecx, 0x1000, PG_GLOBAL+PG_NOCACHE+PG_SWR + mov [LAPIC_BASE], eax + mov ecx, eax + pop eax mov edi, smpt mov ebx, [ecx+APIC_ID] diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 8d9e96f610..140a16ff50 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -646,9 +646,13 @@ endg mov edi, OS_BASE + 8000h mov ecx, (ap_init16_size + 3) / 4 rep movsd + mov eax, [LAPIC_BASE] + test eax, eax + jnz @f stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_GLOBAL+PG_NOCACHE+PG_SWR mov [LAPIC_BASE], eax - lea edi, [eax+300h] +@@: + lea edi, [eax+APIC_ICRL] mov esi, smpt+4 dec ebx .wake_cpus_loop: