arch/sparc/lib/GENmemcpy.S

Source file repositories/reference/linux-study-clean/arch/sparc/lib/GENmemcpy.S

File Facts

System
Linux kernel
Corpus path
arch/sparc/lib/GENmemcpy.S
Extension
.S
Size
2450 bytes
Lines
143
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

#ifdef __KERNEL__
#include <linux/linkage.h>
#define GLOBAL_SPARE	%g7
#else
#define GLOBAL_SPARE	%g5
#endif

#ifndef EX_LD
#define EX_LD(x,y)	x
#endif

#ifndef EX_ST
#define EX_ST(x,y)	x
#endif

#ifndef LOAD
#define LOAD(type,addr,dest)	type [addr], dest
#endif

#ifndef STORE
#define STORE(type,src,addr)	type src, [addr]
#endif

#ifndef FUNC_NAME
#define FUNC_NAME	GENmemcpy
#endif

#ifndef PREAMBLE
#define PREAMBLE
#endif

#ifndef XCC
#define XCC xcc
#endif

	.register	%g2,#scratch
	.register	%g3,#scratch

	.text

#ifndef EX_RETVAL
#define EX_RETVAL(x)	x
ENTRY(GEN_retl_o4_1)
	add	%o4, %o2, %o4
	retl
	 add	%o4, 1, %o0
ENDPROC(GEN_retl_o4_1)
ENTRY(GEN_retl_g1_8)
	add	%g1, %o2, %g1
	retl
	 add	%g1, 8, %o0
ENDPROC(GEN_retl_g1_8)
ENTRY(GEN_retl_o2_4)
	retl
	 add	%o2, 4, %o0
ENDPROC(GEN_retl_o2_4)
ENTRY(GEN_retl_o2_1)
	retl
	 add	%o2, 1, %o0
ENDPROC(GEN_retl_o2_1)
#endif

	.align		64

	.globl	FUNC_NAME
	.type	FUNC_NAME,#function
FUNC_NAME:	/* %o0=dst, %o1=src, %o2=len */
	srlx		%o2, 31, %g2
	cmp		%g2, 0
	tne		%XCC, 5

Annotation

Implementation Notes