Skip to content

Commit 4fb9742

Browse files
committed
acpi, pmm: add get_bios_ebda_addr() helper function
Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
1 parent 02ae26c commit 4fb9742

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

common/acpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static rsdp_rev1_t *acpi_find_rsdp(void) {
103103
uint32_t ebda_addr;
104104
rsdp_rev1_t *rsdp;
105105

106-
ebda_addr = (*(uint16_t *) paddr_to_virt_kern(EBDA_ADDR_ENTRY)) << 4;
106+
ebda_addr = get_bios_ebda_addr();
107107
rsdp =
108108
find_rsdp(paddr_to_virt_kern(ebda_addr), paddr_to_virt_kern(ebda_addr + KB(1)));
109109
if (rsdp)

include/mm/pmm.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ static inline bool in_kernel_section(const void *addr) {
135135
(addr >= _ptr(__start_rodata) && addr < _ptr(__end_rodata));
136136
}
137137

138+
static inline uint32_t get_bios_ebda_addr(void) {
139+
return (*(uint16_t *) paddr_to_virt_kern(EBDA_ADDR_ENTRY)) << 4;
140+
}
141+
138142
#endif /* __ASSEMBLY__ */
139143

140144
#endif /* KTF_PMM_H */

0 commit comments

Comments
 (0)