Changeset 295732b in mainline for boot/arch/mips32/src


Ignore:
Timestamp:
2012-12-06T00:06:29Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bcad855
Parents:
232cd4f
Message:

Make the mips32 loader machine-neutral, not preferring msim.

  • Allow load address it be in both KSEG0 and KSEG1
Location:
boot/arch/mips32/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/mips32/src/main.c

    r232cd4f r295732b  
    6565        for (i = 0; i < COMPONENTS; i++)
    6666                printf(" %p|%p: %s image (%zu/%zu bytes)\n", components[i].start,
    67                     (void *) KSEG2PA(components[i].start), components[i].name,
    68                     components[i].inflated, components[i].size);
     67                    (uintptr_t) components[i].start >= PA2KSEG(0) ?
     68                    (void *) KSEG2PA(components[i].start) :
     69                    (void *) KA2PA(components[i].start),
     70                    components[i].name, components[i].inflated,
     71                    components[i].size);
    6972       
    7073        void *dest[COMPONENTS];
     
    9396       
    9497        for (i = cnt; i > 0; i--) {
     98#ifdef MACHINE_msim
    9599                void *tail = dest[i - 1] + components[i].inflated;
    96100                if (tail >= ((void *) PA2KA(LOADER_OFFSET))) {
     
    99103                        halt();
    100104                }
     105#endif
    101106               
    102107                printf("%s ", components[i - 1].name);
  • boot/arch/mips32/src/putchar.c

    r232cd4f r295732b  
    3232#include <str.h>
    3333
     34#ifdef PUTCHAR_ADDRESS
     35#undef PUTCHAR_ADDRESS
     36#endif
     37
     38#if defined(MACHINE_msim)
     39#define PUTCHAR_ADDRESS MSIM_VIDEORAM_ADDRESS
     40#endif
     41
     42#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
     43#define PUTCHAR_ADDRESS MALTA_SERIAL
     44#endif
     45
    3446void putchar(const wchar_t ch)
    3547{
    3648        if (ascii_check(ch))
    37                 *((char *) MSIM_VIDEORAM_ADDRESS) = ch;
     49                *((char *) PUTCHAR_ADDRESS) = ch;
    3850        else
    39                 *((char *) MSIM_VIDEORAM_ADDRESS) = U_SPECIAL;
     51                *((char *) PUTCHAR_ADDRESS) = U_SPECIAL;
    4052}
     53
Note: See TracChangeset for help on using the changeset viewer.