lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1467131978-669-2-git-send-email-ynorov@caviumnetworks.com>
Date:	Tue, 28 Jun 2016 19:39:16 +0300
From:	Yury Norov <ynorov@...iumnetworks.com>
To:	<libc-alpha@...rceware.org>, <linux-kernel@...r.kernel.org>
CC:	<arnd@...db.de>, <catalin.marinas@....com>,
	<marcus.shawcroft@....com>, <philb@....org>, <davem@...emloft.net>,
	<szabolcs.nagy@....com>, <maxim.kuvyrkov@...aro.org>,
	<joseph@...esourcery.com>, <pinskia@...il.com>,
	<bamvor.zhangjian@...wei.com>, <schwab@...e.de>,
	<fweimer@...hat.com>, <Prasun.Kapoor@...ium.com>,
	<cmetcalf@...lanox.com>, <hjl.tools@...il.com>,
	<adhemerval.zanella@...aro.org>,
	Andrew Pinski <apinski@...ium.com>,
	Yury Norov <ynorov@...iumnetworks.com>
Subject: [PATCH 01/23] [AARCH64] define word size for lp64 and ilp32

From: Andrew Pinski <apinski@...ium.com>

Additionally introduce and/or define MIN/MAX macro for size
and ptrdiff types.

Signed-off-by: Andrew Pinski <apinski@...ium.com>
Signed-off-by: Yury Norov <ynorov@...iumnetworks.com>
---
 sysdeps/aarch64/bits/wordsize.h | 25 +++++++++++++++++++++++++
 sysdeps/generic/stdint.h        |  9 +++++++--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 sysdeps/aarch64/bits/wordsize.h

diff --git a/sysdeps/aarch64/bits/wordsize.h b/sysdeps/aarch64/bits/wordsize.h
new file mode 100644
index 0000000..569307a
--- /dev/null
+++ b/sysdeps/aarch64/bits/wordsize.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 2014 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifdef __LP64__
+# define __WORDSIZE			64
+#else
+# define __WORDSIZE			32
+# define __WORDSIZE32_SIZE_ULONG	1
+# define __WORDSIZE32_PTRDIFF_LONG	1
+#endif
+
diff --git a/sysdeps/generic/stdint.h b/sysdeps/generic/stdint.h
index 4427627..cedbe43 100644
--- a/sysdeps/generic/stdint.h
+++ b/sysdeps/generic/stdint.h
@@ -248,8 +248,13 @@ typedef unsigned long long int	uintmax_t;
 #  define PTRDIFF_MIN		(-9223372036854775807L-1)
 #  define PTRDIFF_MAX		(9223372036854775807L)
 # else
-#  define PTRDIFF_MIN		(-2147483647-1)
-#  define PTRDIFF_MAX		(2147483647)
+#  if __WORDSIZE32_PTRDIFF_LONG
+#    define PTRDIFF_MIN		(-2147483647L-1)
+#    define PTRDIFF_MAX		(2147483647L)
+#  else
+#    define PTRDIFF_MIN		(-2147483647-1)
+#    define PTRDIFF_MAX		(2147483647)
+#  endif
 # endif
 
 /* Limits of `sig_atomic_t'.  */
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ