Changeset f8ddd17 in mainline for kernel/generic/src/mm/as.c
- Timestamp:
- 2006-12-09T20:20:50Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b82a13c
- Parents:
- 9ab9c2ec
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/as.c
r9ab9c2ec rf8ddd17 167 167 as->page_table = page_table_create(flags); 168 168 169 #ifdef CONFIG_VIRT_IDX_DCACHE170 as->dcache_flush_on_install = false;171 as->dcache_flush_on_deinstall = false;172 #endif /* CONFIG_VIRT_IDX_DCACHE */173 174 169 return as; 175 170 } … … 278 273 else 279 274 memsetb((uintptr_t) &a->backend_data, sizeof(a->backend_data), 0); 280 281 #ifdef CONFIG_VIRT_IDX_DCACHE282 /*283 * When the area is being created with the AS_AREA_ATTR_PARTIAL flag, the284 * orig_color is probably wrong until the flag is reset. In other words, it is285 * initialized with the color of the area being created and not with the color286 * of the original address space area at the beginning of the share chain. Of287 * course, the correct color is set by as_area_share() before the flag is288 * reset.289 */290 a->orig_color = PAGE_COLOR(base);291 #endif /* CONFIG_VIRT_IDX_DCACHE */292 275 293 276 btree_create(&a->used_space); … … 576 559 * or ENOMEM if there was a problem in allocating destination address space 577 560 * area. ENOTSUP is returned if the address space area backend does not support 578 * sharing. 561 * sharing or if the kernel detects an attempt to create an illegal address 562 * alias. 579 563 */ 580 564 int as_area_share(as_t *src_as, uintptr_t src_base, size_t acc_size, … … 584 568 int src_flags; 585 569 size_t src_size; 586 int src_orig_color;587 570 as_area_t *src_area, *dst_area; 588 571 share_info_t *sh_info; … … 601 584 return ENOENT; 602 585 } 603 604 586 605 587 if (!src_area->backend || !src_area->backend->share) { … … 618 600 src_backend = src_area->backend; 619 601 src_backend_data = src_area->backend_data; 620 src_orig_color = src_area->orig_color;621 602 622 603 /* Share the cacheable flag from the original mapping */ … … 630 611 return EPERM; 631 612 } 613 614 #ifdef CONFIG_VIRT_IDX_DCACHE 615 if (!(dst_flags_mask & AS_AREA_EXEC)) { 616 if (PAGE_COLOR(src_area->base) != PAGE_COLOR(dst_base)) { 617 /* 618 * Refuse to create an illegal address alias. 619 */ 620 mutex_unlock(&src_area->lock); 621 mutex_unlock(&src_as->lock); 622 interrupts_restore(ipl); 623 return ENOTSUP; 624 } 625 } 626 #endif /* CONFIG_VIRT_IDX_DCACHE */ 632 627 633 628 /* … … 683 678 dst_area->attributes &= ~AS_AREA_ATTR_PARTIAL; 684 679 dst_area->sh_info = sh_info; 685 dst_area->orig_color = src_orig_color;686 #ifdef CONFIG_VIRT_IDX_DCACHE687 if (src_orig_color != PAGE_COLOR(dst_base)) {688 /*689 * We have just detected an attempt to create an invalid address690 * alias. We allow this and set a special flag that tells the691 * architecture specific code to flush the D-cache when the692 * offending address space is installed and deinstalled693 * (cleanup).694 *695 * In order for the flags to take effect immediately, we also696 * perform a global D-cache shootdown.697 */698 dcache_shootdown_start();699 dst_as->dcache_flush_on_install = true;700 dst_as->dcache_flush_on_deinstall = true;701 dcache_flush();702 dcache_shootdown_finalize();703 }704 #endif /* CONFIG_VIRT_IDX_DCACHE */705 680 mutex_unlock(&dst_area->lock); 706 681 mutex_unlock(&dst_as->lock);
Note:
See TracChangeset
for help on using the changeset viewer.