From c2670deb496d2535bcdb67705b046530c8a6b49a Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 20 Jul 2018 09:07:40 +0200 Subject: [PATCH] riscv: Use wfi instruction for idle task Update #3433. --- cpukit/score/cpu/riscv/cpu.c | 5 +++-- cpukit/score/cpu/riscv/include/rtems/score/cpu.h | 10 ---------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/cpukit/score/cpu/riscv/cpu.c b/cpukit/score/cpu/riscv/cpu.c index 64eef969b7..62150d4ea5 100644 --- a/cpukit/score/cpu/riscv/cpu.c +++ b/cpukit/score/cpu/riscv/cpu.c @@ -204,8 +204,9 @@ uint32_t _CPU_ISR_Get_level( void ) void *_CPU_Thread_Idle_body( uintptr_t ignored ) { - do { - } while (1); + while ( true ) { + __asm__ volatile ( "wfi" ); + } return NULL; } diff --git a/cpukit/score/cpu/riscv/include/rtems/score/cpu.h b/cpukit/score/cpu/riscv/include/rtems/score/cpu.h index 724385cd75..039595dd4b 100644 --- a/cpukit/score/cpu/riscv/include/rtems/score/cpu.h +++ b/cpukit/score/cpu/riscv/include/rtems/score/cpu.h @@ -360,16 +360,6 @@ void _CPU_Initialize( void ); -/* - * _CPU_Thread_Idle_body - * - * This routine is the CPU dependent IDLE thread body. - * - * NOTE: It need only be provided if CPU_PROVIDES_IDLE_THREAD_BODY - * is TRUE. - * - */ - void *_CPU_Thread_Idle_body( uintptr_t ignored ); /*