memblock: add functions to convert allocated pointers between virt/phys

This commit is contained in:
2023-02-06 20:39:33 +00:00
parent 6afb3bd10d
commit 998f05d337
2 changed files with 24 additions and 0 deletions

View File

@@ -301,6 +301,20 @@ extern int memblock_free(void *addr, size_t size);
*/
extern int memblock_free_phys(phys_addr_t addr, size_t size);
/* convert a virtual pointer returned by memblock
to a physical address.
@param p the pointer to convert.
*/
extern phys_addr_t memblock_virt_to_phys(void *p);
/* convert a physical address returned by memblock
to a virtual pointer.
@param p the address to convert.
*/
extern void *memblock_phys_to_virt(phys_addr_t p);
extern void __next_memory_region(memblock_iter_t *it, \
memblock_type_t *type_a, memblock_type_t *type_b,
phys_addr_t start, phys_addr_t end);