Changeset 1068f6a in mainline for genarch/src/mm


Ignore:
Timestamp:
2006-05-20T19:32:06Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c1982e45
Parents:
9ea6cc5
Message:

Turn address space lock, address space area lock and
page_ht_lock into mutexes.

Location:
genarch/src/mm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • genarch/src/mm/as_ht.c

    r9ea6cc5 r1068f6a  
    4040#include <memstr.h>
    4141#include <adt/hash_table.h>
    42 #include <synch/spinlock.h>
     42#include <synch/mutex.h>
    4343
    4444static pte_t *ht_create(int flags);
     
    6767        if (flags & FLAG_AS_KERNEL) {
    6868                hash_table_create(&page_ht, PAGE_HT_ENTRIES, 2, &ht_operations);
     69                mutex_initialize(&page_ht_lock);
    6970        }
    7071        return NULL;
     
    8283{
    8384        if (lock)
    84                 spinlock_lock(&as->lock);
    85         spinlock_lock(&page_ht_lock);
     85                mutex_lock(&as->lock);
     86        mutex_lock(&page_ht_lock);
    8687}
    8788
     
    9697void ht_unlock(as_t *as, bool unlock)
    9798{
    98         spinlock_unlock(&page_ht_lock);
     99        mutex_unlock(&page_ht_lock);
    99100        if (unlock)
    100                 spinlock_unlock(&as->lock);
     101                mutex_unlock(&as->lock);
    101102}
  • genarch/src/mm/as_pt.c

    r9ea6cc5 r1068f6a  
    3636#include <mm/frame.h>
    3737#include <mm/as.h>
     38#include <synch/mutex.h>
    3839#include <arch/mm/page.h>
    3940#include <arch/mm/as.h>
     
    7980                 
    8081                ipl = interrupts_disable();
    81                 spinlock_lock(&AS_KERNEL->lock);               
     82                mutex_lock(&AS_KERNEL->lock);           
    8283                src_ptl0 = (pte_t *) PA2KA((__address) AS_KERNEL->page_table);
    8384
     
    8788                memsetb((__address) dst_ptl0, PAGE_SIZE, 0);
    8889                memcpy((void *) dst, (void *) src, PAGE_SIZE - (src - (__address) src_ptl0));
    89                 spinlock_unlock(&AS_KERNEL->lock);
     90                mutex_unlock(&AS_KERNEL->lock);
    9091                interrupts_restore(ipl);
    9192        }
     
    105106{
    106107        if (lock)
    107                 spinlock_lock(&as->lock);
     108                mutex_lock(&as->lock);
    108109}
    109110
     
    119120{
    120121        if (unlock)
    121                 spinlock_unlock(&as->lock);
     122                mutex_unlock(&as->lock);
    122123}
  • genarch/src/mm/asid.c

    r9ea6cc5 r1068f6a  
    5858#include <arch/mm/asid.h>
    5959#include <synch/spinlock.h>
     60#include <synch/mutex.h>
    6061#include <arch.h>
    6162#include <adt/list.h>
     
    104105               
    105106                as = list_get_instance(tmp, as_t, inactive_as_with_asid_link);
    106                 spinlock_lock(&as->lock);
     107                mutex_lock_active(&as->lock);
    107108
    108109                /*
     
    118119                 */
    119120                as->asid = ASID_INVALID;
    120                 spinlock_unlock(&as->lock);
     121                mutex_unlock(&as->lock);
    121122
    122123                /*
  • genarch/src/mm/page_ht.c

    r9ea6cc5 r1068f6a  
    6262 * locks.
    6363 */
    64 SPINLOCK_INITIALIZE(page_ht_lock);
     64mutex_t page_ht_lock;
    6565
    6666/**
Note: See TracChangeset for help on using the changeset viewer.