diff options
| author | JianTao Shan <shanjiantao@loongson.cn> | 2024-09-23 02:52:29 +0000 |
|---|---|---|
| committer | Rich Felker <dalias@aerifal.cx> | 2026-03-12 20:39:22 -0400 |
| commit | b5146b83ab2bb91b42a7fc60fa07c41914f1ff54 (patch) | |
| tree | f4f22c5d2bd1953d2c9caacc8fd9b1e21d295f90 /arch | |
| parent | 38b00812ef2ebc944063d70bf63a09a9ebb98dbf (diff) | |
| download | musl-b5146b83ab2bb91b42a7fc60fa07c41914f1ff54.tar.gz | |
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.
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/loongarch64/bits/signal.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/loongarch64/bits/signal.h b/arch/loongarch64/bits/signal.h index 5a9ed8c9..70ce9402 100644 --- a/arch/loongarch64/bits/signal.h +++ b/arch/loongarch64/bits/signal.h @@ -18,6 +18,10 @@ #endif #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) +#define SC_USED_FP (1U << 0) +#define SC_ADDRERR_RD (1U << 30) +#define SC_ADDRERR_WR (1U << 31) + typedef unsigned long greg_t, gregset_t[32]; struct sigcontext { @@ -26,6 +30,45 @@ 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; +}; + +#define FPU_CTX_MAGIC 0x46505501 +#define FPU_CTX_ALIGN 8 +struct fpu_context { + unsigned long regs[32]; + unsigned long fcc; + unsigned fcsr; +}; + +#define LSX_CTX_MAGIC 0x53580001 +#define LSX_CTX_ALIGN 16 +struct lsx_context { + unsigned long regs[2*32]; + unsigned long fcc; + unsigned fcsr; +}; + +#define LASX_CTX_MAGIC 0x41535801 +#define LASX_CTX_ALIGN 32 +struct lasx_context { + unsigned long regs[4*32]; + unsigned long fcc; + unsigned fcsr; +}; + +#define LBT_CTX_MAGIC 0x42540001 +#define LBT_CTX_ALIGN 8 +struct lbt_context { + unsigned long regs[4]; + unsigned eflags; + unsigned ftop; +}; #endif typedef struct { |
