2011-12-22 15:19:25 +00:00
|
|
|
/*
|
|
|
|
* \brief Input-interrupt handler
|
|
|
|
* \author Norman Feske
|
|
|
|
* \date 2007-10-08
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2012-01-03 14:35:05 +00:00
|
|
|
* Copyright (C) 2007-2012 Genode Labs GmbH
|
2011-12-22 15:19:25 +00: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)
|
|
|
|
:
|
|
|
|
_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_ */
|