edac.h 474 B

12345678910111213141516171819
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_X86_EDAC_H
  3. #define _ASM_X86_EDAC_H
  4. /* ECC atomic, DMA, SMP and interrupt safe scrub function */
  5. static inline void edac_atomic_scrub(void *va, u32 size)
  6. {
  7. u32 i, *virt_addr = va;
  8. /*
  9. * Very carefully read and write to memory atomically so we
  10. * are interrupt, DMA and SMP safe.
  11. */
  12. for (i = 0; i < size / 4; i++, virt_addr++)
  13. asm volatile("lock; addl $0, %0"::"m" (*virt_addr));
  14. }
  15. #endif /* _ASM_X86_EDAC_H */