]> granicus.if.org Git - strace/commitdiff
Move definition of personality macros to arch_defs_.h
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sat, 20 Jan 2018 03:51:29 +0000 (04:51 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 21 Jan 2018 01:46:04 +0000 (01:46 +0000)
* supported_personalities.h: Remove.
* defs.h: Do not include it.
* linux/arch_defs_.h [!DEFAULT_PERSONALITY] (DEFAULT_PERSONALITY): New
macro.
[!SUPPORTED_PERSONALITIES] (SUPPORTED_PERSONALITIES): Likewise.
* linux/aarch64/arch_defs_.h (SUPPORTED_PERSONALITIES): New macro.
* linux/riscv/arch_defs_.h: Likewise.
* linux/s390x/arch_defs_.h: Likewise.
* linux/sparc64/arch_defs_.h: Likewise.
* linux/x32/arch_defs_.h: Likewise.
* linux/x86_64/arch_defs_.h: Likewise.
* linux/powerpc64/arch_defs_.h: New file.
* linux/tile/arch_defs_.h: Likewise.
* Makefile.am (EXTRA_DIST): Add them.
(strace_SOURCES): Remove supported_personalities.h.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
12 files changed:
Makefile.am
defs.h
linux/aarch64/arch_defs_.h
linux/arch_defs_.h
linux/powerpc64/arch_defs_.h [new file with mode: 0644]
linux/riscv/arch_defs_.h
linux/s390x/arch_defs_.h
linux/sparc64/arch_defs_.h
linux/tile/arch_defs_.h [new file with mode: 0644]
linux/x32/arch_defs_.h
linux/x86_64/arch_defs_.h
supported_personalities.h [deleted file]

index d07a9b8073b002fd0e55f1b46712e63208c2aa0f..e584bea22cececf92531a5a83a5f17fca21f8037 100644 (file)
@@ -294,7 +294,6 @@ strace_SOURCES =    \
        strace.c        \
        string_to_uint.h \
        string_to_uint.c \
-       supported_personalities.h \
        swapon.c        \
        syscall.c       \
        sysctl.c        \
@@ -658,6 +657,7 @@ EXTRA_DIST =                                \
        linux/powerpc/set_scno.c        \
        linux/powerpc/syscallent.h      \
        linux/powerpc/userent.h         \
+       linux/powerpc64/arch_defs_.h    \
        linux/powerpc64/arch_regs.c     \
        linux/powerpc64/arch_regs.h     \
        linux/powerpc64/arch_rt_sigframe.c\
@@ -812,6 +812,7 @@ EXTRA_DIST =                                \
        linux/sparc64/userent.h         \
        linux/subcall.h                 \
        linux/syscall.h                 \
+       linux/tile/arch_defs_.h         \
        linux/tile/arch_regs.c          \
        linux/tile/arch_regs.h          \
        linux/tile/arch_rt_sigframe.c   \
diff --git a/defs.h b/defs.h
index b4450ba82d7c77eb8bf5a2cfd996c19e764016d9..6f4c5e852cd469ee7891a9a42752e821e6789040 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -60,7 +60,6 @@
 #include "macros.h"
 #include "mpers_type.h"
 #include "string_to_uint.h"
-#include "supported_personalities.h"
 #include "sysent.h"
 #include "xmalloc.h"
 
index 4d264a1d72b9974917ddc532aaa0fa9b9060b1a1..ad9748ab95fae325bc4edb4c2dafdb03ab2ccb48 100644 (file)
@@ -1,2 +1,3 @@
 #define HAVE_ARCH_OLD_MMAP 1
 #define HAVE_ARCH_UID16_SYSCALLS 1
+#define SUPPORTED_PERSONALITIES 2
index af6625ed1cd0fe96b9f360c53e2585bd80247983..c2aa62f8751a2a2f57d0924e90b961e1de8eba18 100644 (file)
 #ifndef HAVE_ARCH_UID16_SYSCALLS
 # define HAVE_ARCH_UID16_SYSCALLS 0
 #endif
+
+#ifndef DEFAULT_PERSONALITY
+# define DEFAULT_PERSONALITY 0
+#endif
+
+#ifndef SUPPORTED_PERSONALITIES
+# define SUPPORTED_PERSONALITIES 1
+#endif
diff --git a/linux/powerpc64/arch_defs_.h b/linux/powerpc64/arch_defs_.h
new file mode 100644 (file)
index 0000000..640d68e
--- /dev/null
@@ -0,0 +1 @@
+#define SUPPORTED_PERSONALITIES 2
index 0c9ca19511ec129d188c0e9128117578c91a01de..33494f5d9e708e26ade3e1e7a6f242b112a3c27e 100644 (file)
@@ -1 +1,2 @@
 #define HAVE_ARCH_UID16_SYSCALLS 1
+#define SUPPORTED_PERSONALITIES 2
index 59fee837f082b175bd63dbd1fea034893d8f2725..bed2f2d66d7678f23b0ee8fb1e3b2dcbd6c30425 100644 (file)
@@ -1,3 +1,4 @@
 #define HAVE_ARCH_OLD_MMAP 1
 #define HAVE_ARCH_OLD_MMAP_PGOFF 1
 #define HAVE_ARCH_UID16_SYSCALLS 1
+#define SUPPORTED_PERSONALITIES 2
index 5240c36324eb810033fb8ed5aca9609b3d4f4ac1..800d67271b3b4b2fe8139cb5d62642c34e127606 100644 (file)
@@ -1,3 +1,4 @@
 #define HAVE_ARCH_GETRVAL2 1
 #define HAVE_ARCH_UID16_SYSCALLS 1
 #define HAVE_ARCH_SA_RESTORER 1
+#define SUPPORTED_PERSONALITIES 2
diff --git a/linux/tile/arch_defs_.h b/linux/tile/arch_defs_.h
new file mode 100644 (file)
index 0000000..34a5624
--- /dev/null
@@ -0,0 +1,5 @@
+#define SUPPORTED_PERSONALITIES 2
+
+#ifdef __tilepro__
+# define DEFAULT_PERSONALITY 1
+#endif
index 4d264a1d72b9974917ddc532aaa0fa9b9060b1a1..ad9748ab95fae325bc4edb4c2dafdb03ab2ccb48 100644 (file)
@@ -1,2 +1,3 @@
 #define HAVE_ARCH_OLD_MMAP 1
 #define HAVE_ARCH_UID16_SYSCALLS 1
+#define SUPPORTED_PERSONALITIES 2
index 4d264a1d72b9974917ddc532aaa0fa9b9060b1a1..1401c6a87b1739fb4655059c96281ad80a5ff127 100644 (file)
@@ -1,2 +1,3 @@
 #define HAVE_ARCH_OLD_MMAP 1
 #define HAVE_ARCH_UID16_SYSCALLS 1
+#define SUPPORTED_PERSONALITIES 3
diff --git a/supported_personalities.h b/supported_personalities.h
deleted file mode 100644 (file)
index 58ee027..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2001-2017 The strace developers.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef STRACE_SUPPORTED_PERSONALITIES_H
-#define STRACE_SUPPORTED_PERSONALITIES_H
-
-#if defined X86_64
-# define SUPPORTED_PERSONALITIES 3
-#elif defined AARCH64 \
-   || defined POWERPC64 \
-   || defined RISCV \
-   || defined S390X \
-   || defined SPARC64 \
-   || defined TILE \
-   || defined X32
-# define SUPPORTED_PERSONALITIES 2
-#else
-# define SUPPORTED_PERSONALITIES 1
-#endif
-
-#if defined TILE && defined __tilepro__
-# define DEFAULT_PERSONALITY 1
-#else
-# define DEFAULT_PERSONALITY 0
-#endif
-
-#endif /* !STRACE_SUPPORTED_PERSONALITIES_H */