libseccomp/1003-add-loongarch64-support-not-upstream-new-files.patch
2023-08-31 15:19:57 +08:00

97 lines
2.9 KiB
Diff

From 79f8d8ae649afa519ae5b54f592d7908aecbf107 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Thu, 31 Aug 2023 14:28:36 +0800
Subject: [PATCH] add loongarch64 support not upstream new files
---
src/arch-loongarch64.c | 41 +++++++++++++++++++++++++++++++++++++++++
src/arch-loongarch64.h | 28 ++++++++++++++++++++++++++++
2 files changed, 69 insertions(+)
create mode 100644 src/arch-loongarch64.c
create mode 100644 src/arch-loongarch64.h
diff --git a/src/arch-loongarch64.c b/src/arch-loongarch64.c
new file mode 100644
index 0000000..8d28274
--- /dev/null
+++ b/src/arch-loongarch64.c
@@ -0,0 +1,41 @@
+/**
+ * Enhanced Seccomp 64-bit LoongArch Syscall Table
+ *
+ * Copyright (c) 2021 Xiaotian Wu <wuxiaotian@loongson.cn>
+ */
+
+/*
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of version 2.1 of the GNU Lesser General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses>.
+ */
+
+#include <stdlib.h>
+#include <errno.h>
+#include <linux/audit.h>
+
+#include "arch.h"
+#include "arch-loongarch64.h"
+#include "syscalls.h"
+
+ARCH_DEF(loongarch64)
+
+const struct arch_def arch_def_loongarch64 = {
+ .token = SCMP_ARCH_LOONGARCH64,
+ .token_bpf = AUDIT_ARCH_LOONGARCH64,
+ .size = ARCH_SIZE_64,
+ .endian = ARCH_ENDIAN_LITTLE,
+ .syscall_resolve_name_raw = loongarch64_syscall_resolve_name,
+ .syscall_resolve_num_raw = loongarch64_syscall_resolve_num,
+ .syscall_rewrite = NULL,
+ .rule_add = NULL,
+};
+
diff --git a/src/arch-loongarch64.h b/src/arch-loongarch64.h
new file mode 100644
index 0000000..c3c06af
--- /dev/null
+++ b/src/arch-loongarch64.h
@@ -0,0 +1,28 @@
+/**
+ * Enhanced Seccomp 64-bit LoongArch Syscall Table
+ *
+ * Copyright (c) 2021 Xiaotian Wu <wuxiaotian@loongson.cn>
+ */
+
+/*
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of version 2.1 of the GNU Lesser General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses>.
+ */
+
+#ifndef _ARCH_LOONGARCH64_H
+#define _ARCH_LOONGARCH64_H
+
+#include "arch.h"
+
+ARCH_DECL(loongarch64)
+
+#endif
--
2.27.0