arch/sparc/kernel/una_asm_32.S

Source file repositories/reference/linux-study-clean/arch/sparc/kernel/una_asm_32.S

File Facts

System
Linux kernel
Corpus path
arch/sparc/kernel/una_asm_32.S
Extension
.S
Size
2983 bytes
Lines
155
Domain
Architecture Layer
Bucket
arch/sparc
Inferred role
Architecture Layer: arch/sparc
Status
atlas-only

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

#include <linux/errno.h>

	.text

retl_efault:
	retl
	 mov	-EFAULT, %o0

	/* int __do_int_store(unsigned long *dst_addr, int size,
	 *                    unsigned long *src_val)
	 *
	 * %o0 = dest_addr
	 * %o1 = size
	 * %o2 = src_val
	 *
	 * Return '0' on success, -EFAULT on failure.
	 */
	.globl	__do_int_store
__do_int_store:
	ld	[%o2], %g1
	cmp	%o1, 2
	be	2f
	 cmp	%o1, 4
	be	1f
	 srl	%g1, 24, %g2
	srl	%g1, 16, %g7
4:	stb	%g2, [%o0]
	srl	%g1, 8, %g2
5:	stb	%g7, [%o0 + 1]
	ld	[%o2 + 4], %g7
6:	stb	%g2, [%o0 + 2]
	srl	%g7, 24, %g2
7:	stb	%g1, [%o0 + 3]
	srl	%g7, 16, %g1
8:	stb	%g2, [%o0 + 4]
	srl	%g7, 8, %g2
9:	stb	%g1, [%o0 + 5]
10:	stb	%g2, [%o0 + 6]
	b	0f
11:	 stb	%g7, [%o0 + 7]
1:	srl	%g1, 16, %g7
12:	stb	%g2, [%o0]
	srl	%g1, 8, %g2
13:	stb	%g7, [%o0 + 1]
14:	stb	%g2, [%o0 + 2]
	b	0f
15:	 stb	%g1, [%o0 + 3]
2:	srl	%g1, 8, %g2
16:	stb	%g2, [%o0]
17:	stb	%g1, [%o0 + 1]
0:	retl
	 mov	0, %o0

	.section __ex_table,#alloc
	.word	4b, retl_efault
	.word	5b, retl_efault
	.word	6b, retl_efault
	.word	7b, retl_efault
	.word	8b, retl_efault
	.word	9b, retl_efault
	.word	10b, retl_efault
	.word	11b, retl_efault
	.word	12b, retl_efault
	.word	13b, retl_efault
	.word	14b, retl_efault
	.word	15b, retl_efault
	.word	16b, retl_efault
	.word	17b, retl_efault
	.previous

Annotation

Implementation Notes