Changeset 8480714 in mainline


Ignore:
Timestamp:
2008-07-27T20:26:02Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
29f8f8e
Parents:
94fa807d
Message:

limit physical memory to 512 MB (more cannot be used right now, see ticket #29)
fix physical memory detection in gxemul (which doesn't honor uncached flag in TLB)

File:
1 edited

Legend:

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

    r94fa807d r8480714  
    4545
    4646#define ZERO_PAGE_MASK          TLB_PAGE_MASK_256K
    47 #define ZERO_FRAMES                     16384
     47#define ZERO_FRAMES                     2048
    4848#define ZERO_PAGE_WIDTH         18  /* 256K */
    4949#define ZERO_PAGE_SIZE          (1 << ZERO_PAGE_WIDTH)
     
    5454#define ZERO_PAGE_VALUE         (((volatile uint32_t *) ZERO_PAGE_ADDR)[ZERO_PAGE_OFFSET])
    5555
     56#define ZERO_PAGE_VALUE_KSEG1(frame) (((volatile uint32_t *) (0xa0000000 + (frame << ZERO_PAGE_WIDTH)))[ZERO_PAGE_OFFSET])
     57
    5658#define MAX_REGIONS                     32
    5759
     
    7476static bool frame_available(pfn_t frame)
    7577{
     78#if MACHINE == msim
    7679        /* MSIM device (dprinter) */
    7780        if (frame == (KA2PA(MSIM_VIDEORAM) >> ZERO_PAGE_WIDTH))
     
    8184        if (frame == (KA2PA(MSIM_KBD_ADDRESS) >> ZERO_PAGE_WIDTH))
    8285                return false;
    83        
     86#endif
     87
     88#if MACHINE == simics
    8489        /* Simics device (serial line) */
    8590        if (frame == (KA2PA(SERIAL_ADDRESS) >> ZERO_PAGE_WIDTH))
    8691                return false;
     92#endif
     93
     94#if (MACHINE == lgxemul) || (MACHINE == bgxemul)
     95        /* gxemul devices */
     96        if (overlaps(frame << ZERO_PAGE_WIDTH, ZERO_PAGE_SIZE,
     97            0x10000000, MB2SIZE(256)))
     98                return false;
     99#endif
    87100       
    88101        return true;
     
    206219                                        if (ZERO_PAGE_VALUE != 0xdeadbeef)
    207220                                                avail = false;
     221#if (MACHINE == lgxemul) || (MACHINE == bgxemul)
     222                                        else {
     223                                                ZERO_PAGE_VALUE_KSEG1(frame) = 0xaabbccdd;
     224                                                if (ZERO_PAGE_VALUE_KSEG1(frame) != 0xaabbccdd)
     225                                                        avail = false;
     226                                        }
     227#endif
    208228                                }
    209229                        }
Note: See TracChangeset for help on using the changeset viewer.