From a25d046db7a5f67b3aa553f988d2e7527e6a3d2b Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 31 Aug 2011 03:28:39 +0200 Subject: Optimize copyout path * i386/i386/locore.S (copyout): Remove RETRY() use from >=i486 variant. Move copyout_ret and copyout_fail. --- i386/i386/locore.S | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/i386/i386/locore.S b/i386/i386/locore.S index 221201c4..c35b7aba 100644 --- a/i386/i386/locore.S +++ b/i386/i386/locore.S @@ -1298,19 +1298,26 @@ Entry(copyoutmsg) movl %eax,%ecx /* move by longwords first */ shrl $2,%ecx RECOVER(copyout_fail) - RETRY(copyout_retry_longs) -copyout_retry_longs: rep movsl movl %eax,%ecx /* now move remaining bytes */ andl $3,%ecx RECOVER(copyout_fail) - RETRY(copyout_retry_bytes) -copyout_retry_bytes: rep movsb /* move */ xorl %eax,%eax /* return 0 for success */ - jmp copyout_ret + +copyout_ret: + mov %ss,%di /* restore ES to kernel segment */ + mov %di,%es + + popl %edi /* restore registers */ + popl %esi + ret /* and return */ + +copyout_fail: + movl $1,%eax /* return 1 for failure */ + jmp copyout_ret /* pop frame and return */ #if !defined(MACH_HYP) && !PAE /* @@ -1372,20 +1379,9 @@ copyout_retry: subl %eax,%edx /* decrement count */ jg copyout_retry /* restart on next page if not done */ xorl %eax,%eax /* return 0 for success */ + jmp copyout_ret #endif /* !defined(MACH_HYP) && !PAE */ -copyout_ret: - mov %ss,%di /* restore ES to kernel segment */ - mov %di,%es - - popl %edi /* restore registers */ - popl %esi - ret /* and return */ - -copyout_fail: - movl $1,%eax /* return 1 for failure */ - jmp copyout_ret /* pop frame and return */ - /* * int inst_fetch(int eip, int cs); * -- cgit v1.2.3