Subversion Repositories HelenOS

Rev

Rev 2984 | Rev 2986 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2984 Rev 2985
Line 792... Line 792...
792
{
792
{
793
    as_area_t *area;
793
    as_area_t *area;
794
    uintptr_t base;
794
    uintptr_t base;
795
    link_t *cur;
795
    link_t *cur;
796
    ipl_t ipl;
796
    ipl_t ipl;
-
 
797
    int page_flags;
-
 
798
    int old_frame;
-
 
799
 
-
 
800
    /* Flags for the new memory mapping */
-
 
801
    page_flags = area_flags_to_page_flags(flags);
797
 
802
 
798
    ipl = interrupts_disable();
803
    ipl = interrupts_disable();
799
    mutex_lock(&as->lock);
804
    mutex_lock(&as->lock);
800
 
805
 
801
    area = find_area_and_lock(as, address);
806
    area = find_area_and_lock(as, address);
Line 806... Line 811...
806
    }
811
    }
807
 
812
 
808
    if (area->sh_info || area->backend != &anon_backend) {
813
    if (area->sh_info || area->backend != &anon_backend) {
809
        /* Copying shared areas not supported yet */
814
        /* Copying shared areas not supported yet */
810
        /* Copying non-anonymous memory not supported yet */
815
        /* Copying non-anonymous memory not supported yet */
-
 
816
        mutex_unlock(&area->lock);
811
        mutex_unlock(&as->lock);
817
        mutex_unlock(&as->lock);
812
        interrupts_restore(ipl);
818
        interrupts_restore(ipl);
813
        return ENOTSUP;
819
        return ENOTSUP;
814
    }
820
    }
815
 
821
 
Line 837... Line 843...
837
            for (j = 0; j < (count_t) node->value[i]; j++) {
843
            for (j = 0; j < (count_t) node->value[i]; j++) {
838
                page_table_lock(as, false);
844
                page_table_lock(as, false);
839
                pte = page_mapping_find(as, b + j * PAGE_SIZE);
845
                pte = page_mapping_find(as, b + j * PAGE_SIZE);
840
                ASSERT(pte && PTE_VALID(pte) &&
846
                ASSERT(pte && PTE_VALID(pte) &&
841
                    PTE_PRESENT(pte));
847
                    PTE_PRESENT(pte));
-
 
848
                old_frame = PTE_GET_FRAME_ARCH(pte);
842
 
849
 
843
                /* Remove old mapping and insert the new one */
850
                /* Remove old mapping and insert the new one */
844
                page_mapping_remove(as, b + j * PAGE_SIZE);
851
                page_mapping_remove(as, b + j * PAGE_SIZE);
845
                page_mapping_insert(as, b + j * PAGE_SIZE,
852
                page_mapping_insert(as, b + j * PAGE_SIZE,
846
                    PTE_GET_FRAME(pte), flags);
853
                    old_frame, page_flags);
-
 
854
 
847
                page_table_unlock(as, false);
855
                page_table_unlock(as, false);
848
            }
856
            }
849
        }
857
        }
850
    }
858
    }
851
 
859