genode/repos/base/include/irq_session/irq_session.h
Alexander Boettcher faa25e1df6 base: make irq_session asynchronous
second step

options: factor out common parts of irq_session_component.cc
options: use on foc arm no proxy threads

Fixes #1456
2015-04-23 16:47:58 +02:00

77 lines
1.7 KiB
C++

/*
* \brief IRQ session interface
* \author Christian Helmuth
* \author Martin Stein
* \date 2007-09-13
*
* An open IRQ session represents a valid IRQ attachment/association.
* Initially, the interrupt is masked and will only occur if enabled. This is
* done by calling ack_irq().
*
* Disassociation from an IRQ is done by closing the session.
*/
/*
* Copyright (C) 2007-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.
*/
#ifndef _INCLUDE__IRQ_SESSION__IRQ_SESSION_H_
#define _INCLUDE__IRQ_SESSION__IRQ_SESSION_H_
#include <base/signal.h>
#include <base/capability.h>
#include <session/session.h>
namespace Genode {
struct Irq_session;
}
struct Genode::Irq_session : Session
{
/**
* Interrupt trigger
*/
enum Trigger { TRIGGER_UNCHANGED = 0, TRIGGER_LEVEL, TRIGGER_EDGE };
/**
* Interrupt trigger polarity
*/
enum Polarity { POLARITY_UNCHANGED = 0, POLARITY_HIGH, POLARITY_LOW };
/**
* Destructor
*/
virtual ~Irq_session() { }
/**
* Acknowledge handling of last interrupt - re-enables interrupt reception
*/
virtual void ack_irq() = 0;
/**
* Register irq signal handler
*/
virtual void sigh(Genode::Signal_context_capability sigh) = 0;
/*************
** Session **
*************/
static const char * service_name() { return "IRQ"; }
/*********************
** RPC declaration **
*********************/
GENODE_RPC(Rpc_ack_irq, void, ack_irq);
GENODE_RPC(Rpc_sigh, void, sigh, Genode::Signal_context_capability);
GENODE_RPC_INTERFACE(Rpc_ack_irq, Rpc_sigh);
};
#endif /* _INCLUDE__IRQ_SESSION__IRQ_SESSION_H_ */