Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* NGcopy_to_user.S: Niagara optimized copy to userspace.
0003  *
0004  * Copyright (C) 2006, 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       NGcopy_to_user
0020 #define STORE(type,src,addr)    type##a src, [addr] ASI_AIUS
0021 #define STORE_ASI       ASI_BLK_INIT_QUAD_LDD_AIUS
0022 #define EX_RETVAL(x)        %g0
0023 
0024 #ifdef __KERNEL__
0025     /* Writing to %asi is _expensive_ so we hardcode it.
0026      * Reading %asi to check for KERNEL_DS is comparatively
0027      * cheap.
0028      */
0029 #define PREAMBLE                    \
0030     rd      %asi, %g1;          \
0031     cmp     %g1, ASI_AIUS;          \
0032     bne,pn      %icc, raw_copy_in_user;     \
0033      nop
0034 #endif
0035 
0036 #include "NGmemcpy.S"