Ignore:
File:
1 edited

Legend:

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

    r9d58539 r3c50cddc  
    4040#include <mm/asid.h>
    4141#include <config.h>
     42#ifdef MACHINE_msim
    4243#include <arch/drivers/msim.h>
     44#endif
     45#include <arch/arch.h>
    4346#include <print.h>
    4447
     
    8487                return false;
    8588#endif
    86        
    87 #if defined(MACHINE_lgxemul) || defined(MACHINE_bgxemul)
    88         /* gxemul devices */
    89         if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE,
    90             0x10000000, MiB2SIZE(256)))
     89
     90#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
     91        if (frame >= (sdram_size >> ZERO_PAGE_WIDTH))
    9192                return false;
    9293#endif
     
    225226                                        if (ZERO_PAGE_VALUE != 0xdeadbeef)
    226227                                                avail = false;
    227 #if defined(MACHINE_lgxemul) || defined(MACHINE_bgxemul)
    228                                         else {
    229                                                 ZERO_PAGE_VALUE_KSEG1(frame) = 0xaabbccdd;
    230                                                 if (ZERO_PAGE_VALUE_KSEG1(frame) != 0xaabbccdd)
    231                                                         avail = false;
    232                                         }
    233 #endif
    234228                                }
    235229                        }
     
    247241        /* Blacklist interrupt vector frame */
    248242        frame_mark_unavailable(0, 1);
     243
     244#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
     245        /* Blacklist memory regions used by YAMON.
     246         *
     247         * The YAMON User's Manual vaguely says the following physical addresses
     248         * are taken by YAMON:
     249         *
     250         * 0x1000       YAMON functions
     251         * 0x5000       YAMON code
     252         *
     253         * These addresses overlap with the beginning of the SDRAM so we need to
     254         * make sure they cannot be allocated.
     255         *
     256         * The User's Manual unfortunately does not say where does the SDRAM
     257         * portion used by YAMON end.
     258         *
     259         * Looking into the YAMON 02.21 sources, it looks like the first free
     260         * address is computed dynamically and depends on the size of the YAMON
     261         * image. From the YAMON binary, it appears to be 0xc0d50 or roughly
     262         * 772 KiB for that particular version.
     263         *
     264         * Linux is linked to 1MiB which seems to be a safe bet and a reasonable
     265         * upper bound for memory taken by YAMON. We will use it too.
     266         */
     267        frame_mark_unavailable(0, 1024 * 1024 / FRAME_SIZE);
     268#endif
    249269       
    250270        /* Cleanup */
Note: See TracChangeset for help on using the changeset viewer.