- Timestamp:
- 2013-03-28T20:39:16Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2d1fdcad
- Parents:
- cc3c27ad (diff), 5d9fce4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- boot
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/mips32/Makefile.inc
rcc3c27ad rc6a7b3a 29 29 BFD_ARCH = mips 30 30 BITS = 32 31 EXTRA_CFLAGS = -msoft-float -mno-abicalls -G 0 -fno-zero-initialized-in-bss -m ips3 -mabi=3231 EXTRA_CFLAGS = -msoft-float -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mabi=32 32 32 33 RD_SRVS_NON_ESSENTIAL += \34 $(USPACE_PATH)/srv/bd/gxe_bd/gxe_bd35 36 ifeq ($(MACHINE),lgxemul)37 BFD_NAME = elf32-tradlittlemips38 BFD_OUTPUT = ecoff-littlemips39 ENDIANESS = LE40 endif41 ifeq ($(MACHINE),bgxemul)42 BFD_NAME = elf32-tradbigmips43 BFD_OUTPUT = ecoff-bigmips44 ENDIANESS = BE45 endif46 33 ifeq ($(MACHINE),msim) 47 34 BFD_NAME = elf32-tradlittlemips 48 35 BFD_OUTPUT = binary 49 36 ENDIANESS = LE 37 EXTRA_CFLAGS += -march=r4000 50 38 endif 39 ifeq ($(MACHINE),lmalta) 40 BFD_NAME = elf32-tradlittlemips 41 BFD_OUTPUT = elf32-tradlittlemips 42 ENDIANESS = LE 43 EXTRA_CFLAGS += -march=4kc 44 endif 45 ifeq ($(MACHINE),bmalta) 46 BFD_NAME = elf32-tradbigmips 47 BFD_OUTPUT = elf32-tradbigmips 48 ENDIANESS = BE 49 EXTRA_CFLAGS += -march=4kc 50 endif 51 51 52 52 53 SOURCES = \ -
boot/arch/mips32/_link.ld.in
rcc3c27ad rc6a7b3a 2 2 3 3 SECTIONS { 4 #if defined(MACHINE_msim) 4 5 . = 0xbfc00000; 6 #elif defined(MACHINE_lmalta) || defined(MACHINE_bmalta) 7 . = 0x80103000; 8 #endif 5 9 .text : { 6 10 *(BOOTSTRAP); -
boot/arch/mips32/include/arch.h
rcc3c27ad rc6a7b3a 33 33 #define PAGE_SIZE (1 << PAGE_WIDTH) 34 34 35 #if defined(MACHINE_msim) 35 36 #define CPUMAP_OFFSET 0x00001000 36 37 #define STACK_OFFSET 0x00002000 … … 41 42 #define MSIM_VIDEORAM_ADDRESS 0xb0000000 42 43 #define MSIM_DORDER_ADDRESS 0xb0000100 44 #endif 45 46 #if defined(MACHINE_lmalta) || defined(MACHINE_bmalta) 47 #define CPUMAP_OFFSET 0x00100000 48 #define STACK_OFFSET 0x00101000 49 #define BOOTINFO_OFFSET 0x00102000 50 #define BOOT_OFFSET 0x00200000 51 #define LOADER_OFFSET 0x00103000 52 53 #define YAMON_SUBR_BASE PA2KA(0x1fc00500) 54 #define YAMON_SUBR_PRINT_COUNT (YAMON_SUBR_BASE + 0x4) 55 #endif 43 56 44 57 #ifndef __ASM__ 45 58 #define PA2KA(addr) (((uintptr_t) (addr)) + 0x80000000) 59 #define PA2KSEG(addr) (((uintptr_t) (addr)) + 0xa0000000) 60 #define KA2PA(addr) (((uintptr_t) (addr)) - 0x80000000) 46 61 #define KSEG2PA(addr) (((uintptr_t) (addr)) - 0xa0000000) 47 62 #else -
boot/arch/mips32/include/types.h
rcc3c27ad rc6a7b3a 47 47 48 48 typedef struct { 49 #if defined(MACHINE_lmalta) || defined(MACHINE_bmalta) 50 uint32_t sdram_size; 51 #endif 49 52 uint32_t cpumap; 50 53 size_t cnt; -
boot/arch/mips32/src/asm.S
rcc3c27ad rc6a7b3a 51 51 and $a0, $a1, $a0 52 52 mtc0 $a0, $status 53 54 #if defined(MACHINE_lmalta) || defined(MACHINE_bmalta) 55 /* 56 * Remember the size of the SDRAM in bootinfo. 57 */ 58 la $a0, PA2KA(BOOTINFO_OFFSET) 59 sw $a3, 0($a0) 60 #endif 53 61 54 62 /* -
boot/arch/mips32/src/main.c
rcc3c27ad rc6a7b3a 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
rcc3c27ad rc6a7b3a 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(ch) msim_putchar((ch)) 40 static void msim_putchar(const wchar_t ch) 41 { 42 *((char *) MSIM_VIDEORAM_ADDRESS) = ch; 43 } 44 #endif 45 46 #if defined(MACHINE_lmalta) || defined(MACHINE_bmalta) 47 #define _putchar(ch) yamon_putchar((ch)) 48 typedef void (**yamon_print_count_ptr_t)(uint32_t, const char *, uint32_t); 49 yamon_print_count_ptr_t yamon_print_count = 50 (yamon_print_count_ptr_t) YAMON_SUBR_PRINT_COUNT; 51 52 static void yamon_putchar(const wchar_t wch) 53 { 54 const char ch = (char) wch; 55 56 (*yamon_print_count)(0, &ch, 1); 57 } 58 #endif 59 34 60 void putchar(const wchar_t ch) 35 61 { 36 62 if (ascii_check(ch)) 37 *((char *) MSIM_VIDEORAM_ADDRESS) = ch;63 _putchar(ch); 38 64 else 39 *((char *) MSIM_VIDEORAM_ADDRESS) = U_SPECIAL;65 _putchar(U_SPECIAL); 40 66 } 67 -
boot/generic/include/memstr.h
rcc3c27ad rc6a7b3a 36 36 37 37 extern void *memcpy(void *, const void *, size_t); 38 extern void *memset(void *, int, size_t); 38 39 extern void *memmove(void *, const void *, size_t); 39 40 -
boot/generic/src/memstr.c
rcc3c27ad rc6a7b3a 30 30 #include <typedefs.h> 31 31 32 /** Copy block of memory.32 /** Move memory block without overlapping. 33 33 * 34 * Copy cnt bytes from src address to dst address. The source and destination35 * memory areas cannot overlap.34 * Copy cnt bytes from src address to dst address. The source 35 * and destination memory areas cannot overlap. 36 36 * 37 * @param src Source address to copy from.38 * @param dst Destination address to copy to.39 * @param cnt 37 * @param dst Destination address to copy to. 38 * @param src Source address to copy from. 39 * @param cnt Number of bytes to copy. 40 40 * 41 * @return Destination address. 41 * @return Destination address. 42 * 42 43 */ 43 44 void *memcpy(void *dst, const void *src, size_t cnt) 44 45 { 45 size_t i; 46 uint8_t *dp = (uint8_t *) dst; 47 const uint8_t *sp = (uint8_t *) src; 48 49 while (cnt-- != 0) 50 *dp++ = *sp++; 51 52 return dst; 53 } 46 54 47 for (i = 0; i < cnt; i++) 48 ((uint8_t *) dst)[i] = ((uint8_t *) src)[i]; 49 55 /** Fill block of memory. 56 * 57 * Fill cnt bytes at dst address with the value val. 58 * 59 * @param dst Destination address to fill. 60 * @param val Value to fill. 61 * @param cnt Number of bytes to fill. 62 * 63 * @return Destination address. 64 * 65 */ 66 void *memset(void *dst, int val, size_t cnt) 67 { 68 uint8_t *dp = (uint8_t *) dst; 69 70 while (cnt-- != 0) 71 *dp++ = val; 72 50 73 return dst; 51 74 }
Note:
See TracChangeset
for help on using the changeset viewer.