From 7acb0df84f4da8b43de00f19dfb11a8a04373eca Mon Sep 17 00:00:00 2001 From: pangzhen1 Date: Thu, 20 Feb 2025 21:07:41 +0800 Subject: [PATCH] arch/arm: Add the macro definitions for CFI instructions for greenhills compiler Add the macro definitions for CFI instructions for greenhills compiler Signed-off-by: pangzhen1 --- arch/arm/src/armv7-m/arm_exception.S | 1 + arch/arm/src/armv7-m/ghs_compat.S | 48 ++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 arch/arm/src/armv7-m/ghs_compat.S diff --git a/arch/arm/src/armv7-m/arm_exception.S b/arch/arm/src/armv7-m/arm_exception.S index c2053a59e17..67661583bd1 100644 --- a/arch/arm/src/armv7-m/arm_exception.S +++ b/arch/arm/src/armv7-m/arm_exception.S @@ -46,6 +46,7 @@ #include "chip.h" #include "exc_return.h" +#include "ghs_compat.S" /**************************************************************************** * Pre-processor Definitions diff --git a/arch/arm/src/armv7-m/ghs_compat.S b/arch/arm/src/armv7-m/ghs_compat.S new file mode 100644 index 00000000000..74688879499 --- /dev/null +++ b/arch/arm/src/armv7-m/ghs_compat.S @@ -0,0 +1,48 @@ +/**************************************************************************** + * arch/arm/src/armv7-m/ghs_compat.S + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifdef __ghs__ + .macro .cfi_sections section + .endm + + .macro .cfi_startproc + .endm + + .macro .cfi_def_cfa val1 val2 + .endm + + .macro .cfi_def_cfa_offset val + .endm + + .macro .cfi_offset val1 val2 + .endm + + .macro .cfi_restore val + .endm + + .macro .cfi_restore_state + .endm + + .macro .cfi_endproc + .endm + + .macro .cfi_remember_state + .endm +#endif