Changeset c6e314a in mainline for kernel/arch/sparc64/src/mm/frame.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/frame.c

    r10b890b rc6e314a  
    3636#include <mm/frame.h>
    3737#include <arch/boot/boot.h>
     38#include <arch/types.h>
    3839#include <config.h>
    3940#include <align.h>
     41#include <macros.h>
     42
     43uintptr_t last_frame = NULL;
    4044
    4145/** Create memory zones according to information stored in bootinfo.
     
    5155
    5256        for (i = 0; i < bootinfo.memmap.count; i++) {
     57                uintptr_t start = bootinfo.memmap.zones[i].start;
     58                size_t size = bootinfo.memmap.zones[i].size;
    5359
    5460                /*
     
    5763                 */
    5864       
    59                 confdata = ADDR2PFN(bootinfo.memmap.zones[i].start);
     65                confdata = ADDR2PFN(start);
    6066                if (confdata == 0)
    6167                        confdata = 2;
    62                 zone_create(ADDR2PFN(bootinfo.memmap.zones[i].start),
    63                         SIZE2FRAMES(ALIGN_DOWN(bootinfo.memmap.zones[i].size, PAGE_SIZE)),
    64                         confdata, 0);
     68                zone_create(ADDR2PFN(start), SIZE2FRAMES(ALIGN_DOWN(size, FRAME_SIZE)), confdata, 0);
     69               
     70                last_frame = max(last_frame, start + ALIGN_UP(size, FRAME_SIZE));
    6571        }
    6672
Note: See TracChangeset for help on using the changeset viewer.