Rev 2227 | Rev 2519 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2227 | Rev 2513 | ||
---|---|---|---|
Line 48... | Line 48... | ||
48 | #include <userspace.h> |
48 | #include <userspace.h> |
49 | #include <console/console.h> |
49 | #include <console/console.h> |
50 | #include <proc/uarg.h> |
50 | #include <proc/uarg.h> |
51 | #include <syscall/syscall.h> |
51 | #include <syscall/syscall.h> |
52 | #include <ddi/irq.h> |
52 | #include <ddi/irq.h> |
- | 53 | #include <ddi/device.h> |
|
53 | #include <arch/drivers/ega.h> |
54 | #include <arch/drivers/ega.h> |
- | 55 | #include <arch/bootinfo.h> |
|
- | 56 | #include <genarch/kbd/i8042.h> |
|
- | 57 | ||
- | 58 | bootinfo_t *bootinfo; |
|
54 | 59 | ||
55 | void arch_pre_main(void) |
60 | void arch_pre_main(void) |
56 | { |
61 | { |
57 | /* Setup usermode init tasks. */ |
62 | /* Setup usermode init tasks. */ |
- | 63 | ||
- | 64 | #ifdef I460GX |
|
- | 65 | int i; |
|
- | 66 | init.cnt = bootinfo->taskmap.count; |
|
- | 67 | for(i=0;i<init.cnt;i++) |
|
- | 68 | { |
|
- | 69 | init.tasks[i].addr = ((unsigned long)bootinfo->taskmap.tasks[i].addr)|VRN_MASK; |
|
- | 70 | init.tasks[i].size = bootinfo->taskmap.tasks[i].size; |
|
- | 71 | } |
|
- | 72 | #else |
|
58 | init.cnt = 8; |
73 | init.cnt = 8; |
59 | init.tasks[0].addr = INIT0_ADDRESS; |
74 | init.tasks[0].addr = INIT0_ADDRESS; |
60 | init.tasks[0].size = INIT0_SIZE; |
75 | init.tasks[0].size = INIT0_SIZE; |
61 | init.tasks[1].addr = INIT0_ADDRESS + 0x400000; |
76 | init.tasks[1].addr = INIT0_ADDRESS + 0x400000; |
62 | init.tasks[1].size = INIT0_SIZE; |
77 | init.tasks[1].size = INIT0_SIZE; |
Line 70... | Line 85... | ||
70 | init.tasks[5].size = INIT0_SIZE; |
85 | init.tasks[5].size = INIT0_SIZE; |
71 | init.tasks[6].addr = INIT0_ADDRESS + 0x1800000; |
86 | init.tasks[6].addr = INIT0_ADDRESS + 0x1800000; |
72 | init.tasks[6].size = INIT0_SIZE; |
87 | init.tasks[6].size = INIT0_SIZE; |
73 | init.tasks[7].addr = INIT0_ADDRESS + 0x1c00000; |
88 | init.tasks[7].addr = INIT0_ADDRESS + 0x1c00000; |
74 | init.tasks[7].size = INIT0_SIZE; |
89 | init.tasks[7].size = INIT0_SIZE; |
- | 90 | #endif |
|
75 | } |
91 | } |
76 | 92 | ||
77 | void arch_pre_mm_init(void) |
93 | void arch_pre_mm_init(void) |
78 | { |
94 | { |
79 | /* Set Interruption Vector Address (i.e. location of interruption vector table). */ |
95 | /* Set Interruption Vector Address (i.e. location of interruption vector table). */ |
Line 99... | Line 115... | ||
99 | 115 | ||
100 | void arch_pre_smp_init(void) |
116 | void arch_pre_smp_init(void) |
101 | { |
117 | { |
102 | } |
118 | } |
103 | 119 | ||
- | 120 | ||
- | 121 | #ifdef I460GX |
|
- | 122 | #define POLL_INTERVAL 50000 /* 50 ms */ |
|
- | 123 | /** Kernel thread for polling keyboard. */ |
|
- | 124 | static void i8042_kkbdpoll(void *arg) |
|
- | 125 | { |
|
- | 126 | while (1) { |
|
- | 127 | i8042_poll(); |
|
- | 128 | thread_usleep(POLL_INTERVAL); |
|
- | 129 | } |
|
- | 130 | } |
|
- | 131 | #endif |
|
- | 132 | ||
104 | void arch_post_smp_init(void) |
133 | void arch_post_smp_init(void) |
105 | { |
134 | { |
106 | 135 | ||
107 | if (config.cpu_active == 1) { |
136 | if (config.cpu_active == 1) { |
108 | /* |
137 | /* |
Line 113... | Line 142... | ||
113 | t = thread_create(kkbdpoll, NULL, TASK, 0, "kkbdpoll", true); |
142 | t = thread_create(kkbdpoll, NULL, TASK, 0, "kkbdpoll", true); |
114 | if (!t) |
143 | if (!t) |
115 | panic("cannot create kkbdpoll\n"); |
144 | panic("cannot create kkbdpoll\n"); |
116 | thread_ready(t); |
145 | thread_ready(t); |
117 | #endif |
146 | #endif |
- | 147 | ||
- | 148 | #ifdef I460GX |
|
- | 149 | devno_t kbd = device_assign_devno(); |
|
- | 150 | devno_t mouse = device_assign_devno(); |
|
- | 151 | /* keyboard controller */ |
|
- | 152 | i8042_init(kbd, IRQ_KBD, mouse, IRQ_MOUSE); |
|
- | 153 | ||
- | 154 | thread_t *t; |
|
- | 155 | t = thread_create(i8042_kkbdpoll, NULL, TASK, 0, "kkbdpoll", true); |
|
- | 156 | if (!t) |
|
- | 157 | panic("cannot create kkbdpoll\n"); |
|
- | 158 | thread_ready(t); |
|
- | 159 | ||
- | 160 | #endif |
|
- | 161 | ||
118 | } |
162 | } |
119 | } |
163 | } |
120 | 164 | ||
121 | /** Enter userspace and never return. */ |
165 | /** Enter userspace and never return. */ |
122 | void userspace(uspace_arg_t *kernel_uarg) |
166 | void userspace(uspace_arg_t *kernel_uarg) |