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;
* @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
class L4_exception_ipc
{};
-class L4_semaphore
-{
-public:
- Smword counter;
- Mword flags;
-};
-
/**
* Constants for error codes returned by kernel objects.
*/
EBadproto = 39, ///< Protocol not supported by object.
EAddrnotavail = 99, ///< The given address is not available.
+ EMsgtooshort = 1001, ///< Incoming IPC message too short
};
};
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()); }
EXTENSION class L4_exception_ipc
{
public:
- enum { Msg_size = 20 };
+ enum { Msg_size = 21 };
};
//----------------------------------------------------------------------------
};
/// 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).
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
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);