Skip to content

Commit

Permalink
acpi, pmm: add get_bios_ebda_addr() helper function
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
  • Loading branch information
wipawel committed Jul 30, 2021
1 parent 02ae26c commit 4fb9742
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static rsdp_rev1_t *acpi_find_rsdp(void) {
uint32_t ebda_addr;
rsdp_rev1_t *rsdp;

ebda_addr = (*(uint16_t *) paddr_to_virt_kern(EBDA_ADDR_ENTRY)) << 4;
ebda_addr = get_bios_ebda_addr();
rsdp =
find_rsdp(paddr_to_virt_kern(ebda_addr), paddr_to_virt_kern(ebda_addr + KB(1)));
if (rsdp)
Expand Down
4 changes: 4 additions & 0 deletions include/mm/pmm.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ static inline bool in_kernel_section(const void *addr) {
(addr >= _ptr(__start_rodata) && addr < _ptr(__end_rodata));
}

static inline uint32_t get_bios_ebda_addr(void) {
return (*(uint16_t *) paddr_to_virt_kern(EBDA_ADDR_ENTRY)) << 4;
}

#endif /* __ASSEMBLY__ */

#endif /* KTF_PMM_H */

0 comments on commit 4fb9742

Please sign in to comment.