25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_cons.c,v 1.24 2005/02/19 11:51:33 debug Exp $ |
* $Id: dev_cons.c,v 1.25 2005/06/11 21:04:31 debug Exp $ |
29 |
* |
* |
30 |
* A console device. (Fake, only useful for simple tests.) |
* A console device. (Fake, only useful for simple tests.) |
31 |
|
* It is hardwared to the lowest available MIPS hardware IRQ, and only |
32 |
|
* interrupts CPU 0. |
33 |
* |
* |
34 |
* This device provides memory mapped I/O for a simple console supporting |
* This device provides memory mapped I/O for a simple console supporting |
35 |
* putchar (writing to memory) and getchar (reading from memory), and |
* putchar (writing to memory) and getchar (reading from memory), and |
62 |
*/ |
*/ |
63 |
void dev_cons_tick(struct cpu *cpu, void *extra) |
void dev_cons_tick(struct cpu *cpu, void *extra) |
64 |
{ |
{ |
65 |
|
struct cpu *c = cpu->machine->cpus[0]; |
66 |
struct cons_data *d = extra; |
struct cons_data *d = extra; |
67 |
|
|
68 |
cpu_interrupt_ack(cpu, d->irq_nr); |
cpu_interrupt_ack(c, d->irq_nr); |
69 |
|
|
70 |
if (console_charavail(d->console_handle)) |
if (console_charavail(d->console_handle)) |
71 |
cpu_interrupt(cpu, d->irq_nr); |
cpu_interrupt(c, d->irq_nr); |
72 |
} |
} |
73 |
|
|
74 |
|
|