mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 20:42:56 +01:00
Let the kernel CPU-pool be a member of the one Kernel::Main object instead of having it as global static variable. Ref #4217
51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
/*
|
|
* \brief Kernel back-end and core front-end for user interrupts
|
|
* \author Martin Stein
|
|
* \date 2013-10-28
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2013-2017 Genode Labs GmbH
|
|
*
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
* under the terms of the GNU Affero General Public License version 3.
|
|
*/
|
|
|
|
/* core includes */
|
|
#include <kernel/kernel.h>
|
|
#include <kernel/cpu.h>
|
|
#include <kernel/irq.h>
|
|
|
|
|
|
void Kernel::Irq::disable() const
|
|
{
|
|
_pic.mask(_irq_nr);
|
|
}
|
|
|
|
|
|
void Kernel::Irq::enable() const
|
|
{
|
|
_pic.unmask(_irq_nr, Cpu::executing_id());
|
|
}
|
|
|
|
|
|
Kernel::Irq::Pool &Kernel::User_irq::_pool()
|
|
{
|
|
static Irq::Pool p;
|
|
return p;
|
|
}
|
|
|
|
|
|
Kernel::User_irq::User_irq(unsigned const irq,
|
|
Genode::Irq_session::Trigger trigger,
|
|
Genode::Irq_session::Polarity polarity,
|
|
Signal_context &context,
|
|
Board::Pic &pic)
|
|
:
|
|
Irq { irq, _pool(), pic },
|
|
_context { context }
|
|
{
|
|
disable();
|
|
_pic.irq_mode(_irq_nr, trigger, polarity);
|
|
}
|