1  /*
   2   * \brief  Dataspace interface
   3   * \author Norman Feske
   4   * \date   2006-07-05
   5   */

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

  13  
  14  #ifndef _INCLUDE__DATASPACE__DATASPACE_H_
  15  #define _INCLUDE__DATASPACE__DATASPACE_H_
  16  
  17  #include <base/stdint.h>
  18  #include <base/rpc.h>
  19  
  20  namespace Genode {
  21  
  22     struct Dataspace
  23     {
  24        virtual ~Dataspace() { }
  25  
  26        /**
  27         * Request size of dataspace
  28         */

  29        virtual size_t size() = 0;

  30  
  31        /**
  32         * Request base address in physical address space
  33         */

  34        virtual addr_t phys_addr() = 0;

  35  
  36        /**
  37         * Return true if dataspace is writable
  38         */

  39        virtual bool writable() = 0;

  40  
  41  
  42        /*********************
  43         ** RPC declaration **
  44         *********************/

  45  
  46        GENODE_RPC(Rpc_size,      size_t, size);
  47        GENODE_RPC(Rpc_phys_addr, addr_t, phys_addr);
  48        GENODE_RPC(Rpc_writable,  bool,   writable);
  49  
  50        GENODE_RPC_INTERFACE(Rpc_size, Rpc_phys_addr, Rpc_writable);
  51     }
;

  52  }

  53  
  54  #endif /* _INCLUDE__DATASPACE__DATASPACE_H_ */