From: Ben Pfaff Date: Thu, 26 Aug 2004 19:01:02 +0000 (+0000) Subject: Optimize filesys_stub_get_bytes(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30e5bb633c98deda3cc2c5743819714577eb08be;p=pintos-anon Optimize filesys_stub_get_bytes(). --- diff --git a/src/filesys/filesys-stub.c b/src/filesys/filesys-stub.c index 29c4cb9..edf5de2 100644 --- a/src/filesys/filesys-stub.c +++ b/src/filesys/filesys-stub.c @@ -84,7 +84,11 @@ filesys_stub_get_bool (void) void filesys_stub_get_bytes (void *buffer, size_t size) { - backdoor_get_bytes (buffer, size, in_byte, NULL); + /* We could use backdoor_get_bytes() but this is significantly + faster. */ + asm ("rep insl; movl %0, %%ecx; rep insb" + : + : "g" (size % 4), "d" (0x8901), "c" (size / 4), "D" (buffer)); } struct file *