代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/crash-gcore-command 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
diff --git a/src/gcore.mk b/src/gcore.mk
index 4af292b..959ad25 100644
--- a/src/gcore.mk
+++ b/src/gcore.mk
@@ -60,6 +60,12 @@ ifeq ($(shell arch), ppc64le)
ARCH=SUPPORTED
endif
+ifeq ($(shell arch), loongarch64)
+ TARGET=loongarch64
+ TARGET_CFLAGS=
+ ARCH=SUPPORTED
+endif
+
ifeq ($(shell /bin/ls /usr/include/crash/defs.h 2>/dev/null), /usr/include/crash/defs.h)
INCDIR=/usr/include/crash
endif
diff --git a/src/libgcore/gcore_coredump.c b/src/libgcore/gcore_coredump.c
index c14cc11..da85463 100644
--- a/src/libgcore/gcore_coredump.c
+++ b/src/libgcore/gcore_coredump.c
@@ -756,7 +756,7 @@ fill_prstatus_note(struct elf_note_info *info, struct task_context *tc,
struct memelfnote *memnote)
{
struct elf_prstatus *prstatus;
-#if defined(X86) || defined(X86_64) || defined(ARM) || defined(MIPS) || defined(PPC64)
+#if defined(X86) || defined(X86_64) || defined(ARM) || defined(MIPS) || defined(PPC64) || defined(__loongarch64)
struct user_regs_struct *regs = (struct user_regs_struct *)memnote->data;
#endif
#ifdef ARM64
diff --git a/src/libgcore/gcore_defs.h b/src/libgcore/gcore_defs.h
index 3233ea5..0462a0f 100644
--- a/src/libgcore/gcore_defs.h
+++ b/src/libgcore/gcore_defs.h
@@ -170,6 +170,26 @@
#define NT_FILE 0x46494c45
#endif
+#ifdef __loongarch64
+#define ELF_EXEC_PAGESIZE PAGESIZE()
+
+#define ELF_MACHINE EM_LOONGARCH
+#define ELF_OSABI ELFOSABI_NONE
+
+#define ELF_CLASS ELFCLASS64
+#define ELF_DATA ELFDATA2LSB
+#define ELF_ARCH EM_LOONGARCH
+
+#define Elf_Half Elf64_Half
+#define Elf_Word Elf64_Word
+#define Elf_Off Elf64_Off
+
+#define Elf_Ehdr Elf64_Ehdr
+#define Elf_Phdr Elf64_Phdr
+#define Elf_Shdr Elf64_Shdr
+#define Elf_Nhdr Elf64_Nhdr
+#endif
+
#define PAGE_ALIGN(X) roundup(X, ELF_EXEC_PAGESIZE)
#ifdef divideup
@@ -319,6 +339,11 @@ extern void gcore_default_regsets_init(void);
#define REGSET_VIEW_MACHINE EM_AARCH64
#endif
+#ifdef __loongarch64
+#define REGSET_VIEW_NAME "loongarch64"
+#define REGSET_VIEW_MACHINE EM_LOONGARCH
+#endif
+
#ifdef MIPS
#define REGSET_VIEW_NAME "mips"
#define REGSET_VIEW_MACHINE EM_MIPS
@@ -643,6 +668,24 @@ struct user_regs_struct {
};
#endif
+#ifdef __loongarch64
+struct user_regs_struct {
+ /* Saved main processor registers. */
+ unsigned long regs[32];
+
+ /* Saved special registers. */
+ unsigned long csr_crmd;
+ unsigned long csr_prmd;
+ unsigned long csr_euen;
+ unsigned long csr_ecfg;
+ unsigned long csr_estat;
+ unsigned long csr_epc;
+ unsigned long csr_badvaddr;
+ unsigned long orig_a0;
+ unsigned long __last[0];
+ } __attribute__ ((aligned (8)));
+#endif
+
#ifdef PPC64
/* taken from asm/ptrace.h */
struct user_regs_struct {
@@ -669,7 +712,7 @@ struct user_regs_struct {
};
#endif
-#if defined(X86) || defined(X86_64) || defined(ARM) || defined(MIPS)
+#if defined(X86) || defined(X86_64) || defined(ARM) || defined(MIPS) || defined(__loongarch64)
typedef ulong elf_greg_t;
#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
typedef elf_greg_t elf_gregset_t[ELF_NGREG];
@@ -678,7 +721,7 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
#if defined(X86) || defined(ARM) || defined(MIPS)
#define PAGE_SIZE 4096
#endif
-#if defined(ARM64) || defined(PPC64)
+#if defined(ARM64) || defined(PPC64) || defined(__loongarch64)
#define PAGE_SIZE PAGESIZE()
#endif
@@ -832,12 +875,12 @@ struct elf_prstatus
int pr_fpvalid; /* True if math co-processor being used. */
};
-#if defined(X86) || defined(X86_64) || defined(ARM) || defined(MIPS)
+#if defined(X86) || defined(X86_64) || defined(ARM) || defined(MIPS) || defined(__loongarch64)
typedef unsigned short __kernel_old_uid_t;
typedef unsigned short __kernel_old_gid_t;
#endif
-#if defined(X86_64) || defined(ARM64) || defined(PPC64)
+#if defined(X86_64) || defined(ARM64) || defined(PPC64) || defined(__loongarch64)
typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;
#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。