|
ginnOS
The reference: libc, the libraries and the kernel
|
#include "common/stdint.h"#include "kernel/memory/vma.h"#include "kernel/sync/mutex.h"#include "kernel/cpu/cpu.h"#include "arch/arch.h"Go to the source code of this file.
Data Structures | |
| struct | user_space |
| the user half of an address space: the page tables, the areas (vma.h) and the program break. More... | |
Typedefs | |
| typedef struct user_space | user_space_t |
| the user half of an address space: the page tables, the areas (vma.h) and the program break. | |
Functions | |
| user_space_t * | user_space_create (void) |
| make an empty user space with one user. | |
| user_space_t * | user_space_get (user_space_t *space) |
| add a user to a space (a new thread that shares it). | |
| void | user_space_put (user_space_t *space) |
| remove a user from a space. | |
| void | user_space_activate (user_space_t *space) |
| load the page tables of a space on the core that runs the call, and keep the cpu_mask of the old and the new space right: a TLB shootdown goes to the cores in the mask. | |
| bool | user_space_on_cpu (const user_space_t *space, uint32_t core) |
| true if the core has the space loaded now. | |
| typedef struct user_space user_space_t |
the user half of an address space: the page tables, the areas (vma.h) and the program break.
the threads of a process use one user space together; it is freed when the last of them lets it go.
| user_space_t * user_space_create | ( | void | ) |
make an empty user space with one user.
| user_space_t * user_space_get | ( | user_space_t * | space | ) |
add a user to a space (a new thread that shares it).
| space | the space. |
| void user_space_put | ( | user_space_t * | space | ) |
remove a user from a space.
the last user frees it: its pages, its page tables and the object. a process that lets go of its own space must load other page tables first (user_space_activate), because a thread on another core can free the space at once.
| space | the space, or NULL (nothing is done). |
| void user_space_activate | ( | user_space_t * | space | ) |
load the page tables of a space on the core that runs the call, and keep the cpu_mask of the old and the new space right: a TLB shootdown goes to the cores in the mask.
every change of address space goes through here. call it with interrupts off.
| space | the space, or NULL for the kernel's page tables. |
| bool user_space_on_cpu | ( | const user_space_t * | space, |
| uint32_t | core ) |
true if the core has the space loaded now.
| space | the space. |
| core | the index of the core. |