Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* NG2copy_to_user.S: Niagara-2 optimized 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 #define EX_ST_FP(x,y)       \
0016 98: x;          \
0017     .section __ex_table,"a";\
0018     .align 4;       \
0019     .word 98b, y##_fp;  \
0020     .text;          \
0021     .align 4;
0022 
0023 #ifndef ASI_AIUS
0024 #define ASI_AIUS    0x11
0025 #endif
0026 
0027 #ifndef ASI_BLK_AIUS_4V
0028 #define ASI_BLK_AIUS_4V 0x17
0029 #endif
0030 
0031 #ifndef ASI_BLK_INIT_QUAD_LDD_AIUS
0032 #define ASI_BLK_INIT_QUAD_LDD_AIUS 0x23
0033 #endif
0034 
0035 #define FUNC_NAME       NG2copy_to_user
0036 #define STORE(type,src,addr)    type##a src, [addr] ASI_AIUS
0037 #define STORE_ASI       ASI_BLK_INIT_QUAD_LDD_AIUS
0038 #define STORE_BLK(src,addr) stda src, [addr] ASI_BLK_AIUS_4V
0039 #define EX_RETVAL(x)        0
0040 
0041 #ifdef __KERNEL__
0042     /* Writing to %asi is _expensive_ so we hardcode it.
0043      * Reading %asi to check for KERNEL_DS is comparatively
0044      * cheap.
0045      */
0046 #define PREAMBLE                    \
0047     rd      %asi, %g1;          \
0048     cmp     %g1, ASI_AIUS;          \
0049     bne,pn      %icc, raw_copy_in_user;     \
0050      nop
0051 #endif
0052 
0053 #include "NG2memcpy.S"