1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _COPY_MC_TEST_H_
3 #define _COPY_MC_TEST_H_
6 #ifdef CONFIG_COPY_MC_TEST
7 extern unsigned long copy_mc_test_src;
8 extern unsigned long copy_mc_test_dst;
10 static inline void copy_mc_inject_src(void *addr)
13 copy_mc_test_src = (unsigned long) addr;
15 copy_mc_test_src = ~0UL;
18 static inline void copy_mc_inject_dst(void *addr)
21 copy_mc_test_dst = (unsigned long) addr;
23 copy_mc_test_dst = ~0UL;
25 #else /* CONFIG_COPY_MC_TEST */
26 static inline void copy_mc_inject_src(void *addr)
30 static inline void copy_mc_inject_dst(void *addr)
33 #endif /* CONFIG_COPY_MC_TEST */
35 #else /* __ASSEMBLY__ */
36 #include <asm/export.h>
38 #ifdef CONFIG_COPY_MC_TEST
39 .macro COPY_MC_TEST_CTL
42 .globl copy_mc_test_src
45 EXPORT_SYMBOL_GPL(copy_mc_test_src)
46 .globl copy_mc_test_dst
49 EXPORT_SYMBOL_GPL(copy_mc_test_dst)
53 .macro COPY_MC_TEST_SRC reg count target
54 leaq \count(\reg), %r9
55 cmp copy_mc_test_src, %r9
59 .macro COPY_MC_TEST_DST reg count target
60 leaq \count(\reg), %r9
61 cmp copy_mc_test_dst, %r9
65 .macro COPY_MC_TEST_CTL
68 .macro COPY_MC_TEST_SRC reg count target
71 .macro COPY_MC_TEST_DST reg count target
73 #endif /* CONFIG_COPY_MC_TEST */
74 #endif /* __ASSEMBLY__ */
75 #endif /* _COPY_MC_TEST_H_ */