X-Git-Url: https://git.libre-soc.org/?p=mesa.git;a=blobdiff_plain;f=src%2Futil%2Fvma.h;h=9bc058a2c58d86a13284db62e1cc1407aeebcf87;hp=ed69914e4cb4750461e69f2b4dc3c64cc6c4f4f6;hb=HEAD;hpb=f19ad5d31fde8c447119c5483b3e3972922e9991 diff --git a/src/util/vma.h b/src/util/vma.h index ed69914e4cb..9bc058a2c58 100644 --- a/src/util/vma.h +++ b/src/util/vma.h @@ -25,6 +25,7 @@ #define _UTIL_VMA_H #include +#include #include "list.h" @@ -34,6 +35,12 @@ extern "C" { struct util_vma_heap { struct list_head holes; + + /** If true, util_vma_heap_alloc will prefer high addresses + * + * Default is true. + */ + bool alloc_high; }; void util_vma_heap_init(struct util_vma_heap *heap, @@ -43,9 +50,15 @@ void util_vma_heap_finish(struct util_vma_heap *heap); uint64_t util_vma_heap_alloc(struct util_vma_heap *heap, uint64_t size, uint64_t alignment); +bool util_vma_heap_alloc_addr(struct util_vma_heap *heap, + uint64_t addr, uint64_t size); + void util_vma_heap_free(struct util_vma_heap *heap, uint64_t offset, uint64_t size); +void util_vma_heap_print(struct util_vma_heap *heap, FILE *fp, + const char *tab, uint64_t total_size); + #ifdef __cplusplus } /* extern C */ #endif