Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 1 | From c5e7928217ee73640d25c6471c4619601cb1ba19 Mon Sep 17 00:00:00 2001 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 2 | From: Andrea Adami <andrea.adami@gmail.com> |
| 3 | Date: Thu, 19 Apr 2018 10:47:17 +0200 |
Brad Bishop | 26bdd44 | 2019-08-16 17:08:17 -0400 | [diff] [blame] | 4 | Subject: [PATCH] kexec/arm64: image-header.h: add macro for le64toh |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 5 | |
| 6 | Fix |
| 7 | |
| 8 | kexec-arm64.c:(.text+0x370): undefined reference to `le64toh' |
| 9 | kexec-arm64.c:(.text+0x380): undefined reference to `le64toh' |
| 10 | |
| 11 | Upstream-Status: Inappropriate [klibc specific] |
| 12 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> |
| 13 | |
| 14 | --- |
| 15 | kexec/arch/arm64/image-header.h | 9 +++++++++ |
| 16 | 1 file changed, 9 insertions(+) |
| 17 | |
| 18 | diff --git a/kexec/arch/arm64/image-header.h b/kexec/arch/arm64/image-header.h |
| 19 | index 158d411..10ed2d6 100644 |
| 20 | --- a/kexec/arch/arm64/image-header.h |
| 21 | +++ b/kexec/arch/arm64/image-header.h |
| 22 | @@ -8,6 +8,15 @@ |
| 23 | #include <endian.h> |
| 24 | #include <stdint.h> |
| 25 | |
| 26 | +#ifdef __KLIBC__ |
| 27 | +#if __BYTE_ORDER == __LITTLE_ENDIAN |
| 28 | +#define le64toh(x) (x) |
| 29 | +#endif |
| 30 | +#if __BYTE_ORDER == __BIG_ENDIAN |
| 31 | +#define le64toh(x) __bswap_64(x) |
| 32 | +#endif |
| 33 | +#endif |
| 34 | + |
| 35 | /** |
| 36 | * struct arm64_image_header - arm64 kernel image header. |
| 37 | * |