Use -Os for rdc and -O2 for the x86 target
[openwrt/svn-archive/archive.git] / target / linux / brcm47xx-2.6 / patches / 160-kmap_coherent.patch
1 --- ./arch/mips/mm/init.c.orig 2007-03-22 08:08:34.000000000 -0600
2 +++ ./arch/mips/mm/init.c 2007-03-22 08:09:04.000000000 -0600
3 @@ -207,7 +207,7 @@
4 void *vfrom, *vto;
5
6 vto = kmap_atomic(to, KM_USER1);
7 - if (cpu_has_dc_aliases) {
8 + if (cpu_has_dc_aliases && cpu_use_kmap_coherent) {
9 vfrom = kmap_coherent(from, vaddr);
10 copy_page(vto, vfrom);
11 kunmap_coherent(from);
12 @@ -230,7 +230,7 @@
13 struct page *page, unsigned long vaddr, void *dst, const void *src,
14 unsigned long len)
15 {
16 - if (cpu_has_dc_aliases) {
17 + if (cpu_has_dc_aliases && cpu_use_kmap_coherent) {
18 void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
19 memcpy(vto, src, len);
20 kunmap_coherent(page);
21 @@ -246,7 +246,7 @@
22 struct page *page, unsigned long vaddr, void *dst, const void *src,
23 unsigned long len)
24 {
25 - if (cpu_has_dc_aliases) {
26 + if (cpu_has_dc_aliases && cpu_use_kmap_coherent) {
27 void *vfrom =
28 kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
29 memcpy(dst, vfrom, len);
30 --- ./include/asm-mips/mach-bcm947xx/cpu-feature-overrides.h.orig 2007-03-22 08:10:54.000000000 -0600
31 +++ ./include/asm-mips/mach-bcm947xx/cpu-feature-overrides.h 2007-03-22 08:10:50.000000000 -0600
32 @@ -0,0 +1,13 @@
33 +/*
34 + * This file is subject to the terms and conditions of the GNU General Public
35 + * License. See the file "COPYING" in the main directory of this archive
36 + * for more details.
37 + *
38 + * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org)
39 + */
40 +#ifndef __ASM_MACH_BCM947XX_CPU_FEATURE_OVERRIDES_H
41 +#define __ASM_MACH_BCM947XX_CPU_FEATURE_OVERRIDES_H
42 +
43 +#define cpu_use_kmap_coherent 0
44 +
45 +#endif /* __ASM_MACH_BCM947XX_CPU_FEATURE_OVERRIDES_H */
46 --- ./include/asm-mips/cpu-features.h.orig 2007-03-22 08:09:16.000000000 -0600
47 +++ ./include/asm-mips/cpu-features.h 2007-03-22 08:09:52.000000000 -0600
48 @@ -101,6 +101,9 @@
49 #ifndef cpu_has_pindexed_dcache
50 #define cpu_has_pindexed_dcache (cpu_data[0].dcache.flags & MIPS_CACHE_PINDEX)
51 #endif
52 +#ifndef cpu_use_kmap_coherent
53 +#define cpu_use_kmap_coherent 1
54 +#endif
55
56 /*
57 * I-Cache snoops remote store. This only matters on SMP. Some multiprocessors