Changes in kernel/generic/src/mm/as.c [8f80c77:402eda5] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/as.c
r8f80c77 r402eda5 239 239 240 240 spinlock_unlock(&asidlock); 241 interrupts_restore(ipl); 242 241 243 242 244 /* … … 265 267 page_table_destroy(NULL); 266 268 #endif 267 268 interrupts_restore(ipl);269 269 270 270 slab_free(as_slab, as); … … 327 327 return NULL; 328 328 329 ipl_t ipl = interrupts_disable();330 329 mutex_lock(&as->lock); 331 330 332 331 if (!check_area_conflicts(as, base, size, NULL)) { 333 332 mutex_unlock(&as->lock); 334 interrupts_restore(ipl);335 333 return NULL; 336 334 } … … 357 355 358 356 mutex_unlock(&as->lock); 359 interrupts_restore(ipl);360 357 361 358 return area; … … 376 373 int as_area_resize(as_t *as, uintptr_t address, size_t size, unsigned int flags) 377 374 { 378 ipl_t ipl = interrupts_disable();379 375 mutex_lock(&as->lock); 380 376 … … 386 382 if (!area) { 387 383 mutex_unlock(&as->lock); 388 interrupts_restore(ipl);389 384 return ENOENT; 390 385 } … … 398 393 mutex_unlock(&area->lock); 399 394 mutex_unlock(&as->lock); 400 interrupts_restore(ipl);401 395 return ENOTSUP; 402 396 } … … 410 404 mutex_unlock(&area->lock); 411 405 mutex_unlock(&as->lock); 412 interrupts_restore(ipl);413 406 return ENOTSUP; 414 407 } … … 422 415 mutex_unlock(&area->lock); 423 416 mutex_unlock(&as->lock); 424 interrupts_restore(ipl);425 417 return EPERM; 426 418 } … … 441 433 * 442 434 */ 443 tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base +444 pages * PAGE_SIZE, area->pages - pages);435 ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, as->asid, 436 area->base + pages * PAGE_SIZE, area->pages - pages); 445 437 446 438 /* … … 536 528 as_invalidate_translation_cache(as, area->base + 537 529 pages * PAGE_SIZE, area->pages - pages); 538 tlb_shootdown_finalize( );530 tlb_shootdown_finalize(ipl); 539 531 540 532 page_table_unlock(as, false); … … 549 541 mutex_unlock(&area->lock); 550 542 mutex_unlock(&as->lock); 551 interrupts_restore(ipl);552 543 return EADDRNOTAVAIL; 553 544 } … … 558 549 mutex_unlock(&area->lock); 559 550 mutex_unlock(&as->lock); 560 interrupts_restore(ipl);561 551 562 552 return 0; … … 573 563 int as_area_destroy(as_t *as, uintptr_t address) 574 564 { 575 ipl_t ipl = interrupts_disable();576 565 mutex_lock(&as->lock); 577 566 … … 579 568 if (!area) { 580 569 mutex_unlock(&as->lock); 581 interrupts_restore(ipl);582 570 return ENOENT; 583 571 } … … 590 578 * Start TLB shootdown sequence. 591 579 */ 592 tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base, area->pages); 580 ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base, 581 area->pages); 593 582 594 583 /* … … 637 626 */ 638 627 as_invalidate_translation_cache(as, area->base, area->pages); 639 tlb_shootdown_finalize( );628 tlb_shootdown_finalize(ipl); 640 629 641 630 page_table_unlock(as, false); … … 659 648 660 649 mutex_unlock(&as->lock); 661 interrupts_restore(ipl);662 650 return 0; 663 651 } … … 690 678 as_t *dst_as, uintptr_t dst_base, unsigned int dst_flags_mask) 691 679 { 692 ipl_t ipl = interrupts_disable();693 680 mutex_lock(&src_as->lock); 694 681 as_area_t *src_area = find_area_and_lock(src_as, src_base); … … 699 686 */ 700 687 mutex_unlock(&src_as->lock); 701 interrupts_restore(ipl);702 688 return ENOENT; 703 689 } … … 711 697 mutex_unlock(&src_area->lock); 712 698 mutex_unlock(&src_as->lock); 713 interrupts_restore(ipl);714 699 return ENOTSUP; 715 700 } … … 728 713 mutex_unlock(&src_area->lock); 729 714 mutex_unlock(&src_as->lock); 730 interrupts_restore(ipl);731 715 return EPERM; 732 716 } … … 777 761 sh_info_remove_reference(sh_info); 778 762 779 interrupts_restore(ipl);780 763 return ENOMEM; 781 764 } … … 794 777 mutex_unlock(&dst_as->lock); 795 778 796 interrupts_restore(ipl);797 798 779 return 0; 799 780 } … … 816 797 }; 817 798 818 ASSERT(interrupts_disabled());819 799 ASSERT(mutex_locked(&area->lock)); 820 800 … … 844 824 unsigned int page_flags = area_flags_to_page_flags(flags); 845 825 846 ipl_t ipl = interrupts_disable();847 826 mutex_lock(&as->lock); 848 827 … … 850 829 if (!area) { 851 830 mutex_unlock(&as->lock); 852 interrupts_restore(ipl);853 831 return ENOENT; 854 832 } … … 859 837 mutex_unlock(&area->lock); 860 838 mutex_unlock(&as->lock); 861 interrupts_restore(ipl);862 839 return ENOTSUP; 863 840 } … … 889 866 * 890 867 */ 891 tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base, area->pages); 868 ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, as->asid, area->base, 869 area->pages); 892 870 893 871 /* … … 936 914 */ 937 915 as_invalidate_translation_cache(as, area->base, area->pages); 938 tlb_shootdown_finalize( );916 tlb_shootdown_finalize(ipl); 939 917 940 918 page_table_unlock(as, false); … … 978 956 mutex_unlock(&area->lock); 979 957 mutex_unlock(&as->lock); 980 interrupts_restore(ipl);981 958 982 959 return 0; … … 1219 1196 unsigned int as_area_get_flags(as_area_t *area) 1220 1197 { 1221 ASSERT(interrupts_disabled());1222 1198 ASSERT(mutex_locked(&area->lock)); 1223 1199 … … 1321 1297 as_area_t *find_area_and_lock(as_t *as, uintptr_t va) 1322 1298 { 1323 ASSERT(interrupts_disabled());1324 1299 ASSERT(mutex_locked(&as->lock)); 1325 1300 … … 1386 1361 as_area_t *avoid_area) 1387 1362 { 1388 ASSERT(interrupts_disabled());1389 1363 ASSERT(mutex_locked(&as->lock)); 1390 1364 … … 1486 1460 size_t size; 1487 1461 1488 ipl_t ipl = interrupts_disable();1489 1462 page_table_lock(AS, true); 1490 1463 as_area_t *src_area = find_area_and_lock(AS, base); … … 1497 1470 1498 1471 page_table_unlock(AS, true); 1499 interrupts_restore(ipl);1500 1472 return size; 1501 1473 } … … 2070 2042 void as_get_area_info(as_t *as, as_area_info_t **obuf, size_t *osize) 2071 2043 { 2072 ipl_t ipl = interrupts_disable();2073 2044 mutex_lock(&as->lock); 2074 2045 … … 2114 2085 2115 2086 mutex_unlock(&as->lock); 2116 interrupts_restore(ipl);2117 2087 2118 2088 *obuf = info; … … 2127 2097 void as_print(as_t *as) 2128 2098 { 2129 ipl_t ipl = interrupts_disable();2130 2099 mutex_lock(&as->lock); 2131 2100 … … 2150 2119 2151 2120 mutex_unlock(&as->lock); 2152 interrupts_restore(ipl);2153 2121 } 2154 2122
Note:
See TracChangeset
for help on using the changeset viewer.