Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ASM_X86_EDAC_H
0003 #define _ASM_X86_EDAC_H
0004 
0005 /* ECC atomic, DMA, SMP and interrupt safe scrub function */
0006 
0007 static inline void edac_atomic_scrub(void *va, u32 size)
0008 {
0009     u32 i, *virt_addr = va;
0010 
0011     /*
0012      * Very carefully read and write to memory atomically so we
0013      * are interrupt, DMA and SMP safe.
0014      */
0015     for (i = 0; i < size / 4; i++, virt_addr++)
0016         asm volatile("lock; addl $0, %0"::"m" (*virt_addr));
0017 }
0018 
0019 #endif /* _ASM_X86_EDAC_H */