0001
0002
0003
0004
0005
0006
0007
0008 #include <linux/linkage.h>
0009 #include <asm/page.h>
0010 #include <asm/export.h>
0011
0012
0013
0014
0015 #define BLAST_BLOCK(buf, offset) \
0016 std %g0, [buf + offset + 0x38]; \
0017 std %g0, [buf + offset + 0x30]; \
0018 std %g0, [buf + offset + 0x28]; \
0019 std %g0, [buf + offset + 0x20]; \
0020 std %g0, [buf + offset + 0x18]; \
0021 std %g0, [buf + offset + 0x10]; \
0022 std %g0, [buf + offset + 0x08]; \
0023 std %g0, [buf + offset + 0x00];
0024
0025
0026
0027
0028 #define MIRROR_BLOCK(dst, src, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
0029 ldd [src + offset + 0x18], t0; \
0030 ldd [src + offset + 0x10], t2; \
0031 ldd [src + offset + 0x08], t4; \
0032 ldd [src + offset + 0x00], t6; \
0033 std t0, [dst + offset + 0x18]; \
0034 std t2, [dst + offset + 0x10]; \
0035 std t4, [dst + offset + 0x08]; \
0036 std t6, [dst + offset + 0x00];
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 .text
0050 ENTRY(bzero_1page)
0051
0052
0053
0054 or %g0, %g0, %g1
0055 or %o0, %g0, %o1
0056 or %g0, (PAGE_SIZE >> 8), %g2
0057 1:
0058 BLAST_BLOCK(%o0, 0x00)
0059 BLAST_BLOCK(%o0, 0x40)
0060 BLAST_BLOCK(%o0, 0x80)
0061 BLAST_BLOCK(%o0, 0xc0)
0062 subcc %g2, 1, %g2
0063 bne 1b
0064 add %o0, 0x100, %o0
0065
0066 retl
0067 nop
0068 ENDPROC(bzero_1page)
0069 EXPORT_SYMBOL(bzero_1page)
0070
0071 ENTRY(__copy_1page)
0072
0073
0074
0075 or %g0, (PAGE_SIZE >> 8), %g1
0076 1:
0077 MIRROR_BLOCK(%o0, %o1, 0x00, %o2, %o3, %o4, %o5, %g2, %g3, %g4, %g5)
0078 MIRROR_BLOCK(%o0, %o1, 0x20, %o2, %o3, %o4, %o5, %g2, %g3, %g4, %g5)
0079 MIRROR_BLOCK(%o0, %o1, 0x40, %o2, %o3, %o4, %o5, %g2, %g3, %g4, %g5)
0080 MIRROR_BLOCK(%o0, %o1, 0x60, %o2, %o3, %o4, %o5, %g2, %g3, %g4, %g5)
0081 MIRROR_BLOCK(%o0, %o1, 0x80, %o2, %o3, %o4, %o5, %g2, %g3, %g4, %g5)
0082 MIRROR_BLOCK(%o0, %o1, 0xa0, %o2, %o3, %o4, %o5, %g2, %g3, %g4, %g5)
0083 MIRROR_BLOCK(%o0, %o1, 0xc0, %o2, %o3, %o4, %o5, %g2, %g3, %g4, %g5)
0084 MIRROR_BLOCK(%o0, %o1, 0xe0, %o2, %o3, %o4, %o5, %g2, %g3, %g4, %g5)
0085 subcc %g1, 1, %g1
0086 add %o0, 0x100, %o0
0087 bne 1b
0088 add %o1, 0x100, %o1
0089
0090 retl
0091 nop
0092 ENDPROC(__copy_1page)
0093 EXPORT_SYMBOL(__copy_1page)