2022-06-15 07:58:14 +00:00
|
|
|
#include <kernaux/memmap.h>
|
|
|
|
|
|
|
|
#include <assert.h>
|
2022-06-15 08:50:16 +00:00
|
|
|
#include <stdbool.h>
|
2022-06-15 07:58:14 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2022-06-15 08:50:16 +00:00
|
|
|
#define SIZE_256MiB ( 256 * 1024 * 1024)
|
|
|
|
#define SIZE_512MiB ( 512 * 1024 * 1024)
|
|
|
|
#define SIZE_1GiB (1024 * 1024 * 1024)
|
2022-06-15 07:58:14 +00:00
|
|
|
|
|
|
|
KernAux_MemMap memmap;
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
KernAux_MemMap_init(memmap, SIZE_1GiB);
|
|
|
|
|
2022-06-15 08:50:16 +00:00
|
|
|
assert(KernAux_MemMap_add_entry(memmap, true, NULL, 0, SIZE_256MiB));
|
|
|
|
assert(KernAux_MemMap_add_entry(memmap, false, "foo", SIZE_256MiB, SIZE_256MiB));
|
|
|
|
assert(KernAux_MemMap_add_entry(memmap, true, "bar", SIZE_512MiB, SIZE_512MiB));
|
|
|
|
|
2022-06-15 09:16:29 +00:00
|
|
|
assert(KernAux_MemMap_finish(memmap));
|
|
|
|
|
2022-06-15 07:58:14 +00:00
|
|
|
return 0;
|
|
|
|
}
|