summaryrefslogtreecommitdiffstats
path: root/include/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h
index a950cdcc40..d9d5702a97 100644
--- a/include/common.h
+++ b/include/common.h
@@ -81,6 +81,18 @@ typedef void (interrupt_handler_t)(void *);
/*
+ * General Purpose Utilities
+ */
+#define min(X, Y) \
+ ({ typeof (X) __x = (X), __y = (Y); \
+ (__x < __y) ? __x : __y; })
+
+#define max(X, Y) \
+ ({ typeof (X) __x = (X), __y = (Y); \
+ (__x > __y) ? __x : __y; })
+
+
+/*
* Function Prototypes
*/
OpenPOWER on IntegriCloud