aboutsummaryrefslogtreecommitdiff
path: root/core/pldm/pldm.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/pldm/pldm.h')
-rw-r--r--core/pldm/pldm.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/pldm/pldm.h b/core/pldm/pldm.h
index ee4d493..df38ce5 100644
--- a/core/pldm/pldm.h
+++ b/core/pldm/pldm.h
@@ -35,6 +35,21 @@ struct pldm_tx_data {
uint8_t data[1];
};
+/* Return an integer with a bit set in the position corresponding to
+ * the given enumeration (starting from 0 = the least significant
+ * bit) and zeroes in the other positions.
+ * Used for libpldm enumeration constants.
+ *
+ *
+ * @example enum_bit(0) = 0x00000001
+ * @example enum_bit(1) = 0x00000002
+ * @example enum_bit(4) = 0x00000010
+ */
+inline uint32_t enum_bit(unsigned int enumeration)
+{
+ return 1 << enumeration;
+}
+
struct pldm_rx_data {
struct pldm_header_info hdrinf; /* parsed message header */