memblock: add alignment parameter to alloc functions

This commit is contained in:
2023-02-06 20:38:32 +00:00
parent a72117abcd
commit 6afb3bd10d
4 changed files with 25 additions and 14 deletions

View File

@@ -251,8 +251,11 @@ extern int memblock_reserve(phys_addr_t base, size_t size);
previous calls to memblock_alloc()
@param size the size of the buffer to allocate in bytes.
@param align the alignment to use. for example, an alignment of 4096
will result in the returned pointer being a multiple
of 4096. this must be a power of 2.
*/
extern void *memblock_alloc(size_t size);
extern void *memblock_alloc(size_t size, phys_addr_t align);
/* allocate a block of memory, returning a physical address.
@@ -270,8 +273,11 @@ extern void *memblock_alloc(size_t size);
previous calls to memblock_alloc()
@param size the size of the buffer to allocate in bytes.
@param align the alignment to use. for example, an alignment of 4096
will result in the returned pointer being a multiple
of 4096. this must be a power of 2.
*/
extern phys_addr_t memblock_alloc_phys(size_t size);
extern phys_addr_t memblock_alloc_phys(size_t size, phys_addr_t align);
/* free a block of memory using its virtual address.