2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
8 #include <exec/memory.h>
13 * The following functions operate on 'barebone' memory allocator.
14 * They assume you have appropriate privileges for the allocator to work.
15 * They won't change access rights of the memory they operate on.
17 * This two-level design allows safe boot-time memory initialization.
18 * MMU control structures take up (lots of) memory themselves, and you
19 * need to know where to place them.
20 * To solve this, you first initialize memory allocator, and then allocate
21 * memory for MMU control structures. After the MMU is up, you can manipulate
22 * protection attributes.
24 void *mm_AllocPages(void *addr
, uintptr_t length
, uint32_t flags
, struct KernelBase
*KernelBase
);
25 void mm_FreePages(void *addr
, uintptr_t length
, struct KernelBase
*KernelBase
);
28 * Low-level functions, implemented by the allocator.
29 * They will be different, depending on the allocator implementation.
31 APTR
mm_Allocate(struct MemHeader
*mh
, IPTR size
, ULONG flags
);
32 APTR
mm_AllocAbs(struct MemHeader
*mh
, void *addr
, IPTR size
);
33 void mm_Free(struct MemHeader
*mh
, APTR addr
, IPTR size
);
34 void mm_StatMemHeader(struct MemHeader
*mh
, const struct TagItem
*query
, struct KernelBase
*KernelBase
);
35 void mm_Init(struct MemHeader
*mh
, ULONG pageSize
);