diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2009-12-18 12:16:03 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-12-18 09:37:57 -0600 |
commit | 02e60532453d18eafcd5e00f3383ae29f7c468f9 (patch) | |
tree | ddb7839c5ed1ce50341d2096b207bb70974b294c /src/util.h | |
parent | bb627052535339debaa1259b7273172c9181d1a3 (diff) | |
download | seabios-02e60532453d18eafcd5e00f3383ae29f7c468f9.tar.gz |
move htonl() + friends to util.h
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>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 |