#include <space.h>
Inheritance diagram for Space:
Public Types | |
enum | Status { Insert_ok = 0, Insert_warn_exists, Insert_warn_attrib_upgrade, Insert_err_nomem, Insert_err_exists } |
Return status of v_insert. More... | |
enum | Page_attrib { Page_no_attribs = 0, Page_writable = Pt_entry::Writable, Page_noncacheable = Pt_entry::Noncacheable | Pt_entry::Write_through, Page_user_accessible = Pt_entry::User, Page_all_attribs } |
Attribute masks for page mappings. More... | |
Public Member Functions | |
bool | is_privileged (void) |
Is this task a privileged one? | |
void | make_current () |
void | switchin_context () |
template<typename T> | |
T | peek (T const *addr, bool user_space) |
Read integral type at any virtual address. | |
template<typename T> | |
T | peek_user (T const *addr) |
Read integral type at virtual address in user space. | |
template<typename T> | |
void | poke_user (T *addr, T value) |
Set integral type at virtual address in user space to value. | |
template<typename T> | |
void | copy_from_user (T *kdst, T const *usrc, size_t n) |
Copy integral types from user space to kernel space. | |
template<typename T> | |
void | copy_to_user (T *udst, T const *ksrc, size_t n) |
Copy integral types from kernel space to user space. | |
void | page_map (Address phys, Address virt, Address size, unsigned page_attribs) |
void | page_unmap (Address virt, Address size) |
void | page_protect (Address virt, Address size, unsigned page_attribs) |
Address | kip_address () const |
Get KIP address. | |
void | kmem_update (void *addr) |
Update this address space with an entry from the kernel's shared address space. | |
void | remote_update (const Address, const Space *, const Address, size_t) |
Populate this address space with n PDEs from a remote address space. | |
void | update_small (Address virt, bool flush) |
Update a page in the small space window from Kmem. | |
bool | is_mappable (Address addr, size_t size) |
Check if an memory region may be unmapped or overmapped. | |
int | mapped (Address addr, int need_writable) const |
Address | virt_to_phys (Address virt) const |
Simple page-table lookup. | |
const Pdir * | dir () const |
Space_index | id () const |
Task number. | |
Space_index | chief () const |
Chief Number. | |
void * | operator new (size_t size) |
void | operator delete (void *block) |
Address | virt_to_phys_s0 (void *a) const |
Simple page-table lookup. | |
bool | is_sigma0 (void) const |
Tests if a task is the sigma0 task. | |
unsigned | get_io_counter (void) |
bool | io_lookup (Address) |
~Space () | |
Destructor. | |
Space::Status | v_insert (Address phys, Address virt, size_t size, unsigned page_attribs) |
Insert a page-table entry, or upgrade an existing entry with new attributes. | |
bool | v_lookup (Address virt, Address *phys=0, Address *size=0, unsigned *page_attribs=0) |
Look up a page-table entry. | |
bool | v_delete (Address virt, Address size, unsigned page_attribs=0) |
Delete page-table entries, or some of the entries' attributes. | |
void | ldt_addr (void *addr) |
Address | ldt_addr () const |
void | ldt_size (Mword size) |
Mword | ldt_size () const |
template<> | |
void | copy_from_user (Mword *kdst, Mword const *usrc, size_t n) |
template<> | |
void | copy_to_user (Mword *udst, Mword const *ksrc, size_t n) |
Static Public Member Functions | |
static Space * | id_lookup (Task_num id) |
Lookup space belonging to a task number. | |
static Space * | current () |
Protected Member Functions | |
void | switchin_lipc_kip_pointer () |
Space (unsigned number) | |
Constructor. | |
Protected Attributes | |
Pdir | _dir |
Private Member Functions | |
Space () | |
Space (const Space &) | |
void | remove_from_space_index () |
Remove space from space index. | |
void | switch_ldt () |
void | free_ldt_memory () |
Class Space extends Space_context with insertion and lookup functions.
|
Attribute masks for page mappings.
|
|
Return status of v_insert.
|
|
|
|
|
|
Destructor. Deletes the address space and unregisters it from Space_index. |
|
Constructor. Creates a new address space and registers it with Space_index. Registration may fail (if a task with the given number already exists, or if another thread creates an address space for the same task number concurrently). In this case, the newly-created address space should be deleted again.
|
|
Chief Number.
|
|
|
|
Copy integral types from user space to kernel space.
|
|
|
|
Copy integral types from kernel space to user space.
|
|
|
|
|
|
|
|
|
|
Task number.
|
|
Lookup space belonging to a task number.
|
|
|
|
Check if an memory region may be unmapped or overmapped. In V2-utcb, it returns false if the memory region overlaps the utcb area |
|
Is this task a privileged one?
|
|
Tests if a task is the sigma0 task.
|
|
Get KIP address.
|
|
Update this address space with an entry from the kernel's shared address space. The kernel maintains a 'master' page directory in class Kmem. Use this function when an entry from the master directory needs to be copied into this address space.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Read integral type at any virtual address.
|
|
Read integral type at virtual address in user space.
|
|
Set integral type at virtual address in user space to value.
|
|
Populate this address space with n PDEs from a remote address space. Use this function when a part of another address space needs to be temporarily visible in the current address space (i.e., for long IPC). If one of the PDEs was valid, i.e. non-null, we need a TLB flush.
|
|
Remove space from space index.
|
|
|
|
|
|
|
|
Update a page in the small space window from Kmem.
|
|
Delete page-table entries, or some of the entries' attributes. This function works for one or multiple mappings (in contrast to v_insert!).
|
|
Insert a page-table entry, or upgrade an existing entry with new attributes.
|
|
Look up a page-table entry.
|
|
Simple page-table lookup.
|
|
Simple page-table lookup. This method is similar to Space_context's virt_to_phys(). The difference is that this version handles Sigma0's address space with a special case: For Sigma0, we do not actually consult the page table -- it is meaningless because we create new mappings for Sigma0 transparently; instead, we return the logically-correct result of physical address == virtual address.
|
|
|