]> rtime.felk.cvut.cz Git - l4.git/blobdiff - kernel/fiasco/src/kern/space-io.cpp
update
[l4.git] / kernel / fiasco / src / kern / space-io.cpp
index 6bc0550349c30a056d419ead4c66441b28b43325..f37b9f9079126b7f0475c8d9491254464ed920a4 100644 (file)
@@ -4,64 +4,6 @@ INTERFACE [io]:
 #include "io_space.h"
 #include "l4_types.h"
 
-class Space;
+EXTENSION class Space : public Generic_io_space<Space>
+{};
 
-EXTENSION class Space
-{
-private:
-  typedef Space_container<Io_space> Io_space_container;
-  Io_space_container _io_space;
-
-public:
-  /** The interface for Io_space to get the surrounding Space. */
-  static Space *space(Io_space const *os)
-  {
-    return reinterpret_cast<Space*>(Address(os) - Address(&reinterpret_cast<Space*>(32)->_io_space) + 32);
-  }
-
-};
-
-
-//----------------------------------------------------------------------------
-IMPLEMENTATION [io]:
-
-// 
-// Utilities for map<Io_space> and unmap<Io_space>
-// 
-
-PUBLIC inline
-Io_space*
-Space::io_space()
-{
-  return _io_space.get();
-}
-
-PUBLIC inline
-bool
-Space::lookup_space (Io_space** out_io_space)
-{
-  *out_io_space = io_space();
-  return true;
-}
-
-//----------------------------------------------------------------------------
-IMPLEMENTATION [io && iopl3]:
-
-/// Is this task a privileged one?
-PUBLIC inline NEEDS ["l4_types.h", "config.h"]
-bool
-Space::has_io_privileges()
-{
-  // A task is privileged if it has all the IO ports mapped.
-  return (!Config::enable_io_protection
-         || (io_space()->get_io_counter() == Mem_layout::Io_port_max));
-}
-
-//----------------------------------------------------------------------------
-IMPLEMENTATION [io && !iopl3]:
-
-/// Is this task a privileged one?
-PUBLIC inline NEEDS ["l4_types.h", "config.h"]
-bool 
-Space::has_io_privileges()
-{ return false; }