VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
b24413180f560 (Greg Kroah-Hartman 2017-11-01 15:07:57 +0100  1) /* SPDX-License-Identifier: GPL-2.0 */
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900  2) /* memset.S */
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900  3) 
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900  4) #include <asm/linkage.h>
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900  5) 
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900  6) #if defined(CONFIG_CPU_H8300H)
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900  7) 	.h8300h
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900  8) #endif
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900  9) #if defined(CONFIG_CPU_H8S)
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 10) 	.h8300s
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 11) #endif
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 12) 	.text
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 13) 
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 14) .global	memset
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 15) .global	clear_user
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 16) 
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 17) ;;void *memset(*ptr, int c, size_t count)
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 18) ;; ptr = er0
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 19) ;; c   = er1(r1l)
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 20) ;; count = er2
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 21) memset:
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 22) 	btst	#0,r0l
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 23) 	beq	2f
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 24) 
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 25) 	;; odd address
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 26) 1:
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 27) 	mov.b	r1l,@er0
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 28) 	adds	#1,er0
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 29) 	dec.l	#1,er2
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 30) 	beq	6f
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 31) 
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 32) 	;; even address
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 33) 2:
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 34) 	mov.l	er2,er3
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 35) 	cmp.l	#4,er2
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 36) 	blo	4f
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 37) 	;; count>=4 -> count/4
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 38) #if defined(CONFIG_CPU_H8300H)
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 39) 	shlr.l	er2
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 40) 	shlr.l	er2
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 41) #endif
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 42) #if defined(CONFIG_CPU_H8S)
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 43) 	shlr.l	#2,er2
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 44) #endif
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 45) 	;; byte -> long
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 46) 	mov.b	r1l,r1h
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 47) 	mov.w	r1,e1
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 48) 3:
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 49) 	mov.l	er1,@er0
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 50) 	adds	#4,er0
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 51) 	dec.l	#1,er2
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 52) 	bne	3b
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 53) 4:
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 54) 	;; count % 4
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 55) 	and.b	#3,r3l
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 56) 	beq	6f
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 57) 5:
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 58) 	mov.b	r1l,@er0
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 59) 	adds	#1,er0
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 60) 	dec.b	r3l
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 61) 	bne	5b
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 62) 6:
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 63) 	rts
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 64) 
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 65) clear_user:
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 66) 	mov.l	er1, er2
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 67) 	sub.l	er1, er1
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 68) 	bra	memset
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 69) 
a71a29de4c2f9 (Yoshinori Sato     2015-01-28 02:48:15 +0900 70) 	.end