[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] include/types: move stdlib.h-kind types to common header


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 12 Jan 2023 15:01:27 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fJjRH7h1ZjdWbrus5g79m3fp7lbTH6/IpDJ5Io/pxKM=; b=AWtY/kf6gOv0a8lqD+5AbBSayEOxxh9yffB+smNLJmYACkhhR8NE5RirPRTKN6Pgbij7tIyJnWHystLIskD+gtZWsfX+500csi+L+SJvIe/kd/esfX5+xmMgbnCvTV+GB95u/67WG4C3bgbx+ZW6Yx+BFcpD6/Pyy/YzOuTWs2XDTcNg7O62ZTVWFYOZKfAR/G5D4F2wojXX3RVay7ppRJhB5RAFqxTViPwtLVIigGN/Ubxq95r+T50vvfVEu8za5ILlnfGljY+Sdm+GgjDrolgdWKKtvsHDTb08NEfEdutDqgCXfvcCHQdyp+htQKj6dHblNcoWLHQ0pkircfpy2Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j4TDR/EjdVzfF8gJg0EwKmIRx9k81maO44+S6RcKj1t3j2StYeyE1iT2Yvpk1kCyjW40YZEbUXfZ4hbbOppJUle9ZaBj2e6J7pTqKQtog0C0Qu1Ir+5xOzkwb7ChH9QPU2WprvITr1gdkUcgarlQT1PWQmOu92r/lAJFfIrpqSlhHScSPXGtYoGuQBnELh8gO46M1fAqV4eiLxBfeeUAlr+l5C1Xe//+HNzmd34ZRLEXbYEUf+AjB0sLMI8/BXfHLM+TjDTJB6yT3grUcfktouxnFrhrLYNukROYxNgm2CZ2EOLiE5WdiZZLFkVizWSMQVhw1i2D2gyKM6bl++KP/w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
  • Delivery-date: Thu, 12 Jan 2023 14:01:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

size_t, ssize_t, and ptrdiff_t are all expected to be uniformly defined
on any ports Xen might gain. In particular I hope new ports can rely on
__SIZE_TYPE__ and __PTRDIFF_TYPE__ being made available by the compiler.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
This is just to start with some hopefully uncontroversial low hanging fruit.

--- a/xen/arch/arm/include/asm/types.h
+++ b/xen/arch/arm/include/asm/types.h
@@ -54,19 +54,6 @@ typedef u64 register_t;
 #define PRIregister "016lx"
 #endif
 
-#if defined(__SIZE_TYPE__)
-typedef __SIZE_TYPE__ size_t;
-#else
-typedef unsigned long size_t;
-#endif
-typedef signed long ssize_t;
-
-#if defined(__PTRDIFF_TYPE__)
-typedef __PTRDIFF_TYPE__ ptrdiff_t;
-#else
-typedef signed long ptrdiff_t;
-#endif
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* __ARM_TYPES_H__ */
--- a/xen/arch/x86/include/asm/types.h
+++ b/xen/arch/x86/include/asm/types.h
@@ -32,19 +32,6 @@ typedef unsigned long paddr_t;
 #define INVALID_PADDR (~0UL)
 #define PRIpaddr "016lx"
 
-#if defined(__SIZE_TYPE__)
-typedef __SIZE_TYPE__ size_t;
-#else
-typedef unsigned long size_t;
-#endif
-typedef signed long ssize_t;
-
-#if defined(__PTRDIFF_TYPE__)
-typedef __PTRDIFF_TYPE__ ptrdiff_t;
-#else
-typedef signed long ptrdiff_t;
-#endif
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* __X86_TYPES_H__ */
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -5,6 +5,19 @@
 
 #include <asm/types.h>
 
+#if defined(__SIZE_TYPE__)
+typedef __SIZE_TYPE__ size_t;
+#else
+typedef unsigned long size_t;
+#endif
+typedef signed long ssize_t;
+
+#if defined(__PTRDIFF_TYPE__)
+typedef __PTRDIFF_TYPE__ ptrdiff_t;
+#else
+typedef signed long ptrdiff_t;
+#endif
+
 #define BITS_TO_LONGS(bits) \
     (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)
 #define DECLARE_BITMAP(name,bits) \



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.