Changeset c621f4aa in mainline for kernel/arch/arm32/src/mm/frame.c


Ignore:
Timestamp:
2010-07-25T10:11:13Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
Children:
377cce8
Parents:
24a2517 (diff), a2da43c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with mainline.

File:
1 edited

Legend:

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

    r24a2517 rc621f4aa  
    3636#include <mm/frame.h>
    3737#include <arch/mm/frame.h>
     38#include <arch/machine_func.h>
    3839#include <config.h>
    39 
    40 #ifdef MACHINE_testarm
    41         #include <arch/mach/testarm/testarm.h>
    42 #endif
    43 
    44 #ifdef MACHINE_integratorcp
    45         #include <arch/mach/integratorcp/integratorcp.h>
    46 #endif
     40#include <align.h>
    4741
    4842/** Address of the last frame in the memory. */
     
    5246void frame_arch_init(void)
    5347{
    54         last_frame = machine_get_memory_size();
     48        uintptr_t mem_start, mem_size;
     49        uintptr_t first_frame;
     50        uintptr_t num_frames;
     51
     52        machine_get_memory_extents(&mem_start, &mem_size);
     53        first_frame = ALIGN_UP(mem_start, FRAME_SIZE);
     54        last_frame = ALIGN_DOWN(mem_start + mem_size, FRAME_SIZE);
     55        num_frames = (last_frame - first_frame) >> FRAME_WIDTH;
    5556       
    5657        /* All memory as one zone */
    57         zone_create(0, ADDR2PFN(last_frame),
     58        zone_create(first_frame >> FRAME_WIDTH, num_frames,
    5859            BOOT_PAGE_TABLE_START_FRAME + BOOT_PAGE_TABLE_SIZE_IN_FRAMES, 0);
    5960       
Note: See TracChangeset for help on using the changeset viewer.