From 69e96d9620652df428ec7f4faca92f70cce111d3 Mon Sep 17 00:00:00 2001 From: Wenlong Zhang Date: Tue, 18 Jun 2024 15:14:08 +0800 Subject: [PATCH] add loongarch64 support for libmetal (cherry picked from commit 64f18be37b86d6cee52b3bdd5ca1f389fcda6ec5) --- add-loongarch64-support-for-libmetal.patch | 47 ++++++++++++++++++++++ libmetal.spec | 6 ++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 add-loongarch64-support-for-libmetal.patch diff --git a/add-loongarch64-support-for-libmetal.patch b/add-loongarch64-support-for-libmetal.patch new file mode 100644 index 0000000..c3fba25 --- /dev/null +++ b/add-loongarch64-support-for-libmetal.patch @@ -0,0 +1,47 @@ +From dad4708778f8bb649fa0b874c1e74d5f7b51cd75 Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +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 + diff --git a/libmetal.spec b/libmetal.spec index f00d284..a94d33c 100644 --- a/libmetal.spec +++ b/libmetal.spec @@ -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 - 2022.10.0-5 +- add loongarch64 support for libmetal + * Thu Sep 28 2023 Jingwiw - 2022.10.0-4 - add riscv support -- Gitee