From patchwork Tue Feb 14 17:37:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Bugaev X-Patchwork-Id: 1742549 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=mNUWkgHK; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PGT2j4sBKz23r4 for ; Wed, 15 Feb 2023 04:38:37 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F0DAC385B529 for ; Tue, 14 Feb 2023 17:38:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F0DAC385B529 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676396315; bh=Ud/B61nfyhC1dBt+sjdb8DwsK4MWTkqRFpRA1cM26xw=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=mNUWkgHKz/bkviqFDOv2o85e4TM5klKpO9VkR5gjVEV3rNa5sQrELzQ33F7YEYBAd PJYHVh+cmOiXvndqg7prTSIOYeu85doWRSz1KyOk4XcGLtpNIvF1SMRIVudN/eXgSa kUp/pt6umWfnQgKXMSvQXvdIog3UhWIjBRgmhUso= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by sourceware.org (Postfix) with ESMTPS id 24F723858C53 for ; Tue, 14 Feb 2023 17:37:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 24F723858C53 Received: by mail-lf1-x12f.google.com with SMTP id g28so11919272lfv.0 for ; Tue, 14 Feb 2023 09:37:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ud/B61nfyhC1dBt+sjdb8DwsK4MWTkqRFpRA1cM26xw=; b=etDSWmO0oI/roUcUiRY9h1JD7eoaTevQURweHB7UXprAqfbxcs0yS/lNx8lQ/Nu2fS XuI/TMEH72Q48XNYeyXhv4JAerE33Lv2eaOL20Q7Pj32tsVSjT2k5JeHkFv1r9svcBrK PF/lXKa+Qet0yqqftlRHwCrT0TAhzIoIii8jEuSY2vmnLE5E0EcVNx3rGansO78dCF0r V17zrDF7JUSx/3VgSSLAwAdwy+CjAwEeL6vB6zlGSs8woeMNiow/c1nFGfKzgqo1sQbm OfwI2EOap6zNN7cXGDk3m1chL5Ru1NxyNmgVK8YSMvQCY/ZMKUcYnE5Son64seVPAitA eGPw== X-Gm-Message-State: AO0yUKUiWIO/+mUxEVYCbH9i8z0f9dPMSywDA2bABY0tfwYzj4iKMZZs iiwIrKjVQ8Bet+fAfoBnG/k= X-Google-Smtp-Source: AK7set+fOY3TE4atJkxlOiTkuF1ImlVIE5RMP4fA5AK6N1fi7zrAaIdaQziM46EkvfbZQkyddcm2qA== X-Received: by 2002:a05:6512:546:b0:4db:971:82cd with SMTP id h6-20020a056512054600b004db097182cdmr112129lfl.17.1676396251609; Tue, 14 Feb 2023 09:37:31 -0800 (PST) Received: from surface-pro-6.. ([194.190.106.50]) by smtp.gmail.com with ESMTPSA id w12-20020a19c50c000000b004db3e7dfb8csm424185lfe.189.2023.02.14.09.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 09:37:30 -0800 (PST) To: bug-hurd@gnu.org, libc-alpha@sourceware.org Cc: Sergey Bugaev Subject: [PATCH 3/3] htl: Make pthread_mutex_t pointer-aligned Date: Tue, 14 Feb 2023 20:37:22 +0300 Message-Id: <20230214173722.428140-4-bugaevc@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214173722.428140-1-bugaevc@gmail.com> References: <20230214173722.428140-1-bugaevc@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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: , X-Patchwork-Original-From: Sergey Bugaev via Libc-alpha From: Sergey Bugaev Reply-To: Sergey Bugaev Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" This is for future-proofing. On i386, it is 4-byte aligned anyway, but on x86_64, we want it 8-byte aligned, not 4-byte aligned. Signed-off-by: Sergey Bugaev --- .../hurd/htl/bits/types/struct___pthread_mutex.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h b/sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h index d7b239f4..11caa870 100644 --- a/sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h +++ b/sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h @@ -30,20 +30,23 @@ struct __pthread_mutex int __shpid; int __type; int __flags; - unsigned int __reserved1; - unsigned int __reserved2; + union + { + unsigned int __reserved[2]; + void *__pointer_aligned; + }; }; /* Static mutex initializers. */ #define __PTHREAD_MUTEX_INITIALIZER \ - { 0, 0, 0, 0, __PTHREAD_MUTEX_TIMED, 0, 0, 0 } + { 0, 0, 0, 0, __PTHREAD_MUTEX_TIMED, 0, { { 0, 0 } } } /* The +1 is to mantain binary compatibility with the old * libpthread implementation. */ #define __PTHREAD_ERRORCHECK_MUTEX_INITIALIZER \ - { 0, 0, 0, 0, __PTHREAD_MUTEX_ERRORCHECK + 1, 0, 0, 0 } + { 0, 0, 0, 0, __PTHREAD_MUTEX_ERRORCHECK + 1, 0, { { 0, 0 } } } #define __PTHREAD_RECURSIVE_MUTEX_INITIALIZER \ - { 0, 0, 0, 0, __PTHREAD_MUTEX_RECURSIVE + 1, 0, 0, 0 } + { 0, 0, 0, 0, __PTHREAD_MUTEX_RECURSIVE + 1, 0, { { 0, 0 } } } #endif /* bits/types/struct___pthread_mutex.h */