summaryrefslogtreecommitdiff
path: root/src/include/cpu/x86/mem.h
blob: 530c653277f1a36a7ca5cb2c742d87aa648e1b53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#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)
{
        asm volatile(
                "cld \n\t"
                "rep; stosl\n\t"
                : /* No outputs */
                : "a" (0), "D" (addr), "c" (size>>2)
                );

}

#endif /* CPU_X86_MEM_H */