summaryrefslogtreecommitdiff
path: root/i386
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2011-08-31 03:28:39 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-08-31 03:28:39 +0200
commita25d046db7a5f67b3aa553f988d2e7527e6a3d2b (patch)
treefb9671eeef5687d950a957f2f93f2f38c6d36d9f /i386
parentdc8e2985370f05184d47f956d98fc2404dbb6316 (diff)
Optimize copyout path
* i386/i386/locore.S (copyout): Remove RETRY() use from >=i486 variant. Move copyout_ret and copyout_fail.
Diffstat (limited to 'i386')
-rw-r--r--i386/i386/locore.S30
1 files changed, 13 insertions, 17 deletions
diff --git a/i386/i386/locore.S b/i386/i386/locore.S
index 221201c..c35b7ab 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);
*