/*1* M7copy_to_user.S: SPARC M7 optimized copy to userspace.2*3* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.4*/567#define EX_ST(x, y) \898: x; \9.section __ex_table,"a"; \10.align 4; \11.word 98b, y; \12.text; \13.align 4;1415#define EX_ST_FP(x, y) \1698: x; \17.section __ex_table,"a"; \18.align 4; \19.word 98b, y##_fp; \20.text; \21.align 4;222324#ifndef ASI_AIUS25#define ASI_AIUS 0x1126#endif2728#ifndef ASI_BLK_INIT_QUAD_LDD_AIUS29#define ASI_BLK_INIT_QUAD_LDD_AIUS 0x2330#endif3132#define FUNC_NAME M7copy_to_user33#define STORE(type,src,addr) type##a src, [addr] %asi34#define STORE_ASI ASI_BLK_INIT_QUAD_LDD_AIUS35#define STORE_MRU_ASI ASI_ST_BLKINIT_MRU_S36#define EX_RETVAL(x) 03738#ifdef __KERNEL__39/* Writing to %asi is _expensive_ so we hardcode it.40* Reading %asi to check for KERNEL_DS is comparatively41* cheap.42*/43#define PREAMBLE \44rd %asi, %g1; \45cmp %g1, ASI_AIUS; \46bne,pn %icc, raw_copy_in_user; \47nop48#endif4950#include "M7memcpy.S"515253