#include <stddef.h>
Go to the source code of this file.
|
#define | BLK_SZ 4096 |
| Page size of the architecture.
|
|
◆ alloc_memory()
void* alloc_memory |
( |
int |
num_pages | ) |
|
Allocates pages of memory
- Parameters
-
num_pages | The number of pages to allocate |
- Returns
- the start address of the pages
◆ alloc_memory_virt()
void alloc_memory_virt |
( |
int |
num_pages, |
|
|
void * |
addr |
|
) |
| |
Allocates pages of memory at a specified start address
- Parameters
-
num_pages | The number of pages to allocate |
addr | The start address of the pages |
◆ copy_data()
void copy_data |
( |
void * |
address_space, |
|
|
void * |
data, |
|
|
size_t |
size, |
|
|
void * |
virt_addr |
|
) |
| |
Copy data into an address space at a specified virtual address
- Parameters
-
address_space | The adress space to copy data to. |
data | The data to copy |
size | The size of the data |
virt_addr | The address to copy the data to in the address space |
◆ map_phys()
void* map_phys |
( |
void * |
phys_addr, |
|
|
size_t |
num_pages |
|
) |
| |
Map physical pages into virtual memory
- Parameters
-
phys_addr | the start of the physical memory block to map |
num_pages | the number of pages to map |
- Returns
- the start address of the mapping in virtual memory
◆ new_address_space()
void* new_address_space |
( |
| ) |
|
Creates a new address space with kernel mappings
- Returns
- a pointer to the new address space in physical memory
◆ put_data()
void* put_data |
( |
void * |
address_space, |
|
|
void * |
data, |
|
|
size_t |
size |
|
) |
| |
Put data into an address space at an unknown virtual address
- Parameters
-
address_space | The adress space to copy data to. |
data | The data to copy |
size | The size of the data |
- Returns
- The address that the data was copied to.