blob: 6ea01c5532a0a87e30f4a737dee0a44b55da3df1 [file] [log] [blame]
David S. Miller398d1082006-03-05 16:41:56 -08001/* NGcopy_to_user.S: Niagara optimized copy to userspace.
2 *
David S. Miller25e55662007-10-02 01:03:09 -07003 * Copyright (C) 2006, 2007 David S. Miller (davem@davemloft.net)
David S. Miller398d1082006-03-05 16:41:56 -08004 */
5
6#define EX_ST(x) \
798: x; \
8 .section .fixup; \
9 .align 4; \
1099: wr %g0, ASI_AIUS, %asi;\
David S. Miller25e55662007-10-02 01:03:09 -070011 ret; \
12 restore %g0, 1, %o0; \
David S. Miller398d1082006-03-05 16:41:56 -080013 .section __ex_table,"a";\
14 .align 4; \
15 .word 98b, 99b; \
16 .text; \
17 .align 4;
18
19#ifndef ASI_AIUS
20#define ASI_AIUS 0x11
21#endif
22
23#define FUNC_NAME NGcopy_to_user
24#define STORE(type,src,addr) type##a src, [addr] ASI_AIUS
25#define STORE_ASI ASI_BLK_INIT_QUAD_LDD_AIUS
David S. Miller25e55662007-10-02 01:03:09 -070026#define EX_RETVAL(x) %g0
David S. Miller398d1082006-03-05 16:41:56 -080027
28#ifdef __KERNEL__
29 /* Writing to %asi is _expensive_ so we hardcode it.
30 * Reading %asi to check for KERNEL_DS is comparatively
31 * cheap.
32 */
33#define PREAMBLE \
34 rd %asi, %g1; \
35 cmp %g1, ASI_AIUS; \
36 bne,pn %icc, memcpy_user_stub; \
37 nop
38#endif
39
David S. Miller0d4bc952006-02-11 10:30:41 -080040#include "NGmemcpy.S"