]>
Commit | Line | Data |
---|---|---|
4e93cb00 MG |
1 | /* |
2 | * linux/arch/arm/mm/copypage-v6.c | |
3 | * | |
4 | * Copyright (C) 2002 Deep Blue Solutions Ltd, All Rights Reserved. | |
5 | * This Edition is maintained by Matthew Veety (aliasxerog) <mveety@gmail.com> | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License version 2 as | |
9 | * published by the Free Software Foundation. | |
10 | */ | |
11 | #include <linux/init.h> | |
12 | #include <linux/spinlock.h> | |
13 | #include <linux/mm.h> | |
14 | #include <linux/highmem.h> | |
15 | ||
16 | #include <asm/pgtable.h> | |
17 | #include <asm/shmparam.h> | |
18 | #include <asm/tlbflush.h> | |
19 | #include <asm/cacheflush.h> | |
20 | #include <asm/cachetype.h> | |
21 | ||
22 | #include "mm.h" | |
23 | ||
24 | #if SHMLBA > 16384 | |
25 | #error FIX ME | |
26 | #endif | |
27 | ||
28 | #define from_address (0xffff8000) | |
29 | #define to_address (0xffffc000) | |
30 | ||
31 | /* | |
32 | * Copy the user page. No aliasing to deal with so we can just | |
33 | * attack the kernel's existing mapping of these pages. | |
34 | */ | |
35 | ||
36 | static void v6_copy_user_highpage_nonaliasing(struct page *to, | |
37 | struct page *from, unsigned long vaddr) | |
38 | { | |
39 | void *kto, *kfrom; | |
40 | ||
41 | kfrom = kmap_atomic(from, KM_USER0); | |
42 | kto = kmap_atomic(to, KM_USER1); | |
43 | copy_page(kto, kfrom); | |
44 | kunmap_atomic(kto, KM_USER1); | |
45 | kunmap_atomic(kfrom, KM_USER0); | |
46 | } | |
47 | ||
48 | /* | |
49 | * Clear the user page. No aliasing to deal with so we can just | |
50 | * attack the kernel's existing mapping of this page. | |
51 | */ | |
52 | static void v6_clear_user_highpage_nonaliasing(struct page *page, unsigned long vaddr) | |
53 | { | |
54 | void *kaddr = kmap_atomic(page, KM_USER0); | |
55 | clear_page(kaddr); | |
56 | kunmap_atomic(kaddr, KM_USER0); | |
57 | } | |
58 | ||
59 | ||
60 | struct cpu_user_fns v6_user_fns __initdata = { | |
61 | .cpu_clear_user_highpage = v6_clear_user_highpage_nonaliasing, | |
62 | .cpu_copy_user_highpage = v6_copy_user_highpage_nonaliasing, | |
63 | }; |