public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Sergey Bugaev <bugaevc@gmail.com>
To: bug-hurd@gnu.org, libc-alpha@sourceware.org
Cc: Sergey Bugaev <bugaevc@gmail.com>
Subject: [PATCH 3/3] htl: Make pthread_mutex_t pointer-aligned
Date: Tue, 14 Feb 2023 20:37:22 +0300	[thread overview]
Message-ID: <20230214173722.428140-4-bugaevc@gmail.com> (raw)
In-Reply-To: <20230214173722.428140-1-bugaevc@gmail.com>

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 <bugaevc@gmail.com>
---
 .../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 */
-- 
2.39.1


  parent reply	other threads:[~2023-02-14 17:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14 17:37 [PATCH 0/3] x86_64-gnu follow-ups Sergey Bugaev
2023-02-14 17:37 ` [PATCH 1/3] hurd: i386 TLS tweaks Sergey Bugaev
2023-02-14 19:27   ` Samuel Thibault
2023-02-14 17:37 ` [PATCH 2/3] mach: undef ENTRY2 Sergey Bugaev
2023-02-14 19:30   ` Samuel Thibault
2023-02-14 17:37 ` Sergey Bugaev [this message]
2023-02-27 22:06   ` [PATCH 3/3] htl: Make pthread_mutex_t pointer-aligned Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230214173722.428140-4-bugaevc@gmail.com \
    --to=bugaevc@gmail.com \
    --cc=bug-hurd@gnu.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).