* grub-core/fs/zfs/zfs_lz4.c: Switch from ad-hoc endiannes and width
macros to GRUB ones.
This commit is contained in:
parent
53a5f5c2f0
commit
c4cf25eef7
2 changed files with 9 additions and 33 deletions
|
@ -1,3 +1,8 @@
|
|||
2013-10-08 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/fs/zfs/zfs_lz4.c: Switch from ad-hoc endiannes and width
|
||||
macros to GRUB ones.
|
||||
|
||||
2013-10-08 Vladimir Testov <vladimir.testov@rosalab.ru>
|
||||
|
||||
* grub-core/gfxmenu/gui_list.c (draw_scrollbar): Fixed rare
|
||||
|
@ -7,7 +12,7 @@
|
|||
|
||||
2013-10-08 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/random_unix.c: Add NetBSD and Mac OS X to verified list.
|
||||
* util/random_unix.c: Add NetBSD, Solaris and Mac OS X to verified list.
|
||||
|
||||
2013-10-08 Vladimir Testov <vladimir.testov@rosalab.ru>
|
||||
|
||||
|
|
|
@ -45,31 +45,12 @@ static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest,
|
|||
*/
|
||||
|
||||
/* 32 or 64 bits ? */
|
||||
#if (defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) || \
|
||||
defined(__amd64) || defined(__ppc64__) || defined(_WIN64) || \
|
||||
defined(__LP64__) || defined(_LP64))
|
||||
#if (GRUB_CPU_SIZEOF_VOID_P == 8)
|
||||
#define LZ4_ARCH64 1
|
||||
#else
|
||||
#define LZ4_ARCH64 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Little Endian or Big Endian?
|
||||
* Note: overwrite the below #define if you know your architecture endianess.
|
||||
*/
|
||||
#if (defined(__BIG_ENDIAN__) || defined(__BIG_ENDIAN) || \
|
||||
defined(_BIG_ENDIAN) || defined(_ARCH_PPC) || defined(__PPC__) || \
|
||||
defined(__PPC) || defined(PPC) || defined(__powerpc__) || \
|
||||
defined(__powerpc) || defined(powerpc) || \
|
||||
((defined(__BYTE_ORDER__)&&(__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))))
|
||||
#define LZ4_BIG_ENDIAN 1
|
||||
#else
|
||||
/*
|
||||
* Little Endian assumed. PDP Endian and other very rare endian format
|
||||
* are unsupported.
|
||||
*/
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compiler Options
|
||||
*/
|
||||
|
@ -77,9 +58,6 @@ static int LZ4_uncompress_unknownOutputSize(const char *source, char *dest,
|
|||
|
||||
#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
|
||||
|
||||
#define lz4_bswap16(x) ((unsigned short int) ((((x) >> 8) & 0xffu) \
|
||||
| (((x) & 0xffu) << 8)))
|
||||
|
||||
#if (GCC_VERSION >= 302) || (__INTEL_COMPILER >= 800) || defined(__clang__)
|
||||
#define expect(expr, value) (__builtin_expect((expr), (value)))
|
||||
#else
|
||||
|
@ -147,15 +125,8 @@ typedef struct _U64_S {
|
|||
#define INITBASE(base) const int base = 0
|
||||
#endif
|
||||
|
||||
#if (defined(LZ4_BIG_ENDIAN) && !defined(BIG_ENDIAN_NATIVE_BUT_INCOMPATIBLE))
|
||||
#define LZ4_READ_LITTLEENDIAN_16(d, s, p) \
|
||||
{ U16 v = A16(p); v = lz4_bswap16(v); d = (s) - v; }
|
||||
#define LZ4_WRITE_LITTLEENDIAN_16(p, i) \
|
||||
{ U16 v = (U16)(i); v = lz4_bswap16(v); A16(p) = v; p += 2; }
|
||||
#else
|
||||
#define LZ4_READ_LITTLEENDIAN_16(d, s, p) { d = (s) - A16(p); }
|
||||
#define LZ4_WRITE_LITTLEENDIAN_16(p, v) { A16(p) = v; p += 2; }
|
||||
#endif
|
||||
#define LZ4_READ_LITTLEENDIAN_16(d, s, p) { d = (s) - grub_le_to_cpu16 (A16 (p)); }
|
||||
#define LZ4_WRITE_LITTLEENDIAN_16(p, v) { A16(p) = grub_cpu_to_le16 (v); p += 2; }
|
||||
|
||||
/* Macros */
|
||||
#define LZ4_WILDCOPY(s, d, e) do { LZ4_COPYPACKET(s, d) } while (d < e);
|
||||
|
|
Loading…
Reference in a new issue