|
ginnOS
The reference: libc, the libraries and the kernel
|
Functions | |
| void | vma_table_init (vma_table_t *table) |
| empty a table. | |
| void | vma_table_copy (vma_table_t *dst, const vma_table_t *src) |
| copy the areas of one table into another (fork). | |
| kerr_t | vma_insert (vma_table_t *table, uintptr_t start, uintptr_t end, uint32_t prot, vma_kind_t kind) |
| add an area. | |
| kerr_t | vma_insert_locked (vma_table_t *table, uintptr_t start, uintptr_t end, uint32_t prot, vma_kind_t kind) |
| vma_insert() for a caller that holds the table's lock. | |
| vma_t * | vma_find (vma_table_t *table, uintptr_t addr) |
| find the area containing an address. | |
| vma_t * | vma_find_kind (vma_table_t *table, vma_kind_t kind) |
| find the first area of a kind. | |
| bool | vma_range_free (const vma_table_t *table, uintptr_t start, uintptr_t end) |
| check that no area overlaps a range. | |
| uintptr_t | vma_find_free (const vma_table_t *table, size_t length, uintptr_t low, uintptr_t high) |
| find the lowest free gap of a given size inside [low, high). | |
| kerr_t | vma_remove (vma_table_t *table, uintptr_t start, uintptr_t end) |
| unmap [start, end) from the table: areas inside it are removed, areas crossing its edges are trimmed, and an area containing it is split in two. | |
| kerr_t | vma_remove_locked (vma_table_t *table, uintptr_t start, uintptr_t end) |
| vma_remove() for a caller that holds the table's lock. | |
| kerr_t | vma_protect (vma_table_t *table, uintptr_t start, uintptr_t end, uint32_t prot) |
| change the protection of [start, end). | |
| kerr_t | vma_protect_locked (vma_table_t *table, uintptr_t start, uintptr_t end, uint32_t prot) |
| vma_protect() for a caller that holds the table's lock. | |
| void vma_table_init | ( | vma_table_t * | table | ) |
empty a table.
| table | the table. |
| void vma_table_copy | ( | vma_table_t * | dst, |
| const vma_table_t * | src ) |
copy the areas of one table into another (fork).
the source's lock is held by the caller; the destination is not in use yet.
| dst | the new table. |
| src | the table to copy. |
| kerr_t vma_insert | ( | vma_table_t * | table, |
| uintptr_t | start, | ||
| uintptr_t | end, | ||
| uint32_t | prot, | ||
| vma_kind_t | kind ) |
add an area.
| table | the table. |
| start | first byte (page-aligned). |
| end | first byte past the area (page-aligned, > start). |
| prot | PROT_* bits. |
| kind | what backs it. |
| kerr_t vma_insert_locked | ( | vma_table_t * | table, |
| uintptr_t | start, | ||
| uintptr_t | end, | ||
| uint32_t | prot, | ||
| vma_kind_t | kind ) |
vma_insert() for a caller that holds the table's lock.
| vma_t * vma_find | ( | vma_table_t * | table, |
| uintptr_t | addr ) |
find the area containing an address.
| table | the table. |
| addr | the address. |
| vma_t * vma_find_kind | ( | vma_table_t * | table, |
| vma_kind_t | kind ) |
find the first area of a kind.
| table | the table. |
| kind | the kind. |
| bool vma_range_free | ( | const vma_table_t * | table, |
| uintptr_t | start, | ||
| uintptr_t | end ) |
check that no area overlaps a range.
| table | the table. |
| start | first byte of the range. |
| end | first byte past the range. |
| uintptr_t vma_find_free | ( | const vma_table_t * | table, |
| size_t | length, | ||
| uintptr_t | low, | ||
| uintptr_t | high ) |
find the lowest free gap of a given size inside [low, high).
| table | the table. |
| length | bytes needed (page-aligned). |
| low | lowest acceptable start (page-aligned). |
| high | first byte past the acceptable range. |
| kerr_t vma_remove | ( | vma_table_t * | table, |
| uintptr_t | start, | ||
| uintptr_t | end ) |
unmap [start, end) from the table: areas inside it are removed, areas crossing its edges are trimmed, and an area containing it is split in two.
| table | the table. |
| start | first byte (page-aligned). |
| end | first byte past the range (page-aligned). |
| kerr_t vma_remove_locked | ( | vma_table_t * | table, |
| uintptr_t | start, | ||
| uintptr_t | end ) |
vma_remove() for a caller that holds the table's lock.
| kerr_t vma_protect | ( | vma_table_t * | table, |
| uintptr_t | start, | ||
| uintptr_t | end, | ||
| uint32_t | prot ) |
change the protection of [start, end).
every byte of the range must be in some area; areas crossing its edges are split so only the range changes.
| table | the table. |
| start | first byte (page-aligned). |
| end | first byte past the range (page-aligned). |
| prot | the new PROT_* bits. |
| kerr_t vma_protect_locked | ( | vma_table_t * | table, |
| uintptr_t | start, | ||
| uintptr_t | end, | ||
| uint32_t | prot ) |
vma_protect() for a caller that holds the table's lock.