Changeset c6e314a in mainline for kernel/arch/sparc64/src/mm/page.c


Ignore:
Timestamp:
2006-07-14T11:39:02Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
08a7802f
Parents:
10b890b
Message:

Change hw_map() on sparc64 to use virtual addresses that are
beyond the end of physical memory. It is beneficial in two
ways: first, physical memory is no longer being wasted by
otherwise necessary calls to frame_alloc() and, second,
virtual addresses for devices are now correctly allocated
and do not overlap with the 4M TLB-locked mapping for
kernel text and data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/mm/page.c

    r10b890b rc6e314a  
    2727 */
    2828
    29  /** @addtogroup sparc64mm     
     29/** @addtogroup sparc64mm       
    3030 * @{
    3131 */
     
    3737#include <genarch/mm/page_ht.h>
    3838#include <mm/frame.h>
     39#include <arch/mm/frame.h>
    3940#include <bitops.h>
    4041#include <debug.h>
     42#include <align.h>
    4143
    4244void page_arch_init(void)
     
    7375        else
    7476                order = (fnzb32(size - 1) + 1) - FRAME_WIDTH;
     77
     78        /*
     79         * Use virtual addresses that are beyond the limit of physical memory.
     80         * Thus, the physical address space will not be wasted by holes created
     81         * by frame_alloc().
     82         */
     83        ASSERT(last_frame);
     84        uintptr_t virtaddr = ALIGN_UP(last_frame, 1<<(order + FRAME_WIDTH));
     85        last_frame = ALIGN_UP(virtaddr + size, 1<<(order + FRAME_WIDTH));
    7586       
    76         uintptr_t virtaddr = (uintptr_t) frame_alloc(order, FRAME_KA);
    77 
    7887        for (i = 0; i < sizemap[order].count; i++)
    7988                dtlb_insert_mapping(virtaddr + i*sizemap[order].increment,
     
    8493}
    8594
    86  /** @}
     95/** @}
    8796 */
    88 
Note: See TracChangeset for help on using the changeset viewer.