qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org, xen-devel@lists.xensource.com
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 03/11] add container_of() macro to osdep.h
Date: Mon, 11 Aug 2008 14:32:42 +0200	[thread overview]
Message-ID: <1218457970-11707-4-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1218457970-11707-1-git-send-email-kraxel@redhat.com>

>From linux kernel sources, xen bits will use it, put it
into a place where others can see and use it too ;)

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 osdep.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/osdep.h b/osdep.h
index a32242e..b69ce2e 100644
--- a/osdep.h
+++ b/osdep.h
@@ -19,6 +19,10 @@
 #define unlikely(x)   __builtin_expect(!!(x), 0)
 #endif
 
+#define container_of(ptr, type, member) ({                      \
+        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
+        (type *)( (char *)__mptr - offsetof(type,member) );})
+
 #ifndef MIN
 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
 #endif
-- 
1.5.5.1

  parent reply	other threads:[~2008-08-11 12:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-11 12:32 [Qemu-devel] [PATCH 00/11] merge some xen bits into qemu Gerd Hoffmann
2008-08-11 12:32 ` [Qemu-devel] [PATCH 01/11] Handle terminating signals Gerd Hoffmann
2008-08-11 19:27   ` Anthony Liguori
2008-08-11 19:52     ` Gerd Hoffmann
2008-08-11 19:30   ` Anthony Liguori
2008-08-11 19:58     ` Gerd Hoffmann
2008-08-12  1:53       ` Anthony Liguori
2008-08-11 12:32 ` [Qemu-devel] [PATCH 02/11] add DisplayState->idle Gerd Hoffmann
2008-08-11 12:36   ` [Qemu-devel] " Samuel Thibault
2008-08-11 12:32 ` Gerd Hoffmann [this message]
2008-08-11 12:32 ` [Qemu-devel] [PATCH 04/11] move GUI_REFRESH_INTERVAL define from vl.c to console.h Gerd Hoffmann
2008-08-11 12:32 ` [Qemu-devel] [PATCH 05/11] xen: groundwork for xen support Gerd Hoffmann
2008-08-11 12:32 ` [Qemu-devel] [PATCH 06/11] xen: backend driver core Gerd Hoffmann
2008-08-11 12:32 ` [Qemu-devel] [PATCH 07/11] xen: add console backend driver Gerd Hoffmann
2008-08-11 12:32 ` [Qemu-devel] [PATCH 08/11] xen: add framebuffer " Gerd Hoffmann
2008-08-11 12:32 ` [Qemu-devel] [PATCH 09/11] xen: add block device " Gerd Hoffmann
2008-08-11 12:32 ` [Qemu-devel] [PATCH 10/11] xen: add net " Gerd Hoffmann
2008-08-11 12:32 ` [Qemu-devel] [PATCH 11/11] xen: blk & nic configuration via cmd line Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1218457970-11707-4-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).