Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* GENcopy_to_user.S: Generic sparc64 copy to userspace.
0003  *
0004  * Copyright (C) 2007 David S. Miller (davem@davemloft.net)
0005  */
0006 
0007 #define EX_ST(x,y)      \
0008 98: x;          \
0009     .section __ex_table,"a";\
0010     .align 4;       \
0011     .word 98b, y;       \
0012     .text;          \
0013     .align 4;
0014 
0015 #ifndef ASI_AIUS
0016 #define ASI_AIUS    0x11
0017 #endif
0018 
0019 #define FUNC_NAME       GENcopy_to_user
0020 #define STORE(type,src,addr)    type##a src, [addr] ASI_AIUS
0021 #define EX_RETVAL(x)        0
0022 
0023 #ifdef __KERNEL__
0024     /* Writing to %asi is _expensive_ so we hardcode it.
0025      * Reading %asi to check for KERNEL_DS is comparatively
0026      * cheap.
0027      */
0028 #define PREAMBLE                    \
0029     rd      %asi, %g1;          \
0030     cmp     %g1, ASI_AIUS;          \
0031     bne,pn      %icc, raw_copy_in_user;     \
0032      nop
0033 #endif
0034 
0035 #include "GENmemcpy.S"