From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14746 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Khem Raj Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] Change container for riscv floating-point state to __riscv_mc_fp_state Date: Sat, 28 Sep 2019 16:39:11 -0700 Message-ID: <307db9de-e1e6-714e-8ccb-7a9b98b4a348@gmail.com> References: <20190928230348.3011887-1-raj.khem@gmail.com> <20190928232431.GJ9017@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="203101"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 To: musl@lists.openwall.com, Rich Felker Original-X-From: musl-return-14762-gllmg-musl=m.gmane.org@lists.openwall.com Sun Sep 29 01:39:35 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1iEMJJ-000qiL-Ph for gllmg-musl@m.gmane.org; Sun, 29 Sep 2019 01:39:33 +0200 Original-Received: (qmail 22333 invoked by uid 550); 28 Sep 2019 23:39: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: Original-Received: (qmail 22313 invoked from network); 28 Sep 2019 23:39:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=wxLoDAR46NIgunicOsSozE6PdTzAn6RO88pXJrBVVfQ=; b=pysmGWIF3A/YLsS6G5rYTttuvXfhWEvUFDujNYd6wtN3QeNhgUeEDk0QVtw+5xllUA JudEf98Z51UVUibS06laVKH1yQtyMdEve+8OSeQAPFRW+qoSD0B7enIIiOupHJ7YLNIj Rnki4RPKVLOm/aV0nk6oRRlL6prNHoMIFt4VMY/4jCeTq+0z3zOtRmdjsLFbR5ELSmZJ 1qaD+uIalGUq+6PioerqRa0L8DsXnS8+ZfBOMYuG6e+FrCzqQXbrOgGtPptqKf3bkgKI GEM/VqKZoF118AJAqwOQ3MUTr+Ga6djetp+ea/YM05t1DYD87uezjb+UxRJUHhlcrfu9 G64w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wxLoDAR46NIgunicOsSozE6PdTzAn6RO88pXJrBVVfQ=; b=AYTob1TfYY1z1tkVzon+5nGCGmNK6NT8jd1XMHL42Kh3s1rjbVtUFJqIDGPpK0dD7A 74zFphP/idZdc9H1L8nmtV8G2tNXN4p8nVkEgjJbCpei4aesjVuyfQKLwpUGT48AEu/9 djto/MuGzHsAYD68ZzU0PNeP92ecJbL19gTr7NgtS/wqE6qo1vnYS9yJ66usR7yBDmi/ mdjxS7MfyP9gv73pD4X2skVFPGFR+FBF78n2QkRaCFexueF7UxMWARfbfJbejUmQcoNW W9ySoyw9FBnKqNxYicdc0qynUBgyh40C7DsHYGoGiYX7GhPaainzxv7ylYqRKIrh/t/M OgyA== X-Gm-Message-State: APjAAAUHusahq0XwPMRRuXAyWHd6qAReqCoKHg5Sgaj54xXi38Qzj0Tl qCYqWatXXJW7Dzjf1/xPJAkgnrDZ0xw= X-Google-Smtp-Source: APXvYqwyy8C2qgqGbfRO5Cpc1/ArAuxXPTqy45/n3OVTbRu40beFIKfdPp7clrGjVD8Pzig4UQAFOw== X-Received: by 2002:a17:90a:9d87:: with SMTP id k7mr18670003pjp.103.1569713958474; Sat, 28 Sep 2019 16:39:18 -0700 (PDT) Autocrypt: addr=raj.khem@gmail.com; keydata= mQGiBEqXaJERBACUvFofpD3FsxD9675wcPv+rzguIfsRWilrrpSZ61JHjLHwkUnmDLpLSdfv Zw2ZDXeaQbGU2thctxXTyYf6N1fY6P5Tww6mWKInuGU3yAv8Mg5p+Xd8itwOoVR41DOBkftV miO2G7FtXsnqonB6F43a2yvc+h9OwPRVxAFss5mSmwCglSXPWndN1Ka4M/hzt7g+FmeyEssD /1V/G8lLeAS9gQCNjS7jch+uHMFJuWgHzMXdw99e1ywlIkvXN77NPkW+FLVxKxNAHyWZZ3wO 4BQ9/GVR2y0s/rrF1lQSIcfnUmzZrh/Bh0b1wVOSLhl0Vx4MI0/MbdL3xx17JAWy+s67evuK ER4Y8ycTq3gbIGJtVrIJjWPCzWF8BACAA2u52uDmJ2pS8SIhEW0jMK/zYQ5Od9l9fM6BmS6Q jnIlzzcuMvRdZn2IrnuE/YoC8yyzBK3mN+MVc2jWN9rfSg6ml7r14Zjem9Ee0O5Ca7Jg3ZvN 6g3vSlrRJqKgsnq3vdatDF+5rd0NJ7ZKUy6x2i1Pavgtv3qaAgPGa1qQdLQdS2hlbSBSYWog PHJhai5raGVtQGdtYWlsLmNvbT6IYAQTEQIAIAUCSpdokQIbAwYLCQgHAwIEFQIIAwQWAgMB Ah4BAheAAAoJELsFM1WRnTMUhOMAoJJleT2hdT7uw9Fyn26+w+/K4i0gAJ9wRt36PqfjNe90 4evWolFf5cMmp7kEDQRKl2iREBAAjjbVQ55RAouAe0l0nPsKkWdtMuUHwBdLBkpF3rGM/f0u DlPaQzYGLjKT7xDoyRh8x2tFwWvOfiqrZFArxX8e In-Reply-To: <20190928232431.GJ9017@brightrain.aerifal.cx> Content-Language: en-US Xref: news.gmane.org gmane.linux.lib.musl.general:14746 Archived-At: On 9/28/19 4:24 PM, Rich Felker wrote: > On Sat, Sep 28, 2019 at 04:03:48PM -0700, Khem Raj wrote: >> Match the struct elements with glibc >> glibc also uses __riscv_mc prefix, some packages like gdb uses that >> >> Signed-off-by: Khem Raj >> --- >> arch/riscv64/bits/signal.h | 18 +++++++++--------- >> arch/riscv64/bits/user.h | 2 +- >> 2 files changed, 10 insertions(+), 10 deletions(-) >> >> diff --git a/arch/riscv64/bits/signal.h b/arch/riscv64/bits/signal.h >> index 76d7ad80..aba7ab00 100644 >> --- a/arch/riscv64/bits/signal.h >> +++ b/arch/riscv64/bits/signal.h >> @@ -13,25 +13,25 @@ typedef unsigned long greg_t; >> typedef unsigned long gregset_t[32]; >> >> struct __riscv_mc_f_ext_state { >> - unsigned int f[32]; >> - unsigned int fcsr; >> + unsigned int __f[32]; >> + unsigned int __fcsr; >> }; >> >> struct __riscv_mc_d_ext_state { >> - unsigned long long f[32]; >> - unsigned int fcsr; >> + unsigned long long __f[32]; >> + unsigned int __fcsr; >> }; >> >> struct __riscv_mc_q_ext_state { >> - unsigned long long f[64] __attribute__((aligned(16))); >> - unsigned int fcsr; >> + unsigned long long __f[64] __attribute__((aligned(16))); >> + unsigned int __fcsr; >> unsigned int reserved[3]; >> }; >> >> union __riscv_mc_fp_state { >> - struct __riscv_mc_f_ext_state f; >> - struct __riscv_mc_d_ext_state d; >> - struct __riscv_mc_q_ext_state q; >> + struct __riscv_mc_f_ext_state __f; >> + struct __riscv_mc_d_ext_state __d; >> + struct __riscv_mc_q_ext_state __q; >> }; > > This looks like an improvement for another major reason too -- the > names f, d, q, are really bad namespace pollution to have in the > default profile. > > There are actually more namespace problems in this file too, some of > them actually conformance issues. > >> diff --git a/arch/riscv64/bits/user.h b/arch/riscv64/bits/user.h >> index d2e383b2..9918a2fe 100644 >> --- a/arch/riscv64/bits/user.h >> +++ b/arch/riscv64/bits/user.h >> @@ -5,4 +5,4 @@ struct user_fpregs_struct { >> >> #define ELF_NGREG 32 >> typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG]; >> -typedef struct user_fpregs_struct elf_fpregset_t; >> +typedef union __riscv_mc_fp_state elf_fpregset_t; >> -- >> 2.23.0 > > This part unfortunately depends on signal.h, which sys/user.h does not > include. Since sys/user.h is a junk header it might be acceptable to > just make the rv64 bits include signal.h, or to make it always include > signal.h. I think including bitss/signal.h in sys/user.h on rv64 is a good compromise. Do you want a v2 with this change ? or I can send the include part as a separate patch on top > > Rich >