diff --git a/arch/arm64/src/common/CMakeLists.txt b/arch/arm64/src/common/CMakeLists.txt index 86be271a90..0746b9994c 100644 --- a/arch/arm64/src/common/CMakeLists.txt +++ b/arch/arm64/src/common/CMakeLists.txt @@ -23,7 +23,7 @@ set(SRCS arm64_head.S) # TODO: support kernel startup obj ctr0 list(APPEND SRCS arm64_vector_table.S arm64_vectors.S arm64_smccc.S) -list(APPEND SRCS arm64_cpu_idle.S arm64_fork_func.S) +list(APPEND SRCS arm64_fork_func.S) if(CONFIG_ARCH_HAVE_TESTSET) list(APPEND SRCS arm64_testset.S) diff --git a/arch/arm64/src/common/Make.defs b/arch/arm64/src/common/Make.defs index 14f7eb1193..d29014861e 100644 --- a/arch/arm64/src/common/Make.defs +++ b/arch/arm64/src/common/Make.defs @@ -35,7 +35,7 @@ endif # Common assembly language files CMN_ASRCS = arm64_vector_table.S arm64_vectors.S arm64_smccc.S -CMN_ASRCS += arm64_cpu_idle.S arm64_fork_func.S +CMN_ASRCS += arm64_fork_func.S ifeq ($(CONFIG_ARCH_HAVE_TESTSET),y) CMN_ASRCS += arm64_testset.S diff --git a/arch/arm64/src/common/arm64_cpu_idle.S b/arch/arm64/src/common/arm64_cpu_idle.S deleted file mode 100644 index a9e5e8fac9..0000000000 --- a/arch/arm64/src/common/arm64_cpu_idle.S +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** - * arch/arm64/src/common/arm64_cpu_idle.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. - * - ****************************************************************************/ - -#include - -#include "arm64_arch.h" -#include "arm64_macro.inc" - -/**************************************************************************** - * Public Symbols - ****************************************************************************/ - - .file "arm64_cpu_idle.S" - -/**************************************************************************** - * Assembly Macros - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -GTEXT(arch_cpu_idle) -SECTION_FUNC(text, arch_cpu_idle) -#ifdef CONFIG_TRACING_IDLE - stp xzr, x30, [sp, #-16]! - bl sys_trace_idle - ldp xzr, x30, [sp], #16 -#endif - dsb sy - wfi - ret - -GTEXT(arch_cpu_atomic_idle) -SECTION_FUNC(text, arch_cpu_atomic_idle) -#ifdef CONFIG_TRACING_IDLE - stp xzr, x30, [sp, #-16]! - bl sys_trace_idle - ldp xzr, x30, [sp], #16 -#endif - msr daifset, #(DAIFSET_IRQ_BIT) - isb - wfe - tst x0, #(DAIF_IRQ_BIT) - beq _irq_disabled - msr daifclr, #(DAIFCLR_IRQ_BIT) -_irq_disabled: - ret diff --git a/arch/arm64/src/common/arm64_idle.c b/arch/arm64/src/common/arm64_idle.c index 88db506f78..ad7fa430bd 100644 --- a/arch/arm64/src/common/arm64_idle.c +++ b/arch/arm64/src/common/arm64_idle.c @@ -57,6 +57,7 @@ void up_idle(void) /* Sleep until an interrupt occurs to save power */ - arch_cpu_idle(); + asm("dsb sy"); + asm("wfi"); #endif }