Changeset 0321109 in mainline
- Timestamp:
- 2010-05-02T13:45:44Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6193351
- Parents:
- 9150781
- Location:
- kernel/generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/mm/as.h
r9150781 r0321109 229 229 extern as_t *as_create(int); 230 230 extern void as_destroy(as_t *); 231 extern void as_hold(as_t *); 232 extern void as_release(as_t *); 231 233 extern void as_switch(as_t *, as_t *); 232 234 extern int as_page_fault(uintptr_t, pf_access_t, istate_t *); -
kernel/generic/src/mm/as.c
r9150781 r0321109 1 1 /* 2 * Copyright (c) 20 01-2006Jakub Jermar2 * Copyright (c) 2010 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 258 258 259 259 slab_free(as_slab, as); 260 } 261 262 /** Hold a reference to an address space. 263 * 264 * Holding a reference to an address space prevents destruction of that address 265 * space. 266 * 267 * @param a Address space to be held. 268 */ 269 void as_hold(as_t *as) 270 { 271 atomic_inc(&as->refcount); 272 } 273 274 /** Release a reference to an address space. 275 * 276 * The last one to release a reference to an address space destroys the address 277 * space. 278 * 279 * @param a Address space to be released. 280 */ 281 void as_release(as_t *as) 282 { 283 if (atomic_predec(&as->refcount) == 0) 284 as_destroy(as); 260 285 } 261 286
Note:
See TracChangeset
for help on using the changeset viewer.