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