Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 6250c37 in mainline


Ignore:
Timestamp:
2010-06-27T10:20:01Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial
Children:
f1fc83a
Parents:
12b0d51
Message:

Fix first physical frame number computation. Only create kernel identity mapping from beginning of physical memory, not from zero.

Location:
kernel/arch/arm32
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/include/mm/frame.h

    r12b0d51 r6250c37  
    4646
    4747#define BOOT_PAGE_TABLE_SIZE     0x4000
    48 #define BOOT_PAGE_TABLE_ADDRESS  0x8000
     48
     49#ifdef MACHINE_gta02
     50#define BOOT_PAGE_TABLE_ADDRESS  0x30010000
     51#else
     52#define BOOT_PAGE_TABLE_ADDRESS  0x00008000
     53#endif
    4954
    5055#define BOOT_PAGE_TABLE_START_FRAME     (BOOT_PAGE_TABLE_ADDRESS >> FRAME_WIDTH)
    5156#define BOOT_PAGE_TABLE_SIZE_IN_FRAMES  (BOOT_PAGE_TABLE_SIZE >> FRAME_WIDTH)
     57
     58#ifdef MACHINE_gta02
     59#define PHYSMEM_START_ADDR      0x30008000
     60#else
     61#define PHYSMEM_START_ADDR      0x00000000
     62#endif
    5263
    5364extern uintptr_t last_frame;
  • kernel/arch/arm32/src/mach/gta02/gta02.c

    r12b0d51 r6250c37  
    7676/** Get extents of available memory.
    7777 *
    78  * @param start         Place to store memory start address.
     78 * @param start         Place to store memory start address (physical).
    7979 * @param size          Place to store memory size.
    8080 */
    8181static void gta02_get_memory_extents(uintptr_t *start, uintptr_t *size)
    8282{
    83         *start = PA2KA(GTA02_MEMORY_START) + GTA02_MEMORY_SKIP;
     83        *start = GTA02_MEMORY_START + GTA02_MEMORY_SKIP;
    8484        *size  = GTA02_MEMORY_SIZE - GTA02_MEMORY_SKIP;
    8585}
  • kernel/arch/arm32/src/mm/frame.c

    r12b0d51 r6250c37  
    5656       
    5757        /* All memory as one zone */
    58         zone_create(first_frame, num_frames,
     58        zone_create(first_frame >> FRAME_WIDTH, num_frames,
    5959            BOOT_PAGE_TABLE_START_FRAME + BOOT_PAGE_TABLE_SIZE_IN_FRAMES, 0);
    6060       
  • kernel/arch/arm32/src/mm/page.c

    r12b0d51 r6250c37  
    5858        uintptr_t cur;
    5959        /* Kernel identity mapping */
    60         for (cur = 0; cur < last_frame; cur += FRAME_SIZE)
     60        for (cur = PHYSMEM_START_ADDR; cur < last_frame; cur += FRAME_SIZE)
    6161                page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags);
    6262       
Note: See TracChangeset for help on using the changeset viewer.