20 #ifndef _COBALT_POSIX_MEMORY_H 21 #define _COBALT_POSIX_MEMORY_H 23 #include <cobalt/kernel/ppd.h> 25 #define cobalt_umm_set_name(__umm, __fmt, __args...) \ 26 xnheap_set_name(&(__umm)->heap, (__fmt), ## __args) 29 void *cobalt_umm_alloc(
struct cobalt_umm *umm, __u32 size)
35 void *cobalt_umm_zalloc(
struct cobalt_umm *umm, __u32 size)
37 return xnheap_zalloc(&umm->heap, size);
41 void cobalt_umm_free(
struct cobalt_umm *umm,
void *p)
47 __u32 cobalt_umm_offset(
struct cobalt_umm *umm,
void *p)
49 return p - xnheap_get_membase(&umm->heap);
52 int cobalt_memdev_init(
void);
54 void cobalt_memdev_cleanup(
void);
56 int cobalt_umm_init(
struct cobalt_umm *umm, u32 size,
57 void (*release)(
struct cobalt_umm *umm));
59 void cobalt_umm_destroy(
struct cobalt_umm *umm);
void xnheap_free(struct xnheap *heap, void *block)
Release a block to a memory heap.
Definition: heap.c:618
void * xnheap_alloc(struct xnheap *heap, size_t size)
Allocate a memory block from a memory heap.
Definition: heap.c:531