qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org, seabios@seabios.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 3/4] move htonl() + friends to util.h
Date: Fri, 18 Dec 2009 12:16:03 +0100	[thread overview]
Message-ID: <1261134964-12427-4-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1261134964-12427-1-git-send-email-kraxel@redhat.com>

As the next patch will add one more user of the macros move them
to util.h.  Also add the 16bit variants.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 src/coreboot.c |    5 -----
 src/util.h     |    7 +++++++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/coreboot.c b/src/coreboot.c
index 7fa18e4..3dc6a7f 100644
--- a/src/coreboot.c
+++ b/src/coreboot.c
@@ -351,11 +351,6 @@ ulzma(u8 *dst, u32 maxlen, const u8 *src, u32 srclen)
  * Coreboot flash format
  ****************************************************************/
 
-// XXX - optimize
-#define ntohl(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | \
-                  (((x)&0xff0000) >> 8) | (((x)&0xff000000) >> 24))
-#define htonl(x) ntohl(x)
-
 #define CBFS_HEADER_MAGIC 0x4F524243
 #define CBFS_HEADPTR_ADDR 0xFFFFFFFc
 #define CBFS_VERSION1 0x31313131
diff --git a/src/util.h b/src/util.h
index 1eafce0..24e39d1 100644
--- a/src/util.h
+++ b/src/util.h
@@ -367,4 +367,11 @@ extern u8 BiosChecksum;
 // version (auto generated file out/version.c)
 extern const char VERSION[];
 
+// XXX - optimize
+#define ntohl(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | \
+                  (((x)&0xff0000) >> 8) | (((x)&0xff000000) >> 24))
+#define htonl(x) ntohl(x)
+#define ntohs(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8))
+#define htons(x) ntohs(x)
+
 #endif // util.h
-- 
1.6.5.2

  parent reply	other threads:[~2009-12-18 11:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-18 11:16 [Qemu-devel] [PATCH 0/4] qemu option loading Gerd Hoffmann
2009-12-18 11:16 ` [Qemu-devel] [PATCH 1/4] Do not guard qemu shadow ram work around in CONFIG_OPTIONROMS_DEPLOYED Gerd Hoffmann
2009-12-18 11:16 ` [Qemu-devel] [PATCH 2/4] Disable CONFIG_OPTIONROMS_DEPLOYED by default Gerd Hoffmann
2009-12-18 11:16 ` Gerd Hoffmann [this message]
2009-12-18 11:16 ` [Qemu-devel] [PATCH 4/4] qemu: add rom loading via fw_cfg Gerd Hoffmann
2009-12-18 15:41 ` [Qemu-devel] Re: [SeaBIOS] [PATCH 0/4] qemu option loading Anthony Liguori
2009-12-18 15:52   ` Gerd Hoffmann
2009-12-18 16:22     ` Anthony Liguori
2009-12-18 16:37       ` Gerd Hoffmann
2009-12-18 23:40     ` Kevin O'Connor
2009-12-19  0:37 ` Kevin O'Connor
2009-12-19  2:55   ` Anthony Liguori
2009-12-19  3:37     ` Kevin O'Connor

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=1261134964-12427-4-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.org \
    /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).