Ignore:
File:
1 edited

Legend:

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

    r3c50cddc r32817cc  
    4040#include <mm/asid.h>
    4141#include <config.h>
    42 #ifdef MACHINE_msim
    4342#include <arch/drivers/msim.h>
    44 #endif
    45 #include <arch/arch.h>
    4643#include <print.h>
    4744
     
    8784                return false;
    8885#endif
    89 
    90 #if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
    91         if (frame >= (sdram_size >> ZERO_PAGE_WIDTH))
     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)))
    9291                return false;
    9392#endif
     
    226225                                        if (ZERO_PAGE_VALUE != 0xdeadbeef)
    227226                                                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
    228234                                }
    229235                        }
     
    241247        /* Blacklist interrupt vector frame */
    242248        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
    269249       
    270250        /* Cleanup */
Note: See TracChangeset for help on using the changeset viewer.