Changeset 38de8a5 in mainline
- Timestamp:
- 2005-09-09T13:50:54Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b02e5d1
- Parents:
- b0edf3b2
- Files:
-
- 2 added
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
arch/mips/Makefile.inc
rb0edf3b2 r38de8a5 25 25 arch/mips.c \ 26 26 arch/dummy.S \ 27 arch/ putchar.c \27 arch/console.c \ 28 28 arch/asm.S \ 29 29 arch/exception.c \ -
arch/mips/_link.ld
rb0edf3b2 r38de8a5 7 7 */ 8 8 9 /* OUTPUT_FORMAT(ecoff-littlemips) */ 9 10 OUTPUT_FORMAT(binary) 11 /* OUTPUT_FORMAT(elf32-little) */ 12 10 13 ENTRY(kernel_image_start) 11 14 12 15 SECTIONS { 13 .image 0x80000000: AT (0 x80000000) {16 .image 0x80000000: AT (0) { 14 17 _gp = 0x00000000; 15 18 … … 28 31 *(.sdata); 29 32 *(.sbss); 33 *(.comment); 34 *(.pdr); 35 30 36 hardcoded_ktext_size = .; 31 37 LONG(ktext_end - ktext_start); … … 43 49 kdata_end = .; 44 50 45 } = 0x0000000051 } 46 52 } -
arch/mips/src/console.c
rb0edf3b2 r38de8a5 1 1 /* 2 * Copyright (C) 200 3-2004 Jakub Jermar2 * Copyright (C) 2005 Ondrej Palkovsky 3 3 * All rights reserved. 4 4 * … … 30 30 #include <arch/types.h> 31 31 #include <arch/cp0.h> 32 #include <arch/console.h> 32 33 33 #define VIDEORAM 0xB0000000 34 static void (*putchar_func)(const char ch) = NULL; 35 36 static void cons_putchar(const char ch) 37 { 38 *((char *) VIDEORAM) = ch; 39 } 40 41 42 static void serial_putchar(const char ch) 43 { 44 int i; 45 46 if (ch=='\n') 47 putchar('\r'); 48 49 /* Wait until transmit buffer empty */ 50 while (! ((*SERIAL_LSR) & (1<<TRANSMIT_EMPTY_BIT))) 51 ; 52 *(SERIAL_PORT_BASE) = ch; 53 } 54 55 void console_init(void) 56 { 57 /* The LSR on the start usually contains this value */ 58 if (*SERIAL_LSR == 0x60) 59 putchar_func = serial_putchar; 60 else 61 putchar_func = cons_putchar; 62 } 34 63 35 64 void putchar(const char ch) 36 65 { 37 // __u32 status = cp0_status_read(); 38 39 // cp0_status_write(cp0_status_read() | cp0_status_erl_error_bit); 40 *((char *) VIDEORAM) = ch; 41 // cp0_status_write(status); 66 putchar_func(ch); 42 67 } -
arch/mips/src/cpu/cpu.c
rb0edf3b2 r38de8a5 35 35 36 36 #include <typedefs.h> 37 #include <print.h> 37 #include <print.h> 38 38 39 struct {39 struct data_t { 40 40 char *vendor; 41 41 char *model; 42 } imp_data[] = { 42 }; 43 44 static struct data_t imp_data[] = { 43 45 { "Invalid", "Invalid" }, /* 0x00 */ 44 46 { "MIPS", "R2000" }, /* 0x01 */ … … 79 81 }; 80 82 83 static struct data_t imp_data80[] = { 84 { "MIPS", "4Kc" }, /* 0x80 */ 85 {"Invalid","Invalid"}, /* 0x81 */ 86 {"Invalid","Invalid"}, /* 0x82 */ 87 {"MIPS","4Km & 4Kp"} /* 0x83 */ 88 }; 89 81 90 void cpu_arch_init(void) 82 91 { … … 91 100 void cpu_print_report(cpu_t *m) 92 101 { 102 struct data_t *data; 103 104 if (m->arch.imp_num & 0x80) { 105 data = &imp_data80[m->arch.imp_num & 0x7f]; 106 } else 107 data = &imp_data[m->arch.imp_num]; 108 93 109 printf("cpu%d: %s %s (rev=%d.%d, imp=%d)\n", 94 m->id, imp_data[m->arch.imp_num].vendor, imp_data[m->arch.imp_num].model, m->arch.rev_num >> 4, m->arch.rev_num & 0xf, m->arch.imp_num); 110 m->id, data->vendor, data->model, m->arch.rev_num >> 4, 111 m->arch.rev_num & 0xf, m->arch.imp_num); 95 112 } -
arch/mips/src/interrupt.c
rb0edf3b2 r38de8a5 58 58 } 59 59 60 61 60 void interrupt(void) 62 61 { … … 84 83 break; 85 84 case 7: /* Timer Interrupt */ 86 cp0_compare_write(cp0_co mpare_value); /* clear timer interrupt */85 cp0_compare_write(cp0_count_read() + cp0_compare_value); /* clear timer interrupt */ 87 86 /* start counting over again */ 88 cp0_count_write(0);89 87 clock(); 90 88 break; -
arch/mips/src/mips.c
rb0edf3b2 r38de8a5 34 34 #include <mm/vm.h> 35 35 #include <userspace.h> 36 #include <arch/console.h> 36 37 37 38 void arch_pre_mm_init(void) … … 51 52 * Start hardware clock. 52 53 */ 53 cp0_compare_write(cp0_compare_value); 54 cp0_count_write(0); 54 cp0_compare_write(cp0_compare_value + cp0_count_read()); 55 56 console_init(); 55 57 } 56 58 -
arch/mips/src/mm/tlb.c
rb0edf3b2 r38de8a5 38 38 void tlb_refill(struct exception_regdump *pstate) 39 39 { 40 panic("tlb_refill exception\n"); 40 char *symbol = ""; 41 char *sym2 = ""; 42 43 if (THREAD) { 44 char *s = get_symtab_entry(pstate->epc); 45 if (s) 46 symbol = s; 47 s = get_symtab_entry(pstate->ra); 48 if (s) 49 sym2 = s; 50 } 51 panic("%X: tlb_refill exception at %X(%s<-%s)\n", cp0_badvaddr_read(), 52 pstate->epc, symbol,sym2); 41 53 } 42 54
Note:
See TracChangeset
for help on using the changeset viewer.