diff --git a/drivers/md/kcopyd.c b/drivers/md/kcopyd.c index ca99979c868acbc38d752f83ee37a5553f12e2e6..8b3515f394a6ef93c115f00073bea02c071707ac 100644 --- a/drivers/md/kcopyd.c +++ b/drivers/md/kcopyd.c @@ -8,6 +8,7 @@ * completion notification. */ +#include #include #include diff --git a/fs/nfsctl.c b/fs/nfsctl.c index 0b14938b5b627ceac85590762fb50ec68f1c872f..0d4cf948606866f71d1807883da0afbf35968668 100644 --- a/fs/nfsctl.c +++ b/fs/nfsctl.c @@ -5,6 +5,7 @@ * */ #include +#include #include #include #include diff --git a/include/asm-i386/atomic.h b/include/asm-i386/atomic.h index de649d3aa2d45d630874634c11f732e5e4819491..e2c00c95a5e130b5bc16249a76c8e82d82ff0cb6 100644 --- a/include/asm-i386/atomic.h +++ b/include/asm-i386/atomic.h @@ -255,5 +255,17 @@ __asm__ __volatile__(LOCK "orl %0,%1" \ #define smp_mb__before_atomic_inc() barrier() #define smp_mb__after_atomic_inc() barrier() +/* ECC atomic, DMA, SMP and interrupt safe scrub function */ + +static __inline__ void atomic_scrub(unsigned long *virt_addr, u32 size) +{ + u32 i; + for (i = 0; i < size / 4; i++, virt_addr++) + /* Very carefully read and write to memory atomically + * so we are interrupt, DMA and SMP safe. + */ + __asm__ __volatile__("lock; addl $0, %0"::"m"(*virt_addr)); +} + #include #endif diff --git a/include/asm-x86_64/atomic.h b/include/asm-x86_64/atomic.h index 4b5cd553e772637d157b0af95edbd89d7e12eb1a..4048508c4f407fbd7bdd5129974a101014d24265 100644 --- a/include/asm-x86_64/atomic.h +++ b/include/asm-x86_64/atomic.h @@ -426,5 +426,17 @@ __asm__ __volatile__(LOCK "orl %0,%1" \ #define smp_mb__before_atomic_inc() barrier() #define smp_mb__after_atomic_inc() barrier() +/* ECC atomic, DMA, SMP and interrupt safe scrub function */ + +static __inline__ void atomic_scrub(u32 *virt_addr, u32 size) +{ + u32 i; + for (i = 0; i < size / 4; i++, virt_addr++) + /* Very carefully read and write to memory atomically + * so we are interrupt, DMA and SMP safe. + */ + __asm__ __volatile__("lock; addl $0, %0"::"m"(*virt_addr)); +} + #include #endif diff --git a/kernel/audit.c b/kernel/audit.c index d13ab7d2d8994f38fb9bf422d873152fd4417057..0a813d2883e58089563bd0d266a99e5c029ece3b 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -42,8 +42,8 @@ */ #include -#include #include +#include #include #include #include diff --git a/kernel/auditsc.c b/kernel/auditsc.c index d8a68509e7299df13233c98134c9431e994faa41..685c25175d96374a601d33460dae6e7a35ff0f07 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -30,8 +30,8 @@ */ #include -#include #include +#include #include #include #include diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 165a4d81efa4a75663e72e12d3cfa12eddb9f969..f29a12da5109d91a9a9dfebd318c2b1aa5a63b94 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -40,12 +40,12 @@ */ #include +#include #include #include #include #include #include -#include #include #include #include