From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28107 invoked from network); 18 Apr 2023 11:32:34 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 18 Apr 2023 11:32:34 -0000 Received: (qmail 23687 invoked by uid 550); 18 Apr 2023 11:32:31 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 23655 invoked from network); 18 Apr 2023 11:32:30 -0000 To: musl@lists.openwall.com, Szabolcs Nagy References: <20230418093844.GP3630668@port70.net> From: =?UTF-8?B?546L5rSq5Lqu?= Message-ID: <0fd19586-376c-14ec-a50b-8c561f9f82f2@loongson.cn> Date: Tue, 18 Apr 2023 19:32:13 +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: <20230418093844.GP3630668@port70.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID:AQAAf8Bx57y+fz5kYeAsAA--.51463S3 X-CM-SenderInfo: pzdqwxxrqjzxhdqjqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvJXoW7tw1rtFy7Xw43AF4rWr4fGrg_yoW8KFWDpF 4vka48CrWUKFn5Zryjv3yYvry5Gr18J3W7GryfXa42vFW7AFn2gFy7XFn09rn8Ar48WF1U Ar1jgrnruw4xJa7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bI8YFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVWUCVW8JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4UJVWxJr1l e2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27wAqx4xG64xvF2 IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4U McvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwCYjI0SjxkI62AI1cAE67vIY487Mx AIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_ Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUXVWUAwCIc40Y0x0EwI xGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8 JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcV C2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxUzsqWUUUUU Subject: Re: [musl] add loongarch64 port v7. 在 2023/4/18 下午5:38, Szabolcs Nagy 写道: > * 王洪亮 [2023-04-18 09:28:49 +0800]: >> +++ b/arch/loongarch64/bits/signal.h >> @@ -6,14 +6,27 @@ >>  #define SIGSTKSZ    16384 >>  #endif >> >> +#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) >>  typedef unsigned long greg_t, gregset_t[32]; >> >> -typedef struct sigcontext { >> +struct sigcontext { >>      unsigned long sc_pc; >> -    gregset_t     sc_regs; >> -    unsigned int  sc_flags; >> -    unsigned long sc_extcontext[]; >> +    unsigned long sc_regs[32]; >> +    unsigned int sc_flags; >> +    unsigned long sc_extcontext[] __attribute__((__aligned__(16))); >> +}; > this looks good. (i don't know if this is really > needed in signal.h, but other targets have it too) > >> + >> +typedef struct { >> +    unsigned long __pc; >> +    unsigned long __gregs[32]; >> +    unsigned int __flags; >> +    unsigned long __extcontext[] __attribute__((__aligned__(16))); >>  } mcontext_t; > i would use the same struct tag as glibc so > > typedef struct mcontext_t { ... > > (we don't need c++ abi compat with glibc, but > it's nicer to be consistent) > >> +#else >> +typedef struct { >> +    unsigned long __space[34]; >> +} mcontext_t; > i would add the aligned attribute here. > > (it's more important to match the kernel layout than to > avoid c extensions in standard mode: loongarch c compilers > will all support the aligned attribute in system headers) I understand there is no need for me to submit modifications, you help me modify it directly,right? >> +#endif >> >>  struct sigaltstack { >>      void   *ss_sp; >> @@ -23,11 +36,10 @@ struct sigaltstack { >> >>  typedef struct __ucontext >>  { >> -    unsigned long      uc_flags; >> +    unsigned long      __uc_flags; >>      struct __ucontext  *uc_link; >>      stack_t            uc_stack; >>      sigset_t           uc_sigmask; >> -    long               __uc_pad; >>      mcontext_t         uc_mcontext; >>  } ucontext_t; > looks good. > > (the only issue is if some code uses uc_flags in an > arch independent way. i don't know if there is any > use for it on linux. but we can fix that later on > both glibc and musl side if it comes up.)