]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
x86: Fix ptrdiff_t for x86_64
authorRichard Weinberger <richard@nod.at>
Fri, 2 Aug 2024 10:08:43 +0000 (12:08 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 15 Aug 2024 22:14:36 +0000 (16:14 -0600)
sbrk() assumes ptrdiff_t is large enough to enlarge/shrink the heap
by LONG_MIN/LONG_MAX.
So, use the long type, also to match the rest of the Linux ecosystem.

Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/x86/include/asm/posix_types.h

index dbcea7f47ff9cf02b7be510e557963681e45dfac..e1ed9bcabc7636922e3505c159317c327d24d1ad 100644 (file)
@@ -20,11 +20,12 @@ typedef unsigned short      __kernel_gid_t;
 #if defined(__x86_64__)
 typedef unsigned long  __kernel_size_t;
 typedef long           __kernel_ssize_t;
+typedef long           __kernel_ptrdiff_t;
 #else
 typedef unsigned int   __kernel_size_t;
 typedef int            __kernel_ssize_t;
-#endif
 typedef int            __kernel_ptrdiff_t;
+#endif
 typedef long           __kernel_time_t;
 typedef long           __kernel_suseconds_t;
 typedef long           __kernel_clock_t;