git: a2e8fccd7ae4 - stable/13 - Implement suword16() for the 32-bit ARMv6/v7 architecture.

From: Hans Petter Selasky <hselasky_at_FreeBSD.org>
Date: Fri, 07 Jan 2022 13:30:58 UTC
The branch stable/13 has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=a2e8fccd7ae4d25867ed3b12f4a91a0cc2b5c698

commit a2e8fccd7ae4d25867ed3b12f4a91a0cc2b5c698
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2021-12-19 11:12:58 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-01-07 13:25:23 +0000

    Implement suword16() for the 32-bit ARMv6/v7 architecture.
    
    Sponsored by:   NVIDIA Networking
    
    (cherry picked from commit 516df155820471dd333a9cbc35bca3680d7b0051)
    (cherry picked from commit 48014c6679024f5f1b8217508915fbcd69c2041b)
---
 sys/arm/arm/fusu.S | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/sys/arm/arm/fusu.S b/sys/arm/arm/fusu.S
index 1a77377cb148..fd366542b283 100644
--- a/sys/arm/arm/fusu.S
+++ b/sys/arm/arm/fusu.S
@@ -212,6 +212,35 @@ fusupcbfaulttext:
 	.align	2
 #endif
 
+/*
+ * suword16(caddr_t uaddr, int x);
+ * Store an uint16_t in the user's address space.
+ */
+
+ENTRY(suword16)
+	ldr	r3, =(VM_MAXUSER_ADDRESS-3)
+	cmp	r0, r3
+	mvncs	r0, #0
+	RETc(cs)
+
+	GET_PCB(r2)
+	ldr	r2, [r2]
+
+#ifdef DIAGNOSTIC
+	teq	r2, #0x00000000
+	beq	.Lfusupcbfault
+#endif
+
+	adr	r3, .Lfusufault
+	str	r3, [r2, #PCB_ONFAULT]
+
+	strht	r1, [r0], #0
+
+	mov	r0, #0x00000000
+	str	r0, [r2, #PCB_ONFAULT]
+	RET
+END(suword16)
+
 /*
  * suword(caddr_t uaddr, int x);
  * Store an int in the user's address space.