20 lines
1.4 KiB
Markdown
20 lines
1.4 KiB
Markdown
|
---
|
||
|
title: "mapping.h"
|
||
|
summary: "handles the memory mappings that an ELF file can request"
|
||
|
---
|
||
|
|
||
|
# `elf_mapping_T` - struct
|
||
|
A mapping describes an area of memory,
|
||
|
that should be copied from the elf file into the RAM and how/where it should be mapped.
|
||
|
|
||
|
| Name | Type | Description |
|
||
|
|----------------|----------|------------------------------------------------------------------------------------------------------------------|
|
||
|
| offset_file | uint64_t | The mappings' start in the elf file |
|
||
|
| offset_virtual | uint64_t | The mappings' start in memory |
|
||
|
| length_file | uint64_t | The mappings' size in the elf file |
|
||
|
| length_virtual | uint64_t | The mappings' size in memory, if this is bigger than _length_file_ the remaining space will be filled with zeros |
|
||
|
|
||
|
# `elf_mappings_apply(mappings, num_mappings, buffer, base, page_map)` - function (void)
|
||
|
Maps all **_mappings_** into **_page_map_** and copies the related data from **_buffer_** (elf file) to the mapped memory.
|
||
|
**_base_** specifies where the mappings should start in the virtual address space.
|