1 /* NG2page.S: Niagara-2 optimized clear and copy page.
3 * Copyright (C) 2007 (davem@davemloft.net)
8 #include <asm/visasm.h>
13 /* This is heavily simplified from the sun4u variants
14 * because Niagara-2 does not have any D-cache aliasing issues.
16 NG2copy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */
17 prefetch [%o1 + 0x00], #one_read
18 prefetch [%o1 + 0x40], #one_read
22 1: stxa %g0, [%o1 + %g3] ASI_BLK_INIT_QUAD_LDD_P
24 ldda [%o1] ASI_BLK_P, %f0
25 stda %f0, [%o1 + %g3] ASI_BLK_P
28 prefetch [%o1 + 0x40], #one_read
34 #define BRANCH_ALWAYS 0x10680000
35 #define NOP 0x01000000
36 #define NG_DO_PATCH(OLD, NEW) \
37 sethi %hi(NEW), %g1; \
38 or %g1, %lo(NEW), %g1; \
39 sethi %hi(OLD), %g2; \
40 or %g2, %lo(OLD), %g2; \
42 sethi %hi(BRANCH_ALWAYS), %g3; \
44 srl %g1, 11 + 2, %g1; \
45 or %g3, %lo(BRANCH_ALWAYS), %g3; \
48 sethi %hi(NOP), %g3; \
49 or %g3, %lo(NOP), %g3; \
50 stw %g3, [%g2 + 0x4]; \
53 .globl niagara2_patch_pageops
54 .type niagara2_patch_pageops,#function
55 niagara2_patch_pageops:
56 NG_DO_PATCH(copy_user_page, NG2copy_user_page)
57 NG_DO_PATCH(_clear_page, NGclear_page)
58 NG_DO_PATCH(clear_user_page, NGclear_user_page)
61 .size niagara2_patch_pageops,.-niagara2_patch_pageops