Changeset 47800e0 in mainline
- Timestamp:
- 2006-05-25T09:03:40Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- baafe71
- Parents:
- 9dfc69a
- Location:
- generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/include/mm/as.h
r9dfc69a r47800e0 77 77 78 78 /** Number of processors on wich is this address space active. */ 79 count_t refcount;79 count_t cpu_refcount; 80 80 81 81 /** B+tree of address space areas. */ … … 135 135 extern as_operations_t *as_operations; 136 136 137 extern spinlock_t as_lock;137 extern spinlock_t inactive_as_with_asid_lock; 138 138 extern link_t inactive_as_with_asid_head; 139 139 -
generic/src/mm/as.c
r9dfc69a r47800e0 84 84 as_operations_t *as_operations = NULL; 85 85 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. */ 87 SPINLOCK_INITIALIZE(inactive_as_with_asid_lock); 88 88 89 89 /** … … 129 129 as->asid = ASID_INVALID; 130 130 131 as-> refcount = 0;131 as->cpu_refcount = 0; 132 132 as->page_table = page_table_create(flags); 133 133 … … 138 138 void as_free(as_t *as) 139 139 { 140 ASSERT(as-> refcount == 0);140 ASSERT(as->cpu_refcount == 0); 141 141 142 142 /* TODO: free as_areas and other resources held by as */ … … 734 734 * 735 735 * Note that this function cannot sleep as it is essentially a part of 736 * thescheduling. Sleeping here would lead to deadlock on wakeup.736 * scheduling. Sleeping here would lead to deadlock on wakeup. 737 737 * 738 738 * @param old Old address space or NULL. … … 745 745 746 746 ipl = interrupts_disable(); 747 spinlock_lock(& as_lock);747 spinlock_lock(&inactive_as_with_asid_lock); 748 748 749 749 /* … … 752 752 if (old) { 753 753 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)) { 756 756 /* 757 757 * The old address space is no longer active on … … 770 770 */ 771 771 mutex_lock_active(&new->lock); 772 if ((new-> refcount++ == 0) && (new != AS_KERNEL)) {772 if ((new->cpu_refcount++ == 0) && (new != AS_KERNEL)) { 773 773 if (new->asid != ASID_INVALID) 774 774 list_remove(&new->inactive_as_with_asid_link); … … 791 791 mutex_unlock(&new->lock); 792 792 } 793 spinlock_unlock(& as_lock);793 spinlock_unlock(&inactive_as_with_asid_lock); 794 794 interrupts_restore(ipl); 795 795
Note:
See TracChangeset
for help on using the changeset viewer.