]> rtime.felk.cvut.cz Git - l4.git/blobdiff - kernel/fiasco/src/abi/l4_types.cpp
Update
[l4.git] / kernel / fiasco / src / abi / l4_types.cpp
index 7da85c2821eb37f34a8039e5921a52e051ec830f..91766e1ca7a21036b5c6949c577b78de81cb6e18 100644 (file)
@@ -425,9 +425,14 @@ public:
     Label_log = -13L,          ///< Protocol ID for log / vcon objects.
     Label_scheduler = -14L,    ///< Protocol ID for scheduler objects.
     Label_factory = -15L,      ///< Protocol ID for factory objects.
-    Label_vm = -16L,           ///< Protocol ID for VM objects (used for create
+    Label_vm = -16L,           ///< Factory ID for VM objects (used for create
                                ///  operations on a factory).
+    Label_dma_space = -17L,    ///< Factory ID for an DMA address space
+    Label_irq_sender = -18L,   ///< Protocol for IRQ sender objects.
+    Label_irq_mux = -19L,      ///< Protocol for IRQ multiplexer objects.
     Label_semaphore = -20L,    ///< Protocol ID for semaphore objects.
+    Label_iommu = -22L,        ///< Protocol ID for IOMMUs
+    Max_factory_label = Label_iommu,
   };
 private:
   Mword _tag;
@@ -508,7 +513,7 @@ public:
    * @param clock Current value of kernel clock
    * @return The receive timeout in micro seconds.
    */
-  Unsigned64 microsecs_abs(Utcb *u) const;
+  Unsigned64 microsecs_abs(Utcb const *u) const;
 
 private:
   enum
@@ -547,13 +552,6 @@ struct L4_timeout_pair
 class L4_exception_ipc
 {};
 
-class L4_semaphore
-{
-public:
-  Smword counter;
-  Mword flags;
-};
-
 /**
  * Constants for error codes returned by kernel objects.
  */
@@ -574,6 +572,7 @@ public:
     EBadproto     = 39, ///< Protocol not supported by object.
 
     EAddrnotavail = 99, ///< The given address is not available.
+    EMsgtooshort  = 1001, ///< Incoming IPC message too short
   };
 };
 
@@ -585,7 +584,11 @@ private:
 
 public:
   Order granularity() const
-  { return Order((_w >> 24) & (MWORD_BITS-1)) ; }
+  {
+    Mword g = (_w >> 24) & 0xff;
+    if (g > 24) g = 24; // limit granularity to 2**24
+    return Order(g);
+  }
 
   Cpu_number offset() const
   { return cxx::mask_lsb(Cpu_number(_w & 0x00ffffff), granularity()); }
@@ -665,7 +668,7 @@ INTERFACE [arm]:
 EXTENSION class L4_exception_ipc
 {
 public:
-  enum { Msg_size = 20 };
+  enum { Msg_size = 21 };
 };
 
 //----------------------------------------------------------------------------
@@ -755,7 +758,18 @@ public:
   };
 
   /// The message registers (MRs).
-  Mword           values[Max_words];
+  union
+  {
+    Mword         values[Max_words];
+    Unsigned64    val64[Max_words / (sizeof(Unsigned64) / sizeof(Mword))];
+  } __attribute__((packed));
+
+  static unsigned val64_idx(unsigned validx)
+  { return validx / (sizeof(Unsigned64) / sizeof(Mword)); }
+
+  static unsigned val_idx(unsigned val64_idx)
+  { return val64_idx * (sizeof(Unsigned64) / sizeof(Mword)); }
+
   Mword           utcb_addr;
 
   /// The buffer descriptor register (BDR).
@@ -941,7 +955,7 @@ L4_timeout::microsecs_rel(Unsigned64 clock) const
 
 IMPLEMENT inline NEEDS[<minmax.h>]
 Unsigned64
-L4_timeout::microsecs_abs(Utcb *u) const
+L4_timeout::microsecs_abs(Utcb const *u) const
 {
   int idx = min<int>(_t & 0x3f, Utcb::Max_buffers);
   Utcb::Time_val const *top
@@ -956,7 +970,7 @@ L4_timeout::is_absolute() const
 
 PUBLIC inline
 Unsigned64
-L4_timeout::microsecs(Unsigned64 clock, Utcb *u) const
+L4_timeout::microsecs(Unsigned64 clock, Utcb const *u) const
 { 
   if (is_absolute())
     return microsecs_abs(u);