Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1380 → Rev 1379

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