Changes in kernel/arch/mips32/src/mips32.c [36df4109:2277e03] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/src/mips32.c
r36df4109 r2277e03 34 34 35 35 #include <arch.h> 36 #include <arch/arch.h>37 36 #include <typedefs.h> 38 37 #include <errno.h> … … 42 41 #include <memstr.h> 43 42 #include <userspace.h> 43 #include <console/console.h> 44 44 #include <syscall/syscall.h> 45 45 #include <sysinfo/sysinfo.h> 46 46 #include <arch/debug.h> 47 47 #include <arch/debugger.h> 48 #include <arch/machine_func.h> 48 #include <arch/drivers/msim.h> 49 #include <genarch/fb/fb.h> 50 #include <genarch/drivers/dsrln/dsrlnin.h> 51 #include <genarch/drivers/dsrln/dsrlnout.h> 52 #include <genarch/srln/srln.h> 49 53 50 54 /* Size of the code jumping to the exception handler code … … 57 61 #define CACHE_EXC ((char *) 0x80000100) 58 62 59 static void mips32_pre_mm_init(void);60 static void mips32_post_mm_init(void);61 static void mips32_post_smp_init(void);62 63 arch_ops_t mips32_ops = {64 .pre_mm_init = mips32_pre_mm_init,65 .post_mm_init = mips32_post_mm_init,66 .post_smp_init = mips32_post_smp_init,67 };68 69 arch_ops_t *arch_ops = &mips32_ops;70 63 71 64 /* Why the linker moves the variable 64K away in assembler … … 78 71 size_t cpu_count = 0; 79 72 80 #if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)81 size_t sdram_size = 0;82 #endif83 84 73 /** Performs mips32-specific initialization before main_bsp() is called. */ 85 void mips32_pre_main(void *entry __attribute__((unused)), bootinfo_t *bootinfo)74 void arch_pre_main(void *entry __attribute__((unused)), bootinfo_t *bootinfo) 86 75 { 87 76 init.cnt = min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); … … 99 88 cpu_count++; 100 89 } 101 102 #if defined(MACHINE_lmalta) || defined(MACHINE_bmalta) 103 sdram_size = bootinfo->sdram_size; 104 #endif 105 106 /* Initialize machine_ops pointer. */ 107 machine_ops_init(); 108 } 109 110 void mips32_pre_mm_init(void) 90 } 91 92 void arch_pre_mm_init(void) 111 93 { 112 94 /* It is not assumed by default */ … … 139 121 } 140 122 141 void mips32_post_mm_init(void)123 void arch_post_mm_init(void) 142 124 { 143 125 interrupt_init(); 144 145 machine_init(); 146 machine_output_init(); 147 } 148 149 void mips32_post_smp_init(void) 150 { 126 127 #ifdef CONFIG_FB 128 /* GXemul framebuffer */ 129 fb_properties_t gxemul_prop = { 130 .addr = 0x12000000, 131 .offset = 0, 132 .x = 640, 133 .y = 480, 134 .scan = 1920, 135 .visual = VISUAL_RGB_8_8_8, 136 }; 137 138 outdev_t *fbdev = fb_init(&gxemul_prop); 139 if (fbdev) 140 stdout_wire(fbdev); 141 #endif 142 143 #ifdef CONFIG_MIPS_PRN 144 outdev_t *dsrlndev = dsrlnout_init((ioport8_t *) MSIM_KBD_ADDRESS); 145 if (dsrlndev) 146 stdout_wire(dsrlndev); 147 #endif 148 } 149 150 void arch_post_cpu_init(void) 151 { 152 } 153 154 void arch_pre_smp_init(void) 155 { 156 } 157 158 void arch_post_smp_init(void) 159 { 160 static const char *platform; 161 151 162 /* Set platform name. */ 152 sysinfo_set_item_data("platform", NULL, 153 (void *) machine_get_platform_name(), 154 str_size(machine_get_platform_name())); 155 156 machine_input_init(); 163 #ifdef MACHINE_msim 164 platform = "msim"; 165 #endif 166 #ifdef MACHINE_bgxemul 167 platform = "gxemul"; 168 #endif 169 #ifdef MACHINE_lgxemul 170 platform = "gxemul"; 171 #endif 172 sysinfo_set_item_data("platform", NULL, (void *) platform, 173 str_size(platform)); 174 175 #ifdef CONFIG_MIPS_KBD 176 /* 177 * Initialize the msim/GXemul keyboard port. Then initialize the serial line 178 * module and connect it to the msim/GXemul keyboard. Enable keyboard interrupts. 179 */ 180 dsrlnin_instance_t *dsrlnin_instance 181 = dsrlnin_init((dsrlnin_t *) MSIM_KBD_ADDRESS, MSIM_KBD_IRQ); 182 if (dsrlnin_instance) { 183 srln_instance_t *srln_instance = srln_init(); 184 if (srln_instance) { 185 indev_t *sink = stdin_wire(); 186 indev_t *srln = srln_wire(srln_instance, sink); 187 dsrlnin_wire(dsrlnin_instance, srln); 188 cp0_unmask_int(MSIM_KBD_IRQ); 189 } 190 } 191 192 /* 193 * This is the necessary evil until the userspace driver is entirely 194 * self-sufficient. 195 */ 196 sysinfo_set_item_val("kbd", NULL, true); 197 sysinfo_set_item_val("kbd.inr", NULL, MSIM_KBD_IRQ); 198 sysinfo_set_item_val("kbd.address.physical", NULL, 199 PA2KA(MSIM_KBD_ADDRESS)); 200 #endif 157 201 } 158 202 … … 191 235 } 192 236 237 /** Set thread-local-storage pointer 238 * 239 * We have it currently in K1, it is 240 * possible to have it separately in the future. 241 */ 242 sysarg_t sys_tls_set(uintptr_t addr) 243 { 244 return EOK; 245 } 246 193 247 void arch_reboot(void) 194 248 {
Note:
See TracChangeset
for help on using the changeset viewer.