aboutsummaryrefslogtreecommitdiff
path: root/libmctp/range.h
diff options
context:
space:
mode:
authorChristophe Lombard <clombard@linux.ibm.com>2023-06-20 16:52:05 +0200
committerReza Arbab <arbab@linux.ibm.com>2023-09-12 14:22:11 -0500
commitb9b330a0090d7092dffab2b8137da154c7248ad9 (patch)
treedf99eb84ab3f1c64897a3224af40a4e110b4af37 /libmctp/range.h
parenta55d0672d62aaf6eb77dcbc6461d35b751b56c41 (diff)
downloadskiboot-b9b330a0090d7092dffab2b8137da154c7248ad9.zip
skiboot-b9b330a0090d7092dffab2b8137da154c7248ad9.tar.gz
skiboot-b9b330a0090d7092dffab2b8137da154c7248ad9.tar.bz2
libmctp: Import libmctp library handling MCTP protocol
The Management Component Transport Protocol (MCTP) is a protocol defined by the DMTF Platform Management Component Intercommunications sub-team of the DMTF Pre-OS Workgroup. MCTP is designed to support communications between different intelligent hardware components that make up a platform management subsystem that is provides monitoring and control functions inside a managed system. DMTF standard "DSP2016" This library is intended to be a portable implementation of the Management Component Transport Protocol (MCTP), as defined by DMTF standard "DSP0236", plus transport binding specifications. MCTP has been designed to carry multiple types of manageability-related traffic across a common medium. The base MCTP specifications define message types for supporting the initialization and configuration of MCTP itself, and to support vendor-specific messages over MCTP. Other message types, such as message types to support a Platform Level Data Model (PLDM). The source is located here: https://github.com/openbmc/libmctp and use as is, without any update. The libmctp code is integrated into the folder ./libmctp as a set of sources, compiled if the compiler flag CONFIG_PLDM is set. A config file is required. Not being generated automatically by 'configure', it must be edited manually to match the environment. Signed-off-by: Christophe Lombard <clombard@linux.ibm.com> Acked-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
Diffstat (limited to 'libmctp/range.h')
-rw-r--r--libmctp/range.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/libmctp/range.h b/libmctp/range.h
new file mode 100644
index 0000000..20349f2
--- /dev/null
+++ b/libmctp/range.h
@@ -0,0 +1,26 @@
+#ifndef _RANGE_H
+#define _RANGE_H
+
+#ifndef typeof
+#define typeof __typeof__
+#endif
+
+#ifndef MIN
+#define MIN(a, b) \
+ ({ \
+ typeof(a) _a = a; \
+ typeof(b) _b = b; \
+ _a < _b ? _a : _b; \
+ })
+#endif
+
+#ifndef MAX
+#define MAX(a, b) \
+ ({ \
+ typeof(a) _a = a; \
+ typeof(b) _b = b; \
+ _a > _b ? _a : _b; \
+ })
+#endif
+
+#endif