blk: rq_data_dir() should not return a boolean
[cris-mirror.git] / arch / mips / include / asm / edac.h
blob980b165273741061323a5bf861ff9e2c07ed382c
1 #ifndef ASM_EDAC_H
2 #define ASM_EDAC_H
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;
11 unsigned long temp;
12 u32 i;
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__ (
23 " .set mips2 \n"
24 "1: ll %0, %1 # edac_atomic_scrub \n"
25 " addu %0, $0 \n"
26 " sc %0, %1 \n"
27 " beqz %0, 1b \n"
28 " .set mips0 \n"
29 : "=&r" (temp), "=" GCC_OFF_SMALL_ASM() (*virt_addr)
30 : GCC_OFF_SMALL_ASM() (*virt_addr));
32 virt_addr++;
36 #endif