ACPI / LPSS: Make acpi_lpss_find_device() also find PCI devices
[linux/fpc-iii.git] / arch / x86 / include / asm / mcsafe_test.h
blobeb59804b6201c35c85f66230522c663904ffada1
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _MCSAFE_TEST_H_
3 #define _MCSAFE_TEST_H_
5 #ifndef __ASSEMBLY__
6 #ifdef CONFIG_MCSAFE_TEST
7 extern unsigned long mcsafe_test_src;
8 extern unsigned long mcsafe_test_dst;
10 static inline void mcsafe_inject_src(void *addr)
12 if (addr)
13 mcsafe_test_src = (unsigned long) addr;
14 else
15 mcsafe_test_src = ~0UL;
18 static inline void mcsafe_inject_dst(void *addr)
20 if (addr)
21 mcsafe_test_dst = (unsigned long) addr;
22 else
23 mcsafe_test_dst = ~0UL;
25 #else /* CONFIG_MCSAFE_TEST */
26 static inline void mcsafe_inject_src(void *addr)
30 static inline void mcsafe_inject_dst(void *addr)
33 #endif /* CONFIG_MCSAFE_TEST */
35 #else /* __ASSEMBLY__ */
36 #include <asm/export.h>
38 #ifdef CONFIG_MCSAFE_TEST
39 .macro MCSAFE_TEST_CTL
40 .pushsection .data
41 .align 8
42 .globl mcsafe_test_src
43 mcsafe_test_src:
44 .quad 0
45 EXPORT_SYMBOL_GPL(mcsafe_test_src)
46 .globl mcsafe_test_dst
47 mcsafe_test_dst:
48 .quad 0
49 EXPORT_SYMBOL_GPL(mcsafe_test_dst)
50 .popsection
51 .endm
53 .macro MCSAFE_TEST_SRC reg count target
54 leaq \count(\reg), %r9
55 cmp mcsafe_test_src, %r9
56 ja \target
57 .endm
59 .macro MCSAFE_TEST_DST reg count target
60 leaq \count(\reg), %r9
61 cmp mcsafe_test_dst, %r9
62 ja \target
63 .endm
64 #else
65 .macro MCSAFE_TEST_CTL
66 .endm
68 .macro MCSAFE_TEST_SRC reg count target
69 .endm
71 .macro MCSAFE_TEST_DST reg count target
72 .endm
73 #endif /* CONFIG_MCSAFE_TEST */
74 #endif /* __ASSEMBLY__ */
75 #endif /* _MCSAFE_TEST_H_ */