aboutsummaryrefslogtreecommitdiffstats
path: root/hw/slavio_intctl.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-08-08 20:36:08 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-08-08 20:36:08 +0000
commit68556e2e9e7a0563027c0ea919434b37f99544d1 (patch)
treea5ee07f315d00547362b55a455baf1c8cc70c224 /hw/slavio_intctl.c
parent4b48bf059b2824e09ca8062269b689a20528f16c (diff)
Sparc32: move intbit_to_level table back to slavio_intctl.c
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/slavio_intctl.c')
-rw-r--r--hw/slavio_intctl.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/hw/slavio_intctl.c b/hw/slavio_intctl.c
index 8eea6f94a..a56feb6de 100644
--- a/hw/slavio_intctl.c
+++ b/hw/slavio_intctl.c
@@ -67,7 +67,6 @@ typedef struct SLAVIO_INTCTLState {
uint64_t irq_count[32];
#endif
qemu_irq cpu_irqs[MAX_CPUS][MAX_PILS];
- const uint32_t *intbit_to_level;
uint32_t cputimer_lbit, cputimer_mbit;
uint32_t cputimer_bit;
uint32_t pil_out[MAX_CPUS];
@@ -252,6 +251,11 @@ void slavio_irq_info(Monitor *mon, void *opaque)
#endif
}
+static const uint32_t intbit_to_level[] = {
+ 2, 3, 5, 7, 9, 11, 0, 14, 3, 5, 7, 9, 11, 13, 12, 12,
+ 6, 0, 4, 10, 8, 0, 11, 0, 0, 0, 0, 0, 15, 0, 15, 0,
+};
+
static void slavio_check_interrupts(SLAVIO_INTCTLState *s, int set_irqs)
{
uint32_t pending = s->intregm_pending, pil_pending;
@@ -266,7 +270,7 @@ static void slavio_check_interrupts(SLAVIO_INTCTLState *s, int set_irqs)
(i == s->target_cpu)) {
for (j = 0; j < 32; j++) {
if (pending & (1 << j))
- pil_pending |= 1 << s->intbit_to_level[j];
+ pil_pending |= 1 << intbit_to_level[j];
}
}
pil_pending |= (s->slaves[i].intreg_pending & CPU_SOFTIRQ_MASK) >> 16;
@@ -296,7 +300,7 @@ static void slavio_set_irq(void *opaque, int irq, int level)
{
SLAVIO_INTCTLState *s = opaque;
uint32_t mask = 1 << irq;
- uint32_t pil = s->intbit_to_level[irq];
+ uint32_t pil = intbit_to_level[irq];
DPRINTF("Set cpu %d irq %d -> pil %d level %d\n", s->target_cpu, irq, pil,
level);
@@ -397,7 +401,7 @@ static void slavio_intctl_init1(SysBusDevice *dev)
slavio_intctlm_mem_write, s);
sysbus_init_mmio(dev, INTCTLM_SIZE, io_memory);
s->cputimer_mbit = 1 << s->cputimer_bit;
- s->cputimer_lbit = 1 << s->intbit_to_level[s->cputimer_bit];
+ s->cputimer_lbit = 1 << intbit_to_level[s->cputimer_bit];
for (i = 0; i < MAX_CPUS; i++) {
for (j = 0; j < MAX_PILS; j++) {
@@ -422,11 +426,6 @@ static SysBusDeviceInfo slavio_intctl_info = {
.qdev.size = sizeof(SLAVIO_INTCTLState),
.qdev.props = (Property[]) {
{
- .name = "intbit_to_level",
- .info = &qdev_prop_ptr,
- .offset = offsetof(SLAVIO_INTCTLState, intbit_to_level),
- },
- {
.name = "cputimer_bit",
.info = &qdev_prop_uint32,
.offset = offsetof(SLAVIO_INTCTLState, cputimer_bit),