Subversion Repositories HelenOS-historic

Rev

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

Rev 1044 Rev 1059
Line 64... Line 64...
64
    dst_ptl0 = (pte_t *) PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA | FRAME_PANIC)));
64
    dst_ptl0 = (pte_t *) PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA | FRAME_PANIC)));
65
 
65
 
66
    if (flags & FLAG_AS_KERNEL) {
66
    if (flags & FLAG_AS_KERNEL) {
67
        memsetb((__address) dst_ptl0, PAGE_SIZE, 0);
67
        memsetb((__address) dst_ptl0, PAGE_SIZE, 0);
68
    } else {
68
    } else {
-
 
69
        __address src, dst;
-
 
70
   
69
        /*
71
        /*
70
         * Copy the kernel address space portion to new PTL0.
72
         * Copy the kernel address space portion to new PTL0.
71
         * TODO: copy only kernel address space.
-
 
72
         */
73
         */
73
         
74
         
74
        ipl = interrupts_disable();
75
        ipl = interrupts_disable();
75
        spinlock_lock(&AS_KERNEL->lock);
76
        spinlock_lock(&AS_KERNEL->lock);       
76
        src_ptl0 = (pte_t *) PA2KA((__address) AS_KERNEL->page_table);
77
        src_ptl0 = (pte_t *) PA2KA((__address) AS_KERNEL->page_table);
-
 
78
 
-
 
79
        src = (__address) &src_ptl0[PTL0_INDEX(KERNEL_ADDRESS_SPACE_START)];
-
 
80
        dst = (__address) &dst_ptl0[PTL0_INDEX(KERNEL_ADDRESS_SPACE_START)];
-
 
81
 
77
        memcpy((void *) dst_ptl0,(void *) src_ptl0, PAGE_SIZE);
82
        memsetb((__address) dst_ptl0, PAGE_SIZE, 0);
-
 
83
        memcpy((void *) dst, (void *) src, PAGE_SIZE - (src - (__address) src_ptl0));
78
        spinlock_unlock(&AS_KERNEL->lock);
84
        spinlock_unlock(&AS_KERNEL->lock);
79
        interrupts_restore(ipl);
85
        interrupts_restore(ipl);
80
    }
86
    }
81
 
87
 
82
    return (pte_t *) KA2PA((__address) dst_ptl0);
88
    return (pte_t *) KA2PA((__address) dst_ptl0);