Nightloader/i386/legacy-boot/src-asm/drivers/acpi/driver.asm

46 lines
1.1 KiB
NASM

initialize_acpi_driver:
push dword esi
sub esp, 64
mov esi, esp
mov [esi + (64 - 4)], eax
mov [esi + (64 - 8)], ebx
mov [esi + (64 - 12)], ecx
mov [esi + (64 - 16)], edx
mov [esi + (64 - 20)], edi
.get_rsdt:
push ebp
mov ebp, esp
call acpi_search_rsdt
mov esp, ebp
pop ebp
push ebp
mov ebp, esp
push eax
call acpi_enumerate_tables
mov esp, ebp
pop ebp
cmp eax, 0
je .rsdp_not_found
.success:
mov eax, [esi + (64 - 4)]
mov ebx, [esi + (64 - 8)]
mov ecx, [esi + (64 - 12)]
mov edx, [esi + (64 - 16)]
mov edi, [esi + (64 - 20)]
add esp, 64
pop dword esi
ret
.rsdp_not_found:
; todo(debug): Write warning
hlt
%include "drivers/acpi/utility.asm"