⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uaccess64.s

📁 linux-2.6.15.6
💻 S
字号:
/* *  arch/s390x/lib/uaccess.S *    __copy_{from|to}_user functions. * *  s390 *    Copyright (C) 2000,2002 IBM Deutschland Entwicklung GmbH, IBM Corporation *    Authors(s): Martin Schwidefsky (schwidefsky@de.ibm.com) * *  These functions have standard call interface */#include <linux/errno.h>#include <asm/lowcore.h>#include <asm/asm-offsets.h>        .text        .align 4        .globl __copy_from_user_asm	# %r2 = to, %r3 = n, %r4 = from__copy_from_user_asm:	slgr	%r0,%r00:	mvcp	0(%r3,%r2),0(%r4),%r0	jnz	1f	slgr	%r2,%r2	br	%r141:	la	%r2,256(%r2)	la	%r4,256(%r4)	aghi	%r3,-2562:	mvcp	0(%r3,%r2),0(%r4),%r0	jnz	1b3:	slgr	%r2,%r2	br	%r144:	lghi	%r0,-4096	lgr	%r5,%r4	slgr	%r5,%r0	ngr	%r5,%r0		# %r5 = (%r4 + 4096) & -4096	slgr	%r5,%r4		# %r5 = #bytes to next user page boundary	clgr	%r3,%r5		# copy crosses next page boundary ?	jnh	6f		# no, the current page faulted	# move with the reduced length which is < 2565:	mvcp	0(%r5,%r2),0(%r4),%r0	slgr	%r3,%r56:	lgr	%r2,%r3	br	%r14        .section __ex_table,"a"	.quad	0b,4b	.quad	2b,4b	.quad	5b,6b        .previous        .align 4        .text        .globl __copy_to_user_asm	# %r2 = from, %r3 = n, %r4 = to__copy_to_user_asm:	slgr	%r0,%r00:	mvcs	0(%r3,%r4),0(%r2),%r0	jnz	1f	slgr	%r2,%r2	br	%r141:	la	%r2,256(%r2)	la	%r4,256(%r4)	aghi	%r3,-2562:	mvcs	0(%r3,%r4),0(%r2),%r0	jnz	1b3:	slgr	%r2,%r2	br	%r144:	lghi	%r0,-4096	lgr	%r5,%r4	slgr	%r5,%r0	ngr	%r5,%r0		# %r5 = (%r4 + 4096) & -4096	slgr	%r5,%r4		# %r5 = #bytes to next user page boundary	clgr	%r3,%r5		# copy crosses next page boundary ?	jnh	6f		# no, the current page faulted	# move with the reduced length which is < 2565:	mvcs	0(%r5,%r4),0(%r2),%r0	slgr	%r3,%r56:	lgr	%r2,%r3	br	%r14        .section __ex_table,"a"	.quad	0b,4b	.quad	2b,4b	.quad	5b,6b        .previous        .align 4        .text        .globl __copy_in_user_asm	# %r2 = from, %r3 = n, %r4 = to__copy_in_user_asm:	sacf	256	bras	1,1f	mvc	0(1,%r4),0(%r2)0:	mvc	0(256,%r4),0(%r2)	la	%r2,256(%r2)	la	%r4,256(%r4)1:	aghi	%r3,-256	jnm	0b2:	ex	%r3,0(%r1)	sacf	0	slgr	%r2,%r2	br	143:	mvc	0(1,%r4),0(%r2)	la	%r2,1(%r2)	la	%r4,1(%r4)	aghi	%r3,-1	jnm	3b4:	lgr	%r2,%r3	sacf	0	br	%r14        .section __ex_table,"a"	.quad	0b,3b	.quad	2b,3b	.quad	3b,4b        .previous        .align 4        .text        .globl __clear_user_asm	# %r2 = to, %r3 = n__clear_user_asm:	slgr	%r0,%r0	larl	%r5,empty_zero_page1:	mvcs	0(%r3,%r2),0(%r5),%r0	jnz	2f	slgr	%r2,%r2	br	%r142:	la	%r2,256(%r2)	aghi	%r3,-2563:	mvcs	0(%r3,%r2),0(%r5),%r0	jnz	2b4:	slgr	%r2,%r2	br	%r145:	lghi	%r0,-4096	lgr	%r4,%r2	slgr	%r4,%r0	ngr	%r4,%r0		# %r4 = (%r2 + 4096) & -4096	slgr	%r4,%r2		# %r4 = #bytes to next user page boundary	clgr	%r3,%r4		# clear crosses next page boundary ?	jnh	7f		# no, the current page faulted	# clear with the reduced length which is < 2566:	mvcs	0(%r4,%r2),0(%r5),%r0	slgr	%r3,%r47:	lgr	%r2,%r3	br	%r14        .section __ex_table,"a"	.quad	1b,5b	.quad	3b,5b	.quad	6b,7b        .previous        .align 4        .text        .globl __strncpy_from_user_asm	# %r2 = count, %r3 = dst, %r4 = src__strncpy_from_user_asm:	lghi	%r0,0	lgr	%r1,%r4	la	%r2,0(%r2,%r4)	# %r2 points to first byte after string	sacf	2560:	srst	%r2,%r1	jo	0b	sacf	0	lgr	%r1,%r2	jh	1f		# \0 found in string ?	aghi	%r1,1		# include \0 in copy1:	slgr	%r1,%r4		# %r1 = copy length (without \0)	slgr	%r2,%r4		# %r2 = return length (including \0)2:	mvcp	0(%r1,%r3),0(%r4),%r0	jnz	3f	br	%r143:	la	%r3,256(%r3)	la	%r4,256(%r4)	aghi	%r1,-256	mvcp	0(%r1,%r3),0(%r4),%r0	jnz	3b	br	%r144:	sacf	0	lghi	%r2,-EFAULT	br	%r14	.section __ex_table,"a"	.quad	0b,4b	.previous        .align 4        .text        .globl __strnlen_user_asm	# %r2 = count, %r3 = src__strnlen_user_asm:	lghi	%r0,0	lgr	%r1,%r3	la	%r2,0(%r2,%r3)	# %r2 points to first byte after string	sacf	2560:	srst	%r2,%r1	jo	0b	sacf	0	jh	1f		# \0 found in string ?	aghi	%r2,1		# strnlen_user result includes the \01:	slgr	%r2,%r3	br	%r142:	sacf	0	lghi	%r2,-EFAULT	br	%r14	.section __ex_table,"a"	.quad	0b,2b	.previous

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -