summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2017-05-12 19:25:19 +0000
committerkettenis <kettenis@openbsd.org>2017-05-12 19:25:19 +0000
commitb221ce63fe7adfbde39fabe44637ca7ef2c808a9 (patch)
treef331262b4beb76f655bb0ff755d1eb098d955de1
parentExport delay statistics instead of bucket information (diff)
downloadwireguard-openbsd-b221ce63fe7adfbde39fabe44637ca7ef2c808a9.tar.xz
wireguard-openbsd-b221ce63fe7adfbde39fabe44637ca7ef2c808a9.zip
Make copyin(9) and copyout(9) atomic for naturally aligned 32-bit words.
ok mpi@, visa@
-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