arch/sparc/lib/strncmp_32.S

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

File Facts

System
Linux kernel
Corpus path
arch/sparc/lib/strncmp_32.S
Extension
.S
Size
1353 bytes
Lines
122
Domain
Architecture Layer
Bucket
arch/sparc
Inferred role
Architecture Layer: exported/initcall integration point
Status
integration implementation candidate

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/export.h>
#include <linux/linkage.h>

	.text
ENTRY(strncmp)
	mov	%o0, %g3
	mov	0, %o3

	cmp	%o2, 3
	ble	7f
	 mov	0, %g2

	sra	%o2, 2, %o4
	ldub	[%g3], %o3

0:
	ldub	[%o1], %g2
	add	%g3, 1, %g3
	and	%o3, 0xff, %o0

	cmp	%o0, 0
	be	8f
	 add	%o1, 1, %o1

	cmp	%o0, %g2
	be,a	1f
	 ldub	[%g3], %o3

	retl
	 sub	%o0, %g2, %o0

1:
	ldub	[%o1], %g2
	add	%g3,1, %g3
	and	%o3, 0xff, %o0

	cmp	%o0, 0
	be	8f
	 add	%o1, 1, %o1

	cmp	%o0, %g2
	be,a	1f
	 ldub	[%g3], %o3

	retl
	 sub	%o0, %g2, %o0

1:
	ldub	[%o1], %g2
	add	%g3, 1, %g3
	and	%o3, 0xff, %o0

	cmp	%o0, 0
	be	8f
	 add	%o1, 1, %o1

	cmp	%o0, %g2
	be,a	1f
	 ldub	[%g3], %o3

	retl
	 sub	%o0, %g2, %o0

1:
	ldub	[%o1], %g2
	add	%g3, 1, %g3
	and	%o3, 0xff, %o0

	cmp	%o0, 0
	be	8f

Annotation

Implementation Notes