1 /* GENpage.S: Generic clear and copy page.
3 * Copyright (C) 2007 (davem@davemloft.net)
12 1: ldx [%o1 + 0x00], %o2
38 1: stx %g0, [%o0 + 0x00]
50 #define BRANCH_ALWAYS 0x10680000
51 #define NOP 0x01000000
52 #define GEN_DO_PATCH(OLD, NEW) \
53 sethi %hi(NEW), %g1; \
54 or %g1, %lo(NEW), %g1; \
55 sethi %hi(OLD), %g2; \
56 or %g2, %lo(OLD), %g2; \
58 sethi %hi(BRANCH_ALWAYS), %g3; \
60 srl %g1, 11 + 2, %g1; \
61 or %g3, %lo(BRANCH_ALWAYS), %g3; \
64 sethi %hi(NOP), %g3; \
65 or %g3, %lo(NOP), %g3; \
66 stw %g3, [%g2 + 0x4]; \
69 .globl generic_patch_pageops
70 .type generic_patch_pageops,#function
71 generic_patch_pageops:
72 GEN_DO_PATCH(copy_user_page, GENcopy_user_page)
73 GEN_DO_PATCH(_clear_page, GENclear_page)
74 GEN_DO_PATCH(clear_user_page, GENclear_user_page)
77 .size generic_patch_pageops,.-generic_patch_pageops