mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-20 06:07:59 +00:00
parent
385b7cdd31
commit
545a397fa6
@ -51,10 +51,12 @@ namespace Genode
|
||||
Platform_pd(char const *label) : _main_thread(0), _label(label)
|
||||
{
|
||||
/* get some aligned space for the kernel object */
|
||||
void * kernel_pd;
|
||||
void * kernel_pd = 0;
|
||||
Range_allocator * ram = platform()->ram_alloc();
|
||||
assert(ram->alloc_aligned(Kernel::pd_size(), &kernel_pd,
|
||||
Kernel::pd_alignm_log2()).is_ok())
|
||||
bool kernel_pd_ok =
|
||||
ram->alloc_aligned(Kernel::pd_size(), &kernel_pd,
|
||||
Kernel::pd_alignm_log2()).is_ok();
|
||||
assert(kernel_pd_ok);
|
||||
|
||||
/* create kernel object */
|
||||
_id = Kernel::new_pd(kernel_pd, this);
|
||||
|
@ -852,12 +852,13 @@ namespace Kernel
|
||||
void handle_pagefault(Thread * const user)
|
||||
{
|
||||
/* check out cause and attributes of abort */
|
||||
addr_t va;
|
||||
bool w;
|
||||
assert(user->translation_miss(va, w));
|
||||
addr_t virt_addr = 0;
|
||||
bool write = 0;
|
||||
bool is_transl_miss = user->translation_miss(virt_addr, write);
|
||||
assert(is_transl_miss);
|
||||
|
||||
/* the user might be able to resolve the pagefault */
|
||||
user->pagefault(va, w);
|
||||
user->pagefault(virt_addr, write);
|
||||
}
|
||||
|
||||
|
||||
|
@ -183,7 +183,7 @@ namespace Kernel
|
||||
*/
|
||||
unsigned alloc()
|
||||
{
|
||||
if (!_valid_id(_first_free_id)) assert(0);
|
||||
assert(_valid_id(_first_free_id));
|
||||
_free[_first_free_id] = 0;
|
||||
unsigned const id = _first_free_id;
|
||||
_first_free_id_assigned();
|
||||
|
@ -71,8 +71,10 @@ Platform_thread::Platform_thread(const char * name,
|
||||
|
||||
/* create UTCB for a core thread */
|
||||
Range_allocator * const ram = platform()->ram_alloc();
|
||||
assert(ram->alloc_aligned(sizeof(Native_utcb), (void **)&_phys_utcb,
|
||||
MIN_MAPPING_SIZE_LOG2).is_ok());
|
||||
bool phys_utcb_ok = ram->alloc_aligned(sizeof(Native_utcb),
|
||||
(void **)&_phys_utcb,
|
||||
MIN_MAPPING_SIZE_LOG2).is_ok();
|
||||
assert(phys_utcb_ok);
|
||||
_virt_utcb = _phys_utcb;
|
||||
|
||||
/* common constructor parts */
|
||||
|
@ -70,14 +70,16 @@ void Ipc_pager::resolve_and_wait_for_fault()
|
||||
_mapping.size_log2, flags);
|
||||
if (sl2)
|
||||
{
|
||||
/* try to get some natural aligned space */
|
||||
void * space;
|
||||
assert(platform()->ram_alloc()->alloc_aligned(1<<sl2, &space, sl2).is_ok());
|
||||
/* try to get some natural aligned RAM */
|
||||
void * ram;
|
||||
bool ram_ok = platform()->ram_alloc()->alloc_aligned(1<<sl2, &ram,
|
||||
sl2).is_ok();
|
||||
assert(ram_ok);
|
||||
|
||||
/* try to translate again with extra space */
|
||||
/* try to translate again with extra RAM */
|
||||
sl2 = tlb->insert_translation(_mapping.virt_address,
|
||||
_mapping.phys_address,
|
||||
_mapping.size_log2, flags, space);
|
||||
_mapping.size_log2, flags, ram);
|
||||
assert(!sl2);
|
||||
}
|
||||
/* wake up faulter */
|
||||
|
Loading…
Reference in New Issue
Block a user