public inbox for cluster-cvs@sourceware.org help / color / mirror / Atom feed
From: "Fabio M. Di Nitto" <fabbione@fedoraproject.org> To: cluster-cvs-relay@redhat.com Subject: cluster: STABLE3 - libgfs2: Merge linux_endian.h into libgfs2 Date: Thu, 19 Feb 2009 10:12:00 -0000 [thread overview] Message-ID: <20090219100846.9D3B112030E@lists.fedorahosted.org> (raw) Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=dcd42923491b2f82afe632346eef2f059338d993 Commit: dcd42923491b2f82afe632346eef2f059338d993 Parent: 5cbb29ab2a5979ff91f6aa123e12c2c86c0b7912 Author: Steven Whitehouse <swhiteho@redhat.com> AuthorDate: Mon Jan 26 10:13:56 2009 +0000 Committer: Fabio M. Di Nitto <fdinitto@redhat.com> CommitterDate: Thu Feb 19 10:59:54 2009 +0100 libgfs2: Merge linux_endian.h into libgfs2 Its not very large, and we always need it anyway. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> --- gfs2/include/linux_endian.h | 68 ------------------------------------------- gfs2/libgfs2/libgfs2.h | 61 +++++++++++++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 69 deletions(-) diff --git a/gfs2/include/linux_endian.h b/gfs2/include/linux_endian.h deleted file mode 100644 index 43089d2..0000000 --- a/gfs2/include/linux_endian.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef __LINUX_ENDIAN_DOT_H__ -#define __LINUX_ENDIAN_DOT_H__ - - -#include <endian.h> -#include <byteswap.h> - - -/* I'm not sure which versions of alpha glibc/gcc are broken, - so fix all of them. */ -#ifdef __alpha__ -#undef bswap_64 -static __inline__ unsigned long bswap_64(unsigned long x) -{ - unsigned int h = x >> 32; - unsigned int l = x; - - h = bswap_32(h); - l = bswap_32(l); - - return ((unsigned long)l << 32) | h; -} -#endif /* __alpha__ */ - - -#if __BYTE_ORDER == __BIG_ENDIAN - -#define be16_to_cpu(x) (x) -#define be32_to_cpu(x) (x) -#define be64_to_cpu(x) (x) - -#define cpu_to_be16(x) (x) -#define cpu_to_be32(x) (x) -#define cpu_to_be64(x) (x) - -#define le16_to_cpu(x) (bswap_16((x))) -#define le32_to_cpu(x) (bswap_32((x))) -#define le64_to_cpu(x) (bswap_64((x))) - -#define cpu_to_le16(x) (bswap_16((x))) -#define cpu_to_le32(x) (bswap_32((x))) -#define cpu_to_le64(x) (bswap_64((x))) - -#endif /* __BYTE_ORDER == __BIG_ENDIAN */ - - -#if __BYTE_ORDER == __LITTLE_ENDIAN - -#define be16_to_cpu(x) (bswap_16((x))) -#define be32_to_cpu(x) (bswap_32((x))) -#define be64_to_cpu(x) (bswap_64((x))) - -#define cpu_to_be16(x) (bswap_16((x))) -#define cpu_to_be32(x) (bswap_32((x))) -#define cpu_to_be64(x) (bswap_64((x))) - -#define le16_to_cpu(x) (x) -#define le32_to_cpu(x) (x) -#define le64_to_cpu(x) (x) - -#define cpu_to_le16(x) (x) -#define cpu_to_le32(x) (x) -#define cpu_to_le64(x) (x) - -#endif /* __BYTE_ORDER == __LITTLE_ENDIAN */ - - -#endif /* __LINUX_ENDIAN_DOT_H__ */ diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h index 509712a..17b859e 100644 --- a/gfs2/libgfs2/libgfs2.h +++ b/gfs2/libgfs2/libgfs2.h @@ -12,8 +12,9 @@ #include <sys/types.h> #include <linux/types.h> #include <linux/limits.h> +#include <endian.h> +#include <byteswap.h> -#include "linux_endian.h" #include <linux/gfs2_ondisk.h> #include "osi_list.h" #include "copyright.cf" @@ -29,6 +30,64 @@ __BEGIN_DECLS #define FALSE (0) #endif +/* I'm not sure which versions of alpha glibc/gcc are broken, + so fix all of them. */ +#ifdef __alpha__ +#undef bswap_64 +static __inline__ unsigned long bswap_64(unsigned long x) +{ + unsigned int h = x >> 32; + unsigned int l = x; + + h = bswap_32(h); + l = bswap_32(l); + + return ((unsigned long)l << 32) | h; +} +#endif /* __alpha__ */ + + +#if __BYTE_ORDER == __BIG_ENDIAN + +#define be16_to_cpu(x) (x) +#define be32_to_cpu(x) (x) +#define be64_to_cpu(x) (x) + +#define cpu_to_be16(x) (x) +#define cpu_to_be32(x) (x) +#define cpu_to_be64(x) (x) + +#define le16_to_cpu(x) (bswap_16((x))) +#define le32_to_cpu(x) (bswap_32((x))) +#define le64_to_cpu(x) (bswap_64((x))) + +#define cpu_to_le16(x) (bswap_16((x))) +#define cpu_to_le32(x) (bswap_32((x))) +#define cpu_to_le64(x) (bswap_64((x))) + +#endif /* __BYTE_ORDER == __BIG_ENDIAN */ + + +#if __BYTE_ORDER == __LITTLE_ENDIAN + +#define be16_to_cpu(x) (bswap_16((x))) +#define be32_to_cpu(x) (bswap_32((x))) +#define be64_to_cpu(x) (bswap_64((x))) + +#define cpu_to_be16(x) (bswap_16((x))) +#define cpu_to_be32(x) (bswap_32((x))) +#define cpu_to_be64(x) (bswap_64((x))) + +#define le16_to_cpu(x) (x) +#define le32_to_cpu(x) (x) +#define le64_to_cpu(x) (x) + +#define cpu_to_le16(x) (x) +#define cpu_to_le32(x) (x) +#define cpu_to_le64(x) (x) + +#endif /* __BYTE_ORDER == __LITTLE_ENDIAN */ + extern char *prog_name; static __inline__ __attribute__((noreturn)) void die(const char *fmt, ...)
reply other threads:[~2009-02-19 10:12 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20090219100846.9D3B112030E@lists.fedorahosted.org \ --to=fabbione@fedoraproject.org \ --cc=cluster-cvs-relay@redhat.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: linkBe 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 read-only IMAP folder(s) and NNTP newsgroup(s).