genode/repos/base-nova/src/core/include/irq_object.h
Alexander Boettcher 3e90542559 nova: use signals with irqs in core
Avoids the need to have per IRQ a thread that blocks synchronously for next
interrupt. Now a thread may wait for multiple IRQs as other signals
simultaneously.

In core no threads are required anymore for IRQs/MSI - the clients (either
the pci_drv or in case of MSI the driver) gets the IRQ delivered directly as
a ordinary Genode signal.

Useful since #1216 and #1487 is now available.
Commit applies feature of #1446 also to IRQ/MSIs.
2015-05-26 09:39:51 +02:00

45 lines
975 B
C++

/*
* \brief Nova-specific instance of the IRQ object
* \author Alexander Boettcher
*/
/*
* Copyright (C) 2015 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#pragma once
namespace Genode { class Irq_object; }
class Genode::Irq_object
{
private:
Signal_context_capability _sigh_cap;
Genode::addr_t _kernel_caps;
Genode::addr_t _msi_addr;
Genode::addr_t _msi_data;
Genode::addr_t _device_phys; /* PCI config extended address */
enum { KERNEL_CAP_COUNT_LOG2 = 0 };
Genode::addr_t const irq_sel() { return _kernel_caps; }
public:
Irq_object();
~Irq_object();
Genode::addr_t msi_address() const { return _msi_addr; }
Genode::addr_t msi_value() const { return _msi_data; }
void sigh(Signal_context_capability cap);
void ack_irq();
void start(unsigned irq, Genode::addr_t);
};