1 |
/* |
/* |
2 |
* Copyright (C) 2004-2006 Anders Gavare. All rights reserved. |
* Copyright (C) 2004-2007 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_z8530.c,v 1.9 2006/10/07 02:05:21 debug Exp $ |
* $Id: dev_z8530.c,v 1.13 2007/01/28 14:31:43 debug Exp $ |
29 |
* |
* |
30 |
* Zilog "zs" serial controller (Z8530). |
* Zilog "zs" serial controller (Z8530). |
31 |
* |
* |
46 |
#include "console.h" |
#include "console.h" |
47 |
#include "cpu.h" |
#include "cpu.h" |
48 |
#include "device.h" |
#include "device.h" |
49 |
|
#include "interrupt.h" |
50 |
#include "machine.h" |
#include "machine.h" |
51 |
#include "memory.h" |
#include "memory.h" |
52 |
#include "misc.h" |
#include "misc.h" |
62 |
#define DEV_Z8530_LENGTH 4 |
#define DEV_Z8530_LENGTH 4 |
63 |
|
|
64 |
struct z8530_data { |
struct z8530_data { |
65 |
int irq_nr; |
struct interrupt irq; |
|
int dma_irq_nr; |
|
66 |
int irq_asserted; |
int irq_asserted; |
67 |
int addr_mult; |
int addr_mult; |
68 |
|
|
116 |
asserted = 0; |
asserted = 0; |
117 |
|
|
118 |
if (asserted) |
if (asserted) |
119 |
cpu_interrupt(cpu, d->irq_nr); |
INTERRUPT_ASSERT(d->irq); |
120 |
|
|
121 |
if (d->irq_asserted && !asserted) |
if (d->irq_asserted && !asserted) |
122 |
cpu_interrupt_ack(cpu, d->irq_nr); |
INTERRUPT_DEASSERT(d->irq); |
123 |
|
|
124 |
d->irq_asserted = asserted; |
d->irq_asserted = asserted; |
125 |
} |
} |
211 |
exit(1); |
exit(1); |
212 |
} |
} |
213 |
memset(d, 0, sizeof(struct z8530_data)); |
memset(d, 0, sizeof(struct z8530_data)); |
214 |
d->irq_nr = devinit->irq_nr; |
|
|
d->dma_irq_nr = devinit->dma_irq_nr; |
|
215 |
d->addr_mult = devinit->addr_mult; |
d->addr_mult = devinit->addr_mult; |
216 |
|
|
217 |
|
INTERRUPT_CONNECT(devinit->interrupt_path, d->irq); |
218 |
|
|
219 |
snprintf(tmp, sizeof(tmp), "%s [ch-b]", devinit->name); |
snprintf(tmp, sizeof(tmp), "%s [ch-b]", devinit->name); |
220 |
d->console_handle[0] = console_start_slave(devinit->machine, tmp, |
d->console_handle[0] = console_start_slave(devinit->machine, tmp, |
221 |
devinit->in_use); |
devinit->in_use); |