git: ac672e747ff1 - main - mips: Implement suword16

From: Jessica Clarke <jrtc27_at_FreeBSD.org>
Date: Sun, 19 Dec 2021 12:49:10 UTC
The branch main has been updated by jrtc27:

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

commit ac672e747ff15e24ffa99f11c11f27ae305e988f
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2021-12-19 12:48:49 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2021-12-19 12:48:49 +0000

    mips: Implement suword16
    
    This fixes building USB-using kernels after 0ec590d24e41.
    
    Fixes:          0ec590d24e41 ("usb: add 32-bit compat for FIFOs")
---
 sys/mips/mips/support.S | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/sys/mips/mips/support.S b/sys/mips/mips/support.S
index 9fd5b919d89e..50aefc1fb9d0 100644
--- a/sys/mips/mips/support.S
+++ b/sys/mips/mips/support.S
@@ -272,6 +272,19 @@ LEAF(fubyte)
 	PTR_S	zero, U_PCB_ONFAULT(v1)
 END(fubyte)
 
+LEAF(suword16)
+	PTR_LA	v0, fswberr
+	blt	a0, zero, fswberr	# make sure address is in user space
+	nop
+	GET_CPU_PCPU(v1)
+	PTR_L	v1, PC_CURPCB(v1)
+	PTR_S	v0, U_PCB_ONFAULT(v1)
+	sh	a1, 0(a0)		# store short
+	PTR_S	zero, U_PCB_ONFAULT(v1)
+	j	ra
+	move	v0, zero
+END(suword16)
+
 LEAF(suword32)
 #ifndef __mips_n64
 XLEAF(suword)