Changeset 24241cf in mainline
- Timestamp:
- 2005-09-10T17:30:56Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a1493d9
- Parents:
- 9060bd1
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/mips/Makefile.inc
r9060bd1 r24241cf 12 12 BFD_ARCH=mips 13 13 14 ASFLAGS=-mips3 15 16 DEFS=-DARCH=$(ARCH) -DMACHINE=${MACHINE} 17 CFLAGS=$(DEFS) -mno-abicalls -mips3 -G 0 -nostdlib -fno-builtin -O2 18 LFLAGS=-mips2 -M -no-check-sections 14 DEFS=-DARCH=$(ARCH) -DMACHINE=${MACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS} 15 CFLAGS=$(DEFS) -mno-abicalls -G 0 -nostdlib -fno-builtin -O2 -fno-zero-initialized-in-bss 16 LFLAGS=-M -N 19 17 20 18 # It seems that on big endian either GCC or the simulators … … 23 21 24 22 ifeq (${MACHINE},indy) 25 CFLAGS += -EB -mmemcpy -DBIG_ENDIAN -DHAVE_FPU -DFPU_LAZY 26 BFD = elf32-big 23 CFLAGS += -EB -mmemcpy -DBIG_ENDIAN -DHAVE_FPU -DFPU_LAZY -march=r4600 24 BFD = ecoff-bigmips 25 KERNEL_LOAD_ADDRESS = 0x88002000 27 26 endif 28 27 29 28 ifeq (${MACHINE},lgxemul) 30 CFLAGS += -DHAVE_FPU -DFPU_LAZY 29 CFLAGS += -DHAVE_FPU -DFPU_LAZY -mips3 31 30 BFD = ecoff-littlemips 31 KERNEL_LOAD_ADDRESS = 0x80010000 32 32 endif 33 33 34 34 ifeq (${MACHINE},bgxemul) 35 CFLAGS += -EB -mmemcpy -DBIG_ENDIAN -DHAVE_FPU -DFPU_LAZY 35 CFLAGS += -EB -mmemcpy -DBIG_ENDIAN -DHAVE_FPU -DFPU_LAZY -mips3 36 36 BFD = ecoff-bigmips 37 KERNEL_LOAD_ADDRESS = 0x80010000 37 38 endif 38 39 40 # MSIM needs lwl/swl patch & 4kc instruction patch to work 41 # otherwise add -mmemcpy -mips3 39 42 ifeq (${MACHINE},msim) 40 43 BFD = binary 41 CFLAGS += -msoft-float 44 CFLAGS += -msoft-float -march=4kc 45 KERNEL_LOAD_ADDRESS = 0x80010000 42 46 endif 43 47 48 # SIMICS 4kc emulation is broken, although for instructions 49 # that do not bother us 44 50 ifeq (${MACHINE},simics) 45 51 BFD = elf32-little 46 CFLAGS += -msoft-float 52 CFLAGS += -msoft-float -mips3 53 KERNEL_LOAD_ADDRESS = 0x80010000 47 54 endif 48 55 -
arch/mips/_link.ld.in
r9060bd1 r24241cf 16 16 17 17 SECTIONS { 18 . = 0x80100000;18 . = KERNEL_LOAD_ADDRESS; 19 19 .text : { 20 20 ktext_start = .; … … 30 30 LONG(kdata_end - kdata_start); 31 31 hardcoded_load_address = .; 32 LONG(0x80100000); 32 LONG(KERNEL_LOAD_ADDRESS); 33 *(.rodata*); 34 *(.sdata); 35 *(.reginfo); 33 36 } 34 37 _gp = . + 0x8000; 35 38 .lit8 : { *(.lit8) } 36 39 .lit4 : { *(.lit4) } 37 .sdata : { *(.sdata) }38 40 .sbss : { 39 41 *(.sbss); … … 44 46 *(COMMON); /* global variables */ 45 47 } 46 mysymtable : { 48 49 mysymtab : { 47 50 symbol_table = .; 48 *(symtab.*); /* Symbol table, must be LAST symbol!*/51 *(symtab.*); /* Symbol table, must be LAST symbol!*/ 49 52 } 50 53 kdata_end = .; 51 54 52 .mdebug : { *(.mdebug) } 53 .stab 0 : { *(.stab) } 54 .stabstr 0 : { *(.stabstr) } 55 .comment : { *(.comment) } 56 .note : { *(.note) } 55 /DISCARD/ : { 56 *(.mdebug*); 57 *(.pdr); 58 *(.comment); 59 *(.note); 60 } 57 61 } -
arch/mips/boot/Makefile
r9060bd1 r24241cf 14 14 15 15 ASFLAGS=-mips2 -I../../../include 16 LFLAGS=--oformat=binary - mips2 -e start -T _link.ld16 LFLAGS=--oformat=binary -e start -T _link.ld 17 17 18 18 .S.o: -
arch/mips/boot/boot.S
r9060bd1 r24241cf 34 34 35 35 #include <arch/asm/boot.h> 36 37 #ifndef KERNEL_LOAD_ADDRESS 38 # define KERNEL_LOAD_ADDRESS 0x80010000 39 #endif 36 40 37 41 .global start -
arch/mips/include/asm/boot.h
r9060bd1 r24241cf 34 34 #define TEMP_STACK_SIZE 0x100 35 35 36 /* Kernel startup address */37 #define KERNEL_LOAD_ADDRESS 0x8010000038 39 40 36 #endif -
arch/mips/include/console.h
r9060bd1 r24241cf 39 39 void console_init(void); 40 40 41 extern int bios_write(int fd, const char *buf, int size, int *cnt); 42 43 41 44 #endif -
arch/mips/include/cp0.h
r9060bd1 r24241cf 39 39 #define cp0_status_fpu_bit (1<<29) 40 40 41 #define cp0_status_im7_shift 15 41 #define cp0_status_im_shift 8 42 #define cp0_status_im_mask 0xff00 43 42 44 /* 43 45 * Magic value for use in msim. … … 64 66 } 65 67 68 #define cp0_mask_all_int() cp0_status_write(cp0_status_read() & ~(cp0_status_im_mask)) 69 #define cp0_unmask_all_int() cp0_status_write(cp0_status_read() | cp0_status_im_mask) 70 #define cp0_mask_int(it) cp0_status_write(cp0_status_read() & ~(1<<(cp0_status_im_shift+(it)))) 71 #define cp0_unmask_int(it) cp0_status_write(cp0_status_read() | (1<<(cp0_status_im_shift+(it)))) 66 72 67 73 -
arch/mips/include/interrupt.h
r9060bd1 r24241cf 30 30 #define __INTERRUPT_H__ 31 31 32 #define TIMER_INTERRUPT 7 33 32 34 extern void interrupt(void); 33 35 -
arch/mips/include/mm/memory_init.h
r9060bd1 r24241cf 33 33 34 34 #define get_memory_size() CONFIG_MEMORY_SIZE 35 //#define get_memory_size() 150*1024*1024 35 36 36 37 #endif -
arch/mips/src/asm.S
r9060bd1 r24241cf 118 118 119 119 120 .global bios_write 121 bios_write: 122 lw $2, 0x80001020 123 lw $2, 0x6c($2) 124 j $2 125 nop 126 120 127 .global cpu_halt 121 128 cpu_halt: -
arch/mips/src/console.c
r9060bd1 r24241cf 31 31 #include <arch/cp0.h> 32 32 #include <arch/console.h> 33 #include <arch.h> 34 35 static void arc_putchar(const char ch) 36 { 37 int cnt; 38 pri_t pri; 39 40 /* TODO: Should be spinlock? */ 41 pri = cpu_priority_high(); 42 bios_write(1, &ch, 1, &cnt); 43 cpu_priority_restore(pri); 44 45 } 33 46 34 47 static void cons_putchar(const char ch) -
arch/mips/src/cpu/cpu.c
r9060bd1 r24241cf 78 78 { "Sony", "R3000" }, /* 0x21 */ 79 79 { "Toshiba", "R3000" }, /* 0x22 */ 80 { "NKK", "R3000" } /* 0x23 */ 80 { "NKK", "R3000" }, /* 0x23 */ 81 { NULL, NULL } 81 82 }; 82 83 … … 85 86 {"Invalid","Invalid"}, /* 0x81 */ 86 87 {"Invalid","Invalid"}, /* 0x82 */ 87 {"MIPS","4Km & 4Kp"} /* 0x83 */ 88 {"MIPS","4Km & 4Kp"}, /* 0x83 */ 89 { NULL, NULL} 88 90 }; 89 91 … … 101 103 { 102 104 struct data_t *data; 105 int i; 103 106 104 107 if (m->arch.imp_num & 0x80) { 108 /* Count records */ 109 for (i=0;imp_data80[i].vendor;i++) 110 ; 111 if (m->arch.imp_num & 0x7f >= i) { 112 printf("imp=%d\n",m->arch.imp_num); 113 return; 114 } 105 115 data = &imp_data80[m->arch.imp_num & 0x7f]; 106 } else 116 } else { 117 for (i=0;imp_data[i].vendor;i++) 118 ; 119 if (m->arch.imp_num >= i) { 120 printf("imp=%d\n",m->arch.imp_num); 121 return; 122 } 107 123 data = &imp_data[m->arch.imp_num]; 124 } 108 125 109 126 printf("cpu%d: %s %s (rev=%d.%d, imp=%d)\n", -
arch/mips/src/interrupt.c
r9060bd1 r24241cf 82 82 panic("unhandled interrupt %d\n", i); 83 83 break; 84 case 7: /* Timer Interrupt */85 cp0_compare_write(cp0_count_read() + cp0_compare_value); /* clear timer interrupt*/86 /* start counting over again */84 case TIMER_INTERRUPT: 85 /* clear timer interrupt & set new */ 86 cp0_compare_write(cp0_count_read() + cp0_compare_value); 87 87 clock(); 88 88 break; -
arch/mips/src/mips.c
r9060bd1 r24241cf 36 36 #include <arch/console.h> 37 37 #include <memstr.h> 38 #include <arch/interrupt.h> 38 39 39 40 /* Size of the code jumping to the exception handler code … … 48 49 #include <arch/debug.h> 49 50 51 #include <print.h> 50 52 void arch_pre_mm_init(void) 51 53 { 54 /* It is not assumed by default */ 55 cpu_priority_high(); 56 52 57 /* Copy the exception vectors to the right places */ 53 58 memcpy(TLB_EXC, (char *)tlb_refill_entry, EXCEPTION_JUMP_SIZE); 54 59 memcpy(NORM_EXC, (char *)exception_entry, EXCEPTION_JUMP_SIZE); 55 60 memcpy(CACHE_EXC, (char *)cache_error_entry, EXCEPTION_JUMP_SIZE); 56 57 61 58 62 /* … … 62 66 cp0_status_write(cp0_status_read() & ~(cp0_status_bev_bootstrap_bit|cp0_status_erl_error_bit)); 63 67 68 /* 69 * Mask all interrupts 70 */ 71 cp0_mask_all_int(); 64 72 /* 65 73 * Unmask hardware clock interrupt. 66 74 */ 67 cp0_ status_write(cp0_status_read() | (1<<cp0_status_im7_shift));75 cp0_unmask_int(TIMER_INTERRUPT); 68 76 69 77 /* -
arch/mips/src/mm/frame.c
r9060bd1 r24241cf 29 29 #include <arch/mm/frame.h> 30 30 #include <mm/frame.h> 31 #include <arch/asm/boot.h> 32 #include <arch/mm/page.h> 31 33 32 34 void frame_arch_init(void) 33 35 { 34 /* Disable first megabyte (God knows why)*/35 frame_region_not_free(0, 1024*1024);36 /* Disable Everything until load address */ 37 frame_region_not_free(0, KA2PA(KERNEL_LOAD_ADDRESS)); 36 38 } -
test/fpu/mips1/test.c
r9060bd1 r24241cf 87 87 for (i = 0; i<ATTEMPTS; i++) { 88 88 __asm__ volatile ( 89 " ctc1 %0,$1"89 "mtc1 %0,$1" 90 90 :"=r"(arg) 91 91 ); … … 93 93 scheduler(); 94 94 __asm__ volatile ( 95 " cfc1 %0,$1"95 "mfc1 %0,$1" 96 96 :"=r"(after_arg) 97 97 ); 98 98 99 99 if(arg != after_arg) 100 panic(" Control reg tid%d: arg(%d) != %d\n",100 panic("General reg tid%d: arg(%d) != %d\n", 101 101 THREAD->tid, arg, after_arg); 102 102 }
Note:
See TracChangeset
for help on using the changeset viewer.