4 #include <asm/compiler.h>
6 /* ECC atomic, DMA, SMP and interrupt safe scrub function */
8 static inline void edac_atomic_scrub(void *va
, u32 size
)
10 unsigned long *virt_addr
= va
;
14 for (i
= 0; i
< size
/ sizeof(unsigned long); i
++) {
16 * Very carefully read and write to memory atomically
17 * so we are interrupt, DMA and SMP safe.
19 * Intel: asm("lock; addl $0, %0"::"m"(*virt_addr));
22 __asm__
__volatile__ (
24 "1: ll %0, %1 # edac_atomic_scrub \n"
29 : "=&r" (temp
), "=" GCC_OFF_SMALL_ASM() (*virt_addr
)
30 : GCC_OFF_SMALL_ASM() (*virt_addr
));