From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1792) id 06BCD3858D3C; Wed, 1 Feb 2023 23:27:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 06BCD3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675294078; bh=py1qfvl8DiGtyb46HhTSD/mE61R4kMo+eOfOrn9/Ld4=; h=From:To:Subject:Date:From; b=oRBU3O3duksJNrh8Xg5ybbG+xZYfUmT7RCu5QIXrW2aYYpvTi2NW0mdECypDlYy+F SLRrcZvQgFh9cN+rO05Arw/69ljsgl8c/NvfzbMYonjZbP+hpAMtPktXgjRF4QDULX 68RG99nZBfNymGvAzYbGcKQ6THAAk/miswEp9Z34= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Samuel Thibault To: glibc-cvs@sourceware.org Subject: [glibc] hurd: Move some i386 bits to x86 X-Act-Checkin: glibc X-Git-Author: Samuel Thibault X-Git-Refname: refs/heads/master X-Git-Oldrev: fa93858a88b109a19656931e68b48d06eedff5b5 X-Git-Newrev: e0dc827bf6e9882e1531905c61a00c83cc91359d Message-Id: <20230201232758.06BCD3858D3C@sourceware.org> Date: Wed, 1 Feb 2023 23:27:58 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e0dc827bf6e9882e1531905c61a00c83cc91359d commit e0dc827bf6e9882e1531905c61a00c83cc91359d Author: Samuel Thibault Date: Thu Feb 2 00:27:26 2023 +0100 hurd: Move some i386 bits to x86 As they will actually be usable on x86_64 too. Diff: --- 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(-) 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 -#include - -#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 #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 - - /* 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 + . */ + +#ifndef _MACH_X86_SYSDEP_H +#define _MACH_X86_SYSDEP_H 1 + +/* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */ +#include +#include + +#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 + +#endif /* mach/x86/sysdep.h */