From patchwork Wed Feb 1 23:28:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 64123 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C62313857C55 for ; Wed, 1 Feb 2023 23:28:41 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 099203858D3C for ; Wed, 1 Feb 2023 23:28:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 099203858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id DD92B20158; Thu, 2 Feb 2023 00:28:23 +0100 (CET) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NLMCkGcFLXJ3; Thu, 2 Feb 2023 00:28:23 +0100 (CET) Received: from begin (lfbn-bor-1-1163-184.w92-158.abo.wanadoo.fr [92.158.138.184]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id B823920154; Thu, 2 Feb 2023 00:28:22 +0100 (CET) Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1pNMWc-00C8bH-0z; Thu, 02 Feb 2023 00:28:22 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd,commited] hurd: Move some i386 bits to x86 Date: Thu, 2 Feb 2023 00:28:22 +0100 Message-Id: <20230201232822.2892988-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, SPF_PASS, TXREP, URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" 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 --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 */