Changeset 295732b in mainline
- Timestamp:
- 2012-12-06T00:06:29Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bcad855
- Parents:
- 232cd4f
- Location:
- boot/arch/mips32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/mips32/_link.ld.in
r232cd4f r295732b 2 2 3 3 SECTIONS { 4 #if defined(MACHINE_msim) 4 5 . = 0xbfc00000; 6 #elif defined(MACHINE_lmalta) || defined(MACHINE_bmalta) 7 . = 0x80004000; 8 #endif 5 9 .text : { 6 10 *(BOOTSTRAP); -
boot/arch/mips32/include/arch.h
r232cd4f r295732b 37 37 #define BOOTINFO_OFFSET 0x00003000 38 38 #define BOOT_OFFSET 0x00100000 39 40 #if defined(MACHINE_msim) 39 41 #define LOADER_OFFSET 0x1fc00000 42 #elif defined(MACHINE_lmalta) || defined(MACHINE_bmalta) 43 #define LOADER_OFFSET 0x00004000 44 #endif 40 45 46 #if defined(MACHINE_msim) 41 47 #define MSIM_VIDEORAM_ADDRESS 0xb0000000 42 48 #define MSIM_DORDER_ADDRESS 0xb0000100 49 #endif 50 51 #if defined(MACHINE_lmalta) || defined(MACHINE_bmalta) 52 #define MALTA_SERIAL 0xb80003f8 53 #endif 43 54 44 55 #ifndef __ASM__ 45 56 #define PA2KA(addr) (((uintptr_t) (addr)) + 0x80000000) 57 #define PA2KSEG(addr) (((uintptr_t) (addr)) + 0xa0000000) 58 #define KA2PA(addr) (((uintptr_t) (addr)) - 0x80000000) 46 59 #define KSEG2PA(addr) (((uintptr_t) (addr)) - 0xa0000000) 47 60 #else -
boot/arch/mips32/src/main.c
r232cd4f r295732b 65 65 for (i = 0; i < COMPONENTS; i++) 66 66 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); 69 72 70 73 void *dest[COMPONENTS]; … … 93 96 94 97 for (i = cnt; i > 0; i--) { 98 #ifdef MACHINE_msim 95 99 void *tail = dest[i - 1] + components[i].inflated; 96 100 if (tail >= ((void *) PA2KA(LOADER_OFFSET))) { … … 99 103 halt(); 100 104 } 105 #endif 101 106 102 107 printf("%s ", components[i - 1].name); -
boot/arch/mips32/src/putchar.c
r232cd4f r295732b 32 32 #include <str.h> 33 33 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 34 46 void putchar(const wchar_t ch) 35 47 { 36 48 if (ascii_check(ch)) 37 *((char *) MSIM_VIDEORAM_ADDRESS) = ch;49 *((char *) PUTCHAR_ADDRESS) = ch; 38 50 else 39 *((char *) MSIM_VIDEORAM_ADDRESS) = U_SPECIAL;51 *((char *) PUTCHAR_ADDRESS) = U_SPECIAL; 40 52 } 53
Note:
See TracChangeset
for help on using the changeset viewer.