diff options
author | 2020-10-16 23:42:14 +0000 | |
---|---|---|
committer | 2020-10-16 23:42:14 +0000 | |
commit | 1a8dbaac879b9f3335ad7fb25429ce63ac1d6bac (patch) | |
tree | 1012eaf97347a2d9691ed5e6290a8f4ad98684ec /lib/libc/arch/powerpc64/string | |
parent | Add retguard asm macros for ppc64. (diff) | |
download | wireguard-openbsd-1a8dbaac879b9f3335ad7fb25429ce63ac1d6bac.tar.xz wireguard-openbsd-1a8dbaac879b9f3335ad7fb25429ce63ac1d6bac.zip |
Adapt SYS.h to use retguard macros from asm.h, so that generated system
calls are guarded. Adapt the first few hand-written functions to this
model (a few remain)
ok kettenis mortimer
Diffstat (limited to 'lib/libc/arch/powerpc64/string')
-rw-r--r-- | lib/libc/arch/powerpc64/string/ffs.S | 4 | ||||
-rw-r--r-- | lib/libc/arch/powerpc64/string/memmove.S | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/libc/arch/powerpc64/string/ffs.S b/lib/libc/arch/powerpc64/string/ffs.S index 8e656698ec9..8f6ec55421f 100644 --- a/lib/libc/arch/powerpc64/string/ffs.S +++ b/lib/libc/arch/powerpc64/string/ffs.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs.S,v 1.1 2020/06/26 20:16:21 naddy Exp $ */ +/* $OpenBSD: ffs.S,v 1.2 2020/10/16 23:42:16 deraadt Exp $ */ /* * Written by Christian Weisgerber <naddy@openbsd.org>. * Public domain. @@ -7,9 +7,11 @@ #include "DEFS.h" ENTRY(ffs) + RETGUARD_SETUP(ffs, %r11); neg %r4, %r3 and %r3, %r3, %r4 cntlzw %r3, %r3 subfic %r3, %r3, 32 + RETGUARD_CHECK(ffs, %r11); blr END_BUILTIN(ffs) diff --git a/lib/libc/arch/powerpc64/string/memmove.S b/lib/libc/arch/powerpc64/string/memmove.S index a944320f390..3c869495983 100644 --- a/lib/libc/arch/powerpc64/string/memmove.S +++ b/lib/libc/arch/powerpc64/string/memmove.S @@ -1,4 +1,4 @@ -/* $OpenBSD: memmove.S,v 1.1 2020/06/25 02:34:22 drahn Exp $ */ +/* $OpenBSD: memmove.S,v 1.2 2020/10/16 23:42:16 deraadt Exp $ */ /* $NetBSD: memmove.S,v 1.3 2011/01/15 07:31:12 matt Exp $ */ /* stropt/memmove.S, pl_string_common, pl_linux 10/11/04 11:45:37 @@ -56,6 +56,7 @@ ENTRY(bcopy) /* void *memmove(void *, const void *, size_t) */ ENTRY(memmove) + RETGUARD_SETUP(memmove, %r11); mr %r8, %r3 /* Save dst (return value) */ cmpd %r4, %r8 /* Branch to reverse if */ @@ -110,8 +111,7 @@ last2: lbzu %r6, 1(%r4) /* But handle the rest by */ stbu %r6, 1(%r8) /* updating addr by 1 */ bdnz+ last2 - - blr + b done /* We're here since src < dest. Don't want to overwrite end of */ /* src with start of dest */ @@ -165,6 +165,8 @@ rlast2: bdnz+ rlast2 /* Dec ctr, and branch if more */ /* bytes left */ +done: + RETGUARD_CHECK(memmove, %r11); blr END_STRONG(memmove) END_WEAK(bcopy) |