diff --git a/include/mm/vmm.h b/include/mm/vmm.h index fbdb927c..114d4117 100644 --- a/include/mm/vmm.h +++ b/include/mm/vmm.h @@ -33,23 +33,24 @@ enum gfp_flags { GFP_IDENT = 0x00000004, GFP_KERNEL_MAP = 0x00000008, }; +typedef enum gfp_flags gfp_flags_t; /* External definitions */ -extern void *get_free_pages(unsigned int order, uint32_t flags); +extern void *get_free_pages(unsigned int order, gfp_flags_t flags); extern void put_pages(void *page, unsigned int order); /* Static definitions */ -static inline void *get_free_page(uint32_t flags) { +static inline void *get_free_page(gfp_flags_t flags) { return get_free_pages(PAGE_ORDER_4K, flags); } -static inline void *get_free_pages_top(unsigned int order, uint32_t flags) { +static inline void *get_free_pages_top(unsigned int order, gfp_flags_t flags) { return get_free_pages(order, flags) + (PAGE_SIZE << order); } -static inline void *get_free_page_top(uint32_t flags) { +static inline void *get_free_page_top(gfp_flags_t flags) { return get_free_page(flags) + PAGE_SIZE; } diff --git a/mm/vmm.c b/mm/vmm.c index fad57929..fedcd89c 100644 --- a/mm/vmm.c +++ b/mm/vmm.c @@ -30,7 +30,7 @@ #include #include -void *get_free_pages(unsigned int order, uint32_t flags) { +void *get_free_pages(unsigned int order, gfp_flags_t flags) { frame_t *frame = get_free_frames(order); void *va = NULL; mfn_t mfn;