summaryrefslogtreecommitdiff
path: root/api/kernel/memory/range.h
blob: 0084bbb06b1b1135b5cd6cd4a2711a2ffbd81ccc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#include <stdint.h>
#include <stddef.h>

typedef uintptr_t phys_addr_t;

enum memory_range_type
{
    // types for physical pages
    RESERVED_MEMORY,
    SYSTEM_MEMORY,
    AVAILABLE_MEMORY,
    // types for firmware pages with unknown backing
    FIRMWARE_MEMORY,
    // types for other addresses that are not physical
    MMIO_MEMORY,
    INVALID_MEMORY = 0xff
};

struct memory_range
{
    enum memory_range_type type;
    phys_addr_t base;
    size_t size;
};