From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 1CD7F22F99 for ; Mon, 23 Sep 2024 04:53:07 +0200 (CEST) Received: (qmail 9954 invoked by uid 550); 23 Sep 2024 02:53:00 -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 x-ms-reactions: disallow Received: (qmail 9870 invoked from network); 23 Sep 2024 02:52:59 -0000 From: JianTao Shan To: musl@lists.openwall.com Cc: lixing@loongson.cn, wanghongliang@loongson.cn, huajingyun@loongson.cn, JianTao Shan Date: Mon, 23 Sep 2024 02:52:29 +0000 Message-ID: <20240923025229.1127803-1-shanjiantao@loongson.cn> X-Mailer: git-send-email 2.46.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:qciowMBxe8b+1_Bm_yUPAA--.61578S4 X-CM-SenderInfo: hvkd0yxldq3t3r6o00pqjv00gofq/1tbiAQEJA2bwB-sDDQACss X-Coremail-Antispam: 1Uk129KBj93XoW7WFWxtryxury7CFW3KF4rWFX_yoW8Zr1fpF 18C34FkrWYqFZIg34aya4Yqr1fJr18t3W7WFnxuF48JFyYqFn3WrZxCrWrGFWUZrykWa47 ZryYqwn7KFZ7JacCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUk0b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc 02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAF wI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7V AKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCj r7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6x IIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x 0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxUzsqWUUUUU Subject: [musl] [PATCH] loongarch64: add fpu and simd context to signal.h The signal stack extension field of loongarch64 is mutable, and the types are distinguished according to some magic. The lack of this part of the uapi definition will cause some projects such as dotnet to fail to compile on musl. --- arch/loongarch64/bits/signal.h | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/arch/loongarch64/bits/signal.h b/arch/loongarch64/bits/signal.h index 5a9ed8c9..1487c0d7 100644 --- a/arch/loongarch64/bits/signal.h +++ b/arch/loongarch64/bits/signal.h @@ -18,6 +18,14 @@ #endif #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +/* FP context was used */ +#define SC_USED_FP (1 << 0) +/* Address error was due to memory load */ +#define SC_ADDRERR_RD (1 << 30) +/* Address error was due to memory store */ +#define SC_ADDRERR_WR (1 << 31) + +/* FPU context */ typedef unsigned long greg_t, gregset_t[32]; struct sigcontext { @@ -26,6 +34,48 @@ struct sigcontext { unsigned sc_flags; unsigned long sc_extcontext[] __attribute__((__aligned__(16))); }; + +#define CONTEXT_INFO_ALIGN 16 +struct sctx_info { + unsigned magic; + unsigned size; + unsigned long padding; /* padding to 16 bytes */ +}; + +#define FPU_CTX_MAGIC 0x46505501 +#define FPU_CTX_ALIGN 8 +struct fpu_context { + unsigned long regs[32]; + unsigned long fcc; + unsigned fcsr; +}; + +/* LSX context */ +#define LSX_CTX_MAGIC 0x53580001 +#define LSX_CTX_ALIGN 16 +struct lsx_context { + unsigned long regs[2*32]; + unsigned long fcc; + unsigned fcsr; +}; + +/* LASX context */ +#define LASX_CTX_MAGIC 0x41535801 +#define LASX_CTX_ALIGN 32 +struct lasx_context { + unsigned long regs[4*32]; + unsigned long fcc; + unsigned fcsr; +}; + +/* LBT context */ +#define LBT_CTX_MAGIC 0x42540001 +#define LBT_CTX_ALIGN 8 +struct lbt_context { + unsigned long regs[4]; + unsigned eflags; + unsigned ftop; +}; #endif typedef struct { -- 2.46.1