6 * Description of the mapping buffer registers contained in the UTCB
7 * (used e.g. during IPC).
8 * The utcb can contain buffers that describe memory regions, bits in the
9 * I/O bitmap or capabilities. The buffer description is used to find the
10 * first buffer for each type.
11 * Additionally, the buffer description contains a flag to specify the
12 * willingness to receive FPU state in an IPC operation.
14 * Note that a single buffer might occupy more than one word in the buffer-
15 * registers array in the UTCB. The L4_buf_iter class can be used to iterate
24 * \brief Flag the willingness to receive FPU state during IPC.
26 * If this flag is set, the receiving thread in an IPC is willing
27 * to receive the status of the floating point unit (FPU) from its partner
28 * as part of an IPC. Conceptually, this flag adds the FPU of the
29 * receiver as an additional message receiver buffer.
30 * The sender must set the corresponding flag L4_msg_tag::Transfer_fpu.
32 Inherit_fpu = (1UL << 24)
36 * Create an uninitialized buffer descriptor.
37 * \note The value of the buffer descriptor is unpredictable.
42 * Create a buffer descriptor with given values.
43 * \param mem the BR index for the first memory buffer item.
44 * \param io the BR index for the first I/O-port buffer item.
45 * \param obj the BR index for the first object/capability buffer item.
46 * \param flags the flags, such as, Inherit_fpu.
48 * The buffer registers must contain blocks of buffers of identical
49 * type (memory, caps, I/O-ports) starting at the given index. The first
50 * non-matching item terminates the items of the particular type.
51 * \see Utcb and L4_msg_tag
53 L4_buf_desc(unsigned mem, unsigned io, unsigned obj,
55 : _raw(mem | (io << 5) | (obj << 10) | flags)
59 * Index of the first memory receive buffer.
60 * \return the index of the first receive buffer for memory mappings.
62 * The memory receive items use two BRs each.
63 * \see L4_fpage, L4_msg_item
65 unsigned mem() const { return _raw & ((1UL << 5)-1); }
68 * Index of the first I/O-port buffer item.
69 * \return the index of the first BR containing a I/O-port buffer.
71 * The I/O-port buffer items use two BRs each.
72 * \see L4_fpage, L4_msg_item.
74 unsigned io() const { return (_raw >> 5) & ((1UL << 5)-1); }
77 * Index of the first object receive buffer.
78 * \return the BR index for the first object/capability receive buffer.
80 * An object receive buffer may use one or two BRs depending on the
81 * value in the L4_msg_item in the first BR.
82 * \see L4_msg_item, L4_fpage.
84 unsigned obj() const { return (_raw >> 10) & ((1UL << 5)-1); }
87 * The flags of the BDR.
88 * \return flags encoded in the BDR, see #Inherit_fpu, L4_buf_desc::Flags.
89 * \note The return value may have reserved bits set.
91 Mword flags() const { return _raw; }
94 * Get the raw binary representation of the buffer descriptor.
95 * \return binary representation of the buffer descriptor.
97 Mword raw() const { return _raw; }
101 * A single machine word that describes the buffers that follow:
102 * - Bits 0..4: The index of the first memory buffer.
103 * - Bits 5..9: The index of the first io buffer.
104 * - Bits 10..14: The index of the first capability buffer.
105 * - Bits 15..23: Unused
106 * - Bits 24..31: Flags as defined above (only #Inherit_fpu is in use).