Lines Matching +full:cpu +full:- +full:offset
13 #include "cpu.h"
17 #include "hw/qdev-properties.h"
20 #define TYPE_MCF_INTC "mcf-intc"
32 M68kCPU *cpu; member
43 active = (s->ipr | s->ifr) & s->enabled & ~s->imr; in mcf_intc_update()
48 if ((active & 1) != 0 && s->icr[i] >= best_level) { in mcf_intc_update()
49 best_level = s->icr[i]; in mcf_intc_update()
55 s->active_vector = ((best == 64) ? 24 : (best + 64)); in mcf_intc_update()
56 m68k_set_irq_level(s->cpu, best_level, s->active_vector); in mcf_intc_update()
62 int offset; in mcf_intc_read() local
64 offset = addr & 0xff; in mcf_intc_read()
65 if (offset >= 0x40 && offset < 0x80) { in mcf_intc_read()
66 return s->icr[offset - 0x40]; in mcf_intc_read()
68 switch (offset) { in mcf_intc_read()
70 return (uint32_t)(s->ipr >> 32); in mcf_intc_read()
72 return (uint32_t)s->ipr; in mcf_intc_read()
74 return (uint32_t)(s->imr >> 32); in mcf_intc_read()
76 return (uint32_t)s->imr; in mcf_intc_read()
78 return (uint32_t)(s->ifr >> 32); in mcf_intc_read()
80 return (uint32_t)s->ifr; in mcf_intc_read()
82 return s->active_vector; in mcf_intc_read()
86 qemu_log_mask(LOG_UNIMP, "%s: LnIACK not implemented (offset 0x%02x)\n", in mcf_intc_read()
87 __func__, offset); in mcf_intc_read()
97 int offset; in mcf_intc_write() local
99 offset = addr & 0xff; in mcf_intc_write()
100 if (offset >= 0x40 && offset < 0x80) { in mcf_intc_write()
101 int n = offset - 0x40; in mcf_intc_write()
102 s->icr[n] = val; in mcf_intc_write()
104 s->enabled &= ~(1ull << n); in mcf_intc_write()
106 s->enabled |= (1ull << n); in mcf_intc_write()
110 switch (offset) { in mcf_intc_write()
115 s->imr = (s->imr & 0xffffffff) | ((uint64_t)val << 32); in mcf_intc_write()
118 s->imr = (s->imr & 0xffffffff00000000ull) | (uint32_t)val; in mcf_intc_write()
122 s->imr = ~0ull; in mcf_intc_write()
124 s->imr |= (0x1ull << (val & 0x3f)); in mcf_intc_write()
129 s->imr = 0ull; in mcf_intc_write()
131 s->imr &= ~(0x1ull << (val & 0x3f)); in mcf_intc_write()
135 qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%02x\n", in mcf_intc_write()
136 __func__, offset); in mcf_intc_write()
148 s->ipr |= 1ull << irq; in mcf_intc_set_irq()
150 s->ipr &= ~(1ull << irq); in mcf_intc_set_irq()
158 s->imr = ~0ull; in mcf_intc_reset()
159 s->ipr = 0; in mcf_intc_reset()
160 s->ifr = 0; in mcf_intc_reset()
161 s->enabled = 0; in mcf_intc_reset()
162 memset(s->icr, 0, 64); in mcf_intc_reset()
163 s->active_vector = 24; in mcf_intc_reset()
176 memory_region_init_io(&s->iomem, obj, &mcf_intc_ops, s, "mcf", 0x100); in mcf_intc_instance_init()
177 sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->iomem); in mcf_intc_instance_init()
181 DEFINE_PROP_LINK("m68k-cpu", mcf_intc_state, cpu,
191 set_bit(DEVICE_CATEGORY_MISC, dc->categories); in mcf_intc_class_init()
212 M68kCPU *cpu) in type_init()
217 object_property_set_link(OBJECT(dev), "m68k-cpu", in type_init()
218 OBJECT(cpu), &error_abort); in type_init()