Changeset 94d614e in mainline for kernel/arch/sparc64/src/mm/frame.c


Ignore:
Timestamp:
2006-07-13T17:32:38Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a5f76758
Parents:
63cda71
Message:

Remove OpenFirmware calls from kernel/ entirely.

Switch the sparc64 port to use bootinfo.

Copy memcpy from boot/ to sparc64 kernel/ and
adjust it for memcpy_from/to_uspace.

File:
1 edited

Legend:

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

    r63cda71 r94d614e  
    3434
    3535#include <arch/mm/frame.h>
    36 #include <genarch/ofw/memory_init.h>
    3736#include <mm/frame.h>
     37#include <arch/boot/boot.h>
    3838#include <config.h>
    3939#include <align.h>
    4040
     41/** Create memory zones according to information stored in bootinfo.
     42 *
     43 * Walk the bootinfo memory map and create frame zones according to it.
     44 * The first frame is not blacklisted here as it is done in generic
     45 * frame_init().
     46 */
    4147void frame_arch_init(void)
    4248{
    43         ofw_init_zones();
     49        int i;
     50        pfn_t confdata;
    4451
    45         /*
    46          * Workaround to prevent slab allocator from allocating frame 0.
    47          * Frame 0 is
    48          * a) not mapped by OFW
    49          * b) would be confused with NULL error return code
    50          */
    51         frame_mark_unavailable(0, 1);
     52        for (i = 0; i < bootinfo.memmap.count; i++) {
     53
     54                /*
     55                 * The memmap is created by HelenOS boot loader.
     56                 * It already contains no holes.
     57                 */
     58       
     59                confdata = ADDR2PFN(bootinfo.memmap.zones[i].start);
     60                if (confdata == 0)
     61                        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);
     65        }
     66
    5267}
    5368
Note: See TracChangeset for help on using the changeset viewer.