1  /**
   2   * \brief  Protection domain (PD) session interface
   3   * \author Christian Helmuth
   4   * \date   2006-06-27
   5   *
   6   * A pd session represents the protection domain of a program.
   7   */

   8  
   9  /*
  10   * Copyright (C) 2006-2010 Genode Labs GmbH
  11   *
  12   * This file is part of the Genode OS framework, which is distributed
  13   * under the terms of the GNU General Public License version 2.
  14   */

  15  
  16  #ifndef _INCLUDE__PD_SESSION__PD_SESSION_H_
  17  #define _INCLUDE__PD_SESSION__PD_SESSION_H_
  18  
  19  #include <thread/capability.h>
  20  #include <parent/capability.h>
  21  
  22  namespace Genode {
  23  
  24     class Pd_session
  25     {
  26        public:
  27  
  28           enum Opcode { BIND_THREAD, ASSIGN_PARENT, NUM_GENERIC_OPCODES };
  29  
  30           static const char *service_name() { return "PD"; }
  31  
  32           virtual ~Pd_session() { }
  33  
  34           /**
  35            * Bind thread to protection domain
  36            *
  37            * \param thread  capability of thread to bind
  38            *
  39            * \return        0 on success or negative error code
  40            *
  41            * After successful bind, the thread will execute inside this
  42            * protection domain when started.
  43            */

  44           virtual int bind_thread(Thread_capability thread) = 0;

  45  
  46           /**
  47            * Assign parent to protection domain
  48            *
  49            * \param   parent  capability of parent interface
  50            * \return  0 on success, or negative error code
  51            */

  52           virtual int assign_parent(Parent_capability parent) = 0;

  53     }
;

  54  }

  55  
  56  #endif /* _INCLUDE__PD_SESSION__PD_SESSION_H_ */