1  /*
   2   * \brief  IRQ session interface
   3   * \author Christian Helmuth
   4   * \date   2007-09-13
   5   *
   6   * An open IRQ session represents a valid IRQ attachment/association.
   7   * Initially, the interrupt is masked and will only occur if enabled. This is
   8   * done by calling wait_for_irq(). When the interrupt is delivered to the
   9   * client, it was acknowledged and masked at the interrupt controller before.
  10   *
  11   * Disassociation from an IRQ is done by closing the session.
  12   */

  13  
  14  /*
  15   * Copyright (C) 2007-2013 Genode Labs GmbH
  16   *
  17   * This file is part of the Genode OS framework, which is distributed
  18   * under the terms of the GNU General Public License version 2.
  19   */

  20  
  21  #ifndef _INCLUDE__IRQ_SESSION__IRQ_SESSION_H_
  22  #define _INCLUDE__IRQ_SESSION__IRQ_SESSION_H_
  23  
  24  #include <base/capability.h>
  25  #include <session/session.h>
  26  
  27  namespace Genode {
  28  
  29     struct Irq_session : Session
  30     {
  31  
  32        /**
  33         * Interrupt trigger
  34         */

  35        enum Trigger { TRIGGER_UNCHANGED = 0, TRIGGER_LEVEL, TRIGGER_EDGE };

  36  
  37        /**
  38         * Interrupt trigger polarity
  39         */

  40        enum Polarity { POLARITY_UNCHANGED = 0, POLARITY_HIGH, POLARITY_LOW };

  41  
  42        static const char *service_name() { return "IRQ"; }
  43  
  44        virtual ~Irq_session() { }
  45  
  46        virtual void wait_for_irq() = 0;
  47  
  48  
  49        /*********************
  50         ** RPC declaration **
  51         *********************/

  52  
  53        GENODE_RPC(Rpc_wait_for_irq, void, wait_for_irq);
  54        GENODE_RPC_INTERFACE(Rpc_wait_for_irq);
  55     }
;

  56  }

  57  
  58  #endif /* _INCLUDE__IRQ_SESSION__IRQ_SESSION_H_ */