Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F159888114
D18850.id52872.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D18850.id52872.diff
View Options
Index: sys/riscv/include/asm.h
===================================================================
--- sys/riscv/include/asm.h
+++ sys/riscv/include/asm.h
@@ -50,6 +50,10 @@
.text; .globl sym; .type sym,@function; .align 4; sym:
#define END(sym) .size sym, . - sym
+#define ENTRY_LOCAL(sym) \
+ .text; .local sym; .type sym,@function; .align 4; sym:
+#define END_LOCAL(sym) .size sym, . - sym
+
#define EENTRY(sym) \
.globl sym; sym:
#define EEND(sym)
Index: sys/riscv/riscv/copyinout.S
===================================================================
--- sys/riscv/riscv/copyinout.S
+++ sys/riscv/riscv/copyinout.S
@@ -62,19 +62,7 @@
li a4, VM_MAXUSER_ADDRESS
bgt a3, a4, copyio_fault_nopcb
- la a6, copyio_fault /* Get the handler address */
- SET_FAULT_HANDLER(a6, a7) /* Set the handler */
- ENTER_USER_ACCESS(a7)
-
-1: lb a4, 0(a0) /* Load from kaddr */
- addi a0, a0, 1
- sb a4, 0(a1) /* Store in uaddr */
- addi a1, a1, 1
- addi a2, a2, -1 /* len-- */
- bnez a2, 1b
-
- EXIT_USER_ACCESS(a7)
- SET_FAULT_HANDLER(x0, a7) /* Clear the handler */
+ j copycommon
2: li a0, 0 /* return 0 */
ret
@@ -91,19 +79,7 @@
li a4, VM_MAXUSER_ADDRESS
bgt a3, a4, copyio_fault_nopcb
- la a6, copyio_fault /* Get the handler address */
- SET_FAULT_HANDLER(a6, a7) /* Set the handler */
- ENTER_USER_ACCESS(a7)
-
-1: lb a4, 0(a0) /* Load from uaddr */
- addi a0, a0, 1
- sb a4, 0(a1) /* Store in kaddr */
- addi a1, a1, 1
- addi a2, a2, -1 /* len-- */
- bnez a2, 1b
-
- EXIT_USER_ACCESS(a7)
- SET_FAULT_HANDLER(x0, a7) /* Clear the handler */
+ j copycommon
2: li a0, 0 /* return 0 */
ret
@@ -146,3 +122,29 @@
5:
ret
END(copyinstr)
+
+/*
+ * copycommon - local copy function
+ *
+ * a0 (src) - Source address
+ * a1 (dest) - Destination address
+ * a2 (len) - Size of the copy
+ */
+ENTRY_LOCAL(copycommon)
+ la a6, copyio_fault /* Get the handler address */
+ SET_FAULT_HANDLER(a6, a7) /* Set the handler */
+ ENTER_USER_ACCESS(a7)
+
+1: lb a4, 0(a0) /* Load from src */
+ addi a0, a0, 1
+ sb a4, 0(a1) /* Store in dest */
+ addi a1, a1, 1
+ addi a2, a2, -1 /* len-- */
+ bnez a2, 1b
+
+ EXIT_USER_ACCESS(a7)
+ SET_FAULT_HANDLER(x0, a7) /* Clear the handler */
+
+ li a0, 0
+ ret
+END_LOCAL(copycommon)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jun 20, 3:35 AM (10 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34110092
Default Alt Text
D18850.id52872.diff (2 KB)
Attached To
Mode
D18850: Extract common code in copyin/copyout to local routine
Attached
Detach File
Event Timeline
Log In to Comment