Rev 4347 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4347 | Rev 4348 | ||
|---|---|---|---|
| Line 34... | Line 34... | ||
| 34 | 34 | ||
| 35 | #include <arch.h> |
35 | #include <arch.h> |
| 36 | #include <arch/cp0.h> |
36 | #include <arch/cp0.h> |
| 37 | #include <arch/exception.h> |
37 | #include <arch/exception.h> |
| 38 | #include <mm/as.h> |
38 | #include <mm/as.h> |
| 39 | - | ||
| 40 | #include <userspace.h> |
39 | #include <userspace.h> |
| 41 | #include <arch/console.h> |
- | |
| 42 | #include <memstr.h> |
40 | #include <memstr.h> |
| 43 | #include <proc/thread.h> |
41 | #include <proc/thread.h> |
| 44 | #include <proc/uarg.h> |
42 | #include <proc/uarg.h> |
| 45 | #include <print.h> |
43 | #include <print.h> |
| - | 44 | #include <console/console.h> |
|
| 46 | #include <syscall/syscall.h> |
45 | #include <syscall/syscall.h> |
| 47 | #include <sysinfo/sysinfo.h> |
46 | #include <sysinfo/sysinfo.h> |
| 48 | - | ||
| 49 | #include <arch/interrupt.h> |
47 | #include <arch/interrupt.h> |
| 50 | #include <console/chardev.h> |
48 | #include <console/chardev.h> |
| 51 | #include <arch/barrier.h> |
49 | #include <arch/barrier.h> |
| 52 | #include <arch/debugger.h> |
50 | #include <arch/debugger.h> |
| 53 | #include <genarch/fb/fb.h> |
51 | #include <genarch/fb/fb.h> |
| Line 57... | Line 55... | ||
| 57 | #include <genarch/srln/srln.h> |
55 | #include <genarch/srln/srln.h> |
| 58 | #include <macros.h> |
56 | #include <macros.h> |
| 59 | #include <config.h> |
57 | #include <config.h> |
| 60 | #include <string.h> |
58 | #include <string.h> |
| 61 | #include <arch/drivers/msim.h> |
59 | #include <arch/drivers/msim.h> |
| 62 | - | ||
| 63 | #include <arch/asm/regname.h> |
60 | #include <arch/asm/regname.h> |
| 64 | 61 | ||
| 65 | /* Size of the code jumping to the exception handler code |
62 | /* Size of the code jumping to the exception handler code |
| 66 | * - J+NOP |
63 | * - J+NOP |
| 67 | */ |
64 | */ |
| Line 89... | Line 86... | ||
| 89 | 86 | ||
| 90 | count_t i; |
87 | count_t i; |
| 91 | for (i = 0; i < min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); i++) { |
88 | for (i = 0; i < min3(bootinfo->cnt, TASKMAP_MAX_RECORDS, CONFIG_INIT_TASKS); i++) { |
| 92 | init.tasks[i].addr = bootinfo->tasks[i].addr; |
89 | init.tasks[i].addr = bootinfo->tasks[i].addr; |
| 93 | init.tasks[i].size = bootinfo->tasks[i].size; |
90 | init.tasks[i].size = bootinfo->tasks[i].size; |
| 94 | strncpy(init.tasks[i].name, bootinfo->tasks[i].name, |
91 | str_cpy(init.tasks[i].name, CONFIG_TASK_NAME_BUFLEN, |
| 95 | CONFIG_TASK_NAME_BUFLEN); |
92 | bootinfo->tasks[i].name); |
| 96 | } |
93 | } |
| 97 | 94 | ||
| 98 | for (i = 0; i < CPUMAP_MAX_RECORDS; i++) { |
95 | for (i = 0; i < CPUMAP_MAX_RECORDS; i++) { |
| 99 | if ((bootinfo->cpumap & (1 << i)) != 0) |
96 | if ((bootinfo->cpumap & (1 << i)) != 0) |
| 100 | cpu_count++; |
97 | cpu_count++; |
| Line 167... | Line 164... | ||
| 167 | #ifdef CONFIG_MIPS_KBD |
164 | #ifdef CONFIG_MIPS_KBD |
| 168 | /* |
165 | /* |
| 169 | * Initialize the msim/GXemul keyboard port. Then initialize the serial line |
166 | * Initialize the msim/GXemul keyboard port. Then initialize the serial line |
| 170 | * module and connect it to the msim/GXemul keyboard. Enable keyboard interrupts. |
167 | * module and connect it to the msim/GXemul keyboard. Enable keyboard interrupts. |
| 171 | */ |
168 | */ |
| - | 169 | dsrlnin_instance_t *dsrlnin_instance |
|
| 172 | indev_t *kbrdin = dsrlnin_init((dsrlnin_t *) MSIM_KBD_ADDRESS, MSIM_KBD_IRQ); |
170 | = dsrlnin_init((dsrlnin_t *) MSIM_KBD_ADDRESS, MSIM_KBD_IRQ); |
| 173 | if (kbrdin) { |
171 | if (dsrlnin_instance) { |
| - | 172 | srln_instance_t *srln_instance = srln_init(); |
|
| 174 | srln_init(kbrdin); |
173 | if (srln_instance) { |
| - | 174 | indev_t *sink = stdin_wire(); |
|
| - | 175 | indev_t *srln = srln_wire(srln_instance, sink); |
|
| - | 176 | dsrlnin_wire(dsrlnin_instance, srln); |
|
| 175 | cp0_unmask_int(MSIM_KBD_IRQ); |
177 | cp0_unmask_int(MSIM_KBD_IRQ); |
| - | 178 | } |
|
| 176 | } |
179 | } |
| 177 | 180 | ||
| 178 | /* |
181 | /* |
| 179 | * This is the necessary evil until the userspace driver is entirely |
182 | * This is the necessary evil until the userspace driver is entirely |
| 180 | * self-sufficient. |
183 | * self-sufficient. |
| Line 246... | Line 249... | ||
| 246 | void *arch_construct_function(fncptr_t *fptr, void *addr, void *caller) |
249 | void *arch_construct_function(fncptr_t *fptr, void *addr, void *caller) |
| 247 | { |
250 | { |
| 248 | return addr; |
251 | return addr; |
| 249 | } |
252 | } |
| 250 | 253 | ||
| - | 254 | void arch_grab_console(void) |
|
| - | 255 | { |
|
| - | 256 | #ifdef CONFIG_FB |
|
| - | 257 | fb_redraw(); |
|
| - | 258 | #endif |
|
| - | 259 | } |
|
| - | 260 | ||
| - | 261 | /** Return console to userspace |
|
| - | 262 | * |
|
| - | 263 | */ |
|
| - | 264 | void arch_release_console(void) |
|
| - | 265 | { |
|
| - | 266 | } |
|
| - | 267 | ||
| 251 | /** @} |
268 | /** @} |
| 252 | */ |
269 | */ |