Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  *  linux/arch/arm/lib/putuser.S
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  *  Copyright (C) 2001 Russell King
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  *  Idea from x86 version, (C) Copyright 1998 Linus Torvalds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9)  * These functions have a non-standard call interface to make
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)  * them more efficient, especially as they return an error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)  * value in addition to the "real" return value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)  * __put_user_X
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)  * Inputs:	r0 contains the address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)  *		r1 contains the address limit, which must be preserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)  *		r2, r3 contains the value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)  * Outputs:	r0 is the error code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)  *		lr corrupted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)  * No other registers must be altered.  (see <asm/uaccess.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)  * for specific ASM register usage).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)  * Note that ADDR_LIMIT is either 0 or 0xc0000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)  * Note also that it is intended that __put_user_bad is not global.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #include <linux/linkage.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #include <asm/assembler.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #include <asm/errno.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #include <asm/domain.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) ENTRY(__put_user_1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	check_uaccess r0, 1, r1, ip, __put_user_bad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 1: TUSER(strb)	r2, [r0]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 	mov	r0, #0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 	ret	lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) ENDPROC(__put_user_1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) ENTRY(__put_user_2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 	check_uaccess r0, 2, r1, ip, __put_user_bad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #if __LINUX_ARM_ARCH__ >= 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 2: TUSER(strh)	r2, [r0]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 	mov	ip, r2, lsr #8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #ifndef __ARMEB__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 2: TUSER(strb)	r2, [r0], #1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 3: TUSER(strb)	ip, [r0]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 2: TUSER(strb)	ip, [r0], #1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 3: TUSER(strb)	r2, [r0]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #endif /* __LINUX_ARM_ARCH__ >= 6 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 	mov	r0, #0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 	ret	lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) ENDPROC(__put_user_2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) ENTRY(__put_user_4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 	check_uaccess r0, 4, r1, ip, __put_user_bad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 4: TUSER(str)	r2, [r0]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) 	mov	r0, #0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) 	ret	lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) ENDPROC(__put_user_4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) ENTRY(__put_user_8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) 	check_uaccess r0, 8, r1, ip, __put_user_bad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) #ifdef CONFIG_THUMB2_KERNEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) 5: TUSER(str)	r2, [r0]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) 6: TUSER(str)	r3, [r0, #4]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) 5: TUSER(str)	r2, [r0], #4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) 6: TUSER(str)	r3, [r0]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) 	mov	r0, #0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) 	ret	lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) ENDPROC(__put_user_8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) __put_user_bad:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) 	mov	r0, #-EFAULT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) 	ret	lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) ENDPROC(__put_user_bad)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) .pushsection __ex_table, "a"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) 	.long	1b, __put_user_bad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) 	.long	2b, __put_user_bad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) #if __LINUX_ARM_ARCH__ < 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) 	.long	3b, __put_user_bad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) 	.long	4b, __put_user_bad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) 	.long	5b, __put_user_bad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) 	.long	6b, __put_user_bad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) .popsection