summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2016-10-04 03:15:51 +0000
committerguenther <guenther@openbsd.org>2016-10-04 03:15:51 +0000
commitaa9f6bfe037dc443ad3cc550a5705d5c20f8cf2b (patch)
tree53af9fe27dfc49596b6420933f9901a957d667c2
parentRemove some dead code in cmd-move-window.c and make a load of local (diff)
downloadwireguard-openbsd-aa9f6bfe037dc443ad3cc550a5705d5c20f8cf2b.tar.xz
wireguard-openbsd-aa9f6bfe037dc443ad3cc550a5705d5c20f8cf2b.zip
Use the userspace-visible thread register directly in __cerror instead
of indirecting through __errno(). Register naming tweaks and clang testing by patrick@ and jsg@ ok kettenis@
-rw-r--r--lib/libc/arch/arm/sys/cerror.S14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/libc/arch/arm/sys/cerror.S b/lib/libc/arch/arm/sys/cerror.S
index ec6bce8a1aa..9d04b9cb4e2 100644
--- a/lib/libc/arch/arm/sys/cerror.S
+++ b/lib/libc/arch/arm/sys/cerror.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cerror.S,v 1.9 2016/08/06 19:16:09 guenther Exp $ */
+/* $OpenBSD: cerror.S,v 1.10 2016/10/04 03:15:51 guenther Exp $ */
/* $NetBSD: cerror.S,v 1.5 2003/08/07 16:42:04 agc Exp $ */
/*-
@@ -34,11 +34,13 @@
#include "SYS.h"
+/* offsetof(struct tib, tib_errno) - offsetof(struct tib, __tib_tcb) */
+#define TCB_OFFSET_ERRNO (-8)
+
_ENTRY(CERROR)
- stmfd sp!, {r4, lr}
- mov r4, r0
- bl _HIDDEN(__errno)
- str r4, [r0]
+ mrc p15, 0, r1, c13, c0, 3
+ str r0, [r1, #TCB_OFFSET_ERRNO]
mvn r0, #0x00000000
mvn r1, #0x00000000
- ldmfd sp!, {r4, pc}
+ mov pc, lr
+END(CERROR)