summaryrefslogtreecommitdiff
path: root/arch/loongarch64/bits
diff options
context:
space:
mode:
Diffstat (limited to 'arch/loongarch64/bits')
-rw-r--r--arch/loongarch64/bits/hwcap.h14
-rw-r--r--arch/loongarch64/bits/signal.h43
-rw-r--r--arch/loongarch64/bits/stdint.h20
-rw-r--r--arch/loongarch64/bits/syscall.h.in14
-rw-r--r--arch/loongarch64/bits/user.h14
5 files changed, 85 insertions, 20 deletions
diff --git a/arch/loongarch64/bits/hwcap.h b/arch/loongarch64/bits/hwcap.h
new file mode 100644
index 00000000..b8184f69
--- /dev/null
+++ b/arch/loongarch64/bits/hwcap.h
@@ -0,0 +1,14 @@
+#define HWCAP_LOONGARCH_CPUCFG (1 << 0)
+#define HWCAP_LOONGARCH_LAM (1 << 1)
+#define HWCAP_LOONGARCH_UAL (1 << 2)
+#define HWCAP_LOONGARCH_FPU (1 << 3)
+#define HWCAP_LOONGARCH_LSX (1 << 4)
+#define HWCAP_LOONGARCH_LASX (1 << 5)
+#define HWCAP_LOONGARCH_CRC32 (1 << 6)
+#define HWCAP_LOONGARCH_COMPLEX (1 << 7)
+#define HWCAP_LOONGARCH_CRYPTO (1 << 8)
+#define HWCAP_LOONGARCH_LVZ (1 << 9)
+#define HWCAP_LOONGARCH_LBT_X86 (1 << 10)
+#define HWCAP_LOONGARCH_LBT_ARM (1 << 11)
+#define HWCAP_LOONGARCH_LBT_MIPS (1 << 12)
+#define HWCAP_LOONGARCH_PTW (1 << 13)
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 {
diff --git a/arch/loongarch64/bits/stdint.h b/arch/loongarch64/bits/stdint.h
deleted file mode 100644
index 1bb147f2..00000000
--- a/arch/loongarch64/bits/stdint.h
+++ /dev/null
@@ -1,20 +0,0 @@
-typedef int32_t int_fast16_t;
-typedef int32_t int_fast32_t;
-typedef uint32_t uint_fast16_t;
-typedef uint32_t uint_fast32_t;
-
-#define INT_FAST16_MIN INT32_MIN
-#define INT_FAST32_MIN INT32_MIN
-
-#define INT_FAST16_MAX INT32_MAX
-#define INT_FAST32_MAX INT32_MAX
-
-#define UINT_FAST16_MAX UINT32_MAX
-#define UINT_FAST32_MAX UINT32_MAX
-
-#define INTPTR_MIN INT64_MIN
-#define INTPTR_MAX INT64_MAX
-#define UINTPTR_MAX UINT64_MAX
-#define PTRDIFF_MIN INT64_MIN
-#define PTRDIFF_MAX INT64_MAX
-#define SIZE_MAX UINT64_MAX
diff --git a/arch/loongarch64/bits/syscall.h.in b/arch/loongarch64/bits/syscall.h.in
index 2afb4ea1..66c0d7b9 100644
--- a/arch/loongarch64/bits/syscall.h.in
+++ b/arch/loongarch64/bits/syscall.h.in
@@ -305,6 +305,20 @@
#define __NR_futex_wake 454
#define __NR_futex_wait 455
#define __NR_futex_requeue 456
+#define __NR_statmount 457
+#define __NR_listmount 458
+#define __NR_lsm_get_self_attr 459
+#define __NR_lsm_set_self_attr 460
+#define __NR_lsm_list_modules 461
+#define __NR_mseal 462
+#define __NR_setxattrat 463
+#define __NR_getxattrat 464
+#define __NR_listxattrat 465
+#define __NR_removexattrat 466
+#define __NR_open_tree_attr 467
+#define __NR_file_getattr 468
+#define __NR_file_setattr 469
+#define __NR_listns 470
#define __NR_fcntl __NR3264_fcntl
#define __NR_statfs __NR3264_statfs
#define __NR_fstatfs __NR3264_fstatfs
diff --git a/arch/loongarch64/bits/user.h b/arch/loongarch64/bits/user.h
index fd9b7b22..e4aee0d3 100644
--- a/arch/loongarch64/bits/user.h
+++ b/arch/loongarch64/bits/user.h
@@ -22,3 +22,17 @@ typedef union {
float f;
} elf_fpreg_t;
typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
+
+typedef union
+{
+ __attribute__((__aligned__(16)))
+ double d[2];
+ float f[4];
+} elf_lsxregset_t[32];
+
+typedef union
+{
+ __attribute__((__aligned__(32)))
+ double d[4];
+ float f[8];
+} elf_lasxregset_t[32];