1/* NGcopy_to_user.S: Niagara optimized copy to userspace. 2 * 3 * Copyright (C) 2006, 2007 David S. Miller (davem@davemloft.net) 4 */ 5 6#define EX_ST(x) \ 798: x; \ 8 .section .fixup; \ 9 .align 4; \ 1099: wr %g0, ASI_AIUS, %asi;\ 11 ret; \ 12 restore %g0, 1, %o0; \ 13 .section __ex_table,"a";\ 14 .align 4; \ 15 .word 98b, 99b; \ 16 .text; \ 17 .align 4; 18 19#ifndef ASI_AIUS 20#define ASI_AIUS 0x11 21#endif 22 23#define FUNC_NAME NGcopy_to_user 24#define STORE(type,src,addr) type##a src, [addr] ASI_AIUS 25#define STORE_ASI ASI_BLK_INIT_QUAD_LDD_AIUS 26#define EX_RETVAL(x) %g0 27 28#ifdef __KERNEL__ 29 /* Writing to %asi is _expensive_ so we hardcode it. 30 * Reading %asi to check for KERNEL_DS is comparatively 31 * cheap. 32 */ 33#define PREAMBLE \ 34 rd %asi, %g1; \ 35 cmp %g1, ASI_AIUS; \ 36 bne,pn %icc, memcpy_user_stub; \ 37 nop 38#endif 39 40#include "NGmemcpy.S" 41