diff options
author | 2017-12-30 10:20:34 +0000 | |
---|---|---|
committer | 2017-12-30 10:20:34 +0000 | |
commit | 8ad2d952b645c43391da1e3521672a6a0ffe8c99 (patch) | |
tree | 27da569c96de15c9188a875ed4e0ed009f0e40ca /sys | |
parent | get_date(), from getdate.y, was last used in the sparc support, so zap it (diff) | |
download | wireguard-openbsd-8ad2d952b645c43391da1e3521672a6a0ffe8c99.tar.xz wireguard-openbsd-8ad2d952b645c43391da1e3521672a6a0ffe8c99.zip |
Add copyin32 implementation.
ok guenther@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/arm64/arm64/copy.S | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/arch/arm64/arm64/copy.S b/sys/arch/arm64/arm64/copy.S index 0a493cc16e1..af9f015ec08 100644 --- a/sys/arch/arm64/arm64/copy.S +++ b/sys/arch/arm64/arm64/copy.S @@ -1,4 +1,4 @@ -/* $OpenBSD: copy.S,v 1.3 2017/02/15 21:39:50 patrick Exp $ */ +/* $OpenBSD: copy.S,v 1.4 2017/12/30 10:20:34 kettenis Exp $ */ /* * Copyright (c) 2015 Dale Rahn <drahn@dalerahn.com> * Copyright (c) 2014 Patrick Wildt <patrick@blueri.se> @@ -61,6 +61,28 @@ ENTRY(copyin) ret /* + * x0 = user space address + * x1 = kernel space address + * + * Atomically copies a 32-bit word from user space to kernel space + * + * XXX should this assert that address spaces are correct for each address? + */ +ENTRY(copyin32) + mrs x3, tpidr_el1 // load cpuinfo + ldr x3, [x3, #(CI_CURPCB)] + ldr x4, [x3, #(PCB_ONFAULT)] + adr x5, .Lcopyfault + str x5, [x3, #(PCB_ONFAULT)] // set handler + + ldtr w6, [x0] + str w6, [x1] + + str x4, [x3, #(PCB_ONFAULT)] // clear handler + mov x0, xzr + ret + +/* * x0 = kernel space address * x1 = user space address * x2 = length |