hw/x86: add interrupt controller re-init support

Issue #4669
This commit is contained in:
Alexander Boettcher 2023-01-11 10:17:28 +01:00 committed by Christian Helmuth
parent 1da71afbf3
commit dc1996d289
11 changed files with 28 additions and 18 deletions

View File

@ -26,7 +26,7 @@ namespace Board {
using namespace Hw::Imx6q_sabrelite_board;
class Global_interrupt_controller { };
class Global_interrupt_controller { public: void init() {} };
class Pic : public Hw::Gicv2 { public: Pic(Global_interrupt_controller &) { } };
using L2_cache = Hw::Pl310;

View File

@ -26,7 +26,7 @@ namespace Board {
using namespace Hw::Nit6_solox_board;
class Global_interrupt_controller { };
class Global_interrupt_controller { public: void init() {} };
class Pic : public Hw::Gicv2 { public: Pic(Global_interrupt_controller &) { } };
using L2_cache = Hw::Pl310;

View File

@ -26,7 +26,7 @@ namespace Board {
using namespace Hw::Pbxa9_board;
class Global_interrupt_controller { };
class Global_interrupt_controller { public: void init() {} };
class Pic : public Hw::Gicv2 { public: Pic(Global_interrupt_controller &) { } };
L2_cache & l2_cache();

View File

@ -29,7 +29,7 @@ namespace Board {
using L2_cache = Hw::Pl310;
class Global_interrupt_controller { };
class Global_interrupt_controller { public: void init() {} };
class Pic : public Hw::Gicv2 { public: Pic(Global_interrupt_controller &) { } };
L2_cache & l2_cache();

View File

@ -144,6 +144,7 @@ void Kernel::main_initialize_and_handle_kernel_entry()
kernel_initialized = false;
Main::_instance->_serial.init();
Main::_instance->_global_irq_ctrl.init();
}
nr_of_initialized_cpus ++;

View File

@ -27,7 +27,7 @@ namespace Board {
struct Vm_page_table {};
struct Vm_page_table_array {};
class Global_interrupt_controller { };
class Global_interrupt_controller { public: void init() {} };
struct Pic : Hw::Pic { struct Virtual_context {}; Pic(Global_interrupt_controller &) { } };
struct Vcpu_context { Vcpu_context(Kernel::Cpu &) {} };
}

View File

@ -18,7 +18,7 @@
namespace Board {
class Global_interrupt_controller { };
class Global_interrupt_controller { public: void init() {} };
class Pic;
};

View File

@ -18,7 +18,7 @@
namespace Board {
class Global_interrupt_controller { };
class Global_interrupt_controller { public: void init() {} };
class Pic;
};

View File

@ -22,7 +22,7 @@
namespace Board {
class Global_interrupt_controller { };
class Global_interrupt_controller { public: void init() {} };
class Pic;
}

View File

@ -246,17 +246,24 @@ Global_interrupt_controller::Global_interrupt_controller()
_irq_mode[i].trigger_mode = TRIGGER_LEVEL;
_irq_mode[i].polarity = POLARITY_LOW;
}
/* remap all IRQs managed by I/O APIC */
if (i < _irte_count) {
Irte::access_t irte = _create_irt_entry(i);
write<Ioregsel>(IOREDTBL + 2 * i + 1);
write<Iowin>((Iowin::access_t)(irte >> Iowin::ACCESS_WIDTH));
write<Ioregsel>(IOREDTBL + 2 * i);
write<Iowin>((Iowin::access_t)(irte));
}
}
};
init();
}
void Global_interrupt_controller::init()
{
/* remap all IRQs managed by I/O APIC */
for (unsigned i = 0; i < _irte_count; i++)
{
Irte::access_t irte = _create_irt_entry(i);
write<Ioregsel>(IOREDTBL + 2 * i + 1);
write<Iowin>((Iowin::access_t)(irte >> Iowin::ACCESS_WIDTH));
write<Ioregsel>(IOREDTBL + 2 * i);
write<Iowin>((Iowin::access_t)(irte));
}
}
void Global_interrupt_controller::toggle_mask(unsigned const vector,

View File

@ -114,6 +114,8 @@ class Board::Global_interrupt_controller : public Genode::Mmio
Global_interrupt_controller();
void init();
/**
* Set/unset mask bit of IRTE for given vector
*