copypage-feroceon.c (d73e60b7144a86baf0fdfcc9537a70bb4f72e11c) copypage-feroceon.c (063b0a4207e43acbeff3d4b09f43e750e0212b48)
1/*
2 * linux/arch/arm/mm/copypage-feroceon.S
3 *
4 * Copyright (C) 2008 Marvell Semiconductors
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
1/*
2 * linux/arch/arm/mm/copypage-feroceon.S
3 *
4 * Copyright (C) 2008 Marvell Semiconductors
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This handles copy_user_page and clear_user_page on Feroceon
10 * This handles copy_user_highpage and clear_user_page on Feroceon
11 * more optimally than the generic implementations.
12 */
13#include <linux/init.h>
11 * more optimally than the generic implementations.
12 */
13#include <linux/init.h>
14#include <linux/highmem.h>
14
15
15#include <asm/page.h>
16
17void __attribute__((naked))
18feroceon_copy_user_page(void *kto, const void *kfrom, unsigned long vaddr)
16static void __attribute__((naked))
17feroceon_copy_user_page(void *kto, const void *kfrom)
19{
20 asm("\
21 stmfd sp!, {r4-r9, lr} \n\
22 mov ip, %0 \n\
231: mov lr, r1 \n\
24 ldmia r1!, {r2 - r9} \n\
25 pld [lr, #32] \n\
26 pld [lr, #64] \n\

--- 36 unchanged lines hidden (view full) ---

63 add r0, r0, #32 \n\
64 bne 1b \n\
65 mcr p15, 0, ip, c7, c10, 4 @ drain WB\n\
66 ldmfd sp!, {r4-r9, pc}"
67 :
68 : "I" (PAGE_SIZE));
69}
70
18{
19 asm("\
20 stmfd sp!, {r4-r9, lr} \n\
21 mov ip, %0 \n\
221: mov lr, r1 \n\
23 ldmia r1!, {r2 - r9} \n\
24 pld [lr, #32] \n\
25 pld [lr, #64] \n\

--- 36 unchanged lines hidden (view full) ---

62 add r0, r0, #32 \n\
63 bne 1b \n\
64 mcr p15, 0, ip, c7, c10, 4 @ drain WB\n\
65 ldmfd sp!, {r4-r9, pc}"
66 :
67 : "I" (PAGE_SIZE));
68}
69
70void feroceon_copy_user_highpage(struct page *to, struct page *from,
71 unsigned long vaddr)
72{
73 void *kto, *kfrom;
74
75 kto = kmap_atomic(to, KM_USER0);
76 kfrom = kmap_atomic(from, KM_USER1);
77 feroceon_copy_user_page(kto, kfrom);
78 kunmap_atomic(kfrom, KM_USER1);
79 kunmap_atomic(kto, KM_USER0);
80}
81
71void __attribute__((naked))
72feroceon_clear_user_page(void *kaddr, unsigned long vaddr)
73{
74 asm("\
75 stmfd sp!, {r4-r7, lr} \n\
76 mov r1, %0 \n\
77 mov r2, #0 \n\
78 mov r3, #0 \n\

--- 11 unchanged lines hidden (view full) ---

90 mcr p15, 0, r1, c7, c10, 4 @ drain WB\n\
91 ldmfd sp!, {r4-r7, pc}"
92 :
93 : "I" (PAGE_SIZE / 32));
94}
95
96struct cpu_user_fns feroceon_user_fns __initdata = {
97 .cpu_clear_user_page = feroceon_clear_user_page,
82void __attribute__((naked))
83feroceon_clear_user_page(void *kaddr, unsigned long vaddr)
84{
85 asm("\
86 stmfd sp!, {r4-r7, lr} \n\
87 mov r1, %0 \n\
88 mov r2, #0 \n\
89 mov r3, #0 \n\

--- 11 unchanged lines hidden (view full) ---

101 mcr p15, 0, r1, c7, c10, 4 @ drain WB\n\
102 ldmfd sp!, {r4-r7, pc}"
103 :
104 : "I" (PAGE_SIZE / 32));
105}
106
107struct cpu_user_fns feroceon_user_fns __initdata = {
108 .cpu_clear_user_page = feroceon_clear_user_page,
98 .cpu_copy_user_page = feroceon_copy_user_page,
109 .cpu_copy_user_highpage = feroceon_copy_user_highpage,
99};
100
110};
111