Changes in kernel/generic/src/mm/as.c [1624aae:d99c1d2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/as.c
r1624aae rd99c1d2 1 1 /* 2 * Copyright (c) 20 10Jakub Jermar2 * Copyright (c) 2001-2006 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 152 152 * reference count never drops to zero. 153 153 */ 154 a s_hold(AS_KERNEL);154 atomic_set(&AS_KERNEL->refcount, 1); 155 155 } 156 156 … … 200 200 DEADLOCK_PROBE_INIT(p_asidlock); 201 201 202 ASSERT(as != AS);203 202 ASSERT(atomic_get(&as->refcount) == 0); 204 203 205 204 /* 206 * Since there is no reference to this a ddress space, it is safe not to207 * lock its mutex.205 * Since there is no reference to this area, 206 * it is safe not to lock its mutex. 208 207 */ 209 208 … … 226 225 preemption_enable(); /* Interrupts disabled, enable preemption */ 227 226 if (as->asid != ASID_INVALID && as != AS_KERNEL) { 228 if (as ->cpu_refcount == 0)227 if (as != AS && as->cpu_refcount == 0) 229 228 list_remove(&as->inactive_as_with_asid_link); 230 229 asid_put(as->asid); … … 259 258 260 259 slab_free(as_slab, as); 261 }262 263 /** Hold a reference to an address space.264 *265 * Holding a reference to an address space prevents destruction of that address266 * space.267 *268 * @param a Address space to be held.269 */270 void as_hold(as_t *as)271 {272 atomic_inc(&as->refcount);273 }274 275 /** Release a reference to an address space.276 *277 * The last one to release a reference to an address space destroys the address278 * space.279 *280 * @param a Address space to be released.281 */282 void as_release(as_t *as)283 {284 if (atomic_predec(&as->refcount) == 0)285 as_destroy(as);286 260 } 287 261
Note:
See TracChangeset
for help on using the changeset viewer.