diff mbox series

[hurd,commited] hurd: Move some i386 bits to x86

Message ID 20230201232822.2892988-1-samuel.thibault@ens-lyon.org
State New
Headers show
Series [hurd,commited] hurd: Move some i386 bits to x86 | expand

Commit Message

Samuel Thibault Feb. 1, 2023, 11:28 p.m. UTC
As they will actually be usable on x86_64 too.
---
 sysdeps/mach/hurd/Makefile                   | 62 +++++++++++++++
 sysdeps/mach/hurd/i386/Makefile              | 79 --------------------
 sysdeps/mach/hurd/x86/Makefile               | 16 ++++
 sysdeps/mach/hurd/{i386 => x86}/ioperm.c     |  0
 sysdeps/mach/hurd/{i386 => x86}/sys/io.h     |  0
 sysdeps/mach/i386/Implies                    |  1 +
 sysdeps/mach/i386/sysdep.h                   | 27 +------
 sysdeps/mach/{i386 => x86}/bits/mach/param.h |  2 +-
 sysdeps/mach/{i386 => x86}/machine-lock.h    |  2 +-
 sysdeps/mach/x86/sysdep.h                    | 47 ++++++++++++
 10 files changed, 129 insertions(+), 107 deletions(-)
 create mode 100644 sysdeps/mach/hurd/x86/Makefile
 rename sysdeps/mach/hurd/{i386 => x86}/ioperm.c (100%)
 rename sysdeps/mach/hurd/{i386 => x86}/sys/io.h (100%)
 create mode 100644 sysdeps/mach/i386/Implies
 rename sysdeps/mach/{i386 => x86}/bits/mach/param.h (94%)
 rename sysdeps/mach/{i386 => x86}/machine-lock.h (97%)
 create mode 100644 sysdeps/mach/x86/sysdep.h
diff mbox series

Patch

diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile
index 76c2774ef0..d0e3da03ca 100644
--- a/sysdeps/mach/hurd/Makefile
+++ b/sysdeps/mach/hurd/Makefile
@@ -227,3 +227,65 @@  LDLIBS-pthread.so += $(objdir)/hurd/libhurduser.so
 LDLIBS-c_malloc_debug.so += $(link-rpcuserlibs)
 
 endif	# in-Makerules
+
+# For bug 23286
+ifeq ($(subdir),hurd)
+test-xfail-check-abi-libhurduser = yes
+endif
+ifeq ($(subdir),mach)
+test-xfail-check-abi-libmachuser = yes
+endif
+
+# For bug 25521
+# (setpshared support)
+ifeq ($(subdir),malloc)
+test-xfail-tst-mallocfork2 = yes
+test-xfail-tst-mallocfork2-mcheck = yes
+test-xfail-tst-mallocfork2-malloc-check = yes
+test-xfail-tst-mallocfork2-malloc-hugetlb1 = yes
+test-xfail-tst-mallocfork2-malloc-hugetlb2 = yes
+endif
+ifeq ($(subdir),htl)
+test-xfail-tst-mutex4 = yes
+test-xfail-tst-cancel16 = yes
+test-xfail-tst-cancelx16 = yes
+test-xfail-tst-cond4 = yes
+test-xfail-tst-cond6 = yes
+test-xfail-tst-cond12 = yes
+test-xfail-tst-cond13 = yes
+test-xfail-tst-cond23 = yes
+test-xfail-tst-rwlock4 = yes
+test-xfail-tst-rwlock12 = yes
+test-xfail-tst-barrier2 = yes
+test-xfail-tst-pututxline-cache = yes
+test-xfail-tst-pututxline-lockfail = yes
+test-xfail-tst-flock2 = yes
+test-xfail-tst-signal1 = yes
+test-xfail-tst-signal2 = yes
+endif
+
+ifeq ($(subdir),htl)
+# For bug 25522
+# (setprotocol support)
+test-xfail-tst-cond24 = yes
+test-xfail-tst-cond25 = yes
+
+# For bug 25563
+# (robust support against dead threads)
+test-xfail-tst-robust1 = yes
+test-xfail-tst-robust2 = yes
+test-xfail-tst-robust3 = yes
+test-xfail-tst-robust4 = yes
+test-xfail-tst-robust5 = yes
+test-xfail-tst-robust6 = yes
+test-xfail-tst-robust7 = yes
+test-xfail-tst-robust9 = yes
+endif
+
+ifeq ($(subdir),elf)
+# We do use nested functions involving creation of trampolines, notably for
+# callbacks whose parameters don't permit to get the context parameters.
+check-execstack-xfail += ld.so libc.so libpthread.so
+# We always create a thread for signals
+test-xfail-tst-single_threaded-pthread-static = yes
+endif
diff --git a/sysdeps/mach/hurd/i386/Makefile b/sysdeps/mach/hurd/i386/Makefile
index ec58bb18f6..8fe93ef27a 100644
--- a/sysdeps/mach/hurd/i386/Makefile
+++ b/sysdeps/mach/hurd/i386/Makefile
@@ -1,16 +1,3 @@ 
-ifeq ($(subdir),misc)
-sysdep_routines += ioperm
-sysdep_headers += sys/io.h
-endif
-
-ifeq ($(subdir),debug)
-gen-as-const-headers += signal-defines.sym
-endif
-
-ifeq ($(subdir),setjmp)
-gen-as-const-headers += signal-defines.sym
-endif
-
 ifeq ($(subdir),csu)
 ifeq (yes,$(build-shared))
 sysdep_routines += divdi3
@@ -24,69 +11,3 @@  ifeq ($(subdir),conform)
 # (type conformance)
 conformtest-xfail-conds += i386-gnu
 endif
-
-# For bug 23286
-ifeq ($(subdir),hurd)
-test-xfail-check-abi-libhurduser = yes
-endif
-ifeq ($(subdir),mach)
-test-xfail-check-abi-libmachuser = yes
-endif
-
-# For bug 25521
-# (setpshared support)
-ifeq ($(subdir),malloc)
-test-xfail-tst-mallocfork2 = yes
-test-xfail-tst-mallocfork2-mcheck = yes
-test-xfail-tst-mallocfork2-malloc-check = yes
-test-xfail-tst-mallocfork2-malloc-hugetlb1 = yes
-test-xfail-tst-mallocfork2-malloc-hugetlb2 = yes
-endif
-ifeq ($(subdir),htl)
-test-xfail-tst-mutex4 = yes
-test-xfail-tst-cancel16 = yes
-test-xfail-tst-cancelx16 = yes
-test-xfail-tst-cond4 = yes
-test-xfail-tst-cond6 = yes
-test-xfail-tst-cond12 = yes
-test-xfail-tst-cond13 = yes
-test-xfail-tst-cond23 = yes
-test-xfail-tst-rwlock4 = yes
-test-xfail-tst-rwlock12 = yes
-test-xfail-tst-barrier2 = yes
-test-xfail-tst-pututxline-cache = yes
-test-xfail-tst-pututxline-lockfail = yes
-test-xfail-tst-flock2 = yes
-test-xfail-tst-signal1 = yes
-test-xfail-tst-signal2 = yes
-endif
-
-ifeq ($(subdir),htl)
-# For bug 25522
-# (setprotocol support)
-test-xfail-tst-cond24 = yes
-test-xfail-tst-cond25 = yes
-
-# For bug 25563
-# (robust support against dead threads)
-test-xfail-tst-robust1 = yes
-test-xfail-tst-robust2 = yes
-test-xfail-tst-robust3 = yes
-test-xfail-tst-robust4 = yes
-test-xfail-tst-robust5 = yes
-test-xfail-tst-robust6 = yes
-test-xfail-tst-robust7 = yes
-test-xfail-tst-robust9 = yes
-endif
-
-ifeq ($(subdir),elf)
-# We do use nested functions involving creation of trampolines, notably for
-# callbacks whose parameters don't permit to get the context parameters.
-check-execstack-xfail += ld.so libc.so libpthread.so
-# We always create a thread for signals
-test-xfail-tst-single_threaded-pthread-static = yes
-endif
-
-ifeq ($(subdir),stdlib)
-gen-as-const-headers += ucontext_i.sym
-endif
diff --git a/sysdeps/mach/hurd/x86/Makefile b/sysdeps/mach/hurd/x86/Makefile
new file mode 100644
index 0000000000..29371f6c9a
--- /dev/null
+++ b/sysdeps/mach/hurd/x86/Makefile
@@ -0,0 +1,16 @@ 
+ifeq ($(subdir),misc)
+sysdep_routines += ioperm
+sysdep_headers += sys/io.h
+endif
+
+ifeq ($(subdir),debug)
+gen-as-const-headers += signal-defines.sym
+endif
+
+ifeq ($(subdir),setjmp)
+gen-as-const-headers += signal-defines.sym
+endif
+
+ifeq ($(subdir),stdlib)
+gen-as-const-headers += ucontext_i.sym
+endif
diff --git a/sysdeps/mach/hurd/i386/ioperm.c b/sysdeps/mach/hurd/x86/ioperm.c
similarity index 100%
rename from sysdeps/mach/hurd/i386/ioperm.c
rename to sysdeps/mach/hurd/x86/ioperm.c
diff --git a/sysdeps/mach/hurd/i386/sys/io.h b/sysdeps/mach/hurd/x86/sys/io.h
similarity index 100%
rename from sysdeps/mach/hurd/i386/sys/io.h
rename to sysdeps/mach/hurd/x86/sys/io.h
diff --git a/sysdeps/mach/i386/Implies b/sysdeps/mach/i386/Implies
new file mode 100644
index 0000000000..da8291f4c8
--- /dev/null
+++ b/sysdeps/mach/i386/Implies
@@ -0,0 +1 @@ 
+mach/x86
diff --git a/sysdeps/mach/i386/sysdep.h b/sysdeps/mach/i386/sysdep.h
index 19eab418a7..33bd5ee402 100644
--- a/sysdeps/mach/i386/sysdep.h
+++ b/sysdeps/mach/i386/sysdep.h
@@ -19,37 +19,12 @@ 
 #ifndef _MACH_I386_SYSDEP_H
 #define _MACH_I386_SYSDEP_H 1
 
-/* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO.  */
-#include <dl-sysdep.h>
-#include <tls.h>
-
-#define LOSE asm volatile ("hlt")
-
-#define SNARF_ARGS(entry_sp, argc, argv, envp)				      \
-  do									      \
-    {									      \
-      char **p;								      \
-      argc = (int) *entry_sp;						      \
-      argv = (char **) (entry_sp + 1);					      \
-      p = argv;								      \
-      while (*p++ != NULL)						      \
-	;								      \
-      if (p >= (char **) argv[0])					      \
-	--p;								      \
-      envp = p;							      \
-    } while (0)
+#include <sysdeps/mach/x86/sysdep.h>
 
 #define RETURN_TO(sp, pc, retval) \
   asm volatile ("movl %0, %%esp; jmp %*%1 # %2" \
 		: : "g" (sp), "r" (pc), "a" (retval))
 
-
-#define STACK_GROWTH_DOWN
-
-/* Get the machine-independent Mach definitions.  */
-#include <sysdeps/mach/sysdep.h>
-
-
 /* This should be rearranged, but at the moment this file provides
    the most useful definitions for assembler syntax details.  */
 #undef ENTRY
diff --git a/sysdeps/mach/i386/bits/mach/param.h b/sysdeps/mach/x86/bits/mach/param.h
similarity index 94%
rename from sysdeps/mach/i386/bits/mach/param.h
rename to sysdeps/mach/x86/bits/mach/param.h
index 4d3ec5da36..cef2bdb165 100644
--- a/sysdeps/mach/i386/bits/mach/param.h
+++ b/sysdeps/mach/x86/bits/mach/param.h
@@ -1,4 +1,4 @@ 
-/* Old-style Unix parameters and limits.  i386 Mach version.
+/* Old-style Unix parameters and limits.  x86 Mach version.
    Copyright (C) 1993-2023 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
diff --git a/sysdeps/mach/i386/machine-lock.h b/sysdeps/mach/x86/machine-lock.h
similarity index 97%
rename from sysdeps/mach/i386/machine-lock.h
rename to sysdeps/mach/x86/machine-lock.h
index 53d2c95c40..6ce884a8c3 100644
--- a/sysdeps/mach/i386/machine-lock.h
+++ b/sysdeps/mach/x86/machine-lock.h
@@ -1,4 +1,4 @@ 
-/* Machine-specific definition for spin locks.  i386 version.
+/* Machine-specific definition for spin locks.  x86 version.
    Copyright (C) 1994-2023 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
diff --git a/sysdeps/mach/x86/sysdep.h b/sysdeps/mach/x86/sysdep.h
new file mode 100644
index 0000000000..90f295b27d
--- /dev/null
+++ b/sysdeps/mach/x86/sysdep.h
@@ -0,0 +1,47 @@ 
+/* Copyright (C) 1991-2023 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _MACH_X86_SYSDEP_H
+#define _MACH_X86_SYSDEP_H 1
+
+/* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO.  */
+#include <dl-sysdep.h>
+#include <tls.h>
+
+#define LOSE asm volatile ("hlt")
+
+#define SNARF_ARGS(entry_sp, argc, argv, envp)				      \
+  do									      \
+    {									      \
+      char **p;								      \
+      argc = (int) *entry_sp;						      \
+      argv = (char **) (entry_sp + 1);					      \
+      p = argv;								      \
+      while (*p++ != NULL)						      \
+	;								      \
+      if (p >= (char **) argv[0])					      \
+	--p;								      \
+      envp = p;							      \
+    } while (0)
+
+#define STACK_GROWTH_DOWN
+
+/* Get the machine-independent Mach definitions.  */
+#include <sysdeps/mach/sysdep.h>
+
+#endif /* mach/x86/sysdep.h */