summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2017-05-12 19:25:20 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2017-05-12 19:25:20 +0000
commit69f77de764e4819331c13853e67803f61b46495b (patch)
tree86648da5a3a49173b8d0b7310a563991addd4f36 /sys/arch/amd64
parente186ec7c1bf6a48e79bf79df67c6bf4c8349af4b (diff)
Make copyin(9) and copyout(9) atomic for naturally aligned 32-bit words.
ok mpi@, visa@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/copy.S16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/copy.S b/sys/arch/amd64/amd64/copy.S
index ba71b7fa2be..0637717a020 100644
--- a/sys/arch/amd64/amd64/copy.S
+++ b/sys/arch/amd64/amd64/copy.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: copy.S,v 1.7 2015/04/25 21:31:24 guenther Exp $ */
+/* $OpenBSD: copy.S,v 1.8 2017/05/12 19:25:19 kettenis Exp $ */
/* $NetBSD: copy.S,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*
@@ -138,7 +138,12 @@ ENTRY(copyout)
rep
movsq
movb %al,%cl
- andb $7,%cl
+ shrb $2,%cl
+ andb $1,%cl
+ rep
+ movsl
+ movb %al,%cl
+ andb $3,%cl
rep
movsb
SMAP_CLAC
@@ -168,7 +173,12 @@ ENTRY(copyin)
rep
movsq
movb %al,%cl
- andb $7,%cl
+ shrb $2,%cl
+ andb $1,%cl
+ rep
+ movsl
+ movb %al,%cl
+ andb $3,%cl
rep
movsb