Thread (14 messages) flat view 14 messages, 3 authors, 2022-02-16
STALE1674d

[RFC PATCH v1 06/11] powerpc/machdep: Add helpers to use ppc_md. functions

From: Christophe Leroy <hidden>
Date: 2021-09-03 11:19:09
Also in: lkml
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

As a preparation to converting ppc_md functions to static
calls, add helpers to play with ppc_md. functions.

Signed-off-by: Christophe Leroy <redacted>
---
 arch/powerpc/include/asm/machdep.h | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index 9f31281095ab..51949ab0abfe 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -203,6 +203,11 @@ struct machdep_calls {
 #endif
 };
 
+#define ppc_md_call(func)		ppc_md.func
+#define ppc_md_has(func)		(ppc_md.func)
+#define ppc_md_call_cond(func)		if (ppc_md_has(func)) ppc_md_call(func)
+#define ppc_md_update(func, f)		ppc_md.func = f
+
 extern void e500_idle(void);
 extern void power4_idle(void);
 extern void ppc6xx_idle(void);
-- 
2.25.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help