add loongarch64 support for libmetal

This commit is contained in:
Wenlong Zhang 2024-06-18 15:14:08 +08:00
parent 67eca7e36e
commit 64f18be37b
2 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,47 @@
From dad4708778f8bb649fa0b874c1e74d5f7b51cd75 Mon Sep 17 00:00:00 2001
From: Wenlong Zhang <zhangwenlong@loongson.cn>
Date: Tue, 18 Jun 2024 15:10:16 +0800
Subject: [PATCH] add loongarch64 support for libmetal
---
lib/processor/loongarch64/CMakeLists.txt | 3 +++
lib/processor/loongarch64/cpu.h | 17 +++++++++++++++++
2 files changed, 20 insertions(+)
create mode 100644 lib/processor/loongarch64/CMakeLists.txt
create mode 100644 lib/processor/loongarch64/cpu.h
diff --git a/lib/processor/loongarch64/CMakeLists.txt b/lib/processor/loongarch64/CMakeLists.txt
new file mode 100644
index 0000000..c06e951
--- /dev/null
+++ b/lib/processor/loongarch64/CMakeLists.txt
@@ -0,0 +1,3 @@
+collect (PROJECT_LIB_HEADERS cpu.h)
+
+# vim: expandtab:ts=2:sw=2:smartindent
diff --git a/lib/processor/loongarch64/cpu.h b/lib/processor/loongarch64/cpu.h
new file mode 100644
index 0000000..ea34eb6
--- /dev/null
+++ b/lib/processor/loongarch64/cpu.h
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2018, Pinecone Inc. and Contributors. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/*
+ * @file cpu.h
+ * @brief CPU specific primitives
+ */
+
+#ifndef __METAL_LOONGARCH_CPU__H__
+#define __METAL_LOONGARCH_CPU__H__
+
+#define metal_cpu_yield()
+
+#endif /* __METAL_LOONGARCH_CPU__H__ */
--
2.43.0

View File

@ -1,6 +1,6 @@
Name: libmetal
Version: 2022.10.0
Release: 4
Release: 5
Summary: An abstraction layer across user-space Linux, baremetal, and RTOS environments
License: BSD
@ -9,6 +9,7 @@ Source0: https://github.com/OpenAMP/libmetal/archive/refs/tags/v%{version}/%{nam
Patch0: libmetal-add-additional-arches.patch
Patch1: add-riscv-support.patch
Patch2: add-loongarch64-support-for-libmetal.patch
BuildRequires: cmake
BuildRequires: doxygen
@ -72,6 +73,9 @@ done
%changelog
* Tue Jun 18 2024 Wenlong Zhang <zhangwenlong@loongson.cn> - 2022.10.0-5
- add loongarch64 support for libmetal
* Thu Sep 28 2023 Jingwiw <wangjingwei@iscas.ac.cn> - 2022.10.0-4
- add riscv support