From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 9CDB4385B219 for ; Fri, 15 Apr 2022 01:28:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9CDB4385B219 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from [10.20.4.187] (unknown [10.20.4.187]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxrxFSylhiiskjAA--.16477S3; Fri, 15 Apr 2022 09:28:50 +0800 (CST) From: caiyinyu Subject: Re: [PATCH v2 09/14] LoongArch: Linux ABI To: Adhemerval Zanella , libc-alpha@sourceware.org Cc: xuchenghua@loongson.cn, joseph_myers@mentor.com References: <20211231064455.1030051-1-caiyinyu@loongson.cn> <20211231064455.1030051-10-caiyinyu@loongson.cn> <0446048b-ba32-f750-6e00-1fde5bb435f1@linaro.org> Message-ID: Date: Fri, 15 Apr 2022 09:28:50 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <0446048b-ba32-f750-6e00-1fde5bb435f1@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID: AQAAf9DxrxFSylhiiskjAA--.16477S3 X-Coremail-Antispam: 1UD129KBjvJXoWxAw17uF15GF1kKFW5Ww1ftFb_yoW5Ww45pF yrCayUKrWxJ342g3ZFgrsIqFsayr4xAF17uryagw4UtrW5J3WfWFsF9as8GryxXw1xuFyj vFW5Za47uFs3JaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvv14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxV WxJr0_GcWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2Wl Yx0E2Ix0cI8IcVAFwI0_Jw0_WrylYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbV WUJVW8JwACjcxG0xvEwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc7I2V7IY0VAS07Al zVAYIcxG8wCY02Avz4vE-syl42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr 1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE 14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Gr0_Xr1lIxAIcVC0I7 IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWUCVW8JwCI42IY6I8E 87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73Uj IFyTuYvjfU0pBTUUUUU X-CM-SenderInfo: 5fdl5xhq1xqz5rrqw2lrqou0/ X-Spam-Status: No, score=-14.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Fri, 15 Apr 2022 01:28:54 -0000 在 2022/1/4 下午10:24, Adhemerval Zanella 写道: > On 31/12/2021 03:44, caiyinyu wrote: > >> diff --git a/sysdeps/loongarch/nptl/bits/struct_rwlock.h b/sysdeps/loongarch/nptl/bits/struct_rwlock.h >> new file mode 100644 >> index 0000000000..12b6a469bd >> --- /dev/null >> +++ b/sysdeps/loongarch/nptl/bits/struct_rwlock.h >> @@ -0,0 +1,44 @@ >> +/* LoongArch internal rwlock struct definitions. >> + Copyright (C) 2021 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 _RWLOCK_INTERNAL_H >> +#define _RWLOCK_INTERNAL_H >> + >> +/* There is a lot of padding in this structure. While it's not strictly >> + necessary on LoongArch, we're going to leave it in to be on the safe side in >> + case it's needed in the future. Most other architectures have the padding, >> + so this gives us the same extensibility as everyone else has. */ >> +struct __pthread_rwlock_arch_t >> +{ >> + unsigned int __readers; >> + unsigned int __writers; >> + unsigned int __wrphase_futex; >> + unsigned int __writers_futex; >> + unsigned int __pad3; >> + unsigned int __pad4; >> + int __cur_writer; >> + int __shared; >> + unsigned long int __pad1; >> + unsigned long int __pad2; >> + unsigned int __flags; >> +}; >> + >> +#define __PTHREAD_RWLOCK_INITIALIZER(__flags) \ >> + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, __flags >> + >> +#endif > Why can't you use the generic Linux sysdeps/nptl/bits/struct_rwlock.h ? Fixed by using generic Linux file. >> diff --git a/sysdeps/loongarch/nptl/pthread-offsets.h b/sysdeps/loongarch/nptl/pthread-offsets.h >> new file mode 100644 >> index 0000000000..415c3c113f >> --- /dev/null >> +++ b/sysdeps/loongarch/nptl/pthread-offsets.h >> @@ -0,0 +1,15 @@ >> +#if __WORDSIZE == 64 >> +#define __PTHREAD_MUTEX_KIND_OFFSET 16 >> +#else >> +#define __PTHREAD_MUTEX_KIND_OFFSET 12 >> +#endif >> + >> +#if __WORDSIZE == 64 >> +#define __PTHREAD_RWLOCK_FLAGS_OFFSET 48 >> +#else >> +#if __BYTE_ORDER == __BIG_ENDIAN >> +#define __PTHREAD_RWLOCK_FLAGS_OFFSET 27 >> +#else >> +#define __PTHREAD_RWLOCK_FLAGS_OFFSET 24 >> +#endif >> +#endif > Ditto. Fixed by using generic Linux file.