arch/microblaze/lib/uaccess_old.S

Source file repositories/reference/linux-study-clean/arch/microblaze/lib/uaccess_old.S

File Facts

System
Linux kernel
Corpus path
arch/microblaze/lib/uaccess_old.S
Extension
.S
Size
3868 bytes
Lines
177
Domain
Architecture Layer
Bucket
arch/microblaze
Inferred role
Architecture Layer: arch/microblaze
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>
#include <linux/linkage.h>
#include <asm/page.h>

/* Loop unrolling for __copy_tofrom_user */
#define COPY(offset)	\
1:	lwi	r4 , r6, 0x0000 + offset;	\
2:	lwi	r19, r6, 0x0004 + offset;	\
3:	lwi	r20, r6, 0x0008 + offset;	\
4:	lwi	r21, r6, 0x000C + offset;	\
5:	lwi	r22, r6, 0x0010 + offset;	\
6:	lwi	r23, r6, 0x0014 + offset;	\
7:	lwi	r24, r6, 0x0018 + offset;	\
8:	lwi	r25, r6, 0x001C + offset;	\
9:	swi	r4 , r5, 0x0000 + offset;	\
10:	swi	r19, r5, 0x0004 + offset;	\
11:	swi	r20, r5, 0x0008 + offset;	\
12:	swi	r21, r5, 0x000C + offset;	\
13:	swi	r22, r5, 0x0010 + offset;	\
14:	swi	r23, r5, 0x0014 + offset;	\
15:	swi	r24, r5, 0x0018 + offset;	\
16:	swi	r25, r5, 0x001C + offset;	\
	.section __ex_table,"a";		\
	.word	1b, 33f;			\
	.word	2b, 33f;			\
	.word	3b, 33f;			\
	.word	4b, 33f;			\
	.word	5b, 33f;			\
	.word	6b, 33f;			\
	.word	7b, 33f;			\
	.word	8b, 33f;			\
	.word	9b, 33f;			\
	.word	10b, 33f;			\
	.word	11b, 33f;			\
	.word	12b, 33f;			\
	.word	13b, 33f;			\
	.word	14b, 33f;			\
	.word	15b, 33f;			\
	.word	16b, 33f;			\
	.text

#define COPY_80(offset)	\
	COPY(0x00 + offset);\
	COPY(0x20 + offset);\
	COPY(0x40 + offset);\
	COPY(0x60 + offset);

/*
 * int __copy_tofrom_user(char *to, char *from, int len)
 * Return:
 *   0 on success
 *   number of not copied bytes on error
 */
	.text
.globl __copy_tofrom_user;
.type  __copy_tofrom_user, @function
.align 4;
__copy_tofrom_user:
	/*
	 * r5 - to
	 * r6 - from
	 * r7, r3 - count
	 * r4 - tempval
	 */
	beqid	r7, 0f /* zero size is not likely */
	or	r3, r5, r6 /* find if is any to/from unaligned */
	or	r3, r3, r7 /* find if count is unaligned */
	andi	r3, r3, 0x3 /* mask last 3 bits */
	bneid	r3, bu1 /* if r3 is not zero then byte copying */
	or	r3, r0, r0

Annotation

Implementation Notes