Changeset dad5951 in mainline
- Timestamp:
- 2007-01-29T17:28:20Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3802fcd
- Parents:
- 8be8cfa
- Location:
- kernel/generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/mm/as.h
r8be8cfa rdad5951 147 147 extern as_t *as_create(int flags); 148 148 extern void as_destroy(as_t *as); 149 extern void as_switch(as_t *old, as_t * new);149 extern void as_switch(as_t *old, as_t *replace); 150 150 extern int as_page_fault(uintptr_t page, pf_access_t access, istate_t *istate); 151 151 -
kernel/generic/src/mm/as.c
r8be8cfa rdad5951 864 864 * @param new New address space. 865 865 */ 866 void as_switch(as_t *old, as_t * new)866 void as_switch(as_t *old, as_t *replace) 867 867 { 868 868 ipl_t ipl; … … 901 901 * Second, prepare the new address space. 902 902 */ 903 mutex_lock_active(& new->lock);904 if (( new->cpu_refcount++ == 0) && (new!= AS_KERNEL)) {905 if ( new->asid != ASID_INVALID) {906 list_remove(& new->inactive_as_with_asid_link);903 mutex_lock_active(&replace->lock); 904 if ((replace->cpu_refcount++ == 0) && (replace != AS_KERNEL)) { 905 if (replace->asid != ASID_INVALID) { 906 list_remove(&replace->inactive_as_with_asid_link); 907 907 } else { 908 908 /* 909 * Defer call to asid_get() until new->lock is released.909 * Defer call to asid_get() until replace->lock is released. 910 910 */ 911 911 needs_asid = true; 912 912 } 913 913 } 914 SET_PTL0_ADDRESS( new->page_table);915 mutex_unlock(& new->lock);914 SET_PTL0_ADDRESS(replace->page_table); 915 mutex_unlock(&replace->lock); 916 916 917 917 if (needs_asid) { … … 923 923 924 924 asid = asid_get(); 925 mutex_lock_active(& new->lock);926 new->asid = asid;927 mutex_unlock(& new->lock);925 mutex_lock_active(&replace->lock); 926 replace->asid = asid; 927 mutex_unlock(&replace->lock); 928 928 } 929 929 spinlock_unlock(&inactive_as_with_asid_lock); … … 934 934 * (e.g. write ASID to hardware register etc.) 935 935 */ 936 as_install_arch( new);937 938 AS = new;936 as_install_arch(replace); 937 938 AS = replace; 939 939 } 940 940
Note:
See TracChangeset
for help on using the changeset viewer.