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)  * Based on arch/arm/lib/clear_user.S
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  * Copyright (C) 2012 ARM Ltd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) #include <linux/linkage.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) #include <asm/asm-uaccess.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <asm/assembler.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) 	.text
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) /* Prototype: int __arch_clear_user(void *addr, size_t sz)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)  * Purpose  : clear some user memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)  * Params   : addr - user memory address to clear
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)  *          : sz   - number of bytes to clear
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)  * Returns  : number of bytes NOT cleared
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)  * Alignment fixed up by hardware.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) SYM_FUNC_START(__arch_clear_user)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 	mov	x2, x1			// save the size for fixup return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 	subs	x1, x1, #8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 	b.mi	2f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 1:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) uao_user_alternative 9f, str, sttr, xzr, x0, 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 	subs	x1, x1, #8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 	b.pl	1b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 2:	adds	x1, x1, #4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 	b.mi	3f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) uao_user_alternative 9f, str, sttr, wzr, x0, 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	sub	x1, x1, #4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 3:	adds	x1, x1, #2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 	b.mi	4f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) uao_user_alternative 9f, strh, sttrh, wzr, x0, 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 	sub	x1, x1, #2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 4:	adds	x1, x1, #1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 	b.mi	5f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) uao_user_alternative 9f, strb, sttrb, wzr, x0, 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 5:	mov	x0, #0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 	ret
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) SYM_FUNC_END(__arch_clear_user)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) EXPORT_SYMBOL(__arch_clear_user)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 	.section .fixup,"ax"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 	.align	2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 9:	mov	x0, x2			// return the original size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 	ret
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 	.previous