ia64/pv_ops/xen: implement xen pv_time_ops.
[pv_ops_mirror.git] / arch / sparc64 / lib / GENcopy_to_user.S
blobbb3f7084daf9fb0282f88ad390f6b73551854bc5
1 /* GENcopy_to_user.S: Generic sparc64 copy to userspace.
2  *
3  * Copyright (C) 2007 David S. Miller (davem@davemloft.net)
4  */
6 #define EX_ST(x)                \
7 98:     x;                      \
8         .section .fixup;        \
9         .align 4;               \
10 99:     retl;                   \
11          mov    1, %o0;         \
12         .section __ex_table,"a";\
13         .align 4;               \
14         .word 98b, 99b;         \
15         .text;                  \
16         .align 4;
18 #ifndef ASI_AIUS
19 #define ASI_AIUS        0x11
20 #endif
22 #define FUNC_NAME               GENcopy_to_user
23 #define STORE(type,src,addr)    type##a src, [addr] ASI_AIUS
24 #define EX_RETVAL(x)            0
26 #ifdef __KERNEL__
27         /* Writing to %asi is _expensive_ so we hardcode it.
28          * Reading %asi to check for KERNEL_DS is comparatively
29          * cheap.
30          */
31 #define PREAMBLE                                        \
32         rd              %asi, %g1;                      \
33         cmp             %g1, ASI_AIUS;                  \
34         bne,pn          %icc, memcpy_user_stub;         \
35          nop
36 #endif
38 #include "GENmemcpy.S"