Changeset 47800e0 in mainline


Ignore:
Timestamp:
2006-05-25T09:03:40Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
baafe71
Parents:
9dfc69a
Message:

Some renaming to prevent confusion.
as_lock → inactive_as_with_asid_lock
as_t::refcount → as_t::cpu_refcount

Location:
generic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • generic/include/mm/as.h

    r9dfc69a r47800e0  
    7777
    7878        /** Number of processors on wich is this address space active. */
    79         count_t refcount;
     79        count_t cpu_refcount;
    8080
    8181        /** B+tree of address space areas. */
     
    135135extern as_operations_t *as_operations;
    136136
    137 extern spinlock_t as_lock;
     137extern spinlock_t inactive_as_with_asid_lock;
    138138extern link_t inactive_as_with_asid_head;
    139139
  • generic/src/mm/as.c

    r9dfc69a r47800e0  
    8484as_operations_t *as_operations = NULL;
    8585
    86 /** Address space lock. It protects inactive_as_with_asid_head. Must be acquired before as_t mutex. */
    87 SPINLOCK_INITIALIZE(as_lock);
     86/** This lock protects inactive_as_with_asid_head list. It must be acquired before as_t mutex. */
     87SPINLOCK_INITIALIZE(inactive_as_with_asid_lock);
    8888
    8989/**
     
    129129                as->asid = ASID_INVALID;
    130130       
    131         as->refcount = 0;
     131        as->cpu_refcount = 0;
    132132        as->page_table = page_table_create(flags);
    133133
     
    138138void as_free(as_t *as)
    139139{
    140         ASSERT(as->refcount == 0);
     140        ASSERT(as->cpu_refcount == 0);
    141141
    142142        /* TODO: free as_areas and other resources held by as */
     
    734734 *
    735735 * Note that this function cannot sleep as it is essentially a part of
    736  * the scheduling. Sleeping here would lead to deadlock on wakeup.
     736 * scheduling. Sleeping here would lead to deadlock on wakeup.
    737737 *
    738738 * @param old Old address space or NULL.
     
    745745       
    746746        ipl = interrupts_disable();
    747         spinlock_lock(&as_lock);
     747        spinlock_lock(&inactive_as_with_asid_lock);
    748748
    749749        /*
     
    752752        if (old) {
    753753                mutex_lock_active(&old->lock);
    754                 ASSERT(old->refcount);
    755                 if((--old->refcount == 0) && (old != AS_KERNEL)) {
     754                ASSERT(old->cpu_refcount);
     755                if((--old->cpu_refcount == 0) && (old != AS_KERNEL)) {
    756756                        /*
    757757                         * The old address space is no longer active on
     
    770770         */
    771771        mutex_lock_active(&new->lock);
    772         if ((new->refcount++ == 0) && (new != AS_KERNEL)) {
     772        if ((new->cpu_refcount++ == 0) && (new != AS_KERNEL)) {
    773773                if (new->asid != ASID_INVALID)
    774774                        list_remove(&new->inactive_as_with_asid_link);
     
    791791                mutex_unlock(&new->lock);
    792792        }
    793         spinlock_unlock(&as_lock);
     793        spinlock_unlock(&inactive_as_with_asid_lock);
    794794        interrupts_restore(ipl);
    795795       
Note: See TracChangeset for help on using the changeset viewer.