Rev 1702 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1702 | Rev 1780 | ||
|---|---|---|---|
| Line 140... | Line 140... | ||
| 140 | 140 | ||
| 141 | for (i=0; i < configdata->count; i++) { |
141 | for (i=0; i < configdata->count; i++) { |
| 142 | switch (configdata->descr[i].type) { |
142 | switch (configdata->descr[i].type) { |
| 143 | case CmResourceTypePort: |
143 | case CmResourceTypePort: |
| 144 | printf("Port: %p-size:%d ", |
144 | printf("Port: %p-size:%d ", |
| 145 | (__address)configdata->descr[i].u.port.start, |
145 | (uintptr_t)configdata->descr[i].u.port.start, |
| 146 | configdata->descr[i].u.port.length); |
146 | configdata->descr[i].u.port.length); |
| 147 | break; |
147 | break; |
| 148 | case CmResourceTypeInterrupt: |
148 | case CmResourceTypeInterrupt: |
| 149 | printf("Irq: level(%d) vector(%d) ", |
149 | printf("Irq: level(%d) vector(%d) ", |
| 150 | configdata->descr[i].u.interrupt.level, |
150 | configdata->descr[i].u.interrupt.level, |
| 151 | configdata->descr[i].u.interrupt.vector); |
151 | configdata->descr[i].u.interrupt.vector); |
| 152 | break; |
152 | break; |
| 153 | case CmResourceTypeMemory: |
153 | case CmResourceTypeMemory: |
| 154 | printf("Memory: %p-size:%d ", |
154 | printf("Memory: %p-size:%d ", |
| 155 | (__address)configdata->descr[i].u.port.start, |
155 | (uintptr_t)configdata->descr[i].u.port.start, |
| 156 | configdata->descr[i].u.port.length); |
156 | configdata->descr[i].u.port.length); |
| 157 | break; |
157 | break; |
| 158 | default: |
158 | default: |
| 159 | break; |
159 | break; |
| 160 | } |
160 | } |
| Line 234... | Line 234... | ||
| 234 | }; |
234 | }; |
| 235 | 235 | ||
| 236 | /** Print charactor to console */ |
236 | /** Print charactor to console */ |
| 237 | static void arc_putchar(char ch) |
237 | static void arc_putchar(char ch) |
| 238 | { |
238 | { |
| 239 | __u32 cnt; |
239 | uint32_t cnt; |
| 240 | ipl_t ipl; |
240 | ipl_t ipl; |
| 241 | 241 | ||
| 242 | /* TODO: Should be spinlock? */ |
242 | /* TODO: Should be spinlock? */ |
| 243 | ipl = interrupts_disable(); |
243 | ipl = interrupts_disable(); |
| 244 | arc_entry->write(1, &ch, 1, &cnt); |
244 | arc_entry->write(1, &ch, 1, &cnt); |
| Line 291... | Line 291... | ||
| 291 | 291 | ||
| 292 | /** Try to get character, return character or -1 if not available */ |
292 | /** Try to get character, return character or -1 if not available */ |
| 293 | static void arc_keyboard_poll(void) |
293 | static void arc_keyboard_poll(void) |
| 294 | { |
294 | { |
| 295 | char ch; |
295 | char ch; |
| 296 | __u32 count; |
296 | uint32_t count; |
| 297 | long result; |
297 | long result; |
| 298 | 298 | ||
| 299 | if (! kbd_polling_enabled) |
299 | if (! kbd_polling_enabled) |
| 300 | return; |
300 | return; |
| 301 | 301 | ||
| Line 314... | Line 314... | ||
| 314 | } |
314 | } |
| 315 | 315 | ||
| 316 | static char arc_read(chardev_t *dev) |
316 | static char arc_read(chardev_t *dev) |
| 317 | { |
317 | { |
| 318 | char ch; |
318 | char ch; |
| 319 | __u32 count; |
319 | uint32_t count; |
| 320 | long result; |
320 | long result; |
| 321 | 321 | ||
| 322 | result = arc_entry->read(0, &ch, 1, &count); |
322 | result = arc_entry->read(0, &ch, 1, &count); |
| 323 | if (result || count!=1) { |
323 | if (result || count!=1) { |
| 324 | printf("Error reading from ARC keyboard.\n"); |
324 | printf("Error reading from ARC keyboard.\n"); |
| Line 378... | Line 378... | ||
| 378 | */ |
378 | */ |
| 379 | void arc_frame_init(void) |
379 | void arc_frame_init(void) |
| 380 | { |
380 | { |
| 381 | arc_memdescriptor_t *desc; |
381 | arc_memdescriptor_t *desc; |
| 382 | int total = 0; |
382 | int total = 0; |
| 383 | __address base; |
383 | uintptr_t base; |
| 384 | size_t basesize; |
384 | size_t basesize; |
| 385 | 385 | ||
| 386 | desc = arc_entry->getmemorydescriptor(NULL); |
386 | desc = arc_entry->getmemorydescriptor(NULL); |
| 387 | while (desc) { |
387 | while (desc) { |
| 388 | if (desc->type == FreeMemory || |
388 | if (desc->type == FreeMemory || |