aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acglobal.h4
-rw-r--r--include/acpi/acpi_bus.h2
-rw-r--r--include/acpi/acpi_drivers.h1
-rw-r--r--include/acpi/acpiosxf.h3
-rw-r--r--include/acpi/processor.h9
-rw-r--r--include/asm-alpha/atomic.h2
-rw-r--r--include/asm-alpha/pci.h1
-rw-r--r--include/asm-alpha/pgalloc.h8
-rw-r--r--include/asm-alpha/tlb.h4
-rw-r--r--include/asm-alpha/tlbflush.h6
-rw-r--r--include/asm-alpha/unistd.h1
-rw-r--r--include/asm-arm/arch-iop13xx/adma.h18
-rw-r--r--include/asm-arm/arch-pxa/gpio.h48
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h13
-rw-r--r--include/asm-arm/arch-s3c2410/regs-lcd.h11
-rw-r--r--include/asm-arm/arch-s3c2410/spi-gpio.h6
-rw-r--r--include/asm-arm/arch-s3c2410/spi.h6
-rw-r--r--include/asm-arm/hardware/iop3xx-adma.h30
-rw-r--r--include/asm-arm/pgalloc.h10
-rw-r--r--include/asm-arm/tlb.h4
-rw-r--r--include/asm-avr32/arch-at32ap/at32ap700x.h2
-rw-r--r--include/asm-avr32/arch-at32ap/gpio.h34
-rw-r--r--include/asm-avr32/arch-at32ap/irq.h4
-rw-r--r--include/asm-avr32/delay.h2
-rw-r--r--include/asm-avr32/pgalloc.h6
-rw-r--r--include/asm-avr32/timex.h3
-rw-r--r--include/asm-avr32/unistd.h2
-rw-r--r--include/asm-blackfin/io.h2
-rw-r--r--include/asm-cris/bitops.h7
-rw-r--r--include/asm-cris/pgalloc.h6
-rw-r--r--include/asm-frv/dma-mapping.h10
-rw-r--r--include/asm-frv/page.h4
-rw-r--r--include/asm-frv/pgalloc.h8
-rw-r--r--include/asm-frv/pgtable.h2
-rw-r--r--include/asm-frv/scatterlist.h10
-rw-r--r--include/asm-frv/unistd.h2
-rw-r--r--include/asm-generic/4level-fixup.h2
-rw-r--r--include/asm-generic/cputime.h1
-rw-r--r--include/asm-generic/gpio.h98
-rw-r--r--include/asm-generic/pgtable-nopmd.h2
-rw-r--r--include/asm-generic/pgtable-nopud.h2
-rw-r--r--include/asm-generic/sections.h2
-rw-r--r--include/asm-h8300/io.h2
-rw-r--r--include/asm-h8300/virtconvert.h2
-rw-r--r--include/asm-ia64/bitops.h50
-rw-r--r--include/asm-ia64/gcc_intrin.h2
-rw-r--r--include/asm-ia64/mca.h6
-rw-r--r--include/asm-ia64/mca_asm.h3
-rw-r--r--include/asm-ia64/pgalloc.h16
-rw-r--r--include/asm-ia64/processor.h5
-rw-r--r--include/asm-ia64/sal.h14
-rw-r--r--include/asm-m32r/delay.h2
-rw-r--r--include/asm-m32r/irq.h2
-rw-r--r--include/asm-m32r/m32700ut/m32700ut_pld.h4
-rw-r--r--include/asm-m32r/pgalloc.h10
-rw-r--r--include/asm-m32r/unistd.h2
-rw-r--r--include/asm-m68k/macintosh.h2
-rw-r--r--include/asm-m68k/motorola_pgalloc.h10
-rw-r--r--include/asm-m68k/pgtable.h2
-rw-r--r--include/asm-m68k/sun3_pgalloc.h8
-rw-r--r--include/asm-m68knommu/io.h2
-rw-r--r--include/asm-m68knommu/mcfne.h27
-rw-r--r--include/asm-m68knommu/mcfsim.h4
-rw-r--r--include/asm-m68knommu/mcftimer.h2
-rw-r--r--include/asm-m68knommu/mcfuart.h2
-rw-r--r--include/asm-m68knommu/system.h17
-rw-r--r--include/asm-mips/pgalloc.h12
-rw-r--r--include/asm-mips/processor.h2
-rw-r--r--include/asm-parisc/pgalloc.h10
-rw-r--r--include/asm-parisc/processor.h3
-rw-r--r--include/asm-parisc/tlb.h4
-rw-r--r--include/asm-powerpc/cputime.h14
-rw-r--r--include/asm-powerpc/dma.h39
-rw-r--r--include/asm-powerpc/iommu.h12
-rw-r--r--include/asm-powerpc/mediabay.h8
-rw-r--r--include/asm-powerpc/nvram.h3
-rw-r--r--include/asm-powerpc/paca.h2
-rw-r--r--include/asm-powerpc/pgalloc-32.h10
-rw-r--r--include/asm-powerpc/pgalloc-64.h10
-rw-r--r--include/asm-powerpc/processor.h3
-rw-r--r--include/asm-powerpc/ps3av.h43
-rw-r--r--include/asm-powerpc/systbl.h2
-rw-r--r--include/asm-ppc/pgalloc.h10
-rw-r--r--include/asm-s390/bitops.h558
-rw-r--r--include/asm-s390/cacheflush.h4
-rw-r--r--include/asm-s390/ccwgroup.h2
-rw-r--r--include/asm-s390/cputime.h1
-rw-r--r--include/asm-s390/pgalloc.h14
-rw-r--r--include/asm-s390/pgtable.h12
-rw-r--r--include/asm-s390/processor.h3
-rw-r--r--include/asm-s390/tlb.h8
-rw-r--r--include/asm-sh/delay.h2
-rw-r--r--include/asm-sh/pgalloc.h8
-rw-r--r--include/asm-sh/unistd_32.h2
-rw-r--r--include/asm-sh/unistd_64.h2
-rw-r--r--include/asm-sparc/pgalloc.h12
-rw-r--r--include/asm-sparc/unistd.h6
-rw-r--r--include/asm-sparc64/io.h2
-rw-r--r--include/asm-sparc64/pgalloc.h8
-rw-r--r--include/asm-sparc64/timex.h6
-rw-r--r--include/asm-sparc64/tlb.h4
-rw-r--r--include/asm-sparc64/unistd.h6
-rw-r--r--include/asm-um/a.out.h4
-rw-r--r--include/asm-um/current.h23
-rw-r--r--include/asm-um/elf-i386.h28
-rw-r--r--include/asm-um/elf-x86_64.h8
-rw-r--r--include/asm-um/fixmap.h6
-rw-r--r--include/asm-um/ldt.h4
-rw-r--r--include/asm-um/linkage.h6
-rw-r--r--include/asm-um/mmu_context.h7
-rw-r--r--include/asm-um/page.h6
-rw-r--r--include/asm-um/param.h2
-rw-r--r--include/asm-um/pgalloc.h8
-rw-r--r--include/asm-um/pgtable-2level.h3
-rw-r--r--include/asm-um/pgtable-3level.h35
-rw-r--r--include/asm-um/pgtable.h100
-rw-r--r--include/asm-um/processor-generic.h13
-rw-r--r--include/asm-um/processor-i386.h1
-rw-r--r--include/asm-um/thread_info.h11
-rw-r--r--include/asm-um/tlb.h122
-rw-r--r--include/asm-um/uaccess.h10
-rw-r--r--include/asm-v850/io.h2
-rw-r--r--include/asm-x86/bitops_64.h16
-rw-r--r--include/asm-x86/delay.h2
-rw-r--r--include/asm-x86/highmem.h6
-rw-r--r--include/asm-x86/pgalloc_32.h8
-rw-r--r--include/asm-x86/pgalloc_64.h20
-rw-r--r--include/asm-x86/pgtable_32.h8
-rw-r--r--include/asm-x86/timex.h3
-rw-r--r--include/asm-x86/unistd_32.h4
-rw-r--r--include/asm-x86/unistd_64.h9
-rw-r--r--include/asm-xtensa/pgalloc.h6
-rw-r--r--include/asm-xtensa/tlb.h2
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/ac97_codec.h7
-rw-r--r--include/linux/acct.h4
-rw-r--r--include/linux/acpi.h3
-rw-r--r--include/linux/agp_backend.h1
-rw-r--r--include/linux/agpgart.h1
-rw-r--r--include/linux/async_tx.h13
-rw-r--r--include/linux/ata_platform.h (renamed from include/linux/pata_platform.h)13
-rw-r--r--include/linux/capability.h251
-rw-r--r--include/linux/compat.h15
-rw-r--r--include/linux/cpuidle.h28
-rw-r--r--include/linux/device.h11
-rw-r--r--include/linux/dma-mapping.h30
-rw-r--r--include/linux/dmaengine.h29
-rw-r--r--include/linux/dmi.h2
-rw-r--r--include/linux/fs.h12
-rw-r--r--include/linux/fsnotify.h22
-rw-r--r--include/linux/gfp.h2
-rw-r--r--include/linux/hash.h42
-rw-r--r--include/linux/hdlc.h25
-rw-r--r--include/linux/highmem.h52
-rw-r--r--include/linux/hrtimer.h13
-rw-r--r--include/linux/hw_random.h10
-rw-r--r--include/linux/i2c/pca953x.h18
-rw-r--r--include/linux/i2c/pcf857x.h45
-rw-r--r--include/linux/ide.h42
-rw-r--r--include/linux/if_vlan.h7
-rw-r--r--include/linux/init.h1
-rw-r--r--include/linux/init_task.h13
-rw-r--r--include/linux/interrupt.h2
-rw-r--r--include/linux/iommu-helper.h7
-rw-r--r--include/linux/isdn.h1
-rw-r--r--include/linux/jbd.h3
-rw-r--r--include/linux/kernel.h2
-rw-r--r--include/linux/kprobes.h3
-rw-r--r--include/linux/latency.h25
-rw-r--r--include/linux/leds.h10
-rw-r--r--include/linux/libata.h2
-rw-r--r--include/linux/log2.h16
-rw-r--r--include/linux/loop.h1
-rw-r--r--include/linux/lp.h4
-rw-r--r--include/linux/miscdevice.h10
-rw-r--r--include/linux/mm.h38
-rw-r--r--include/linux/mmzone.h2
-rw-r--r--include/linux/mod_devicetable.h3
-rw-r--r--include/linux/nubus.h4
-rw-r--r--include/linux/page-flags.h42
-rw-r--r--include/linux/pci.h16
-rw-r--r--include/linux/pci_ids.h18
-rw-r--r--include/linux/percpu.h2
-rw-r--r--include/linux/pkt_cls.h4
-rw-r--r--include/linux/pm_qos_params.h25
-rw-r--r--include/linux/pnp.h1
-rw-r--r--include/linux/power_supply.h1
-rw-r--r--include/linux/prctl.h4
-rw-r--r--include/linux/proc_fs.h3
-rw-r--r--include/linux/ptrace.h35
-rw-r--r--include/linux/raid/bitmap.h3
-rw-r--r--include/linux/raid/md_k.h23
-rw-r--r--include/linux/rcupdate.h11
-rw-r--r--include/linux/reboot.h2
-rw-r--r--include/linux/rtnetlink.h12
-rw-r--r--include/linux/sched.h17
-rw-r--r--include/linux/security.h26
-rw-r--r--include/linux/serial_8250.h1
-rw-r--r--include/linux/signal.h2
-rw-r--r--include/linux/sm501.h2
-rw-r--r--include/linux/sonypi.h2
-rw-r--r--include/linux/spi/mcp23s08.h24
-rw-r--r--include/linux/ssb/ssb.h9
-rw-r--r--include/linux/suspend.h1
-rw-r--r--include/linux/swap.h34
-rw-r--r--include/linux/swapops.h6
-rw-r--r--include/linux/syscalls.h7
-rw-r--r--include/linux/sysctl.h3
-rw-r--r--include/linux/tc_ematch/tc_em_meta.h1
-rw-r--r--include/linux/thermal.h94
-rw-r--r--include/linux/timex.h2
-rw-r--r--include/linux/tty.h1
-rw-r--r--include/linux/vmalloc.h6
-rw-r--r--include/linux/vt_kern.h1
-rw-r--r--include/linux/w1-gpio.h23
-rw-r--r--include/linux/wait.h16
-rw-r--r--include/linux/writeback.h2
-rw-r--r--include/linux/xattr.h1
-rw-r--r--include/net/9p/9p.h1
-rw-r--r--include/net/9p/client.h5
-rw-r--r--include/net/9p/conn.h57
-rw-r--r--include/net/9p/transport.h11
-rw-r--r--include/net/inet_hashtables.h2
-rw-r--r--include/net/ip_fib.h8
-rw-r--r--include/net/ipv6.h6
-rw-r--r--include/net/netlabel.h47
-rw-r--r--include/pcmcia/cs.h8
-rw-r--r--include/pcmcia/cs_types.h1
-rw-r--r--include/pcmcia/ss.h6
-rw-r--r--include/video/atmel_lcdc.h25
230 files changed, 2072 insertions, 1358 deletions
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 347a911d8237..47a1fd8f2d8a 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -117,10 +117,6 @@ extern u32 acpi_dbg_layer;
117 117
118extern u32 acpi_gbl_nesting_level; 118extern u32 acpi_gbl_nesting_level;
119 119
120/* Event counters */
121
122ACPI_EXTERN u32 acpi_gpe_count;
123
124/* Support for dynamic control method tracing mechanism */ 120/* Support for dynamic control method tracing mechanism */
125 121
126ACPI_EXTERN u32 acpi_gbl_original_dbg_level; 122ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index fb7171b1bd22..504af20b10c1 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -321,6 +321,8 @@ struct acpi_bus_event {
321 321
322extern struct kobject *acpi_kobj; 322extern struct kobject *acpi_kobj;
323extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); 323extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int);
324void acpi_bus_private_data_handler(acpi_handle, u32, void *);
325int acpi_bus_get_private_data(acpi_handle, void **);
324/* 326/*
325 * External Functions 327 * External Functions
326 */ 328 */
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index f85f77a538aa..581daa451ffc 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -48,6 +48,7 @@
48#define ACPI_BUTTON_HID_SLEEPF "LNXSLPBN" 48#define ACPI_BUTTON_HID_SLEEPF "LNXSLPBN"
49#define ACPI_VIDEO_HID "LNXVIDEO" 49#define ACPI_VIDEO_HID "LNXVIDEO"
50#define ACPI_BAY_HID "LNXIOBAY" 50#define ACPI_BAY_HID "LNXIOBAY"
51#define ACPI_DOCK_HID "LNXDOCK"
51 52
52/* -------------------------------------------------------------------------- 53/* --------------------------------------------------------------------------
53 PCI 54 PCI
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index ca882b8e7d10..1a16cfbe9e0d 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -181,6 +181,9 @@ acpi_os_install_interrupt_handler(u32 gsi,
181acpi_status 181acpi_status
182acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine); 182acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine);
183 183
184void acpi_os_gpe_count(u32 gpe_number);
185void acpi_os_fixed_event_count(u32 fixed_event_number);
186
184/* 187/*
185 * Threads and Scheduling 188 * Threads and Scheduling
186 */ 189 */
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 6e253b5b0f3b..0c75a0b9c565 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -4,7 +4,7 @@
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/cpu.h> 5#include <linux/cpu.h>
6#include <linux/cpuidle.h> 6#include <linux/cpuidle.h>
7 7#include <linux/thermal.h>
8#include <asm/acpi.h> 8#include <asm/acpi.h>
9 9
10#define ACPI_PROCESSOR_BUSY_METRIC 10 10#define ACPI_PROCESSOR_BUSY_METRIC 10
@@ -34,6 +34,7 @@
34 34
35#define ACPI_CSTATE_SYSTEMIO (0) 35#define ACPI_CSTATE_SYSTEMIO (0)
36#define ACPI_CSTATE_FFH (1) 36#define ACPI_CSTATE_FFH (1)
37#define ACPI_CSTATE_HALT (2)
37 38
38/* Power Management */ 39/* Power Management */
39 40
@@ -64,7 +65,7 @@ struct acpi_processor_cx {
64 u8 valid; 65 u8 valid;
65 u8 type; 66 u8 type;
66 u32 address; 67 u32 address;
67 u8 space_id; 68 u8 entry_method;
68 u8 index; 69 u8 index;
69 u32 latency; 70 u32 latency;
70 u32 latency_ticks; 71 u32 latency_ticks;
@@ -218,7 +219,7 @@ struct acpi_processor {
218 struct acpi_processor_performance *performance; 219 struct acpi_processor_performance *performance;
219 struct acpi_processor_throttling throttling; 220 struct acpi_processor_throttling throttling;
220 struct acpi_processor_limit limit; 221 struct acpi_processor_limit limit;
221 222 struct thermal_cooling_device *cdev;
222 /* the _PDC objects for this processor, if any */ 223 /* the _PDC objects for this processor, if any */
223 struct acpi_object_list *pdc; 224 struct acpi_object_list *pdc;
224}; 225};
@@ -330,7 +331,7 @@ extern struct cpuidle_driver acpi_idle_driver;
330/* in processor_thermal.c */ 331/* in processor_thermal.c */
331int acpi_processor_get_limit_info(struct acpi_processor *pr); 332int acpi_processor_get_limit_info(struct acpi_processor *pr);
332extern struct file_operations acpi_processor_limit_fops; 333extern struct file_operations acpi_processor_limit_fops;
333 334extern struct thermal_cooling_device_ops processor_cooling_ops;
334#ifdef CONFIG_CPU_FREQ 335#ifdef CONFIG_CPU_FREQ
335void acpi_thermal_cpufreq_init(void); 336void acpi_thermal_cpufreq_init(void);
336void acpi_thermal_cpufreq_exit(void); 337void acpi_thermal_cpufreq_exit(void);
diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h
index f5cb7b878af2..ca88e54dec93 100644
--- a/include/asm-alpha/atomic.h
+++ b/include/asm-alpha/atomic.h
@@ -100,7 +100,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
100/* 100/*
101 * Same as above, but return the result value 101 * Same as above, but return the result value
102 */ 102 */
103static __inline__ long atomic_add_return(int i, atomic_t * v) 103static inline int atomic_add_return(int i, atomic_t *v)
104{ 104{
105 long temp, result; 105 long temp, result;
106 smp_mb(); 106 smp_mb();
diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h
index 30ee7669b19f..d5b10ef64364 100644
--- a/include/asm-alpha/pci.h
+++ b/include/asm-alpha/pci.h
@@ -4,6 +4,7 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/spinlock.h> 6#include <linux/spinlock.h>
7#include <linux/dma-mapping.h>
7#include <asm/scatterlist.h> 8#include <asm/scatterlist.h>
8#include <asm/machvec.h> 9#include <asm/machvec.h>
9 10
diff --git a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h
index 471864e8d4c3..fdbedacc7375 100644
--- a/include/asm-alpha/pgalloc.h
+++ b/include/asm-alpha/pgalloc.h
@@ -31,7 +31,7 @@ pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
31extern pgd_t *pgd_alloc(struct mm_struct *mm); 31extern pgd_t *pgd_alloc(struct mm_struct *mm);
32 32
33static inline void 33static inline void
34pgd_free(pgd_t *pgd) 34pgd_free(struct mm_struct *mm, pgd_t *pgd)
35{ 35{
36 free_page((unsigned long)pgd); 36 free_page((unsigned long)pgd);
37} 37}
@@ -44,7 +44,7 @@ pmd_alloc_one(struct mm_struct *mm, unsigned long address)
44} 44}
45 45
46static inline void 46static inline void
47pmd_free(pmd_t *pmd) 47pmd_free(struct mm_struct *mm, pmd_t *pmd)
48{ 48{
49 free_page((unsigned long)pmd); 49 free_page((unsigned long)pmd);
50} 50}
@@ -52,7 +52,7 @@ pmd_free(pmd_t *pmd)
52extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); 52extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr);
53 53
54static inline void 54static inline void
55pte_free_kernel(pte_t *pte) 55pte_free_kernel(struct mm_struct *mm, pte_t *pte)
56{ 56{
57 free_page((unsigned long)pte); 57 free_page((unsigned long)pte);
58} 58}
@@ -67,7 +67,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr)
67} 67}
68 68
69static inline void 69static inline void
70pte_free(struct page *page) 70pte_free(struct mm_struct *mm, struct page *page)
71{ 71{
72 __free_page(page); 72 __free_page(page);
73} 73}
diff --git a/include/asm-alpha/tlb.h b/include/asm-alpha/tlb.h
index aa91335533e0..c13636575fba 100644
--- a/include/asm-alpha/tlb.h
+++ b/include/asm-alpha/tlb.h
@@ -9,7 +9,7 @@
9 9
10#include <asm-generic/tlb.h> 10#include <asm-generic/tlb.h>
11 11
12#define __pte_free_tlb(tlb,pte) pte_free(pte) 12#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte)
13#define __pmd_free_tlb(tlb,pmd) pmd_free(pmd) 13#define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd)
14 14
15#endif 15#endif
diff --git a/include/asm-alpha/tlbflush.h b/include/asm-alpha/tlbflush.h
index b9e9147226f7..9d87aaa08c0d 100644
--- a/include/asm-alpha/tlbflush.h
+++ b/include/asm-alpha/tlbflush.h
@@ -142,6 +142,10 @@ extern void flush_tlb_range(struct vm_area_struct *, unsigned long,
142 142
143#endif /* CONFIG_SMP */ 143#endif /* CONFIG_SMP */
144 144
145#define flush_tlb_kernel_range(start, end) flush_tlb_all() 145static inline void flush_tlb_kernel_range(unsigned long start,
146 unsigned long end)
147{
148 flush_tlb_all();
149}
146 150
147#endif /* _ALPHA_TLBFLUSH_H */ 151#endif /* _ALPHA_TLBFLUSH_H */
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h
index 29bf2fdc91c0..5b5c17485942 100644
--- a/include/asm-alpha/unistd.h
+++ b/include/asm-alpha/unistd.h
@@ -442,7 +442,6 @@
442#define __ARCH_WANT_OLD_READDIR 442#define __ARCH_WANT_OLD_READDIR
443#define __ARCH_WANT_STAT64 443#define __ARCH_WANT_STAT64
444#define __ARCH_WANT_SYS_GETHOSTNAME 444#define __ARCH_WANT_SYS_GETHOSTNAME
445#define __ARCH_WANT_SYS_SOCKETCALL
446#define __ARCH_WANT_SYS_FADVISE64 445#define __ARCH_WANT_SYS_FADVISE64
447#define __ARCH_WANT_SYS_GETPGRP 446#define __ARCH_WANT_SYS_GETPGRP
448#define __ARCH_WANT_SYS_OLD_GETRLIMIT 447#define __ARCH_WANT_SYS_OLD_GETRLIMIT
diff --git a/include/asm-arm/arch-iop13xx/adma.h b/include/asm-arm/arch-iop13xx/adma.h
index 04006c1c5fd7..efd9a5eb1008 100644
--- a/include/asm-arm/arch-iop13xx/adma.h
+++ b/include/asm-arm/arch-iop13xx/adma.h
@@ -247,7 +247,7 @@ static inline u32 iop_desc_get_src_count(struct iop_adma_desc_slot *desc,
247} 247}
248 248
249static inline void 249static inline void
250iop_desc_init_memcpy(struct iop_adma_desc_slot *desc, int int_en) 250iop_desc_init_memcpy(struct iop_adma_desc_slot *desc, unsigned long flags)
251{ 251{
252 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc; 252 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
253 union { 253 union {
@@ -257,13 +257,13 @@ iop_desc_init_memcpy(struct iop_adma_desc_slot *desc, int int_en)
257 257
258 u_desc_ctrl.value = 0; 258 u_desc_ctrl.value = 0;
259 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */ 259 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */
260 u_desc_ctrl.field.int_en = int_en; 260 u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
261 hw_desc->desc_ctrl = u_desc_ctrl.value; 261 hw_desc->desc_ctrl = u_desc_ctrl.value;
262 hw_desc->crc_addr = 0; 262 hw_desc->crc_addr = 0;
263} 263}
264 264
265static inline void 265static inline void
266iop_desc_init_memset(struct iop_adma_desc_slot *desc, int int_en) 266iop_desc_init_memset(struct iop_adma_desc_slot *desc, unsigned long flags)
267{ 267{
268 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc; 268 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
269 union { 269 union {
@@ -274,14 +274,15 @@ iop_desc_init_memset(struct iop_adma_desc_slot *desc, int int_en)
274 u_desc_ctrl.value = 0; 274 u_desc_ctrl.value = 0;
275 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */ 275 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */
276 u_desc_ctrl.field.block_fill_en = 1; 276 u_desc_ctrl.field.block_fill_en = 1;
277 u_desc_ctrl.field.int_en = int_en; 277 u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
278 hw_desc->desc_ctrl = u_desc_ctrl.value; 278 hw_desc->desc_ctrl = u_desc_ctrl.value;
279 hw_desc->crc_addr = 0; 279 hw_desc->crc_addr = 0;
280} 280}
281 281
282/* to do: support buffers larger than ADMA_MAX_BYTE_COUNT */ 282/* to do: support buffers larger than ADMA_MAX_BYTE_COUNT */
283static inline void 283static inline void
284iop_desc_init_xor(struct iop_adma_desc_slot *desc, int src_cnt, int int_en) 284iop_desc_init_xor(struct iop_adma_desc_slot *desc, int src_cnt,
285 unsigned long flags)
285{ 286{
286 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc; 287 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
287 union { 288 union {
@@ -292,7 +293,7 @@ iop_desc_init_xor(struct iop_adma_desc_slot *desc, int src_cnt, int int_en)
292 u_desc_ctrl.value = 0; 293 u_desc_ctrl.value = 0;
293 u_desc_ctrl.field.src_select = src_cnt - 1; 294 u_desc_ctrl.field.src_select = src_cnt - 1;
294 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */ 295 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */
295 u_desc_ctrl.field.int_en = int_en; 296 u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
296 hw_desc->desc_ctrl = u_desc_ctrl.value; 297 hw_desc->desc_ctrl = u_desc_ctrl.value;
297 hw_desc->crc_addr = 0; 298 hw_desc->crc_addr = 0;
298 299
@@ -301,7 +302,8 @@ iop_desc_init_xor(struct iop_adma_desc_slot *desc, int src_cnt, int int_en)
301 302
302/* to do: support buffers larger than ADMA_MAX_BYTE_COUNT */ 303/* to do: support buffers larger than ADMA_MAX_BYTE_COUNT */
303static inline int 304static inline int
304iop_desc_init_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt, int int_en) 305iop_desc_init_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt,
306 unsigned long flags)
305{ 307{
306 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc; 308 struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
307 union { 309 union {
@@ -314,7 +316,7 @@ iop_desc_init_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt, int int_en)
314 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */ 316 u_desc_ctrl.field.xfer_dir = 3; /* local to internal bus */
315 u_desc_ctrl.field.zero_result = 1; 317 u_desc_ctrl.field.zero_result = 1;
316 u_desc_ctrl.field.status_write_back_en = 1; 318 u_desc_ctrl.field.status_write_back_en = 1;
317 u_desc_ctrl.field.int_en = int_en; 319 u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
318 hw_desc->desc_ctrl = u_desc_ctrl.value; 320 hw_desc->desc_ctrl = u_desc_ctrl.value;
319 hw_desc->crc_addr = 0; 321 hw_desc->crc_addr = 0;
320 322
diff --git a/include/asm-arm/arch-pxa/gpio.h b/include/asm-arm/arch-pxa/gpio.h
index 9dbc2dc794f7..bdbf5f9ffdd5 100644
--- a/include/asm-arm/arch-pxa/gpio.h
+++ b/include/asm-arm/arch-pxa/gpio.h
@@ -28,43 +28,35 @@
28#include <asm/irq.h> 28#include <asm/irq.h>
29#include <asm/hardware.h> 29#include <asm/hardware.h>
30 30
31static inline int gpio_request(unsigned gpio, const char *label) 31#include <asm-generic/gpio.h>
32{
33 return 0;
34}
35 32
36static inline void gpio_free(unsigned gpio)
37{
38 return;
39}
40 33
41extern int gpio_direction_input(unsigned gpio); 34/* NOTE: some PXAs have fewer on-chip GPIOs (like PXA255, with 85).
42extern int gpio_direction_output(unsigned gpio, int value); 35 * Those cases currently cause holes in the GPIO number space.
36 */
37#define NR_BUILTIN_GPIO 128
43 38
44static inline int __gpio_get_value(unsigned gpio) 39static inline int gpio_get_value(unsigned gpio)
45{ 40{
46 return GPLR(gpio) & GPIO_bit(gpio); 41 if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO))
42 return GPLR(gpio) & GPIO_bit(gpio);
43 else
44 return __gpio_get_value(gpio);
47} 45}
48 46
49#define gpio_get_value(gpio) \ 47static inline void gpio_set_value(unsigned gpio, int value)
50 (__builtin_constant_p(gpio) ? \
51 __gpio_get_value(gpio) : \
52 pxa_gpio_get_value(gpio))
53
54static inline void __gpio_set_value(unsigned gpio, int value)
55{ 48{
56 if (value) 49 if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO)) {
57 GPSR(gpio) = GPIO_bit(gpio); 50 if (value)
58 else 51 GPSR(gpio) = GPIO_bit(gpio);
59 GPCR(gpio) = GPIO_bit(gpio); 52 else
53 GPCR(gpio) = GPIO_bit(gpio);
54 } else {
55 __gpio_set_value(gpio, value);
56 }
60} 57}
61 58
62#define gpio_set_value(gpio,value) \ 59#define gpio_cansleep __gpio_cansleep
63 (__builtin_constant_p(gpio) ? \
64 __gpio_set_value(gpio, value) : \
65 pxa_gpio_set_value(gpio, value))
66
67#include <asm-generic/gpio.h> /* cansleep wrappers */
68 60
69#define gpio_to_irq(gpio) IRQ_GPIO(gpio) 61#define gpio_to_irq(gpio) IRQ_GPIO(gpio)
70#define irq_to_gpio(irq) IRQ_TO_GPIO(irq) 62#define irq_to_gpio(irq) IRQ_TO_GPIO(irq)
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index 16ed24dbda4e..ac175b4d10cb 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -1131,6 +1131,19 @@
1131 * General Purpose I/O 1131 * General Purpose I/O
1132 */ 1132 */
1133 1133
1134#define GPIO0_BASE ((void __iomem *)io_p2v(0x40E00000))
1135#define GPIO1_BASE ((void __iomem *)io_p2v(0x40E00004))
1136#define GPIO2_BASE ((void __iomem *)io_p2v(0x40E00008))
1137#define GPIO3_BASE ((void __iomem *)io_p2v(0x40E00100))
1138
1139#define GPLR_OFFSET 0x00
1140#define GPDR_OFFSET 0x0C
1141#define GPSR_OFFSET 0x18
1142#define GPCR_OFFSET 0x24
1143#define GRER_OFFSET 0x30
1144#define GFER_OFFSET 0x3C
1145#define GEDR_OFFSET 0x48
1146
1134#define GPLR0 __REG(0x40E00000) /* GPIO Pin-Level Register GPIO<31:0> */ 1147#define GPLR0 __REG(0x40E00000) /* GPIO Pin-Level Register GPIO<31:0> */
1135#define GPLR1 __REG(0x40E00004) /* GPIO Pin-Level Register GPIO<63:32> */ 1148#define GPLR1 __REG(0x40E00004) /* GPIO Pin-Level Register GPIO<63:32> */
1136#define GPLR2 __REG(0x40E00008) /* GPIO Pin-Level Register GPIO<80:64> */ 1149#define GPLR2 __REG(0x40E00008) /* GPIO Pin-Level Register GPIO<80:64> */
diff --git a/include/asm-arm/arch-s3c2410/regs-lcd.h b/include/asm-arm/arch-s3c2410/regs-lcd.h
index 76fe5f693426..bd854845697f 100644
--- a/include/asm-arm/arch-s3c2410/regs-lcd.h
+++ b/include/asm-arm/arch-s3c2410/regs-lcd.h
@@ -147,7 +147,16 @@
147 147
148#define S3C2412_FRCPAT(x) S3C2410_LCDREG(0xB4 + ((x)*4)) 148#define S3C2412_FRCPAT(x) S3C2410_LCDREG(0xB4 + ((x)*4))
149 149
150#endif /* ___ASM_ARCH_REGS_LCD_H */ 150/* general registers */
151
152/* base of the LCD registers, where INTPND, INTSRC and then INTMSK
153 * are available. */
151 154
155#define S3C2410_LCDINTBASE S3C2410_LCDREG(0x54)
156#define S3C2412_LCDINTBASE S3C2410_LCDREG(0x24)
152 157
158#define S3C24XX_LCDINTPND (0x00)
159#define S3C24XX_LCDSRCPND (0x04)
160#define S3C24XX_LCDINTMSK (0x08)
153 161
162#endif /* ___ASM_ARCH_REGS_LCD_H */
diff --git a/include/asm-arm/arch-s3c2410/spi-gpio.h b/include/asm-arm/arch-s3c2410/spi-gpio.h
index ba1dca88d480..73803731142a 100644
--- a/include/asm-arm/arch-s3c2410/spi-gpio.h
+++ b/include/asm-arm/arch-s3c2410/spi-gpio.h
@@ -13,9 +13,6 @@
13#ifndef __ASM_ARCH_SPIGPIO_H 13#ifndef __ASM_ARCH_SPIGPIO_H
14#define __ASM_ARCH_SPIGPIO_H __FILE__ 14#define __ASM_ARCH_SPIGPIO_H __FILE__
15 15
16struct s3c2410_spigpio_info;
17struct spi_board_info;
18
19struct s3c2410_spigpio_info { 16struct s3c2410_spigpio_info {
20 unsigned long pin_clk; 17 unsigned long pin_clk;
21 unsigned long pin_mosi; 18 unsigned long pin_mosi;
@@ -23,9 +20,6 @@ struct s3c2410_spigpio_info {
23 20
24 int bus_num; 21 int bus_num;
25 22
26 unsigned long board_size;
27 struct spi_board_info *board_info;
28
29 void (*chip_select)(struct s3c2410_spigpio_info *spi, int cs); 23 void (*chip_select)(struct s3c2410_spigpio_info *spi, int cs);
30}; 24};
31 25
diff --git a/include/asm-arm/arch-s3c2410/spi.h b/include/asm-arm/arch-s3c2410/spi.h
index 4029a1a1ab40..7ca0ed97a6d0 100644
--- a/include/asm-arm/arch-s3c2410/spi.h
+++ b/include/asm-arm/arch-s3c2410/spi.h
@@ -13,15 +13,9 @@
13#ifndef __ASM_ARCH_SPI_H 13#ifndef __ASM_ARCH_SPI_H
14#define __ASM_ARCH_SPI_H __FILE__ 14#define __ASM_ARCH_SPI_H __FILE__
15 15
16struct s3c2410_spi_info;
17struct spi_board_info;
18
19struct s3c2410_spi_info { 16struct s3c2410_spi_info {
20 unsigned long pin_cs; /* simple gpio cs */ 17 unsigned long pin_cs; /* simple gpio cs */
21 18
22 unsigned long board_size;
23 struct spi_board_info *board_info;
24
25 void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol); 19 void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol);
26}; 20};
27 21
diff --git a/include/asm-arm/hardware/iop3xx-adma.h b/include/asm-arm/hardware/iop3xx-adma.h
index 10834b54f681..5c529e6a5e3b 100644
--- a/include/asm-arm/hardware/iop3xx-adma.h
+++ b/include/asm-arm/hardware/iop3xx-adma.h
@@ -414,7 +414,7 @@ static inline void iop3xx_aau_desc_set_src_addr(struct iop3xx_desc_aau *hw_desc,
414} 414}
415 415
416static inline void 416static inline void
417iop_desc_init_memcpy(struct iop_adma_desc_slot *desc, int int_en) 417iop_desc_init_memcpy(struct iop_adma_desc_slot *desc, unsigned long flags)
418{ 418{
419 struct iop3xx_desc_dma *hw_desc = desc->hw_desc; 419 struct iop3xx_desc_dma *hw_desc = desc->hw_desc;
420 union { 420 union {
@@ -425,14 +425,14 @@ iop_desc_init_memcpy(struct iop_adma_desc_slot *desc, int int_en)
425 u_desc_ctrl.value = 0; 425 u_desc_ctrl.value = 0;
426 u_desc_ctrl.field.mem_to_mem_en = 1; 426 u_desc_ctrl.field.mem_to_mem_en = 1;
427 u_desc_ctrl.field.pci_transaction = 0xe; /* memory read block */ 427 u_desc_ctrl.field.pci_transaction = 0xe; /* memory read block */
428 u_desc_ctrl.field.int_en = int_en; 428 u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
429 hw_desc->desc_ctrl = u_desc_ctrl.value; 429 hw_desc->desc_ctrl = u_desc_ctrl.value;
430 hw_desc->upper_pci_src_addr = 0; 430 hw_desc->upper_pci_src_addr = 0;
431 hw_desc->crc_addr = 0; 431 hw_desc->crc_addr = 0;
432} 432}
433 433
434static inline void 434static inline void
435iop_desc_init_memset(struct iop_adma_desc_slot *desc, int int_en) 435iop_desc_init_memset(struct iop_adma_desc_slot *desc, unsigned long flags)
436{ 436{
437 struct iop3xx_desc_aau *hw_desc = desc->hw_desc; 437 struct iop3xx_desc_aau *hw_desc = desc->hw_desc;
438 union { 438 union {
@@ -443,12 +443,13 @@ iop_desc_init_memset(struct iop_adma_desc_slot *desc, int int_en)
443 u_desc_ctrl.value = 0; 443 u_desc_ctrl.value = 0;
444 u_desc_ctrl.field.blk1_cmd_ctrl = 0x2; /* memory block fill */ 444 u_desc_ctrl.field.blk1_cmd_ctrl = 0x2; /* memory block fill */
445 u_desc_ctrl.field.dest_write_en = 1; 445 u_desc_ctrl.field.dest_write_en = 1;
446 u_desc_ctrl.field.int_en = int_en; 446 u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
447 hw_desc->desc_ctrl = u_desc_ctrl.value; 447 hw_desc->desc_ctrl = u_desc_ctrl.value;
448} 448}
449 449
450static inline u32 450static inline u32
451iop3xx_desc_init_xor(struct iop3xx_desc_aau *hw_desc, int src_cnt, int int_en) 451iop3xx_desc_init_xor(struct iop3xx_desc_aau *hw_desc, int src_cnt,
452 unsigned long flags)
452{ 453{
453 int i, shift; 454 int i, shift;
454 u32 edcr; 455 u32 edcr;
@@ -509,21 +510,23 @@ iop3xx_desc_init_xor(struct iop3xx_desc_aau *hw_desc, int src_cnt, int int_en)
509 510
510 u_desc_ctrl.field.dest_write_en = 1; 511 u_desc_ctrl.field.dest_write_en = 1;
511 u_desc_ctrl.field.blk1_cmd_ctrl = 0x7; /* direct fill */ 512 u_desc_ctrl.field.blk1_cmd_ctrl = 0x7; /* direct fill */
512 u_desc_ctrl.field.int_en = int_en; 513 u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
513 hw_desc->desc_ctrl = u_desc_ctrl.value; 514 hw_desc->desc_ctrl = u_desc_ctrl.value;
514 515
515 return u_desc_ctrl.value; 516 return u_desc_ctrl.value;
516} 517}
517 518
518static inline void 519static inline void
519iop_desc_init_xor(struct iop_adma_desc_slot *desc, int src_cnt, int int_en) 520iop_desc_init_xor(struct iop_adma_desc_slot *desc, int src_cnt,
521 unsigned long flags)
520{ 522{
521 iop3xx_desc_init_xor(desc->hw_desc, src_cnt, int_en); 523 iop3xx_desc_init_xor(desc->hw_desc, src_cnt, flags);
522} 524}
523 525
524/* return the number of operations */ 526/* return the number of operations */
525static inline int 527static inline int
526iop_desc_init_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt, int int_en) 528iop_desc_init_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt,
529 unsigned long flags)
527{ 530{
528 int slot_cnt = desc->slot_cnt, slots_per_op = desc->slots_per_op; 531 int slot_cnt = desc->slot_cnt, slots_per_op = desc->slots_per_op;
529 struct iop3xx_desc_aau *hw_desc, *prev_hw_desc, *iter; 532 struct iop3xx_desc_aau *hw_desc, *prev_hw_desc, *iter;
@@ -538,10 +541,10 @@ iop_desc_init_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt, int int_en)
538 for (i = 0, j = 0; (slot_cnt -= slots_per_op) >= 0; 541 for (i = 0, j = 0; (slot_cnt -= slots_per_op) >= 0;
539 i += slots_per_op, j++) { 542 i += slots_per_op, j++) {
540 iter = iop_hw_desc_slot_idx(hw_desc, i); 543 iter = iop_hw_desc_slot_idx(hw_desc, i);
541 u_desc_ctrl.value = iop3xx_desc_init_xor(iter, src_cnt, int_en); 544 u_desc_ctrl.value = iop3xx_desc_init_xor(iter, src_cnt, flags);
542 u_desc_ctrl.field.dest_write_en = 0; 545 u_desc_ctrl.field.dest_write_en = 0;
543 u_desc_ctrl.field.zero_result_en = 1; 546 u_desc_ctrl.field.zero_result_en = 1;
544 u_desc_ctrl.field.int_en = int_en; 547 u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
545 iter->desc_ctrl = u_desc_ctrl.value; 548 iter->desc_ctrl = u_desc_ctrl.value;
546 549
547 /* for the subsequent descriptors preserve the store queue 550 /* for the subsequent descriptors preserve the store queue
@@ -559,7 +562,8 @@ iop_desc_init_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt, int int_en)
559} 562}
560 563
561static inline void 564static inline void
562iop_desc_init_null_xor(struct iop_adma_desc_slot *desc, int src_cnt, int int_en) 565iop_desc_init_null_xor(struct iop_adma_desc_slot *desc, int src_cnt,
566 unsigned long flags)
563{ 567{
564 struct iop3xx_desc_aau *hw_desc = desc->hw_desc; 568 struct iop3xx_desc_aau *hw_desc = desc->hw_desc;
565 union { 569 union {
@@ -591,7 +595,7 @@ iop_desc_init_null_xor(struct iop_adma_desc_slot *desc, int src_cnt, int int_en)
591 } 595 }
592 596
593 u_desc_ctrl.field.dest_write_en = 0; 597 u_desc_ctrl.field.dest_write_en = 0;
594 u_desc_ctrl.field.int_en = int_en; 598 u_desc_ctrl.field.int_en = flags & DMA_PREP_INTERRUPT;
595 hw_desc->desc_ctrl = u_desc_ctrl.value; 599 hw_desc->desc_ctrl = u_desc_ctrl.value;
596} 600}
597 601
diff --git a/include/asm-arm/pgalloc.h b/include/asm-arm/pgalloc.h
index 4d4394552911..fb6c6e3222bd 100644
--- a/include/asm-arm/pgalloc.h
+++ b/include/asm-arm/pgalloc.h
@@ -27,14 +27,14 @@
27 * Since we have only two-level page tables, these are trivial 27 * Since we have only two-level page tables, these are trivial
28 */ 28 */
29#define pmd_alloc_one(mm,addr) ({ BUG(); ((pmd_t *)2); }) 29#define pmd_alloc_one(mm,addr) ({ BUG(); ((pmd_t *)2); })
30#define pmd_free(pmd) do { } while (0) 30#define pmd_free(mm, pmd) do { } while (0)
31#define pgd_populate(mm,pmd,pte) BUG() 31#define pgd_populate(mm,pmd,pte) BUG()
32 32
33extern pgd_t *get_pgd_slow(struct mm_struct *mm); 33extern pgd_t *get_pgd_slow(struct mm_struct *mm);
34extern void free_pgd_slow(pgd_t *pgd); 34extern void free_pgd_slow(struct mm_struct *mm, pgd_t *pgd);
35 35
36#define pgd_alloc(mm) get_pgd_slow(mm) 36#define pgd_alloc(mm) get_pgd_slow(mm)
37#define pgd_free(pgd) free_pgd_slow(pgd) 37#define pgd_free(mm, pgd) free_pgd_slow(mm, pgd)
38 38
39/* 39/*
40 * Allocate one PTE table. 40 * Allocate one PTE table.
@@ -83,7 +83,7 @@ pte_alloc_one(struct mm_struct *mm, unsigned long addr)
83/* 83/*
84 * Free one PTE table. 84 * Free one PTE table.
85 */ 85 */
86static inline void pte_free_kernel(pte_t *pte) 86static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
87{ 87{
88 if (pte) { 88 if (pte) {
89 pte -= PTRS_PER_PTE; 89 pte -= PTRS_PER_PTE;
@@ -91,7 +91,7 @@ static inline void pte_free_kernel(pte_t *pte)
91 } 91 }
92} 92}
93 93
94static inline void pte_free(struct page *pte) 94static inline void pte_free(struct mm_struct *mm, struct page *pte)
95{ 95{
96 __free_page(pte); 96 __free_page(pte);
97} 97}
diff --git a/include/asm-arm/tlb.h b/include/asm-arm/tlb.h
index cb740025d413..36bd402a21cb 100644
--- a/include/asm-arm/tlb.h
+++ b/include/asm-arm/tlb.h
@@ -85,8 +85,8 @@ tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma)
85} 85}
86 86
87#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page) 87#define tlb_remove_page(tlb,page) free_page_and_swap_cache(page)
88#define pte_free_tlb(tlb,ptep) pte_free(ptep) 88#define pte_free_tlb(tlb, ptep) pte_free((tlb)->mm, ptep)
89#define pmd_free_tlb(tlb,pmdp) pmd_free(pmdp) 89#define pmd_free_tlb(tlb, pmdp) pmd_free((tlb)->mm, pmdp)
90 90
91#define tlb_migrate_finish(mm) do { } while (0) 91#define tlb_migrate_finish(mm) do { } while (0)
92 92
diff --git a/include/asm-avr32/arch-at32ap/at32ap700x.h b/include/asm-avr32/arch-at32ap/at32ap700x.h
index 99684d6f3967..31e48b0e7324 100644
--- a/include/asm-avr32/arch-at32ap/at32ap700x.h
+++ b/include/asm-avr32/arch-at32ap/at32ap700x.h
@@ -13,8 +13,6 @@
13#define GPIO_PERIPH_A 0 13#define GPIO_PERIPH_A 0
14#define GPIO_PERIPH_B 1 14#define GPIO_PERIPH_B 1
15 15
16#define NR_GPIO_CONTROLLERS 4
17
18/* 16/*
19 * Pin numbers identifying specific GPIO pins on the chip. They can 17 * Pin numbers identifying specific GPIO pins on the chip. They can
20 * also be converted to IRQ numbers by passing them through 18 * also be converted to IRQ numbers by passing them through
diff --git a/include/asm-avr32/arch-at32ap/gpio.h b/include/asm-avr32/arch-at32ap/gpio.h
index af7f9535bab3..0180f584ef03 100644
--- a/include/asm-avr32/arch-at32ap/gpio.h
+++ b/include/asm-avr32/arch-at32ap/gpio.h
@@ -5,20 +5,36 @@
5#include <asm/irq.h> 5#include <asm/irq.h>
6 6
7 7
8/* Arch-neutral GPIO API */ 8/* Some GPIO chips can manage IRQs; some can't. The exact numbers can
9int __must_check gpio_request(unsigned int gpio, const char *label); 9 * be changed if needed, but for the moment they're not configurable.
10void gpio_free(unsigned int gpio); 10 */
11#define ARCH_NR_GPIOS (NR_GPIO_IRQS + 2 * 32)
11 12
12int gpio_direction_input(unsigned int gpio);
13int gpio_direction_output(unsigned int gpio, int value);
14int gpio_get_value(unsigned int gpio);
15void gpio_set_value(unsigned int gpio, int value);
16 13
17#include <asm-generic/gpio.h> /* cansleep wrappers */ 14/* Arch-neutral GPIO API, supporting both "native" and external GPIOs. */
15#include <asm-generic/gpio.h>
16
17static inline int gpio_get_value(unsigned int gpio)
18{
19 return __gpio_get_value(gpio);
20}
21
22static inline void gpio_set_value(unsigned int gpio, int value)
23{
24 __gpio_set_value(gpio, value);
25}
26
27static inline int gpio_cansleep(unsigned int gpio)
28{
29 return __gpio_cansleep(gpio);
30}
31
18 32
19static inline int gpio_to_irq(unsigned int gpio) 33static inline int gpio_to_irq(unsigned int gpio)
20{ 34{
21 return gpio + GPIO_IRQ_BASE; 35 if (gpio < NR_GPIO_IRQS)
36 return gpio + GPIO_IRQ_BASE;
37 return -EINVAL;
22} 38}
23 39
24static inline int irq_to_gpio(unsigned int irq) 40static inline int irq_to_gpio(unsigned int irq)
diff --git a/include/asm-avr32/arch-at32ap/irq.h b/include/asm-avr32/arch-at32ap/irq.h
index 5adffab9a577..608e350368c7 100644
--- a/include/asm-avr32/arch-at32ap/irq.h
+++ b/include/asm-avr32/arch-at32ap/irq.h
@@ -3,11 +3,11 @@
3 3
4#define EIM_IRQ_BASE NR_INTERNAL_IRQS 4#define EIM_IRQ_BASE NR_INTERNAL_IRQS
5#define NR_EIM_IRQS 32 5#define NR_EIM_IRQS 32
6
7#define AT32_EXTINT(n) (EIM_IRQ_BASE + (n)) 6#define AT32_EXTINT(n) (EIM_IRQ_BASE + (n))
8 7
9#define GPIO_IRQ_BASE (EIM_IRQ_BASE + NR_EIM_IRQS) 8#define GPIO_IRQ_BASE (EIM_IRQ_BASE + NR_EIM_IRQS)
10#define NR_GPIO_IRQS (5 * 32) 9#define NR_GPIO_CTLR (5 /*internal*/ + 1 /*external*/)
10#define NR_GPIO_IRQS (NR_GPIO_CTLR * 32)
11 11
12#define NR_IRQS (GPIO_IRQ_BASE + NR_GPIO_IRQS) 12#define NR_IRQS (GPIO_IRQ_BASE + NR_GPIO_IRQS)
13 13
diff --git a/include/asm-avr32/delay.h b/include/asm-avr32/delay.h
index cc3b2e3343b3..a0ed9a9839a5 100644
--- a/include/asm-avr32/delay.h
+++ b/include/asm-avr32/delay.h
@@ -12,7 +12,7 @@ extern void __bad_ndelay(void);
12 12
13extern void __udelay(unsigned long usecs); 13extern void __udelay(unsigned long usecs);
14extern void __ndelay(unsigned long nsecs); 14extern void __ndelay(unsigned long nsecs);
15extern void __const_udelay(unsigned long usecs); 15extern void __const_udelay(unsigned long xloops);
16extern void __delay(unsigned long loops); 16extern void __delay(unsigned long loops);
17 17
18#define udelay(n) (__builtin_constant_p(n) ? \ 18#define udelay(n) (__builtin_constant_p(n) ? \
diff --git a/include/asm-avr32/pgalloc.h b/include/asm-avr32/pgalloc.h
index 0e680f47209f..b77e364b4c44 100644
--- a/include/asm-avr32/pgalloc.h
+++ b/include/asm-avr32/pgalloc.h
@@ -30,7 +30,7 @@ static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm)
30 return kcalloc(USER_PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL); 30 return kcalloc(USER_PTRS_PER_PGD, sizeof(pgd_t), GFP_KERNEL);
31} 31}
32 32
33static inline void pgd_free(pgd_t *pgd) 33static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
34{ 34{
35 kfree(pgd); 35 kfree(pgd);
36} 36}
@@ -55,12 +55,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,
55 return pte; 55 return pte;
56} 56}
57 57
58static inline void pte_free_kernel(pte_t *pte) 58static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
59{ 59{
60 free_page((unsigned long)pte); 60 free_page((unsigned long)pte);
61} 61}
62 62
63static inline void pte_free(struct page *pte) 63static inline void pte_free(struct mm_struct *mm, struct page *pte)
64{ 64{
65 __free_page(pte); 65 __free_page(pte);
66} 66}
diff --git a/include/asm-avr32/timex.h b/include/asm-avr32/timex.h
index 5e44ecb3ce0c..187dcf38b210 100644
--- a/include/asm-avr32/timex.h
+++ b/include/asm-avr32/timex.h
@@ -34,7 +34,6 @@ static inline cycles_t get_cycles (void)
34 return 0; 34 return 0;
35} 35}
36 36
37extern int read_current_timer(unsigned long *timer_value); 37#define ARCH_HAS_READ_CURRENT_TIMER
38#define ARCH_HAS_READ_CURRENT_TIMER 1
39 38
40#endif /* __ASM_AVR32_TIMEX_H */ 39#endif /* __ASM_AVR32_TIMEX_H */
diff --git a/include/asm-avr32/unistd.h b/include/asm-avr32/unistd.h
index de09009593f8..89861a27543e 100644
--- a/include/asm-avr32/unistd.h
+++ b/include/asm-avr32/unistd.h
@@ -297,7 +297,7 @@
297 297
298#define __NR_utimensat 278 298#define __NR_utimensat 278
299#define __NR_signalfd 279 299#define __NR_signalfd 279
300#define __NR_timerfd 280 300/* 280 was __NR_timerfd */
301#define __NR_eventfd 281 301#define __NR_eventfd 281
302 302
303#ifdef __KERNEL__ 303#ifdef __KERNEL__
diff --git a/include/asm-blackfin/io.h b/include/asm-blackfin/io.h
index 1601d62f39a5..574fe56989d1 100644
--- a/include/asm-blackfin/io.h
+++ b/include/asm-blackfin/io.h
@@ -188,8 +188,6 @@ extern void blkfin_inv_cache_all(void);
188#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) 188#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
189#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT) 189#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT)
190 190
191#define mm_ptov(vaddr) ((void *) (vaddr))
192#define mm_vtop(vaddr) ((unsigned long) (vaddr))
193#define phys_to_virt(vaddr) ((void *) (vaddr)) 191#define phys_to_virt(vaddr) ((void *) (vaddr))
194#define virt_to_phys(vaddr) ((unsigned long) (vaddr)) 192#define virt_to_phys(vaddr) ((unsigned long) (vaddr))
195 193
diff --git a/include/asm-cris/bitops.h b/include/asm-cris/bitops.h
index e2f49c27ed29..75ea6e096483 100644
--- a/include/asm-cris/bitops.h
+++ b/include/asm-cris/bitops.h
@@ -24,13 +24,6 @@
24#include <linux/compiler.h> 24#include <linux/compiler.h>
25 25
26/* 26/*
27 * Some hacks to defeat gcc over-optimizations..
28 */
29struct __dummy { unsigned long a[100]; };
30#define ADDR (*(struct __dummy *) addr)
31#define CONST_ADDR (*(const struct __dummy *) addr)
32
33/*
34 * set_bit - Atomically set a bit in memory 27 * set_bit - Atomically set a bit in memory
35 * @nr: the bit to set 28 * @nr: the bit to set
36 * @addr: the address to start counting from 29 * @addr: the address to start counting from
diff --git a/include/asm-cris/pgalloc.h b/include/asm-cris/pgalloc.h
index deaddfe79bbc..8ddd66f81773 100644
--- a/include/asm-cris/pgalloc.h
+++ b/include/asm-cris/pgalloc.h
@@ -16,7 +16,7 @@ static inline pgd_t *pgd_alloc (struct mm_struct *mm)
16 return (pgd_t *)get_zeroed_page(GFP_KERNEL); 16 return (pgd_t *)get_zeroed_page(GFP_KERNEL);
17} 17}
18 18
19static inline void pgd_free (pgd_t *pgd) 19static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
20{ 20{
21 free_page((unsigned long)pgd); 21 free_page((unsigned long)pgd);
22} 22}
@@ -34,12 +34,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add
34 return pte; 34 return pte;
35} 35}
36 36
37static inline void pte_free_kernel(pte_t *pte) 37static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
38{ 38{
39 free_page((unsigned long)pte); 39 free_page((unsigned long)pte);
40} 40}
41 41
42static inline void pte_free(struct page *pte) 42static inline void pte_free(struct mm_struct *mm, struct page *pte)
43{ 43{
44 __free_page(pte); 44 __free_page(pte);
45} 45}
diff --git a/include/asm-frv/dma-mapping.h b/include/asm-frv/dma-mapping.h
index bcb2df68496e..2e8966ca030d 100644
--- a/include/asm-frv/dma-mapping.h
+++ b/include/asm-frv/dma-mapping.h
@@ -17,16 +17,6 @@ void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle
17void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle); 17void dma_free_coherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle);
18 18
19/* 19/*
20 * These macros should be used after a pci_map_sg call has been done
21 * to get bus addresses of each of the SG entries and their lengths.
22 * You should only work with the number of sg entries pci_map_sg
23 * returns, or alternatively stop on the first sg_dma_len(sg) which
24 * is 0.
25 */
26#define sg_dma_address(sg) ((sg)->dma_address)
27#define sg_dma_len(sg) ((sg)->length)
28
29/*
30 * Map a single buffer of the indicated size for DMA in streaming mode. 20 * Map a single buffer of the indicated size for DMA in streaming mode.
31 * The 32-bit bus address to use is returned. 21 * The 32-bit bus address to use is returned.
32 * 22 *
diff --git a/include/asm-frv/page.h b/include/asm-frv/page.h
index 213d92fd652a..bd9bd2d9cc78 100644
--- a/include/asm-frv/page.h
+++ b/include/asm-frv/page.h
@@ -76,10 +76,6 @@ extern unsigned long max_pfn;
76 76
77#endif /* __ASSEMBLY__ */ 77#endif /* __ASSEMBLY__ */
78 78
79#ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC
80#define WANT_PAGE_VIRTUAL 1
81#endif
82
83#include <asm-generic/memory_model.h> 79#include <asm-generic/memory_model.h>
84#include <asm-generic/page.h> 80#include <asm-generic/page.h>
85 81
diff --git a/include/asm-frv/pgalloc.h b/include/asm-frv/pgalloc.h
index ce982a6c610f..e89620ef08ca 100644
--- a/include/asm-frv/pgalloc.h
+++ b/include/asm-frv/pgalloc.h
@@ -31,18 +31,18 @@ do { \
31 */ 31 */
32 32
33extern pgd_t *pgd_alloc(struct mm_struct *); 33extern pgd_t *pgd_alloc(struct mm_struct *);
34extern void pgd_free(pgd_t *); 34extern void pgd_free(struct mm_struct *mm, pgd_t *);
35 35
36extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); 36extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long);
37 37
38extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); 38extern struct page *pte_alloc_one(struct mm_struct *, unsigned long);
39 39
40static inline void pte_free_kernel(pte_t *pte) 40static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
41{ 41{
42 free_page((unsigned long)pte); 42 free_page((unsigned long)pte);
43} 43}
44 44
45static inline void pte_free(struct page *pte) 45static inline void pte_free(struct mm_struct *mm, struct page *pte)
46{ 46{
47 __free_page(pte); 47 __free_page(pte);
48} 48}
@@ -55,7 +55,7 @@ static inline void pte_free(struct page *pte)
55 * (In the PAE case we free the pmds as part of the pgd.) 55 * (In the PAE case we free the pmds as part of the pgd.)
56 */ 56 */
57#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *) 2); }) 57#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *) 2); })
58#define pmd_free(x) do { } while (0) 58#define pmd_free(mm, x) do { } while (0)
59#define __pmd_free_tlb(tlb,x) do { } while (0) 59#define __pmd_free_tlb(tlb,x) do { } while (0)
60 60
61#endif /* CONFIG_MMU */ 61#endif /* CONFIG_MMU */
diff --git a/include/asm-frv/pgtable.h b/include/asm-frv/pgtable.h
index 3c402afb9e74..6c0682ed5fc9 100644
--- a/include/asm-frv/pgtable.h
+++ b/include/asm-frv/pgtable.h
@@ -226,7 +226,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long address)
226 * inside the pgd, so has no extra memory associated with it. 226 * inside the pgd, so has no extra memory associated with it.
227 */ 227 */
228#define pud_alloc_one(mm, address) NULL 228#define pud_alloc_one(mm, address) NULL
229#define pud_free(x) do { } while (0) 229#define pud_free(mm, x) do { } while (0)
230#define __pud_free_tlb(tlb, x) do { } while (0) 230#define __pud_free_tlb(tlb, x) do { } while (0)
231 231
232/* 232/*
diff --git a/include/asm-frv/scatterlist.h b/include/asm-frv/scatterlist.h
index 2e7143b5a7ad..4bca8a28546c 100644
--- a/include/asm-frv/scatterlist.h
+++ b/include/asm-frv/scatterlist.h
@@ -31,6 +31,16 @@ struct scatterlist {
31 unsigned int length; 31 unsigned int length;
32}; 32};
33 33
34/*
35 * These macros should be used after a pci_map_sg call has been done
36 * to get bus addresses of each of the SG entries and their lengths.
37 * You should only work with the number of sg entries pci_map_sg
38 * returns, or alternatively stop on the first sg_dma_len(sg) which
39 * is 0.
40 */
41#define sg_dma_address(sg) ((sg)->dma_address)
42#define sg_dma_len(sg) ((sg)->length)
43
34#define ISA_DMA_THRESHOLD (0xffffffffUL) 44#define ISA_DMA_THRESHOLD (0xffffffffUL)
35 45
36#endif /* !_ASM_SCATTERLIST_H */ 46#endif /* !_ASM_SCATTERLIST_H */
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h
index cd84f1771e34..e8c986667532 100644
--- a/include/asm-frv/unistd.h
+++ b/include/asm-frv/unistd.h
@@ -328,7 +328,7 @@
328#define __NR_epoll_pwait 319 328#define __NR_epoll_pwait 319
329#define __NR_utimensat 320 329#define __NR_utimensat 320
330#define __NR_signalfd 321 330#define __NR_signalfd 321
331#define __NR_timerfd 322 331/* #define __NR_timerfd 322 removed */
332#define __NR_eventfd 323 332#define __NR_eventfd 323
333#define __NR_fallocate 324 333#define __NR_fallocate 324
334 334
diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h
index 7b88d3931e34..9d40e879f99e 100644
--- a/include/asm-generic/4level-fixup.h
+++ b/include/asm-generic/4level-fixup.h
@@ -28,7 +28,7 @@
28 28
29#undef pud_free_tlb 29#undef pud_free_tlb
30#define pud_free_tlb(tlb, x) do { } while (0) 30#define pud_free_tlb(tlb, x) do { } while (0)
31#define pud_free(x) do { } while (0) 31#define pud_free(mm, x) do { } while (0)
32#define __pud_free_tlb(tlb, x) do { } while (0) 32#define __pud_free_tlb(tlb, x) do { } while (0)
33 33
34#undef pud_addr_end 34#undef pud_addr_end
diff --git a/include/asm-generic/cputime.h b/include/asm-generic/cputime.h
index 09204e40d663..1c1fa422d18a 100644
--- a/include/asm-generic/cputime.h
+++ b/include/asm-generic/cputime.h
@@ -18,6 +18,7 @@ typedef unsigned long cputime_t;
18#define cputime_lt(__a, __b) ((__a) < (__b)) 18#define cputime_lt(__a, __b) ((__a) < (__b))
19#define cputime_le(__a, __b) ((__a) <= (__b)) 19#define cputime_le(__a, __b) ((__a) <= (__b))
20#define cputime_to_jiffies(__ct) (__ct) 20#define cputime_to_jiffies(__ct) (__ct)
21#define cputime_to_scaled(__ct) (__ct)
21#define jiffies_to_cputime(__hz) (__hz) 22#define jiffies_to_cputime(__hz) (__hz)
22 23
23typedef u64 cputime64_t; 24typedef u64 cputime64_t;
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 2d0aab1d8611..f29a502f4a6c 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -1,6 +1,102 @@
1#ifndef _ASM_GENERIC_GPIO_H 1#ifndef _ASM_GENERIC_GPIO_H
2#define _ASM_GENERIC_GPIO_H 2#define _ASM_GENERIC_GPIO_H
3 3
4#ifdef CONFIG_HAVE_GPIO_LIB
5
6/* Platforms may implement their GPIO interface with library code,
7 * at a small performance cost for non-inlined operations and some
8 * extra memory (for code and for per-GPIO table entries).
9 *
10 * While the GPIO programming interface defines valid GPIO numbers
11 * to be in the range 0..MAX_INT, this library restricts them to the
12 * smaller range 0..ARCH_NR_GPIOS.
13 */
14
15#ifndef ARCH_NR_GPIOS
16#define ARCH_NR_GPIOS 256
17#endif
18
19struct seq_file;
20
21/**
22 * struct gpio_chip - abstract a GPIO controller
23 * @label: for diagnostics
24 * @direction_input: configures signal "offset" as input, or returns error
25 * @get: returns value for signal "offset"; for output signals this
26 * returns either the value actually sensed, or zero
27 * @direction_output: configures signal "offset" as output, or returns error
28 * @set: assigns output value for signal "offset"
29 * @dbg_show: optional routine to show contents in debugfs; default code
30 * will be used when this is omitted, but custom code can show extra
31 * state (such as pullup/pulldown configuration).
32 * @base: identifies the first GPIO number handled by this chip; or, if
33 * negative during registration, requests dynamic ID allocation.
34 * @ngpio: the number of GPIOs handled by this controller; the last GPIO
35 * handled is (base + ngpio - 1).
36 * @can_sleep: flag must be set iff get()/set() methods sleep, as they
37 * must while accessing GPIO expander chips over I2C or SPI
38 *
39 * A gpio_chip can help platforms abstract various sources of GPIOs so
40 * they can all be accessed through a common programing interface.
41 * Example sources would be SOC controllers, FPGAs, multifunction
42 * chips, dedicated GPIO expanders, and so on.
43 *
44 * Each chip controls a number of signals, identified in method calls
45 * by "offset" values in the range 0..(@ngpio - 1). When those signals
46 * are referenced through calls like gpio_get_value(gpio), the offset
47 * is calculated by subtracting @base from the gpio number.
48 */
49struct gpio_chip {
50 char *label;
51
52 int (*direction_input)(struct gpio_chip *chip,
53 unsigned offset);
54 int (*get)(struct gpio_chip *chip,
55 unsigned offset);
56 int (*direction_output)(struct gpio_chip *chip,
57 unsigned offset, int value);
58 void (*set)(struct gpio_chip *chip,
59 unsigned offset, int value);
60 void (*dbg_show)(struct seq_file *s,
61 struct gpio_chip *chip);
62 int base;
63 u16 ngpio;
64 unsigned can_sleep:1;
65};
66
67extern const char *gpiochip_is_requested(struct gpio_chip *chip,
68 unsigned offset);
69
70/* add/remove chips */
71extern int gpiochip_add(struct gpio_chip *chip);
72extern int __must_check gpiochip_remove(struct gpio_chip *chip);
73
74
75/* Always use the library code for GPIO management calls,
76 * or when sleeping may be involved.
77 */
78extern int gpio_request(unsigned gpio, const char *label);
79extern void gpio_free(unsigned gpio);
80
81extern int gpio_direction_input(unsigned gpio);
82extern int gpio_direction_output(unsigned gpio, int value);
83
84extern int gpio_get_value_cansleep(unsigned gpio);
85extern void gpio_set_value_cansleep(unsigned gpio, int value);
86
87
88/* A platform's <asm/gpio.h> code may want to inline the I/O calls when
89 * the GPIO is constant and refers to some always-present controller,
90 * giving direct access to chip registers and tight bitbanging loops.
91 */
92extern int __gpio_get_value(unsigned gpio);
93extern void __gpio_set_value(unsigned gpio, int value);
94
95extern int __gpio_cansleep(unsigned gpio);
96
97
98#else
99
4/* platforms that don't directly support access to GPIOs through I2C, SPI, 100/* platforms that don't directly support access to GPIOs through I2C, SPI,
5 * or other blocking infrastructure can use these wrappers. 101 * or other blocking infrastructure can use these wrappers.
6 */ 102 */
@@ -22,4 +118,6 @@ static inline void gpio_set_value_cansleep(unsigned gpio, int value)
22 gpio_set_value(gpio, value); 118 gpio_set_value(gpio, value);
23} 119}
24 120
121#endif
122
25#endif /* _ASM_GENERIC_GPIO_H */ 123#endif /* _ASM_GENERIC_GPIO_H */
diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h
index 29ff5d84d8c3..087325ede76c 100644
--- a/include/asm-generic/pgtable-nopmd.h
+++ b/include/asm-generic/pgtable-nopmd.h
@@ -54,7 +54,7 @@ static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address)
54 * inside the pud, so has no extra memory associated with it. 54 * inside the pud, so has no extra memory associated with it.
55 */ 55 */
56#define pmd_alloc_one(mm, address) NULL 56#define pmd_alloc_one(mm, address) NULL
57#define pmd_free(x) do { } while (0) 57#define pmd_free(mm, x) do { } while (0)
58#define __pmd_free_tlb(tlb, x) do { } while (0) 58#define __pmd_free_tlb(tlb, x) do { } while (0)
59 59
60#undef pmd_addr_end 60#undef pmd_addr_end
diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h
index 566464500558..87cf449a6df3 100644
--- a/include/asm-generic/pgtable-nopud.h
+++ b/include/asm-generic/pgtable-nopud.h
@@ -51,7 +51,7 @@ static inline pud_t * pud_offset(pgd_t * pgd, unsigned long address)
51 * inside the pgd, so has no extra memory associated with it. 51 * inside the pgd, so has no extra memory associated with it.
52 */ 52 */
53#define pud_alloc_one(mm, address) NULL 53#define pud_alloc_one(mm, address) NULL
54#define pud_free(x) do { } while (0) 54#define pud_free(mm, x) do { } while (0)
55#define __pud_free_tlb(tlb, x) do { } while (0) 55#define __pud_free_tlb(tlb, x) do { } while (0)
56 56
57#undef pud_addr_end 57#undef pud_addr_end
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 962cad7cfbbd..8feeae1f2369 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -8,8 +8,6 @@ extern char _data[], _sdata[], _edata[];
8extern char __bss_start[], __bss_stop[]; 8extern char __bss_start[], __bss_stop[];
9extern char __init_begin[], __init_end[]; 9extern char __init_begin[], __init_end[];
10extern char _sinittext[], _einittext[]; 10extern char _sinittext[], _einittext[];
11extern char _sextratext[] __attribute__((weak));
12extern char _eextratext[] __attribute__((weak));
13extern char _end[]; 11extern char _end[];
14extern char __per_cpu_start[], __per_cpu_end[]; 12extern char __per_cpu_start[], __per_cpu_end[];
15extern char __kprobes_text_start[], __kprobes_text_end[]; 13extern char __kprobes_text_start[], __kprobes_text_end[];
diff --git a/include/asm-h8300/io.h b/include/asm-h8300/io.h
index 7543a57b4ea1..26dc6ccd9441 100644
--- a/include/asm-h8300/io.h
+++ b/include/asm-h8300/io.h
@@ -302,8 +302,6 @@ static __inline__ void ctrl_outl(unsigned long b, unsigned long addr)
302/* 302/*
303 * Macros used for converting between virtual and physical mappings. 303 * Macros used for converting between virtual and physical mappings.
304 */ 304 */
305#define mm_ptov(vaddr) ((void *) (vaddr))
306#define mm_vtop(vaddr) ((unsigned long) (vaddr))
307#define phys_to_virt(vaddr) ((void *) (vaddr)) 305#define phys_to_virt(vaddr) ((void *) (vaddr))
308#define virt_to_phys(vaddr) ((unsigned long) (vaddr)) 306#define virt_to_phys(vaddr) ((unsigned long) (vaddr))
309 307
diff --git a/include/asm-h8300/virtconvert.h b/include/asm-h8300/virtconvert.h
index ee7d5ea10065..19cfd62b11c3 100644
--- a/include/asm-h8300/virtconvert.h
+++ b/include/asm-h8300/virtconvert.h
@@ -10,8 +10,6 @@
10#include <asm/setup.h> 10#include <asm/setup.h>
11#include <asm/page.h> 11#include <asm/page.h>
12 12
13#define mm_ptov(vaddr) ((void *) (vaddr))
14#define mm_vtop(vaddr) ((unsigned long) (vaddr))
15#define phys_to_virt(vaddr) ((void *) (vaddr)) 13#define phys_to_virt(vaddr) ((void *) (vaddr))
16#define virt_to_phys(vaddr) ((unsigned long) (vaddr)) 14#define virt_to_phys(vaddr) ((unsigned long) (vaddr))
17 15
diff --git a/include/asm-ia64/bitops.h b/include/asm-ia64/bitops.h
index a1b9719f5fbb..953d3df9dd22 100644
--- a/include/asm-ia64/bitops.h
+++ b/include/asm-ia64/bitops.h
@@ -122,38 +122,40 @@ clear_bit_unlock (int nr, volatile void *addr)
122} 122}
123 123
124/** 124/**
125 * __clear_bit_unlock - Non-atomically clear a bit with release 125 * __clear_bit_unlock - Non-atomically clears a bit in memory with release
126 * @nr: Bit to clear
127 * @addr: Address to start counting from
126 * 128 *
127 * This is like clear_bit_unlock, but the implementation uses a store 129 * Similarly to clear_bit_unlock, the implementation uses a store
128 * with release semantics. See also __raw_spin_unlock(). 130 * with release semantics. See also __raw_spin_unlock().
129 */ 131 */
130static __inline__ void 132static __inline__ void
131__clear_bit_unlock(int nr, volatile void *addr) 133__clear_bit_unlock(int nr, void *addr)
132{ 134{
133 __u32 mask, new; 135 __u32 * const m = (__u32 *) addr + (nr >> 5);
134 volatile __u32 *m; 136 __u32 const new = *m & ~(1 << (nr & 31));
135 137
136 m = (volatile __u32 *)addr + (nr >> 5);
137 mask = ~(1 << (nr & 31));
138 new = *m & mask;
139 barrier();
140 ia64_st4_rel_nta(m, new); 138 ia64_st4_rel_nta(m, new);
141} 139}
142 140
143/** 141/**
144 * __clear_bit - Clears a bit in memory (non-atomic version) 142 * __clear_bit - Clears a bit in memory (non-atomic version)
143 * @nr: the bit to clear
144 * @addr: the address to start counting from
145 *
146 * Unlike clear_bit(), this function is non-atomic and may be reordered.
147 * If it's called on the same region of memory simultaneously, the effect
148 * may be that only one operation succeeds.
145 */ 149 */
146static __inline__ void 150static __inline__ void
147__clear_bit (int nr, volatile void *addr) 151__clear_bit (int nr, volatile void *addr)
148{ 152{
149 volatile __u32 *p = (__u32 *) addr + (nr >> 5); 153 *((__u32 *) addr + (nr >> 5)) &= ~(1 << (nr & 31));
150 __u32 m = 1 << (nr & 31);
151 *p &= ~m;
152} 154}
153 155
154/** 156/**
155 * change_bit - Toggle a bit in memory 157 * change_bit - Toggle a bit in memory
156 * @nr: Bit to clear 158 * @nr: Bit to toggle
157 * @addr: Address to start counting from 159 * @addr: Address to start counting from
158 * 160 *
159 * change_bit() is atomic and may not be reordered. 161 * change_bit() is atomic and may not be reordered.
@@ -178,7 +180,7 @@ change_bit (int nr, volatile void *addr)
178 180
179/** 181/**
180 * __change_bit - Toggle a bit in memory 182 * __change_bit - Toggle a bit in memory
181 * @nr: the bit to set 183 * @nr: the bit to toggle
182 * @addr: the address to start counting from 184 * @addr: the address to start counting from
183 * 185 *
184 * Unlike change_bit(), this function is non-atomic and may be reordered. 186 * Unlike change_bit(), this function is non-atomic and may be reordered.
@@ -197,7 +199,7 @@ __change_bit (int nr, volatile void *addr)
197 * @addr: Address to count from 199 * @addr: Address to count from
198 * 200 *
199 * This operation is atomic and cannot be reordered. 201 * This operation is atomic and cannot be reordered.
200 * It also implies a memory barrier. 202 * It also implies the acquisition side of the memory barrier.
201 */ 203 */
202static __inline__ int 204static __inline__ int
203test_and_set_bit (int nr, volatile void *addr) 205test_and_set_bit (int nr, volatile void *addr)
@@ -247,11 +249,11 @@ __test_and_set_bit (int nr, volatile void *addr)
247 249
248/** 250/**
249 * test_and_clear_bit - Clear a bit and return its old value 251 * test_and_clear_bit - Clear a bit and return its old value
250 * @nr: Bit to set 252 * @nr: Bit to clear
251 * @addr: Address to count from 253 * @addr: Address to count from
252 * 254 *
253 * This operation is atomic and cannot be reordered. 255 * This operation is atomic and cannot be reordered.
254 * It also implies a memory barrier. 256 * It also implies the acquisition side of the memory barrier.
255 */ 257 */
256static __inline__ int 258static __inline__ int
257test_and_clear_bit (int nr, volatile void *addr) 259test_and_clear_bit (int nr, volatile void *addr)
@@ -272,7 +274,7 @@ test_and_clear_bit (int nr, volatile void *addr)
272 274
273/** 275/**
274 * __test_and_clear_bit - Clear a bit and return its old value 276 * __test_and_clear_bit - Clear a bit and return its old value
275 * @nr: Bit to set 277 * @nr: Bit to clear
276 * @addr: Address to count from 278 * @addr: Address to count from
277 * 279 *
278 * This operation is non-atomic and can be reordered. 280 * This operation is non-atomic and can be reordered.
@@ -292,11 +294,11 @@ __test_and_clear_bit(int nr, volatile void * addr)
292 294
293/** 295/**
294 * test_and_change_bit - Change a bit and return its old value 296 * test_and_change_bit - Change a bit and return its old value
295 * @nr: Bit to set 297 * @nr: Bit to change
296 * @addr: Address to count from 298 * @addr: Address to count from
297 * 299 *
298 * This operation is atomic and cannot be reordered. 300 * This operation is atomic and cannot be reordered.
299 * It also implies a memory barrier. 301 * It also implies the acquisition side of the memory barrier.
300 */ 302 */
301static __inline__ int 303static __inline__ int
302test_and_change_bit (int nr, volatile void *addr) 304test_and_change_bit (int nr, volatile void *addr)
@@ -315,8 +317,12 @@ test_and_change_bit (int nr, volatile void *addr)
315 return (old & bit) != 0; 317 return (old & bit) != 0;
316} 318}
317 319
318/* 320/**
319 * WARNING: non atomic version. 321 * __test_and_change_bit - Change a bit and return its old value
322 * @nr: Bit to change
323 * @addr: Address to count from
324 *
325 * This operation is non-atomic and can be reordered.
320 */ 326 */
321static __inline__ int 327static __inline__ int
322__test_and_change_bit (int nr, void *addr) 328__test_and_change_bit (int nr, void *addr)
diff --git a/include/asm-ia64/gcc_intrin.h b/include/asm-ia64/gcc_intrin.h
index 5b6665c754c9..de2ed2cbdd84 100644
--- a/include/asm-ia64/gcc_intrin.h
+++ b/include/asm-ia64/gcc_intrin.h
@@ -24,7 +24,9 @@
24extern void ia64_bad_param_for_setreg (void); 24extern void ia64_bad_param_for_setreg (void);
25extern void ia64_bad_param_for_getreg (void); 25extern void ia64_bad_param_for_getreg (void);
26 26
27#ifdef __KERNEL__
27register unsigned long ia64_r13 asm ("r13") __used; 28register unsigned long ia64_r13 asm ("r13") __used;
29#endif
28 30
29#define ia64_setreg(regnum, val) \ 31#define ia64_setreg(regnum, val) \
30({ \ 32({ \
diff --git a/include/asm-ia64/mca.h b/include/asm-ia64/mca.h
index 823553bf12e6..f1663aa94a52 100644
--- a/include/asm-ia64/mca.h
+++ b/include/asm-ia64/mca.h
@@ -3,9 +3,9 @@
3 * Purpose: Machine check handling specific defines 3 * Purpose: Machine check handling specific defines
4 * 4 *
5 * Copyright (C) 1999, 2004 Silicon Graphics, Inc. 5 * Copyright (C) 1999, 2004 Silicon Graphics, Inc.
6 * Copyright (C) Vijay Chander (vijay@engr.sgi.com) 6 * Copyright (C) Vijay Chander <vijay@engr.sgi.com>
7 * Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com) 7 * Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com>
8 * Copyright (C) Russ Anderson (rja@sgi.com) 8 * Copyright (C) Russ Anderson <rja@sgi.com>
9 */ 9 */
10 10
11#ifndef _ASM_IA64_MCA_H 11#ifndef _ASM_IA64_MCA_H
diff --git a/include/asm-ia64/mca_asm.h b/include/asm-ia64/mca_asm.h
index 76203f9a8718..dd2a5b134390 100644
--- a/include/asm-ia64/mca_asm.h
+++ b/include/asm-ia64/mca_asm.h
@@ -1,8 +1,9 @@
1/* 1/*
2 * File: mca_asm.h 2 * File: mca_asm.h
3 * Purpose: Machine check handling specific defines
3 * 4 *
4 * Copyright (C) 1999 Silicon Graphics, Inc. 5 * Copyright (C) 1999 Silicon Graphics, Inc.
5 * Copyright (C) Vijay Chander (vijay@engr.sgi.com) 6 * Copyright (C) Vijay Chander <vijay@engr.sgi.com>
6 * Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com> 7 * Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com>
7 * Copyright (C) 2000 Hewlett-Packard Co. 8 * Copyright (C) 2000 Hewlett-Packard Co.
8 * Copyright (C) 2000 David Mosberger-Tang <davidm@hpl.hp.com> 9 * Copyright (C) 2000 David Mosberger-Tang <davidm@hpl.hp.com>
diff --git a/include/asm-ia64/pgalloc.h b/include/asm-ia64/pgalloc.h
index 67552cad5173..556d988123ac 100644
--- a/include/asm-ia64/pgalloc.h
+++ b/include/asm-ia64/pgalloc.h
@@ -27,7 +27,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
27 return quicklist_alloc(0, GFP_KERNEL, NULL); 27 return quicklist_alloc(0, GFP_KERNEL, NULL);
28} 28}
29 29
30static inline void pgd_free(pgd_t * pgd) 30static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
31{ 31{
32 quicklist_free(0, NULL, pgd); 32 quicklist_free(0, NULL, pgd);
33} 33}
@@ -44,11 +44,11 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
44 return quicklist_alloc(0, GFP_KERNEL, NULL); 44 return quicklist_alloc(0, GFP_KERNEL, NULL);
45} 45}
46 46
47static inline void pud_free(pud_t * pud) 47static inline void pud_free(struct mm_struct *mm, pud_t *pud)
48{ 48{
49 quicklist_free(0, NULL, pud); 49 quicklist_free(0, NULL, pud);
50} 50}
51#define __pud_free_tlb(tlb, pud) pud_free(pud) 51#define __pud_free_tlb(tlb, pud) pud_free((tlb)->mm, pud)
52#endif /* CONFIG_PGTABLE_4 */ 52#endif /* CONFIG_PGTABLE_4 */
53 53
54static inline void 54static inline void
@@ -62,12 +62,12 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
62 return quicklist_alloc(0, GFP_KERNEL, NULL); 62 return quicklist_alloc(0, GFP_KERNEL, NULL);
63} 63}
64 64
65static inline void pmd_free(pmd_t * pmd) 65static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
66{ 66{
67 quicklist_free(0, NULL, pmd); 67 quicklist_free(0, NULL, pmd);
68} 68}
69 69
70#define __pmd_free_tlb(tlb, pmd) pmd_free(pmd) 70#define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd)
71 71
72static inline void 72static inline void
73pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, struct page *pte) 73pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, struct page *pte)
@@ -94,12 +94,12 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
94 return quicklist_alloc(0, GFP_KERNEL, NULL); 94 return quicklist_alloc(0, GFP_KERNEL, NULL);
95} 95}
96 96
97static inline void pte_free(struct page *pte) 97static inline void pte_free(struct mm_struct *mm, struct page *pte)
98{ 98{
99 quicklist_free_page(0, NULL, pte); 99 quicklist_free_page(0, NULL, pte);
100} 100}
101 101
102static inline void pte_free_kernel(pte_t * pte) 102static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
103{ 103{
104 quicklist_free(0, NULL, pte); 104 quicklist_free(0, NULL, pte);
105} 105}
@@ -109,6 +109,6 @@ static inline void check_pgt_cache(void)
109 quicklist_trim(0, NULL, 25, 16); 109 quicklist_trim(0, NULL, 25, 16);
110} 110}
111 111
112#define __pte_free_tlb(tlb, pte) pte_free(pte) 112#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte)
113 113
114#endif /* _ASM_IA64_PGALLOC_H */ 114#endif /* _ASM_IA64_PGALLOC_H */
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index be3b0ae43270..741f7ecb986a 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -31,7 +31,8 @@
31 * each (assuming 8KB page size), for a total of 8TB of user virtual 31 * each (assuming 8KB page size), for a total of 8TB of user virtual
32 * address space. 32 * address space.
33 */ 33 */
34#define TASK_SIZE (current->thread.task_size) 34#define TASK_SIZE_OF(tsk) ((tsk)->thread.task_size)
35#define TASK_SIZE TASK_SIZE_OF(current)
35 36
36/* 37/*
37 * This decides where the kernel will search for a free chunk of vm 38 * This decides where the kernel will search for a free chunk of vm
@@ -472,7 +473,7 @@ ia64_set_psr (__u64 psr)
472{ 473{
473 ia64_stop(); 474 ia64_stop();
474 ia64_setreg(_IA64_REG_PSR_L, psr); 475 ia64_setreg(_IA64_REG_PSR_L, psr);
475 ia64_srlz_d(); 476 ia64_srlz_i();
476} 477}
477 478
478/* 479/*
diff --git a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h
index 1f5412d6f9bb..2251118894ae 100644
--- a/include/asm-ia64/sal.h
+++ b/include/asm-ia64/sal.h
@@ -649,17 +649,6 @@ typedef struct err_rec {
649 * Now define a couple of inline functions for improved type checking 649 * Now define a couple of inline functions for improved type checking
650 * and convenience. 650 * and convenience.
651 */ 651 */
652static inline long
653ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second,
654 unsigned long *drift_info)
655{
656 struct ia64_sal_retval isrv;
657
658 SAL_CALL(isrv, SAL_FREQ_BASE, which, 0, 0, 0, 0, 0, 0);
659 *ticks_per_second = isrv.v0;
660 *drift_info = isrv.v1;
661 return isrv.status;
662}
663 652
664extern s64 ia64_sal_cache_flush (u64 cache_type); 653extern s64 ia64_sal_cache_flush (u64 cache_type);
665extern void __init check_sal_cache_flush (void); 654extern void __init check_sal_cache_flush (void);
@@ -841,6 +830,9 @@ extern int ia64_sal_oemcall_nolock(struct ia64_sal_retval *, u64, u64, u64,
841 u64, u64, u64, u64, u64); 830 u64, u64, u64, u64, u64);
842extern int ia64_sal_oemcall_reentrant(struct ia64_sal_retval *, u64, u64, u64, 831extern int ia64_sal_oemcall_reentrant(struct ia64_sal_retval *, u64, u64, u64,
843 u64, u64, u64, u64, u64); 832 u64, u64, u64, u64, u64);
833extern long
834ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second,
835 unsigned long *drift_info);
844#ifdef CONFIG_HOTPLUG_CPU 836#ifdef CONFIG_HOTPLUG_CPU
845/* 837/*
846 * System Abstraction Layer Specification 838 * System Abstraction Layer Specification
diff --git a/include/asm-m32r/delay.h b/include/asm-m32r/delay.h
index 164448d23850..9dd9e999ea69 100644
--- a/include/asm-m32r/delay.h
+++ b/include/asm-m32r/delay.h
@@ -12,7 +12,7 @@ extern void __bad_ndelay(void);
12 12
13extern void __udelay(unsigned long usecs); 13extern void __udelay(unsigned long usecs);
14extern void __ndelay(unsigned long nsecs); 14extern void __ndelay(unsigned long nsecs);
15extern void __const_udelay(unsigned long usecs); 15extern void __const_udelay(unsigned long xloops);
16extern void __delay(unsigned long loops); 16extern void __delay(unsigned long loops);
17 17
18#define udelay(n) (__builtin_constant_p(n) ? \ 18#define udelay(n) (__builtin_constant_p(n) ? \
diff --git a/include/asm-m32r/irq.h b/include/asm-m32r/irq.h
index 2f93f4743add..242028b4d86a 100644
--- a/include/asm-m32r/irq.h
+++ b/include/asm-m32r/irq.h
@@ -3,7 +3,7 @@
3#define _ASM_M32R_IRQ_H 3#define _ASM_M32R_IRQ_H
4 4
5 5
6#if defined(CONFIG_PLAT_M32700UT_Alpha) || defined(CONFIG_PLAT_USRV) 6#if defined(CONFIG_PLAT_USRV)
7/* 7/*
8 * IRQ definitions for M32700UT 8 * IRQ definitions for M32700UT
9 * M32700 Chip: 64 interrupts 9 * M32700 Chip: 64 interrupts
diff --git a/include/asm-m32r/m32700ut/m32700ut_pld.h b/include/asm-m32r/m32700ut/m32700ut_pld.h
index d39121279a1a..57623beb44cb 100644
--- a/include/asm-m32r/m32700ut/m32700ut_pld.h
+++ b/include/asm-m32r/m32700ut/m32700ut_pld.h
@@ -13,9 +13,7 @@
13 * this archive for more details. 13 * this archive for more details.
14 */ 14 */
15 15
16#if defined(CONFIG_PLAT_M32700UT_Alpha) 16#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV)
17#define PLD_PLAT_BASE 0x08c00000
18#elif defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_USRV)
19#define PLD_PLAT_BASE 0x04c00000 17#define PLD_PLAT_BASE 0x04c00000
20#else 18#else
21#error "no platform configuration" 19#error "no platform configuration"
diff --git a/include/asm-m32r/pgalloc.h b/include/asm-m32r/pgalloc.h
index 943ba63c1ebc..e5921adfad1b 100644
--- a/include/asm-m32r/pgalloc.h
+++ b/include/asm-m32r/pgalloc.h
@@ -24,7 +24,7 @@ static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm)
24 return pgd; 24 return pgd;
25} 25}
26 26
27static __inline__ void pgd_free(pgd_t *pgd) 27static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
28{ 28{
29 free_page((unsigned long)pgd); 29 free_page((unsigned long)pgd);
30} 30}
@@ -46,17 +46,17 @@ static __inline__ struct page *pte_alloc_one(struct mm_struct *mm,
46 return pte; 46 return pte;
47} 47}
48 48
49static __inline__ void pte_free_kernel(pte_t *pte) 49static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
50{ 50{
51 free_page((unsigned long)pte); 51 free_page((unsigned long)pte);
52} 52}
53 53
54static __inline__ void pte_free(struct page *pte) 54static inline void pte_free(struct mm_struct *mm, struct page *pte)
55{ 55{
56 __free_page(pte); 56 __free_page(pte);
57} 57}
58 58
59#define __pte_free_tlb(tlb, pte) pte_free((pte)) 59#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte))
60 60
61/* 61/*
62 * allocating and freeing a pmd is trivial: the 1-entry pmd is 62 * allocating and freeing a pmd is trivial: the 1-entry pmd is
@@ -65,7 +65,7 @@ static __inline__ void pte_free(struct page *pte)
65 */ 65 */
66 66
67#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) 67#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); })
68#define pmd_free(x) do { } while (0) 68#define pmd_free(mm, x) do { } while (0)
69#define __pmd_free_tlb(tlb, x) do { } while (0) 69#define __pmd_free_tlb(tlb, x) do { } while (0)
70#define pgd_populate(mm, pmd, pte) BUG() 70#define pgd_populate(mm, pmd, pte) BUG()
71 71
diff --git a/include/asm-m32r/unistd.h b/include/asm-m32r/unistd.h
index f467eac9ba70..cf701c933249 100644
--- a/include/asm-m32r/unistd.h
+++ b/include/asm-m32r/unistd.h
@@ -327,7 +327,7 @@
327#define __NR_epoll_pwait 319 327#define __NR_epoll_pwait 319
328#define __NR_utimensat 320 328#define __NR_utimensat 320
329#define __NR_signalfd 321 329#define __NR_signalfd 321
330#define __NR_timerfd 322 330/* #define __NR_timerfd 322 removed */
331#define __NR_eventfd 323 331#define __NR_eventfd 323
332#define __NR_fallocate 324 332#define __NR_fallocate 324
333 333
diff --git a/include/asm-m68k/macintosh.h b/include/asm-m68k/macintosh.h
index 27d11da2b479..28b0f49ee521 100644
--- a/include/asm-m68k/macintosh.h
+++ b/include/asm-m68k/macintosh.h
@@ -14,8 +14,6 @@ extern void mac_init_IRQ(void);
14extern int mac_irq_pending(unsigned int); 14extern int mac_irq_pending(unsigned int);
15extern void mac_identify(void); 15extern void mac_identify(void);
16extern void mac_report_hardware(void); 16extern void mac_report_hardware(void);
17extern void mac_debugging_penguin(int);
18extern void mac_boom(int);
19 17
20/* 18/*
21 * Floppy driver magic hook - probably shouldnt be here 19 * Floppy driver magic hook - probably shouldnt be here
diff --git a/include/asm-m68k/motorola_pgalloc.h b/include/asm-m68k/motorola_pgalloc.h
index 5158412cd54d..500ec9b8b189 100644
--- a/include/asm-m68k/motorola_pgalloc.h
+++ b/include/asm-m68k/motorola_pgalloc.h
@@ -22,7 +22,7 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long ad
22 return pte; 22 return pte;
23} 23}
24 24
25static inline void pte_free_kernel(pte_t *pte) 25static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
26{ 26{
27 cache_page(pte); 27 cache_page(pte);
28 free_page((unsigned long) pte); 28 free_page((unsigned long) pte);
@@ -47,7 +47,7 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add
47 return page; 47 return page;
48} 48}
49 49
50static inline void pte_free(struct page *page) 50static inline void pte_free(struct mm_struct *mm, struct page *page)
51{ 51{
52 cache_page(kmap(page)); 52 cache_page(kmap(page));
53 kunmap(page); 53 kunmap(page);
@@ -67,7 +67,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
67 return get_pointer_table(); 67 return get_pointer_table();
68} 68}
69 69
70static inline int pmd_free(pmd_t *pmd) 70static inline int pmd_free(struct mm_struct *mm, pmd_t *pmd)
71{ 71{
72 return free_pointer_table(pmd); 72 return free_pointer_table(pmd);
73} 73}
@@ -78,9 +78,9 @@ static inline int __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
78} 78}
79 79
80 80
81static inline void pgd_free(pgd_t *pgd) 81static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
82{ 82{
83 pmd_free((pmd_t *)pgd); 83 pmd_free(mm, (pmd_t *)pgd);
84} 84}
85 85
86static inline pgd_t *pgd_alloc(struct mm_struct *mm) 86static inline pgd_t *pgd_alloc(struct mm_struct *mm)
diff --git a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h
index 778a4c538eb2..0b604f0f192d 100644
--- a/include/asm-m68k/pgtable.h
+++ b/include/asm-m68k/pgtable.h
@@ -107,8 +107,6 @@ extern void *empty_zero_page;
107/* 64-bit machines, beware! SRB. */ 107/* 64-bit machines, beware! SRB. */
108#define SIZEOF_PTR_LOG2 2 108#define SIZEOF_PTR_LOG2 2
109 109
110#define mm_end_of_chunk(addr, len) 0
111
112extern void kernel_set_cachemode(void *addr, unsigned long size, int cmode); 110extern void kernel_set_cachemode(void *addr, unsigned long size, int cmode);
113 111
114/* 112/*
diff --git a/include/asm-m68k/sun3_pgalloc.h b/include/asm-m68k/sun3_pgalloc.h
index fd8241117649..a5a91e72714b 100644
--- a/include/asm-m68k/sun3_pgalloc.h
+++ b/include/asm-m68k/sun3_pgalloc.h
@@ -21,12 +21,12 @@ extern const char bad_pmd_string[];
21#define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) 21#define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); })
22 22
23 23
24static inline void pte_free_kernel(pte_t * pte) 24static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
25{ 25{
26 free_page((unsigned long) pte); 26 free_page((unsigned long) pte);
27} 27}
28 28
29static inline void pte_free(struct page *page) 29static inline void pte_free(struct mm_struct *mm, struct page *page)
30{ 30{
31 __free_page(page); 31 __free_page(page);
32} 32}
@@ -72,10 +72,10 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *p
72 * allocating and freeing a pmd is trivial: the 1-entry pmd is 72 * allocating and freeing a pmd is trivial: the 1-entry pmd is
73 * inside the pgd, so has no extra memory associated with it. 73 * inside the pgd, so has no extra memory associated with it.
74 */ 74 */
75#define pmd_free(x) do { } while (0) 75#define pmd_free(mm, x) do { } while (0)
76#define __pmd_free_tlb(tlb, x) do { } while (0) 76#define __pmd_free_tlb(tlb, x) do { } while (0)
77 77
78static inline void pgd_free(pgd_t * pgd) 78static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
79{ 79{
80 free_page((unsigned long) pgd); 80 free_page((unsigned long) pgd);
81} 81}
diff --git a/include/asm-m68knommu/io.h b/include/asm-m68knommu/io.h
index 653d9b2d7ddf..6adef1ee2082 100644
--- a/include/asm-m68knommu/io.h
+++ b/include/asm-m68knommu/io.h
@@ -172,8 +172,6 @@ extern void iounmap(void *addr);
172/* 172/*
173 * Macros used for converting between virtual and physical mappings. 173 * Macros used for converting between virtual and physical mappings.
174 */ 174 */
175#define mm_ptov(vaddr) ((void *) (vaddr))
176#define mm_vtop(vaddr) ((unsigned long) (vaddr))
177#define phys_to_virt(vaddr) ((void *) (vaddr)) 175#define phys_to_virt(vaddr) ((void *) (vaddr))
178#define virt_to_phys(vaddr) ((unsigned long) (vaddr)) 176#define virt_to_phys(vaddr) ((unsigned long) (vaddr))
179 177
diff --git a/include/asm-m68knommu/mcfne.h b/include/asm-m68knommu/mcfne.h
index c920ccdb61fe..431f63aadd0e 100644
--- a/include/asm-m68knommu/mcfne.h
+++ b/include/asm-m68knommu/mcfne.h
@@ -60,17 +60,6 @@
60#define NE2000_BYTE volatile unsigned char 60#define NE2000_BYTE volatile unsigned char
61#endif 61#endif
62 62
63#if defined(CONFIG_CFV240)
64#define NE2000_ADDR 0x40010000
65#define NE2000_ADDR1 0x40010001
66#define NE2000_ODDOFFSET 0x00000000
67#define NE2000_IRQ 1
68#define NE2000_IRQ_VECTOR 0x19
69#define NE2000_IRQ_PRIORITY 2
70#define NE2000_IRQ_LEVEL 1
71#define NE2000_BYTE volatile unsigned char
72#endif
73
74#if defined(CONFIG_M5307C3) 63#if defined(CONFIG_M5307C3)
75#define NE2000_ADDR 0x40000300 64#define NE2000_ADDR 0x40000300
76#define NE2000_ODDOFFSET 0x00010000 65#define NE2000_ODDOFFSET 0x00010000
@@ -173,13 +162,8 @@ void ne2000_outsw(unsigned int addr, void *vbuf, unsigned long len);
173 * On most NE2000 implementations on ColdFire boards the chip is 162 * On most NE2000 implementations on ColdFire boards the chip is
174 * mapped in kinda funny, due to its ISA heritage. 163 * mapped in kinda funny, due to its ISA heritage.
175 */ 164 */
176#ifdef CONFIG_CFV240
177#define NE2000_PTR(addr) (NE2000_ADDR + ((addr & 0x3f) << 1) + 1)
178#define NE2000_DATA_PTR(addr) (NE2000_ADDR + ((addr & 0x3f) << 1))
179#else
180#define NE2000_PTR(addr) ((addr&0x1)?(NE2000_ODDOFFSET+addr-1):(addr)) 165#define NE2000_PTR(addr) ((addr&0x1)?(NE2000_ODDOFFSET+addr-1):(addr))
181#define NE2000_DATA_PTR(addr) (addr) 166#define NE2000_DATA_PTR(addr) (addr)
182#endif
183 167
184 168
185void ne2000_outb(unsigned int val, unsigned int addr) 169void ne2000_outb(unsigned int val, unsigned int addr)
@@ -285,17 +269,6 @@ void ne2000_irqsetup(int irq)
285} 269}
286#endif 270#endif
287 271
288#if defined(CONFIG_CFV240)
289void ne2000_irqsetup(int irq)
290{
291 volatile unsigned char *icrp;
292
293 icrp = (volatile unsigned char *) (MCF_MBAR + MCFSIM_ICR1);
294 *icrp = MCFSIM_ICR_LEVEL1 | MCFSIM_ICR_PRI2 | MCFSIM_ICR_AUTOVEC;
295 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_EINT1);
296}
297#endif
298
299#if defined(CONFIG_M5206e) && defined(CONFIG_NETtel) 272#if defined(CONFIG_M5206e) && defined(CONFIG_NETtel)
300void ne2000_irqsetup(int irq) 273void ne2000_irqsetup(int irq)
301{ 274{
diff --git a/include/asm-m68knommu/mcfsim.h b/include/asm-m68knommu/mcfsim.h
index 1074ae717f74..da3f2ceff3a4 100644
--- a/include/asm-m68knommu/mcfsim.h
+++ b/include/asm-m68knommu/mcfsim.h
@@ -17,9 +17,7 @@
17 * Include 5204, 5206/e, 5235, 5249, 5270/5271, 5272, 5280/5282, 17 * Include 5204, 5206/e, 5235, 5249, 5270/5271, 5272, 5280/5282,
18 * 5307 or 5407 specific addresses. 18 * 5307 or 5407 specific addresses.
19 */ 19 */
20#if defined(CONFIG_M5204) 20#if defined(CONFIG_M5206) || defined(CONFIG_M5206e)
21#include <asm/m5204sim.h>
22#elif defined(CONFIG_M5206) || defined(CONFIG_M5206e)
23#include <asm/m5206sim.h> 21#include <asm/m5206sim.h>
24#elif defined(CONFIG_M520x) 22#elif defined(CONFIG_M520x)
25#include <asm/m520xsim.h> 23#include <asm/m520xsim.h>
diff --git a/include/asm-m68knommu/mcftimer.h b/include/asm-m68knommu/mcftimer.h
index 6f4d796e03db..0f90f6d2227a 100644
--- a/include/asm-m68knommu/mcftimer.h
+++ b/include/asm-m68knommu/mcftimer.h
@@ -16,7 +16,7 @@
16/* 16/*
17 * Get address specific defines for this ColdFire member. 17 * Get address specific defines for this ColdFire member.
18 */ 18 */
19#if defined(CONFIG_M5204) || defined(CONFIG_M5206) || defined(CONFIG_M5206e) 19#if defined(CONFIG_M5206) || defined(CONFIG_M5206e)
20#define MCFTIMER_BASE1 0x100 /* Base address of TIMER1 */ 20#define MCFTIMER_BASE1 0x100 /* Base address of TIMER1 */
21#define MCFTIMER_BASE2 0x120 /* Base address of TIMER2 */ 21#define MCFTIMER_BASE2 0x120 /* Base address of TIMER2 */
22#elif defined(CONFIG_M5272) 22#elif defined(CONFIG_M5272)
diff --git a/include/asm-m68knommu/mcfuart.h b/include/asm-m68knommu/mcfuart.h
index 8a7a67703ac3..ef2293873612 100644
--- a/include/asm-m68knommu/mcfuart.h
+++ b/include/asm-m68knommu/mcfuart.h
@@ -19,7 +19,7 @@
19#if defined(CONFIG_M5272) 19#if defined(CONFIG_M5272)
20#define MCFUART_BASE1 0x100 /* Base address of UART1 */ 20#define MCFUART_BASE1 0x100 /* Base address of UART1 */
21#define MCFUART_BASE2 0x140 /* Base address of UART2 */ 21#define MCFUART_BASE2 0x140 /* Base address of UART2 */
22#elif defined(CONFIG_M5204) || defined(CONFIG_M5206) || defined(CONFIG_M5206e) 22#elif defined(CONFIG_M5206) || defined(CONFIG_M5206e)
23#if defined(CONFIG_NETtel) 23#if defined(CONFIG_NETtel)
24#define MCFUART_BASE1 0x180 /* Base address of UART1 */ 24#define MCFUART_BASE1 0x180 /* Base address of UART1 */
25#define MCFUART_BASE2 0x140 /* Base address of UART2 */ 25#define MCFUART_BASE2 0x140 /* Base address of UART2 */
diff --git a/include/asm-m68knommu/system.h b/include/asm-m68knommu/system.h
index 15b4c7d45c94..ee2dc07bae0e 100644
--- a/include/asm-m68knommu/system.h
+++ b/include/asm-m68knommu/system.h
@@ -207,23 +207,6 @@ cmpxchg(volatile int *p, int old, int new)
207} 207}
208 208
209 209
210#ifdef CONFIG_M68332
211#define HARD_RESET_NOW() ({ \
212 local_irq_disable(); \
213 asm(" \
214 movew #0x0000, 0xfffa6a; \
215 reset; \
216 /*movew #0x1557, 0xfffa44;*/ \
217 /*movew #0x0155, 0xfffa46;*/ \
218 moveal #0, %a0; \
219 movec %a0, %vbr; \
220 moveal 0, %sp; \
221 moveal 4, %a0; \
222 jmp (%a0); \
223 "); \
224})
225#endif
226
227#if defined( CONFIG_M68328 ) || defined( CONFIG_M68EZ328 ) || \ 210#if defined( CONFIG_M68328 ) || defined( CONFIG_M68EZ328 ) || \
228 defined (CONFIG_M68360) || defined( CONFIG_M68VZ328 ) 211 defined (CONFIG_M68360) || defined( CONFIG_M68VZ328 )
229#define HARD_RESET_NOW() ({ \ 212#define HARD_RESET_NOW() ({ \
diff --git a/include/asm-mips/pgalloc.h b/include/asm-mips/pgalloc.h
index 81b72122207a..c4efeced8396 100644
--- a/include/asm-mips/pgalloc.h
+++ b/include/asm-mips/pgalloc.h
@@ -58,7 +58,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
58 return ret; 58 return ret;
59} 59}
60 60
61static inline void pgd_free(pgd_t *pgd) 61static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
62{ 62{
63 free_pages((unsigned long)pgd, PGD_ORDER); 63 free_pages((unsigned long)pgd, PGD_ORDER);
64} 64}
@@ -85,12 +85,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,
85 return pte; 85 return pte;
86} 86}
87 87
88static inline void pte_free_kernel(pte_t *pte) 88static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
89{ 89{
90 free_pages((unsigned long)pte, PTE_ORDER); 90 free_pages((unsigned long)pte, PTE_ORDER);
91} 91}
92 92
93static inline void pte_free(struct page *pte) 93static inline void pte_free(struct mm_struct *mm, struct page *pte)
94{ 94{
95 __free_pages(pte, PTE_ORDER); 95 __free_pages(pte, PTE_ORDER);
96} 96}
@@ -103,7 +103,7 @@ static inline void pte_free(struct page *pte)
103 * allocating and freeing a pmd is trivial: the 1-entry pmd is 103 * allocating and freeing a pmd is trivial: the 1-entry pmd is
104 * inside the pgd, so has no extra memory associated with it. 104 * inside the pgd, so has no extra memory associated with it.
105 */ 105 */
106#define pmd_free(x) do { } while (0) 106#define pmd_free(mm, x) do { } while (0)
107#define __pmd_free_tlb(tlb, x) do { } while (0) 107#define __pmd_free_tlb(tlb, x) do { } while (0)
108 108
109#endif 109#endif
@@ -120,12 +120,12 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
120 return pmd; 120 return pmd;
121} 121}
122 122
123static inline void pmd_free(pmd_t *pmd) 123static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
124{ 124{
125 free_pages((unsigned long)pmd, PMD_ORDER); 125 free_pages((unsigned long)pmd, PMD_ORDER);
126} 126}
127 127
128#define __pmd_free_tlb(tlb, x) pmd_free(x) 128#define __pmd_free_tlb(tlb, x) pmd_free((tlb)->mm, x)
129 129
130#endif 130#endif
131 131
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index 83bc94534084..36f42de59409 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -65,6 +65,8 @@ extern unsigned int vced_count, vcei_count;
65#define TASK_UNMAPPED_BASE \ 65#define TASK_UNMAPPED_BASE \
66 (test_thread_flag(TIF_32BIT_ADDR) ? \ 66 (test_thread_flag(TIF_32BIT_ADDR) ? \
67 PAGE_ALIGN(TASK_SIZE32 / 3) : PAGE_ALIGN(TASK_SIZE / 3)) 67 PAGE_ALIGN(TASK_SIZE32 / 3) : PAGE_ALIGN(TASK_SIZE / 3))
68#define TASK_SIZE_OF(tsk) \
69 (test_tsk_thread_flag(tsk, TIF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE)
68#endif 70#endif
69 71
70#define NUM_FPU_REGS 32 72#define NUM_FPU_REGS 32
diff --git a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h
index 1af1a41e0723..aab66f1bea14 100644
--- a/include/asm-parisc/pgalloc.h
+++ b/include/asm-parisc/pgalloc.h
@@ -43,7 +43,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
43 return actual_pgd; 43 return actual_pgd;
44} 44}
45 45
46static inline void pgd_free(pgd_t *pgd) 46static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
47{ 47{
48#ifdef CONFIG_64BIT 48#ifdef CONFIG_64BIT
49 pgd -= PTRS_PER_PGD; 49 pgd -= PTRS_PER_PGD;
@@ -70,7 +70,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
70 return pmd; 70 return pmd;
71} 71}
72 72
73static inline void pmd_free(pmd_t *pmd) 73static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
74{ 74{
75#ifdef CONFIG_64BIT 75#ifdef CONFIG_64BIT
76 if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED) 76 if(pmd_flag(*pmd) & PxD_FLAG_ATTACHED)
@@ -91,7 +91,7 @@ static inline void pmd_free(pmd_t *pmd)
91 */ 91 */
92 92
93#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) 93#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); })
94#define pmd_free(x) do { } while (0) 94#define pmd_free(mm, x) do { } while (0)
95#define pgd_populate(mm, pmd, pte) BUG() 95#define pgd_populate(mm, pmd, pte) BUG()
96 96
97#endif 97#endif
@@ -130,12 +130,12 @@ pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr)
130 return pte; 130 return pte;
131} 131}
132 132
133static inline void pte_free_kernel(pte_t *pte) 133static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
134{ 134{
135 free_page((unsigned long)pte); 135 free_page((unsigned long)pte);
136} 136}
137 137
138#define pte_free(page) pte_free_kernel(page_address(page)) 138#define pte_free(mm, page) pte_free_kernel(page_address(page))
139 139
140#define check_pgt_cache() do { } while (0) 140#define check_pgt_cache() do { } while (0)
141 141
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h
index 6b294fb07a23..3bb06e898fde 100644
--- a/include/asm-parisc/processor.h
+++ b/include/asm-parisc/processor.h
@@ -32,7 +32,8 @@
32#endif 32#endif
33#define current_text_addr() ({ void *pc; current_ia(pc); pc; }) 33#define current_text_addr() ({ void *pc; current_ia(pc); pc; })
34 34
35#define TASK_SIZE (current->thread.task_size) 35#define TASK_SIZE_OF(tsk) ((tsk)->thread.task_size)
36#define TASK_SIZE TASK_SIZE_OF(current)
36#define TASK_UNMAPPED_BASE (current->thread.map_base) 37#define TASK_UNMAPPED_BASE (current->thread.map_base)
37 38
38#define DEFAULT_TASK_SIZE32 (0xFFF00000UL) 39#define DEFAULT_TASK_SIZE32 (0xFFF00000UL)
diff --git a/include/asm-parisc/tlb.h b/include/asm-parisc/tlb.h
index 33107a248e1f..383b1db310ee 100644
--- a/include/asm-parisc/tlb.h
+++ b/include/asm-parisc/tlb.h
@@ -21,7 +21,7 @@ do { if (!(tlb)->fullmm) \
21 21
22#include <asm-generic/tlb.h> 22#include <asm-generic/tlb.h>
23 23
24#define __pmd_free_tlb(tlb, pmd) pmd_free(pmd) 24#define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd)
25#define __pte_free_tlb(tlb, pte) pte_free(pte) 25#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte)
26 26
27#endif 27#endif
diff --git a/include/asm-powerpc/cputime.h b/include/asm-powerpc/cputime.h
index 310804485208..f42e623030ee 100644
--- a/include/asm-powerpc/cputime.h
+++ b/include/asm-powerpc/cputime.h
@@ -52,12 +52,26 @@ typedef u64 cputime64_t;
52 * Convert cputime <-> jiffies 52 * Convert cputime <-> jiffies
53 */ 53 */
54extern u64 __cputime_jiffies_factor; 54extern u64 __cputime_jiffies_factor;
55DECLARE_PER_CPU(unsigned long, cputime_last_delta);
56DECLARE_PER_CPU(unsigned long, cputime_scaled_last_delta);
55 57
56static inline unsigned long cputime_to_jiffies(const cputime_t ct) 58static inline unsigned long cputime_to_jiffies(const cputime_t ct)
57{ 59{
58 return mulhdu(ct, __cputime_jiffies_factor); 60 return mulhdu(ct, __cputime_jiffies_factor);
59} 61}
60 62
63/* Estimate the scaled cputime by scaling the real cputime based on
64 * the last scaled to real ratio */
65static inline cputime_t cputime_to_scaled(const cputime_t ct)
66{
67 if (cpu_has_feature(CPU_FTR_SPURR) &&
68 per_cpu(cputime_last_delta, smp_processor_id()))
69 return ct *
70 per_cpu(cputime_scaled_last_delta, smp_processor_id())/
71 per_cpu(cputime_last_delta, smp_processor_id());
72 return ct;
73}
74
61static inline cputime_t jiffies_to_cputime(const unsigned long jif) 75static inline cputime_t jiffies_to_cputime(const unsigned long jif)
62{ 76{
63 cputime_t ct; 77 cputime_t ct;
diff --git a/include/asm-powerpc/dma.h b/include/asm-powerpc/dma.h
index 7a4374bdbef4..a7e06e25c708 100644
--- a/include/asm-powerpc/dma.h
+++ b/include/asm-powerpc/dma.h
@@ -93,16 +93,6 @@
93 * 93 *
94 */ 94 */
95 95
96/* see prep_setup_arch() for detailed informations */
97#if defined(CONFIG_SOUND_CS4232) && defined(CONFIG_PPC_PREP)
98extern long ppc_cs4232_dma, ppc_cs4232_dma2;
99#define SND_DMA1 ppc_cs4232_dma
100#define SND_DMA2 ppc_cs4232_dma2
101#else
102#define SND_DMA1 -1
103#define SND_DMA2 -1
104#endif
105
106/* 8237 DMA controllers */ 96/* 8237 DMA controllers */
107#define IO_DMA1_BASE 0x00 /* 8 bit slave DMA, channels 0..3 */ 97#define IO_DMA1_BASE 0x00 /* 8 bit slave DMA, channels 0..3 */
108#define IO_DMA2_BASE 0xC0 /* 16 bit master DMA, ch 4(=slave input)..7 */ 98#define IO_DMA2_BASE 0xC0 /* 16 bit master DMA, ch 4(=slave input)..7 */
@@ -269,24 +259,15 @@ static __inline__ void set_dma_page(unsigned int dmanr, int pagenr)
269 dma_outb(pagenr >> 8, DMA_HI_PAGE_3); 259 dma_outb(pagenr >> 8, DMA_HI_PAGE_3);
270 break; 260 break;
271 case 5: 261 case 5:
272 if (SND_DMA1 == 5 || SND_DMA2 == 5) 262 dma_outb(pagenr & 0xfe, DMA_LO_PAGE_5);
273 dma_outb(pagenr, DMA_LO_PAGE_5);
274 else
275 dma_outb(pagenr & 0xfe, DMA_LO_PAGE_5);
276 dma_outb(pagenr >> 8, DMA_HI_PAGE_5); 263 dma_outb(pagenr >> 8, DMA_HI_PAGE_5);
277 break; 264 break;
278 case 6: 265 case 6:
279 if (SND_DMA1 == 6 || SND_DMA2 == 6) 266 dma_outb(pagenr & 0xfe, DMA_LO_PAGE_6);
280 dma_outb(pagenr, DMA_LO_PAGE_6);
281 else
282 dma_outb(pagenr & 0xfe, DMA_LO_PAGE_6);
283 dma_outb(pagenr >> 8, DMA_HI_PAGE_6); 267 dma_outb(pagenr >> 8, DMA_HI_PAGE_6);
284 break; 268 break;
285 case 7: 269 case 7:
286 if (SND_DMA1 == 7 || SND_DMA2 == 7) 270 dma_outb(pagenr & 0xfe, DMA_LO_PAGE_7);
287 dma_outb(pagenr, DMA_LO_PAGE_7);
288 else
289 dma_outb(pagenr & 0xfe, DMA_LO_PAGE_7);
290 dma_outb(pagenr >> 8, DMA_HI_PAGE_7); 271 dma_outb(pagenr >> 8, DMA_HI_PAGE_7);
291 break; 272 break;
292 } 273 }
@@ -302,12 +283,6 @@ static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int phys)
302 ((dmanr & 3) << 1) + IO_DMA1_BASE); 283 ((dmanr & 3) << 1) + IO_DMA1_BASE);
303 dma_outb((phys >> 8) & 0xff, 284 dma_outb((phys >> 8) & 0xff,
304 ((dmanr & 3) << 1) + IO_DMA1_BASE); 285 ((dmanr & 3) << 1) + IO_DMA1_BASE);
305 } else if (dmanr == SND_DMA1 || dmanr == SND_DMA2) {
306 dma_outb(phys & 0xff,
307 ((dmanr & 3) << 2) + IO_DMA2_BASE);
308 dma_outb((phys >> 8) & 0xff,
309 ((dmanr & 3) << 2) + IO_DMA2_BASE);
310 dma_outb((dmanr & 3), DMA2_EXT_REG);
311 } else { 286 } else {
312 dma_outb((phys >> 1) & 0xff, 287 dma_outb((phys >> 1) & 0xff,
313 ((dmanr & 3) << 2) + IO_DMA2_BASE); 288 ((dmanr & 3) << 2) + IO_DMA2_BASE);
@@ -334,11 +309,6 @@ static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
334 ((dmanr & 3) << 1) + 1 + IO_DMA1_BASE); 309 ((dmanr & 3) << 1) + 1 + IO_DMA1_BASE);
335 dma_outb((count >> 8) & 0xff, 310 dma_outb((count >> 8) & 0xff,
336 ((dmanr & 3) << 1) + 1 + IO_DMA1_BASE); 311 ((dmanr & 3) << 1) + 1 + IO_DMA1_BASE);
337 } else if (dmanr == SND_DMA1 || dmanr == SND_DMA2) {
338 dma_outb(count & 0xff,
339 ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE);
340 dma_outb((count >> 8) & 0xff,
341 ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE);
342 } else { 312 } else {
343 dma_outb((count >> 1) & 0xff, 313 dma_outb((count >> 1) & 0xff,
344 ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE); 314 ((dmanr & 3) << 2) + 2 + IO_DMA2_BASE);
@@ -368,8 +338,7 @@ static __inline__ int get_dma_residue(unsigned int dmanr)
368 count = 1 + dma_inb(io_port); 338 count = 1 + dma_inb(io_port);
369 count += dma_inb(io_port) << 8; 339 count += dma_inb(io_port) << 8;
370 340
371 return (dmanr <= 3 || dmanr == SND_DMA1 || dmanr == SND_DMA2) 341 return (dmanr <= 3) ? count : (count << 1);
372 ? count : (count << 1);
373} 342}
374 343
375/* These are in kernel/dma.c: */ 344/* These are in kernel/dma.c: */
diff --git a/include/asm-powerpc/iommu.h b/include/asm-powerpc/iommu.h
index 7a3cef785abd..852e15f51a1e 100644
--- a/include/asm-powerpc/iommu.h
+++ b/include/asm-powerpc/iommu.h
@@ -79,19 +79,19 @@ extern void iommu_free_table(struct iommu_table *tbl, const char *node_name);
79extern struct iommu_table *iommu_init_table(struct iommu_table * tbl, 79extern struct iommu_table *iommu_init_table(struct iommu_table * tbl,
80 int nid); 80 int nid);
81 81
82extern int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist, 82extern int iommu_map_sg(struct device *dev, struct scatterlist *sglist,
83 int nelems, unsigned long mask, 83 int nelems, unsigned long mask,
84 enum dma_data_direction direction); 84 enum dma_data_direction direction);
85extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist, 85extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist,
86 int nelems, enum dma_data_direction direction); 86 int nelems, enum dma_data_direction direction);
87 87
88extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size, 88extern void *iommu_alloc_coherent(struct device *dev, struct iommu_table *tbl,
89 dma_addr_t *dma_handle, unsigned long mask, 89 size_t size, dma_addr_t *dma_handle,
90 gfp_t flag, int node); 90 unsigned long mask, gfp_t flag, int node);
91extern void iommu_free_coherent(struct iommu_table *tbl, size_t size, 91extern void iommu_free_coherent(struct iommu_table *tbl, size_t size,
92 void *vaddr, dma_addr_t dma_handle); 92 void *vaddr, dma_addr_t dma_handle);
93extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, 93extern dma_addr_t iommu_map_single(struct device *dev, struct iommu_table *tbl,
94 size_t size, unsigned long mask, 94 void *vaddr, size_t size, unsigned long mask,
95 enum dma_data_direction direction); 95 enum dma_data_direction direction);
96extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle, 96extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle,
97 size_t size, enum dma_data_direction direction); 97 size_t size, enum dma_data_direction direction);
diff --git a/include/asm-powerpc/mediabay.h b/include/asm-powerpc/mediabay.h
index 9daa3252d7b6..de83fe196309 100644
--- a/include/asm-powerpc/mediabay.h
+++ b/include/asm-powerpc/mediabay.h
@@ -18,14 +18,14 @@
18#define MB_NO 7 /* media bay contains nothing */ 18#define MB_NO 7 /* media bay contains nothing */
19 19
20int check_media_bay(struct device_node *which_bay, int what); 20int check_media_bay(struct device_node *which_bay, int what);
21int check_media_bay_by_base(unsigned long base, int what);
22 21
23/* Number of bays in the machine or 0 */ 22/* Number of bays in the machine or 0 */
24extern int media_bay_count; 23extern int media_bay_count;
25 24
26/* called by pmac-ide.c to register IDE controller for media bay */ 25int check_media_bay_by_base(unsigned long base, int what);
27extern int media_bay_set_ide_infos(struct device_node* which_bay, 26/* called by IDE PMAC host driver to register IDE controller for media bay */
28 unsigned long base, int irq, int index); 27int media_bay_set_ide_infos(struct device_node *which_bay, unsigned long base,
28 int irq, int index);
29 29
30#endif /* __KERNEL__ */ 30#endif /* __KERNEL__ */
31#endif /* _PPC_MEDIABAY_H */ 31#endif /* _PPC_MEDIABAY_H */
diff --git a/include/asm-powerpc/nvram.h b/include/asm-powerpc/nvram.h
index 4e7059cc6113..efde5ac82f7b 100644
--- a/include/asm-powerpc/nvram.h
+++ b/include/asm-powerpc/nvram.h
@@ -58,6 +58,9 @@ struct nvram_header {
58}; 58};
59 59
60#ifdef __KERNEL__ 60#ifdef __KERNEL__
61
62#include <linux/list.h>
63
61struct nvram_partition { 64struct nvram_partition {
62 struct list_head partition; 65 struct list_head partition;
63 struct nvram_header header; 66 struct nvram_header header;
diff --git a/include/asm-powerpc/paca.h b/include/asm-powerpc/paca.h
index f6dfce025adf..748b35ab37b5 100644
--- a/include/asm-powerpc/paca.h
+++ b/include/asm-powerpc/paca.h
@@ -115,8 +115,6 @@ struct paca_struct {
115 u64 system_time; /* accumulated system TB ticks */ 115 u64 system_time; /* accumulated system TB ticks */
116 u64 startpurr; /* PURR/TB value snapshot */ 116 u64 startpurr; /* PURR/TB value snapshot */
117 u64 startspurr; /* SPURR value snapshot */ 117 u64 startspurr; /* SPURR value snapshot */
118 u64 purrdelta; /* FIXME: document */
119 u64 spurrdelta; /* FIXME: document */
120}; 118};
121 119
122extern struct paca_struct paca[]; 120extern struct paca_struct paca[];
diff --git a/include/asm-powerpc/pgalloc-32.h b/include/asm-powerpc/pgalloc-32.h
index e1307432163c..c162a4c37b39 100644
--- a/include/asm-powerpc/pgalloc-32.h
+++ b/include/asm-powerpc/pgalloc-32.h
@@ -6,14 +6,14 @@
6extern void __bad_pte(pmd_t *pmd); 6extern void __bad_pte(pmd_t *pmd);
7 7
8extern pgd_t *pgd_alloc(struct mm_struct *mm); 8extern pgd_t *pgd_alloc(struct mm_struct *mm);
9extern void pgd_free(pgd_t *pgd); 9extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
10 10
11/* 11/*
12 * We don't have any real pmd's, and this code never triggers because 12 * We don't have any real pmd's, and this code never triggers because
13 * the pgd will always be present.. 13 * the pgd will always be present..
14 */ 14 */
15/* #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) */ 15/* #define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) */
16#define pmd_free(x) do { } while (0) 16#define pmd_free(mm, x) do { } while (0)
17#define __pmd_free_tlb(tlb,x) do { } while (0) 17#define __pmd_free_tlb(tlb,x) do { } while (0)
18/* #define pgd_populate(mm, pmd, pte) BUG() */ 18/* #define pgd_populate(mm, pmd, pte) BUG() */
19 19
@@ -31,10 +31,10 @@ extern void pgd_free(pgd_t *pgd);
31 31
32extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); 32extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr);
33extern struct page *pte_alloc_one(struct mm_struct *mm, unsigned long addr); 33extern struct page *pte_alloc_one(struct mm_struct *mm, unsigned long addr);
34extern void pte_free_kernel(pte_t *pte); 34extern void pte_free_kernel(struct mm_struct *mm, pte_t *pte);
35extern void pte_free(struct page *pte); 35extern void pte_free(struct mm_struct *mm, struct page *pte);
36 36
37#define __pte_free_tlb(tlb, pte) pte_free((pte)) 37#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte))
38 38
39#define check_pgt_cache() do { } while (0) 39#define check_pgt_cache() do { } while (0)
40 40
diff --git a/include/asm-powerpc/pgalloc-64.h b/include/asm-powerpc/pgalloc-64.h
index 43214c8085b7..5afae8593931 100644
--- a/include/asm-powerpc/pgalloc-64.h
+++ b/include/asm-powerpc/pgalloc-64.h
@@ -29,7 +29,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
29 return kmem_cache_alloc(pgtable_cache[PGD_CACHE_NUM], GFP_KERNEL); 29 return kmem_cache_alloc(pgtable_cache[PGD_CACHE_NUM], GFP_KERNEL);
30} 30}
31 31
32static inline void pgd_free(pgd_t *pgd) 32static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
33{ 33{
34 subpage_prot_free(pgd); 34 subpage_prot_free(pgd);
35 kmem_cache_free(pgtable_cache[PGD_CACHE_NUM], pgd); 35 kmem_cache_free(pgtable_cache[PGD_CACHE_NUM], pgd);
@@ -45,7 +45,7 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
45 GFP_KERNEL|__GFP_REPEAT); 45 GFP_KERNEL|__GFP_REPEAT);
46} 46}
47 47
48static inline void pud_free(pud_t *pud) 48static inline void pud_free(struct mm_struct *mm, pud_t *pud)
49{ 49{
50 kmem_cache_free(pgtable_cache[PUD_CACHE_NUM], pud); 50 kmem_cache_free(pgtable_cache[PUD_CACHE_NUM], pud);
51} 51}
@@ -81,7 +81,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
81 GFP_KERNEL|__GFP_REPEAT); 81 GFP_KERNEL|__GFP_REPEAT);
82} 82}
83 83
84static inline void pmd_free(pmd_t *pmd) 84static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
85{ 85{
86 kmem_cache_free(pgtable_cache[PMD_CACHE_NUM], pmd); 86 kmem_cache_free(pgtable_cache[PMD_CACHE_NUM], pmd);
87} 87}
@@ -99,12 +99,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,
99 return pte ? virt_to_page(pte) : NULL; 99 return pte ? virt_to_page(pte) : NULL;
100} 100}
101 101
102static inline void pte_free_kernel(pte_t *pte) 102static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
103{ 103{
104 free_page((unsigned long)pte); 104 free_page((unsigned long)pte);
105} 105}
106 106
107static inline void pte_free(struct page *ptepage) 107static inline void pte_free(struct mm_struct *mm, struct page *ptepage)
108{ 108{
109 __free_page(ptepage); 109 __free_page(ptepage);
110} 110}
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h
index dba7c948189d..1f4765d6546f 100644
--- a/include/asm-powerpc/processor.h
+++ b/include/asm-powerpc/processor.h
@@ -99,8 +99,9 @@ extern struct task_struct *last_task_used_spe;
99 */ 99 */
100#define TASK_SIZE_USER32 (0x0000000100000000UL - (1*PAGE_SIZE)) 100#define TASK_SIZE_USER32 (0x0000000100000000UL - (1*PAGE_SIZE))
101 101
102#define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \ 102#define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk, TIF_32BIT) ? \
103 TASK_SIZE_USER32 : TASK_SIZE_USER64) 103 TASK_SIZE_USER32 : TASK_SIZE_USER64)
104#define TASK_SIZE TASK_SIZE_OF(current)
104 105
105/* This decides where the kernel will search for a free chunk of vm 106/* This decides where the kernel will search for a free chunk of vm
106 * space during mmap's. 107 * space during mmap's.
diff --git a/include/asm-powerpc/ps3av.h b/include/asm-powerpc/ps3av.h
index 967930b82ed3..fda98715cd35 100644
--- a/include/asm-powerpc/ps3av.h
+++ b/include/asm-powerpc/ps3av.h
@@ -310,19 +310,25 @@
310#define PS3AV_MONITOR_TYPE_HDMI 1 /* HDMI */ 310#define PS3AV_MONITOR_TYPE_HDMI 1 /* HDMI */
311#define PS3AV_MONITOR_TYPE_DVI 2 /* DVI */ 311#define PS3AV_MONITOR_TYPE_DVI 2 /* DVI */
312 312
313#define PS3AV_DEFAULT_HDMI_MODE_ID_REG_60 2 /* 480p */
314#define PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_60 1 /* 480i */
315#define PS3AV_DEFAULT_HDMI_MODE_ID_REG_50 7 /* 576p */
316#define PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_50 6 /* 576i */
317
318#define PS3AV_REGION_60 0x01
319#define PS3AV_REGION_50 0x02
320#define PS3AV_REGION_RGB 0x10
321
322#define get_status(buf) (((__u32 *)buf)[2])
323#define PS3AV_HDR_SIZE 4 /* version + size */
324 313
325/* for video mode */ 314/* for video mode */
315enum ps3av_mode_num {
316 PS3AV_MODE_AUTO = 0,
317 PS3AV_MODE_480I = 1,
318 PS3AV_MODE_480P = 2,
319 PS3AV_MODE_720P60 = 3,
320 PS3AV_MODE_1080I60 = 4,
321 PS3AV_MODE_1080P60 = 5,
322 PS3AV_MODE_576I = 6,
323 PS3AV_MODE_576P = 7,
324 PS3AV_MODE_720P50 = 8,
325 PS3AV_MODE_1080I50 = 9,
326 PS3AV_MODE_1080P50 = 10,
327 PS3AV_MODE_WXGA = 11,
328 PS3AV_MODE_SXGA = 12,
329 PS3AV_MODE_WUXGA = 13,
330};
331
326#define PS3AV_MODE_MASK 0x000F 332#define PS3AV_MODE_MASK 0x000F
327#define PS3AV_MODE_HDCP_OFF 0x1000 /* Retail PS3 product doesn't support this */ 333#define PS3AV_MODE_HDCP_OFF 0x1000 /* Retail PS3 product doesn't support this */
328#define PS3AV_MODE_DITHER 0x0800 334#define PS3AV_MODE_DITHER 0x0800
@@ -333,6 +339,19 @@
333#define PS3AV_MODE_RGB 0x0020 339#define PS3AV_MODE_RGB 0x0020
334 340
335 341
342#define PS3AV_DEFAULT_HDMI_MODE_ID_REG_60 PS3AV_MODE_480P
343#define PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_60 PS3AV_MODE_480I
344#define PS3AV_DEFAULT_HDMI_MODE_ID_REG_50 PS3AV_MODE_576P
345#define PS3AV_DEFAULT_AVMULTI_MODE_ID_REG_50 PS3AV_MODE_576I
346
347#define PS3AV_REGION_60 0x01
348#define PS3AV_REGION_50 0x02
349#define PS3AV_REGION_RGB 0x10
350
351#define get_status(buf) (((__u32 *)buf)[2])
352#define PS3AV_HDR_SIZE 4 /* version + size */
353
354
336/** command packet structure **/ 355/** command packet structure **/
337struct ps3av_send_hdr { 356struct ps3av_send_hdr {
338 u16 version; 357 u16 version;
@@ -713,8 +732,6 @@ extern int ps3av_set_video_mode(u32);
713extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32); 732extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32);
714extern int ps3av_get_auto_mode(void); 733extern int ps3av_get_auto_mode(void);
715extern int ps3av_get_mode(void); 734extern int ps3av_get_mode(void);
716extern int ps3av_get_scanmode(int);
717extern int ps3av_get_refresh_rate(int);
718extern int ps3av_video_mode2res(u32, u32 *, u32 *); 735extern int ps3av_video_mode2res(u32, u32 *, u32 *);
719extern int ps3av_video_mute(int); 736extern int ps3av_video_mute(int);
720extern int ps3av_audio_mute(int); 737extern int ps3av_audio_mute(int);
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h
index 0c8b0d679139..e996521fb3a6 100644
--- a/include/asm-powerpc/systbl.h
+++ b/include/asm-powerpc/systbl.h
@@ -309,7 +309,7 @@ SYSCALL_SPU(getcpu)
309COMPAT_SYS(epoll_pwait) 309COMPAT_SYS(epoll_pwait)
310COMPAT_SYS_SPU(utimensat) 310COMPAT_SYS_SPU(utimensat)
311COMPAT_SYS_SPU(signalfd) 311COMPAT_SYS_SPU(signalfd)
312COMPAT_SYS_SPU(timerfd) 312SYSCALL(ni_syscall)
313SYSCALL_SPU(eventfd) 313SYSCALL_SPU(eventfd)
314COMPAT_SYS_SPU(sync_file_range2) 314COMPAT_SYS_SPU(sync_file_range2)
315COMPAT_SYS(fallocate) 315COMPAT_SYS(fallocate)
diff --git a/include/asm-ppc/pgalloc.h b/include/asm-ppc/pgalloc.h
index 44d88a98e87c..7c39a95829c7 100644
--- a/include/asm-ppc/pgalloc.h
+++ b/include/asm-ppc/pgalloc.h
@@ -7,14 +7,14 @@
7extern void __bad_pte(pmd_t *pmd); 7extern void __bad_pte(pmd_t *pmd);
8 8
9extern pgd_t *pgd_alloc(struct mm_struct *mm); 9extern pgd_t *pgd_alloc(struct mm_struct *mm);
10extern void pgd_free(pgd_t *pgd); 10extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
11 11
12/* 12/*
13 * We don't have any real pmd's, and this code never triggers because 13 * We don't have any real pmd's, and this code never triggers because
14 * the pgd will always be present.. 14 * the pgd will always be present..
15 */ 15 */
16#define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) 16#define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); })
17#define pmd_free(x) do { } while (0) 17#define pmd_free(mm, x) do { } while (0)
18#define __pmd_free_tlb(tlb,x) do { } while (0) 18#define __pmd_free_tlb(tlb,x) do { } while (0)
19#define pgd_populate(mm, pmd, pte) BUG() 19#define pgd_populate(mm, pmd, pte) BUG()
20 20
@@ -32,10 +32,10 @@ extern void pgd_free(pgd_t *pgd);
32 32
33extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); 33extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr);
34extern struct page *pte_alloc_one(struct mm_struct *mm, unsigned long addr); 34extern struct page *pte_alloc_one(struct mm_struct *mm, unsigned long addr);
35extern void pte_free_kernel(pte_t *pte); 35extern void pte_free_kernel(struct mm_struct *mm, pte_t *pte);
36extern void pte_free(struct page *pte); 36extern void pte_free(struct mm_struct *mm, struct page *pte);
37 37
38#define __pte_free_tlb(tlb, pte) pte_free((pte)) 38#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, (pte))
39 39
40#define check_pgt_cache() do { } while (0) 40#define check_pgt_cache() do { } while (0)
41 41
diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h
index dba6fecad0be..882db054110c 100644
--- a/include/asm-s390/bitops.h
+++ b/include/asm-s390/bitops.h
@@ -440,242 +440,256 @@ __constant_test_bit(unsigned long nr, const volatile unsigned long *addr) {
440 __test_bit((nr),(addr)) ) 440 __test_bit((nr),(addr)) )
441 441
442/* 442/*
443 * ffz = Find First Zero in word. Undefined if no zero exists, 443 * Optimized find bit helper functions.
444 * so code should check against ~0UL first..
445 */ 444 */
446static inline unsigned long ffz(unsigned long word) 445
446/**
447 * __ffz_word_loop - find byte offset of first long != -1UL
448 * @addr: pointer to array of unsigned long
449 * @size: size of the array in bits
450 */
451static inline unsigned long __ffz_word_loop(const unsigned long *addr,
452 unsigned long size)
447{ 453{
448 unsigned long bit = 0; 454 typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype;
455 unsigned long bytes = 0;
449 456
457 asm volatile(
458#ifndef __s390x__
459 " ahi %1,31\n"
460 " srl %1,5\n"
461 "0: c %2,0(%0,%3)\n"
462 " jne 1f\n"
463 " la %0,4(%0)\n"
464 " brct %1,0b\n"
465 "1:\n"
466#else
467 " aghi %1,63\n"
468 " srlg %1,%1,6\n"
469 "0: cg %2,0(%0,%3)\n"
470 " jne 1f\n"
471 " la %0,8(%0)\n"
472 " brct %1,0b\n"
473 "1:\n"
474#endif
475 : "+a" (bytes), "+d" (size)
476 : "d" (-1UL), "a" (addr), "m" (*(addrtype *) addr)
477 : "cc" );
478 return bytes;
479}
480
481/**
482 * __ffs_word_loop - find byte offset of first long != 0UL
483 * @addr: pointer to array of unsigned long
484 * @size: size of the array in bits
485 */
486static inline unsigned long __ffs_word_loop(const unsigned long *addr,
487 unsigned long size)
488{
489 typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype;
490 unsigned long bytes = 0;
491
492 asm volatile(
493#ifndef __s390x__
494 " ahi %1,31\n"
495 " srl %1,5\n"
496 "0: c %2,0(%0,%3)\n"
497 " jne 1f\n"
498 " la %0,4(%0)\n"
499 " brct %1,0b\n"
500 "1:\n"
501#else
502 " aghi %1,63\n"
503 " srlg %1,%1,6\n"
504 "0: cg %2,0(%0,%3)\n"
505 " jne 1f\n"
506 " la %0,8(%0)\n"
507 " brct %1,0b\n"
508 "1:\n"
509#endif
510 : "+a" (bytes), "+a" (size)
511 : "d" (0UL), "a" (addr), "m" (*(addrtype *) addr)
512 : "cc" );
513 return bytes;
514}
515
516/**
517 * __ffz_word - add number of the first unset bit
518 * @nr: base value the bit number is added to
519 * @word: the word that is searched for unset bits
520 */
521static inline unsigned long __ffz_word(unsigned long nr, unsigned long word)
522{
450#ifdef __s390x__ 523#ifdef __s390x__
451 if (likely((word & 0xffffffff) == 0xffffffff)) { 524 if (likely((word & 0xffffffff) == 0xffffffff)) {
452 word >>= 32; 525 word >>= 32;
453 bit += 32; 526 nr += 32;
454 } 527 }
455#endif 528#endif
456 if (likely((word & 0xffff) == 0xffff)) { 529 if (likely((word & 0xffff) == 0xffff)) {
457 word >>= 16; 530 word >>= 16;
458 bit += 16; 531 nr += 16;
459 } 532 }
460 if (likely((word & 0xff) == 0xff)) { 533 if (likely((word & 0xff) == 0xff)) {
461 word >>= 8; 534 word >>= 8;
462 bit += 8; 535 nr += 8;
463 } 536 }
464 return bit + _zb_findmap[word & 0xff]; 537 return nr + _zb_findmap[(unsigned char) word];
465} 538}
466 539
467/* 540/**
468 * __ffs = find first bit in word. Undefined if no bit exists, 541 * __ffs_word - add number of the first set bit
469 * so code should check against 0UL first.. 542 * @nr: base value the bit number is added to
543 * @word: the word that is searched for set bits
470 */ 544 */
471static inline unsigned long __ffs (unsigned long word) 545static inline unsigned long __ffs_word(unsigned long nr, unsigned long word)
472{ 546{
473 unsigned long bit = 0;
474
475#ifdef __s390x__ 547#ifdef __s390x__
476 if (likely((word & 0xffffffff) == 0)) { 548 if (likely((word & 0xffffffff) == 0)) {
477 word >>= 32; 549 word >>= 32;
478 bit += 32; 550 nr += 32;
479 } 551 }
480#endif 552#endif
481 if (likely((word & 0xffff) == 0)) { 553 if (likely((word & 0xffff) == 0)) {
482 word >>= 16; 554 word >>= 16;
483 bit += 16; 555 nr += 16;
484 } 556 }
485 if (likely((word & 0xff) == 0)) { 557 if (likely((word & 0xff) == 0)) {
486 word >>= 8; 558 word >>= 8;
487 bit += 8; 559 nr += 8;
488 } 560 }
489 return bit + _sb_findmap[word & 0xff]; 561 return nr + _sb_findmap[(unsigned char) word];
490} 562}
491 563
492/*
493 * Find-bit routines..
494 */
495 564
496#ifndef __s390x__ 565/**
566 * __load_ulong_be - load big endian unsigned long
567 * @p: pointer to array of unsigned long
568 * @offset: byte offset of source value in the array
569 */
570static inline unsigned long __load_ulong_be(const unsigned long *p,
571 unsigned long offset)
572{
573 p = (unsigned long *)((unsigned long) p + offset);
574 return *p;
575}
497 576
498static inline int 577/**
499find_first_zero_bit(const unsigned long * addr, unsigned long size) 578 * __load_ulong_le - load little endian unsigned long
579 * @p: pointer to array of unsigned long
580 * @offset: byte offset of source value in the array
581 */
582static inline unsigned long __load_ulong_le(const unsigned long *p,
583 unsigned long offset)
500{ 584{
501 typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; 585 unsigned long word;
502 unsigned long cmp, count;
503 unsigned int res;
504 586
505 if (!size) 587 p = (unsigned long *)((unsigned long) p + offset);
506 return 0; 588#ifndef __s390x__
507 asm volatile( 589 asm volatile(
508 " lhi %1,-1\n" 590 " ic %0,0(%1)\n"
509 " lr %2,%3\n" 591 " icm %0,2,1(%1)\n"
510 " slr %0,%0\n" 592 " icm %0,4,2(%1)\n"
511 " ahi %2,31\n" 593 " icm %0,8,3(%1)"
512 " srl %2,5\n" 594 : "=&d" (word) : "a" (p), "m" (*p) : "cc");
513 "0: c %1,0(%0,%4)\n" 595#else
514 " jne 1f\n" 596 asm volatile(
515 " la %0,4(%0)\n" 597 " lrvg %0,%1"
516 " brct %2,0b\n" 598 : "=d" (word) : "m" (*p) );
517 " lr %0,%3\n" 599#endif
518 " j 4f\n" 600 return word;
519 "1: l %2,0(%0,%4)\n"
520 " sll %0,3\n"
521 " lhi %1,0xff\n"
522 " tml %2,0xffff\n"
523 " jno 2f\n"
524 " ahi %0,16\n"
525 " srl %2,16\n"
526 "2: tml %2,0x00ff\n"
527 " jno 3f\n"
528 " ahi %0,8\n"
529 " srl %2,8\n"
530 "3: nr %2,%1\n"
531 " ic %2,0(%2,%5)\n"
532 " alr %0,%2\n"
533 "4:"
534 : "=&a" (res), "=&d" (cmp), "=&a" (count)
535 : "a" (size), "a" (addr), "a" (&_zb_findmap),
536 "m" (*(addrtype *) addr) : "cc");
537 return (res < size) ? res : size;
538} 601}
539 602
540static inline int 603/*
541find_first_bit(const unsigned long * addr, unsigned long size) 604 * The various find bit functions.
605 */
606
607/*
608 * ffz - find first zero in word.
609 * @word: The word to search
610 *
611 * Undefined if no zero exists, so code should check against ~0UL first.
612 */
613static inline unsigned long ffz(unsigned long word)
542{ 614{
543 typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; 615 return __ffz_word(0, word);
544 unsigned long cmp, count; 616}
545 unsigned int res;
546 617
547 if (!size) 618/**
548 return 0; 619 * __ffs - find first bit in word.
549 asm volatile( 620 * @word: The word to search
550 " slr %1,%1\n" 621 *
551 " lr %2,%3\n" 622 * Undefined if no bit exists, so code should check against 0 first.
552 " slr %0,%0\n" 623 */
553 " ahi %2,31\n" 624static inline unsigned long __ffs (unsigned long word)
554 " srl %2,5\n" 625{
555 "0: c %1,0(%0,%4)\n" 626 return __ffs_word(0, word);
556 " jne 1f\n"
557 " la %0,4(%0)\n"
558 " brct %2,0b\n"
559 " lr %0,%3\n"
560 " j 4f\n"
561 "1: l %2,0(%0,%4)\n"
562 " sll %0,3\n"
563 " lhi %1,0xff\n"
564 " tml %2,0xffff\n"
565 " jnz 2f\n"
566 " ahi %0,16\n"
567 " srl %2,16\n"
568 "2: tml %2,0x00ff\n"
569 " jnz 3f\n"
570 " ahi %0,8\n"
571 " srl %2,8\n"
572 "3: nr %2,%1\n"
573 " ic %2,0(%2,%5)\n"
574 " alr %0,%2\n"
575 "4:"
576 : "=&a" (res), "=&d" (cmp), "=&a" (count)
577 : "a" (size), "a" (addr), "a" (&_sb_findmap),
578 "m" (*(addrtype *) addr) : "cc");
579 return (res < size) ? res : size;
580} 627}
581 628
582#else /* __s390x__ */ 629/**
630 * ffs - find first bit set
631 * @x: the word to search
632 *
633 * This is defined the same way as
634 * the libc and compiler builtin ffs routines, therefore
635 * differs in spirit from the above ffz (man ffs).
636 */
637static inline int ffs(int x)
638{
639 if (!x)
640 return 0;
641 return __ffs_word(1, x);
642}
583 643
584static inline unsigned long 644/**
585find_first_zero_bit(const unsigned long * addr, unsigned long size) 645 * find_first_zero_bit - find the first zero bit in a memory region
646 * @addr: The address to start the search at
647 * @size: The maximum size to search
648 *
649 * Returns the bit-number of the first zero bit, not the number of the byte
650 * containing a bit.
651 */
652static inline unsigned long find_first_zero_bit(const unsigned long *addr,
653 unsigned long size)
586{ 654{
587 typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; 655 unsigned long bytes, bits;
588 unsigned long res, cmp, count;
589 656
590 if (!size) 657 if (!size)
591 return 0; 658 return 0;
592 asm volatile( 659 bytes = __ffz_word_loop(addr, size);
593 " lghi %1,-1\n" 660 bits = __ffz_word(bytes*8, __load_ulong_be(addr, bytes));
594 " lgr %2,%3\n" 661 return (bits < size) ? bits : size;
595 " slgr %0,%0\n" 662}
596 " aghi %2,63\n" 663
597 " srlg %2,%2,6\n" 664/**
598 "0: cg %1,0(%0,%4)\n" 665 * find_first_bit - find the first set bit in a memory region
599 " jne 1f\n" 666 * @addr: The address to start the search at
600 " la %0,8(%0)\n" 667 * @size: The maximum size to search
601 " brct %2,0b\n" 668 *
602 " lgr %0,%3\n" 669 * Returns the bit-number of the first set bit, not the number of the byte
603 " j 5f\n" 670 * containing a bit.
604 "1: lg %2,0(%0,%4)\n" 671 */
605 " sllg %0,%0,3\n" 672static inline unsigned long find_first_bit(const unsigned long * addr,
606 " clr %2,%1\n" 673 unsigned long size)
607 " jne 2f\n"
608 " aghi %0,32\n"
609 " srlg %2,%2,32\n"
610 "2: lghi %1,0xff\n"
611 " tmll %2,0xffff\n"
612 " jno 3f\n"
613 " aghi %0,16\n"
614 " srl %2,16\n"
615 "3: tmll %2,0x00ff\n"
616 " jno 4f\n"
617 " aghi %0,8\n"
618 " srl %2,8\n"
619 "4: ngr %2,%1\n"
620 " ic %2,0(%2,%5)\n"
621 " algr %0,%2\n"
622 "5:"
623 : "=&a" (res), "=&d" (cmp), "=&a" (count)
624 : "a" (size), "a" (addr), "a" (&_zb_findmap),
625 "m" (*(addrtype *) addr) : "cc");
626 return (res < size) ? res : size;
627}
628
629static inline unsigned long
630find_first_bit(const unsigned long * addr, unsigned long size)
631{ 674{
632 typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; 675 unsigned long bytes, bits;
633 unsigned long res, cmp, count;
634 676
635 if (!size) 677 if (!size)
636 return 0; 678 return 0;
637 asm volatile( 679 bytes = __ffs_word_loop(addr, size);
638 " slgr %1,%1\n" 680 bits = __ffs_word(bytes*8, __load_ulong_be(addr, bytes));
639 " lgr %2,%3\n" 681 return (bits < size) ? bits : size;
640 " slgr %0,%0\n"
641 " aghi %2,63\n"
642 " srlg %2,%2,6\n"
643 "0: cg %1,0(%0,%4)\n"
644 " jne 1f\n"
645 " aghi %0,8\n"
646 " brct %2,0b\n"
647 " lgr %0,%3\n"
648 " j 5f\n"
649 "1: lg %2,0(%0,%4)\n"
650 " sllg %0,%0,3\n"
651 " clr %2,%1\n"
652 " jne 2f\n"
653 " aghi %0,32\n"
654 " srlg %2,%2,32\n"
655 "2: lghi %1,0xff\n"
656 " tmll %2,0xffff\n"
657 " jnz 3f\n"
658 " aghi %0,16\n"
659 " srl %2,16\n"
660 "3: tmll %2,0x00ff\n"
661 " jnz 4f\n"
662 " aghi %0,8\n"
663 " srl %2,8\n"
664 "4: ngr %2,%1\n"
665 " ic %2,0(%2,%5)\n"
666 " algr %0,%2\n"
667 "5:"
668 : "=&a" (res), "=&d" (cmp), "=&a" (count)
669 : "a" (size), "a" (addr), "a" (&_sb_findmap),
670 "m" (*(addrtype *) addr) : "cc");
671 return (res < size) ? res : size;
672} 682}
673 683
674#endif /* __s390x__ */ 684/**
675 685 * find_next_zero_bit - find the first zero bit in a memory region
676static inline int 686 * @addr: The address to base the search on
677find_next_zero_bit (const unsigned long * addr, unsigned long size, 687 * @offset: The bitnumber to start searching at
678 unsigned long offset) 688 * @size: The maximum size to search
689 */
690static inline int find_next_zero_bit (const unsigned long * addr,
691 unsigned long size,
692 unsigned long offset)
679{ 693{
680 const unsigned long *p; 694 const unsigned long *p;
681 unsigned long bit, set; 695 unsigned long bit, set;
@@ -688,10 +702,10 @@ find_next_zero_bit (const unsigned long * addr, unsigned long size,
688 p = addr + offset / __BITOPS_WORDSIZE; 702 p = addr + offset / __BITOPS_WORDSIZE;
689 if (bit) { 703 if (bit) {
690 /* 704 /*
691 * s390 version of ffz returns __BITOPS_WORDSIZE 705 * __ffz_word returns __BITOPS_WORDSIZE
692 * if no zero bit is present in the word. 706 * if no zero bit is present in the word.
693 */ 707 */
694 set = ffz(*p >> bit) + bit; 708 set = __ffz_word(0, *p >> bit) + bit;
695 if (set >= size) 709 if (set >= size)
696 return size + offset; 710 return size + offset;
697 if (set < __BITOPS_WORDSIZE) 711 if (set < __BITOPS_WORDSIZE)
@@ -703,9 +717,15 @@ find_next_zero_bit (const unsigned long * addr, unsigned long size,
703 return offset + find_first_zero_bit(p, size); 717 return offset + find_first_zero_bit(p, size);
704} 718}
705 719
706static inline int 720/**
707find_next_bit (const unsigned long * addr, unsigned long size, 721 * find_next_bit - find the first set bit in a memory region
708 unsigned long offset) 722 * @addr: The address to base the search on
723 * @offset: The bitnumber to start searching at
724 * @size: The maximum size to search
725 */
726static inline int find_next_bit (const unsigned long * addr,
727 unsigned long size,
728 unsigned long offset)
709{ 729{
710 const unsigned long *p; 730 const unsigned long *p;
711 unsigned long bit, set; 731 unsigned long bit, set;
@@ -718,10 +738,10 @@ find_next_bit (const unsigned long * addr, unsigned long size,
718 p = addr + offset / __BITOPS_WORDSIZE; 738 p = addr + offset / __BITOPS_WORDSIZE;
719 if (bit) { 739 if (bit) {
720 /* 740 /*
721 * s390 version of __ffs returns __BITOPS_WORDSIZE 741 * __ffs_word returns __BITOPS_WORDSIZE
722 * if no one bit is present in the word. 742 * if no one bit is present in the word.
723 */ 743 */
724 set = __ffs(*p & (~0UL << bit)); 744 set = __ffs_word(0, *p & (~0UL << bit));
725 if (set >= size) 745 if (set >= size)
726 return size + offset; 746 return size + offset;
727 if (set < __BITOPS_WORDSIZE) 747 if (set < __BITOPS_WORDSIZE)
@@ -744,8 +764,6 @@ static inline int sched_find_first_bit(unsigned long *b)
744 return find_first_bit(b, 140); 764 return find_first_bit(b, 140);
745} 765}
746 766
747#include <asm-generic/bitops/ffs.h>
748
749#include <asm-generic/bitops/fls.h> 767#include <asm-generic/bitops/fls.h>
750#include <asm-generic/bitops/fls64.h> 768#include <asm-generic/bitops/fls64.h>
751 769
@@ -772,108 +790,23 @@ static inline int sched_find_first_bit(unsigned long *b)
772 test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) 790 test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr)
773#define ext2_test_bit(nr, addr) \ 791#define ext2_test_bit(nr, addr) \
774 test_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr) 792 test_bit((nr)^(__BITOPS_WORDSIZE - 8), (unsigned long *)addr)
775#define ext2_find_next_bit(addr, size, off) \
776 generic_find_next_le_bit((unsigned long *)(addr), (size), (off))
777 793
778#ifndef __s390x__ 794static inline int ext2_find_first_zero_bit(void *vaddr, unsigned int size)
779
780static inline int
781ext2_find_first_zero_bit(void *vaddr, unsigned int size)
782{ 795{
783 typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; 796 unsigned long bytes, bits;
784 unsigned long cmp, count;
785 unsigned int res;
786 797
787 if (!size) 798 if (!size)
788 return 0; 799 return 0;
789 asm volatile( 800 bytes = __ffz_word_loop(vaddr, size);
790 " lhi %1,-1\n" 801 bits = __ffz_word(bytes*8, __load_ulong_le(vaddr, bytes));
791 " lr %2,%3\n" 802 return (bits < size) ? bits : size;
792 " ahi %2,31\n"
793 " srl %2,5\n"
794 " slr %0,%0\n"
795 "0: cl %1,0(%0,%4)\n"
796 " jne 1f\n"
797 " ahi %0,4\n"
798 " brct %2,0b\n"
799 " lr %0,%3\n"
800 " j 4f\n"
801 "1: l %2,0(%0,%4)\n"
802 " sll %0,3\n"
803 " ahi %0,24\n"
804 " lhi %1,0xff\n"
805 " tmh %2,0xffff\n"
806 " jo 2f\n"
807 " ahi %0,-16\n"
808 " srl %2,16\n"
809 "2: tml %2,0xff00\n"
810 " jo 3f\n"
811 " ahi %0,-8\n"
812 " srl %2,8\n"
813 "3: nr %2,%1\n"
814 " ic %2,0(%2,%5)\n"
815 " alr %0,%2\n"
816 "4:"
817 : "=&a" (res), "=&d" (cmp), "=&a" (count)
818 : "a" (size), "a" (vaddr), "a" (&_zb_findmap),
819 "m" (*(addrtype *) vaddr) : "cc");
820 return (res < size) ? res : size;
821} 803}
822 804
823#else /* __s390x__ */ 805static inline int ext2_find_next_zero_bit(void *vaddr, unsigned long size,
824 806 unsigned long offset)
825static inline unsigned long
826ext2_find_first_zero_bit(void *vaddr, unsigned long size)
827{
828 typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype;
829 unsigned long res, cmp, count;
830
831 if (!size)
832 return 0;
833 asm volatile(
834 " lghi %1,-1\n"
835 " lgr %2,%3\n"
836 " aghi %2,63\n"
837 " srlg %2,%2,6\n"
838 " slgr %0,%0\n"
839 "0: clg %1,0(%0,%4)\n"
840 " jne 1f\n"
841 " aghi %0,8\n"
842 " brct %2,0b\n"
843 " lgr %0,%3\n"
844 " j 5f\n"
845 "1: cl %1,0(%0,%4)\n"
846 " jne 2f\n"
847 " aghi %0,4\n"
848 "2: l %2,0(%0,%4)\n"
849 " sllg %0,%0,3\n"
850 " aghi %0,24\n"
851 " lghi %1,0xff\n"
852 " tmlh %2,0xffff\n"
853 " jo 3f\n"
854 " aghi %0,-16\n"
855 " srl %2,16\n"
856 "3: tmll %2,0xff00\n"
857 " jo 4f\n"
858 " aghi %0,-8\n"
859 " srl %2,8\n"
860 "4: ngr %2,%1\n"
861 " ic %2,0(%2,%5)\n"
862 " algr %0,%2\n"
863 "5:"
864 : "=&a" (res), "=&d" (cmp), "=&a" (count)
865 : "a" (size), "a" (vaddr), "a" (&_zb_findmap),
866 "m" (*(addrtype *) vaddr) : "cc");
867 return (res < size) ? res : size;
868}
869
870#endif /* __s390x__ */
871
872static inline int
873ext2_find_next_zero_bit(void *vaddr, unsigned long size, unsigned long offset)
874{ 807{
875 unsigned long *addr = vaddr, *p; 808 unsigned long *addr = vaddr, *p;
876 unsigned long word, bit, set; 809 unsigned long bit, set;
877 810
878 if (offset >= size) 811 if (offset >= size)
879 return size; 812 return size;
@@ -882,23 +815,11 @@ ext2_find_next_zero_bit(void *vaddr, unsigned long size, unsigned long offset)
882 size -= offset; 815 size -= offset;
883 p = addr + offset / __BITOPS_WORDSIZE; 816 p = addr + offset / __BITOPS_WORDSIZE;
884 if (bit) { 817 if (bit) {
885#ifndef __s390x__
886 asm volatile(
887 " ic %0,0(%1)\n"
888 " icm %0,2,1(%1)\n"
889 " icm %0,4,2(%1)\n"
890 " icm %0,8,3(%1)"
891 : "=&a" (word) : "a" (p), "m" (*p) : "cc");
892#else
893 asm volatile(
894 " lrvg %0,%1"
895 : "=a" (word) : "m" (*p) );
896#endif
897 /* 818 /*
898 * s390 version of ffz returns __BITOPS_WORDSIZE 819 * s390 version of ffz returns __BITOPS_WORDSIZE
899 * if no zero bit is present in the word. 820 * if no zero bit is present in the word.
900 */ 821 */
901 set = ffz(word >> bit) + bit; 822 set = ffz(__load_ulong_le(p, 0) >> bit) + bit;
902 if (set >= size) 823 if (set >= size)
903 return size + offset; 824 return size + offset;
904 if (set < __BITOPS_WORDSIZE) 825 if (set < __BITOPS_WORDSIZE)
@@ -910,6 +831,47 @@ ext2_find_next_zero_bit(void *vaddr, unsigned long size, unsigned long offset)
910 return offset + ext2_find_first_zero_bit(p, size); 831 return offset + ext2_find_first_zero_bit(p, size);
911} 832}
912 833
834static inline unsigned long ext2_find_first_bit(void *vaddr,
835 unsigned long size)
836{
837 unsigned long bytes, bits;
838
839 if (!size)
840 return 0;
841 bytes = __ffs_word_loop(vaddr, size);
842 bits = __ffs_word(bytes*8, __load_ulong_le(vaddr, bytes));
843 return (bits < size) ? bits : size;
844}
845
846static inline int ext2_find_next_bit(void *vaddr, unsigned long size,
847 unsigned long offset)
848{
849 unsigned long *addr = vaddr, *p;
850 unsigned long bit, set;
851
852 if (offset >= size)
853 return size;
854 bit = offset & (__BITOPS_WORDSIZE - 1);
855 offset -= bit;
856 size -= offset;
857 p = addr + offset / __BITOPS_WORDSIZE;
858 if (bit) {
859 /*
860 * s390 version of ffz returns __BITOPS_WORDSIZE
861 * if no zero bit is present in the word.
862 */
863 set = ffs(__load_ulong_le(p, 0) >> bit) + bit;
864 if (set >= size)
865 return size + offset;
866 if (set < __BITOPS_WORDSIZE)
867 return set + offset;
868 offset += __BITOPS_WORDSIZE;
869 size -= __BITOPS_WORDSIZE;
870 p++;
871 }
872 return offset + ext2_find_first_bit(p, size);
873}
874
913#include <asm-generic/bitops/minix.h> 875#include <asm-generic/bitops/minix.h>
914 876
915#endif /* __KERNEL__ */ 877#endif /* __KERNEL__ */
diff --git a/include/asm-s390/cacheflush.h b/include/asm-s390/cacheflush.h
index f7cade8083f3..49d5af916d01 100644
--- a/include/asm-s390/cacheflush.h
+++ b/include/asm-s390/cacheflush.h
@@ -24,4 +24,8 @@
24#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ 24#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
25 memcpy(dst, src, len) 25 memcpy(dst, src, len)
26 26
27#ifdef CONFIG_DEBUG_PAGEALLOC
28void kernel_map_pages(struct page *page, int numpages, int enable);
29#endif
30
27#endif /* _S390_CACHEFLUSH_H */ 31#endif /* _S390_CACHEFLUSH_H */
diff --git a/include/asm-s390/ccwgroup.h b/include/asm-s390/ccwgroup.h
index 7109c7cab87e..289053ef5e60 100644
--- a/include/asm-s390/ccwgroup.h
+++ b/include/asm-s390/ccwgroup.h
@@ -37,6 +37,7 @@ struct ccwgroup_device {
37 * @remove: function called on remove 37 * @remove: function called on remove
38 * @set_online: function called when device is set online 38 * @set_online: function called when device is set online
39 * @set_offline: function called when device is set offline 39 * @set_offline: function called when device is set offline
40 * @shutdown: function called when device is shut down
40 * @driver: embedded driver structure 41 * @driver: embedded driver structure
41 */ 42 */
42struct ccwgroup_driver { 43struct ccwgroup_driver {
@@ -49,6 +50,7 @@ struct ccwgroup_driver {
49 void (*remove) (struct ccwgroup_device *); 50 void (*remove) (struct ccwgroup_device *);
50 int (*set_online) (struct ccwgroup_device *); 51 int (*set_online) (struct ccwgroup_device *);
51 int (*set_offline) (struct ccwgroup_device *); 52 int (*set_offline) (struct ccwgroup_device *);
53 void (*shutdown)(struct ccwgroup_device *);
52 54
53 struct device_driver driver; 55 struct device_driver driver;
54}; 56};
diff --git a/include/asm-s390/cputime.h b/include/asm-s390/cputime.h
index 4b3ef7cad115..133ce054fc89 100644
--- a/include/asm-s390/cputime.h
+++ b/include/asm-s390/cputime.h
@@ -54,6 +54,7 @@ __div(unsigned long long n, unsigned int base)
54#define cputime_lt(__a, __b) ((__a) < (__b)) 54#define cputime_lt(__a, __b) ((__a) < (__b))
55#define cputime_le(__a, __b) ((__a) <= (__b)) 55#define cputime_le(__a, __b) ((__a) <= (__b))
56#define cputime_to_jiffies(__ct) (__div((__ct), 1000000 / HZ)) 56#define cputime_to_jiffies(__ct) (__div((__ct), 1000000 / HZ))
57#define cputime_to_scaled(__ct) (__ct)
57#define jiffies_to_cputime(__hz) ((cputime_t)(__hz) * (1000000 / HZ)) 58#define jiffies_to_cputime(__hz) ((cputime_t)(__hz) * (1000000 / HZ))
58 59
59#define cputime64_zero (0ULL) 60#define cputime64_zero (0ULL)
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h
index 709dd1740956..6f6619ba8980 100644
--- a/include/asm-s390/pgalloc.h
+++ b/include/asm-s390/pgalloc.h
@@ -57,10 +57,10 @@ static inline unsigned long pgd_entry_type(struct mm_struct *mm)
57} 57}
58 58
59#define pud_alloc_one(mm,address) ({ BUG(); ((pud_t *)2); }) 59#define pud_alloc_one(mm,address) ({ BUG(); ((pud_t *)2); })
60#define pud_free(x) do { } while (0) 60#define pud_free(mm, x) do { } while (0)
61 61
62#define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); }) 62#define pmd_alloc_one(mm,address) ({ BUG(); ((pmd_t *)2); })
63#define pmd_free(x) do { } while (0) 63#define pmd_free(mm, x) do { } while (0)
64 64
65#define pgd_populate(mm, pgd, pud) BUG() 65#define pgd_populate(mm, pgd, pud) BUG()
66#define pgd_populate_kernel(mm, pgd, pud) BUG() 66#define pgd_populate_kernel(mm, pgd, pud) BUG()
@@ -76,7 +76,7 @@ static inline unsigned long pgd_entry_type(struct mm_struct *mm)
76} 76}
77 77
78#define pud_alloc_one(mm,address) ({ BUG(); ((pud_t *)2); }) 78#define pud_alloc_one(mm,address) ({ BUG(); ((pud_t *)2); })
79#define pud_free(x) do { } while (0) 79#define pud_free(mm, x) do { } while (0)
80 80
81static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr) 81static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
82{ 82{
@@ -85,7 +85,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr)
85 crst_table_init(crst, _SEGMENT_ENTRY_EMPTY); 85 crst_table_init(crst, _SEGMENT_ENTRY_EMPTY);
86 return (pmd_t *) crst; 86 return (pmd_t *) crst;
87} 87}
88#define pmd_free(pmd) crst_table_free((unsigned long *) pmd) 88#define pmd_free(mm, pmd) crst_table_free((unsigned long *)pmd)
89 89
90#define pgd_populate(mm, pgd, pud) BUG() 90#define pgd_populate(mm, pgd, pud) BUG()
91#define pgd_populate_kernel(mm, pgd, pud) BUG() 91#define pgd_populate_kernel(mm, pgd, pud) BUG()
@@ -115,7 +115,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
115 crst_table_init(crst, pgd_entry_type(mm)); 115 crst_table_init(crst, pgd_entry_type(mm));
116 return (pgd_t *) crst; 116 return (pgd_t *) crst;
117} 117}
118#define pgd_free(pgd) crst_table_free((unsigned long *) pgd) 118#define pgd_free(mm, pgd) crst_table_free((unsigned long *) pgd)
119 119
120static inline void 120static inline void
121pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) 121pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
@@ -151,9 +151,9 @@ pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *page)
151#define pte_alloc_one(mm, vmaddr) \ 151#define pte_alloc_one(mm, vmaddr) \
152 virt_to_page(page_table_alloc(s390_noexec)) 152 virt_to_page(page_table_alloc(s390_noexec))
153 153
154#define pte_free_kernel(pte) \ 154#define pte_free_kernel(mm, pte) \
155 page_table_free((unsigned long *) pte) 155 page_table_free((unsigned long *) pte)
156#define pte_free(pte) \ 156#define pte_free(mm, pte) \
157 page_table_free((unsigned long *) page_to_phys((struct page *) pte)) 157 page_table_free((unsigned long *) page_to_phys((struct page *) pte))
158 158
159#endif /* _S390_PGALLOC_H */ 159#endif /* _S390_PGALLOC_H */
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index 79b9eab1a0c7..3f520754e71c 100644
--- a/include/asm-s390/pgtable.h
+++ b/include/asm-s390/pgtable.h
@@ -115,15 +115,21 @@ extern char empty_zero_page[PAGE_SIZE];
115#ifndef __s390x__ 115#ifndef __s390x__
116#define VMALLOC_START 0x78000000UL 116#define VMALLOC_START 0x78000000UL
117#define VMALLOC_END 0x7e000000UL 117#define VMALLOC_END 0x7e000000UL
118#define VMEM_MAP_MAX 0x80000000UL 118#define VMEM_MAP_END 0x80000000UL
119#else /* __s390x__ */ 119#else /* __s390x__ */
120#define VMALLOC_START 0x3e000000000UL 120#define VMALLOC_START 0x3e000000000UL
121#define VMALLOC_END 0x3e040000000UL 121#define VMALLOC_END 0x3e040000000UL
122#define VMEM_MAP_MAX 0x40000000000UL 122#define VMEM_MAP_END 0x40000000000UL
123#endif /* __s390x__ */ 123#endif /* __s390x__ */
124 124
125/*
126 * VMEM_MAX_PHYS is the highest physical address that can be added to the 1:1
127 * mapping. This needs to be calculated at compile time since the size of the
128 * VMEM_MAP is static but the size of struct page can change.
129 */
130#define VMEM_MAX_PHYS min(VMALLOC_START, ((VMEM_MAP_END - VMALLOC_END) / \
131 sizeof(struct page) * PAGE_SIZE) & ~((16 << 20) - 1))
125#define VMEM_MAP ((struct page *) VMALLOC_END) 132#define VMEM_MAP ((struct page *) VMALLOC_END)
126#define VMEM_MAP_SIZE ((VMALLOC_START / PAGE_SIZE) * sizeof(struct page))
127 133
128/* 134/*
129 * A 31 bit pagetable entry of S390 has following format: 135 * A 31 bit pagetable entry of S390 has following format:
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index c86b982aef5a..4f744609cd11 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -70,8 +70,9 @@ extern int get_cpu_capability(unsigned int *);
70 70
71#else /* __s390x__ */ 71#else /* __s390x__ */
72 72
73# define TASK_SIZE (test_thread_flag(TIF_31BIT) ? \ 73# define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk, TIF_31BIT) ? \
74 (0x80000000UL) : (0x40000000000UL)) 74 (0x80000000UL) : (0x40000000000UL))
75# define TASK_SIZE TASK_SIZE_OF(current)
75# define TASK_UNMAPPED_BASE (TASK_SIZE / 2) 76# define TASK_UNMAPPED_BASE (TASK_SIZE / 2)
76# define DEFAULT_TASK_SIZE (0x40000000000UL) 77# define DEFAULT_TASK_SIZE (0x40000000000UL)
77 78
diff --git a/include/asm-s390/tlb.h b/include/asm-s390/tlb.h
index 618693cfc10f..985de2b88279 100644
--- a/include/asm-s390/tlb.h
+++ b/include/asm-s390/tlb.h
@@ -65,9 +65,9 @@ static inline void tlb_flush_mmu(struct mmu_gather *tlb,
65 if (!tlb->fullmm && (tlb->nr_ptes > 0 || tlb->nr_pmds < TLB_NR_PTRS)) 65 if (!tlb->fullmm && (tlb->nr_ptes > 0 || tlb->nr_pmds < TLB_NR_PTRS))
66 __tlb_flush_mm(tlb->mm); 66 __tlb_flush_mm(tlb->mm);
67 while (tlb->nr_ptes > 0) 67 while (tlb->nr_ptes > 0)
68 pte_free(tlb->array[--tlb->nr_ptes]); 68 pte_free(tlb->mm, tlb->array[--tlb->nr_ptes]);
69 while (tlb->nr_pmds < TLB_NR_PTRS) 69 while (tlb->nr_pmds < TLB_NR_PTRS)
70 pmd_free((pmd_t *) tlb->array[tlb->nr_pmds++]); 70 pmd_free(tlb->mm, (pmd_t *) tlb->array[tlb->nr_pmds++]);
71} 71}
72 72
73static inline void tlb_finish_mmu(struct mmu_gather *tlb, 73static inline void tlb_finish_mmu(struct mmu_gather *tlb,
@@ -102,7 +102,7 @@ static inline void pte_free_tlb(struct mmu_gather *tlb, struct page *page)
102 if (tlb->nr_ptes >= tlb->nr_pmds) 102 if (tlb->nr_ptes >= tlb->nr_pmds)
103 tlb_flush_mmu(tlb, 0, 0); 103 tlb_flush_mmu(tlb, 0, 0);
104 } else 104 } else
105 pte_free(page); 105 pte_free(tlb->mm, page);
106} 106}
107 107
108/* 108/*
@@ -117,7 +117,7 @@ static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd)
117 if (tlb->nr_ptes >= tlb->nr_pmds) 117 if (tlb->nr_ptes >= tlb->nr_pmds)
118 tlb_flush_mmu(tlb, 0, 0); 118 tlb_flush_mmu(tlb, 0, 0);
119 } else 119 } else
120 pmd_free(pmd); 120 pmd_free(tlb->mm, pmd);
121#endif 121#endif
122} 122}
123 123
diff --git a/include/asm-sh/delay.h b/include/asm-sh/delay.h
index 031db84f2aa1..d5d464041003 100644
--- a/include/asm-sh/delay.h
+++ b/include/asm-sh/delay.h
@@ -12,7 +12,7 @@ extern void __bad_ndelay(void);
12 12
13extern void __udelay(unsigned long usecs); 13extern void __udelay(unsigned long usecs);
14extern void __ndelay(unsigned long nsecs); 14extern void __ndelay(unsigned long nsecs);
15extern void __const_udelay(unsigned long usecs); 15extern void __const_udelay(unsigned long xloops);
16extern void __delay(unsigned long loops); 16extern void __delay(unsigned long loops);
17 17
18#ifdef CONFIG_SUPERH32 18#ifdef CONFIG_SUPERH32
diff --git a/include/asm-sh/pgalloc.h b/include/asm-sh/pgalloc.h
index 18b613c57cf5..59ca16d77a1d 100644
--- a/include/asm-sh/pgalloc.h
+++ b/include/asm-sh/pgalloc.h
@@ -36,7 +36,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
36 return quicklist_alloc(QUICK_PGD, GFP_KERNEL | __GFP_REPEAT, pgd_ctor); 36 return quicklist_alloc(QUICK_PGD, GFP_KERNEL | __GFP_REPEAT, pgd_ctor);
37} 37}
38 38
39static inline void pgd_free(pgd_t *pgd) 39static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
40{ 40{
41 quicklist_free(QUICK_PGD, NULL, pgd); 41 quicklist_free(QUICK_PGD, NULL, pgd);
42} 42}
@@ -54,12 +54,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,
54 return pg ? virt_to_page(pg) : NULL; 54 return pg ? virt_to_page(pg) : NULL;
55} 55}
56 56
57static inline void pte_free_kernel(pte_t *pte) 57static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
58{ 58{
59 quicklist_free(QUICK_PT, NULL, pte); 59 quicklist_free(QUICK_PT, NULL, pte);
60} 60}
61 61
62static inline void pte_free(struct page *pte) 62static inline void pte_free(struct mm_struct *mm, struct page *pte)
63{ 63{
64 quicklist_free_page(QUICK_PT, NULL, pte); 64 quicklist_free_page(QUICK_PT, NULL, pte);
65} 65}
@@ -71,7 +71,7 @@ static inline void pte_free(struct page *pte)
71 * inside the pgd, so has no extra memory associated with it. 71 * inside the pgd, so has no extra memory associated with it.
72 */ 72 */
73 73
74#define pmd_free(x) do { } while (0) 74#define pmd_free(mm, x) do { } while (0)
75#define __pmd_free_tlb(tlb,x) do { } while (0) 75#define __pmd_free_tlb(tlb,x) do { } while (0)
76 76
77static inline void check_pgt_cache(void) 77static inline void check_pgt_cache(void)
diff --git a/include/asm-sh/unistd_32.h b/include/asm-sh/unistd_32.h
index b182b1cb05fd..433fd1b48fa2 100644
--- a/include/asm-sh/unistd_32.h
+++ b/include/asm-sh/unistd_32.h
@@ -330,7 +330,7 @@
330#define __NR_epoll_pwait 319 330#define __NR_epoll_pwait 319
331#define __NR_utimensat 320 331#define __NR_utimensat 320
332#define __NR_signalfd 321 332#define __NR_signalfd 321
333#define __NR_timerfd 322 333/* #define __NR_timerfd 322 removed */
334#define __NR_eventfd 323 334#define __NR_eventfd 323
335#define __NR_fallocate 324 335#define __NR_fallocate 324
336 336
diff --git a/include/asm-sh/unistd_64.h b/include/asm-sh/unistd_64.h
index 944511882cac..108d2ba897fe 100644
--- a/include/asm-sh/unistd_64.h
+++ b/include/asm-sh/unistd_64.h
@@ -370,7 +370,7 @@
370#define __NR_epoll_pwait 347 370#define __NR_epoll_pwait 347
371#define __NR_utimensat 348 371#define __NR_utimensat 348
372#define __NR_signalfd 349 372#define __NR_signalfd 349
373#define __NR_timerfd 350 373/* #define __NR_timerfd 350 removed */
374#define __NR_eventfd 351 374#define __NR_eventfd 351
375#define __NR_fallocate 352 375#define __NR_fallocate 352
376 376
diff --git a/include/asm-sparc/pgalloc.h b/include/asm-sparc/pgalloc.h
index a449cd4912d1..b5fbdd36447f 100644
--- a/include/asm-sparc/pgalloc.h
+++ b/include/asm-sparc/pgalloc.h
@@ -32,7 +32,7 @@ BTFIXUPDEF_CALL(pgd_t *, get_pgd_fast, void)
32BTFIXUPDEF_CALL(void, free_pgd_fast, pgd_t *) 32BTFIXUPDEF_CALL(void, free_pgd_fast, pgd_t *)
33#define free_pgd_fast(pgd) BTFIXUP_CALL(free_pgd_fast)(pgd) 33#define free_pgd_fast(pgd) BTFIXUP_CALL(free_pgd_fast)(pgd)
34 34
35#define pgd_free(pgd) free_pgd_fast(pgd) 35#define pgd_free(mm, pgd) free_pgd_fast(pgd)
36#define pgd_alloc(mm) get_pgd_fast() 36#define pgd_alloc(mm) get_pgd_fast()
37 37
38BTFIXUPDEF_CALL(void, pgd_set, pgd_t *, pmd_t *) 38BTFIXUPDEF_CALL(void, pgd_set, pgd_t *, pmd_t *)
@@ -45,8 +45,8 @@ BTFIXUPDEF_CALL(pmd_t *, pmd_alloc_one, struct mm_struct *, unsigned long)
45BTFIXUPDEF_CALL(void, free_pmd_fast, pmd_t *) 45BTFIXUPDEF_CALL(void, free_pmd_fast, pmd_t *)
46#define free_pmd_fast(pmd) BTFIXUP_CALL(free_pmd_fast)(pmd) 46#define free_pmd_fast(pmd) BTFIXUP_CALL(free_pmd_fast)(pmd)
47 47
48#define pmd_free(pmd) free_pmd_fast(pmd) 48#define pmd_free(mm, pmd) free_pmd_fast(pmd)
49#define __pmd_free_tlb(tlb, pmd) pmd_free(pmd) 49#define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd)
50 50
51BTFIXUPDEF_CALL(void, pmd_populate, pmd_t *, struct page *) 51BTFIXUPDEF_CALL(void, pmd_populate, pmd_t *, struct page *)
52#define pmd_populate(MM, PMD, PTE) BTFIXUP_CALL(pmd_populate)(PMD, PTE) 52#define pmd_populate(MM, PMD, PTE) BTFIXUP_CALL(pmd_populate)(PMD, PTE)
@@ -59,10 +59,10 @@ BTFIXUPDEF_CALL(pte_t *, pte_alloc_one_kernel, struct mm_struct *, unsigned long
59#define pte_alloc_one_kernel(mm, addr) BTFIXUP_CALL(pte_alloc_one_kernel)(mm, addr) 59#define pte_alloc_one_kernel(mm, addr) BTFIXUP_CALL(pte_alloc_one_kernel)(mm, addr)
60 60
61BTFIXUPDEF_CALL(void, free_pte_fast, pte_t *) 61BTFIXUPDEF_CALL(void, free_pte_fast, pte_t *)
62#define pte_free_kernel(pte) BTFIXUP_CALL(free_pte_fast)(pte) 62#define pte_free_kernel(mm, pte) BTFIXUP_CALL(free_pte_fast)(pte)
63 63
64BTFIXUPDEF_CALL(void, pte_free, struct page *) 64BTFIXUPDEF_CALL(void, pte_free, struct page *)
65#define pte_free(pte) BTFIXUP_CALL(pte_free)(pte) 65#define pte_free(mm, pte) BTFIXUP_CALL(pte_free)(pte)
66#define __pte_free_tlb(tlb, pte) pte_free(pte) 66#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte)
67 67
68#endif /* _SPARC_PGALLOC_H */ 68#endif /* _SPARC_PGALLOC_H */
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 0decdf763716..2338a0276377 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -327,11 +327,13 @@
327#define __NR_epoll_pwait 309 327#define __NR_epoll_pwait 309
328#define __NR_utimensat 310 328#define __NR_utimensat 310
329#define __NR_signalfd 311 329#define __NR_signalfd 311
330#define __NR_timerfd 312 330#define __NR_timerfd_create 312
331#define __NR_eventfd 313 331#define __NR_eventfd 313
332#define __NR_fallocate 314 332#define __NR_fallocate 314
333#define __NR_timerfd_settime 315
334#define __NR_timerfd_gettime 316
333 335
334#define NR_SYSCALLS 315 336#define NR_SYSCALLS 317
335 337
336/* Sparc 32-bit only has the "setresuid32", "getresuid32" variants, 338/* Sparc 32-bit only has the "setresuid32", "getresuid32" variants,
337 * it never had the plain ones and there is no value to adding those 339 * it never had the plain ones and there is no value to adding those
diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h
index c299b853b5ba..b6ece223562d 100644
--- a/include/asm-sparc64/io.h
+++ b/include/asm-sparc64/io.h
@@ -16,7 +16,7 @@
16/* BIO layer definitions. */ 16/* BIO layer definitions. */
17extern unsigned long kern_base, kern_size; 17extern unsigned long kern_base, kern_size;
18#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) 18#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
19#define BIO_VMERGE_BOUNDARY 8192 19#define BIO_VMERGE_BOUNDARY 0
20 20
21static inline u8 _inb(unsigned long addr) 21static inline u8 _inb(unsigned long addr)
22{ 22{
diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h
index 5d66b858a965..b48f73c2274e 100644
--- a/include/asm-sparc64/pgalloc.h
+++ b/include/asm-sparc64/pgalloc.h
@@ -20,7 +20,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
20 return quicklist_alloc(0, GFP_KERNEL, NULL); 20 return quicklist_alloc(0, GFP_KERNEL, NULL);
21} 21}
22 22
23static inline void pgd_free(pgd_t *pgd) 23static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
24{ 24{
25 quicklist_free(0, NULL, pgd); 25 quicklist_free(0, NULL, pgd);
26} 26}
@@ -32,7 +32,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
32 return quicklist_alloc(0, GFP_KERNEL, NULL); 32 return quicklist_alloc(0, GFP_KERNEL, NULL);
33} 33}
34 34
35static inline void pmd_free(pmd_t *pmd) 35static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
36{ 36{
37 quicklist_free(0, NULL, pmd); 37 quicklist_free(0, NULL, pmd);
38} 38}
@@ -50,12 +50,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,
50 return pg ? virt_to_page(pg) : NULL; 50 return pg ? virt_to_page(pg) : NULL;
51} 51}
52 52
53static inline void pte_free_kernel(pte_t *pte) 53static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
54{ 54{
55 quicklist_free(0, NULL, pte); 55 quicklist_free(0, NULL, pte);
56} 56}
57 57
58static inline void pte_free(struct page *ptepage) 58static inline void pte_free(struct mm_struct *mm, struct page *ptepage)
59{ 59{
60 quicklist_free_page(0, NULL, ptepage); 60 quicklist_free_page(0, NULL, ptepage);
61} 61}
diff --git a/include/asm-sparc64/timex.h b/include/asm-sparc64/timex.h
index 2a5e4ebaad80..c622535c4560 100644
--- a/include/asm-sparc64/timex.h
+++ b/include/asm-sparc64/timex.h
@@ -14,10 +14,6 @@
14typedef unsigned long cycles_t; 14typedef unsigned long cycles_t;
15#define get_cycles() tick_ops->get_tick() 15#define get_cycles() tick_ops->get_tick()
16 16
17#define ARCH_HAS_READ_CURRENT_TIMER 1 17#define ARCH_HAS_READ_CURRENT_TIMER
18#define read_current_timer(timer_val_p) \
19({ *timer_val_p = tick_ops->get_tick(); \
20 0; \
21})
22 18
23#endif 19#endif
diff --git a/include/asm-sparc64/tlb.h b/include/asm-sparc64/tlb.h
index 349d1d3e9c27..ec81cdedef2c 100644
--- a/include/asm-sparc64/tlb.h
+++ b/include/asm-sparc64/tlb.h
@@ -100,8 +100,8 @@ static inline void tlb_remove_page(struct mmu_gather *mp, struct page *page)
100} 100}
101 101
102#define tlb_remove_tlb_entry(mp,ptep,addr) do { } while (0) 102#define tlb_remove_tlb_entry(mp,ptep,addr) do { } while (0)
103#define pte_free_tlb(mp,ptepage) pte_free(ptepage) 103#define pte_free_tlb(mp, ptepage) pte_free((mp)->mm, ptepage)
104#define pmd_free_tlb(mp,pmdp) pmd_free(pmdp) 104#define pmd_free_tlb(mp, pmdp) pmd_free((mp)->mm, pmdp)
105#define pud_free_tlb(tlb,pudp) __pud_free_tlb(tlb,pudp) 105#define pud_free_tlb(tlb,pudp) __pud_free_tlb(tlb,pudp)
106 106
107#define tlb_migrate_finish(mm) do { } while (0) 107#define tlb_migrate_finish(mm) do { } while (0)
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index cb751b4d0f56..77559da0ea3f 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -329,11 +329,13 @@
329#define __NR_epoll_pwait 309 329#define __NR_epoll_pwait 309
330#define __NR_utimensat 310 330#define __NR_utimensat 310
331#define __NR_signalfd 311 331#define __NR_signalfd 311
332#define __NR_timerfd 312 332#define __NR_timerfd_create 312
333#define __NR_eventfd 313 333#define __NR_eventfd 313
334#define __NR_fallocate 314 334#define __NR_fallocate 314
335#define __NR_timerfd_settime 315
336#define __NR_timerfd_gettime 316
335 337
336#define NR_SYSCALLS 315 338#define NR_SYSCALLS 317
337 339
338#ifdef __KERNEL__ 340#ifdef __KERNEL__
339/* sysconf options, for SunOS compatibility */ 341/* sysconf options, for SunOS compatibility */
diff --git a/include/asm-um/a.out.h b/include/asm-um/a.out.h
index 9281dd8eb334..f42ff14577fa 100644
--- a/include/asm-um/a.out.h
+++ b/include/asm-um/a.out.h
@@ -13,11 +13,9 @@
13 13
14extern unsigned long stacksizelim; 14extern unsigned long stacksizelim;
15 15
16extern unsigned long host_task_size;
17
18#define STACK_ROOM (stacksizelim) 16#define STACK_ROOM (stacksizelim)
19 17
20#define STACK_TOP task_size 18#define STACK_TOP (TASK_SIZE - 2 * PAGE_SIZE)
21 19
22#define STACK_TOP_MAX STACK_TOP 20#define STACK_TOP_MAX STACK_TOP
23 21
diff --git a/include/asm-um/current.h b/include/asm-um/current.h
index 8fd72f69ce65..c2191d9aa03d 100644
--- a/include/asm-um/current.h
+++ b/include/asm-um/current.h
@@ -1,32 +1,13 @@
1/* 1/*
2 * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
6#ifndef __UM_CURRENT_H 6#ifndef __UM_CURRENT_H
7#define __UM_CURRENT_H 7#define __UM_CURRENT_H
8 8
9#ifndef __ASSEMBLY__
10
11#include "asm/page.h"
12#include "linux/thread_info.h" 9#include "linux/thread_info.h"
13 10
14#define current (current_thread_info()->task) 11#define current (current_thread_info()->task)
15 12
16/*Backward compatibility - it's used inside arch/um.*/
17#define current_thread current_thread_info()
18
19#endif /* __ASSEMBLY__ */
20
21#endif 13#endif
22
23/*
24 * Overrides for Emacs so that we follow Linus's tabbing style.
25 * Emacs will notice this stuff at the end of the file and automatically
26 * adjust the settings for this buffer only. This must remain at the end
27 * of the file.
28 * ---------------------------------------------------------------------------
29 * Local variables:
30 * c-file-style: "linux"
31 * End:
32 */
diff --git a/include/asm-um/elf-i386.h b/include/asm-um/elf-i386.h
index ca94a136dfe8..23d6893e8617 100644
--- a/include/asm-um/elf-i386.h
+++ b/include/asm-um/elf-i386.h
@@ -1,11 +1,11 @@
1/* 1/*
2 * Copyright (C) 2000 - 2003 Jeff Dike (jdike@addtoit.com) 2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5#ifndef __UM_ELF_I386_H 5#ifndef __UM_ELF_I386_H
6#define __UM_ELF_I386_H 6#define __UM_ELF_I386_H
7 7
8#include <linux/sched.h> 8#include <asm/user.h>
9#include "skas.h" 9#include "skas.h"
10 10
11#define R_386_NONE 0 11#define R_386_NONE 0
@@ -46,7 +46,7 @@ typedef struct user_i387_struct elf_fpregset_t;
46 PT_REGS_EDI(regs) = 0; \ 46 PT_REGS_EDI(regs) = 0; \
47 PT_REGS_EBP(regs) = 0; \ 47 PT_REGS_EBP(regs) = 0; \
48 PT_REGS_EAX(regs) = 0; \ 48 PT_REGS_EAX(regs) = 0; \
49} while(0) 49} while (0)
50 50
51#define USE_ELF_CORE_DUMP 51#define USE_ELF_CORE_DUMP
52#define ELF_EXEC_PAGESIZE 4096 52#define ELF_EXEC_PAGESIZE 4096
@@ -74,14 +74,9 @@ typedef struct user_i387_struct elf_fpregset_t;
74 pr_reg[14] = PT_REGS_EFLAGS(regs); \ 74 pr_reg[14] = PT_REGS_EFLAGS(regs); \
75 pr_reg[15] = PT_REGS_SP(regs); \ 75 pr_reg[15] = PT_REGS_SP(regs); \
76 pr_reg[16] = PT_REGS_SS(regs); \ 76 pr_reg[16] = PT_REGS_SS(regs); \
77} while(0); 77} while (0);
78 78
79static inline int elf_core_copy_fpregs(struct task_struct *t, 79extern int elf_core_copy_fpregs(struct task_struct *t, elf_fpregset_t *fpu);
80 elf_fpregset_t *fpu)
81{
82 int cpu = ((struct thread_info *) t->stack)->cpu;
83 return save_fp_registers(userspace_pid[cpu], (unsigned long *) fpu);
84}
85 80
86#define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu) 81#define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu)
87 82
@@ -91,7 +86,7 @@ extern long elf_aux_hwcap;
91extern char * elf_aux_platform; 86extern char * elf_aux_platform;
92#define ELF_PLATFORM (elf_aux_platform) 87#define ELF_PLATFORM (elf_aux_platform)
93 88
94#define SET_PERSONALITY(ex, ibcs2) do ; while(0) 89#define SET_PERSONALITY(ex, ibcs2) do { } while (0)
95 90
96extern unsigned long vsyscall_ehdr; 91extern unsigned long vsyscall_ehdr;
97extern unsigned long vsyscall_end; 92extern unsigned long vsyscall_end;
@@ -166,14 +161,3 @@ if ( vsyscall_ehdr ) { \
166} 161}
167 162
168#endif 163#endif
169
170/*
171 * Overrides for Emacs so that we follow Linus's tabbing style.
172 * Emacs will notice this stuff at the end of the file and automatically
173 * adjust the settings for this buffer only. This must remain at the end
174 * of the file.
175 * ---------------------------------------------------------------------------
176 * Local variables:
177 * c-file-style: "linux"
178 * End:
179 */
diff --git a/include/asm-um/elf-x86_64.h b/include/asm-um/elf-x86_64.h
index 3c9d543eb61e..3b2d5224a7e1 100644
--- a/include/asm-um/elf-x86_64.h
+++ b/include/asm-um/elf-x86_64.h
@@ -7,7 +7,6 @@
7#ifndef __UM_ELF_X86_64_H 7#ifndef __UM_ELF_X86_64_H
8#define __UM_ELF_X86_64_H 8#define __UM_ELF_X86_64_H
9 9
10#include <linux/sched.h>
11#include <asm/user.h> 10#include <asm/user.h>
12#include "skas.h" 11#include "skas.h"
13 12
@@ -96,12 +95,7 @@ typedef struct user_i387_struct elf_fpregset_t;
96 (pr_reg)[25] = 0; \ 95 (pr_reg)[25] = 0; \
97 (pr_reg)[26] = 0; 96 (pr_reg)[26] = 0;
98 97
99static inline int elf_core_copy_fpregs(struct task_struct *t, 98extern int elf_core_copy_fpregs(struct task_struct *t, elf_fpregset_t *fpu);
100 elf_fpregset_t *fpu)
101{
102 int cpu = current_thread->cpu;
103 return save_fp_registers(userspace_pid[cpu], (unsigned long *) fpu);
104}
105 99
106#define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu) 100#define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu)
107 101
diff --git a/include/asm-um/fixmap.h b/include/asm-um/fixmap.h
index d352a35cfafb..89a87c18b927 100644
--- a/include/asm-um/fixmap.h
+++ b/include/asm-um/fixmap.h
@@ -1,9 +1,10 @@
1#ifndef __UM_FIXMAP_H 1#ifndef __UM_FIXMAP_H
2#define __UM_FIXMAP_H 2#define __UM_FIXMAP_H
3 3
4#include <asm/system.h>
4#include <asm/kmap_types.h> 5#include <asm/kmap_types.h>
5#include <asm/archparam.h> 6#include <asm/archparam.h>
6#include <asm/elf.h> 7#include <asm/page.h>
7 8
8/* 9/*
9 * Here we define all the compile-time 'special' virtual 10 * Here we define all the compile-time 'special' virtual
@@ -55,9 +56,8 @@ extern void __set_fixmap (enum fixed_addresses idx,
55 * the start of the fixmap, and leave one page empty 56 * the start of the fixmap, and leave one page empty
56 * at the top of mem.. 57 * at the top of mem..
57 */ 58 */
58extern unsigned long get_kmem_end(void);
59 59
60#define FIXADDR_TOP (get_kmem_end() - 0x2000) 60#define FIXADDR_TOP (CONFIG_TOP_ADDR - 2 * PAGE_SIZE)
61#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) 61#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
62#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE) 62#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
63 63
diff --git a/include/asm-um/ldt.h b/include/asm-um/ldt.h
index b2553f3e87eb..52af512f5e7d 100644
--- a/include/asm-um/ldt.h
+++ b/include/asm-um/ldt.h
@@ -8,7 +8,7 @@
8#ifndef __ASM_LDT_H 8#ifndef __ASM_LDT_H
9#define __ASM_LDT_H 9#define __ASM_LDT_H
10 10
11#include "asm/semaphore.h" 11#include <linux/mutex.h>
12#include "asm/host_ldt.h" 12#include "asm/host_ldt.h"
13 13
14extern void ldt_host_info(void); 14extern void ldt_host_info(void);
@@ -27,7 +27,7 @@ struct ldt_entry {
27 27
28typedef struct uml_ldt { 28typedef struct uml_ldt {
29 int entry_count; 29 int entry_count;
30 struct semaphore semaphore; 30 struct mutex lock;
31 union { 31 union {
32 struct ldt_entry * pages[LDT_PAGES_MAX]; 32 struct ldt_entry * pages[LDT_PAGES_MAX];
33 struct ldt_entry entries[LDT_DIRECT_ENTRIES]; 33 struct ldt_entry entries[LDT_DIRECT_ENTRIES];
diff --git a/include/asm-um/linkage.h b/include/asm-um/linkage.h
index cdb3024a699a..7dfce37adc8b 100644
--- a/include/asm-um/linkage.h
+++ b/include/asm-um/linkage.h
@@ -3,10 +3,4 @@
3 3
4#include "asm/arch/linkage.h" 4#include "asm/arch/linkage.h"
5 5
6
7/* <linux/linkage.h> will pick sane defaults */
8#ifdef CONFIG_GPROF
9#undef fastcall
10#endif
11
12#endif 6#endif
diff --git a/include/asm-um/mmu_context.h b/include/asm-um/mmu_context.h
index 5f3b863aef9a..6686fc524ca1 100644
--- a/include/asm-um/mmu_context.h
+++ b/include/asm-um/mmu_context.h
@@ -6,11 +6,12 @@
6#ifndef __UM_MMU_CONTEXT_H 6#ifndef __UM_MMU_CONTEXT_H
7#define __UM_MMU_CONTEXT_H 7#define __UM_MMU_CONTEXT_H
8 8
9#include <asm-generic/mm_hooks.h>
10
11#include "linux/sched.h" 9#include "linux/sched.h"
12#include "um_mmu.h" 10#include "um_mmu.h"
13 11
12extern void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm);
13extern void arch_exit_mmap(struct mm_struct *mm);
14
14#define get_mmu_context(task) do ; while(0) 15#define get_mmu_context(task) do ; while(0)
15#define activate_context(tsk) do ; while(0) 16#define activate_context(tsk) do ; while(0)
16 17
@@ -30,6 +31,8 @@ static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
30 */ 31 */
31 if (old != new && (current->flags & PF_BORROWED_MM)) 32 if (old != new && (current->flags & PF_BORROWED_MM))
32 __switch_mm(&new->context.id); 33 __switch_mm(&new->context.id);
34
35 arch_dup_mmap(old, new);
33} 36}
34 37
35static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, 38static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
diff --git a/include/asm-um/page.h b/include/asm-um/page.h
index 4b424c75fca5..fe2374d705d1 100644
--- a/include/asm-um/page.h
+++ b/include/asm-um/page.h
@@ -30,7 +30,7 @@ struct page;
30#if defined(CONFIG_3_LEVEL_PGTABLES) && !defined(CONFIG_64BIT) 30#if defined(CONFIG_3_LEVEL_PGTABLES) && !defined(CONFIG_64BIT)
31 31
32typedef struct { unsigned long pte_low, pte_high; } pte_t; 32typedef struct { unsigned long pte_low, pte_high; } pte_t;
33typedef struct { unsigned long long pmd; } pmd_t; 33typedef struct { unsigned long pmd; } pmd_t;
34typedef struct { unsigned long pgd; } pgd_t; 34typedef struct { unsigned long pgd; } pgd_t;
35#define pte_val(x) ((x).pte_low | ((unsigned long long) (x).pte_high << 32)) 35#define pte_val(x) ((x).pte_low | ((unsigned long long) (x).pte_high << 32))
36 36
@@ -106,8 +106,8 @@ extern unsigned long uml_physmem;
106#define __pa(virt) to_phys((void *) (unsigned long) (virt)) 106#define __pa(virt) to_phys((void *) (unsigned long) (virt))
107#define __va(phys) to_virt((unsigned long) (phys)) 107#define __va(phys) to_virt((unsigned long) (phys))
108 108
109#define phys_to_pfn(p) ((p) >> PAGE_SHIFT) 109#define phys_to_pfn(p) ((pfn_t) ((p) >> PAGE_SHIFT))
110#define pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) 110#define pfn_to_phys(pfn) ((phys_t) ((pfn) << PAGE_SHIFT))
111 111
112#define pfn_valid(pfn) ((pfn) < max_mapnr) 112#define pfn_valid(pfn) ((pfn) < max_mapnr)
113#define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v))) 113#define virt_addr_valid(v) pfn_valid(phys_to_pfn(__pa(v)))
diff --git a/include/asm-um/param.h b/include/asm-um/param.h
index f914e7d67b01..4cd4a226f8c1 100644
--- a/include/asm-um/param.h
+++ b/include/asm-um/param.h
@@ -10,7 +10,7 @@
10#define MAXHOSTNAMELEN 64 /* max length of hostname */ 10#define MAXHOSTNAMELEN 64 /* max length of hostname */
11 11
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13#define HZ 100 13#define HZ CONFIG_HZ
14#define USER_HZ 100 /* .. some user interfaces are in "ticks" */ 14#define USER_HZ 100 /* .. some user interfaces are in "ticks" */
15#define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */ 15#define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */
16#endif 16#endif
diff --git a/include/asm-um/pgalloc.h b/include/asm-um/pgalloc.h
index 14904876e8fb..4f3e62b02861 100644
--- a/include/asm-um/pgalloc.h
+++ b/include/asm-um/pgalloc.h
@@ -23,17 +23,17 @@
23 * Allocate and free page tables. 23 * Allocate and free page tables.
24 */ 24 */
25extern pgd_t *pgd_alloc(struct mm_struct *); 25extern pgd_t *pgd_alloc(struct mm_struct *);
26extern void pgd_free(pgd_t *pgd); 26extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
27 27
28extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); 28extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long);
29extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); 29extern struct page *pte_alloc_one(struct mm_struct *, unsigned long);
30 30
31static inline void pte_free_kernel(pte_t *pte) 31static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
32{ 32{
33 free_page((unsigned long) pte); 33 free_page((unsigned long) pte);
34} 34}
35 35
36static inline void pte_free(struct page *pte) 36static inline void pte_free(struct mm_struct *mm, struct page *pte)
37{ 37{
38 __free_page(pte); 38 __free_page(pte);
39} 39}
@@ -42,7 +42,7 @@ static inline void pte_free(struct page *pte)
42 42
43#ifdef CONFIG_3_LEVEL_PGTABLES 43#ifdef CONFIG_3_LEVEL_PGTABLES
44 44
45static inline void pmd_free(pmd_t *pmd) 45static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
46{ 46{
47 free_page((unsigned long)pmd); 47 free_page((unsigned long)pmd);
48} 48}
diff --git a/include/asm-um/pgtable-2level.h b/include/asm-um/pgtable-2level.h
index 172a75fde512..f534b73e753e 100644
--- a/include/asm-um/pgtable-2level.h
+++ b/include/asm-um/pgtable-2level.h
@@ -41,9 +41,6 @@ static inline void pgd_mkuptodate(pgd_t pgd) { }
41#define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot)) 41#define pfn_pte(pfn, prot) __pte(pfn_to_phys(pfn) | pgprot_val(prot))
42#define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot)) 42#define pfn_pmd(pfn, prot) __pmd(pfn_to_phys(pfn) | pgprot_val(prot))
43 43
44#define pmd_page_vaddr(pmd) \
45 ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
46
47/* 44/*
48 * Bits 0 through 4 are taken 45 * Bits 0 through 4 are taken
49 */ 46 */
diff --git a/include/asm-um/pgtable-3level.h b/include/asm-um/pgtable-3level.h
index 3ebafbaacb24..0446f456b428 100644
--- a/include/asm-um/pgtable-3level.h
+++ b/include/asm-um/pgtable-3level.h
@@ -11,7 +11,11 @@
11 11
12/* PGDIR_SHIFT determines what a third-level page table entry can map */ 12/* PGDIR_SHIFT determines what a third-level page table entry can map */
13 13
14#ifdef CONFIG_64BIT
14#define PGDIR_SHIFT 30 15#define PGDIR_SHIFT 30
16#else
17#define PGDIR_SHIFT 31
18#endif
15#define PGDIR_SIZE (1UL << PGDIR_SHIFT) 19#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
16#define PGDIR_MASK (~(PGDIR_SIZE-1)) 20#define PGDIR_MASK (~(PGDIR_SIZE-1))
17 21
@@ -28,9 +32,15 @@
28 */ 32 */
29 33
30#define PTRS_PER_PTE 512 34#define PTRS_PER_PTE 512
35#ifdef CONFIG_64BIT
31#define PTRS_PER_PMD 512 36#define PTRS_PER_PMD 512
32#define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE)
33#define PTRS_PER_PGD 512 37#define PTRS_PER_PGD 512
38#else
39#define PTRS_PER_PMD 1024
40#define PTRS_PER_PGD 1024
41#endif
42
43#define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE)
34#define FIRST_USER_ADDRESS 0 44#define FIRST_USER_ADDRESS 0
35 45
36#define pte_ERROR(e) \ 46#define pte_ERROR(e) \
@@ -49,7 +59,12 @@
49#define pud_populate(mm, pud, pmd) \ 59#define pud_populate(mm, pud, pmd) \
50 set_pud(pud, __pud(_PAGE_TABLE + __pa(pmd))) 60 set_pud(pud, __pud(_PAGE_TABLE + __pa(pmd)))
51 61
62#ifdef CONFIG_64BIT
52#define set_pud(pudptr, pudval) set_64bit((phys_t *) (pudptr), pud_val(pudval)) 63#define set_pud(pudptr, pudval) set_64bit((phys_t *) (pudptr), pud_val(pudval))
64#else
65#define set_pud(pudptr, pudval) (*(pudptr) = (pudval))
66#endif
67
53static inline int pgd_newpage(pgd_t pgd) 68static inline int pgd_newpage(pgd_t pgd)
54{ 69{
55 return(pgd_val(pgd) & _PAGE_NEWPAGE); 70 return(pgd_val(pgd) & _PAGE_NEWPAGE);
@@ -57,17 +72,14 @@ static inline int pgd_newpage(pgd_t pgd)
57 72
58static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; } 73static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; }
59 74
75#ifdef CONFIG_64BIT
60#define set_pmd(pmdptr, pmdval) set_64bit((phys_t *) (pmdptr), pmd_val(pmdval)) 76#define set_pmd(pmdptr, pmdval) set_64bit((phys_t *) (pmdptr), pmd_val(pmdval))
77#else
78#define set_pmd(pmdptr, pmdval) (*(pmdptr) = (pmdval))
79#endif
61 80
62static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) 81struct mm_struct;
63{ 82extern pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address);
64 pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL);
65
66 if(pmd)
67 memset(pmd, 0, PAGE_SIZE);
68
69 return pmd;
70}
71 83
72static inline void pud_clear (pud_t *pud) 84static inline void pud_clear (pud_t *pud)
73{ 85{
@@ -75,8 +87,7 @@ static inline void pud_clear (pud_t *pud)
75} 87}
76 88
77#define pud_page(pud) phys_to_page(pud_val(pud) & PAGE_MASK) 89#define pud_page(pud) phys_to_page(pud_val(pud) & PAGE_MASK)
78#define pud_page_vaddr(pud) \ 90#define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PAGE_MASK))
79 ((struct page *) __va(pud_val(pud) & PAGE_MASK))
80 91
81/* Find an entry in the second-level page table.. */ 92/* Find an entry in the second-level page table.. */
82#define pmd_offset(pud, address) ((pmd_t *) pud_page_vaddr(*(pud)) + \ 93#define pmd_offset(pud, address) ((pmd_t *) pud_page_vaddr(*(pud)) + \
diff --git a/include/asm-um/pgtable.h b/include/asm-um/pgtable.h
index 830fc6e5d49d..4102b443e925 100644
--- a/include/asm-um/pgtable.h
+++ b/include/asm-um/pgtable.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Copyright 2003 PathScale, Inc. 3 * Copyright 2003 PathScale, Inc.
4 * Derived from include/asm-i386/pgtable.h 4 * Derived from include/asm-i386/pgtable.h
5 * Licensed under the GPL 5 * Licensed under the GPL
@@ -8,11 +8,7 @@
8#ifndef __UM_PGTABLE_H 8#ifndef __UM_PGTABLE_H
9#define __UM_PGTABLE_H 9#define __UM_PGTABLE_H
10 10
11#include "linux/sched.h" 11#include <asm/fixmap.h>
12#include "linux/linkage.h"
13#include "asm/processor.h"
14#include "asm/page.h"
15#include "asm/fixmap.h"
16 12
17#define _PAGE_PRESENT 0x001 13#define _PAGE_PRESENT 0x001
18#define _PAGE_NEWPAGE 0x002 14#define _PAGE_NEWPAGE 0x002
@@ -34,22 +30,11 @@
34 30
35extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 31extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
36 32
37extern void *um_virt_to_phys(struct task_struct *task, unsigned long virt,
38 pte_t *pte_out);
39
40/* zero page used for uninitialized stuff */ 33/* zero page used for uninitialized stuff */
41extern unsigned long *empty_zero_page; 34extern unsigned long *empty_zero_page;
42 35
43#define pgtable_cache_init() do ; while (0) 36#define pgtable_cache_init() do ; while (0)
44 37
45/*
46 * pgd entries used up by user/kernel:
47 */
48
49#define USER_PGD_PTRS (TASK_SIZE >> PGDIR_SHIFT)
50#define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
51
52#ifndef __ASSEMBLY__
53/* Just any arbitrary offset to the start of the vmalloc VM area: the 38/* Just any arbitrary offset to the start of the vmalloc VM area: the
54 * current 8MB value just means that there will be a 8MB "hole" after the 39 * current 8MB value just means that there will be a 8MB "hole" after the
55 * physical memory until the kernel virtual memory starts. That means that 40 * physical memory until the kernel virtual memory starts. That means that
@@ -62,16 +47,12 @@ extern unsigned long end_iomem;
62 47
63#define VMALLOC_OFFSET (__va_space) 48#define VMALLOC_OFFSET (__va_space)
64#define VMALLOC_START ((end_iomem + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) 49#define VMALLOC_START ((end_iomem + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
65
66#ifdef CONFIG_HIGHMEM 50#ifdef CONFIG_HIGHMEM
67# define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) 51# define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE)
68#else 52#else
69# define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE) 53# define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE)
70#endif 54#endif
71 55
72#define REGION_SHIFT (sizeof(pte_t) * 8 - 4)
73#define REGION_MASK (((unsigned long) 0xf) << REGION_SHIFT)
74
75#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY) 56#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY)
76#define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY) 57#define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
77#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY) 58#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
@@ -81,11 +62,12 @@ extern unsigned long end_iomem;
81#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED) 62#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
82#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED) 63#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
83#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED) 64#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
84#define PAGE_KERNEL_RO __pgprot(_PAGE_PRESENT | _PAGE_DIRTY | _PAGE_ACCESSED)
85 65
86/* 66/*
87 * The i386 can't do page protection for execute, and considers that the same are read. 67 * The i386 can't do page protection for execute, and considers that the same
88 * Also, write permissions imply read permissions. This is the closest we can get.. 68 * are read.
69 * Also, write permissions imply read permissions. This is the closest we can
70 * get..
89 */ 71 */
90#define __P000 PAGE_NONE 72#define __P000 PAGE_NONE
91#define __P001 PAGE_READONLY 73#define __P001 PAGE_READONLY
@@ -106,40 +88,16 @@ extern unsigned long end_iomem;
106#define __S111 PAGE_SHARED 88#define __S111 PAGE_SHARED
107 89
108/* 90/*
109 * Define this if things work differently on an i386 and an i486:
110 * it will (on an i486) warn about kernel memory accesses that are
111 * done without a 'access_ok(VERIFY_WRITE,..)'
112 */
113#undef TEST_VERIFY_AREA
114
115/* page table for 0-4MB for everybody */
116extern unsigned long pg0[1024];
117
118/*
119 * ZERO_PAGE is a global shared page that is always zero: used 91 * ZERO_PAGE is a global shared page that is always zero: used
120 * for zero-mapped memory areas etc.. 92 * for zero-mapped memory areas etc..
121 */ 93 */
122
123#define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page) 94#define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page)
124 95
125/* number of bits that fit into a memory pointer */
126#define BITS_PER_PTR (8*sizeof(unsigned long))
127
128/* to align the pointer to a pointer address */
129#define PTR_MASK (~(sizeof(void*)-1))
130
131/* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */
132/* 64-bit machines, beware! SRB. */
133#define SIZEOF_PTR_LOG2 3
134
135/* to find an entry in a page-table */
136#define PAGE_PTR(address) \
137((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
138
139#define pte_clear(mm,addr,xp) pte_set_val(*(xp), (phys_t) 0, __pgprot(_PAGE_NEWPAGE)) 96#define pte_clear(mm,addr,xp) pte_set_val(*(xp), (phys_t) 0, __pgprot(_PAGE_NEWPAGE))
140 97
141#define pmd_none(x) (!((unsigned long)pmd_val(x) & ~_PAGE_NEWPAGE)) 98#define pmd_none(x) (!((unsigned long)pmd_val(x) & ~_PAGE_NEWPAGE))
142#define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE) 99#define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
100
143#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT) 101#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT)
144#define pmd_clear(xp) do { pmd_val(*(xp)) = _PAGE_NEWPAGE; } while (0) 102#define pmd_clear(xp) do { pmd_val(*(xp)) = _PAGE_NEWPAGE; } while (0)
145 103
@@ -149,14 +107,9 @@ extern unsigned long pg0[1024];
149#define pud_newpage(x) (pud_val(x) & _PAGE_NEWPAGE) 107#define pud_newpage(x) (pud_val(x) & _PAGE_NEWPAGE)
150#define pud_mkuptodate(x) (pud_val(x) &= ~_PAGE_NEWPAGE) 108#define pud_mkuptodate(x) (pud_val(x) &= ~_PAGE_NEWPAGE)
151 109
152#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
153
154#define pmd_page(pmd) phys_to_page(pmd_val(pmd) & PAGE_MASK) 110#define pmd_page(pmd) phys_to_page(pmd_val(pmd) & PAGE_MASK)
155 111
156#define pte_page(x) pfn_to_page(pte_pfn(x)) 112#define pte_page(x) pfn_to_page(pte_pfn(x))
157#define pte_address(x) (__va(pte_val(x) & PAGE_MASK))
158#define mk_phys(a, r) ((a) + (((unsigned long) r) << REGION_SHIFT))
159#define phys_addr(p) ((p) & ~REGION_MASK)
160 113
161#define pte_present(x) pte_get_bits(x, (_PAGE_PRESENT | _PAGE_PROTNONE)) 114#define pte_present(x) pte_get_bits(x, (_PAGE_PRESENT | _PAGE_PROTNONE))
162 115
@@ -309,7 +262,8 @@ static inline void set_pte(pte_t *pteptr, pte_t pteval)
309 262
310#define phys_to_page(phys) pfn_to_page(phys_to_pfn(phys)) 263#define phys_to_page(phys) pfn_to_page(phys_to_pfn(phys))
311#define __virt_to_page(virt) phys_to_page(__pa(virt)) 264#define __virt_to_page(virt) phys_to_page(__pa(virt))
312#define page_to_phys(page) pfn_to_phys(page_to_pfn(page)) 265#define page_to_phys(page) pfn_to_phys((pfn_t) page_to_pfn(page))
266#define virt_to_page(addr) __virt_to_page((const unsigned long) addr)
313 267
314#define mk_pte(page, pgprot) \ 268#define mk_pte(page, pgprot) \
315 ({ pte_t pte; \ 269 ({ pte_t pte; \
@@ -325,8 +279,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
325 return pte; 279 return pte;
326} 280}
327 281
328#define pmd_page_vaddr(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
329
330/* 282/*
331 * the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD] 283 * the pgd page can be thought of an array like this: pgd_t[PTRS_PER_PGD]
332 * 284 *
@@ -335,8 +287,6 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
335 */ 287 */
336#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) 288#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
337 289
338#define pgd_index_k(addr) pgd_index(addr)
339
340/* 290/*
341 * pgd_offset() returns a (pgd_t *) 291 * pgd_offset() returns a (pgd_t *)
342 * pgd_index() is used get the offset into the pgd page's array of pgd_t's; 292 * pgd_index() is used get the offset into the pgd page's array of pgd_t's;
@@ -355,8 +305,12 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
355 * this macro returns the index of the entry in the pmd page which would 305 * this macro returns the index of the entry in the pmd page which would
356 * control the given virtual address 306 * control the given virtual address
357 */ 307 */
308#define pmd_page_vaddr(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
358#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) 309#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
359 310
311#define pmd_page_vaddr(pmd) \
312 ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
313
360/* 314/*
361 * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE] 315 * the pte page can be thought of an array like this: pte_t[PTRS_PER_PTE]
362 * 316 *
@@ -372,6 +326,9 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
372#define pte_unmap(pte) do { } while (0) 326#define pte_unmap(pte) do { } while (0)
373#define pte_unmap_nested(pte) do { } while (0) 327#define pte_unmap_nested(pte) do { } while (0)
374 328
329struct mm_struct;
330extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr);
331
375#define update_mmu_cache(vma,address,pte) do ; while (0) 332#define update_mmu_cache(vma,address,pte) do ; while (0)
376 333
377/* Encode and de-code a swap entry */ 334/* Encode and de-code a swap entry */
@@ -388,29 +345,4 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
388 345
389#include <asm-generic/pgtable.h> 346#include <asm-generic/pgtable.h>
390 347
391#include <asm-generic/pgtable-nopud.h>
392
393#ifdef CONFIG_HIGHMEM
394/* Clear a kernel PTE and flush it from the TLB */
395#define kpte_clear_flush(ptep, vaddr) \
396do { \
397 pte_clear(&init_mm, vaddr, ptep); \
398 __flush_tlb_one(vaddr); \
399} while (0)
400#endif 348#endif
401
402#endif
403#endif
404
405#define virt_to_page(addr) __virt_to_page((const unsigned long) addr)
406
407/*
408 * Overrides for Emacs so that we follow Linus's tabbing style.
409 * Emacs will notice this stuff at the end of the file and automatically
410 * adjust the settings for this buffer only. This must remain at the end
411 * of the file.
412 * ---------------------------------------------------------------------------
413 * Local variables:
414 * c-file-style: "linux"
415 * End:
416 */
diff --git a/include/asm-um/processor-generic.h b/include/asm-um/processor-generic.h
index 78c0599cc80c..b7d9a16a7451 100644
--- a/include/asm-um/processor-generic.h
+++ b/include/asm-um/processor-generic.h
@@ -11,6 +11,7 @@ struct pt_regs;
11struct task_struct; 11struct task_struct;
12 12
13#include "asm/ptrace.h" 13#include "asm/ptrace.h"
14#include "asm/pgtable.h"
14#include "registers.h" 15#include "registers.h"
15#include "sysdep/archsetjmp.h" 16#include "sysdep/archsetjmp.h"
16 17
@@ -26,7 +27,6 @@ struct thread_struct {
26 * as of 2.6.11). 27 * as of 2.6.11).
27 */ 28 */
28 int forking; 29 int forking;
29 int nsyscalls;
30 struct pt_regs regs; 30 struct pt_regs regs;
31 int singlestep_syscall; 31 int singlestep_syscall;
32 void *fault_addr; 32 void *fault_addr;
@@ -58,7 +58,6 @@ struct thread_struct {
58#define INIT_THREAD \ 58#define INIT_THREAD \
59{ \ 59{ \
60 .forking = 0, \ 60 .forking = 0, \
61 .nsyscalls = 0, \
62 .regs = EMPTY_REGS, \ 61 .regs = EMPTY_REGS, \
63 .fault_addr = NULL, \ 62 .fault_addr = NULL, \
64 .prev_sched = NULL, \ 63 .prev_sched = NULL, \
@@ -68,10 +67,6 @@ struct thread_struct {
68 .request = { 0 } \ 67 .request = { 0 } \
69} 68}
70 69
71typedef struct {
72 unsigned long seg;
73} mm_segment_t;
74
75extern struct task_struct *alloc_task_struct(void); 70extern struct task_struct *alloc_task_struct(void);
76 71
77static inline void release_thread(struct task_struct *task) 72static inline void release_thread(struct task_struct *task)
@@ -97,9 +92,7 @@ static inline void mm_copy_segments(struct mm_struct *from_mm,
97/* 92/*
98 * User space process size: 3GB (default). 93 * User space process size: 3GB (default).
99 */ 94 */
100extern unsigned long task_size; 95#define TASK_SIZE (CONFIG_TOP_ADDR & PGDIR_MASK)
101
102#define TASK_SIZE (task_size)
103 96
104/* This decides where the kernel will search for a free chunk of vm 97/* This decides where the kernel will search for a free chunk of vm
105 * space during mmap's. 98 * space during mmap's.
@@ -128,6 +121,6 @@ extern struct cpuinfo_um cpu_data[];
128 121
129 122
130#define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf) 123#define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf)
131#define get_wchan(p) (0) 124extern unsigned long get_wchan(struct task_struct *p);
132 125
133#endif 126#endif
diff --git a/include/asm-um/processor-i386.h b/include/asm-um/processor-i386.h
index 595f1c3e1e40..a2b7fe13fe1e 100644
--- a/include/asm-um/processor-i386.h
+++ b/include/asm-um/processor-i386.h
@@ -10,7 +10,6 @@
10#include "asm/host_ldt.h" 10#include "asm/host_ldt.h"
11#include "asm/segment.h" 11#include "asm/segment.h"
12 12
13extern int host_has_xmm;
14extern int host_has_cmov; 13extern int host_has_cmov;
15 14
16/* include faultinfo structure */ 15/* include faultinfo structure */
diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h
index 6e5fd5c892d0..356b83e2c22e 100644
--- a/include/asm-um/thread_info.h
+++ b/include/asm-um/thread_info.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
5 5
@@ -8,8 +8,9 @@
8 8
9#ifndef __ASSEMBLY__ 9#ifndef __ASSEMBLY__
10 10
11#include <asm/processor.h>
12#include <asm/types.h> 11#include <asm/types.h>
12#include <asm/page.h>
13#include <asm/uaccess.h>
13 14
14struct thread_info { 15struct thread_info {
15 struct task_struct *task; /* main task structure */ 16 struct task_struct *task; /* main task structure */
@@ -75,8 +76,8 @@ static inline struct thread_info *current_thread_info(void)
75#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ 76#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
76#define TIF_SIGPENDING 1 /* signal pending */ 77#define TIF_SIGPENDING 1 /* signal pending */
77#define TIF_NEED_RESCHED 2 /* rescheduling necessary */ 78#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
78#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling 79#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
79 * TIF_NEED_RESCHED 80 * TIF_NEED_RESCHED
80 */ 81 */
81#define TIF_RESTART_BLOCK 4 82#define TIF_RESTART_BLOCK 4
82#define TIF_MEMDIE 5 83#define TIF_MEMDIE 5
diff --git a/include/asm-um/tlb.h b/include/asm-um/tlb.h
index c640033bc1fd..39fc475df6c9 100644
--- a/include/asm-um/tlb.h
+++ b/include/asm-um/tlb.h
@@ -1,6 +1,126 @@
1#ifndef __UM_TLB_H 1#ifndef __UM_TLB_H
2#define __UM_TLB_H 2#define __UM_TLB_H
3 3
4#include <asm/arch/tlb.h> 4#include <linux/swap.h>
5#include <asm/percpu.h>
6#include <asm/pgalloc.h>
7#include <asm/tlbflush.h>
8
9#define tlb_start_vma(tlb, vma) do { } while (0)
10#define tlb_end_vma(tlb, vma) do { } while (0)
11#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
12
13/* struct mmu_gather is an opaque type used by the mm code for passing around
14 * any data needed by arch specific code for tlb_remove_page.
15 */
16struct mmu_gather {
17 struct mm_struct *mm;
18 unsigned int need_flush; /* Really unmapped some ptes? */
19 unsigned long start;
20 unsigned long end;
21 unsigned int fullmm; /* non-zero means full mm flush */
22};
23
24/* Users of the generic TLB shootdown code must declare this storage space. */
25DECLARE_PER_CPU(struct mmu_gather, mmu_gathers);
26
27static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep,
28 unsigned long address)
29{
30 if (tlb->start > address)
31 tlb->start = address;
32 if (tlb->end < address + PAGE_SIZE)
33 tlb->end = address + PAGE_SIZE;
34}
35
36static inline void init_tlb_gather(struct mmu_gather *tlb)
37{
38 tlb->need_flush = 0;
39
40 tlb->start = TASK_SIZE;
41 tlb->end = 0;
42
43 if (tlb->fullmm) {
44 tlb->start = 0;
45 tlb->end = TASK_SIZE;
46 }
47}
48
49/* tlb_gather_mmu
50 * Return a pointer to an initialized struct mmu_gather.
51 */
52static inline struct mmu_gather *
53tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush)
54{
55 struct mmu_gather *tlb = &get_cpu_var(mmu_gathers);
56
57 tlb->mm = mm;
58 tlb->fullmm = full_mm_flush;
59
60 init_tlb_gather(tlb);
61
62 return tlb;
63}
64
65extern void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
66 unsigned long end);
67
68static inline void
69tlb_flush_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
70{
71 if (!tlb->need_flush)
72 return;
73
74 flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end);
75 init_tlb_gather(tlb);
76}
77
78/* tlb_finish_mmu
79 * Called at the end of the shootdown operation to free up any resources
80 * that were required.
81 */
82static inline void
83tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
84{
85 tlb_flush_mmu(tlb, start, end);
86
87 /* keep the page table cache within bounds */
88 check_pgt_cache();
89
90 put_cpu_var(mmu_gathers);
91}
92
93/* tlb_remove_page
94 * Must perform the equivalent to __free_pte(pte_get_and_clear(ptep)),
95 * while handling the additional races in SMP caused by other CPUs
96 * caching valid mappings in their TLBs.
97 */
98static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page)
99{
100 tlb->need_flush = 1;
101 free_page_and_swap_cache(page);
102 return;
103}
104
105/**
106 * tlb_remove_tlb_entry - remember a pte unmapping for later tlb invalidation.
107 *
108 * Record the fact that pte's were really umapped in ->need_flush, so we can
109 * later optimise away the tlb invalidate. This helps when userspace is
110 * unmapping already-unmapped pages, which happens quite a lot.
111 */
112#define tlb_remove_tlb_entry(tlb, ptep, address) \
113 do { \
114 tlb->need_flush = 1; \
115 __tlb_remove_tlb_entry(tlb, ptep, address); \
116 } while (0)
117
118#define pte_free_tlb(tlb, ptep) __pte_free_tlb(tlb, ptep)
119
120#define pud_free_tlb(tlb, pudp) __pud_free_tlb(tlb, pudp)
121
122#define pmd_free_tlb(tlb, pmdp) __pmd_free_tlb(tlb, pmdp)
123
124#define tlb_migrate_finish(mm) do {} while (0)
5 125
6#endif 126#endif
diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h
index 077032d4fc47..b9a895d6fa1d 100644
--- a/include/asm-um/uaccess.h
+++ b/include/asm-um/uaccess.h
@@ -6,7 +6,15 @@
6#ifndef __UM_UACCESS_H 6#ifndef __UM_UACCESS_H
7#define __UM_UACCESS_H 7#define __UM_UACCESS_H
8 8
9#include "linux/sched.h" 9#include <asm/errno.h>
10#include <asm/processor.h>
11
12/* thread_info has a mm_segment_t in it, so put the definition up here */
13typedef struct {
14 unsigned long seg;
15} mm_segment_t;
16
17#include "linux/thread_info.h"
10 18
11#define VERIFY_READ 0 19#define VERIFY_READ 0
12#define VERIFY_WRITE 1 20#define VERIFY_WRITE 1
diff --git a/include/asm-v850/io.h b/include/asm-v850/io.h
index cc364fcbec10..cdad251fba9f 100644
--- a/include/asm-v850/io.h
+++ b/include/asm-v850/io.h
@@ -122,8 +122,6 @@ outsl (unsigned long port, const void *src, unsigned long count)
122#endif 122#endif
123 123
124/* Conversion between virtual and physical mappings. */ 124/* Conversion between virtual and physical mappings. */
125#define mm_ptov(addr) ((void *)__phys_to_virt (addr))
126#define mm_vtop(addr) ((unsigned long)__virt_to_phys (addr))
127#define phys_to_virt(addr) ((void *)__phys_to_virt (addr)) 125#define phys_to_virt(addr) ((void *)__phys_to_virt (addr))
128#define virt_to_phys(addr) ((unsigned long)__virt_to_phys (addr)) 126#define virt_to_phys(addr) ((unsigned long)__virt_to_phys (addr))
129 127
diff --git a/include/asm-x86/bitops_64.h b/include/asm-x86/bitops_64.h
index 48adbf56ca60..aaf15194d536 100644
--- a/include/asm-x86/bitops_64.h
+++ b/include/asm-x86/bitops_64.h
@@ -37,12 +37,6 @@ static inline long __scanbit(unsigned long val, unsigned long max)
37 ((off)+(__scanbit(~(((*(unsigned long *)addr)) >> (off)),(size)-(off)))) : \ 37 ((off)+(__scanbit(~(((*(unsigned long *)addr)) >> (off)),(size)-(off)))) : \
38 find_next_zero_bit(addr,size,off))) 38 find_next_zero_bit(addr,size,off)))
39 39
40/*
41 * Find string of zero bits in a bitmap. -1 when not found.
42 */
43extern unsigned long
44find_next_zero_string(unsigned long *bitmap, long start, long nbits, int len);
45
46static inline void set_bit_string(unsigned long *bitmap, unsigned long i, 40static inline void set_bit_string(unsigned long *bitmap, unsigned long i,
47 int len) 41 int len)
48{ 42{
@@ -53,16 +47,6 @@ static inline void set_bit_string(unsigned long *bitmap, unsigned long i,
53 } 47 }
54} 48}
55 49
56static inline void __clear_bit_string(unsigned long *bitmap, unsigned long i,
57 int len)
58{
59 unsigned long end = i + len;
60 while (i < end) {
61 __clear_bit(i, bitmap);
62 i++;
63 }
64}
65
66/** 50/**
67 * ffz - find first zero in word. 51 * ffz - find first zero in word.
68 * @word: The word to search 52 * @word: The word to search
diff --git a/include/asm-x86/delay.h b/include/asm-x86/delay.h
index d11d47fc1a0e..409a649204aa 100644
--- a/include/asm-x86/delay.h
+++ b/include/asm-x86/delay.h
@@ -13,7 +13,7 @@ extern void __bad_ndelay(void);
13 13
14extern void __udelay(unsigned long usecs); 14extern void __udelay(unsigned long usecs);
15extern void __ndelay(unsigned long nsecs); 15extern void __ndelay(unsigned long nsecs);
16extern void __const_udelay(unsigned long usecs); 16extern void __const_udelay(unsigned long xloops);
17extern void __delay(unsigned long loops); 17extern void __delay(unsigned long loops);
18 18
19/* 0x10c7 is 2**32 / 1000000 (rounded up) */ 19/* 0x10c7 is 2**32 / 1000000 (rounded up) */
diff --git a/include/asm-x86/highmem.h b/include/asm-x86/highmem.h
index c25cfcaab589..479767c9195f 100644
--- a/include/asm-x86/highmem.h
+++ b/include/asm-x86/highmem.h
@@ -38,11 +38,6 @@ extern pte_t *pkmap_page_table;
38 * easily, subsequent pte tables have to be allocated in one physical 38 * easily, subsequent pte tables have to be allocated in one physical
39 * chunk of RAM. 39 * chunk of RAM.
40 */ 40 */
41#ifdef CONFIG_X86_PAE
42#define LAST_PKMAP 512
43#else
44#define LAST_PKMAP 1024
45#endif
46/* 41/*
47 * Ordering is: 42 * Ordering is:
48 * 43 *
@@ -58,7 +53,6 @@ extern pte_t *pkmap_page_table;
58 * VMALLOC_START 53 * VMALLOC_START
59 * high_memory 54 * high_memory
60 */ 55 */
61#define PKMAP_BASE ( (FIXADDR_BOOT_START - PAGE_SIZE*(LAST_PKMAP + 1)) & PMD_MASK )
62#define LAST_PKMAP_MASK (LAST_PKMAP-1) 56#define LAST_PKMAP_MASK (LAST_PKMAP-1)
63#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT) 57#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
64#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) 58#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
diff --git a/include/asm-x86/pgalloc_32.h b/include/asm-x86/pgalloc_32.h
index 6c21ef951dab..bab12718a913 100644
--- a/include/asm-x86/pgalloc_32.h
+++ b/include/asm-x86/pgalloc_32.h
@@ -36,17 +36,17 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *p
36 * Allocate and free page tables. 36 * Allocate and free page tables.
37 */ 37 */
38extern pgd_t *pgd_alloc(struct mm_struct *); 38extern pgd_t *pgd_alloc(struct mm_struct *);
39extern void pgd_free(pgd_t *pgd); 39extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
40 40
41extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long); 41extern pte_t *pte_alloc_one_kernel(struct mm_struct *, unsigned long);
42extern struct page *pte_alloc_one(struct mm_struct *, unsigned long); 42extern struct page *pte_alloc_one(struct mm_struct *, unsigned long);
43 43
44static inline void pte_free_kernel(pte_t *pte) 44static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
45{ 45{
46 free_page((unsigned long)pte); 46 free_page((unsigned long)pte);
47} 47}
48 48
49static inline void pte_free(struct page *pte) 49static inline void pte_free(struct mm_struct *mm, struct page *pte)
50{ 50{
51 __free_page(pte); 51 __free_page(pte);
52} 52}
@@ -63,7 +63,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
63 return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 63 return (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
64} 64}
65 65
66static inline void pmd_free(pmd_t *pmd) 66static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
67{ 67{
68 BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); 68 BUG_ON((unsigned long)pmd & (PAGE_SIZE-1));
69 free_page((unsigned long)pmd); 69 free_page((unsigned long)pmd);
diff --git a/include/asm-x86/pgalloc_64.h b/include/asm-x86/pgalloc_64.h
index 8bb564687860..4f6220db22b1 100644
--- a/include/asm-x86/pgalloc_64.h
+++ b/include/asm-x86/pgalloc_64.h
@@ -17,7 +17,7 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *p
17 set_pmd(pmd, __pmd(_PAGE_TABLE | (page_to_pfn(pte) << PAGE_SHIFT))); 17 set_pmd(pmd, __pmd(_PAGE_TABLE | (page_to_pfn(pte) << PAGE_SHIFT)));
18} 18}
19 19
20static inline void pmd_free(pmd_t *pmd) 20static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
21{ 21{
22 BUG_ON((unsigned long)pmd & (PAGE_SIZE-1)); 22 BUG_ON((unsigned long)pmd & (PAGE_SIZE-1));
23 free_page((unsigned long)pmd); 23 free_page((unsigned long)pmd);
@@ -33,7 +33,7 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
33 return (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT); 33 return (pud_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
34} 34}
35 35
36static inline void pud_free (pud_t *pud) 36static inline void pud_free(struct mm_struct *mm, pud_t *pud)
37{ 37{
38 BUG_ON((unsigned long)pud & (PAGE_SIZE-1)); 38 BUG_ON((unsigned long)pud & (PAGE_SIZE-1));
39 free_page((unsigned long)pud); 39 free_page((unsigned long)pud);
@@ -42,19 +42,21 @@ static inline void pud_free (pud_t *pud)
42static inline void pgd_list_add(pgd_t *pgd) 42static inline void pgd_list_add(pgd_t *pgd)
43{ 43{
44 struct page *page = virt_to_page(pgd); 44 struct page *page = virt_to_page(pgd);
45 unsigned long flags;
45 46
46 spin_lock(&pgd_lock); 47 spin_lock_irqsave(&pgd_lock, flags);
47 list_add(&page->lru, &pgd_list); 48 list_add(&page->lru, &pgd_list);
48 spin_unlock(&pgd_lock); 49 spin_unlock_irqrestore(&pgd_lock, flags);
49} 50}
50 51
51static inline void pgd_list_del(pgd_t *pgd) 52static inline void pgd_list_del(pgd_t *pgd)
52{ 53{
53 struct page *page = virt_to_page(pgd); 54 struct page *page = virt_to_page(pgd);
55 unsigned long flags;
54 56
55 spin_lock(&pgd_lock); 57 spin_lock_irqsave(&pgd_lock, flags);
56 list_del(&page->lru); 58 list_del(&page->lru);
57 spin_unlock(&pgd_lock); 59 spin_unlock_irqrestore(&pgd_lock, flags);
58} 60}
59 61
60static inline pgd_t *pgd_alloc(struct mm_struct *mm) 62static inline pgd_t *pgd_alloc(struct mm_struct *mm)
@@ -77,7 +79,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
77 return pgd; 79 return pgd;
78} 80}
79 81
80static inline void pgd_free(pgd_t *pgd) 82static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
81{ 83{
82 BUG_ON((unsigned long)pgd & (PAGE_SIZE-1)); 84 BUG_ON((unsigned long)pgd & (PAGE_SIZE-1));
83 pgd_list_del(pgd); 85 pgd_list_del(pgd);
@@ -100,13 +102,13 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm, unsigned long add
100/* Should really implement gc for free page table pages. This could be 102/* Should really implement gc for free page table pages. This could be
101 done with a reference count in struct page. */ 103 done with a reference count in struct page. */
102 104
103static inline void pte_free_kernel(pte_t *pte) 105static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
104{ 106{
105 BUG_ON((unsigned long)pte & (PAGE_SIZE-1)); 107 BUG_ON((unsigned long)pte & (PAGE_SIZE-1));
106 free_page((unsigned long)pte); 108 free_page((unsigned long)pte);
107} 109}
108 110
109static inline void pte_free(struct page *pte) 111static inline void pte_free(struct mm_struct *mm, struct page *pte)
110{ 112{
111 __free_page(pte); 113 __free_page(pte);
112} 114}
diff --git a/include/asm-x86/pgtable_32.h b/include/asm-x86/pgtable_32.h
index 935630d17304..80dd438642f6 100644
--- a/include/asm-x86/pgtable_32.h
+++ b/include/asm-x86/pgtable_32.h
@@ -66,6 +66,14 @@ void paging_init(void);
66#define VMALLOC_OFFSET (8*1024*1024) 66#define VMALLOC_OFFSET (8*1024*1024)
67#define VMALLOC_START (((unsigned long) high_memory + \ 67#define VMALLOC_START (((unsigned long) high_memory + \
68 2*VMALLOC_OFFSET-1) & ~(VMALLOC_OFFSET-1)) 68 2*VMALLOC_OFFSET-1) & ~(VMALLOC_OFFSET-1))
69#ifdef CONFIG_X86_PAE
70#define LAST_PKMAP 512
71#else
72#define LAST_PKMAP 1024
73#endif
74
75#define PKMAP_BASE ((FIXADDR_BOOT_START - PAGE_SIZE*(LAST_PKMAP + 1)) & PMD_MASK)
76
69#ifdef CONFIG_HIGHMEM 77#ifdef CONFIG_HIGHMEM
70# define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) 78# define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE)
71#else 79#else
diff --git a/include/asm-x86/timex.h b/include/asm-x86/timex.h
index 27cfd6c599ba..43e5a78500c5 100644
--- a/include/asm-x86/timex.h
+++ b/include/asm-x86/timex.h
@@ -14,7 +14,6 @@
14#endif 14#endif
15#define CLOCK_TICK_RATE PIT_TICK_RATE 15#define CLOCK_TICK_RATE PIT_TICK_RATE
16 16
17extern int read_current_timer(unsigned long *timer_value); 17#define ARCH_HAS_READ_CURRENT_TIMER
18#define ARCH_HAS_READ_CURRENT_TIMER 1
19 18
20#endif 19#endif
diff --git a/include/asm-x86/unistd_32.h b/include/asm-x86/unistd_32.h
index 8d8f9b5adbb9..984123a68f7c 100644
--- a/include/asm-x86/unistd_32.h
+++ b/include/asm-x86/unistd_32.h
@@ -327,9 +327,11 @@
327#define __NR_epoll_pwait 319 327#define __NR_epoll_pwait 319
328#define __NR_utimensat 320 328#define __NR_utimensat 320
329#define __NR_signalfd 321 329#define __NR_signalfd 321
330#define __NR_timerfd 322 330#define __NR_timerfd_create 322
331#define __NR_eventfd 323 331#define __NR_eventfd 323
332#define __NR_fallocate 324 332#define __NR_fallocate 324
333#define __NR_timerfd_settime 325
334#define __NR_timerfd_gettime 326
333 335
334#ifdef __KERNEL__ 336#ifdef __KERNEL__
335 337
diff --git a/include/asm-x86/unistd_64.h b/include/asm-x86/unistd_64.h
index 5ff4d3e24c34..3883ceb54ef5 100644
--- a/include/asm-x86/unistd_64.h
+++ b/include/asm-x86/unistd_64.h
@@ -629,12 +629,17 @@ __SYSCALL(__NR_utimensat, sys_utimensat)
629__SYSCALL(__NR_epoll_pwait, sys_epoll_pwait) 629__SYSCALL(__NR_epoll_pwait, sys_epoll_pwait)
630#define __NR_signalfd 282 630#define __NR_signalfd 282
631__SYSCALL(__NR_signalfd, sys_signalfd) 631__SYSCALL(__NR_signalfd, sys_signalfd)
632#define __NR_timerfd 283 632#define __NR_timerfd_create 283
633__SYSCALL(__NR_timerfd, sys_timerfd) 633__SYSCALL(__NR_timerfd_create, sys_timerfd_create)
634#define __NR_eventfd 284 634#define __NR_eventfd 284
635__SYSCALL(__NR_eventfd, sys_eventfd) 635__SYSCALL(__NR_eventfd, sys_eventfd)
636#define __NR_fallocate 285 636#define __NR_fallocate 285
637__SYSCALL(__NR_fallocate, sys_fallocate) 637__SYSCALL(__NR_fallocate, sys_fallocate)
638#define __NR_timerfd_settime 286
639__SYSCALL(__NR_timerfd_settime, sys_timerfd_settime)
640#define __NR_timerfd_gettime 287
641__SYSCALL(__NR_timerfd_gettime, sys_timerfd_gettime)
642
638 643
639#ifndef __NO_STUBS 644#ifndef __NO_STUBS
640#define __ARCH_WANT_OLD_READDIR 645#define __ARCH_WANT_OLD_READDIR
diff --git a/include/asm-xtensa/pgalloc.h b/include/asm-xtensa/pgalloc.h
index 3e5b56525102..1d51ba5463f9 100644
--- a/include/asm-xtensa/pgalloc.h
+++ b/include/asm-xtensa/pgalloc.h
@@ -31,7 +31,7 @@ pgd_alloc(struct mm_struct *mm)
31 return (pgd_t*) __get_free_pages(GFP_KERNEL | __GFP_ZERO, PGD_ORDER); 31 return (pgd_t*) __get_free_pages(GFP_KERNEL | __GFP_ZERO, PGD_ORDER);
32} 32}
33 33
34static inline void pgd_free(pgd_t *pgd) 34static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
35{ 35{
36 free_page((unsigned long)pgd); 36 free_page((unsigned long)pgd);
37} 37}
@@ -52,12 +52,12 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,
52 return virt_to_page(pte_alloc_one_kernel(mm, addr)); 52 return virt_to_page(pte_alloc_one_kernel(mm, addr));
53} 53}
54 54
55static inline void pte_free_kernel(pte_t *pte) 55static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
56{ 56{
57 kmem_cache_free(pgtable_cache, pte); 57 kmem_cache_free(pgtable_cache, pte);
58} 58}
59 59
60static inline void pte_free(struct page *page) 60static inline void pte_free(struct mm_struct *mm, struct page *page)
61{ 61{
62 kmem_cache_free(pgtable_cache, page_address(page)); 62 kmem_cache_free(pgtable_cache, page_address(page));
63} 63}
diff --git a/include/asm-xtensa/tlb.h b/include/asm-xtensa/tlb.h
index 4830232017af..31c220faca02 100644
--- a/include/asm-xtensa/tlb.h
+++ b/include/asm-xtensa/tlb.h
@@ -42,6 +42,6 @@
42 42
43#include <asm-generic/tlb.h> 43#include <asm-generic/tlb.h>
44 44
45#define __pte_free_tlb(tlb,pte) pte_free(pte) 45#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte)
46 46
47#endif /* _XTENSA_TLB_H */ 47#endif /* _XTENSA_TLB_H */
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index c0f9bb78727d..93631229fd5c 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -219,6 +219,7 @@ unifdef-y += i2c-dev.h
219unifdef-y += icmp.h 219unifdef-y += icmp.h
220unifdef-y += icmpv6.h 220unifdef-y += icmpv6.h
221unifdef-y += if_addr.h 221unifdef-y += if_addr.h
222unifdef-y += if_addrlabel.h
222unifdef-y += if_arp.h 223unifdef-y += if_arp.h
223unifdef-y += if_bridge.h 224unifdef-y += if_bridge.h
224unifdef-y += if_ec.h 225unifdef-y += if_ec.h
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h
index 22eb9367235a..0260c3e79fdd 100644
--- a/include/linux/ac97_codec.h
+++ b/include/linux/ac97_codec.h
@@ -326,11 +326,7 @@ struct ac97_ops
326#define AC97_DEFAULT_POWER_OFF 4 /* Needs warm reset to power up */ 326#define AC97_DEFAULT_POWER_OFF 4 /* Needs warm reset to power up */
327}; 327};
328 328
329extern int ac97_read_proc (char *page_out, char **start, off_t off,
330 int count, int *eof, void *data);
331extern int ac97_probe_codec(struct ac97_codec *); 329extern int ac97_probe_codec(struct ac97_codec *);
332extern unsigned int ac97_set_adc_rate(struct ac97_codec *codec, unsigned int rate);
333extern unsigned int ac97_set_dac_rate(struct ac97_codec *codec, unsigned int rate);
334 330
335extern struct ac97_codec *ac97_alloc_codec(void); 331extern struct ac97_codec *ac97_alloc_codec(void);
336extern void ac97_release_codec(struct ac97_codec *codec); 332extern void ac97_release_codec(struct ac97_codec *codec);
@@ -363,7 +359,4 @@ struct ac97_quirk {
363 int type; /* quirk type above */ 359 int type; /* quirk type above */
364}; 360};
365 361
366struct pci_dev;
367extern int ac97_tune_hardware(struct pci_dev *pdev, struct ac97_quirk *quirk, int override);
368
369#endif /* _AC97_CODEC_H_ */ 362#endif /* _AC97_CODEC_H_ */
diff --git a/include/linux/acct.h b/include/linux/acct.h
index 302eb727ecb8..e8cae54e8d88 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -173,7 +173,11 @@ typedef struct acct acct_t;
173static inline u32 jiffies_to_AHZ(unsigned long x) 173static inline u32 jiffies_to_AHZ(unsigned long x)
174{ 174{
175#if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0 175#if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0
176# if HZ < AHZ
177 return x * (AHZ / HZ);
178# else
176 return x / (HZ / AHZ); 179 return x / (HZ / AHZ);
180# endif
177#else 181#else
178 u64 tmp = (u64)x * TICK_NSEC; 182 u64 tmp = (u64)x * TICK_NSEC;
179 do_div(tmp, (NSEC_PER_SEC / AHZ)); 183 do_div(tmp, (NSEC_PER_SEC / AHZ));
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index fab9f70fe39d..5a5a13b64d09 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -80,7 +80,6 @@ typedef int (*acpi_table_handler) (struct acpi_table_header *table);
80typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); 80typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
81 81
82char * __acpi_map_table (unsigned long phys_addr, unsigned long size); 82char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
83unsigned long acpi_find_rsdp (void);
84int acpi_boot_init (void); 83int acpi_boot_init (void);
85int acpi_boot_table_init (void); 84int acpi_boot_table_init (void);
86int acpi_numa_init (void); 85int acpi_numa_init (void);
@@ -115,7 +114,9 @@ int acpi_unmap_lsapic(int cpu);
115 114
116int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); 115int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base);
117int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base); 116int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);
117void acpi_irq_stats_init(void);
118 118
119extern u32 acpi_irq_handled;
119extern int acpi_mp_config; 120extern int acpi_mp_config;
120 121
121extern struct acpi_mcfg_allocation *pci_mmcfg_config; 122extern struct acpi_mcfg_allocation *pci_mmcfg_config;
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h
index abc521cfb084..03e34547d489 100644
--- a/include/linux/agp_backend.h
+++ b/include/linux/agp_backend.h
@@ -109,6 +109,7 @@ extern int agp_unbind_memory(struct agp_memory *);
109extern void agp_enable(struct agp_bridge_data *, u32); 109extern void agp_enable(struct agp_bridge_data *, u32);
110extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); 110extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *);
111extern void agp_backend_release(struct agp_bridge_data *); 111extern void agp_backend_release(struct agp_bridge_data *);
112extern void agp_flush_chipset(struct agp_bridge_data *);
112 113
113#endif /* __KERNEL__ */ 114#endif /* __KERNEL__ */
114#endif /* _AGP_BACKEND_H */ 115#endif /* _AGP_BACKEND_H */
diff --git a/include/linux/agpgart.h b/include/linux/agpgart.h
index 09fbf7e5a6cb..62aef589eb94 100644
--- a/include/linux/agpgart.h
+++ b/include/linux/agpgart.h
@@ -38,6 +38,7 @@
38#define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int) 38#define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int)
39#define AGPIOC_BIND _IOW (AGPIOC_BASE, 8, struct agp_bind*) 39#define AGPIOC_BIND _IOW (AGPIOC_BASE, 8, struct agp_bind*)
40#define AGPIOC_UNBIND _IOW (AGPIOC_BASE, 9, struct agp_unbind*) 40#define AGPIOC_UNBIND _IOW (AGPIOC_BASE, 9, struct agp_unbind*)
41#define AGPIOC_CHIPSET_FLUSH _IO (AGPIOC_BASE, 10)
41 42
42#define AGP_DEVICE "/dev/agpgart" 43#define AGP_DEVICE "/dev/agpgart"
43 44
diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h
index bdca3f1b3213..eb640f0acfac 100644
--- a/include/linux/async_tx.h
+++ b/include/linux/async_tx.h
@@ -47,7 +47,6 @@ struct dma_chan_ref {
47 * address is an implied source, whereas the asynchronous case it must be listed 47 * address is an implied source, whereas the asynchronous case it must be listed
48 * as a source. The destination address must be the first address in the source 48 * as a source. The destination address must be the first address in the source
49 * array. 49 * array.
50 * @ASYNC_TX_ASSUME_COHERENT: skip cache maintenance operations
51 * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a 50 * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a
52 * dependency chain 51 * dependency chain
53 * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining. 52 * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining.
@@ -55,7 +54,6 @@ struct dma_chan_ref {
55enum async_tx_flags { 54enum async_tx_flags {
56 ASYNC_TX_XOR_ZERO_DST = (1 << 0), 55 ASYNC_TX_XOR_ZERO_DST = (1 << 0),
57 ASYNC_TX_XOR_DROP_DST = (1 << 1), 56 ASYNC_TX_XOR_DROP_DST = (1 << 1),
58 ASYNC_TX_ASSUME_COHERENT = (1 << 2),
59 ASYNC_TX_ACK = (1 << 3), 57 ASYNC_TX_ACK = (1 << 3),
60 ASYNC_TX_DEP_ACK = (1 << 4), 58 ASYNC_TX_DEP_ACK = (1 << 4),
61}; 59};
@@ -64,9 +62,15 @@ enum async_tx_flags {
64void async_tx_issue_pending_all(void); 62void async_tx_issue_pending_all(void);
65enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); 63enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
66void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx); 64void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx);
65#ifdef CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL
66#include <asm/async_tx.h>
67#else
68#define async_tx_find_channel(dep, type, dst, dst_count, src, src_count, len) \
69 __async_tx_find_channel(dep, type)
67struct dma_chan * 70struct dma_chan *
68async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, 71__async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
69 enum dma_transaction_type tx_type); 72 enum dma_transaction_type tx_type);
73#endif /* CONFIG_ARCH_HAS_ASYNC_TX_FIND_CHANNEL */
70#else 74#else
71static inline void async_tx_issue_pending_all(void) 75static inline void async_tx_issue_pending_all(void)
72{ 76{
@@ -88,7 +92,8 @@ async_tx_run_dependencies(struct dma_async_tx_descriptor *tx,
88 92
89static inline struct dma_chan * 93static inline struct dma_chan *
90async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx, 94async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
91 enum dma_transaction_type tx_type) 95 enum dma_transaction_type tx_type, struct page **dst, int dst_count,
96 struct page **src, int src_count, size_t len)
92{ 97{
93 return NULL; 98 return NULL;
94} 99}
diff --git a/include/linux/pata_platform.h b/include/linux/ata_platform.h
index 6a7a92db294c..b856a2a590d9 100644
--- a/include/linux/pata_platform.h
+++ b/include/linux/ata_platform.h
@@ -1,5 +1,5 @@
1#ifndef __LINUX_PATA_PLATFORM_H 1#ifndef __LINUX_ATA_PLATFORM_H
2#define __LINUX_PATA_PLATFORM_H 2#define __LINUX_ATA_PLATFORM_H
3 3
4struct pata_platform_info { 4struct pata_platform_info {
5 /* 5 /*
@@ -24,4 +24,11 @@ extern int __devinit __pata_platform_probe(struct device *dev,
24 24
25extern int __devexit __pata_platform_remove(struct device *dev); 25extern int __devexit __pata_platform_remove(struct device *dev);
26 26
27#endif /* __LINUX_PATA_PLATFORM_H */ 27/*
28 * Marvell SATA private data
29 */
30struct mv_sata_platform_data {
31 int n_ports; /* number of sata ports */
32};
33
34#endif /* __LINUX_ATA_PLATFORM_H */
diff --git a/include/linux/capability.h b/include/linux/capability.h
index bb017edffd56..7d50ff6d269f 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -14,7 +14,6 @@
14#define _LINUX_CAPABILITY_H 14#define _LINUX_CAPABILITY_H
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/compiler.h>
18 17
19struct task_struct; 18struct task_struct;
20 19
@@ -23,13 +22,20 @@ struct task_struct;
23 kernel might be somewhat backwards compatible, but don't bet on 22 kernel might be somewhat backwards compatible, but don't bet on
24 it. */ 23 it. */
25 24
26/* XXX - Note, cap_t, is defined by POSIX to be an "opaque" pointer to 25/* Note, cap_t, is defined by POSIX (draft) to be an "opaque" pointer to
27 a set of three capability sets. The transposition of 3*the 26 a set of three capability sets. The transposition of 3*the
28 following structure to such a composite is better handled in a user 27 following structure to such a composite is better handled in a user
29 library since the draft standard requires the use of malloc/free 28 library since the draft standard requires the use of malloc/free
30 etc.. */ 29 etc.. */
31 30
32#define _LINUX_CAPABILITY_VERSION 0x19980330 31#define _LINUX_CAPABILITY_VERSION_1 0x19980330
32#define _LINUX_CAPABILITY_U32S_1 1
33
34#define _LINUX_CAPABILITY_VERSION_2 0x20071026
35#define _LINUX_CAPABILITY_U32S_2 2
36
37#define _LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_2
38#define _LINUX_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_2
33 39
34typedef struct __user_cap_header_struct { 40typedef struct __user_cap_header_struct {
35 __u32 version; 41 __u32 version;
@@ -42,41 +48,42 @@ typedef struct __user_cap_data_struct {
42 __u32 inheritable; 48 __u32 inheritable;
43} __user *cap_user_data_t; 49} __user *cap_user_data_t;
44 50
51
45#define XATTR_CAPS_SUFFIX "capability" 52#define XATTR_CAPS_SUFFIX "capability"
46#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX 53#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
47 54
48#define XATTR_CAPS_SZ (3*sizeof(__le32))
49#define VFS_CAP_REVISION_MASK 0xFF000000 55#define VFS_CAP_REVISION_MASK 0xFF000000
56#define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK
57#define VFS_CAP_FLAGS_EFFECTIVE 0x000001
58
50#define VFS_CAP_REVISION_1 0x01000000 59#define VFS_CAP_REVISION_1 0x01000000
60#define VFS_CAP_U32_1 1
61#define XATTR_CAPS_SZ_1 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_1))
51 62
52#define VFS_CAP_REVISION VFS_CAP_REVISION_1 63#define VFS_CAP_REVISION_2 0x02000000
64#define VFS_CAP_U32_2 2
65#define XATTR_CAPS_SZ_2 (sizeof(__le32)*(1 + 2*VFS_CAP_U32_2))
66
67#define XATTR_CAPS_SZ XATTR_CAPS_SZ_2
68#define VFS_CAP_U32 VFS_CAP_U32_2
69#define VFS_CAP_REVISION VFS_CAP_REVISION_2
53 70
54#define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK
55#define VFS_CAP_FLAGS_EFFECTIVE 0x000001
56 71
57struct vfs_cap_data { 72struct vfs_cap_data {
58 __u32 magic_etc; /* Little endian */ 73 __le32 magic_etc; /* Little endian */
59 __u32 permitted; /* Little endian */ 74 struct {
60 __u32 inheritable; /* Little endian */ 75 __le32 permitted; /* Little endian */
76 __le32 inheritable; /* Little endian */
77 } data[VFS_CAP_U32];
61}; 78};
62 79
63#ifdef __KERNEL__ 80#ifdef __KERNEL__
64 81
65/* #define STRICT_CAP_T_TYPECHECKS */
66
67#ifdef STRICT_CAP_T_TYPECHECKS
68
69typedef struct kernel_cap_struct { 82typedef struct kernel_cap_struct {
70 __u32 cap; 83 __u32 cap[_LINUX_CAPABILITY_U32S];
71} kernel_cap_t; 84} kernel_cap_t;
72 85
73#else 86#define _USER_CAP_HEADER_SIZE (sizeof(struct __user_cap_header_struct))
74
75typedef __u32 kernel_cap_t;
76
77#endif
78
79#define _USER_CAP_HEADER_SIZE (2*sizeof(__u32))
80#define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t)) 87#define _KERNEL_CAP_T_SIZE (sizeof(kernel_cap_t))
81 88
82#endif 89#endif
@@ -119,10 +126,6 @@ typedef __u32 kernel_cap_t;
119 126
120#define CAP_FSETID 4 127#define CAP_FSETID 4
121 128
122/* Used to decide between falling back on the old suser() or fsuser(). */
123
124#define CAP_FS_MASK 0x1f
125
126/* Overrides the restriction that the real or effective user ID of a 129/* Overrides the restriction that the real or effective user ID of a
127 process sending a signal must match the real or effective user ID 130 process sending a signal must match the real or effective user ID
128 of the process receiving the signal. */ 131 of the process receiving the signal. */
@@ -145,8 +148,14 @@ typedef __u32 kernel_cap_t;
145 ** Linux-specific capabilities 148 ** Linux-specific capabilities
146 **/ 149 **/
147 150
148/* Transfer any capability in your permitted set to any pid, 151/* Without VFS support for capabilities:
149 remove any capability in your permitted set from any pid */ 152 * Transfer any capability in your permitted set to any pid,
153 * remove any capability in your permitted set from any pid
154 * With VFS support for capabilities (neither of above, but)
155 * Add any capability from current's capability bounding set
156 * to the current process' inheritable set
157 * Allow taking bits out of capability bounding set
158 */
150 159
151#define CAP_SETPCAP 8 160#define CAP_SETPCAP 8
152 161
@@ -195,7 +204,6 @@ typedef __u32 kernel_cap_t;
195#define CAP_IPC_OWNER 15 204#define CAP_IPC_OWNER 15
196 205
197/* Insert and remove kernel modules - modify kernel without limit */ 206/* Insert and remove kernel modules - modify kernel without limit */
198/* Modify cap_bset */
199#define CAP_SYS_MODULE 16 207#define CAP_SYS_MODULE 16
200 208
201/* Allow ioperm/iopl access */ 209/* Allow ioperm/iopl access */
@@ -307,74 +315,183 @@ typedef __u32 kernel_cap_t;
307 315
308#define CAP_SETFCAP 31 316#define CAP_SETFCAP 31
309 317
318/* Override MAC access.
319 The base kernel enforces no MAC policy.
320 An LSM may enforce a MAC policy, and if it does and it chooses
321 to implement capability based overrides of that policy, this is
322 the capability it should use to do so. */
323
324#define CAP_MAC_OVERRIDE 32
325
326/* Allow MAC configuration or state changes.
327 The base kernel requires no MAC configuration.
328 An LSM may enforce a MAC policy, and if it does and it chooses
329 to implement capability based checks on modifications to that
330 policy or the data required to maintain it, this is the
331 capability it should use to do so. */
332
333#define CAP_MAC_ADMIN 33
334
335#define CAP_LAST_CAP CAP_MAC_ADMIN
336
337#define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
338
339/*
340 * Bit location of each capability (used by user-space library and kernel)
341 */
342
343#define CAP_TO_INDEX(x) ((x) >> 5) /* 1 << 5 == bits in __u32 */
344#define CAP_TO_MASK(x) (1 << ((x) & 31)) /* mask for indexed __u32 */
345
310#ifdef __KERNEL__ 346#ifdef __KERNEL__
311 347
312/* 348/*
313 * Internal kernel functions only 349 * Internal kernel functions only
314 */ 350 */
315 351
316#ifdef STRICT_CAP_T_TYPECHECKS 352#define CAP_FOR_EACH_U32(__capi) \
353 for (__capi = 0; __capi < _LINUX_CAPABILITY_U32S; ++__capi)
354
355# define CAP_FS_MASK_B0 (CAP_TO_MASK(CAP_CHOWN) \
356 | CAP_TO_MASK(CAP_DAC_OVERRIDE) \
357 | CAP_TO_MASK(CAP_DAC_READ_SEARCH) \
358 | CAP_TO_MASK(CAP_FOWNER) \
359 | CAP_TO_MASK(CAP_FSETID))
360
361# define CAP_FS_MASK_B1 (CAP_TO_MASK(CAP_MAC_OVERRIDE))
362
363#if _LINUX_CAPABILITY_U32S != 2
364# error Fix up hand-coded capability macro initializers
365#else /* HAND-CODED capability initializers */
366
367# define CAP_EMPTY_SET {{ 0, 0 }}
368# define CAP_FULL_SET {{ ~0, ~0 }}
369# define CAP_INIT_EFF_SET {{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }}
370# define CAP_FS_SET {{ CAP_FS_MASK_B0, CAP_FS_MASK_B1 } }
371# define CAP_NFSD_SET {{ CAP_FS_MASK_B0|CAP_TO_MASK(CAP_SYS_RESOURCE), \
372 CAP_FS_MASK_B1 } }
373
374#endif /* _LINUX_CAPABILITY_U32S != 2 */
375
376#define CAP_INIT_INH_SET CAP_EMPTY_SET
377
378# define cap_clear(c) do { (c) = __cap_empty_set; } while (0)
379# define cap_set_full(c) do { (c) = __cap_full_set; } while (0)
380# define cap_set_init_eff(c) do { (c) = __cap_init_eff_set; } while (0)
381
382#define cap_raise(c, flag) ((c).cap[CAP_TO_INDEX(flag)] |= CAP_TO_MASK(flag))
383#define cap_lower(c, flag) ((c).cap[CAP_TO_INDEX(flag)] &= ~CAP_TO_MASK(flag))
384#define cap_raised(c, flag) ((c).cap[CAP_TO_INDEX(flag)] & CAP_TO_MASK(flag))
385
386#define CAP_BOP_ALL(c, a, b, OP) \
387do { \
388 unsigned __capi; \
389 CAP_FOR_EACH_U32(__capi) { \
390 c.cap[__capi] = a.cap[__capi] OP b.cap[__capi]; \
391 } \
392} while (0)
393
394#define CAP_UOP_ALL(c, a, OP) \
395do { \
396 unsigned __capi; \
397 CAP_FOR_EACH_U32(__capi) { \
398 c.cap[__capi] = OP a.cap[__capi]; \
399 } \
400} while (0)
401
402static inline kernel_cap_t cap_combine(const kernel_cap_t a,
403 const kernel_cap_t b)
404{
405 kernel_cap_t dest;
406 CAP_BOP_ALL(dest, a, b, |);
407 return dest;
408}
317 409
318#define to_cap_t(x) { x } 410static inline kernel_cap_t cap_intersect(const kernel_cap_t a,
319#define cap_t(x) (x).cap 411 const kernel_cap_t b)
412{
413 kernel_cap_t dest;
414 CAP_BOP_ALL(dest, a, b, &);
415 return dest;
416}
320 417
321#else 418static inline kernel_cap_t cap_drop(const kernel_cap_t a,
419 const kernel_cap_t drop)
420{
421 kernel_cap_t dest;
422 CAP_BOP_ALL(dest, a, drop, &~);
423 return dest;
424}
322 425
323#define to_cap_t(x) (x) 426static inline kernel_cap_t cap_invert(const kernel_cap_t c)
324#define cap_t(x) (x) 427{
428 kernel_cap_t dest;
429 CAP_UOP_ALL(dest, c, ~);
430 return dest;
431}
325 432
326#endif 433static inline int cap_isclear(const kernel_cap_t a)
434{
435 unsigned __capi;
436 CAP_FOR_EACH_U32(__capi) {
437 if (a.cap[__capi] != 0)
438 return 0;
439 }
440 return 1;
441}
327 442
328#define CAP_EMPTY_SET to_cap_t(0) 443static inline int cap_issubset(const kernel_cap_t a, const kernel_cap_t set)
329#define CAP_FULL_SET to_cap_t(~0) 444{
330#define CAP_INIT_EFF_SET to_cap_t(~0 & ~CAP_TO_MASK(CAP_SETPCAP)) 445 kernel_cap_t dest;
331#define CAP_INIT_INH_SET to_cap_t(0) 446 dest = cap_drop(a, set);
447 return cap_isclear(dest);
448}
332 449
333#define CAP_TO_MASK(x) (1 << (x)) 450/* Used to decide between falling back on the old suser() or fsuser(). */
334#define cap_raise(c, flag) (cap_t(c) |= CAP_TO_MASK(flag))
335#define cap_lower(c, flag) (cap_t(c) &= ~CAP_TO_MASK(flag))
336#define cap_raised(c, flag) (cap_t(c) & CAP_TO_MASK(flag))
337 451
338static inline kernel_cap_t cap_combine(kernel_cap_t a, kernel_cap_t b) 452static inline int cap_is_fs_cap(int cap)
339{ 453{
340 kernel_cap_t dest; 454 const kernel_cap_t __cap_fs_set = CAP_FS_SET;
341 cap_t(dest) = cap_t(a) | cap_t(b); 455 return !!(CAP_TO_MASK(cap) & __cap_fs_set.cap[CAP_TO_INDEX(cap)]);
342 return dest;
343} 456}
344 457
345static inline kernel_cap_t cap_intersect(kernel_cap_t a, kernel_cap_t b) 458static inline kernel_cap_t cap_drop_fs_set(const kernel_cap_t a)
346{ 459{
347 kernel_cap_t dest; 460 const kernel_cap_t __cap_fs_set = CAP_FS_SET;
348 cap_t(dest) = cap_t(a) & cap_t(b); 461 return cap_drop(a, __cap_fs_set);
349 return dest;
350} 462}
351 463
352static inline kernel_cap_t cap_drop(kernel_cap_t a, kernel_cap_t drop) 464static inline kernel_cap_t cap_raise_fs_set(const kernel_cap_t a,
465 const kernel_cap_t permitted)
353{ 466{
354 kernel_cap_t dest; 467 const kernel_cap_t __cap_fs_set = CAP_FS_SET;
355 cap_t(dest) = cap_t(a) & ~cap_t(drop); 468 return cap_combine(a,
356 return dest; 469 cap_intersect(permitted, __cap_fs_set));
357} 470}
358 471
359static inline kernel_cap_t cap_invert(kernel_cap_t c) 472static inline kernel_cap_t cap_drop_nfsd_set(const kernel_cap_t a)
360{ 473{
361 kernel_cap_t dest; 474 const kernel_cap_t __cap_fs_set = CAP_NFSD_SET;
362 cap_t(dest) = ~cap_t(c); 475 return cap_drop(a, __cap_fs_set);
363 return dest;
364} 476}
365 477
366#define cap_isclear(c) (!cap_t(c)) 478static inline kernel_cap_t cap_raise_nfsd_set(const kernel_cap_t a,
367#define cap_issubset(a,set) (!(cap_t(a) & ~cap_t(set))) 479 const kernel_cap_t permitted)
368 480{
369#define cap_clear(c) do { cap_t(c) = 0; } while(0) 481 const kernel_cap_t __cap_nfsd_set = CAP_NFSD_SET;
370#define cap_set_full(c) do { cap_t(c) = ~0; } while(0) 482 return cap_combine(a,
371#define cap_mask(c,mask) do { cap_t(c) &= cap_t(mask); } while(0) 483 cap_intersect(permitted, __cap_nfsd_set));
484}
372 485
373#define cap_is_fs_cap(c) (CAP_TO_MASK(c) & CAP_FS_MASK) 486extern const kernel_cap_t __cap_empty_set;
487extern const kernel_cap_t __cap_full_set;
488extern const kernel_cap_t __cap_init_eff_set;
374 489
375int capable(int cap); 490int capable(int cap);
376int __capable(struct task_struct *t, int cap); 491int __capable(struct task_struct *t, int cap);
377 492
493extern long cap_prctl_drop(unsigned long cap);
494
378#endif /* __KERNEL__ */ 495#endif /* __KERNEL__ */
379 496
380#endif /* !_LINUX_CAPABILITY_H */ 497#endif /* !_LINUX_CAPABILITY_H */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index d38655f2be70..a671dbff7a1f 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -257,16 +257,8 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
257/* 257/*
258 * epoll (fs/eventpoll.c) compat bits follow ... 258 * epoll (fs/eventpoll.c) compat bits follow ...
259 */ 259 */
260#ifndef CONFIG_HAS_COMPAT_EPOLL_EVENT
261struct epoll_event; 260struct epoll_event;
262#define compat_epoll_event epoll_event 261#define compat_epoll_event epoll_event
263#else
264asmlinkage long compat_sys_epoll_ctl(int epfd, int op, int fd,
265 struct compat_epoll_event __user *event);
266asmlinkage long compat_sys_epoll_wait(int epfd,
267 struct compat_epoll_event __user *events,
268 int maxevents, int timeout);
269#endif
270asmlinkage long compat_sys_epoll_pwait(int epfd, 262asmlinkage long compat_sys_epoll_pwait(int epfd,
271 struct compat_epoll_event __user *events, 263 struct compat_epoll_event __user *events,
272 int maxevents, int timeout, 264 int maxevents, int timeout,
@@ -279,8 +271,11 @@ asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename,
279asmlinkage long compat_sys_signalfd(int ufd, 271asmlinkage long compat_sys_signalfd(int ufd,
280 const compat_sigset_t __user *sigmask, 272 const compat_sigset_t __user *sigmask,
281 compat_size_t sigsetsize); 273 compat_size_t sigsetsize);
282asmlinkage long compat_sys_timerfd(int ufd, int clockid, int flags, 274asmlinkage long compat_sys_timerfd_settime(int ufd, int flags,
283 const struct compat_itimerspec __user *utmr); 275 const struct compat_itimerspec __user *utmr,
276 struct compat_itimerspec __user *otmr);
277asmlinkage long compat_sys_timerfd_gettime(int ufd,
278 struct compat_itimerspec __user *otmr);
284 279
285#endif /* CONFIG_COMPAT */ 280#endif /* CONFIG_COMPAT */
286#endif /* _LINUX_COMPAT_H */ 281#endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index c4e00161a247..c8eb8c71809e 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -46,9 +46,10 @@ struct cpuidle_state {
46/* Idle State Flags */ 46/* Idle State Flags */
47#define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ 47#define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */
48#define CPUIDLE_FLAG_CHECK_BM (0x02) /* BM activity will exit state */ 48#define CPUIDLE_FLAG_CHECK_BM (0x02) /* BM activity will exit state */
49#define CPUIDLE_FLAG_SHALLOW (0x10) /* low latency, minimal savings */ 49#define CPUIDLE_FLAG_POLL (0x10) /* no latency, no savings */
50#define CPUIDLE_FLAG_BALANCED (0x20) /* medium latency, moderate savings */ 50#define CPUIDLE_FLAG_SHALLOW (0x20) /* low latency, minimal savings */
51#define CPUIDLE_FLAG_DEEP (0x40) /* high latency, large savings */ 51#define CPUIDLE_FLAG_BALANCED (0x40) /* medium latency, moderate savings */
52#define CPUIDLE_FLAG_DEEP (0x80) /* high latency, large savings */
52 53
53#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) 54#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
54 55
@@ -72,6 +73,19 @@ cpuidle_set_statedata(struct cpuidle_state *state, void *data)
72 state->driver_data = data; 73 state->driver_data = data;
73} 74}
74 75
76#ifdef CONFIG_SMP
77#ifdef CONFIG_ARCH_HAS_CPU_IDLE_WAIT
78static inline void cpuidle_kick_cpus(void)
79{
80 cpu_idle_wait();
81}
82#else /* !CONFIG_ARCH_HAS_CPU_IDLE_WAIT */
83#error "Arch needs cpu_idle_wait() equivalent here"
84#endif /* !CONFIG_ARCH_HAS_CPU_IDLE_WAIT */
85#else /* !CONFIG_SMP */
86static inline void cpuidle_kick_cpus(void) {}
87#endif /* !CONFIG_SMP */
88
75struct cpuidle_state_kobj { 89struct cpuidle_state_kobj {
76 struct cpuidle_state *state; 90 struct cpuidle_state *state;
77 struct completion kobj_unregister; 91 struct completion kobj_unregister;
@@ -79,7 +93,7 @@ struct cpuidle_state_kobj {
79}; 93};
80 94
81struct cpuidle_device { 95struct cpuidle_device {
82 int enabled:1; 96 unsigned int enabled:1;
83 unsigned int cpu; 97 unsigned int cpu;
84 98
85 int last_residency; 99 int last_residency;
@@ -178,4 +192,10 @@ static inline void cpuidle_unregister_governor(struct cpuidle_governor *gov) { }
178 192
179#endif 193#endif
180 194
195#ifdef CONFIG_ARCH_HAS_CPU_RELAX
196#define CPUIDLE_DRIVER_STATE_START 1
197#else
198#define CPUIDLE_DRIVER_STATE_START 0
199#endif
200
181#endif /* _LINUX_CPUIDLE_H */ 201#endif /* _LINUX_CPUIDLE_H */
diff --git a/include/linux/device.h b/include/linux/device.h
index 479c0b31593c..2258d89bf523 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -410,6 +410,15 @@ extern int devres_release_group(struct device *dev, void *id);
410extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp); 410extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp);
411extern void devm_kfree(struct device *dev, void *p); 411extern void devm_kfree(struct device *dev, void *p);
412 412
413struct device_dma_parameters {
414 /*
415 * a low level driver may set these to teach IOMMU code about
416 * sg limitations.
417 */
418 unsigned int max_segment_size;
419 unsigned long segment_boundary_mask;
420};
421
413struct device { 422struct device {
414 struct klist klist_children; 423 struct klist klist_children;
415 struct klist_node knode_parent; /* node in sibling list */ 424 struct klist_node knode_parent; /* node in sibling list */
@@ -445,6 +454,8 @@ struct device {
445 64 bit addresses for consistent 454 64 bit addresses for consistent
446 allocations such descriptors. */ 455 allocations such descriptors. */
447 456
457 struct device_dma_parameters *dma_parms;
458
448 struct list_head dma_pools; /* dma pools (if dma'ble) */ 459 struct list_head dma_pools; /* dma pools (if dma'ble) */
449 460
450 struct dma_coherent_mem *dma_mem; /* internal for coherent mem 461 struct dma_coherent_mem *dma_mem; /* internal for coherent mem
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 4470950892be..332030709623 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -60,6 +60,36 @@ static inline int is_device_dma_capable(struct device *dev)
60 60
61extern u64 dma_get_required_mask(struct device *dev); 61extern u64 dma_get_required_mask(struct device *dev);
62 62
63static inline unsigned int dma_get_max_seg_size(struct device *dev)
64{
65 return dev->dma_parms ? dev->dma_parms->max_segment_size : 65536;
66}
67
68static inline unsigned int dma_set_max_seg_size(struct device *dev,
69 unsigned int size)
70{
71 if (dev->dma_parms) {
72 dev->dma_parms->max_segment_size = size;
73 return 0;
74 } else
75 return -EIO;
76}
77
78static inline unsigned long dma_get_seg_boundary(struct device *dev)
79{
80 return dev->dma_parms ?
81 dev->dma_parms->segment_boundary_mask : 0xffffffff;
82}
83
84static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
85{
86 if (dev->dma_parms) {
87 dev->dma_parms->segment_boundary_mask = mask;
88 return 0;
89 } else
90 return -EIO;
91}
92
63/* flags for the coherent memory api */ 93/* flags for the coherent memory api */
64#define DMA_MEMORY_MAP 0x01 94#define DMA_MEMORY_MAP 0x01
65#define DMA_MEMORY_IO 0x02 95#define DMA_MEMORY_IO 0x02
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 5c84bf897593..acbb364674ff 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -95,6 +95,15 @@ enum dma_transaction_type {
95#define DMA_TX_TYPE_END (DMA_INTERRUPT + 1) 95#define DMA_TX_TYPE_END (DMA_INTERRUPT + 1)
96 96
97/** 97/**
98 * enum dma_prep_flags - DMA flags to augment operation preparation
99 * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of
100 * this transaction
101 */
102enum dma_prep_flags {
103 DMA_PREP_INTERRUPT = (1 << 0),
104};
105
106/**
98 * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t. 107 * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t.
99 * See linux/cpumask.h 108 * See linux/cpumask.h
100 */ 109 */
@@ -209,8 +218,6 @@ typedef void (*dma_async_tx_callback)(void *dma_async_param);
209 * descriptors 218 * descriptors
210 * @chan: target channel for this operation 219 * @chan: target channel for this operation
211 * @tx_submit: set the prepared descriptor(s) to be executed by the engine 220 * @tx_submit: set the prepared descriptor(s) to be executed by the engine
212 * @tx_set_dest: set a destination address in a hardware descriptor
213 * @tx_set_src: set a source address in a hardware descriptor
214 * @callback: routine to call after this operation is complete 221 * @callback: routine to call after this operation is complete
215 * @callback_param: general parameter to pass to the callback routine 222 * @callback_param: general parameter to pass to the callback routine
216 * ---async_tx api specific fields--- 223 * ---async_tx api specific fields---
@@ -227,10 +234,6 @@ struct dma_async_tx_descriptor {
227 struct list_head tx_list; 234 struct list_head tx_list;
228 struct dma_chan *chan; 235 struct dma_chan *chan;
229 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); 236 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
230 void (*tx_set_dest)(dma_addr_t addr,
231 struct dma_async_tx_descriptor *tx, int index);
232 void (*tx_set_src)(dma_addr_t addr,
233 struct dma_async_tx_descriptor *tx, int index);
234 dma_async_tx_callback callback; 237 dma_async_tx_callback callback;
235 void *callback_param; 238 void *callback_param;
236 struct list_head depend_list; 239 struct list_head depend_list;
@@ -279,15 +282,17 @@ struct dma_device {
279 void (*device_free_chan_resources)(struct dma_chan *chan); 282 void (*device_free_chan_resources)(struct dma_chan *chan);
280 283
281 struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)( 284 struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)(
282 struct dma_chan *chan, size_t len, int int_en); 285 struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
286 size_t len, unsigned long flags);
283 struct dma_async_tx_descriptor *(*device_prep_dma_xor)( 287 struct dma_async_tx_descriptor *(*device_prep_dma_xor)(
284 struct dma_chan *chan, unsigned int src_cnt, size_t len, 288 struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src,
285 int int_en); 289 unsigned int src_cnt, size_t len, unsigned long flags);
286 struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)( 290 struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)(
287 struct dma_chan *chan, unsigned int src_cnt, size_t len, 291 struct dma_chan *chan, dma_addr_t *src, unsigned int src_cnt,
288 u32 *result, int int_en); 292 size_t len, u32 *result, unsigned long flags);
289 struct dma_async_tx_descriptor *(*device_prep_dma_memset)( 293 struct dma_async_tx_descriptor *(*device_prep_dma_memset)(
290 struct dma_chan *chan, int value, size_t len, int int_en); 294 struct dma_chan *chan, dma_addr_t dest, int value, size_t len,
295 unsigned long flags);
291 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( 296 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
292 struct dma_chan *chan); 297 struct dma_chan *chan);
293 298
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 5b42a659a308..b1251b2af568 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -79,7 +79,6 @@ extern void dmi_scan_machine(void);
79extern int dmi_get_year(int field); 79extern int dmi_get_year(int field);
80extern int dmi_name_in_vendors(const char *str); 80extern int dmi_name_in_vendors(const char *str);
81extern int dmi_available; 81extern int dmi_available;
82extern char *dmi_get_slot(int slot);
83 82
84#else 83#else
85 84
@@ -90,7 +89,6 @@ static inline const struct dmi_device * dmi_find_device(int type, const char *na
90static inline int dmi_get_year(int year) { return 0; } 89static inline int dmi_get_year(int year) { return 0; }
91static inline int dmi_name_in_vendors(const char *s) { return 0; } 90static inline int dmi_name_in_vendors(const char *s) { return 0; }
92#define dmi_available 0 91#define dmi_available 0
93static inline char *dmi_get_slot(int slot) { return NULL; }
94 92
95#endif 93#endif
96 94
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 56bd421c1208..109734bf6377 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -21,7 +21,7 @@
21 21
22/* Fixed constants first: */ 22/* Fixed constants first: */
23#undef NR_OPEN 23#undef NR_OPEN
24#define NR_OPEN (1024*1024) /* Absolute upper limit on fd num */ 24extern int sysctl_nr_open;
25#define INR_OPEN 1024 /* Initial setting for nfile rlimits */ 25#define INR_OPEN 1024 /* Initial setting for nfile rlimits */
26 26
27#define BLOCK_SIZE_BITS 10 27#define BLOCK_SIZE_BITS 10
@@ -977,7 +977,6 @@ extern int send_sigurg(struct fown_struct *fown);
977extern struct list_head super_blocks; 977extern struct list_head super_blocks;
978extern spinlock_t sb_lock; 978extern spinlock_t sb_lock;
979 979
980#define sb_entry(list) list_entry((list), struct super_block, s_list)
981#define S_BIAS (1<<30) 980#define S_BIAS (1<<30)
982struct super_block { 981struct super_block {
983 struct list_head s_list; /* Keep this first */ 982 struct list_head s_list; /* Keep this first */
@@ -1279,8 +1278,10 @@ struct super_operations {
1279 * 1278 *
1280 * Two bits are used for locking and completion notification, I_LOCK and I_SYNC. 1279 * Two bits are used for locking and completion notification, I_LOCK and I_SYNC.
1281 * 1280 *
1282 * I_DIRTY_SYNC Inode itself is dirty. 1281 * I_DIRTY_SYNC Inode is dirty, but doesn't have to be written on
1283 * I_DIRTY_DATASYNC Data-related inode changes pending 1282 * fdatasync(). i_atime is the usual cause.
1283 * I_DIRTY_DATASYNC Inode is dirty and must be written on fdatasync(), f.e.
1284 * because i_size changed.
1284 * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean. 1285 * I_DIRTY_PAGES Inode has dirty pages. Inode itself may be clean.
1285 * I_NEW get_new_inode() sets i_state to I_LOCK|I_NEW. Both 1286 * I_NEW get_new_inode() sets i_state to I_LOCK|I_NEW. Both
1286 * are cleared by unlock_new_inode(), called from iget(). 1287 * are cleared by unlock_new_inode(), called from iget().
@@ -1312,8 +1313,6 @@ struct super_operations {
1312 * purpose reduces latency and prevents some filesystem- 1313 * purpose reduces latency and prevents some filesystem-
1313 * specific deadlocks. 1314 * specific deadlocks.
1314 * 1315 *
1315 * Q: Why does I_DIRTY_DATASYNC exist? It appears as if it could be replaced
1316 * by (I_DIRTY_SYNC|I_DIRTY_PAGES).
1317 * Q: What is the difference between I_WILL_FREE and I_FREEING? 1316 * Q: What is the difference between I_WILL_FREE and I_FREEING?
1318 * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on 1317 * Q: igrab() only checks on (I_FREEING|I_WILL_FREE). Should it also check on
1319 * I_CLEAR? If not, why? 1318 * I_CLEAR? If not, why?
@@ -2113,6 +2112,7 @@ struct ctl_table;
2113int proc_nr_files(struct ctl_table *table, int write, struct file *filp, 2112int proc_nr_files(struct ctl_table *table, int write, struct file *filp,
2114 void __user *buffer, size_t *lenp, loff_t *ppos); 2113 void __user *buffer, size_t *lenp, loff_t *ppos);
2115 2114
2115int get_filesystem_list(char * buf);
2116 2116
2117#endif /* __KERNEL__ */ 2117#endif /* __KERNEL__ */
2118#endif /* _LINUX_FS_H */ 2118#endif /* _LINUX_FS_H */
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index 2bd31fa623b6..d4b7c4ac72e6 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -92,6 +92,14 @@ static inline void fsnotify_inoderemove(struct inode *inode)
92} 92}
93 93
94/* 94/*
95 * fsnotify_link_count - inode's link count changed
96 */
97static inline void fsnotify_link_count(struct inode *inode)
98{
99 inotify_inode_queue_event(inode, IN_ATTRIB, 0, NULL, NULL);
100}
101
102/*
95 * fsnotify_create - 'name' was linked in 103 * fsnotify_create - 'name' was linked in
96 */ 104 */
97static inline void fsnotify_create(struct inode *inode, struct dentry *dentry) 105static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
@@ -103,6 +111,20 @@ static inline void fsnotify_create(struct inode *inode, struct dentry *dentry)
103} 111}
104 112
105/* 113/*
114 * fsnotify_link - new hardlink in 'inode' directory
115 * Note: We have to pass also the linked inode ptr as some filesystems leave
116 * new_dentry->d_inode NULL and instantiate inode pointer later
117 */
118static inline void fsnotify_link(struct inode *dir, struct inode *inode, struct dentry *new_dentry)
119{
120 inode_dir_notify(dir, DN_CREATE);
121 inotify_inode_queue_event(dir, IN_CREATE, 0, new_dentry->d_name.name,
122 inode);
123 fsnotify_link_count(inode);
124 audit_inode_child(new_dentry->d_name.name, new_dentry, dir);
125}
126
127/*
106 * fsnotify_mkdir - directory 'name' was created 128 * fsnotify_mkdir - directory 'name' was created
107 */ 129 */
108static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) 130static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 7e93a9ae7064..0c6ce515185d 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -228,5 +228,7 @@ extern void FASTCALL(free_cold_page(struct page *page));
228 228
229void page_alloc_init(void); 229void page_alloc_init(void);
230void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp); 230void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
231void drain_all_pages(void);
232void drain_local_pages(void *dummy);
231 233
232#endif /* __LINUX_GFP_H */ 234#endif /* __LINUX_GFP_H */
diff --git a/include/linux/hash.h b/include/linux/hash.h
index acf17bb8e7f9..06d25c189cc5 100644
--- a/include/linux/hash.h
+++ b/include/linux/hash.h
@@ -1,6 +1,6 @@
1#ifndef _LINUX_HASH_H 1#ifndef _LINUX_HASH_H
2#define _LINUX_HASH_H 2#define _LINUX_HASH_H
3/* Fast hashing routine for a long. 3/* Fast hashing routine for ints, longs and pointers.
4 (C) 2002 William Lee Irwin III, IBM */ 4 (C) 2002 William Lee Irwin III, IBM */
5 5
6/* 6/*
@@ -13,23 +13,30 @@
13 * them can use shifts and additions instead of multiplications for 13 * them can use shifts and additions instead of multiplications for
14 * machines where multiplications are slow. 14 * machines where multiplications are slow.
15 */ 15 */
16#if BITS_PER_LONG == 32 16
17#include <asm/types.h>
18
17/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */ 19/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
18#define GOLDEN_RATIO_PRIME 0x9e370001UL 20#define GOLDEN_RATIO_PRIME_32 0x9e370001UL
19#elif BITS_PER_LONG == 64
20/* 2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */ 21/* 2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */
21#define GOLDEN_RATIO_PRIME 0x9e37fffffffc0001UL 22#define GOLDEN_RATIO_PRIME_64 0x9e37fffffffc0001UL
23
24#if BITS_PER_LONG == 32
25#define GOLDEN_RATIO_PRIME GOLDEN_RATIO_PRIME_32
26#define hash_long(val, bits) hash_32(val, bits)
27#elif BITS_PER_LONG == 64
28#define hash_long(val, bits) hash_64(val, bits)
29#define GOLDEN_RATIO_PRIME GOLDEN_RATIO_PRIME_64
22#else 30#else
23#error Define GOLDEN_RATIO_PRIME for your wordsize. 31#error Wordsize not 32 or 64
24#endif 32#endif
25 33
26static inline unsigned long hash_long(unsigned long val, unsigned int bits) 34static inline u64 hash_64(u64 val, unsigned int bits)
27{ 35{
28 unsigned long hash = val; 36 u64 hash = val;
29 37
30#if BITS_PER_LONG == 64
31 /* Sigh, gcc can't optimise this alone like it does for 32 bits. */ 38 /* Sigh, gcc can't optimise this alone like it does for 32 bits. */
32 unsigned long n = hash; 39 u64 n = hash;
33 n <<= 18; 40 n <<= 18;
34 hash -= n; 41 hash -= n;
35 n <<= 33; 42 n <<= 33;
@@ -42,15 +49,20 @@ static inline unsigned long hash_long(unsigned long val, unsigned int bits)
42 hash += n; 49 hash += n;
43 n <<= 2; 50 n <<= 2;
44 hash += n; 51 hash += n;
45#else 52
53 /* High bits are more random, so use them. */
54 return hash >> (64 - bits);
55}
56
57static inline u32 hash_32(u32 val, unsigned int bits)
58{
46 /* On some cpus multiply is faster, on others gcc will do shifts */ 59 /* On some cpus multiply is faster, on others gcc will do shifts */
47 hash *= GOLDEN_RATIO_PRIME; 60 u32 hash = val * GOLDEN_RATIO_PRIME_32;
48#endif
49 61
50 /* High bits are more random, so use them. */ 62 /* High bits are more random, so use them. */
51 return hash >> (BITS_PER_LONG - bits); 63 return hash >> (32 - bits);
52} 64}
53 65
54static inline unsigned long hash_ptr(void *ptr, unsigned int bits) 66static inline unsigned long hash_ptr(void *ptr, unsigned int bits)
55{ 67{
56 return hash_long((unsigned long)ptr, bits); 68 return hash_long((unsigned long)ptr, bits);
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index db390c511ada..6115545a5b9c 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -26,13 +26,6 @@
26#include <linux/netdevice.h> 26#include <linux/netdevice.h>
27#include <linux/hdlc/ioctl.h> 27#include <linux/hdlc/ioctl.h>
28 28
29
30/* Used by all network devices here, pointed to by netdev_priv(dev) */
31struct hdlc_device_desc {
32 int (*netif_rx)(struct sk_buff *skb);
33 struct net_device_stats stats;
34};
35
36/* This structure is a private property of HDLC protocols. 29/* This structure is a private property of HDLC protocols.
37 Hardware drivers have no interest here */ 30 Hardware drivers have no interest here */
38 31
@@ -44,12 +37,15 @@ struct hdlc_proto {
44 void (*detach)(struct net_device *dev); 37 void (*detach)(struct net_device *dev);
45 int (*ioctl)(struct net_device *dev, struct ifreq *ifr); 38 int (*ioctl)(struct net_device *dev, struct ifreq *ifr);
46 __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev); 39 __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev);
40 int (*netif_rx)(struct sk_buff *skb);
47 struct module *module; 41 struct module *module;
48 struct hdlc_proto *next; /* next protocol in the list */ 42 struct hdlc_proto *next; /* next protocol in the list */
49}; 43};
50 44
51 45
46/* Pointed to by dev->priv */
52typedef struct hdlc_device { 47typedef struct hdlc_device {
48 struct net_device_stats stats;
53 /* used by HDLC layer to take control over HDLC device from hw driver*/ 49 /* used by HDLC layer to take control over HDLC device from hw driver*/
54 int (*attach)(struct net_device *dev, 50 int (*attach)(struct net_device *dev,
55 unsigned short encoding, unsigned short parity); 51 unsigned short encoding, unsigned short parity);
@@ -83,18 +79,11 @@ void unregister_hdlc_protocol(struct hdlc_proto *proto);
83 79
84struct net_device *alloc_hdlcdev(void *priv); 80struct net_device *alloc_hdlcdev(void *priv);
85 81
86 82static inline struct hdlc_device* dev_to_hdlc(struct net_device *dev)
87static __inline__ struct hdlc_device_desc* dev_to_desc(struct net_device *dev)
88{
89 return netdev_priv(dev);
90}
91
92static __inline__ hdlc_device* dev_to_hdlc(struct net_device *dev)
93{ 83{
94 return netdev_priv(dev) + sizeof(struct hdlc_device_desc); 84 return dev->priv;
95} 85}
96 86
97
98static __inline__ void debug_frame(const struct sk_buff *skb) 87static __inline__ void debug_frame(const struct sk_buff *skb)
99{ 88{
100 int i; 89 int i;
@@ -116,13 +105,13 @@ int hdlc_open(struct net_device *dev);
116void hdlc_close(struct net_device *dev); 105void hdlc_close(struct net_device *dev);
117 106
118int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, 107int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,
119 int (*rx)(struct sk_buff *skb), size_t size); 108 size_t size);
120/* May be used by hardware driver to gain control over HDLC device */ 109/* May be used by hardware driver to gain control over HDLC device */
121void detach_hdlc_protocol(struct net_device *dev); 110void detach_hdlc_protocol(struct net_device *dev);
122 111
123static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev) 112static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev)
124{ 113{
125 return &dev_to_desc(dev)->stats; 114 return &dev_to_hdlc(dev)->stats;
126} 115}
127 116
128 117
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 1fcb0033179e..7dcbc82f3b7b 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -68,8 +68,6 @@ static inline void clear_user_highpage(struct page *page, unsigned long vaddr)
68 void *addr = kmap_atomic(page, KM_USER0); 68 void *addr = kmap_atomic(page, KM_USER0);
69 clear_user_page(addr, vaddr, page); 69 clear_user_page(addr, vaddr, page);
70 kunmap_atomic(addr, KM_USER0); 70 kunmap_atomic(addr, KM_USER0);
71 /* Make sure this page is cleared on other CPU's too before using it */
72 smp_wmb();
73} 71}
74 72
75#ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 73#ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
@@ -124,28 +122,40 @@ static inline void clear_highpage(struct page *page)
124 kunmap_atomic(kaddr, KM_USER0); 122 kunmap_atomic(kaddr, KM_USER0);
125} 123}
126 124
127/* 125static inline void zero_user_segments(struct page *page,
128 * Same but also flushes aliased cache contents to RAM. 126 unsigned start1, unsigned end1,
129 * 127 unsigned start2, unsigned end2)
130 * This must be a macro because KM_USER0 and friends aren't defined if 128{
131 * !CONFIG_HIGHMEM 129 void *kaddr = kmap_atomic(page, KM_USER0);
132 */ 130
133#define zero_user_page(page, offset, size, km_type) \ 131 BUG_ON(end1 > PAGE_SIZE || end2 > PAGE_SIZE);
134 do { \ 132
135 void *kaddr; \ 133 if (end1 > start1)
136 \ 134 memset(kaddr + start1, 0, end1 - start1);
137 BUG_ON((offset) + (size) > PAGE_SIZE); \ 135
138 \ 136 if (end2 > start2)
139 kaddr = kmap_atomic(page, km_type); \ 137 memset(kaddr + start2, 0, end2 - start2);
140 memset((char *)kaddr + (offset), 0, (size)); \ 138
141 flush_dcache_page(page); \ 139 kunmap_atomic(kaddr, KM_USER0);
142 kunmap_atomic(kaddr, (km_type)); \ 140 flush_dcache_page(page);
143 } while (0) 141}
142
143static inline void zero_user_segment(struct page *page,
144 unsigned start, unsigned end)
145{
146 zero_user_segments(page, start, end, 0, 0);
147}
148
149static inline void zero_user(struct page *page,
150 unsigned start, unsigned size)
151{
152 zero_user_segments(page, start, start + size, 0, 0);
153}
144 154
145static inline void __deprecated memclear_highpage_flush(struct page *page, 155static inline void __deprecated memclear_highpage_flush(struct page *page,
146 unsigned int offset, unsigned int size) 156 unsigned int offset, unsigned int size)
147{ 157{
148 zero_user_page(page, offset, size, KM_USER0); 158 zero_user(page, offset, size);
149} 159}
150 160
151#ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE 161#ifndef __HAVE_ARCH_COPY_USER_HIGHPAGE
@@ -160,8 +170,6 @@ static inline void copy_user_highpage(struct page *to, struct page *from,
160 copy_user_page(vto, vfrom, vaddr, to); 170 copy_user_page(vto, vfrom, vaddr, to);
161 kunmap_atomic(vfrom, KM_USER0); 171 kunmap_atomic(vfrom, KM_USER0);
162 kunmap_atomic(vto, KM_USER1); 172 kunmap_atomic(vto, KM_USER1);
163 /* Make sure this page is cleared on other CPU's too before using it */
164 smp_wmb();
165} 173}
166 174
167#endif 175#endif
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index f79dcba4b2c1..8371b664b41f 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -301,9 +301,16 @@ static inline int hrtimer_is_queued(struct hrtimer *timer)
301} 301}
302 302
303/* Forward a hrtimer so it expires after now: */ 303/* Forward a hrtimer so it expires after now: */
304extern unsigned long 304extern u64
305hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval); 305hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);
306 306
307/* Forward a hrtimer so it expires after the hrtimer's current now */
308static inline u64 hrtimer_forward_now(struct hrtimer *timer,
309 ktime_t interval)
310{
311 return hrtimer_forward(timer, timer->base->get_time(), interval);
312}
313
307/* Precise sleep: */ 314/* Precise sleep: */
308extern long hrtimer_nanosleep(struct timespec *rqtp, 315extern long hrtimer_nanosleep(struct timespec *rqtp,
309 struct timespec *rmtp, 316 struct timespec *rmtp,
@@ -322,9 +329,9 @@ extern void hrtimer_run_pending(void);
322extern void __init hrtimers_init(void); 329extern void __init hrtimers_init(void);
323 330
324#if BITS_PER_LONG < 64 331#if BITS_PER_LONG < 64
325extern unsigned long ktime_divns(const ktime_t kt, s64 div); 332extern u64 ktime_divns(const ktime_t kt, s64 div);
326#else /* BITS_PER_LONG < 64 */ 333#else /* BITS_PER_LONG < 64 */
327# define ktime_divns(kt, div) (unsigned long)((kt).tv64 / (div)) 334# define ktime_divns(kt, div) (u64)((kt).tv64 / (div))
328#endif 335#endif
329 336
330/* Show pending timers: */ 337/* Show pending timers: */
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h
index 85d11916e9ea..42131820bb89 100644
--- a/include/linux/hw_random.h
+++ b/include/linux/hw_random.h
@@ -44,7 +44,15 @@ struct hwrng {
44/** Register a new Hardware Random Number Generator driver. */ 44/** Register a new Hardware Random Number Generator driver. */
45extern int hwrng_register(struct hwrng *rng); 45extern int hwrng_register(struct hwrng *rng);
46/** Unregister a Hardware Random Number Generator driver. */ 46/** Unregister a Hardware Random Number Generator driver. */
47extern void hwrng_unregister(struct hwrng *rng); 47extern void __hwrng_unregister(struct hwrng *rng, bool suspended);
48static inline void hwrng_unregister(struct hwrng *rng)
49{
50 __hwrng_unregister(rng, false);
51}
52static inline void hwrng_unregister_suspended(struct hwrng *rng)
53{
54 __hwrng_unregister(rng, true);
55}
48 56
49#endif /* __KERNEL__ */ 57#endif /* __KERNEL__ */
50#endif /* LINUX_HWRANDOM_H_ */ 58#endif /* LINUX_HWRANDOM_H_ */
diff --git a/include/linux/i2c/pca953x.h b/include/linux/i2c/pca953x.h
new file mode 100644
index 000000000000..3c7361217df8
--- /dev/null
+++ b/include/linux/i2c/pca953x.h
@@ -0,0 +1,18 @@
1/* platform data for the PCA9539 16-bit I/O expander driver */
2
3struct pca953x_platform_data {
4 /* number of the first GPIO */
5 unsigned gpio_base;
6
7 /* initial polarity inversion setting */
8 uint16_t invert;
9
10 void *context; /* param to setup/teardown */
11
12 int (*setup)(struct i2c_client *client,
13 unsigned gpio, unsigned ngpio,
14 void *context);
15 int (*teardown)(struct i2c_client *client,
16 unsigned gpio, unsigned ngpio,
17 void *context);
18};
diff --git a/include/linux/i2c/pcf857x.h b/include/linux/i2c/pcf857x.h
new file mode 100644
index 000000000000..ba8ea6e16476
--- /dev/null
+++ b/include/linux/i2c/pcf857x.h
@@ -0,0 +1,45 @@
1#ifndef __LINUX_PCF857X_H
2#define __LINUX_PCF857X_H
3
4/**
5 * struct pcf857x_platform_data - data to set up pcf857x driver
6 * @gpio_base: number of the chip's first GPIO
7 * @n_latch: optional bit-inverse of initial register value; if
8 * you leave this initialized to zero the driver will act
9 * like the chip was just reset
10 * @setup: optional callback issued once the GPIOs are valid
11 * @teardown: optional callback issued before the GPIOs are invalidated
12 * @context: optional parameter passed to setup() and teardown()
13 *
14 * In addition to the I2C_BOARD_INFO() state appropriate to each chip,
15 * the i2c_board_info used with the pcf875x driver must provide the
16 * chip "type" ("pcf8574", "pcf8574a", "pcf8575", "pcf8575c") and its
17 * platform_data (pointer to one of these structures) with at least
18 * the gpio_base value initialized.
19 *
20 * The @setup callback may be used with the kind of board-specific glue
21 * which hands the (now-valid) GPIOs to other drivers, or which puts
22 * devices in their initial states using these GPIOs.
23 *
24 * These GPIO chips are only "quasi-bidirectional"; read the chip specs
25 * to understand the behavior. They don't have separate registers to
26 * record which pins are used for input or output, record which output
27 * values are driven, or provide access to input values. That must be
28 * inferred by reading the chip's value and knowing the last value written
29 * to it. If you leave n_latch initialized to zero, that last written
30 * value is presumed to be all ones (as if the chip were just reset).
31 */
32struct pcf857x_platform_data {
33 unsigned gpio_base;
34 unsigned n_latch;
35
36 int (*setup)(struct i2c_client *client,
37 int gpio, unsigned ngpio,
38 void *context);
39 int (*teardown)(struct i2c_client *client,
40 int gpio, unsigned ngpio,
41 void *context);
42 void *context;
43};
44
45#endif /* __LINUX_PCF857X_H */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 367c17084a28..acec99da832d 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -115,10 +115,6 @@ typedef unsigned char byte; /* used everywhere */
115#define SATA_ERROR_OFFSET (1) 115#define SATA_ERROR_OFFSET (1)
116#define SATA_CONTROL_OFFSET (2) 116#define SATA_CONTROL_OFFSET (2)
117 117
118#define SATA_MISC_OFFSET (0)
119#define SATA_PHY_OFFSET (1)
120#define SATA_IEN_OFFSET (2)
121
122/* 118/*
123 * Our Physical Region Descriptor (PRD) table should be large enough 119 * Our Physical Region Descriptor (PRD) table should be large enough
124 * to handle the biggest I/O request we are likely to see. Since requests 120 * to handle the biggest I/O request we are likely to see. Since requests
@@ -173,7 +169,7 @@ enum { ide_unknown, ide_generic, ide_pci,
173 ide_rz1000, ide_trm290, 169 ide_rz1000, ide_trm290,
174 ide_cmd646, ide_cy82c693, ide_4drives, 170 ide_cmd646, ide_cy82c693, ide_4drives,
175 ide_pmac, ide_etrax100, ide_acorn, 171 ide_pmac, ide_etrax100, ide_acorn,
176 ide_au1xxx, ide_forced 172 ide_au1xxx, ide_palm3710, ide_forced
177}; 173};
178 174
179typedef u8 hwif_chipset_t; 175typedef u8 hwif_chipset_t;
@@ -198,17 +194,6 @@ struct ide_drive_s;
198int ide_register_hw(hw_regs_t *, void (*)(struct ide_drive_s *), 194int ide_register_hw(hw_regs_t *, void (*)(struct ide_drive_s *),
199 struct hwif_s **); 195 struct hwif_s **);
200 196
201void ide_setup_ports( hw_regs_t *hw,
202 unsigned long base,
203 int *offsets,
204 unsigned long ctrl,
205 unsigned long intr,
206 ide_ack_intr_t *ack_intr,
207#if 0
208 ide_io_ops_t *iops,
209#endif
210 int irq);
211
212static inline void ide_std_init_ports(hw_regs_t *hw, 197static inline void ide_std_init_ports(hw_regs_t *hw,
213 unsigned long io_addr, 198 unsigned long io_addr,
214 unsigned long ctl_addr) 199 unsigned long ctl_addr)
@@ -473,7 +458,6 @@ typedef struct hwif_s {
473 /* task file registers for pata and sata */ 458 /* task file registers for pata and sata */
474 unsigned long io_ports[IDE_NR_PORTS]; 459 unsigned long io_ports[IDE_NR_PORTS];
475 unsigned long sata_scr[SATA_NR_PORTS]; 460 unsigned long sata_scr[SATA_NR_PORTS];
476 unsigned long sata_misc[SATA_NR_PORTS];
477 461
478 ide_drive_t drives[MAX_DRIVES]; /* drive info */ 462 ide_drive_t drives[MAX_DRIVES]; /* drive info */
479 463
@@ -1014,7 +998,8 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o
1014void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *); 998void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *);
1015void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); 999void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);
1016 1000
1017#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 1001/* FIXME: palm_bk3710 uses BLK_DEV_IDEDMA_PCI without BLK_DEV_IDEPCI! */
1002#if defined(CONFIG_BLK_DEV_IDEPCI) && defined(CONFIG_BLK_DEV_IDEDMA_PCI)
1018void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); 1003void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *);
1019#else 1004#else
1020static inline void ide_hwif_setup_dma(ide_hwif_t *hwif, 1005static inline void ide_hwif_setup_dma(ide_hwif_t *hwif,
@@ -1324,4 +1309,25 @@ static inline void ide_set_irq(ide_drive_t *drive, int on)
1324 drive->hwif->OUTB(drive->ctl | (on ? 0 : 2), IDE_CONTROL_REG); 1309 drive->hwif->OUTB(drive->ctl | (on ? 0 : 2), IDE_CONTROL_REG);
1325} 1310}
1326 1311
1312static inline u8 ide_read_status(ide_drive_t *drive)
1313{
1314 ide_hwif_t *hwif = drive->hwif;
1315
1316 return hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]);
1317}
1318
1319static inline u8 ide_read_altstatus(ide_drive_t *drive)
1320{
1321 ide_hwif_t *hwif = drive->hwif;
1322
1323 return hwif->INB(hwif->io_ports[IDE_CONTROL_OFFSET]);
1324}
1325
1326static inline u8 ide_read_error(ide_drive_t *drive)
1327{
1328 ide_hwif_t *hwif = drive->hwif;
1329
1330 return hwif->INB(hwif->io_ports[IDE_ERROR_OFFSET]);
1331}
1332
1327#endif /* _IDE_H */ 1333#endif /* _IDE_H */
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 34f40efc7607..79504b22a932 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -327,7 +327,7 @@ static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, unsigned short t
327 * 327 *
328 * Returns error if the skb is not of VLAN type 328 * Returns error if the skb is not of VLAN type
329 */ 329 */
330static inline int __vlan_get_tag(struct sk_buff *skb, unsigned short *tag) 330static inline int __vlan_get_tag(const struct sk_buff *skb, unsigned short *tag)
331{ 331{
332 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; 332 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data;
333 333
@@ -347,7 +347,8 @@ static inline int __vlan_get_tag(struct sk_buff *skb, unsigned short *tag)
347 * 347 *
348 * Returns error if @skb->cb[] is not set correctly 348 * Returns error if @skb->cb[] is not set correctly
349 */ 349 */
350static inline int __vlan_hwaccel_get_tag(struct sk_buff *skb, unsigned short *tag) 350static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
351 unsigned short *tag)
351{ 352{
352 struct vlan_skb_tx_cookie *cookie; 353 struct vlan_skb_tx_cookie *cookie;
353 354
@@ -370,7 +371,7 @@ static inline int __vlan_hwaccel_get_tag(struct sk_buff *skb, unsigned short *ta
370 * 371 *
371 * Returns error if the skb is not VLAN tagged 372 * Returns error if the skb is not VLAN tagged
372 */ 373 */
373static inline int vlan_get_tag(struct sk_buff *skb, unsigned short *tag) 374static inline int vlan_get_tag(const struct sk_buff *skb, unsigned short *tag)
374{ 375{
375 if (skb->dev->features & NETIF_F_HW_VLAN_TX) { 376 if (skb->dev->features & NETIF_F_HW_VLAN_TX) {
376 return __vlan_hwaccel_get_tag(skb, tag); 377 return __vlan_hwaccel_get_tag(skb, tag);
diff --git a/include/linux/init.h b/include/linux/init.h
index 90cdbbbbe077..a404a0055dd7 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -110,6 +110,7 @@
110#define __FINIT .previous 110#define __FINIT .previous
111 111
112#define __INITDATA .section ".init.data","aw" 112#define __INITDATA .section ".init.data","aw"
113#define __FINITDATA .previous
113 114
114#define __DEVINIT .section ".devinit.text", "ax" 115#define __DEVINIT .section ".devinit.text", "ax"
115#define __DEVINITDATA .section ".devinit.data", "aw" 116#define __DEVINITDATA .section ".devinit.data", "aw"
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index f42663eaf655..1f74e1d7415f 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -121,6 +121,18 @@ extern struct group_info init_groups;
121#else 121#else
122#define INIT_IDS 122#define INIT_IDS
123#endif 123#endif
124
125#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
126/*
127 * Because of the reduced scope of CAP_SETPCAP when filesystem
128 * capabilities are in effect, it is safe to allow CAP_SETPCAP to
129 * be available in the default configuration.
130 */
131# define CAP_INIT_BSET CAP_FULL_SET
132#else
133# define CAP_INIT_BSET CAP_INIT_EFF_SET
134#endif
135
124/* 136/*
125 * INIT_TASK is used to set up the first task table, touch at 137 * INIT_TASK is used to set up the first task table, touch at
126 * your own risk!. Base=0, limit=0x1fffff (=2MB) 138 * your own risk!. Base=0, limit=0x1fffff (=2MB)
@@ -156,6 +168,7 @@ extern struct group_info init_groups;
156 .cap_effective = CAP_INIT_EFF_SET, \ 168 .cap_effective = CAP_INIT_EFF_SET, \
157 .cap_inheritable = CAP_INIT_INH_SET, \ 169 .cap_inheritable = CAP_INIT_INH_SET, \
158 .cap_permitted = CAP_FULL_SET, \ 170 .cap_permitted = CAP_FULL_SET, \
171 .cap_bset = CAP_INIT_BSET, \
159 .keep_capabilities = 0, \ 172 .keep_capabilities = 0, \
160 .user = INIT_USER, \ 173 .user = INIT_USER, \
161 .comm = "swapper", \ 174 .comm = "swapper", \
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index c3db4a00f1fa..dea7598aeff4 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -444,4 +444,6 @@ static inline void init_irq_proc(void)
444} 444}
445#endif 445#endif
446 446
447int show_interrupts(struct seq_file *p, void *v);
448
447#endif 449#endif
diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h
new file mode 100644
index 000000000000..4dd4c04ff2f4
--- /dev/null
+++ b/include/linux/iommu-helper.h
@@ -0,0 +1,7 @@
1extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size,
2 unsigned long start, unsigned int nr,
3 unsigned long shift,
4 unsigned long boundary_size,
5 unsigned long align_mask);
6extern void iommu_area_free(unsigned long *map, unsigned long start,
7 unsigned int nr);
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index d0ecc8eebfbf..9cb2855bb170 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -507,7 +507,6 @@ typedef struct modem_info {
507 struct ktermios normal_termios; /* For saving termios structs */ 507 struct ktermios normal_termios; /* For saving termios structs */
508 struct ktermios callout_termios; 508 struct ktermios callout_termios;
509 wait_queue_head_t open_wait, close_wait; 509 wait_queue_head_t open_wait, close_wait;
510 struct semaphore write_sem;
511 spinlock_t readlock; 510 spinlock_t readlock;
512} modem_info; 511} modem_info;
513 512
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index d9ecd13393b0..b18fd3b9b835 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -33,7 +33,6 @@
33#include <linux/lockdep.h> 33#include <linux/lockdep.h>
34 34
35#include <asm/semaphore.h> 35#include <asm/semaphore.h>
36#endif
37 36
38#define journal_oom_retry 1 37#define journal_oom_retry 1
39 38
@@ -84,7 +83,6 @@ static inline void jbd_free(void *ptr, size_t size)
84 83
85#define JFS_MIN_JOURNAL_BLOCKS 1024 84#define JFS_MIN_JOURNAL_BLOCKS 1024
86 85
87#ifdef __KERNEL__
88 86
89/** 87/**
90 * typedef handle_t - The handle_t type represents a single atomic update being performed by some process. 88 * typedef handle_t - The handle_t type represents a single atomic update being performed by some process.
@@ -924,7 +922,6 @@ extern int journal_recover (journal_t *journal);
924extern int journal_wipe (journal_t *, int); 922extern int journal_wipe (journal_t *, int);
925extern int journal_skip_recovery (journal_t *); 923extern int journal_skip_recovery (journal_t *);
926extern void journal_update_superblock (journal_t *, int); 924extern void journal_update_superblock (journal_t *, int);
927extern void __journal_abort_hard (journal_t *);
928extern void journal_abort (journal_t *, int); 925extern void journal_abort (journal_t *, int);
929extern int journal_errno (journal_t *); 926extern int journal_errno (journal_t *);
930extern void journal_ack_err (journal_t *); 927extern void journal_ack_err (journal_t *);
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index ff356b2ee478..18222f267bc4 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -35,7 +35,7 @@ extern const char linux_proc_banner[];
35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) 35#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) 36#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
37#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) 37#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
38#define IS_ALIGNED(x,a) (((x) % ((typeof(x))(a))) == 0) 38#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
39 39
40#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) 40#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
41 41
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 6168c0a44172..4a6ce82ba039 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -152,8 +152,10 @@ static inline int arch_trampoline_kprobe(struct kprobe *p)
152struct kretprobe { 152struct kretprobe {
153 struct kprobe kp; 153 struct kprobe kp;
154 kretprobe_handler_t handler; 154 kretprobe_handler_t handler;
155 kretprobe_handler_t entry_handler;
155 int maxactive; 156 int maxactive;
156 int nmissed; 157 int nmissed;
158 size_t data_size;
157 struct hlist_head free_instances; 159 struct hlist_head free_instances;
158 struct hlist_head used_instances; 160 struct hlist_head used_instances;
159}; 161};
@@ -164,6 +166,7 @@ struct kretprobe_instance {
164 struct kretprobe *rp; 166 struct kretprobe *rp;
165 kprobe_opcode_t *ret_addr; 167 kprobe_opcode_t *ret_addr;
166 struct task_struct *task; 168 struct task_struct *task;
169 char data[0];
167}; 170};
168 171
169struct kretprobe_blackpoint { 172struct kretprobe_blackpoint {
diff --git a/include/linux/latency.h b/include/linux/latency.h
deleted file mode 100644
index c08b52bb55b0..000000000000
--- a/include/linux/latency.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * latency.h: Explicit system-wide latency-expectation infrastructure
3 *
4 * (C) Copyright 2006 Intel Corporation
5 * Author: Arjan van de Ven <arjan@linux.intel.com>
6 *
7 */
8
9#ifndef _INCLUDE_GUARD_LATENCY_H_
10#define _INCLUDE_GUARD_LATENCY_H_
11
12#include <linux/notifier.h>
13
14void set_acceptable_latency(char *identifier, int usecs);
15void modify_acceptable_latency(char *identifier, int usecs);
16void remove_acceptable_latency(char *identifier);
17void synchronize_acceptable_latency(void);
18int system_latency_constraint(void);
19
20int register_latency_notifier(struct notifier_block * nb);
21int unregister_latency_notifier(struct notifier_block * nb);
22
23#define INFINITE_LATENCY 1000000
24
25#endif
diff --git a/include/linux/leds.h b/include/linux/leds.h
index b4130ff58d0c..00f89fd6c52a 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -54,7 +54,15 @@ struct led_classdev {
54 54
55extern int led_classdev_register(struct device *parent, 55extern int led_classdev_register(struct device *parent,
56 struct led_classdev *led_cdev); 56 struct led_classdev *led_cdev);
57extern void led_classdev_unregister(struct led_classdev *led_cdev); 57extern void __led_classdev_unregister(struct led_classdev *led_cdev, bool sus);
58static inline void led_classdev_unregister(struct led_classdev *lcd)
59{
60 __led_classdev_unregister(lcd, false);
61}
62static inline void led_classdev_unregister_suspended(struct led_classdev *lcd)
63{
64 __led_classdev_unregister(lcd, true);
65}
58extern void led_classdev_suspend(struct led_classdev *led_cdev); 66extern void led_classdev_suspend(struct led_classdev *led_cdev);
59extern void led_classdev_resume(struct led_classdev *led_cdev); 67extern void led_classdev_resume(struct led_classdev *led_cdev);
60 68
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 4374c4277780..bc5a8d0c7090 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -457,7 +457,6 @@ struct ata_queued_cmd {
457 unsigned long flags; /* ATA_QCFLAG_xxx */ 457 unsigned long flags; /* ATA_QCFLAG_xxx */
458 unsigned int tag; 458 unsigned int tag;
459 unsigned int n_elem; 459 unsigned int n_elem;
460 unsigned int n_iter;
461 unsigned int mapped_n_elem; 460 unsigned int mapped_n_elem;
462 461
463 int dma_dir; 462 int dma_dir;
@@ -1367,7 +1366,6 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
1367 qc->nbytes = qc->raw_nbytes = qc->curbytes = 0; 1366 qc->nbytes = qc->raw_nbytes = qc->curbytes = 0;
1368 qc->n_elem = 0; 1367 qc->n_elem = 0;
1369 qc->mapped_n_elem = 0; 1368 qc->mapped_n_elem = 0;
1370 qc->n_iter = 0;
1371 qc->err_mask = 0; 1369 qc->err_mask = 0;
1372 qc->pad_len = 0; 1370 qc->pad_len = 0;
1373 qc->last_sg = NULL; 1371 qc->last_sg = NULL;
diff --git a/include/linux/log2.h b/include/linux/log2.h
index c8cf5e8ef171..25b808631cd9 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -190,4 +190,20 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
190 __rounddown_pow_of_two(n) \ 190 __rounddown_pow_of_two(n) \
191 ) 191 )
192 192
193/**
194 * order_base_2 - calculate the (rounded up) base 2 order of the argument
195 * @n: parameter
196 *
197 * The first few values calculated by this routine:
198 * ob2(0) = 0
199 * ob2(1) = 0
200 * ob2(2) = 1
201 * ob2(3) = 2
202 * ob2(4) = 2
203 * ob2(5) = 3
204 * ... and so on.
205 */
206
207#define order_base_2(n) ilog2(roundup_pow_of_two(n))
208
193#endif /* _LINUX_LOG2_H */ 209#endif /* _LINUX_LOG2_H */
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 26a0a103898f..46169a7b559b 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -76,6 +76,7 @@ struct loop_device {
76enum { 76enum {
77 LO_FLAGS_READ_ONLY = 1, 77 LO_FLAGS_READ_ONLY = 1,
78 LO_FLAGS_USE_AOPS = 2, 78 LO_FLAGS_USE_AOPS = 2,
79 LO_FLAGS_AUTOCLEAR = 4,
79}; 80};
80 81
81#include <asm/posix_types.h> /* for __kernel_old_dev_t */ 82#include <asm/posix_types.h> /* for __kernel_old_dev_t */
diff --git a/include/linux/lp.h b/include/linux/lp.h
index 7059b6b9878a..0df024bfd6f0 100644
--- a/include/linux/lp.h
+++ b/include/linux/lp.h
@@ -99,7 +99,7 @@
99#ifdef __KERNEL__ 99#ifdef __KERNEL__
100 100
101#include <linux/wait.h> 101#include <linux/wait.h>
102#include <asm/semaphore.h> 102#include <linux/mutex.h>
103 103
104/* Magic numbers for defining port-device mappings */ 104/* Magic numbers for defining port-device mappings */
105#define LP_PARPORT_UNSPEC -4 105#define LP_PARPORT_UNSPEC -4
@@ -145,7 +145,7 @@ struct lp_struct {
145#endif 145#endif
146 wait_queue_head_t waitq; 146 wait_queue_head_t waitq;
147 unsigned int last_error; 147 unsigned int last_error;
148 struct semaphore port_mutex; 148 struct mutex port_mutex;
149 wait_queue_head_t dataq; 149 wait_queue_head_t dataq;
150 long timeout; 150 long timeout;
151 unsigned int best_mode; 151 unsigned int best_mode;
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index dff9ea32606a..24b30b9b4f8a 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -43,7 +43,15 @@ struct miscdevice {
43}; 43};
44 44
45extern int misc_register(struct miscdevice * misc); 45extern int misc_register(struct miscdevice * misc);
46extern int misc_deregister(struct miscdevice * misc); 46extern int __misc_deregister(struct miscdevice *misc, bool suspended);
47static inline int misc_deregister(struct miscdevice *misc)
48{
49 return __misc_deregister(misc, false);
50}
51static inline int misc_deregister_suspended(struct miscdevice *misc)
52{
53 return __misc_deregister(misc, true);
54}
47 55
48#define MODULE_ALIAS_MISCDEV(minor) \ 56#define MODULE_ALIAS_MISCDEV(minor) \
49 MODULE_ALIAS("char-major-" __stringify(MISC_MAJOR) \ 57 MODULE_ALIAS("char-major-" __stringify(MISC_MAJOR) \
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 1bba6789a50a..89d7c691b93a 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -227,10 +227,22 @@ static inline int put_page_testzero(struct page *page)
227 */ 227 */
228static inline int get_page_unless_zero(struct page *page) 228static inline int get_page_unless_zero(struct page *page)
229{ 229{
230 VM_BUG_ON(PageCompound(page)); 230 VM_BUG_ON(PageTail(page));
231 return atomic_inc_not_zero(&page->_count); 231 return atomic_inc_not_zero(&page->_count);
232} 232}
233 233
234/* Support for virtually mapped pages */
235struct page *vmalloc_to_page(const void *addr);
236unsigned long vmalloc_to_pfn(const void *addr);
237
238/* Determine if an address is within the vmalloc range */
239static inline int is_vmalloc_addr(const void *x)
240{
241 unsigned long addr = (unsigned long)x;
242
243 return addr >= VMALLOC_START && addr < VMALLOC_END;
244}
245
234static inline struct page *compound_head(struct page *page) 246static inline struct page *compound_head(struct page *page)
235{ 247{
236 if (unlikely(PageTail(page))) 248 if (unlikely(PageTail(page)))
@@ -706,6 +718,28 @@ unsigned long unmap_vmas(struct mmu_gather **tlb,
706 struct vm_area_struct *start_vma, unsigned long start_addr, 718 struct vm_area_struct *start_vma, unsigned long start_addr,
707 unsigned long end_addr, unsigned long *nr_accounted, 719 unsigned long end_addr, unsigned long *nr_accounted,
708 struct zap_details *); 720 struct zap_details *);
721
722/**
723 * mm_walk - callbacks for walk_page_range
724 * @pgd_entry: if set, called for each non-empty PGD (top-level) entry
725 * @pud_entry: if set, called for each non-empty PUD (2nd-level) entry
726 * @pmd_entry: if set, called for each non-empty PMD (3rd-level) entry
727 * @pte_entry: if set, called for each non-empty PTE (4th-level) entry
728 * @pte_hole: if set, called for each hole at all levels
729 *
730 * (see walk_page_range for more details)
731 */
732struct mm_walk {
733 int (*pgd_entry)(pgd_t *, unsigned long, unsigned long, void *);
734 int (*pud_entry)(pud_t *, unsigned long, unsigned long, void *);
735 int (*pmd_entry)(pmd_t *, unsigned long, unsigned long, void *);
736 int (*pte_entry)(pte_t *, unsigned long, unsigned long, void *);
737 int (*pte_hole)(unsigned long, unsigned long, void *);
738};
739
740int walk_page_range(const struct mm_struct *, unsigned long addr,
741 unsigned long end, const struct mm_walk *walk,
742 void *private);
709void free_pgd_range(struct mmu_gather **tlb, unsigned long addr, 743void free_pgd_range(struct mmu_gather **tlb, unsigned long addr,
710 unsigned long end, unsigned long floor, unsigned long ceiling); 744 unsigned long end, unsigned long floor, unsigned long ceiling);
711void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *start_vma, 745void free_pgtables(struct mmu_gather **tlb, struct vm_area_struct *start_vma,
@@ -1089,8 +1123,6 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma)
1089 1123
1090pgprot_t vm_get_page_prot(unsigned long vm_flags); 1124pgprot_t vm_get_page_prot(unsigned long vm_flags);
1091struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); 1125struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr);
1092struct page *vmalloc_to_page(void *addr);
1093unsigned long vmalloc_to_pfn(void *addr);
1094int remap_pfn_range(struct vm_area_struct *, unsigned long addr, 1126int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
1095 unsigned long pfn, unsigned long size, pgprot_t); 1127 unsigned long pfn, unsigned long size, pgprot_t);
1096int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *); 1128int vm_insert_page(struct vm_area_struct *, unsigned long addr, struct page *);
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 4c4522a51a3b..8d8d1977736e 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -113,7 +113,7 @@ struct per_cpu_pages {
113}; 113};
114 114
115struct per_cpu_pageset { 115struct per_cpu_pageset {
116 struct per_cpu_pages pcp[2]; /* 0: hot. 1: cold */ 116 struct per_cpu_pages pcp;
117#ifdef CONFIG_NUMA 117#ifdef CONFIG_NUMA
118 s8 expire; 118 s8 expire;
119#endif 119#endif
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index e9fddb42f26c..139d49d2f078 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -343,7 +343,8 @@ struct sdio_device_id {
343 __u8 class; /* Standard interface or SDIO_ANY_ID */ 343 __u8 class; /* Standard interface or SDIO_ANY_ID */
344 __u16 vendor; /* Vendor or SDIO_ANY_ID */ 344 __u16 vendor; /* Vendor or SDIO_ANY_ID */
345 __u16 device; /* Device ID or SDIO_ANY_ID */ 345 __u16 device; /* Device ID or SDIO_ANY_ID */
346 kernel_ulong_t driver_data; /* Data private to the driver */ 346 kernel_ulong_t driver_data /* Data private to the driver */
347 __attribute__((aligned(sizeof(kernel_ulong_t))));
347}; 348};
348 349
349/* SSB core, see drivers/ssb/ */ 350/* SSB core, see drivers/ssb/ */
diff --git a/include/linux/nubus.h b/include/linux/nubus.h
index cdb3e9b8db54..c4355076d1a5 100644
--- a/include/linux/nubus.h
+++ b/include/linux/nubus.h
@@ -132,10 +132,12 @@ enum nubus_drhw {
132 NUBUS_DRHW_RDIUS_DCGX = 0x027C, /* Radius DirectColor/GX */ 132 NUBUS_DRHW_RDIUS_DCGX = 0x027C, /* Radius DirectColor/GX */
133 NUBUS_DRHW_RDIUS_PC8 = 0x0291, /* Radius PrecisionColor 8 */ 133 NUBUS_DRHW_RDIUS_PC8 = 0x0291, /* Radius PrecisionColor 8 */
134 NUBUS_DRHW_LAPIS_PCS8 = 0x0292, /* Lapis ProColorServer 8 */ 134 NUBUS_DRHW_LAPIS_PCS8 = 0x0292, /* Lapis ProColorServer 8 */
135 NUBUS_DRHW_RASTER_24LXI = 0x02A0, /* RasterOps 8/24 XLi */ 135 NUBUS_DRHW_RASTER_24XLI = 0x02A0, /* RasterOps 8/24 XLi */
136 NUBUS_DRHW_RASTER_PBPGT = 0x02A5, /* RasterOps PaintBoard Prism GT */ 136 NUBUS_DRHW_RASTER_PBPGT = 0x02A5, /* RasterOps PaintBoard Prism GT */
137 NUBUS_DRHW_EMACH_FSX = 0x02AE, /* E-Machines Futura SX */ 137 NUBUS_DRHW_EMACH_FSX = 0x02AE, /* E-Machines Futura SX */
138 NUBUS_DRHW_RASTER_24XLTV = 0x02B7, /* RasterOps 24XLTV */
138 NUBUS_DRHW_SMAC_THUND24 = 0x02CB, /* SuperMac Thunder/24 */ 139 NUBUS_DRHW_SMAC_THUND24 = 0x02CB, /* SuperMac Thunder/24 */
140 NUBUS_DRHW_SMAC_THUNDLGHT = 0x03D9, /* SuperMac ThunderLight */
139 NUBUS_DRHW_RDIUS_PC24XP = 0x0406, /* Radius PrecisionColor 24Xp */ 141 NUBUS_DRHW_RDIUS_PC24XP = 0x0406, /* Radius PrecisionColor 24Xp */
140 NUBUS_DRHW_RDIUS_PC24X = 0x040A, /* Radius PrecisionColor 24X */ 142 NUBUS_DRHW_RDIUS_PC24X = 0x040A, /* Radius PrecisionColor 24X */
141 NUBUS_DRHW_RDIUS_PC8XJ = 0x040B, /* Radius PrecisionColor 8XJ */ 143 NUBUS_DRHW_RDIUS_PC8XJ = 0x040B, /* Radius PrecisionColor 8XJ */
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 209d3a47f50f..bbad43fb8181 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -131,16 +131,52 @@
131#define ClearPageReferenced(page) clear_bit(PG_referenced, &(page)->flags) 131#define ClearPageReferenced(page) clear_bit(PG_referenced, &(page)->flags)
132#define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags) 132#define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags)
133 133
134#define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags) 134static inline int PageUptodate(struct page *page)
135{
136 int ret = test_bit(PG_uptodate, &(page)->flags);
137
138 /*
139 * Must ensure that the data we read out of the page is loaded
140 * _after_ we've loaded page->flags to check for PageUptodate.
141 * We can skip the barrier if the page is not uptodate, because
142 * we wouldn't be reading anything from it.
143 *
144 * See SetPageUptodate() for the other side of the story.
145 */
146 if (ret)
147 smp_rmb();
148
149 return ret;
150}
151
152static inline void __SetPageUptodate(struct page *page)
153{
154 smp_wmb();
155 __set_bit(PG_uptodate, &(page)->flags);
135#ifdef CONFIG_S390 156#ifdef CONFIG_S390
157 page_clear_dirty(page);
158#endif
159}
160
136static inline void SetPageUptodate(struct page *page) 161static inline void SetPageUptodate(struct page *page)
137{ 162{
163#ifdef CONFIG_S390
138 if (!test_and_set_bit(PG_uptodate, &page->flags)) 164 if (!test_and_set_bit(PG_uptodate, &page->flags))
139 page_clear_dirty(page); 165 page_clear_dirty(page);
140}
141#else 166#else
142#define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) 167 /*
168 * Memory barrier must be issued before setting the PG_uptodate bit,
169 * so that all previous stores issued in order to bring the page
170 * uptodate are actually visible before PageUptodate becomes true.
171 *
172 * s390 doesn't need an explicit smp_wmb here because the test and
173 * set bit already provides full barriers.
174 */
175 smp_wmb();
176 set_bit(PG_uptodate, &(page)->flags);
143#endif 177#endif
178}
179
144#define ClearPageUptodate(page) clear_bit(PG_uptodate, &(page)->flags) 180#define ClearPageUptodate(page) clear_bit(PG_uptodate, &(page)->flags)
145 181
146#define PageDirty(page) test_bit(PG_dirty, &(page)->flags) 182#define PageDirty(page) test_bit(PG_dirty, &(page)->flags)
diff --git a/include/linux/pci.h b/include/linux/pci.h
index cee75c0ff6e7..7215d3b1f4af 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -159,6 +159,8 @@ struct pci_dev {
159 this if your device has broken DMA 159 this if your device has broken DMA
160 or supports 64-bit transfers. */ 160 or supports 64-bit transfers. */
161 161
162 struct device_dma_parameters dma_parms;
163
162 pci_power_t current_state; /* Current operating state. In ACPI-speak, 164 pci_power_t current_state; /* Current operating state. In ACPI-speak,
163 this is D0-D3, D0 being fully functional, 165 this is D0-D3, D0 being fully functional,
164 and D3 being off. */ 166 and D3 being off. */
@@ -580,6 +582,8 @@ void pci_intx(struct pci_dev *dev, int enable);
580void pci_msi_off(struct pci_dev *dev); 582void pci_msi_off(struct pci_dev *dev);
581int pci_set_dma_mask(struct pci_dev *dev, u64 mask); 583int pci_set_dma_mask(struct pci_dev *dev, u64 mask);
582int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); 584int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask);
585int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size);
586int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask);
583int pcix_get_max_mmrbc(struct pci_dev *dev); 587int pcix_get_max_mmrbc(struct pci_dev *dev);
584int pcix_get_mmrbc(struct pci_dev *dev); 588int pcix_get_mmrbc(struct pci_dev *dev);
585int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); 589int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc);
@@ -822,6 +826,18 @@ static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
822 return -EIO; 826 return -EIO;
823} 827}
824 828
829static inline int pci_set_dma_max_seg_size(struct pci_dev *dev,
830 unsigned int size)
831{
832 return -EIO;
833}
834
835static inline int pci_set_dma_seg_boundary(struct pci_dev *dev,
836 unsigned long mask)
837{
838 return -EIO;
839}
840
825static inline int pci_assign_resource(struct pci_dev *dev, int i) 841static inline int pci_assign_resource(struct pci_dev *dev, int i)
826{ 842{
827 return -EBUSY; 843 return -EBUSY;
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 41f6f28690f6..df6dd79a0d3b 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1765,6 +1765,7 @@
1765#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020 1765#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020
1766#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050 1766#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050
1767#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060 1767#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060
1768#define PCI_DEVICE_ID_QUATECH_SPPXP_100 0x0278
1768 1769
1769#define PCI_VENDOR_ID_SEALEVEL 0x135e 1770#define PCI_VENDOR_ID_SEALEVEL 0x135e
1770#define PCI_DEVICE_ID_SEALEVEL_U530 0x7101 1771#define PCI_DEVICE_ID_SEALEVEL_U530 0x7101
@@ -2043,6 +2044,23 @@
2043#define PCI_VENDOR_ID_QUICKNET 0x15e2 2044#define PCI_VENDOR_ID_QUICKNET 0x15e2
2044#define PCI_DEVICE_ID_QUICKNET_XJ 0x0500 2045#define PCI_DEVICE_ID_QUICKNET_XJ 0x0500
2045 2046
2047/*
2048 * ADDI-DATA GmbH communication cards <info@addi-data.com>
2049 */
2050#define PCI_VENDOR_ID_ADDIDATA_OLD 0x10E8
2051#define PCI_VENDOR_ID_ADDIDATA 0x15B8
2052#define PCI_DEVICE_ID_ADDIDATA_APCI7500 0x7000
2053#define PCI_DEVICE_ID_ADDIDATA_APCI7420 0x7001
2054#define PCI_DEVICE_ID_ADDIDATA_APCI7300 0x7002
2055#define PCI_DEVICE_ID_ADDIDATA_APCI7800 0x818E
2056#define PCI_DEVICE_ID_ADDIDATA_APCI7500_2 0x7009
2057#define PCI_DEVICE_ID_ADDIDATA_APCI7420_2 0x700A
2058#define PCI_DEVICE_ID_ADDIDATA_APCI7300_2 0x700B
2059#define PCI_DEVICE_ID_ADDIDATA_APCI7500_3 0x700C
2060#define PCI_DEVICE_ID_ADDIDATA_APCI7420_3 0x700D
2061#define PCI_DEVICE_ID_ADDIDATA_APCI7300_3 0x700E
2062#define PCI_DEVICE_ID_ADDIDATA_APCI7800_3 0x700F
2063
2046#define PCI_VENDOR_ID_PDC 0x15e9 2064#define PCI_VENDOR_ID_PDC 0x15e9
2047 2065
2048#define PCI_VENDOR_ID_FARSITE 0x1619 2066#define PCI_VENDOR_ID_FARSITE 0x1619
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 50faa0ea28e4..1ac969724bb2 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -54,7 +54,7 @@
54#ifdef CONFIG_SMP 54#ifdef CONFIG_SMP
55 55
56struct percpu_data { 56struct percpu_data {
57 void *ptrs[NR_CPUS]; 57 void *ptrs[1];
58}; 58};
59 59
60#define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata) 60#define __percpu_disguise(pdata) (struct percpu_data *)~(unsigned long)(pdata)
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index 1c1dba9ea5fb..28dfc61cf79e 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -348,6 +348,7 @@ enum
348 FLOW_KEY_RTCLASSID, 348 FLOW_KEY_RTCLASSID,
349 FLOW_KEY_SKUID, 349 FLOW_KEY_SKUID,
350 FLOW_KEY_SKGID, 350 FLOW_KEY_SKGID,
351 FLOW_KEY_VLAN_TAG,
351 __FLOW_KEY_MAX, 352 __FLOW_KEY_MAX,
352}; 353};
353 354
@@ -459,7 +460,8 @@ enum
459#define TCF_EM_U32 3 460#define TCF_EM_U32 3
460#define TCF_EM_META 4 461#define TCF_EM_META 4
461#define TCF_EM_TEXT 5 462#define TCF_EM_TEXT 5
462#define TCF_EM_MAX 5 463#define TCF_EM_VLAN 6
464#define TCF_EM_MAX 6
463 465
464enum 466enum
465{ 467{
diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h
new file mode 100644
index 000000000000..2e4e97bd19f7
--- /dev/null
+++ b/include/linux/pm_qos_params.h
@@ -0,0 +1,25 @@
1/* interface for the pm_qos_power infrastructure of the linux kernel.
2 *
3 * Mark Gross
4 */
5#include <linux/list.h>
6#include <linux/notifier.h>
7#include <linux/miscdevice.h>
8
9#define PM_QOS_RESERVED 0
10#define PM_QOS_CPU_DMA_LATENCY 1
11#define PM_QOS_NETWORK_LATENCY 2
12#define PM_QOS_NETWORK_THROUGHPUT 3
13
14#define PM_QOS_NUM_CLASSES 4
15#define PM_QOS_DEFAULT_VALUE -1
16
17int pm_qos_add_requirement(int qos, char *name, s32 value);
18int pm_qos_update_requirement(int qos, char *name, s32 new_value);
19void pm_qos_remove_requirement(int qos, char *name);
20
21int pm_qos_requirement(int qos);
22
23int pm_qos_add_notifier(int qos, struct notifier_block *notifier);
24int pm_qos_remove_notifier(int qos, struct notifier_block *notifier);
25
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index b9339d8b95bc..cd6332b88829 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -258,6 +258,7 @@ extern struct pnp_protocol isapnp_protocol;
258#else 258#else
259#define pnp_device_is_isapnp(dev) 0 259#define pnp_device_is_isapnp(dev) 0
260#endif 260#endif
261extern struct mutex pnp_res_mutex;
261 262
262#ifdef CONFIG_PNPBIOS 263#ifdef CONFIG_PNPBIOS
263extern struct pnp_protocol pnpbios_protocol; 264extern struct pnp_protocol pnpbios_protocol;
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 5cbf3e371012..68ed19ccf1f7 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -94,6 +94,7 @@ enum power_supply_property {
94 /* Properties of type `const char *' */ 94 /* Properties of type `const char *' */
95 POWER_SUPPLY_PROP_MODEL_NAME, 95 POWER_SUPPLY_PROP_MODEL_NAME,
96 POWER_SUPPLY_PROP_MANUFACTURER, 96 POWER_SUPPLY_PROP_MANUFACTURER,
97 POWER_SUPPLY_PROP_SERIAL_NUMBER,
97}; 98};
98 99
99enum power_supply_type { 100enum power_supply_type {
diff --git a/include/linux/prctl.h b/include/linux/prctl.h
index e2eff9079fe9..3800639775ae 100644
--- a/include/linux/prctl.h
+++ b/include/linux/prctl.h
@@ -63,4 +63,8 @@
63#define PR_GET_SECCOMP 21 63#define PR_GET_SECCOMP 21
64#define PR_SET_SECCOMP 22 64#define PR_SET_SECCOMP 22
65 65
66/* Get/set the capability bounding set */
67#define PR_CAPBSET_READ 23
68#define PR_CAPBSET_DROP 24
69
66#endif /* _LINUX_PRCTL_H */ 70#endif /* _LINUX_PRCTL_H */
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 8f92546b403d..e43551516831 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -19,6 +19,8 @@ struct completion;
19 */ 19 */
20#define FIRST_PROCESS_ENTRY 256 20#define FIRST_PROCESS_ENTRY 256
21 21
22/* Worst case buffer size needed for holding an integer. */
23#define PROC_NUMBUF 13
22 24
23/* 25/*
24 * We always define these enumerators 26 * We always define these enumerators
@@ -117,7 +119,6 @@ int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir);
117unsigned long task_vsize(struct mm_struct *); 119unsigned long task_vsize(struct mm_struct *);
118int task_statm(struct mm_struct *, int *, int *, int *, int *); 120int task_statm(struct mm_struct *, int *, int *, int *, int *);
119char *task_mem(struct mm_struct *, char *); 121char *task_mem(struct mm_struct *, char *);
120void clear_refs_smap(struct mm_struct *mm);
121 122
122struct proc_dir_entry *de_get(struct proc_dir_entry *de); 123struct proc_dir_entry *de_get(struct proc_dir_entry *de);
123void de_put(struct proc_dir_entry *de); 124void de_put(struct proc_dir_entry *de);
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 515bff053de8..6ab80714a916 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -204,6 +204,41 @@ static inline void user_enable_block_step(struct task_struct *task)
204} 204}
205#endif /* arch_has_block_step */ 205#endif /* arch_has_block_step */
206 206
207#ifndef arch_ptrace_stop_needed
208/**
209 * arch_ptrace_stop_needed - Decide whether arch_ptrace_stop() should be called
210 * @code: current->exit_code value ptrace will stop with
211 * @info: siginfo_t pointer (or %NULL) for signal ptrace will stop with
212 *
213 * This is called with the siglock held, to decide whether or not it's
214 * necessary to release the siglock and call arch_ptrace_stop() with the
215 * same @code and @info arguments. It can be defined to a constant if
216 * arch_ptrace_stop() is never required, or always is. On machines where
217 * this makes sense, it should be defined to a quick test to optimize out
218 * calling arch_ptrace_stop() when it would be superfluous. For example,
219 * if the thread has not been back to user mode since the last stop, the
220 * thread state might indicate that nothing needs to be done.
221 */
222#define arch_ptrace_stop_needed(code, info) (0)
223#endif
224
225#ifndef arch_ptrace_stop
226/**
227 * arch_ptrace_stop - Do machine-specific work before stopping for ptrace
228 * @code: current->exit_code value ptrace will stop with
229 * @info: siginfo_t pointer (or %NULL) for signal ptrace will stop with
230 *
231 * This is called with no locks held when arch_ptrace_stop_needed() has
232 * just returned nonzero. It is allowed to block, e.g. for user memory
233 * access. The arch can have machine-specific work to be done before
234 * ptrace stops. On ia64, register backing store gets written back to user
235 * memory here. Since this can be costly (requires dropping the siglock),
236 * we only do it when the arch requires it for this particular stop, as
237 * indicated by arch_ptrace_stop_needed().
238 */
239#define arch_ptrace_stop(code, info) do { } while (0)
240#endif
241
207#endif 242#endif
208 243
209#endif 244#endif
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index 306a1d1a5af0..e51b531cd0b2 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -244,6 +244,8 @@ struct bitmap {
244 */ 244 */
245 unsigned long daemon_lastrun; /* jiffies of last run */ 245 unsigned long daemon_lastrun; /* jiffies of last run */
246 unsigned long daemon_sleep; /* how many seconds between updates? */ 246 unsigned long daemon_sleep; /* how many seconds between updates? */
247 unsigned long last_end_sync; /* when we lasted called end_sync to
248 * update bitmap with resync progress */
247 249
248 atomic_t pending_writes; /* pending writes to the bitmap file */ 250 atomic_t pending_writes; /* pending writes to the bitmap file */
249 wait_queue_head_t write_wait; 251 wait_queue_head_t write_wait;
@@ -275,6 +277,7 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset,
275int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded); 277int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded);
276void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); 278void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted);
277void bitmap_close_sync(struct bitmap *bitmap); 279void bitmap_close_sync(struct bitmap *bitmap);
280void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector);
278 281
279void bitmap_unplug(struct bitmap *bitmap); 282void bitmap_unplug(struct bitmap *bitmap);
280void bitmap_daemon_work(struct bitmap *bitmap); 283void bitmap_daemon_work(struct bitmap *bitmap);
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index dcb729244f47..85a068bab625 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -81,6 +81,8 @@ struct mdk_rdev_s
81#define In_sync 2 /* device is in_sync with rest of array */ 81#define In_sync 2 /* device is in_sync with rest of array */
82#define WriteMostly 4 /* Avoid reading if at all possible */ 82#define WriteMostly 4 /* Avoid reading if at all possible */
83#define BarriersNotsupp 5 /* BIO_RW_BARRIER is not supported */ 83#define BarriersNotsupp 5 /* BIO_RW_BARRIER is not supported */
84#define AllReserved 6 /* If whole device is reserved for
85 * one array */
84 86
85 int desc_nr; /* descriptor index in the superblock */ 87 int desc_nr; /* descriptor index in the superblock */
86 int raid_disk; /* role of device in array */ 88 int raid_disk; /* role of device in array */
@@ -130,6 +132,9 @@ struct mddev_s
130 minor_version, 132 minor_version,
131 patch_version; 133 patch_version;
132 int persistent; 134 int persistent;
135 int external; /* metadata is
136 * managed externally */
137 char metadata_type[17]; /* externally set*/
133 int chunk_size; 138 int chunk_size;
134 time_t ctime, utime; 139 time_t ctime, utime;
135 int level, layout; 140 int level, layout;
@@ -216,6 +221,8 @@ struct mddev_s
216 atomic_t recovery_active; /* blocks scheduled, but not written */ 221 atomic_t recovery_active; /* blocks scheduled, but not written */
217 wait_queue_head_t recovery_wait; 222 wait_queue_head_t recovery_wait;
218 sector_t recovery_cp; 223 sector_t recovery_cp;
224 sector_t resync_max; /* resync should pause
225 * when it gets here */
219 226
220 spinlock_t write_lock; 227 spinlock_t write_lock;
221 wait_queue_head_t sb_wait; /* for waiting on superblock updates */ 228 wait_queue_head_t sb_wait; /* for waiting on superblock updates */
@@ -306,23 +313,17 @@ static inline char * mdname (mddev_t * mddev)
306 * iterates through some rdev ringlist. It's safe to remove the 313 * iterates through some rdev ringlist. It's safe to remove the
307 * current 'rdev'. Dont touch 'tmp' though. 314 * current 'rdev'. Dont touch 'tmp' though.
308 */ 315 */
309#define ITERATE_RDEV_GENERIC(head,rdev,tmp) \ 316#define rdev_for_each_list(rdev, tmp, list) \
310 \ 317 \
311 for ((tmp) = (head).next; \ 318 for ((tmp) = (list).next; \
312 (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \ 319 (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)), \
313 (tmp) = (tmp)->next, (tmp)->prev != &(head) \ 320 (tmp) = (tmp)->next, (tmp)->prev != &(list) \
314 ; ) 321 ; )
315/* 322/*
316 * iterates through the 'same array disks' ringlist 323 * iterates through the 'same array disks' ringlist
317 */ 324 */
318#define ITERATE_RDEV(mddev,rdev,tmp) \ 325#define rdev_for_each(rdev, tmp, mddev) \
319 ITERATE_RDEV_GENERIC((mddev)->disks,rdev,tmp) 326 rdev_for_each_list(rdev, tmp, (mddev)->disks)
320
321/*
322 * Iterates through 'pending RAID disks'
323 */
324#define ITERATE_RDEV_PENDING(rdev,tmp) \
325 ITERATE_RDEV_GENERIC(pending_raid_disks,rdev,tmp)
326 327
327typedef struct mdk_thread_s { 328typedef struct mdk_thread_s {
328 void (*run) (mddev_t *mddev); 329 void (*run) (mddev_t *mddev);
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index d32c14de270e..37a642c54871 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -174,10 +174,13 @@ struct rcu_head {
174 * code. 174 * code.
175 */ 175 */
176 176
177#define rcu_assign_pointer(p, v) ({ \ 177#define rcu_assign_pointer(p, v) \
178 smp_wmb(); \ 178 ({ \
179 (p) = (v); \ 179 if (!__builtin_constant_p(v) || \
180 }) 180 ((v) != NULL)) \
181 smp_wmb(); \
182 (p) = (v); \
183 })
181 184
182/** 185/**
183 * synchronize_sched - block until all CPUs have exited any non-preemptive 186 * synchronize_sched - block until all CPUs have exited any non-preemptive
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 85ea63f462af..b93b541cf111 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -59,8 +59,6 @@ extern void machine_crash_shutdown(struct pt_regs *);
59 * Architecture independent implemenations of sys_reboot commands. 59 * Architecture independent implemenations of sys_reboot commands.
60 */ 60 */
61 61
62extern void kernel_shutdown_prepare(enum system_states state);
63
64extern void kernel_restart(char *cmd); 62extern void kernel_restart(char *cmd);
65extern void kernel_halt(void); 63extern void kernel_halt(void);
66extern void kernel_power_off(void); 64extern void kernel_power_off(void);
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index b014f6b7fe29..b9e174079002 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -602,24 +602,12 @@ struct tcamsg
602 602
603#include <linux/mutex.h> 603#include <linux/mutex.h>
604 604
605extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size);
606static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) 605static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
607{ 606{
608 int len = strlen(str) + 1; 607 int len = strlen(str) + 1;
609 return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len); 608 return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len);
610} 609}
611 610
612extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len);
613extern int __rtattr_parse_nested_compat(struct rtattr *tb[], int maxattr,
614 struct rtattr *rta, int len);
615
616#define rtattr_parse_nested(tb, max, rta) \
617 rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta)))
618
619#define rtattr_parse_nested_compat(tb, max, rta, data, len) \
620({ data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL; \
621 __rtattr_parse_nested_compat(tb, max, rta, len); })
622
623extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); 611extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo);
624extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid); 612extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid);
625extern int rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group, 613extern int rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, u32 group,
diff --git a/include/linux/sched.h b/include/linux/sched.h
index af6947e69b40..7c8ca05c3cae 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -555,6 +555,13 @@ struct signal_struct {
555#define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */ 555#define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */
556#define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */ 556#define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */
557 557
558/* If true, all threads except ->group_exit_task have pending SIGKILL */
559static inline int signal_group_exit(const struct signal_struct *sig)
560{
561 return (sig->flags & SIGNAL_GROUP_EXIT) ||
562 (sig->group_exit_task != NULL);
563}
564
558/* 565/*
559 * Some day this will be a full-fledged user tracking system.. 566 * Some day this will be a full-fledged user tracking system..
560 */ 567 */
@@ -803,7 +810,7 @@ static inline int above_background_load(void)
803 810
804struct io_context; /* See blkdev.h */ 811struct io_context; /* See blkdev.h */
805#define NGROUPS_SMALL 32 812#define NGROUPS_SMALL 32
806#define NGROUPS_PER_BLOCK ((int)(PAGE_SIZE / sizeof(gid_t))) 813#define NGROUPS_PER_BLOCK ((unsigned int)(PAGE_SIZE / sizeof(gid_t)))
807struct group_info { 814struct group_info {
808 int ngroups; 815 int ngroups;
809 atomic_t usage; 816 atomic_t usage;
@@ -1091,7 +1098,7 @@ struct task_struct {
1091 uid_t uid,euid,suid,fsuid; 1098 uid_t uid,euid,suid,fsuid;
1092 gid_t gid,egid,sgid,fsgid; 1099 gid_t gid,egid,sgid,fsgid;
1093 struct group_info *group_info; 1100 struct group_info *group_info;
1094 kernel_cap_t cap_effective, cap_inheritable, cap_permitted; 1101 kernel_cap_t cap_effective, cap_inheritable, cap_permitted, cap_bset;
1095 unsigned keep_capabilities:1; 1102 unsigned keep_capabilities:1;
1096 struct user_struct *user; 1103 struct user_struct *user;
1097#ifdef CONFIG_KEYS 1104#ifdef CONFIG_KEYS
@@ -1770,7 +1777,7 @@ extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned lon
1770struct task_struct *fork_idle(int); 1777struct task_struct *fork_idle(int);
1771 1778
1772extern void set_task_comm(struct task_struct *tsk, char *from); 1779extern void set_task_comm(struct task_struct *tsk, char *from);
1773extern void get_task_comm(char *to, struct task_struct *tsk); 1780extern char *get_task_comm(char *to, struct task_struct *tsk);
1774 1781
1775#ifdef CONFIG_SMP 1782#ifdef CONFIG_SMP
1776extern void wait_task_inactive(struct task_struct * p); 1783extern void wait_task_inactive(struct task_struct * p);
@@ -2080,6 +2087,10 @@ static inline void migration_init(void)
2080} 2087}
2081#endif 2088#endif
2082 2089
2090#ifndef TASK_SIZE_OF
2091#define TASK_SIZE_OF(tsk) TASK_SIZE
2092#endif
2093
2083#endif /* __KERNEL__ */ 2094#endif /* __KERNEL__ */
2084 2095
2085#endif 2096#endif
diff --git a/include/linux/security.h b/include/linux/security.h
index d24974262dc6..fe52cdeab0a6 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -40,11 +40,6 @@
40#define ROOTCONTEXT_MNT 0x04 40#define ROOTCONTEXT_MNT 0x04
41#define DEFCONTEXT_MNT 0x08 41#define DEFCONTEXT_MNT 0x08
42 42
43/*
44 * Bounding set
45 */
46extern kernel_cap_t cap_bset;
47
48extern unsigned securebits; 43extern unsigned securebits;
49 44
50struct ctl_table; 45struct ctl_table;
@@ -423,15 +418,12 @@ struct request_sock;
423 * identified by @name for @dentry. 418 * identified by @name for @dentry.
424 * Return 0 if permission is granted. 419 * Return 0 if permission is granted.
425 * @inode_getsecurity: 420 * @inode_getsecurity:
426 * Copy the extended attribute representation of the security label 421 * Retrieve a copy of the extended attribute representation of the
427 * associated with @name for @inode into @buffer. @buffer may be 422 * security label associated with @name for @inode via @buffer. Note that
428 * NULL to request the size of the buffer required. @size indicates 423 * @name is the remainder of the attribute name after the security prefix
429 * the size of @buffer in bytes. Note that @name is the remainder 424 * has been removed. @alloc is used to specify of the call should return a
430 * of the attribute name after the security. prefix has been removed. 425 * value via the buffer or just the value length Return size of buffer on
431 * @err is the return value from the preceding fs getxattr call, 426 * success.
432 * and can be used by the security module to determine whether it
433 * should try and canonicalize the attribute value.
434 * Return number of bytes used/required on success.
435 * @inode_setsecurity: 427 * @inode_setsecurity:
436 * Set the security label associated with @name for @inode from the 428 * Set the security label associated with @name for @inode from the
437 * extended attribute value @value. @size indicates the size of the 429 * extended attribute value @value. @size indicates the size of the
@@ -1304,7 +1296,7 @@ struct security_operations {
1304 int (*inode_removexattr) (struct dentry *dentry, char *name); 1296 int (*inode_removexattr) (struct dentry *dentry, char *name);
1305 int (*inode_need_killpriv) (struct dentry *dentry); 1297 int (*inode_need_killpriv) (struct dentry *dentry);
1306 int (*inode_killpriv) (struct dentry *dentry); 1298 int (*inode_killpriv) (struct dentry *dentry);
1307 int (*inode_getsecurity)(const struct inode *inode, const char *name, void *buffer, size_t size, int err); 1299 int (*inode_getsecurity)(const struct inode *inode, const char *name, void **buffer, bool alloc);
1308 int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags); 1300 int (*inode_setsecurity)(struct inode *inode, const char *name, const void *value, size_t size, int flags);
1309 int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size); 1301 int (*inode_listsecurity)(struct inode *inode, char *buffer, size_t buffer_size);
1310 1302
@@ -1565,7 +1557,7 @@ int security_inode_listxattr(struct dentry *dentry);
1565int security_inode_removexattr(struct dentry *dentry, char *name); 1557int security_inode_removexattr(struct dentry *dentry, char *name);
1566int security_inode_need_killpriv(struct dentry *dentry); 1558int security_inode_need_killpriv(struct dentry *dentry);
1567int security_inode_killpriv(struct dentry *dentry); 1559int security_inode_killpriv(struct dentry *dentry);
1568int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err); 1560int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc);
1569int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags); 1561int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags);
1570int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size); 1562int security_inode_listsecurity(struct inode *inode, char *buffer, size_t buffer_size);
1571int security_file_permission(struct file *file, int mask); 1563int security_file_permission(struct file *file, int mask);
@@ -1967,7 +1959,7 @@ static inline int security_inode_killpriv(struct dentry *dentry)
1967 return cap_inode_killpriv(dentry); 1959 return cap_inode_killpriv(dentry);
1968} 1960}
1969 1961
1970static inline int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err) 1962static inline int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc)
1971{ 1963{
1972 return -EOPNOTSUPP; 1964 return -EOPNOTSUPP;
1973} 1965}
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index afe0f6d9b9bc..00b65c0a82ca 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -23,6 +23,7 @@ struct plat_serial8250_port {
23 resource_size_t mapbase; /* resource base */ 23 resource_size_t mapbase; /* resource base */
24 unsigned int irq; /* interrupt number */ 24 unsigned int irq; /* interrupt number */
25 unsigned int uartclk; /* UART clock rate */ 25 unsigned int uartclk; /* UART clock rate */
26 void *private_data;
26 unsigned char regshift; /* register shift */ 27 unsigned char regshift; /* register shift */
27 unsigned char iotype; /* UPIO_* */ 28 unsigned char iotype; /* UPIO_* */
28 unsigned char hub6; 29 unsigned char hub6;
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 0ae338866240..7e095147656c 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -371,6 +371,8 @@ int unhandled_signal(struct task_struct *tsk, int sig);
371 (!siginmask(signr, SIG_KERNEL_IGNORE_MASK|SIG_KERNEL_STOP_MASK) && \ 371 (!siginmask(signr, SIG_KERNEL_IGNORE_MASK|SIG_KERNEL_STOP_MASK) && \
372 (t)->sighand->action[(signr)-1].sa.sa_handler == SIG_DFL) 372 (t)->sighand->action[(signr)-1].sa.sa_handler == SIG_DFL)
373 373
374void signals_init(void);
375
374#endif /* __KERNEL__ */ 376#endif /* __KERNEL__ */
375 377
376#endif /* _LINUX_SIGNAL_H */ 378#endif /* _LINUX_SIGNAL_H */
diff --git a/include/linux/sm501.h b/include/linux/sm501.h
index 9e3aaad6fe4d..932a9efee8a5 100644
--- a/include/linux/sm501.h
+++ b/include/linux/sm501.h
@@ -70,6 +70,8 @@ extern unsigned long sm501_gpio_get(struct device *dev,
70#define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1) 70#define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1)
71#define SM501FB_FLAG_USE_HWCURSOR (1<<2) 71#define SM501FB_FLAG_USE_HWCURSOR (1<<2)
72#define SM501FB_FLAG_USE_HWACCEL (1<<3) 72#define SM501FB_FLAG_USE_HWACCEL (1<<3)
73#define SM501FB_FLAG_PANEL_USE_FPEN (1<<4)
74#define SM501FB_FLAG_PANEL_USE_VBIASEN (1<<5)
73 75
74struct sm501_platdata_fbsub { 76struct sm501_platdata_fbsub {
75 struct fb_videomode *def_mode; 77 struct fb_videomode *def_mode;
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h
index 40c7b5d993b9..f41ffd7c2dd9 100644
--- a/include/linux/sonypi.h
+++ b/include/linux/sonypi.h
@@ -101,6 +101,8 @@
101#define SONYPI_EVENT_FNKEY_RELEASED 59 101#define SONYPI_EVENT_FNKEY_RELEASED 59
102#define SONYPI_EVENT_WIRELESS_ON 60 102#define SONYPI_EVENT_WIRELESS_ON 60
103#define SONYPI_EVENT_WIRELESS_OFF 61 103#define SONYPI_EVENT_WIRELESS_OFF 61
104#define SONYPI_EVENT_ZOOM_IN_PRESSED 62
105#define SONYPI_EVENT_ZOOM_OUT_PRESSED 63
104 106
105/* get/set brightness */ 107/* get/set brightness */
106#define SONYPI_IOCGBRT _IOR('v', 0, __u8) 108#define SONYPI_IOCGBRT _IOR('v', 0, __u8)
diff --git a/include/linux/spi/mcp23s08.h b/include/linux/spi/mcp23s08.h
new file mode 100644
index 000000000000..835ddf47d45c
--- /dev/null
+++ b/include/linux/spi/mcp23s08.h
@@ -0,0 +1,24 @@
1
2/* FIXME driver should be able to handle all four slaves that
3 * can be hooked up to each chipselect, as well as IRQs...
4 */
5
6struct mcp23s08_platform_data {
7 /* four slaves can share one SPI chipselect */
8 u8 slave;
9
10 /* number assigned to the first GPIO */
11 unsigned base;
12
13 /* pins with pullups */
14 u8 pullups;
15
16 void *context; /* param to setup/teardown */
17
18 int (*setup)(struct spi_device *spi,
19 int gpio, unsigned ngpio,
20 void *context);
21 int (*teardown)(struct spi_device *spi,
22 int gpio, unsigned ngpio,
23 void *context);
24};
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index e18f5c23b930..9d5da8b2ccf9 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -373,6 +373,15 @@ void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state)
373 if (sdev->bus->bustype == SSB_BUSTYPE_PCI) 373 if (sdev->bus->bustype == SSB_BUSTYPE_PCI)
374 pci_set_power_state(sdev->bus->host_pci, state); 374 pci_set_power_state(sdev->bus->host_pci, state);
375} 375}
376#else
377static inline void ssb_pcihost_unregister(struct pci_driver *driver)
378{
379}
380
381static inline
382void ssb_pcihost_set_power_state(struct ssb_device *sdev, pci_power_t state)
383{
384}
376#endif /* CONFIG_SSB_PCIHOST */ 385#endif /* CONFIG_SSB_PCIHOST */
377 386
378 387
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 646ce2d068d4..1d7d4c5797ee 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -130,7 +130,6 @@ struct pbe {
130}; 130};
131 131
132/* mm/page_alloc.c */ 132/* mm/page_alloc.c */
133extern void drain_local_pages(void);
134extern void mark_free_pages(struct zone *zone); 133extern void mark_free_pages(struct zone *zone);
135 134
136/** 135/**
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 4f3838adbb30..353153ea0bd5 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -158,9 +158,6 @@ struct swap_list_t {
158/* Swap 50% full? Release swapcache more aggressively.. */ 158/* Swap 50% full? Release swapcache more aggressively.. */
159#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) 159#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
160 160
161/* linux/mm/memory.c */
162extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *);
163
164/* linux/mm/page_alloc.c */ 161/* linux/mm/page_alloc.c */
165extern unsigned long totalram_pages; 162extern unsigned long totalram_pages;
166extern unsigned long totalreserve_pages; 163extern unsigned long totalreserve_pages;
@@ -223,16 +220,17 @@ extern struct address_space swapper_space;
223#define total_swapcache_pages swapper_space.nrpages 220#define total_swapcache_pages swapper_space.nrpages
224extern void show_swap_cache_info(void); 221extern void show_swap_cache_info(void);
225extern int add_to_swap(struct page *, gfp_t); 222extern int add_to_swap(struct page *, gfp_t);
223extern int add_to_swap_cache(struct page *, swp_entry_t, gfp_t);
226extern void __delete_from_swap_cache(struct page *); 224extern void __delete_from_swap_cache(struct page *);
227extern void delete_from_swap_cache(struct page *); 225extern void delete_from_swap_cache(struct page *);
228extern int move_to_swap_cache(struct page *, swp_entry_t);
229extern int move_from_swap_cache(struct page *, unsigned long,
230 struct address_space *);
231extern void free_page_and_swap_cache(struct page *); 226extern void free_page_and_swap_cache(struct page *);
232extern void free_pages_and_swap_cache(struct page **, int); 227extern void free_pages_and_swap_cache(struct page **, int);
233extern struct page * lookup_swap_cache(swp_entry_t); 228extern struct page *lookup_swap_cache(swp_entry_t);
234extern struct page * read_swap_cache_async(swp_entry_t, struct vm_area_struct *vma, 229extern struct page *read_swap_cache_async(swp_entry_t, gfp_t,
235 unsigned long addr); 230 struct vm_area_struct *vma, unsigned long addr);
231extern struct page *swapin_readahead(swp_entry_t, gfp_t,
232 struct vm_area_struct *vma, unsigned long addr);
233
236/* linux/mm/swapfile.c */ 234/* linux/mm/swapfile.c */
237extern long total_swap_pages; 235extern long total_swap_pages;
238extern unsigned int nr_swapfiles; 236extern unsigned int nr_swapfiles;
@@ -306,7 +304,7 @@ static inline void swap_free(swp_entry_t swp)
306{ 304{
307} 305}
308 306
309static inline struct page *read_swap_cache_async(swp_entry_t swp, 307static inline struct page *swapin_readahead(swp_entry_t swp, gfp_t gfp_mask,
310 struct vm_area_struct *vma, unsigned long addr) 308 struct vm_area_struct *vma, unsigned long addr)
311{ 309{
312 return NULL; 310 return NULL;
@@ -317,22 +315,12 @@ static inline struct page *lookup_swap_cache(swp_entry_t swp)
317 return NULL; 315 return NULL;
318} 316}
319 317
320static inline int valid_swaphandles(swp_entry_t entry, unsigned long *offset)
321{
322 return 0;
323}
324
325#define can_share_swap_page(p) (page_mapcount(p) == 1) 318#define can_share_swap_page(p) (page_mapcount(p) == 1)
326 319
327static inline int move_to_swap_cache(struct page *page, swp_entry_t entry) 320static inline int add_to_swap_cache(struct page *page, swp_entry_t entry,
328{ 321 gfp_t gfp_mask)
329 return 1;
330}
331
332static inline int move_from_swap_cache(struct page *page, unsigned long index,
333 struct address_space *mapping)
334{ 322{
335 return 1; 323 return -1;
336} 324}
337 325
338static inline void __delete_from_swap_cache(struct page *page) 326static inline void __delete_from_swap_cache(struct page *page)
diff --git a/include/linux/swapops.h b/include/linux/swapops.h
index ceb6cc5ceebb..7bf2d149d209 100644
--- a/include/linux/swapops.h
+++ b/include/linux/swapops.h
@@ -42,6 +42,12 @@ static inline pgoff_t swp_offset(swp_entry_t entry)
42 return entry.val & SWP_OFFSET_MASK(entry); 42 return entry.val & SWP_OFFSET_MASK(entry);
43} 43}
44 44
45/* check whether a pte points to a swap entry */
46static inline int is_swap_pte(pte_t pte)
47{
48 return !pte_none(pte) && !pte_present(pte) && !pte_file(pte);
49}
50
45/* 51/*
46 * Convert the arch-dependent pte representation of a swp_entry_t into an 52 * Convert the arch-dependent pte representation of a swp_entry_t into an
47 * arch-independent swp_entry_t. 53 * arch-independent swp_entry_t.
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 61def7c8fbb3..4c2577bd1c85 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -607,8 +607,11 @@ asmlinkage long sys_set_robust_list(struct robust_list_head __user *head,
607 size_t len); 607 size_t len);
608asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); 608asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache);
609asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemask); 609asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemask);
610asmlinkage long sys_timerfd(int ufd, int clockid, int flags, 610asmlinkage long sys_timerfd_create(int clockid, int flags);
611 const struct itimerspec __user *utmr); 611asmlinkage long sys_timerfd_settime(int ufd, int flags,
612 const struct itimerspec __user *utmr,
613 struct itimerspec __user *otmr);
614asmlinkage long sys_timerfd_gettime(int ufd, struct itimerspec __user *otmr);
612asmlinkage long sys_eventfd(unsigned int count); 615asmlinkage long sys_eventfd(unsigned int count);
613asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len); 616asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len);
614 617
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index bf4ae4e138f7..571f01d20a86 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -102,7 +102,6 @@ enum
102 KERN_NODENAME=7, 102 KERN_NODENAME=7,
103 KERN_DOMAINNAME=8, 103 KERN_DOMAINNAME=8,
104 104
105 KERN_CAP_BSET=14, /* int: capability bounding set */
106 KERN_PANIC=15, /* int: panic timeout */ 105 KERN_PANIC=15, /* int: panic timeout */
107 KERN_REALROOTDEV=16, /* real root device to mount after initrd */ 106 KERN_REALROOTDEV=16, /* real root device to mount after initrd */
108 107
@@ -965,8 +964,6 @@ extern int proc_dostring(struct ctl_table *, int, struct file *,
965 void __user *, size_t *, loff_t *); 964 void __user *, size_t *, loff_t *);
966extern int proc_dointvec(struct ctl_table *, int, struct file *, 965extern int proc_dointvec(struct ctl_table *, int, struct file *,
967 void __user *, size_t *, loff_t *); 966 void __user *, size_t *, loff_t *);
968extern int proc_dointvec_bset(struct ctl_table *, int, struct file *,
969 void __user *, size_t *, loff_t *);
970extern int proc_dointvec_minmax(struct ctl_table *, int, struct file *, 967extern int proc_dointvec_minmax(struct ctl_table *, int, struct file *,
971 void __user *, size_t *, loff_t *); 968 void __user *, size_t *, loff_t *);
972extern int proc_dointvec_jiffies(struct ctl_table *, int, struct file *, 969extern int proc_dointvec_jiffies(struct ctl_table *, int, struct file *,
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h
index e21937cf91d0..c50d2ba5caf0 100644
--- a/include/linux/tc_ematch/tc_em_meta.h
+++ b/include/linux/tc_ematch/tc_em_meta.h
@@ -81,6 +81,7 @@ enum
81 TCF_META_ID_SK_SNDTIMEO, 81 TCF_META_ID_SK_SNDTIMEO,
82 TCF_META_ID_SK_SENDMSG_OFF, 82 TCF_META_ID_SK_SENDMSG_OFF,
83 TCF_META_ID_SK_WRITE_PENDING, 83 TCF_META_ID_SK_WRITE_PENDING,
84 TCF_META_ID_VLAN_TAG,
84 __TCF_META_ID_MAX 85 __TCF_META_ID_MAX
85}; 86};
86#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) 87#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
new file mode 100644
index 000000000000..bba7712cadc7
--- /dev/null
+++ b/include/linux/thermal.h
@@ -0,0 +1,94 @@
1/*
2 * thermal.h ($Revision: 0 $)
3 *
4 * Copyright (C) 2008 Intel Corp
5 * Copyright (C) 2008 Zhang Rui <rui.zhang@intel.com>
6 * Copyright (C) 2008 Sujith Thomas <sujith.thomas@intel.com>
7 *
8 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 *
22 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 */
24
25#ifndef __THERMAL_H__
26#define __THERMAL_H__
27
28#include <linux/idr.h>
29#include <linux/device.h>
30
31struct thermal_zone_device;
32struct thermal_cooling_device;
33
34struct thermal_zone_device_ops {
35 int (*bind) (struct thermal_zone_device *,
36 struct thermal_cooling_device *);
37 int (*unbind) (struct thermal_zone_device *,
38 struct thermal_cooling_device *);
39 int (*get_temp) (struct thermal_zone_device *, char *);
40 int (*get_mode) (struct thermal_zone_device *, char *);
41 int (*set_mode) (struct thermal_zone_device *, const char *);
42 int (*get_trip_type) (struct thermal_zone_device *, int, char *);
43 int (*get_trip_temp) (struct thermal_zone_device *, int, char *);
44};
45
46struct thermal_cooling_device_ops {
47 int (*get_max_state) (struct thermal_cooling_device *, char *);
48 int (*get_cur_state) (struct thermal_cooling_device *, char *);
49 int (*set_cur_state) (struct thermal_cooling_device *, unsigned int);
50};
51
52#define THERMAL_TRIPS_NONE -1
53#define THERMAL_MAX_TRIPS 10
54#define THERMAL_NAME_LENGTH 20
55struct thermal_cooling_device {
56 int id;
57 char type[THERMAL_NAME_LENGTH];
58 struct device device;
59 void *devdata;
60 struct thermal_cooling_device_ops *ops;
61 struct list_head node;
62};
63
64#define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \
65 ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
66#define CELSIUS_TO_KELVIN(t) ((t)*10+2732)
67
68struct thermal_zone_device {
69 int id;
70 char type[THERMAL_NAME_LENGTH];
71 struct device device;
72 void *devdata;
73 int trips;
74 struct thermal_zone_device_ops *ops;
75 struct list_head cooling_devices;
76 struct idr idr;
77 struct mutex lock; /* protect cooling devices list */
78 struct list_head node;
79};
80
81struct thermal_zone_device *thermal_zone_device_register(char *, int, void *,
82 struct thermal_zone_device_ops *);
83void thermal_zone_device_unregister(struct thermal_zone_device *);
84
85int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
86 struct thermal_cooling_device *);
87int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int,
88 struct thermal_cooling_device *);
89
90struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
91 struct thermal_cooling_device_ops *);
92void thermal_cooling_device_unregister(struct thermal_cooling_device *);
93
94#endif /* __THERMAL_H__ */
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 24c6a2b59511..8ea3e71ba7fa 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -244,6 +244,8 @@ extern int do_adjtimex(struct timex *);
244/* Don't use! Compatibility define for existing users. */ 244/* Don't use! Compatibility define for existing users. */
245#define tickadj (500/HZ ? : 1) 245#define tickadj (500/HZ ? : 1)
246 246
247int read_current_timer(unsigned long *timer_val);
248
247#endif /* KERNEL */ 249#endif /* KERNEL */
248 250
249#endif /* LINUX_TIMEX_H */ 251#endif /* LINUX_TIMEX_H */
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 402de892b3ed..5824a9777ad7 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -74,7 +74,6 @@ struct tty_buffer {
74 74
75struct tty_bufhead { 75struct tty_bufhead {
76 struct delayed_work work; 76 struct delayed_work work;
77 struct semaphore pty_sem;
78 spinlock_t lock; 77 spinlock_t lock;
79 struct tty_buffer *head; /* Queue head */ 78 struct tty_buffer *head; /* Queue head */
80 struct tty_buffer *tail; /* Active buffer */ 79 struct tty_buffer *tail; /* Active buffer */
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 89338b468d0d..ce8e7da05807 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -45,11 +45,11 @@ extern void *vmalloc_32_user(unsigned long size);
45extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot); 45extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot);
46extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask, 46extern void *__vmalloc_area(struct vm_struct *area, gfp_t gfp_mask,
47 pgprot_t prot); 47 pgprot_t prot);
48extern void vfree(void *addr); 48extern void vfree(const void *addr);
49 49
50extern void *vmap(struct page **pages, unsigned int count, 50extern void *vmap(struct page **pages, unsigned int count,
51 unsigned long flags, pgprot_t prot); 51 unsigned long flags, pgprot_t prot);
52extern void vunmap(void *addr); 52extern void vunmap(const void *addr);
53 53
54extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, 54extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
55 unsigned long pgoff); 55 unsigned long pgoff);
@@ -71,7 +71,7 @@ extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
71extern struct vm_struct *get_vm_area_node(unsigned long size, 71extern struct vm_struct *get_vm_area_node(unsigned long size,
72 unsigned long flags, int node, 72 unsigned long flags, int node,
73 gfp_t gfp_mask); 73 gfp_t gfp_mask);
74extern struct vm_struct *remove_vm_area(void *addr); 74extern struct vm_struct *remove_vm_area(const void *addr);
75 75
76extern int map_vm_area(struct vm_struct *area, pgprot_t prot, 76extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
77 struct page ***pages); 77 struct page ***pages);
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index feb5e99a1079..9448ffbdcbf6 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -77,6 +77,7 @@ void change_console(struct vc_data *new_vc);
77void reset_vc(struct vc_data *vc); 77void reset_vc(struct vc_data *vc);
78extern int unbind_con_driver(const struct consw *csw, int first, int last, 78extern int unbind_con_driver(const struct consw *csw, int first, int last,
79 int deflt); 79 int deflt);
80int vty_init(void);
80 81
81/* 82/*
82 * vc_screen.c shares this temporary buffer with the console write code so that 83 * vc_screen.c shares this temporary buffer with the console write code so that
diff --git a/include/linux/w1-gpio.h b/include/linux/w1-gpio.h
new file mode 100644
index 000000000000..9797fec7748a
--- /dev/null
+++ b/include/linux/w1-gpio.h
@@ -0,0 +1,23 @@
1/*
2 * w1-gpio interface to platform code
3 *
4 * Copyright (C) 2007 Ville Syrjala <syrjala@sci.fi>
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
8 * as published by the Free Software Foundation.
9 */
10#ifndef _LINUX_W1_GPIO_H
11#define _LINUX_W1_GPIO_H
12
13/**
14 * struct w1_gpio_platform_data - Platform-dependent data for w1-gpio
15 * @pin: GPIO pin to use
16 * @is_open_drain: GPIO pin is configured as open drain
17 */
18struct w1_gpio_platform_data {
19 unsigned int pin;
20 unsigned int is_open_drain:1;
21};
22
23#endif /* _LINUX_W1_GPIO_H */
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 1f4fb0a81ecd..33a2aa9e02f2 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -162,6 +162,22 @@ wait_queue_head_t *FASTCALL(bit_waitqueue(void *, int));
162#define wake_up_interruptible_all(x) __wake_up(x, TASK_INTERRUPTIBLE, 0, NULL) 162#define wake_up_interruptible_all(x) __wake_up(x, TASK_INTERRUPTIBLE, 0, NULL)
163#define wake_up_interruptible_sync(x) __wake_up_sync((x), TASK_INTERRUPTIBLE, 1) 163#define wake_up_interruptible_sync(x) __wake_up_sync((x), TASK_INTERRUPTIBLE, 1)
164 164
165#ifdef CONFIG_DEBUG_LOCK_ALLOC
166/*
167 * macro to avoid include hell
168 */
169#define wake_up_nested(x, s) \
170do { \
171 unsigned long flags; \
172 \
173 spin_lock_irqsave_nested(&(x)->lock, flags, (s)); \
174 wake_up_locked(x); \
175 spin_unlock_irqrestore(&(x)->lock, flags); \
176} while (0)
177#else
178#define wake_up_nested(x, s) wake_up(x)
179#endif
180
165#define __wait_event(wq, condition) \ 181#define __wait_event(wq, condition) \
166do { \ 182do { \
167 DEFINE_WAIT(__wait); \ 183 DEFINE_WAIT(__wait); \
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index c6148bbf1250..b7b3362f7717 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -62,6 +62,7 @@ struct writeback_control {
62 unsigned for_reclaim:1; /* Invoked from the page allocator */ 62 unsigned for_reclaim:1; /* Invoked from the page allocator */
63 unsigned for_writepages:1; /* This is a writepages() call */ 63 unsigned for_writepages:1; /* This is a writepages() call */
64 unsigned range_cyclic:1; /* range_start is cyclic */ 64 unsigned range_cyclic:1; /* range_start is cyclic */
65 unsigned more_io:1; /* more io to be dispatched */
65}; 66};
66 67
67/* 68/*
@@ -100,6 +101,7 @@ extern int dirty_background_ratio;
100extern int vm_dirty_ratio; 101extern int vm_dirty_ratio;
101extern int dirty_writeback_interval; 102extern int dirty_writeback_interval;
102extern int dirty_expire_interval; 103extern int dirty_expire_interval;
104extern int vm_highmem_is_dirtyable;
103extern int block_dump; 105extern int block_dump;
104extern int laptop_mode; 106extern int laptop_mode;
105 107
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index def131a5ac70..df6b95d2218e 100644
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -46,6 +46,7 @@ struct xattr_handler {
46 size_t size, int flags); 46 size_t size, int flags);
47}; 47};
48 48
49ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t);
49ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t); 50ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t);
50ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); 51ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size);
51int vfs_setxattr(struct dentry *, char *, void *, size_t, int); 52int vfs_setxattr(struct dentry *, char *, void *, size_t, int);
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index 625346c47ee2..585eb4496990 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -124,6 +124,7 @@ enum {
124 P9_DMSOCKET = 0x00100000, 124 P9_DMSOCKET = 0x00100000,
125 P9_DMSETUID = 0x00080000, 125 P9_DMSETUID = 0x00080000,
126 P9_DMSETGID = 0x00040000, 126 P9_DMSETGID = 0x00040000,
127 P9_DMSETVTX = 0x00010000,
127}; 128};
128 129
129/* qid.types */ 130/* qid.types */
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index 9b9221a21392..e52f93d9ac5f 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -3,6 +3,7 @@
3 * 3 *
4 * 9P Client Definitions 4 * 9P Client Definitions
5 * 5 *
6 * Copyright (C) 2008 by Eric Van Hensbergen <ericvh@gmail.com>
6 * Copyright (C) 2007 by Latchesar Ionkov <lucho@ionkov.net> 7 * Copyright (C) 2007 by Latchesar Ionkov <lucho@ionkov.net>
7 * 8 *
8 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -29,6 +30,7 @@ struct p9_client {
29 spinlock_t lock; /* protect client structure */ 30 spinlock_t lock; /* protect client structure */
30 int msize; 31 int msize;
31 unsigned char dotu; 32 unsigned char dotu;
33 struct p9_trans_module *trans_mod;
32 struct p9_trans *trans; 34 struct p9_trans *trans;
33 struct p9_conn *conn; 35 struct p9_conn *conn;
34 36
@@ -52,8 +54,7 @@ struct p9_fid {
52 struct list_head dlist; /* list of all fids attached to a dentry */ 54 struct list_head dlist; /* list of all fids attached to a dentry */
53}; 55};
54 56
55struct p9_client *p9_client_create(struct p9_trans *trans, int msize, 57struct p9_client *p9_client_create(const char *dev_name, char *options);
56 int dotu);
57void p9_client_destroy(struct p9_client *clnt); 58void p9_client_destroy(struct p9_client *clnt);
58void p9_client_disconnect(struct p9_client *clnt); 59void p9_client_disconnect(struct p9_client *clnt);
59struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, 60struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
diff --git a/include/net/9p/conn.h b/include/net/9p/conn.h
deleted file mode 100644
index 756d8784f953..000000000000
--- a/include/net/9p/conn.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * include/net/9p/conn.h
3 *
4 * Connection Definitions
5 *
6 * Copyright (C) 2005 by Latchesar Ionkov <lucho@ionkov.net>
7 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2
11 * as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to:
20 * Free Software Foundation
21 * 51 Franklin Street, Fifth Floor
22 * Boston, MA 02111-1301 USA
23 *
24 */
25
26#ifndef NET_9P_CONN_H
27#define NET_9P_CONN_H
28
29#undef P9_NONBLOCK
30
31struct p9_conn;
32struct p9_req;
33
34/**
35 * p9_mux_req_callback - callback function that is called when the
36 * response of a request is received. The callback is called from
37 * a workqueue and shouldn't block.
38 *
39 * @req - request
40 * @a - the pointer that was specified when the request was send to be
41 * passed to the callback
42 */
43typedef void (*p9_conn_req_callback)(struct p9_req *req, void *a);
44
45struct p9_conn *p9_conn_create(struct p9_trans *trans, int msize,
46 unsigned char *dotu);
47void p9_conn_destroy(struct p9_conn *);
48int p9_conn_rpc(struct p9_conn *m, struct p9_fcall *tc, struct p9_fcall **rc);
49
50#ifdef P9_NONBLOCK
51int p9_conn_rpcnb(struct p9_conn *m, struct p9_fcall *tc,
52 p9_conn_req_callback cb, void *a);
53#endif /* P9_NONBLOCK */
54
55void p9_conn_cancel(struct p9_conn *m, int err);
56
57#endif /* NET_9P_CONN_H */
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index 9dd4a05619a8..d2209ae9d18b 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -4,7 +4,7 @@
4 * Transport Definition 4 * Transport Definition
5 * 5 *
6 * Copyright (C) 2005 by Latchesar Ionkov <lucho@ionkov.net> 6 * Copyright (C) 2005 by Latchesar Ionkov <lucho@ionkov.net>
7 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com> 7 * Copyright (C) 2004-2008 by Eric Van Hensbergen <ericvh@gmail.com>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 10 * it under the terms of the GNU General Public License version 2
@@ -34,11 +34,12 @@ enum p9_trans_status {
34 34
35struct p9_trans { 35struct p9_trans {
36 enum p9_trans_status status; 36 enum p9_trans_status status;
37 int msize;
38 unsigned char extended;
37 void *priv; 39 void *priv;
38 int (*write) (struct p9_trans *, void *, int);
39 int (*read) (struct p9_trans *, void *, int);
40 void (*close) (struct p9_trans *); 40 void (*close) (struct p9_trans *);
41 unsigned int (*poll)(struct p9_trans *, struct poll_table_struct *); 41 int (*rpc) (struct p9_trans *t, struct p9_fcall *tc,
42 struct p9_fcall **rc);
42}; 43};
43 44
44struct p9_trans_module { 45struct p9_trans_module {
@@ -46,7 +47,7 @@ struct p9_trans_module {
46 char *name; /* name of transport */ 47 char *name; /* name of transport */
47 int maxsize; /* max message size of transport */ 48 int maxsize; /* max message size of transport */
48 int def; /* this transport should be default */ 49 int def; /* this transport should be default */
49 struct p9_trans * (*create)(const char *devname, char *options); 50 struct p9_trans * (*create)(const char *, char *, int, unsigned char);
50}; 51};
51 52
52void v9fs_register_trans(struct p9_trans_module *m); 53void v9fs_register_trans(struct p9_trans_module *m);
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 48ac620cb846..97dc35ad09be 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -389,7 +389,7 @@ static inline struct sock *inet_lookup(struct net *net,
389} 389}
390 390
391extern int __inet_hash_connect(struct inet_timewait_death_row *death_row, 391extern int __inet_hash_connect(struct inet_timewait_death_row *death_row,
392 struct sock *sk, 392 struct sock *sk, u32 port_offset,
393 int (*check_established)(struct inet_timewait_death_row *, 393 int (*check_established)(struct inet_timewait_death_row *,
394 struct sock *, __u16, struct inet_timewait_sock **), 394 struct sock *, __u16, struct inet_timewait_sock **),
395 void (*hash)(struct sock *sk)); 395 void (*hash)(struct sock *sk));
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 90d1175f63de..8b12667f7a2b 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -266,6 +266,14 @@ static inline void fib_res_put(struct fib_result *res)
266#ifdef CONFIG_PROC_FS 266#ifdef CONFIG_PROC_FS
267extern int __net_init fib_proc_init(struct net *net); 267extern int __net_init fib_proc_init(struct net *net);
268extern void __net_exit fib_proc_exit(struct net *net); 268extern void __net_exit fib_proc_exit(struct net *net);
269#else
270static inline int fib_proc_init(struct net *net)
271{
272 return 0;
273}
274static inline void fib_proc_exit(struct net *net)
275{
276}
269#endif 277#endif
270 278
271#endif /* _NET_FIB_H */ 279#endif /* _NET_FIB_H */
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index fa80ea48639d..c0c019f72ba9 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -110,7 +110,6 @@ struct frag_hdr {
110 110
111/* sysctls */ 111/* sysctls */
112extern int sysctl_mld_max_msf; 112extern int sysctl_mld_max_msf;
113
114extern struct ctl_path net_ipv6_ctl_path[]; 113extern struct ctl_path net_ipv6_ctl_path[];
115 114
116#define _DEVINC(statname, modifier, idev, field) \ 115#define _DEVINC(statname, modifier, idev, field) \
@@ -586,9 +585,6 @@ extern int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
586 int __user *optlen); 585 int __user *optlen);
587 586
588#ifdef CONFIG_PROC_FS 587#ifdef CONFIG_PROC_FS
589extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net);
590extern struct ctl_table *ipv6_route_sysctl_init(struct net *net);
591
592extern int ac6_proc_init(void); 588extern int ac6_proc_init(void);
593extern void ac6_proc_exit(void); 589extern void ac6_proc_exit(void);
594extern int raw6_proc_init(void); 590extern int raw6_proc_init(void);
@@ -621,6 +617,8 @@ static inline int snmp6_unregister_dev(struct inet6_dev *idev)
621extern ctl_table ipv6_route_table_template[]; 617extern ctl_table ipv6_route_table_template[];
622extern ctl_table ipv6_icmp_table_template[]; 618extern ctl_table ipv6_icmp_table_template[];
623 619
620extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net);
621extern struct ctl_table *ipv6_route_sysctl_init(struct net *net);
624extern int ipv6_sysctl_register(void); 622extern int ipv6_sysctl_register(void);
625extern void ipv6_sysctl_unregister(void); 623extern void ipv6_sysctl_unregister(void);
626#endif 624#endif
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index b3213c7c5309..0ca67d73c7ad 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -36,6 +36,8 @@
36#include <net/netlink.h> 36#include <net/netlink.h>
37#include <asm/atomic.h> 37#include <asm/atomic.h>
38 38
39struct cipso_v4_doi;
40
39/* 41/*
40 * NetLabel - A management interface for maintaining network packet label 42 * NetLabel - A management interface for maintaining network packet label
41 * mapping tables for explicit packet labling protocols. 43 * mapping tables for explicit packet labling protocols.
@@ -103,12 +105,6 @@ struct netlbl_audit {
103 uid_t loginuid; 105 uid_t loginuid;
104}; 106};
105 107
106/* Domain mapping definition struct */
107struct netlbl_dom_map;
108
109/* Domain mapping operations */
110int netlbl_domhsh_remove(const char *domain, struct netlbl_audit *audit_info);
111
112/* 108/*
113 * LSM security attributes 109 * LSM security attributes
114 */ 110 */
@@ -344,6 +340,19 @@ static inline void netlbl_secattr_free(struct netlbl_lsm_secattr *secattr)
344 340
345#ifdef CONFIG_NETLABEL 341#ifdef CONFIG_NETLABEL
346/* 342/*
343 * LSM configuration operations
344 */
345int netlbl_cfg_map_del(const char *domain, struct netlbl_audit *audit_info);
346int netlbl_cfg_unlbl_add_map(const char *domain,
347 struct netlbl_audit *audit_info);
348int netlbl_cfg_cipsov4_add(struct cipso_v4_doi *doi_def,
349 struct netlbl_audit *audit_info);
350int netlbl_cfg_cipsov4_add_map(struct cipso_v4_doi *doi_def,
351 const char *domain,
352 struct netlbl_audit *audit_info);
353int netlbl_cfg_cipsov4_del(u32 doi, struct netlbl_audit *audit_info);
354
355/*
347 * LSM security attribute operations 356 * LSM security attribute operations
348 */ 357 */
349int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap, 358int netlbl_secattr_catmap_walk(struct netlbl_lsm_secattr_catmap *catmap,
@@ -378,6 +387,32 @@ void netlbl_cache_invalidate(void);
378int netlbl_cache_add(const struct sk_buff *skb, 387int netlbl_cache_add(const struct sk_buff *skb,
379 const struct netlbl_lsm_secattr *secattr); 388 const struct netlbl_lsm_secattr *secattr);
380#else 389#else
390static inline int netlbl_cfg_map_del(const char *domain,
391 struct netlbl_audit *audit_info)
392{
393 return -ENOSYS;
394}
395static inline int netlbl_cfg_unlbl_add_map(const char *domain,
396 struct netlbl_audit *audit_info)
397{
398 return -ENOSYS;
399}
400static inline int netlbl_cfg_cipsov4_add(struct cipso_v4_doi *doi_def,
401 struct netlbl_audit *audit_info)
402{
403 return -ENOSYS;
404}
405static inline int netlbl_cfg_cipsov4_add_map(struct cipso_v4_doi *doi_def,
406 const char *domain,
407 struct netlbl_audit *audit_info)
408{
409 return -ENOSYS;
410}
411static inline int netlbl_cfg_cipsov4_del(u32 doi,
412 struct netlbl_audit *audit_info)
413{
414 return -ENOSYS;
415}
381static inline int netlbl_secattr_catmap_walk( 416static inline int netlbl_secattr_catmap_walk(
382 struct netlbl_lsm_secattr_catmap *catmap, 417 struct netlbl_lsm_secattr_catmap *catmap,
383 u32 offset) 418 u32 offset)
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index d5838c30d20f..87a260e3699e 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -147,11 +147,11 @@ typedef struct config_req_t {
147 147
148/* For RequestIO and ReleaseIO */ 148/* For RequestIO and ReleaseIO */
149typedef struct io_req_t { 149typedef struct io_req_t {
150 ioaddr_t BasePort1; 150 u_int BasePort1;
151 ioaddr_t NumPorts1; 151 u_int NumPorts1;
152 u_int Attributes1; 152 u_int Attributes1;
153 ioaddr_t BasePort2; 153 u_int BasePort2;
154 ioaddr_t NumPorts2; 154 u_int NumPorts2;
155 u_int Attributes2; 155 u_int Attributes2;
156 u_int IOAddrLines; 156 u_int IOAddrLines;
157} io_req_t; 157} io_req_t;
diff --git a/include/pcmcia/cs_types.h b/include/pcmcia/cs_types.h
index 5f388035687d..9a6bcc4952f0 100644
--- a/include/pcmcia/cs_types.h
+++ b/include/pcmcia/cs_types.h
@@ -27,7 +27,6 @@ typedef u_int ioaddr_t;
27#else 27#else
28typedef u_short ioaddr_t; 28typedef u_short ioaddr_t;
29#endif 29#endif
30typedef unsigned long kio_addr_t;
31 30
32typedef u_short socket_t; 31typedef u_short socket_t;
33typedef u_int event_t; 32typedef u_int event_t;
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 6e84258b94de..f95dca077c1c 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -92,7 +92,7 @@ typedef struct pccard_io_map {
92 u_char map; 92 u_char map;
93 u_char flags; 93 u_char flags;
94 u_short speed; 94 u_short speed;
95 kio_addr_t start, stop; 95 u_int start, stop;
96} pccard_io_map; 96} pccard_io_map;
97 97
98typedef struct pccard_mem_map { 98typedef struct pccard_mem_map {
@@ -155,7 +155,7 @@ extern struct pccard_resource_ops pccard_iodyn_ops;
155struct pcmcia_socket; 155struct pcmcia_socket;
156 156
157typedef struct io_window_t { 157typedef struct io_window_t {
158 kio_addr_t InUse, Config; 158 u_int InUse, Config;
159 struct resource *res; 159 struct resource *res;
160} io_window_t; 160} io_window_t;
161 161
@@ -208,7 +208,7 @@ struct pcmcia_socket {
208 u_int features; 208 u_int features;
209 u_int irq_mask; 209 u_int irq_mask;
210 u_int map_size; 210 u_int map_size;
211 kio_addr_t io_offset; 211 u_int io_offset;
212 u_char pci_irq; 212 u_char pci_irq;
213 struct pci_dev * cb_dev; 213 struct pci_dev * cb_dev;
214 214
diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h
index 4eea63761a3f..336c20db87f8 100644
--- a/include/video/atmel_lcdc.h
+++ b/include/video/atmel_lcdc.h
@@ -22,7 +22,7 @@
22#ifndef __ATMEL_LCDC_H__ 22#ifndef __ATMEL_LCDC_H__
23#define __ATMEL_LCDC_H__ 23#define __ATMEL_LCDC_H__
24 24
25 /* LCD Controller info data structure */ 25 /* LCD Controller info data structure, stored in device platform_data */
26struct atmel_lcdfb_info { 26struct atmel_lcdfb_info {
27 spinlock_t lock; 27 spinlock_t lock;
28 struct fb_info *info; 28 struct fb_info *info;
@@ -33,7 +33,14 @@ struct atmel_lcdfb_info {
33 struct platform_device *pdev; 33 struct platform_device *pdev;
34 struct clk *bus_clk; 34 struct clk *bus_clk;
35 struct clk *lcdc_clk; 35 struct clk *lcdc_clk;
36 unsigned int default_bpp; 36
37#ifdef CONFIG_BACKLIGHT_ATMEL_LCDC
38 struct backlight_device *backlight;
39 u8 bl_power;
40#endif
41 bool lcdcon_is_backlight;
42
43 u8 default_bpp;
37 unsigned int default_lcdcon2; 44 unsigned int default_lcdcon2;
38 unsigned int default_dmacon; 45 unsigned int default_dmacon;
39 void (*atmel_lcdfb_power_control)(int on); 46 void (*atmel_lcdfb_power_control)(int on);
@@ -115,20 +122,20 @@ struct atmel_lcdfb_info {
115#define ATMEL_LCDC_MEMOR_LITTLE (1 << 31) 122#define ATMEL_LCDC_MEMOR_LITTLE (1 << 31)
116 123
117#define ATMEL_LCDC_TIM1 0x0808 124#define ATMEL_LCDC_TIM1 0x0808
118#define ATMEL_LCDC_VFP (0xff << 0) 125#define ATMEL_LCDC_VFP (0xffU << 0)
119#define ATMEL_LCDC_VBP_OFFSET 8 126#define ATMEL_LCDC_VBP_OFFSET 8
120#define ATMEL_LCDC_VBP (0xff << ATMEL_LCDC_VBP_OFFSET) 127#define ATMEL_LCDC_VBP (0xffU << ATMEL_LCDC_VBP_OFFSET)
121#define ATMEL_LCDC_VPW_OFFSET 16 128#define ATMEL_LCDC_VPW_OFFSET 16
122#define ATMEL_LCDC_VPW (0x3f << ATMEL_LCDC_VPW_OFFSET) 129#define ATMEL_LCDC_VPW (0x3fU << ATMEL_LCDC_VPW_OFFSET)
123#define ATMEL_LCDC_VHDLY_OFFSET 24 130#define ATMEL_LCDC_VHDLY_OFFSET 24
124#define ATMEL_LCDC_VHDLY (0xf << ATMEL_LCDC_VHDLY_OFFSET) 131#define ATMEL_LCDC_VHDLY (0xfU << ATMEL_LCDC_VHDLY_OFFSET)
125 132
126#define ATMEL_LCDC_TIM2 0x080c 133#define ATMEL_LCDC_TIM2 0x080c
127#define ATMEL_LCDC_HBP (0xff << 0) 134#define ATMEL_LCDC_HBP (0xffU << 0)
128#define ATMEL_LCDC_HPW_OFFSET 8 135#define ATMEL_LCDC_HPW_OFFSET 8
129#define ATMEL_LCDC_HPW (0x3f << ATMEL_LCDC_HPW_OFFSET) 136#define ATMEL_LCDC_HPW (0x3fU << ATMEL_LCDC_HPW_OFFSET)
130#define ATMEL_LCDC_HFP_OFFSET 21 137#define ATMEL_LCDC_HFP_OFFSET 21
131#define ATMEL_LCDC_HFP (0x7ff << ATMEL_LCDC_HFP_OFFSET) 138#define ATMEL_LCDC_HFP (0x7ffU << ATMEL_LCDC_HFP_OFFSET)
132 139
133#define ATMEL_LCDC_LCDFRMCFG 0x0810 140#define ATMEL_LCDC_LCDFRMCFG 0x0810
134#define ATMEL_LCDC_LINEVAL (0x7ff << 0) 141#define ATMEL_LCDC_LINEVAL (0x7ff << 0)