Skip to content

Commit

Permalink
[MIPS] Polish <asm/edac.h>.
Browse files Browse the repository at this point in the history
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed Aug 27, 2007
1 parent 88eb413 commit 1bfa771
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions include/asm-mips/edac.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ static inline void atomic_scrub(void *va, u32 size)
unsigned long temp;
u32 i;

for (i = 0; i < size / sizeof(unsigned long); i++, virt_addr++) {

for (i = 0; i < size / sizeof(unsigned long); i++) {
/*
* Very carefully read and write to memory atomically
* so we are interrupt, DMA and SMP safe.
Expand All @@ -19,16 +18,16 @@ static inline void atomic_scrub(void *va, u32 size)
*/

__asm__ __volatile__ (
" .set mips3 \n"
"1: ll %0, %1 # atomic_add \n"
" ll %0, %1 # atomic_add \n"
" addu %0, $0 \n"
" sc %0, %1 \n"
" beqz %0, 1b \n"
" .set mips0 \n"
" .set mips2 \n"
"1: ll %0, %1 # atomic_scrub \n"
" addu %0, $0 \n"
" sc %0, %1 \n"
" beqz %0, 1b \n"
" .set mips0 \n"
: "=&r" (temp), "=m" (*virt_addr)
: "m" (*virt_addr));

virt_addr++;
}
}

Expand Down

0 comments on commit 1bfa771

Please sign in to comment.