From 990d34efddb51f003779c4f955da5f24d809da30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Wed, 20 Jul 2016 19:58:56 +0200 Subject: [PATCH] M68K: add arch_cpu_idle and arch_cpu_pause inline stubs Remove the stub from arch_cpu.cpp We might want to implement a 040 CPU module providing idle using LPSTOP. --- headers/private/kernel/arch/m68k/arch_cpu.h | 20 ++++++++++++++++++++ src/system/kernel/arch/m68k/arch_cpu.cpp | 10 ---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/headers/private/kernel/arch/m68k/arch_cpu.h b/headers/private/kernel/arch/m68k/arch_cpu.h index 8e576a6f89..9d41e35863 100644 --- a/headers/private/kernel/arch/m68k/arch_cpu.h +++ b/headers/private/kernel/arch/m68k/arch_cpu.h @@ -445,6 +445,26 @@ extern bool m68k_is_hw_register_readable(addr_t address); extern bool m68k_is_hw_register_writable(addr_t address, uint16 value); // defined in kernel: arch/m68k/cpu_asm.S + +static inline void +arch_cpu_idle(void) +{ + // TODO: M68K CPU idle call + // there isn't really any insn for this. Maybe NOP/FNOP? + // TODO: make a 060 module using LPSTOP + //asm volatile ("lpstop"); +} + + +static inline void +arch_cpu_pause(void) +{ + // TODO: M68K STOP call + // the problem is STOP wants an immediate to put into SR + // but we don't want to overwrite it. + //asm volatile("stop #0" : : : "memory"); +} + #ifdef __cplusplus } #endif diff --git a/src/system/kernel/arch/m68k/arch_cpu.cpp b/src/system/kernel/arch/m68k/arch_cpu.cpp index 488e905c19..0eaeb49b41 100644 --- a/src/system/kernel/arch/m68k/arch_cpu.cpp +++ b/src/system/kernel/arch/m68k/arch_cpu.cpp @@ -268,16 +268,6 @@ arch_cpu_shutdown(bool reboot) } -void -arch_cpu_idle(void) -{ - if (cpu_ops.idle) - cpu_ops.idle(); -#warning M68K: use LPSTOP ? - //asm volatile ("lpstop"); -} - - // The purpose of this function is to trick the compiler. When setting the // page_handler to a label that is obviously (to the compiler) never used, // it may reorganize the control flow, so that the labeled part is optimized