/kernel/trunk/genarch/src/mm/as_ht.c |
---|
39,7 → 39,7 |
#include <typedefs.h> |
#include <memstr.h> |
#include <adt/hash_table.h> |
#include <synch/spinlock.h> |
#include <synch/mutex.h> |
static pte_t *ht_create(int flags); |
66,6 → 66,7 |
{ |
if (flags & FLAG_AS_KERNEL) { |
hash_table_create(&page_ht, PAGE_HT_ENTRIES, 2, &ht_operations); |
mutex_initialize(&page_ht_lock); |
} |
return NULL; |
} |
81,8 → 82,8 |
void ht_lock(as_t *as, bool lock) |
{ |
if (lock) |
spinlock_lock(&as->lock); |
spinlock_lock(&page_ht_lock); |
mutex_lock(&as->lock); |
mutex_lock(&page_ht_lock); |
} |
/** Unlock page table. |
95,7 → 96,7 |
*/ |
void ht_unlock(as_t *as, bool unlock) |
{ |
spinlock_unlock(&page_ht_lock); |
mutex_unlock(&page_ht_lock); |
if (unlock) |
spinlock_unlock(&as->lock); |
mutex_unlock(&as->lock); |
} |
/kernel/trunk/genarch/src/mm/asid.c |
---|
57,6 → 57,7 |
#include <mm/tlb.h> |
#include <arch/mm/asid.h> |
#include <synch/spinlock.h> |
#include <synch/mutex.h> |
#include <arch.h> |
#include <adt/list.h> |
#include <debug.h> |
103,7 → 104,7 |
list_remove(tmp); |
as = list_get_instance(tmp, as_t, inactive_as_with_asid_link); |
spinlock_lock(&as->lock); |
mutex_lock_active(&as->lock); |
/* |
* Steal the ASID. |
117,7 → 118,7 |
* was stolen by invalidating its asid member. |
*/ |
as->asid = ASID_INVALID; |
spinlock_unlock(&as->lock); |
mutex_unlock(&as->lock); |
/* |
* Get the system rid of the stolen ASID. |
/kernel/trunk/genarch/src/mm/as_pt.c |
---|
35,6 → 35,7 |
#include <mm/page.h> |
#include <mm/frame.h> |
#include <mm/as.h> |
#include <synch/mutex.h> |
#include <arch/mm/page.h> |
#include <arch/mm/as.h> |
#include <arch/types.h> |
78,7 → 79,7 |
*/ |
ipl = interrupts_disable(); |
spinlock_lock(&AS_KERNEL->lock); |
mutex_lock(&AS_KERNEL->lock); |
src_ptl0 = (pte_t *) PA2KA((__address) AS_KERNEL->page_table); |
src = (__address) &src_ptl0[PTL0_INDEX(KERNEL_ADDRESS_SPACE_START)]; |
86,7 → 87,7 |
memsetb((__address) dst_ptl0, PAGE_SIZE, 0); |
memcpy((void *) dst, (void *) src, PAGE_SIZE - (src - (__address) src_ptl0)); |
spinlock_unlock(&AS_KERNEL->lock); |
mutex_unlock(&AS_KERNEL->lock); |
interrupts_restore(ipl); |
} |
104,7 → 105,7 |
void pt_lock(as_t *as, bool lock) |
{ |
if (lock) |
spinlock_lock(&as->lock); |
mutex_lock(&as->lock); |
} |
/** Unlock page tables. |
118,5 → 119,5 |
void pt_unlock(as_t *as, bool unlock) |
{ |
if (unlock) |
spinlock_unlock(&as->lock); |
mutex_unlock(&as->lock); |
} |
/kernel/trunk/genarch/src/mm/page_ht.c |
---|
61,7 → 61,7 |
* after address space lock and after any address space area |
* locks. |
*/ |
SPINLOCK_INITIALIZE(page_ht_lock); |
mutex_t page_ht_lock; |
/** |
* Page hash table. |