arch/sparc/lib/memset.S

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

File Facts

System
Linux kernel
Corpus path
arch/sparc/lib/memset.S
Extension
.S
Size
3861 bytes
Lines
198
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 <asm/ptrace.h>

/* Work around cpp -rob */
#define ALLOC #alloc
#define EXECINSTR #execinstr
#define EX(x,y,a,b) 				\
98: 	x,y;					\
	.section .fixup,ALLOC,EXECINSTR;	\
	.align	4;				\
99:	retl;					\
	 a, b, %o0;				\
	.section __ex_table,ALLOC;		\
	.align	4;				\
	.word	98b, 99b;			\
	.text;					\
	.align	4

#define STORE(source, base, offset, n)		\
98: 	std source, [base + offset + n];	\
	.section .fixup,ALLOC,EXECINSTR;	\
	.align	4;				\
99:	ba 30f;					\
	 sub %o3, n - offset, %o3;		\
	.section __ex_table,ALLOC;		\
	.align	4;				\
	.word	98b, 99b;			\
	.text;					\
	.align	4;

#define STORE_LAST(source, base, offset, n)	\
	EX(std source, [base - offset - n],	\
	   add %o1, offset + n);

/* Please don't change these macros, unless you change the logic
 * in the .fixup section below as well.
 * Store 64 bytes at (BASE + OFFSET) using value SOURCE. */
#define ZERO_BIG_BLOCK(base, offset, source)	\
	STORE(source, base, offset, 0x00);	\
	STORE(source, base, offset, 0x08);	\
	STORE(source, base, offset, 0x10);	\
	STORE(source, base, offset, 0x18);	\
	STORE(source, base, offset, 0x20);	\
	STORE(source, base, offset, 0x28);	\
	STORE(source, base, offset, 0x30);	\
	STORE(source, base, offset, 0x38);

#define ZERO_LAST_BLOCKS(base, offset, source)	\
	STORE_LAST(source, base, offset, 0x38);	\
	STORE_LAST(source, base, offset, 0x30); \
	STORE_LAST(source, base, offset, 0x28);	\
	STORE_LAST(source, base, offset, 0x20);	\
	STORE_LAST(source, base, offset, 0x18);	\
	STORE_LAST(source, base, offset, 0x10);	\
	STORE_LAST(source, base, offset, 0x08);	\
	STORE_LAST(source, base, offset, 0x00);

	.text
	.align 4

        .globl  __bzero_begin
__bzero_begin:

	.globl	__bzero
	.type	__bzero,#function
	.globl	memset
	EXPORT_SYMBOL(__bzero)
	EXPORT_SYMBOL(memset)
memset:
	mov	%o0, %g1

Annotation

Implementation Notes