summaryrefslogtreecommitdiff
path: root/kernel/src/memory/memory.h
blob: 5d99025e0443b4ef429db497fb2ee748a69a60ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include <stdint.h>

struct MemorySegment {
    uint64_t addr;
    uint64_t len;
    uint32_t type;
    uint32_t reserved;
} __attribute__((packed));

struct MemoryMap {
    uint32_t entry_size;
    uint32_t entry_version;
    struct MemorySegment entries[];
} __attribute__((packed));

uint32_t memory_total(void);
uint32_t memory_free(void);
uint32_t memory_used(void);

void memory_init(void);