The manual
ginnOS
The reference: libc, the libraries and the kernel
Toggle main menu visibility
Loading...
Searching...
No Matches
pmm_layout.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
common/stdint.h
"
4
#include "
common/boot/boot_info.h
"
5
#include "
kernel/memory/page.h
"
6
#include "
kernel/memory/phys.h
"
7
8
/**
9
* initialize PMM layout by computing bitmap placement from the E820 map.
10
* must be called after kernel_layout is available and before pmm_init().
11
* @param boot pointer to boot info containing the E820 memory map.
12
*/
13
void
pmm_layout_init
(
boot_info_t
*boot);
14
15
/**
16
* return the start address of the PMM bitmap (page-aligned, after the kernel
17
* and at or above LOW_MEMORY_END).
18
* only valid after pmm_layout_init() has been called.
19
*/
20
phys_addr_t
pmm_bitmap_start
(
void
);
21
22
/**
23
* return the end address of the PMM metadata (exclusive): the bitmap and
24
* the reference-count array after it.
25
* only valid after pmm_layout_init() has been called.
26
*/
27
phys_addr_t
pmm_bitmap_end
(
void
);
28
29
/**
30
* return the start address of the reference-count array (one uint16_t per
31
* page frame, after the bitmap).
32
* only valid after pmm_layout_init() has been called.
33
*/
34
phys_addr_t
pmm_refcount_start
(
void
);
35
36
/**
37
* return the size of the PMM bitmap in bytes.
38
* only valid after pmm_layout_init() has been called.
39
*/
40
size_t
pmm_bitmap_size
(
void
);
41
42
/**
43
* return the total number of page frames the bitmap can track.
44
* only valid after pmm_layout_init() has been called.
45
*/
46
uint32_t
pmm_total_pages
(
void
);
boot_info.h
stdint.h
uint32_t
unsigned int uint32_t
Definition
fb.h:17
page.h
phys.h
phys_addr_t
uintptr_t phys_addr_t
physical addresses and the conversion between physical and virtual.
Definition
phys.h:18
pmm_bitmap_start
phys_addr_t pmm_bitmap_start(void)
return the start address of the PMM bitmap (page-aligned, after the kernel and at or above LOW_MEMORY...
Definition
pmm_layout.c:138
pmm_layout_init
void pmm_layout_init(boot_info_t *boot)
initialize PMM layout by computing bitmap placement from the E820 map.
Definition
pmm_layout.c:79
pmm_refcount_start
phys_addr_t pmm_refcount_start(void)
return the start address of the reference-count array (one uint16_t per page frame,...
Definition
pmm_layout.c:148
pmm_bitmap_end
phys_addr_t pmm_bitmap_end(void)
return the end address of the PMM metadata (exclusive): the bitmap and the reference-count array afte...
Definition
pmm_layout.c:143
pmm_total_pages
uint32_t pmm_total_pages(void)
return the total number of page frames the bitmap can track.
Definition
pmm_layout.c:158
pmm_bitmap_size
size_t pmm_bitmap_size(void)
return the size of the PMM bitmap in bytes.
Definition
pmm_layout.c:153
boot_info_t
information the bootloader hands to the kernel.
Definition
boot_info.h:21
src
kernel
memory
pmm_layout.h
Generated by
1.18.0