armOS  0.1.0
Minimal ARM Operating System for the Raspberry Pi - Documentation generated for Pi 4.
mm.h
Go to the documentation of this file.
1 
9 #ifndef MM_H
10 #define MM_H
11 
12 #include <stdint.h>
13 
14 #include <peripherals/base.h>
15 
16 #define PAGE_SHIFT 12
17 #define TABLE_SHIFT 9
18 #define SECTION_SHIFT (PAGE_SHIFT + TABLE_SHIFT)
26 #define PAGE_SIZE (1 << PAGE_SHIFT)
27 #define SECTION_SIZE (1 << SECTION_SHIFT)
30 #define LOW_MEMORY (2 * SECTION_SIZE)
32 #define HIGH_MEMORY MMIO_BASE
33 
35 #define PAGING_MEMORY (HIGH_MEMORY - LOW_MEMORY)
37 #define PAGING_PAGES (PAGING_MEMORY / PAGE_SIZE)
39 #ifdef AARCH_32
40 
46 uint32_t get_free_page();
51 void free_page(uint32_t p);
52 #elif AARCH_64
53 
59 uint64_t get_free_page();
64 void free_page(uint64_t p);
65 #endif
66 
69 #endif
get_free_page
uint64_t get_free_page()
Definition: mm.c:22
base.h
Definition of base MMIO registers addresses.
free_page
void free_page(uint64_t p)
Definition: mm.c:41