From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by sourceware.org (Postfix) with ESMTPS id 1DA26385734C for ; Mon, 10 Apr 2023 20:46:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1DA26385734C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x22d.google.com with SMTP id z16so3701335oib.9 for ; Mon, 10 Apr 2023 13:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681159596; x=1683751596; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8IyP/V3j9Ll0MaikZsCGxuGjKDgV3MkJ66J9ZZ1Bqvk=; b=kdKMXxOQdr5hNPt2SpETuXNY97ucWKmcWQAUWZ+0HU0+p6oJnK9Ny1ROtmR9ZeYJ5O eFV9PCQXMif59yixOhxUeCmG+lVg8xkRNzPvC2Axmqffiuh9lZW8uzVJYETD8d/+U6CN 1ZJ1nX3IHV/nIgJwdtzeSv+j3zT8N56N91C9Y92aP4NVeAeUuMnDsYUxj8rIGdGU/LIm 2685/Ssrz1uM4nZdvbPAfh2Eni8J9UvOBrYchEaWf9JlIN8neago6RjOnPltZblDVx6o 5HHpYM+3NVaKaICpE4p6N+4j4E8jVzT3T16uXo7l117oUVPEbaYN8gcNxbGtEta6+5g/ dj8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681159596; x=1683751596; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8IyP/V3j9Ll0MaikZsCGxuGjKDgV3MkJ66J9ZZ1Bqvk=; b=MKGkVjhciK/TiAqdSZXLFaiox27IatFYEZ9X1qJQPc42UsUUqbh/P5F+Jb+mx9Ewer tUGjYv2I/rCt38NkrI5H6P74wewN+XSZyeoeWSr3AIme7JcwVc0dh48nHZqQWWR6fC5A Mtd40dbo+9xqMFsgA+7s4zZXrQT2rgtQRNoaQHtz+6I1JHxL/dHqgjN2Em0xG3qGFU9m ymqHqoZuDTf3WjiNX4Cq3qaS/3xblv8Z2gs4uCk6Z1Ipz/32mdYl+srDxvaGLHvLGiE0 Qr5BjzNKrRAwkzn6ZnjdyLD4FTXHXbH7wyFU48vM+wvQPkLjk1zzWbeE6jh6vF42Yu7t AI5Q== X-Gm-Message-State: AAQBX9epC5vmYgYBWzSLhSRKfR4bnbcpLU7csHcYbo8lCJ5QaLVjbMDp D8iLW9NcWwbI1lDm/Svi9WGJfNjsmngaEDgrO/4uqQ== X-Google-Smtp-Source: AKy350bBr1HbpmCXIM/g3p5H0YgqXVoO2gu7MT8ZlOjgB9vRzYkgzsKSv2jHXhtbkW/HhcPf+b6BWg== X-Received: by 2002:aca:2b13:0:b0:389:8a25:1897 with SMTP id i19-20020aca2b13000000b003898a251897mr177210oik.12.1681159594289; Mon, 10 Apr 2023 13:46:34 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c2:55a1:d59a:609a:284:6ed]) by smtp.gmail.com with ESMTPSA id p5-20020acabf05000000b003896f132821sm4865732oif.41.2023.04.10.13.46.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 13:46:33 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v5 17/22] m68k: Fix Race conditions in pthread cancellation [BZ#12683] Date: Mon, 10 Apr 2023 17:46:09 -0300 Message-Id: <20230410204614.4129551-9-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230410204614.4129551-1-adhemerval.zanella@linaro.org> References: <20230410195907.4123869-1-adhemerval.zanella@linaro.org> <20230410204614.4129551-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,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 List-Id: By adding the required syscall_cancel.S. Checked on m68k-linux-gnu. --- sysdeps/unix/sysv/linux/m68k/syscall_cancel.S | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/m68k/syscall_cancel.S diff --git a/sysdeps/unix/sysv/linux/m68k/syscall_cancel.S b/sysdeps/unix/sysv/linux/m68k/syscall_cancel.S new file mode 100644 index 0000000000..8923bcc71c --- /dev/null +++ b/sysdeps/unix/sysv/linux/m68k/syscall_cancel.S @@ -0,0 +1,84 @@ +/* Cancellable syscall wrapper. Linux/m68k version. + Copyright (C) 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 + . */ + +#include +#include + +/* long int __syscall_cancel_arch (int *cancelhandling, + __syscall_arg_t nr, + __syscall_arg_t arg1, + __syscall_arg_t arg2, + __syscall_arg_t arg3, + __syscall_arg_t arg4, + __syscall_arg_t arg5, + __syscall_arg_t arg6) */ + + +ENTRY (__syscall_cancel_arch) +#ifdef __mcoldfire__ + lea (-16,%sp),%sp + movem.l %d2-%d5,(%sp) +#else + movem.l %d2-%d5,-(%sp) +#endif + cfi_def_cfa_offset (20) + cfi_offset (2, -20) + cfi_offset (3, -16) + cfi_offset (4, -12) + cfi_offset (5, -8) + + .global __syscall_cancel_arch_start +__syscall_cancel_arch_start: + + move.l 20(%sp),%a0 + move.l (%a0),%d0 +#ifdef __mcoldfire__ + move.w %d0,%ccr + jeq 1f +#else + btst #TCB_CANCELED_BIT,%d0 + jne 1f +#endif + + move.l 48(%sp),%a0 + move.l 44(%sp),%d5 + move.l 40(%sp),%d4 + move.l 36(%sp),%d3 + move.l 32(%sp),%d2 + move.l 28(%sp),%d1 + move.l 24(%sp),%d0 + trap #0 + + .global __syscall_cancel_arch_end +__syscall_cancel_arch_end: + +#ifdef __mcoldfire__ + movem.l (%sp),%d2-%d5 + lea (16,%sp),%sp +#else + movem.l (%sp)+,%d2-%d5 +#endif + rts + +1: +#ifdef PIC + bsr.l __syscall_do_cancel +#else + jsr __syscall_do_cancel +#endif +END (__syscall_cancel_arch) -- 2.34.1