genode/repos/os/src/drivers/input/ps2/irq_handler.h

51 lines
893 B
C
Raw Normal View History

2011-12-22 16:19:25 +01:00
/*
* \brief Input-interrupt handler
* \author Norman Feske
* \date 2007-10-08
*/
/*
2013-01-10 21:44:47 +01:00
* Copyright (C) 2007-2013 Genode Labs GmbH
2011-12-22 16:19:25 +01:00
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _IRQ_HANDLER_H_
#define _IRQ_HANDLER_H_
#include <base/thread.h>
#include <irq_session/connection.h>
#include "input_driver.h"
class Irq_handler : Genode::Thread<4096>
{
private:
Genode::Irq_connection _irq;
Input_driver &_input_driver;
public:
Irq_handler(int irq_number, Input_driver &input_driver)
:
Thread("irq_handler"),
2011-12-22 16:19:25 +01:00
_irq(irq_number),
_input_driver(input_driver)
{
start();
}
void entry()
{
while (1) {
_irq.wait_for_irq();
while (_input_driver.event_pending())
_input_driver.handle_event();
}
}
};
#endif /* _IRQ_HANDLER_H_ */