mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-18 21:27:56 +00:00
parent
a7a9855493
commit
55c3eb7c14
@ -377,11 +377,11 @@ class Vmm::Gic : public Vmm::Mmio_device
|
||||
|
||||
struct Gicd_icfgr : Irq_reg
|
||||
{
|
||||
Register read(Irq & irq) { return irq.level() ? 0 : 1; }
|
||||
Register read(Irq & irq) { return irq.level() ? 0 : 2; }
|
||||
void write(Irq & irq, Register v) { irq.level(!v); }
|
||||
|
||||
Gicd_icfgr()
|
||||
: Irq_reg("GICD_ICFGR", Mmio_register::RW, 0xc00, 8, 1024) {}
|
||||
: Irq_reg("GICD_ICFGR", Mmio_register::RW, 0xc00, 2, 1024) {}
|
||||
} _icfgr;
|
||||
|
||||
struct Gicd_sgir : Genode::Register<32>, Mmio_register
|
||||
|
@ -202,7 +202,7 @@ Register Gic::Irq_reg::read(Address_range & access, Cpu & cpu)
|
||||
Register bits_per_irq = size * 8 / irq_count;
|
||||
for (unsigned i = (access.start * 8) / bits_per_irq;
|
||||
i < ((access.start+access.size) * 8) / bits_per_irq; i++)
|
||||
ret |= read(cpu.gic().irq(i)) << (i % 32/bits_per_irq);
|
||||
ret |= read(cpu.gic().irq(i)) << ((i % (32/bits_per_irq) * bits_per_irq));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -213,7 +213,7 @@ void Gic::Irq_reg::write(Address_range & access, Cpu & cpu, Register value)
|
||||
Register irq_value_mask = (1<<bits_per_irq) - 1;
|
||||
for (unsigned i = (access.start * 8) / bits_per_irq;
|
||||
i < ((access.start+access.size) * 8) / bits_per_irq; i++)
|
||||
write(cpu.gic().irq(i), (value >> (i % 32/bits_per_irq))
|
||||
write(cpu.gic().irq(i), (value >> ((i % (32/bits_per_irq))*bits_per_irq))
|
||||
& irq_value_mask);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user