2004-10-14 22:13:01 +02:00
|
|
|
#ifndef CPU_X86_MEM_H
|
|
|
|
#define CPU_X86_MEM_H
|
|
|
|
|
|
|
|
/* Optimized generic x86 assembly for clearing memory */
|
|
|
|
static inline void clear_memory(void *addr, unsigned long size)
|
|
|
|
{
|
2006-04-03 22:38:34 +02:00
|
|
|
asm volatile(
|
|
|
|
"cld \n\t"
|
|
|
|
"rep stosl\n\t"
|
|
|
|
: /* No outputs */
|
|
|
|
: "a" (0), "D" (addr), "c" (size>>2)
|
|
|
|
);
|
|
|
|
|
2004-10-14 22:13:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* CPU_X86_MEM_H */
|