Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/mm/as_pt.c

    rf18d01b6 re2a0d76  
    7373pte_t *ptl0_create(unsigned int flags)
    7474{
    75         pte_t *dst_ptl0 = (pte_t *)
    76             PA2KA(frame_alloc(PTL0_FRAMES, FRAME_LOWMEM, PTL0_SIZE - 1));
     75        pte_t *dst_ptl0 = (pte_t *) PA2KA(frame_alloc(PTL0_SIZE,
     76            FRAME_LOWMEM, 0));
     77        size_t table_size = FRAME_SIZE << PTL0_SIZE;
    7778       
    7879        if (flags & FLAG_AS_KERNEL)
    79                 memsetb(dst_ptl0, PTL0_SIZE, 0);
     80                memsetb(dst_ptl0, table_size, 0);
    8081        else {
    8182                /*
     
    9394                    &dst_ptl0[PTL0_INDEX(KERNEL_ADDRESS_SPACE_START)];
    9495               
    95                 memsetb(dst_ptl0, PTL0_SIZE, 0);
     96                memsetb(dst_ptl0, table_size, 0);
    9697                memcpy((void *) dst, (void *) src,
    97                     PTL0_SIZE - (src - (uintptr_t) src_ptl0));
     98                    table_size - (src - (uintptr_t) src_ptl0));
    9899               
    99100                mutex_unlock(&AS_KERNEL->lock);
     
    112113void ptl0_destroy(pte_t *page_table)
    113114{
    114         frame_free((uintptr_t) page_table, PTL0_FRAMES);
     115        frame_free((uintptr_t) page_table);
    115116}
    116117
Note: See TracChangeset for help on using the changeset viewer.