Changeset e3c762cd in mainline for generic/src/mm
- Timestamp:
- 2006-05-05T11:59:19Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- de07bcf
- Parents:
- 22cf454d
- Location:
- generic/src/mm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/mm/as.c
r22cf454d re3c762cd 58 58 #include <adt/btree.h> 59 59 #include <proc/task.h> 60 #include <proc/thread.h> 60 61 #include <arch/asm.h> 61 62 #include <panic.h> … … 69 70 #include <arch/types.h> 70 71 #include <typedefs.h> 72 #include <syscall/copy.h> 73 #include <arch/interrupt.h> 71 74 72 75 as_operations_t *as_operations = NULL; … … 478 481 * 479 482 * @param page Faulting page. 480 * 481 * @return 0 on page fault, 1 on success. 482 */ 483 int as_page_fault(__address page) 483 * @param istate Pointer to interrupted state. 484 * 485 * @return 0 on page fault, 1 on success or 2 if the fault was caused by copy_to_uspace() or copy_from_uspace(). 486 */ 487 int as_page_fault(__address page, istate_t *istate) 484 488 { 485 489 pte_t *pte; … … 497 501 */ 498 502 spinlock_unlock(&AS->lock); 499 return 0;503 goto page_fault; 500 504 } 501 505 … … 507 511 spinlock_unlock(&area->lock); 508 512 spinlock_unlock(&AS->lock); 509 return 0;513 goto page_fault; 510 514 } 511 515 … … 555 559 spinlock_unlock(&area->lock); 556 560 spinlock_unlock(&AS->lock); 557 return 1; 561 return AS_PF_OK; 562 563 page_fault: 564 if (!THREAD) 565 return AS_PF_FAULT; 566 567 if (THREAD->in_copy_from_uspace) { 568 THREAD->in_copy_from_uspace = false; 569 istate_set_retaddr(istate, (__address) &memcpy_from_uspace_failover_address); 570 } else if (THREAD->in_copy_to_uspace) { 571 THREAD->in_copy_to_uspace = false; 572 istate_set_retaddr(istate, (__address) &memcpy_to_uspace_failover_address); 573 } else { 574 return AS_PF_FAULT; 575 } 576 577 return AS_PF_DEFER; 558 578 } 559 579 … … 885 905 { 886 906 as_area_acptsnd_arg_t arg; 887 888 copy_from_uspace(&arg, uspace_accept_arg, sizeof(as_area_acptsnd_arg_t)); 907 int rc; 908 909 rc = copy_from_uspace(&arg, uspace_accept_arg, sizeof(as_area_acptsnd_arg_t)); 910 if (rc != 0) 911 return rc; 889 912 890 913 if (!arg.size) … … 907 930 { 908 931 as_area_acptsnd_arg_t arg; 909 910 copy_from_uspace(&arg, uspace_send_arg, sizeof(as_area_acptsnd_arg_t)); 932 int rc; 933 934 rc = copy_from_uspace(&arg, uspace_send_arg, sizeof(as_area_acptsnd_arg_t)); 935 if (rc != 0) 936 return rc; 911 937 912 938 if (!arg.size) -
generic/src/mm/slab.c
r22cf454d re3c762cd 176 176 slab = data + fsize - sizeof(*slab); 177 177 } 178 178 179 179 /* Fill in slab structures */ 180 180 for (i=0; i < (1 << cache->order); i++) … … 278 278 /* Allow recursion and reclaiming 279 279 * - this should work, as the slab control structures 280 * are small and do not need to alloc te with anything281 * other t en frame_alloc when they are allocating,280 * are small and do not need to allocate with anything 281 * other than frame_alloc when they are allocating, 282 282 * that's why we should get recursion at most 1-level deep 283 283 */ … … 880 880 881 881 ASSERT(_slab_initialized); 882 ASSERT( size && size <= (1 << SLAB_MAX_MALLOC_W));882 ASSERT(size && size <= (1 << SLAB_MAX_MALLOC_W)); 883 883 884 884 if (size < (1 << SLAB_MIN_MALLOC_W)) … … 890 890 } 891 891 892 893 892 void free(void *obj) 894 893 {
Note:
See TracChangeset
for help on using the changeset viewer.
