White space fixes, detab.
[AROS.git] / rom / kernel / kernel_mm.h
blobe6e98966e24f0527a6a1ad984a27b608cfff607d
1 #include <exec/memory.h>
3 #include <inttypes.h>
5 /*
6 * The following functions operate on 'barebone' memory allocator.
7 * They assume you have appropriate privileges for the allocator to work.
8 * They won't change access rights of the memory they operate on.
10 * This two-level design allows safe boot-time memory initialization.
11 * MMU control structures take up (lots of) memory themselves, and you
12 * need to know where to place them.
13 * To solve this, you first initialize memory allocator, and then allocate
14 * memory for MMU control structures. After the MMU is up, you can manipulate
15 * protection attributes.
17 void *mm_AllocPages(void *addr, uintptr_t length, uint32_t flags, struct KernelBase *KernelBase);
18 void mm_FreePages(void *addr, uintptr_t length, struct KernelBase *KernelBase);
21 * Low-level functions, implemented by the allocator.
22 * They will be different, depending on the allocator implementation.
24 APTR mm_Allocate(struct MemHeader *mh, IPTR size, ULONG flags);
25 APTR mm_AllocAbs(struct MemHeader *mh, void *addr, IPTR size);
26 void mm_Free(struct MemHeader *mh, APTR addr, IPTR size);
27 void mm_StatMemHeader(struct MemHeader *mh, const struct TagItem *query, struct KernelBase *KernelBase);
28 void mm_Init(struct MemHeader *mh, ULONG pageSize);