Changeset 5a7d9d1 in mainline for generic/src/mm/as.c
- Timestamp:
- 2006-03-17T10:07:28Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4e49572
- Parents:
- 226a654
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/mm/as.c
r226a654 r5a7d9d1 52 52 #include <debug.h> 53 53 #include <memstr.h> 54 #include <macros.h> 54 55 #include <arch.h> 55 56 #include <print.h> … … 538 539 as_area_t *a; 539 540 541 /* 542 * We don't want any area to have conflicts with NULL page. 543 */ 544 if (overlaps(va, size, NULL, PAGE_SIZE)) 545 return false; 546 540 547 for (cur = as->as_area_head.next; cur != &as->as_area_head; cur = cur->next) { 541 __address start;542 __address end;548 __address a_start; 549 size_t a_size; 543 550 544 551 a = list_get_instance(cur, as_area_t, link); … … 548 555 spinlock_lock(&a->lock); 549 556 550 start = a->base;551 end = a->base + a->pages * PAGE_SIZE - 1;557 a_start = a->base; 558 a_size = a->pages * PAGE_SIZE; 552 559 553 560 spinlock_unlock(&a->lock); 554 561 555 if ((va >= start) && (va <= end)) { 556 /* 557 * Tested area is inside another area. 558 */ 559 return false; 560 } 561 562 if ((start >= va) && (start < va + size)) { 563 /* 564 * Another area starts in tested area. 565 */ 566 return false; 567 } 568 569 if ((end >= va) && (end < va + size)) { 570 /* 571 * Another area ends in tested area. 572 */ 573 return false; 574 } 575 562 if (overlaps(va, size, a_start, a_size)) 563 return false; 564 565 } 566 567 /* 568 * So far, the area does not conflict with other areas. 569 * Check if it doesn't conflict with kernel address space. 570 */ 571 if (!KERNEL_ADDRESS_SPACE_SHADOWED) { 572 return !overlaps(va, size, 573 KERNEL_ADDRESS_SPACE_START, KERNEL_ADDRESS_SPACE_END-KERNEL_ADDRESS_SPACE_START); 576 574 } 577 575
Note:
See TracChangeset
for help on using the changeset viewer.