From d0f3efca650eccd5179e045cd07f7d723037defc Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 1 Sep 2011 10:41:21 -0400 Subject: Use stosl in memset; makes boot time bearable --- x86.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'x86.h') diff --git a/x86.h b/x86.h index 828d5bc..0c3feae 100644 --- a/x86.h +++ b/x86.h @@ -48,6 +48,15 @@ stosb(void *addr, int data, int cnt) "memory", "cc"); } +static inline void +stosl(void *addr, int data, int cnt) +{ + asm volatile("cld; rep stosl" : + "=D" (addr), "=c" (cnt) : + "0" (addr), "1" (cnt), "a" (data) : + "memory", "cc"); +} + struct segdesc; static inline void -- cgit v1.2.3