All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/6] tools/libxl: Introduce min and max macros
@ 2015-03-16 13:29 Ross Lagerwall
  2015-03-16 13:29 ` [PATCH v3 2/6] tools/libxl: Update datacopier to support sending data only Ross Lagerwall
                   ` (4 more replies)
  0 siblings, 5 replies; 29+ messages in thread
From: Ross Lagerwall @ 2015-03-16 13:29 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Ian Jackson, Ian Campbell, Wei Liu

From: Andrew Cooper <andrew.cooper3@citrix.com>

This is the same set used by libxc.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
 tools/libxl/libxl_internal.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 934465a..fcbec7f 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -108,6 +108,22 @@
 
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
 
+#define min(X, Y) ({                             \
+            const typeof (X) _x = (X);           \
+            const typeof (Y) _y = (Y);           \
+            (void) (&_x == &_y);                 \
+            (_x < _y) ? _x : _y; })
+#define max(X, Y) ({                             \
+            const typeof (X) _x = (X);           \
+            const typeof (Y) _y = (Y);           \
+            (void) (&_x == &_y);                 \
+            (_x > _y) ? _x : _y; })
+
+#define min_t(type, x, y)                                               \
+    ({ const type _x = (x); const type _y = (y); _x < _y ? _x: _y; })
+#define max_t(type, x, y)                                               \
+    ({ const type _x = (x); const type _y = (y); _x > _y ? _x: _y; })
+
 #define LIBXL__LOGGING_ENABLED
 
 #ifdef LIBXL__LOGGING_ENABLED
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2015-04-07 12:26 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16 13:29 [PATCH v3 1/6] tools/libxl: Introduce min and max macros Ross Lagerwall
2015-03-16 13:29 ` [PATCH v3 2/6] tools/libxl: Update datacopier to support sending data only Ross Lagerwall
2015-03-16 13:29 ` [PATCH v3 3/6] tools/libxl: Avoid overrunning static buffer with prefixdata Ross Lagerwall
2015-03-16 13:29 ` [PATCH v3 4/6] tools/libxl: Allow limiting amount copied by datacopier Ross Lagerwall
2015-03-18 11:12   ` Ian Campbell
2015-03-16 13:29 ` [PATCH v3 5/6] tools/libxl: Extend datacopier to support reading into a buffer Ross Lagerwall
2015-03-18 11:18   ` Ian Campbell
2015-04-01 15:53   ` Ian Jackson
2015-04-01 15:59     ` Ian Campbell
2015-03-16 13:29 ` [PATCH v3 6/6] tools/libxl: Adjust datacopiers POLLHUP handling when the fd is also readable Ross Lagerwall
2015-03-18 11:31   ` Ian Campbell
2015-03-26 15:20   ` Roger Pau Monné
2015-03-30 10:40     ` Ian Campbell
2015-04-01 10:34       ` Roger Pau Monné
2015-04-01 14:36         ` Andrew Cooper
2015-04-02 15:03           ` [PATCH 0/3] datacopier POLLHUP fixes " Ian Jackson
2015-04-02 15:04             ` [PATCH 1/3] Revert "tools/libxl: Adjust datacopiers POLLHUP handling when the fd is also readable" Ian Jackson
2015-04-02 15:08               ` Ian Campbell
2015-04-02 15:27                 ` Ian Jackson
2015-04-02 15:10               ` Andrew Cooper
2015-04-02 15:11               ` Ian Jackson
2015-04-02 15:04             ` [PATCH 2/3] libxl: Cope with pipes which signal POLLHUP|POLLIN on read eof Ian Jackson
2015-04-02 15:13               ` Ian Campbell
2015-04-02 15:04             ` [PATCH 3/3] libxl: datacopier: Avoid theoretical eof/POLLHUP race Ian Jackson
2015-04-02 15:15               ` Ian Campbell
2015-04-02 16:29               ` Ian Jackson
2015-04-07 11:14                 ` Roger Pau Monné
2015-04-07 12:26                   ` Ian Jackson
2015-04-02 15:09             ` [PATCH 0/3] datacopier POLLHUP fixes handling when the fd is also readable Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.