aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-07-04 09:14:42 -0400
committerAnton Altaparmakov <aia21@cantab.net>2005-07-04 09:14:42 -0400
commit07929dcb963786512c760dd3ecd148d89295e7e5 (patch)
treef5db01392ebb968b4c8acb5a6b3b03a833bfcb02
parentc2d9b8387bce8b4a0fd402fab7dc1319d11a418d (diff)
parent19f7241a3b087bbf4dd107c979608fdb56c83a09 (diff)
Automatic merge with /usr/src/ntfs-2.6.git.
-rw-r--r--Documentation/Changes2
-rw-r--r--Documentation/pcmcia/devicetable.txt5
-rw-r--r--arch/alpha/kernel/irq_alpha.c2
-rw-r--r--arch/alpha/kernel/traps.c2
-rw-r--r--arch/arm/Makefile2
-rw-r--r--arch/arm/configs/omnimeter_defconfig803
-rw-r--r--arch/arm/kernel/head.S20
-rw-r--r--arch/arm/kernel/traps.c12
-rw-r--r--arch/arm/mach-aaec2000/aaed2000.c10
-rw-r--r--arch/arm/mach-clps711x/autcpu12.c12
-rw-r--r--arch/arm/mach-clps711x/cdb89712.c12
-rw-r--r--arch/arm/mach-clps711x/ceiva.c12
-rw-r--r--arch/arm/mach-clps711x/clep7312.c14
-rw-r--r--arch/arm/mach-clps711x/edb7211-arch.c14
-rw-r--r--arch/arm/mach-clps711x/fortunet.c14
-rw-r--r--arch/arm/mach-clps711x/p720t.c14
-rw-r--r--arch/arm/mach-clps7500/core.c14
-rw-r--r--arch/arm/mach-ebsa110/core.c18
-rw-r--r--arch/arm/mach-epxa10db/arch.c10
-rw-r--r--arch/arm/mach-footbridge/cats-hw.c16
-rw-r--r--arch/arm/mach-footbridge/co285.c12
-rw-r--r--arch/arm/mach-footbridge/ebsa285.c15
-rw-r--r--arch/arm/mach-footbridge/netwinder-hw.c21
-rw-r--r--arch/arm/mach-footbridge/personal.c12
-rw-r--r--arch/arm/mach-h720x/h7201-eval.c14
-rw-r--r--arch/arm/mach-h720x/h7202-eval.c16
-rw-r--r--arch/arm/mach-imx/mx1ads.c14
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c14
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c14
-rw-r--r--arch/arm/mach-iop3xx/iop321-setup.c28
-rw-r--r--arch/arm/mach-iop3xx/iop331-setup.c30
-rw-r--r--arch/arm/mach-ixp2000/enp2611.c14
-rw-r--r--arch/arm/mach-ixp2000/ixdp2400.c14
-rw-r--r--arch/arm/mach-ixp2000/ixdp2800.c14
-rw-r--r--arch/arm/mach-ixp2000/ixdp2x01.c28
-rw-r--r--arch/arm/mach-ixp4xx/coyote-setup.c30
-rw-r--r--arch/arm/mach-ixp4xx/gtwx5715-setup.c17
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c60
-rw-r--r--arch/arm/mach-l7200/core.c10
-rw-r--r--arch/arm/mach-lh7a40x/arch-kev7a400.c12
-rw-r--r--arch/arm/mach-lh7a40x/arch-lpd7a40x.c28
-rw-r--r--arch/arm/mach-omap/board-generic.c14
-rw-r--r--arch/arm/mach-omap/board-h2.c14
-rw-r--r--arch/arm/mach-omap/board-h3.c14
-rw-r--r--arch/arm/mach-omap/board-innovator.c14
-rw-r--r--arch/arm/mach-omap/board-netstar.c16
-rw-r--r--arch/arm/mach-omap/board-osk.c14
-rw-r--r--arch/arm/mach-omap/board-perseus2.c14
-rw-r--r--arch/arm/mach-omap/board-voiceblue.c16
-rw-r--r--arch/arm/mach-omap/usb.c1
-rw-r--r--arch/arm/mach-pxa/Makefile4
-rw-r--r--arch/arm/mach-pxa/corgi.c42
-rw-r--r--arch/arm/mach-pxa/idp.c12
-rw-r--r--arch/arm/mach-pxa/lubbock.c12
-rw-r--r--arch/arm/mach-pxa/mainstone.c12
-rw-r--r--arch/arm/mach-pxa/poodle.c14
-rw-r--r--arch/arm/mach-pxa/pxa27x.c9
-rw-r--r--arch/arm/mach-pxa/standby.S32
-rw-r--r--arch/arm/mach-rpc/riscpc.c16
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c9
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c12
-rw-r--r--arch/arm/mach-s3c2410/mach-n30.c9
-rw-r--r--arch/arm/mach-s3c2410/mach-nexcoder.c8
-rw-r--r--arch/arm/mach-s3c2410/mach-otom.c8
-rw-r--r--arch/arm/mach-s3c2410/mach-rx3715.c14
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2410.c12
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2440.c8
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c8
-rw-r--r--arch/arm/mach-sa1100/assabet.c12
-rw-r--r--arch/arm/mach-sa1100/badge4.c10
-rw-r--r--arch/arm/mach-sa1100/cerf.c10
-rw-r--r--arch/arm/mach-sa1100/collie.c8
-rw-r--r--arch/arm/mach-sa1100/cpu-sa1110.c3
-rw-r--r--arch/arm/mach-sa1100/h3600.c30
-rw-r--r--arch/arm/mach-sa1100/hackkit.c10
-rw-r--r--arch/arm/mach-sa1100/jornada720.c10
-rw-r--r--arch/arm/mach-sa1100/lart.c10
-rw-r--r--arch/arm/mach-sa1100/pleb.c8
-rw-r--r--arch/arm/mach-sa1100/shannon.c10
-rw-r--r--arch/arm/mach-sa1100/simpad.c12
-rw-r--r--arch/arm/mach-shark/core.c12
-rw-r--r--arch/arm/mach-versatile/versatile_ab.c14
-rw-r--r--arch/arm/mach-versatile/versatile_pb.c14
-rw-r--r--arch/arm/mm/blockops.c3
-rw-r--r--arch/arm/mm/fault.c75
-rw-r--r--arch/arm/mm/proc-arm1020.S4
-rw-r--r--arch/arm/mm/proc-arm1020e.S4
-rw-r--r--arch/i386/kernel/apic.c2
-rw-r--r--arch/i386/kernel/apm.c5
-rw-r--r--arch/i386/kernel/io_apic.c2
-rw-r--r--arch/i386/kernel/time.c5
-rw-r--r--arch/i386/kernel/timers/timer_cyclone.c4
-rw-r--r--arch/i386/kernel/timers/timer_pit.c4
-rw-r--r--arch/i386/kernel/timers/timer_tsc.c3
-rw-r--r--arch/i386/mach-voyager/voyager_basic.c2
-rw-r--r--arch/ppc/kernel/relocate_kernel.S4
-rw-r--r--arch/ppc/platforms/85xx/mpc8540_ads.c2
-rw-r--r--arch/ppc64/boot/Makefile5
-rw-r--r--arch/ppc64/boot/main.c8
-rw-r--r--arch/ppc64/boot/mknote.c43
-rw-r--r--arch/ppc64/boot/piggyback.c83
-rw-r--r--arch/ppc64/boot/prom.c16
-rw-r--r--arch/ppc64/kernel/ItLpQueue.c294
-rw-r--r--arch/ppc64/kernel/LparData.c11
-rw-r--r--arch/ppc64/kernel/iSeries_proc.c48
-rw-r--r--arch/ppc64/kernel/iSeries_setup.c43
-rw-r--r--arch/ppc64/kernel/idle.c4
-rw-r--r--arch/ppc64/kernel/irq.c7
-rw-r--r--arch/ppc64/kernel/mf.c6
-rw-r--r--arch/ppc64/kernel/nvram.c8
-rw-r--r--arch/ppc64/kernel/pacaData.c212
-rw-r--r--arch/ppc64/kernel/sysfs.c7
-rw-r--r--arch/ppc64/kernel/time.c8
-rw-r--r--arch/x86_64/kernel/io_apic.c1
-rw-r--r--arch/xtensa/Kconfig4
-rw-r--r--arch/xtensa/Makefile48
-rw-r--r--arch/xtensa/boot/Makefile10
-rw-r--r--arch/xtensa/boot/boot-elf/Makefile4
-rw-r--r--arch/xtensa/boot/boot-redboot/Makefile10
-rw-r--r--arch/xtensa/boot/include/zlib.h433
-rw-r--r--arch/xtensa/boot/lib/Makefile13
-rw-r--r--arch/xtensa/boot/lib/memcpy.S36
-rw-r--r--arch/xtensa/boot/lib/zlib.c2150
-rw-r--r--arch/xtensa/boot/lib/zmem.c20
-rw-r--r--arch/xtensa/kernel/pci.c95
-rw-r--r--arch/xtensa/kernel/ptrace.c5
-rw-r--r--drivers/acpi/pci_irq.c2
-rw-r--r--drivers/base/base.h1
-rw-r--r--drivers/base/bus.c117
-rw-r--r--drivers/base/core.c2
-rw-r--r--drivers/base/dd.c2
-rw-r--r--drivers/base/driver.c35
-rw-r--r--drivers/char/tpm/tpm.c2
-rw-r--r--drivers/ide/Makefile1
-rw-r--r--drivers/ide/ide-lib.c13
-rw-r--r--drivers/ide/legacy/hd.c4
-rw-r--r--drivers/ide/pci/alim15x3.c10
-rw-r--r--drivers/ide/pci/amd74xx.c7
-rw-r--r--drivers/ide/pci/cs5530.c4
-rw-r--r--drivers/ide/pci/cy82c693.c8
-rw-r--r--drivers/ide/pci/it8172.c4
-rw-r--r--drivers/ide/pci/ns87415.c2
-rw-r--r--drivers/ide/pci/opti621.c2
-rw-r--r--drivers/ide/pci/sc1200.c2
-rw-r--r--drivers/ide/pci/sl82c105.c6
-rw-r--r--drivers/ide/pci/slc90e66.c2
-rw-r--r--drivers/ide/pci/triflex.c2
-rw-r--r--drivers/ide/pci/via82cxxx.c4
-rw-r--r--drivers/input/gameport/gameport.c3
-rw-r--r--drivers/input/joystick/analog.c4
-rw-r--r--drivers/mmc/mmci.c9
-rw-r--r--drivers/mmc/wbsd.c80
-rw-r--r--drivers/mmc/wbsd.h9
-rw-r--r--drivers/mtd/afs.c16
-rw-r--r--drivers/pcmcia/ds.c2
-rw-r--r--drivers/serial/8250.c3
-rw-r--r--drivers/serial/s3c2410.c5
-rw-r--r--drivers/serial/serial_core.c14
-rw-r--r--drivers/video/console/fbcon.c8
-rw-r--r--fs/fat/cache.c2
-rw-r--r--fs/fat/inode.c21
-rw-r--r--fs/freevxfs/vxfs.h1
-rw-r--r--fs/freevxfs/vxfs_bmap.c2
-rw-r--r--fs/freevxfs/vxfs_fshead.c11
-rw-r--r--fs/freevxfs/vxfs_kcompat.h49
-rw-r--r--fs/freevxfs/vxfs_lookup.c8
-rw-r--r--fs/freevxfs/vxfs_olt.c10
-rw-r--r--fs/freevxfs/vxfs_subr.c1
-rw-r--r--fs/freevxfs/vxfs_super.c7
-rw-r--r--fs/reiserfs/super.c3
-rw-r--r--fs/udf/namei.c4
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h2
-rw-r--r--include/asm-arm/mach/arch.h32
-rw-r--r--include/asm-arm/system.h4
-rw-r--r--include/asm-i386/i8253.h6
-rw-r--r--include/asm-i386/mach-default/do_timer.h1
-rw-r--r--include/asm-ppc64/iSeries/ItLpQueue.h15
-rw-r--r--include/asm-ppc64/paca.h3
-rw-r--r--include/asm-s390/system.h4
-rw-r--r--include/asm-x86_64/io_apic.h2
-rw-r--r--include/asm-xtensa/delay.h2
-rw-r--r--include/asm-xtensa/errno.h128
-rw-r--r--include/asm-xtensa/ipc.h20
-rw-r--r--include/linux/device.h7
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--init/do_mounts_initrd.c5
-rw-r--r--security/selinux/hooks.c3
187 files changed, 1408 insertions, 5038 deletions
diff --git a/Documentation/Changes b/Documentation/Changes
index afebdbcd553a..dfec7569d450 100644
--- a/Documentation/Changes
+++ b/Documentation/Changes
@@ -57,7 +57,7 @@ o e2fsprogs 1.29 # tune2fs
57o jfsutils 1.1.3 # fsck.jfs -V 57o jfsutils 1.1.3 # fsck.jfs -V
58o reiserfsprogs 3.6.3 # reiserfsck -V 2>&1|grep reiserfsprogs 58o reiserfsprogs 3.6.3 # reiserfsck -V 2>&1|grep reiserfsprogs
59o xfsprogs 2.6.0 # xfs_db -V 59o xfsprogs 2.6.0 # xfs_db -V
60o pcmciautils 001 60o pcmciautils 004
61o pcmcia-cs 3.1.21 # cardmgr -V 61o pcmcia-cs 3.1.21 # cardmgr -V
62o quota-tools 3.09 # quota -V 62o quota-tools 3.09 # quota -V
63o PPP 2.4.0 # pppd --version 63o PPP 2.4.0 # pppd --version
diff --git a/Documentation/pcmcia/devicetable.txt b/Documentation/pcmcia/devicetable.txt
index 045511acafc9..3351c0355143 100644
--- a/Documentation/pcmcia/devicetable.txt
+++ b/Documentation/pcmcia/devicetable.txt
@@ -19,9 +19,8 @@ PCMCIA_DEVICE_PROD_ID1("some_string", 0x(hash_of_some_string)),
19If the hash is incorrect, the kernel will inform you about this in "dmesg" 19If the hash is incorrect, the kernel will inform you about this in "dmesg"
20upon module initialization, and tell you of the correct hash. 20upon module initialization, and tell you of the correct hash.
21 21
22You can determine the hash of the product ID strings by running 22You can determine the hash of the product ID strings by catting the file
23"pcmcia-modalias %n.%m" [%n being replaced with the socket number and %m being 23"modalias" in the sysfs directory of the PCMCIA device. It generates a string
24replaced with the device function] from pcmciautils. It generates a string
25in the following form: 24in the following form:
26pcmcia:m0149cC1ABf06pfn00fn00pa725B842DpbF1EFEE84pc0877B627pd00000000 25pcmcia:m0149cC1ABf06pfn00fn00pa725B842DpbF1EFEE84pc0877B627pd00000000
27 26
diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c
index e6ded33c6e22..9d34ce26e5ef 100644
--- a/arch/alpha/kernel/irq_alpha.c
+++ b/arch/alpha/kernel/irq_alpha.c
@@ -55,6 +55,8 @@ do_entInt(unsigned long type, unsigned long vector,
55#ifdef CONFIG_SMP 55#ifdef CONFIG_SMP
56 { 56 {
57 long cpu; 57 long cpu;
58
59 local_irq_disable();
58 smp_percpu_timer_interrupt(regs); 60 smp_percpu_timer_interrupt(regs);
59 cpu = smp_processor_id(); 61 cpu = smp_processor_id();
60 if (cpu != boot_cpuid) { 62 if (cpu != boot_cpuid) {
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c
index fd7bd17cc960..6f509a644bdd 100644
--- a/arch/alpha/kernel/traps.c
+++ b/arch/alpha/kernel/traps.c
@@ -240,7 +240,7 @@ do_entIF(unsigned long type, struct pt_regs *regs)
240 siginfo_t info; 240 siginfo_t info;
241 int signo, code; 241 int signo, code;
242 242
243 if (regs->ps == 0) { 243 if ((regs->ps & ~IPL_MAX) == 0) {
244 if (type == 1) { 244 if (type == 1) {
245 const unsigned int *data 245 const unsigned int *data
246 = (const unsigned int *) regs->pc; 246 = (const unsigned int *) regs->pc;
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 8330495e2448..eb933dcafba0 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -56,7 +56,7 @@ tune-$(CONFIG_CPU_XSCALE) :=$(call cc-option,-mtune=xscale,-mtune=strongarm110)
56tune-$(CONFIG_CPU_V6) :=-mtune=strongarm 56tune-$(CONFIG_CPU_V6) :=-mtune=strongarm
57 57
58# Need -Uarm for gcc < 3.x 58# Need -Uarm for gcc < 3.x
59CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) 59CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,)
60CFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm 60CFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
61AFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float 61AFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float
62 62
diff --git a/arch/arm/configs/omnimeter_defconfig b/arch/arm/configs/omnimeter_defconfig
deleted file mode 100644
index 78fdb4a428b1..000000000000
--- a/arch/arm/configs/omnimeter_defconfig
+++ /dev/null
@@ -1,803 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 21:31:45 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28CONFIG_SYSCTL=y
29# CONFIG_AUDIT is not set
30CONFIG_HOTPLUG=y
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33# CONFIG_EMBEDDED is not set
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39CONFIG_CC_OPTIMIZE_FOR_SIZE=y
40CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
47
48#
49# Loadable module support
50#
51CONFIG_MODULES=y
52# CONFIG_MODULE_UNLOAD is not set
53CONFIG_OBSOLETE_MODPARM=y
54# CONFIG_MODVERSIONS is not set
55# CONFIG_MODULE_SRCVERSION_ALL is not set
56CONFIG_KMOD=y
57
58#
59# System Type
60#
61# CONFIG_ARCH_CLPS7500 is not set
62# CONFIG_ARCH_CLPS711X is not set
63# CONFIG_ARCH_CO285 is not set
64# CONFIG_ARCH_EBSA110 is not set
65# CONFIG_ARCH_CAMELOT is not set
66# CONFIG_ARCH_FOOTBRIDGE is not set
67# CONFIG_ARCH_INTEGRATOR is not set
68# CONFIG_ARCH_IOP3XX is not set
69# CONFIG_ARCH_IXP4XX is not set
70# CONFIG_ARCH_IXP2000 is not set
71# CONFIG_ARCH_L7200 is not set
72# CONFIG_ARCH_PXA is not set
73# CONFIG_ARCH_RPC is not set
74CONFIG_ARCH_SA1100=y
75# CONFIG_ARCH_S3C2410 is not set
76# CONFIG_ARCH_SHARK is not set
77# CONFIG_ARCH_LH7A40X is not set
78# CONFIG_ARCH_OMAP is not set
79# CONFIG_ARCH_VERSATILE is not set
80# CONFIG_ARCH_IMX is not set
81# CONFIG_ARCH_H720X is not set
82
83#
84# SA11x0 Implementations
85#
86# CONFIG_SA1100_ASSABET is not set
87# CONFIG_SA1100_CERF is not set
88# CONFIG_SA1100_COLLIE is not set
89# CONFIG_SA1100_H3100 is not set
90# CONFIG_SA1100_H3600 is not set
91# CONFIG_SA1100_H3800 is not set
92# CONFIG_SA1100_BADGE4 is not set
93# CONFIG_SA1100_JORNADA720 is not set
94# CONFIG_SA1100_HACKKIT is not set
95# CONFIG_SA1100_LART is not set
96# CONFIG_SA1100_PLEB is not set
97# CONFIG_SA1100_SHANNON is not set
98# CONFIG_SA1100_SIMPAD is not set
99# CONFIG_SA1100_SSP is not set
100
101#
102# Processor Type
103#
104CONFIG_CPU_32=y
105CONFIG_CPU_SA1100=y
106CONFIG_CPU_32v4=y
107CONFIG_CPU_ABRT_EV4=y
108CONFIG_CPU_CACHE_V4WB=y
109CONFIG_CPU_CACHE_VIVT=y
110CONFIG_CPU_TLB_V4WB=y
111CONFIG_CPU_MINICACHE=y
112
113#
114# Processor Features
115#
116
117#
118# Bus support
119#
120CONFIG_ISA=y
121
122#
123# PCCARD (PCMCIA/CardBus) support
124#
125CONFIG_PCCARD=y
126# CONFIG_PCMCIA_DEBUG is not set
127CONFIG_PCMCIA=y
128
129#
130# PC-card bridges
131#
132CONFIG_I82365=y
133# CONFIG_TCIC is not set
134CONFIG_PCMCIA_SA1100=y
135CONFIG_PCCARD_NONSTATIC=y
136
137#
138# Kernel Features
139#
140# CONFIG_PREEMPT is not set
141CONFIG_DISCONTIGMEM=y
142# CONFIG_LEDS is not set
143CONFIG_ALIGNMENT_TRAP=y
144
145#
146# Boot options
147#
148CONFIG_ZBOOT_ROM_TEXT=0x0
149CONFIG_ZBOOT_ROM_BSS=0x0
150CONFIG_CMDLINE="keepinitrd mem=16M root=/dev/ram ramdisk=8192 initrd=0xd0000000,4M"
151# CONFIG_XIP_KERNEL is not set
152
153#
154# CPU Frequency scaling
155#
156# CONFIG_CPU_FREQ is not set
157
158#
159# Floating point emulation
160#
161
162#
163# At least one emulation must be selected
164#
165# CONFIG_FPE_NWFPE is not set
166# CONFIG_FPE_FASTFPE is not set
167
168#
169# Userspace binary formats
170#
171CONFIG_BINFMT_ELF=y
172CONFIG_BINFMT_AOUT=y
173# CONFIG_BINFMT_MISC is not set
174# CONFIG_ARTHUR is not set
175
176#
177# Power management options
178#
179# CONFIG_PM is not set
180
181#
182# Device Drivers
183#
184
185#
186# Generic Driver Options
187#
188CONFIG_STANDALONE=y
189CONFIG_PREVENT_FIRMWARE_BUILD=y
190# CONFIG_FW_LOADER is not set
191
192#
193# Memory Technology Devices (MTD)
194#
195# CONFIG_MTD is not set
196
197#
198# Parallel port support
199#
200# CONFIG_PARPORT is not set
201
202#
203# Plug and Play support
204#
205# CONFIG_PNP is not set
206
207#
208# Block devices
209#
210# CONFIG_BLK_DEV_FD is not set
211# CONFIG_BLK_DEV_XD is not set
212# CONFIG_BLK_DEV_COW_COMMON is not set
213CONFIG_BLK_DEV_LOOP=m
214# CONFIG_BLK_DEV_CRYPTOLOOP is not set
215CONFIG_BLK_DEV_NBD=m
216# CONFIG_BLK_DEV_RAM is not set
217CONFIG_BLK_DEV_RAM_COUNT=16
218CONFIG_INITRAMFS_SOURCE=""
219# CONFIG_CDROM_PKTCDVD is not set
220
221#
222# IO Schedulers
223#
224CONFIG_IOSCHED_NOOP=y
225CONFIG_IOSCHED_AS=y
226CONFIG_IOSCHED_DEADLINE=y
227CONFIG_IOSCHED_CFQ=y
228# CONFIG_ATA_OVER_ETH is not set
229
230#
231# ATA/ATAPI/MFM/RLL support
232#
233CONFIG_IDE=y
234CONFIG_BLK_DEV_IDE=y
235
236#
237# Please see Documentation/ide.txt for help/info on IDE drives
238#
239# CONFIG_BLK_DEV_IDE_SATA is not set
240CONFIG_BLK_DEV_IDEDISK=y
241# CONFIG_IDEDISK_MULTI_MODE is not set
242# CONFIG_BLK_DEV_IDECS is not set
243# CONFIG_BLK_DEV_IDECD is not set
244# CONFIG_BLK_DEV_IDETAPE is not set
245# CONFIG_BLK_DEV_IDEFLOPPY is not set
246# CONFIG_IDE_TASK_IOCTL is not set
247
248#
249# IDE chipset support/bugfixes
250#
251CONFIG_IDE_GENERIC=y
252# CONFIG_IDE_ARM is not set
253# CONFIG_IDE_CHIPSETS is not set
254# CONFIG_BLK_DEV_IDEDMA is not set
255# CONFIG_IDEDMA_AUTO is not set
256# CONFIG_BLK_DEV_HD is not set
257
258#
259# SCSI device support
260#
261# CONFIG_SCSI is not set
262
263#
264# Multi-device support (RAID and LVM)
265#
266# CONFIG_MD is not set
267
268#
269# Fusion MPT device support
270#
271
272#
273# IEEE 1394 (FireWire) support
274#
275
276#
277# I2O device support
278#
279
280#
281# Networking support
282#
283CONFIG_NET=y
284
285#
286# Networking options
287#
288CONFIG_PACKET=y
289CONFIG_PACKET_MMAP=y
290# CONFIG_NETLINK_DEV is not set
291CONFIG_UNIX=y
292# CONFIG_NET_KEY is not set
293CONFIG_INET=y
294CONFIG_IP_MULTICAST=y
295# CONFIG_IP_ADVANCED_ROUTER is not set
296# CONFIG_IP_PNP is not set
297# CONFIG_NET_IPIP is not set
298# CONFIG_NET_IPGRE is not set
299# CONFIG_IP_MROUTE is not set
300# CONFIG_ARPD is not set
301# CONFIG_SYN_COOKIES is not set
302# CONFIG_INET_AH is not set
303# CONFIG_INET_ESP is not set
304# CONFIG_INET_IPCOMP is not set
305# CONFIG_INET_TUNNEL is not set
306CONFIG_IP_TCPDIAG=y
307# CONFIG_IP_TCPDIAG_IPV6 is not set
308
309#
310# IP: Virtual Server Configuration
311#
312# CONFIG_IP_VS is not set
313# CONFIG_IPV6 is not set
314CONFIG_NETFILTER=y
315# CONFIG_NETFILTER_DEBUG is not set
316
317#
318# IP: Netfilter Configuration
319#
320# CONFIG_IP_NF_CONNTRACK is not set
321# CONFIG_IP_NF_CONNTRACK_MARK is not set
322# CONFIG_IP_NF_QUEUE is not set
323# CONFIG_IP_NF_IPTABLES is not set
324# CONFIG_IP_NF_ARPTABLES is not set
325
326#
327# SCTP Configuration (EXPERIMENTAL)
328#
329# CONFIG_IP_SCTP is not set
330# CONFIG_ATM is not set
331# CONFIG_BRIDGE is not set
332# CONFIG_VLAN_8021Q is not set
333# CONFIG_DECNET is not set
334# CONFIG_LLC2 is not set
335# CONFIG_IPX is not set
336# CONFIG_ATALK is not set
337# CONFIG_X25 is not set
338# CONFIG_LAPB is not set
339# CONFIG_NET_DIVERT is not set
340# CONFIG_ECONET is not set
341# CONFIG_WAN_ROUTER is not set
342
343#
344# QoS and/or fair queueing
345#
346# CONFIG_NET_SCHED is not set
347# CONFIG_NET_CLS_ROUTE is not set
348
349#
350# Network testing
351#
352# CONFIG_NET_PKTGEN is not set
353# CONFIG_NETPOLL is not set
354# CONFIG_NET_POLL_CONTROLLER is not set
355# CONFIG_HAMRADIO is not set
356# CONFIG_IRDA is not set
357# CONFIG_BT is not set
358CONFIG_NETDEVICES=y
359# CONFIG_DUMMY is not set
360# CONFIG_BONDING is not set
361# CONFIG_EQUALIZER is not set
362# CONFIG_TUN is not set
363
364#
365# ARCnet devices
366#
367# CONFIG_ARCNET is not set
368
369#
370# Ethernet (10 or 100Mbit)
371#
372CONFIG_NET_ETHERNET=y
373# CONFIG_MII is not set
374# CONFIG_NET_VENDOR_3COM is not set
375# CONFIG_LANCE is not set
376# CONFIG_NET_VENDOR_SMC is not set
377# CONFIG_SMC91X is not set
378# CONFIG_NET_VENDOR_RACAL is not set
379# CONFIG_AT1700 is not set
380# CONFIG_DEPCA is not set
381# CONFIG_HP100 is not set
382# CONFIG_NET_ISA is not set
383# CONFIG_NET_PCI is not set
384# CONFIG_NET_POCKET is not set
385
386#
387# Ethernet (1000 Mbit)
388#
389
390#
391# Ethernet (10000 Mbit)
392#
393
394#
395# Token Ring devices
396#
397# CONFIG_TR is not set
398
399#
400# Wireless LAN (non-hamradio)
401#
402CONFIG_NET_RADIO=y
403
404#
405# Obsolete Wireless cards support (pre-802.11)
406#
407# CONFIG_STRIP is not set
408# CONFIG_ARLAN is not set
409# CONFIG_WAVELAN is not set
410CONFIG_PCMCIA_WAVELAN=y
411# CONFIG_PCMCIA_NETWAVE is not set
412
413#
414# Wireless 802.11 Frequency Hopping cards support
415#
416# CONFIG_PCMCIA_RAYCS is not set
417
418#
419# Wireless 802.11b ISA/PCI cards support
420#
421# CONFIG_HERMES is not set
422# CONFIG_ATMEL is not set
423
424#
425# Wireless 802.11b Pcmcia/Cardbus cards support
426#
427CONFIG_AIRO_CS=y
428CONFIG_PCMCIA_WL3501=y
429CONFIG_NET_WIRELESS=y
430
431#
432# PCMCIA network device support
433#
434CONFIG_NET_PCMCIA=y
435CONFIG_PCMCIA_3C589=y
436# CONFIG_PCMCIA_3C574 is not set
437# CONFIG_PCMCIA_FMVJ18X is not set
438CONFIG_PCMCIA_PCNET=y
439# CONFIG_PCMCIA_NMCLAN is not set
440# CONFIG_PCMCIA_SMC91C92 is not set
441# CONFIG_PCMCIA_XIRC2PS is not set
442# CONFIG_PCMCIA_AXNET is not set
443
444#
445# Wan interfaces
446#
447# CONFIG_WAN is not set
448# CONFIG_PPP is not set
449# CONFIG_SLIP is not set
450# CONFIG_SHAPER is not set
451# CONFIG_NETCONSOLE is not set
452
453#
454# ISDN subsystem
455#
456# CONFIG_ISDN is not set
457
458#
459# Input device support
460#
461CONFIG_INPUT=y
462
463#
464# Userland interfaces
465#
466CONFIG_INPUT_MOUSEDEV=y
467CONFIG_INPUT_MOUSEDEV_PSAUX=y
468CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
469CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
470# CONFIG_INPUT_JOYDEV is not set
471# CONFIG_INPUT_TSDEV is not set
472# CONFIG_INPUT_EVDEV is not set
473# CONFIG_INPUT_EVBUG is not set
474
475#
476# Input Device Drivers
477#
478CONFIG_INPUT_KEYBOARD=y
479CONFIG_KEYBOARD_ATKBD=y
480# CONFIG_KEYBOARD_SUNKBD is not set
481# CONFIG_KEYBOARD_LKKBD is not set
482# CONFIG_KEYBOARD_XTKBD is not set
483# CONFIG_KEYBOARD_NEWTON is not set
484CONFIG_INPUT_MOUSE=y
485CONFIG_MOUSE_PS2=y
486# CONFIG_MOUSE_SERIAL is not set
487# CONFIG_MOUSE_INPORT is not set
488# CONFIG_MOUSE_LOGIBM is not set
489# CONFIG_MOUSE_PC110PAD is not set
490# CONFIG_MOUSE_VSXXXAA is not set
491# CONFIG_INPUT_JOYSTICK is not set
492# CONFIG_INPUT_TOUCHSCREEN is not set
493# CONFIG_INPUT_MISC is not set
494
495#
496# Hardware I/O ports
497#
498CONFIG_SERIO=y
499CONFIG_SERIO_SERPORT=y
500CONFIG_SERIO_LIBPS2=y
501# CONFIG_SERIO_RAW is not set
502# CONFIG_GAMEPORT is not set
503CONFIG_SOUND_GAMEPORT=y
504
505#
506# Character devices
507#
508CONFIG_VT=y
509CONFIG_VT_CONSOLE=y
510CONFIG_HW_CONSOLE=y
511# CONFIG_SERIAL_NONSTANDARD is not set
512
513#
514# Serial drivers
515#
516# CONFIG_SERIAL_8250 is not set
517
518#
519# Non-8250 serial port support
520#
521CONFIG_SERIAL_SA1100=y
522CONFIG_SERIAL_SA1100_CONSOLE=y
523CONFIG_SERIAL_CORE=y
524CONFIG_SERIAL_CORE_CONSOLE=y
525CONFIG_UNIX98_PTYS=y
526CONFIG_LEGACY_PTYS=y
527CONFIG_LEGACY_PTY_COUNT=256
528
529#
530# IPMI
531#
532# CONFIG_IPMI_HANDLER is not set
533
534#
535# Watchdog Cards
536#
537# CONFIG_WATCHDOG is not set
538# CONFIG_NVRAM is not set
539# CONFIG_RTC is not set
540# CONFIG_DTLK is not set
541# CONFIG_R3964 is not set
542
543#
544# Ftape, the floppy tape device driver
545#
546# CONFIG_DRM is not set
547
548#
549# PCMCIA character devices
550#
551# CONFIG_SYNCLINK_CS is not set
552# CONFIG_RAW_DRIVER is not set
553
554#
555# TPM devices
556#
557# CONFIG_TCG_TPM is not set
558
559#
560# I2C support
561#
562# CONFIG_I2C is not set
563
564#
565# Misc devices
566#
567
568#
569# Multimedia devices
570#
571# CONFIG_VIDEO_DEV is not set
572
573#
574# Digital Video Broadcasting Devices
575#
576# CONFIG_DVB is not set
577
578#
579# Graphics support
580#
581CONFIG_FB=y
582CONFIG_FB_CFB_FILLRECT=y
583CONFIG_FB_CFB_COPYAREA=y
584CONFIG_FB_CFB_IMAGEBLIT=y
585CONFIG_FB_SOFT_CURSOR=y
586# CONFIG_FB_MODE_HELPERS is not set
587# CONFIG_FB_TILEBLITTING is not set
588CONFIG_FB_SA1100=y
589# CONFIG_FB_VIRTUAL is not set
590
591#
592# Console display driver support
593#
594# CONFIG_VGA_CONSOLE is not set
595# CONFIG_MDA_CONSOLE is not set
596CONFIG_DUMMY_CONSOLE=y
597CONFIG_FRAMEBUFFER_CONSOLE=y
598CONFIG_FONTS=y
599CONFIG_FONT_8x8=y
600# CONFIG_FONT_8x16 is not set
601# CONFIG_FONT_6x11 is not set
602# CONFIG_FONT_PEARL_8x8 is not set
603# CONFIG_FONT_ACORN_8x8 is not set
604# CONFIG_FONT_MINI_4x6 is not set
605# CONFIG_FONT_SUN8x16 is not set
606# CONFIG_FONT_SUN12x22 is not set
607
608#
609# Logo configuration
610#
611# CONFIG_LOGO is not set
612# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
613
614#
615# Sound
616#
617# CONFIG_SOUND is not set
618
619#
620# USB support
621#
622CONFIG_USB_ARCH_HAS_HCD=y
623# CONFIG_USB_ARCH_HAS_OHCI is not set
624# CONFIG_USB is not set
625
626#
627# USB Gadget Support
628#
629# CONFIG_USB_GADGET is not set
630
631#
632# MMC/SD Card support
633#
634# CONFIG_MMC is not set
635
636#
637# File systems
638#
639CONFIG_EXT2_FS=y
640# CONFIG_EXT2_FS_XATTR is not set
641# CONFIG_EXT3_FS is not set
642# CONFIG_JBD is not set
643# CONFIG_REISERFS_FS is not set
644# CONFIG_JFS_FS is not set
645
646#
647# XFS support
648#
649# CONFIG_XFS_FS is not set
650# CONFIG_MINIX_FS is not set
651# CONFIG_ROMFS_FS is not set
652# CONFIG_QUOTA is not set
653CONFIG_DNOTIFY=y
654# CONFIG_AUTOFS_FS is not set
655# CONFIG_AUTOFS4_FS is not set
656
657#
658# CD-ROM/DVD Filesystems
659#
660# CONFIG_ISO9660_FS is not set
661# CONFIG_UDF_FS is not set
662
663#
664# DOS/FAT/NT Filesystems
665#
666CONFIG_FAT_FS=y
667CONFIG_MSDOS_FS=y
668# CONFIG_VFAT_FS is not set
669CONFIG_FAT_DEFAULT_CODEPAGE=437
670# CONFIG_NTFS_FS is not set
671
672#
673# Pseudo filesystems
674#
675CONFIG_PROC_FS=y
676CONFIG_SYSFS=y
677# CONFIG_DEVFS_FS is not set
678# CONFIG_DEVPTS_FS_XATTR is not set
679# CONFIG_TMPFS is not set
680# CONFIG_HUGETLB_PAGE is not set
681CONFIG_RAMFS=y
682
683#
684# Miscellaneous filesystems
685#
686# CONFIG_ADFS_FS is not set
687# CONFIG_AFFS_FS is not set
688# CONFIG_HFS_FS is not set
689# CONFIG_HFSPLUS_FS is not set
690# CONFIG_BEFS_FS is not set
691# CONFIG_BFS_FS is not set
692# CONFIG_EFS_FS is not set
693# CONFIG_CRAMFS is not set
694# CONFIG_VXFS_FS is not set
695# CONFIG_HPFS_FS is not set
696# CONFIG_QNX4FS_FS is not set
697# CONFIG_SYSV_FS is not set
698# CONFIG_UFS_FS is not set
699
700#
701# Network File Systems
702#
703CONFIG_NFS_FS=y
704# CONFIG_NFS_V3 is not set
705# CONFIG_NFS_V4 is not set
706# CONFIG_NFS_DIRECTIO is not set
707# CONFIG_NFSD is not set
708CONFIG_LOCKD=y
709CONFIG_SUNRPC=y
710# CONFIG_RPCSEC_GSS_KRB5 is not set
711# CONFIG_RPCSEC_GSS_SPKM3 is not set
712# CONFIG_SMB_FS is not set
713# CONFIG_CIFS is not set
714# CONFIG_NCP_FS is not set
715# CONFIG_CODA_FS is not set
716# CONFIG_AFS_FS is not set
717
718#
719# Partition Types
720#
721# CONFIG_PARTITION_ADVANCED is not set
722CONFIG_MSDOS_PARTITION=y
723
724#
725# Native Language Support
726#
727CONFIG_NLS=y
728CONFIG_NLS_DEFAULT="iso8859-1"
729# CONFIG_NLS_CODEPAGE_437 is not set
730# CONFIG_NLS_CODEPAGE_737 is not set
731# CONFIG_NLS_CODEPAGE_775 is not set
732# CONFIG_NLS_CODEPAGE_850 is not set
733# CONFIG_NLS_CODEPAGE_852 is not set
734# CONFIG_NLS_CODEPAGE_855 is not set
735# CONFIG_NLS_CODEPAGE_857 is not set
736# CONFIG_NLS_CODEPAGE_860 is not set
737# CONFIG_NLS_CODEPAGE_861 is not set
738# CONFIG_NLS_CODEPAGE_862 is not set
739# CONFIG_NLS_CODEPAGE_863 is not set
740# CONFIG_NLS_CODEPAGE_864 is not set
741# CONFIG_NLS_CODEPAGE_865 is not set
742# CONFIG_NLS_CODEPAGE_866 is not set
743# CONFIG_NLS_CODEPAGE_869 is not set
744# CONFIG_NLS_CODEPAGE_936 is not set
745# CONFIG_NLS_CODEPAGE_950 is not set
746# CONFIG_NLS_CODEPAGE_932 is not set
747# CONFIG_NLS_CODEPAGE_949 is not set
748# CONFIG_NLS_CODEPAGE_874 is not set
749# CONFIG_NLS_ISO8859_8 is not set
750# CONFIG_NLS_CODEPAGE_1250 is not set
751# CONFIG_NLS_CODEPAGE_1251 is not set
752# CONFIG_NLS_ASCII is not set
753# CONFIG_NLS_ISO8859_1 is not set
754# CONFIG_NLS_ISO8859_2 is not set
755# CONFIG_NLS_ISO8859_3 is not set
756# CONFIG_NLS_ISO8859_4 is not set
757# CONFIG_NLS_ISO8859_5 is not set
758# CONFIG_NLS_ISO8859_6 is not set
759# CONFIG_NLS_ISO8859_7 is not set
760# CONFIG_NLS_ISO8859_9 is not set
761# CONFIG_NLS_ISO8859_13 is not set
762# CONFIG_NLS_ISO8859_14 is not set
763# CONFIG_NLS_ISO8859_15 is not set
764# CONFIG_NLS_KOI8_R is not set
765# CONFIG_NLS_KOI8_U is not set
766# CONFIG_NLS_UTF8 is not set
767
768#
769# Profiling support
770#
771# CONFIG_PROFILING is not set
772
773#
774# Kernel hacking
775#
776# CONFIG_PRINTK_TIME is not set
777# CONFIG_DEBUG_KERNEL is not set
778CONFIG_LOG_BUF_SHIFT=14
779CONFIG_DEBUG_BUGVERBOSE=y
780CONFIG_FRAME_POINTER=y
781# CONFIG_DEBUG_USER is not set
782
783#
784# Security options
785#
786# CONFIG_KEYS is not set
787# CONFIG_SECURITY is not set
788
789#
790# Cryptographic options
791#
792# CONFIG_CRYPTO is not set
793
794#
795# Hardware crypto devices
796#
797
798#
799# Library routines
800#
801# CONFIG_CRC_CCITT is not set
802CONFIG_CRC32=y
803# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index bd4823c74645..1155cf07c871 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -344,9 +344,9 @@ __create_page_tables:
344 str r6, [r0] 344 str r6, [r0]
345#endif 345#endif
346 346
347#ifdef CONFIG_DEBUG_LL
347 bic r7, r7, #0x0c @ turn off cacheable 348 bic r7, r7, #0x0c @ turn off cacheable
348 @ and bufferable bits 349 @ and bufferable bits
349#ifdef CONFIG_DEBUG_LL
350 /* 350 /*
351 * Map in IO space for serial debugging. 351 * Map in IO space for serial debugging.
352 * This allows debug messages to be output 352 * This allows debug messages to be output
@@ -372,28 +372,24 @@ __create_page_tables:
372 teq r1, #MACH_TYPE_NETWINDER 372 teq r1, #MACH_TYPE_NETWINDER
373 teqne r1, #MACH_TYPE_CATS 373 teqne r1, #MACH_TYPE_CATS
374 bne 1f 374 bne 1f
375 add r0, r4, #0x3fc0 @ ff000000 375 add r0, r4, #0xff000000 >> 18
376 mov r3, #0x7c000000 376 orr r3, r7, #0x7c000000
377 orr r3, r3, r7 377 str r3, [r0]
378 str r3, [r0], #4
379 add r3, r3, #1 << 20
380 str r3, [r0], #4
3811: 3781:
382#endif 379#endif
383#endif
384#ifdef CONFIG_ARCH_RPC 380#ifdef CONFIG_ARCH_RPC
385 /* 381 /*
386 * Map in screen at 0x02000000 & SCREEN2_BASE 382 * Map in screen at 0x02000000 & SCREEN2_BASE
387 * Similar reasons here - for debug. This is 383 * Similar reasons here - for debug. This is
388 * only for Acorn RiscPC architectures. 384 * only for Acorn RiscPC architectures.
389 */ 385 */
390 add r0, r4, #0x80 @ 02000000 386 add r0, r4, #0x02000000 >> 18
391 mov r3, #0x02000000 387 orr r3, r7, #0x02000000
392 orr r3, r3, r7
393 str r3, [r0] 388 str r3, [r0]
394 add r0, r4, #0x3600 @ d8000000 389 add r0, r4, #0xd8000000 >> 18
395 str r3, [r0] 390 str r3, [r0]
396#endif 391#endif
392#endif
397 mov pc, lr 393 mov pc, lr
398 .ltorg 394 .ltorg
399 395
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 2fb0a4cfb37a..df2cb06ce424 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -230,16 +230,8 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
230 do_exit(SIGSEGV); 230 do_exit(SIGSEGV);
231} 231}
232 232
233void die_if_kernel(const char *str, struct pt_regs *regs, int err) 233void notify_die(const char *str, struct pt_regs *regs, struct siginfo *info,
234{ 234 unsigned long err, unsigned long trap)
235 if (user_mode(regs))
236 return;
237
238 die(str, regs, err);
239}
240
241static void notify_die(const char *str, struct pt_regs *regs, siginfo_t *info,
242 unsigned long err, unsigned long trap)
243{ 235{
244 if (user_mode(regs)) { 236 if (user_mode(regs)) {
245 current->thread.error_code = err; 237 current->thread.error_code = err;
diff --git a/arch/arm/mach-aaec2000/aaed2000.c b/arch/arm/mach-aaec2000/aaed2000.c
index 5417ca3f4621..c9d899886648 100644
--- a/arch/arm/mach-aaec2000/aaed2000.c
+++ b/arch/arm/mach-aaec2000/aaed2000.c
@@ -40,9 +40,11 @@ static void __init aaed2000_map_io(void)
40} 40}
41 41
42MACHINE_START(AAED2000, "Agilent AAED-2000 Development Platform") 42MACHINE_START(AAED2000, "Agilent AAED-2000 Development Platform")
43 MAINTAINER("Nicolas Bellido Y Ortega") 43 /* Maintainer: Nicolas Bellido Y Ortega */
44 BOOT_MEM(0xf0000000, PIO_BASE, VIO_BASE) 44 .phys_ram = 0xf0000000,
45 MAPIO(aaed2000_map_io) 45 .phys_io = PIO_BASE,
46 INITIRQ(aaed2000_init_irq) 46 .io_pg_offst = ((VIO_BASE) >> 18) & 0xfffc,
47 .map_io = aaed2000_map_io,
48 .init_irq = aaed2000_init_irq,
47 .timer = &aaec2000_timer, 49 .timer = &aaec2000_timer,
48MACHINE_END 50MACHINE_END
diff --git a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c
index c106704a2c34..dc73feb1ffb0 100644
--- a/arch/arm/mach-clps711x/autcpu12.c
+++ b/arch/arm/mach-clps711x/autcpu12.c
@@ -59,11 +59,13 @@ void __init autcpu12_map_io(void)
59} 59}
60 60
61MACHINE_START(AUTCPU12, "autronix autcpu12") 61MACHINE_START(AUTCPU12, "autronix autcpu12")
62 MAINTAINER("Thomas Gleixner") 62 /* Maintainer: Thomas Gleixner */
63 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000) 63 .phys_ram = 0xc0000000,
64 BOOT_PARAMS(0xc0020000) 64 .phys_io = 0x80000000,
65 MAPIO(autcpu12_map_io) 65 .io_pg_offst = ((0xff000000) >> 18) & 0xfffc,
66 INITIRQ(clps711x_init_irq) 66 .boot_params = 0xc0020000,
67 .map_io = autcpu12_map_io,
68 .init_irq = clps711x_init_irq,
67 .timer = &clps711x_timer, 69 .timer = &clps711x_timer,
68MACHINE_END 70MACHINE_END
69 71
diff --git a/arch/arm/mach-clps711x/cdb89712.c b/arch/arm/mach-clps711x/cdb89712.c
index 7664f9cf83b8..a46c82cd2711 100644
--- a/arch/arm/mach-clps711x/cdb89712.c
+++ b/arch/arm/mach-clps711x/cdb89712.c
@@ -49,10 +49,12 @@ static void __init cdb89712_map_io(void)
49} 49}
50 50
51MACHINE_START(CDB89712, "Cirrus-CDB89712") 51MACHINE_START(CDB89712, "Cirrus-CDB89712")
52 MAINTAINER("Ray Lehtiniemi") 52 /* Maintainer: Ray Lehtiniemi */
53 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000) 53 .phys_ram = 0xc0000000,
54 BOOT_PARAMS(0xc0000100) 54 .phys_io = 0x80000000,
55 MAPIO(cdb89712_map_io) 55 .io_pg_offst = ((0xff000000) >> 18) & 0xfffc,
56 INITIRQ(clps711x_init_irq) 56 .boot_params = 0xc0000100,
57 .map_io = cdb89712_map_io,
58 .init_irq = clps711x_init_irq,
57 .timer = &clps711x_timer, 59 .timer = &clps711x_timer,
58MACHINE_END 60MACHINE_END
diff --git a/arch/arm/mach-clps711x/ceiva.c b/arch/arm/mach-clps711x/ceiva.c
index e4093be3c4cb..780d91805984 100644
--- a/arch/arm/mach-clps711x/ceiva.c
+++ b/arch/arm/mach-clps711x/ceiva.c
@@ -53,10 +53,12 @@ static void __init ceiva_map_io(void)
53 53
54 54
55MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame") 55MACHINE_START(CEIVA, "CEIVA/Polaroid Photo MAX Digital Picture Frame")
56 MAINTAINER("Rob Scott") 56 /* Maintainer: Rob Scott */
57 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000) 57 .phys_ram = 0xc0000000,
58 BOOT_PARAMS(0xc0000100) 58 .phys_io = 0x80000000,
59 MAPIO(ceiva_map_io) 59 .io_pg_offst = ((0xff000000) >> 18) & 0xfffc,
60 INITIRQ(clps711x_init_irq) 60 .boot_params = 0xc0000100,
61 .map_io = ceiva_map_io,
62 .init_irq = clps711x_init_irq,
61 .timer = &clps711x_timer, 63 .timer = &clps711x_timer,
62MACHINE_END 64MACHINE_END
diff --git a/arch/arm/mach-clps711x/clep7312.c b/arch/arm/mach-clps711x/clep7312.c
index 9ca21cb481ba..c83f3fd68fcd 100644
--- a/arch/arm/mach-clps711x/clep7312.c
+++ b/arch/arm/mach-clps711x/clep7312.c
@@ -37,12 +37,14 @@ fixup_clep7312(struct machine_desc *desc, struct tag *tags,
37 37
38 38
39MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312") 39MACHINE_START(CLEP7212, "Cirrus Logic 7212/7312")
40 MAINTAINER("Nobody") 40 /* Maintainer: Nobody */
41 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000) 41 .phys_ram = 0xc0000000,
42 BOOT_PARAMS(0xc0000100) 42 .phys_io = 0x80000000,
43 FIXUP(fixup_clep7312) 43 .io_pg_offst = ((0xff000000) >> 18) & 0xfffc,
44 MAPIO(clps711x_map_io) 44 .boot_params = 0xc0000100,
45 INITIRQ(clps711x_init_irq) 45 .fixup = fixup_clep7312,
46 .map_io = clps711x_map_io,
47 .init_irq = clps711x_init_irq,
46 .timer = &clps711x_timer, 48 .timer = &clps711x_timer,
47MACHINE_END 49MACHINE_END
48 50
diff --git a/arch/arm/mach-clps711x/edb7211-arch.c b/arch/arm/mach-clps711x/edb7211-arch.c
index c6c46324a2e3..255c98b63e15 100644
--- a/arch/arm/mach-clps711x/edb7211-arch.c
+++ b/arch/arm/mach-clps711x/edb7211-arch.c
@@ -51,11 +51,13 @@ fixup_edb7211(struct machine_desc *desc, struct tag *tags,
51} 51}
52 52
53MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") 53MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
54 MAINTAINER("Jon McClintock") 54 /* Maintainer: Jon McClintock */
55 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000) 55 .phys_ram = 0xc0000000,
56 BOOT_PARAMS(0xc0020100) /* 0xc0000000 - 0xc001ffff can be video RAM */ 56 .phys_io = 0x80000000,
57 FIXUP(fixup_edb7211) 57 .io_pg_offst = ((0xff000000) >> 18) & 0xfffc,
58 MAPIO(edb7211_map_io) 58 .boot_params = 0xc0020100, /* 0xc0000000 - 0xc001ffff can be video RAM */
59 INITIRQ(clps711x_init_irq) 59 .fixup = fixup_edb7211,
60 .map_io = edb7211_map_io,
61 .init_irq = clps711x_init_irq,
60 .timer = &clps711x_timer, 62 .timer = &clps711x_timer,
61MACHINE_END 63MACHINE_END
diff --git a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c
index c1c5b8e01549..f83a59761e02 100644
--- a/arch/arm/mach-clps711x/fortunet.c
+++ b/arch/arm/mach-clps711x/fortunet.c
@@ -75,11 +75,13 @@ fortunet_fixup(struct machine_desc *desc, struct tag *tags,
75} 75}
76 76
77MACHINE_START(FORTUNET, "ARM-FortuNet") 77MACHINE_START(FORTUNET, "ARM-FortuNet")
78 MAINTAINER("FortuNet Inc.") 78 /* Maintainer: FortuNet Inc. */
79 BOOT_MEM(0xc0000000, 0x80000000, 0xf0000000) 79 .phys_ram = 0xc0000000,
80 BOOT_PARAMS(0x00000000) 80 .phys_io = 0x80000000,
81 FIXUP(fortunet_fixup) 81 .io_pg_offst = ((0xf0000000) >> 18) & 0xfffc,
82 MAPIO(clps711x_map_io) 82 .boot_params = 0x00000000,
83 INITIRQ(clps711x_init_irq) 83 .fixup = fortunet_fixup,
84 .map_io = clps711x_map_io,
85 .init_irq = clps711x_init_irq,
84 .timer = &clps711x_timer, 86 .timer = &clps711x_timer,
85MACHINE_END 87MACHINE_END
diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c
index 29269df054f5..5bdb90edf992 100644
--- a/arch/arm/mach-clps711x/p720t.c
+++ b/arch/arm/mach-clps711x/p720t.c
@@ -79,12 +79,14 @@ static void __init p720t_map_io(void)
79} 79}
80 80
81MACHINE_START(P720T, "ARM-Prospector720T") 81MACHINE_START(P720T, "ARM-Prospector720T")
82 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") 82 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
83 BOOT_MEM(0xc0000000, 0x80000000, 0xff000000) 83 .phys_ram = 0xc0000000,
84 BOOT_PARAMS(0xc0000100) 84 .phys_io = 0x80000000,
85 FIXUP(fixup_p720t) 85 .io_pg_offst = ((0xff000000) >> 18) & 0xfffc,
86 MAPIO(p720t_map_io) 86 .boot_params = 0xc0000100,
87 INITIRQ(clps711x_init_irq) 87 .fixup = fixup_p720t,
88 .map_io = p720t_map_io,
89 .init_irq = clps711x_init_irq,
88 .timer = &clps711x_timer, 90 .timer = &clps711x_timer,
89MACHINE_END 91MACHINE_END
90 92
diff --git a/arch/arm/mach-clps7500/core.c b/arch/arm/mach-clps7500/core.c
index 90e85f434f6f..112f1d68fb2b 100644
--- a/arch/arm/mach-clps7500/core.c
+++ b/arch/arm/mach-clps7500/core.c
@@ -366,11 +366,13 @@ static void __init clps7500_init(void)
366} 366}
367 367
368MACHINE_START(CLPS7500, "CL-PS7500") 368MACHINE_START(CLPS7500, "CL-PS7500")
369 MAINTAINER("Philip Blundell") 369 /* Maintainer: Philip Blundell */
370 BOOT_MEM(0x10000000, 0x03000000, 0xe0000000) 370 .phys_ram = 0x10000000,
371 MAPIO(clps7500_map_io) 371 .phys_io = 0x03000000,
372 INITIRQ(clps7500_init_irq) 372 .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc,
373 .init_machine = clps7500_init, 373 .map_io = clps7500_map_io,
374 .timer = &clps7500_timer, 374 .init_irq = clps7500_init_irq,
375 .init_machine = clps7500_init,
376 .timer = &clps7500_timer,
375MACHINE_END 377MACHINE_END
376 378
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c
index 86ffdbb5626e..23c4da10101b 100644
--- a/arch/arm/mach-ebsa110/core.c
+++ b/arch/arm/mach-ebsa110/core.c
@@ -233,13 +233,15 @@ static int __init ebsa110_init(void)
233arch_initcall(ebsa110_init); 233arch_initcall(ebsa110_init);
234 234
235MACHINE_START(EBSA110, "EBSA110") 235MACHINE_START(EBSA110, "EBSA110")
236 MAINTAINER("Russell King") 236 /* Maintainer: Russell King */
237 BOOT_MEM(0x00000000, 0xe0000000, 0xe0000000) 237 .phys_ram = 0x00000000,
238 BOOT_PARAMS(0x00000400) 238 .phys_io = 0xe0000000,
239 DISABLE_PARPORT(0) 239 .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc,
240 DISABLE_PARPORT(2) 240 .boot_params = 0x00000400,
241 SOFT_REBOOT 241 .reserve_lp0 = 1,
242 MAPIO(ebsa110_map_io) 242 .reserve_lp2 = 1,
243 INITIRQ(ebsa110_init_irq) 243 .soft_reboot = 1,
244 .map_io = ebsa110_map_io,
245 .init_irq = ebsa110_init_irq,
244 .timer = &ebsa110_timer, 246 .timer = &ebsa110_timer,
245MACHINE_END 247MACHINE_END
diff --git a/arch/arm/mach-epxa10db/arch.c b/arch/arm/mach-epxa10db/arch.c
index 1b40340e8a21..7daa021676d0 100644
--- a/arch/arm/mach-epxa10db/arch.c
+++ b/arch/arm/mach-epxa10db/arch.c
@@ -63,10 +63,12 @@ extern void epxa10db_init_irq(void);
63extern struct sys_timer epxa10db_timer; 63extern struct sys_timer epxa10db_timer;
64 64
65MACHINE_START(CAMELOT, "Altera Epxa10db") 65MACHINE_START(CAMELOT, "Altera Epxa10db")
66 MAINTAINER("Altera Corporation") 66 /* Maintainer: Altera Corporation */
67 BOOT_MEM(0x00000000, 0x7fffc000, 0xffffc000) 67 .phys_ram = 0x00000000,
68 MAPIO(epxa10db_map_io) 68 .phys_io = 0x7fffc000,
69 INITIRQ(epxa10db_init_irq) 69 .io_pg_offst = ((0xffffc000) >> 18) & 0xfffc,
70 .map_io = epxa10db_map_io,
71 .init_irq = epxa10db_init_irq,
70 .timer = &epxa10db_timer, 72 .timer = &epxa10db_timer,
71MACHINE_END 73MACHINE_END
72 74
diff --git a/arch/arm/mach-footbridge/cats-hw.c b/arch/arm/mach-footbridge/cats-hw.c
index d1ced86c379c..49b898af0032 100644
--- a/arch/arm/mach-footbridge/cats-hw.c
+++ b/arch/arm/mach-footbridge/cats-hw.c
@@ -84,12 +84,14 @@ fixup_cats(struct machine_desc *desc, struct tag *tags,
84} 84}
85 85
86MACHINE_START(CATS, "Chalice-CATS") 86MACHINE_START(CATS, "Chalice-CATS")
87 MAINTAINER("Philip Blundell") 87 /* Maintainer: Philip Blundell */
88 BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000) 88 .phys_ram = 0x00000000,
89 BOOT_PARAMS(0x00000100) 89 .phys_io = DC21285_ARMCSR_BASE,
90 SOFT_REBOOT 90 .io_pg_offst = ((0xfe000000) >> 18) & 0xfffc,
91 FIXUP(fixup_cats) 91 .boot_params = 0x00000100,
92 MAPIO(footbridge_map_io) 92 .soft_reboot = 1,
93 INITIRQ(footbridge_init_irq) 93 .fixup = fixup_cats,
94 .map_io = footbridge_map_io,
95 .init_irq = footbridge_init_irq,
94 .timer = &isa_timer, 96 .timer = &isa_timer,
95MACHINE_END 97MACHINE_END
diff --git a/arch/arm/mach-footbridge/co285.c b/arch/arm/mach-footbridge/co285.c
index e1541914fdcd..548a79081688 100644
--- a/arch/arm/mach-footbridge/co285.c
+++ b/arch/arm/mach-footbridge/co285.c
@@ -28,11 +28,13 @@ fixup_coebsa285(struct machine_desc *desc, struct tag *tags,
28} 28}
29 29
30MACHINE_START(CO285, "co-EBSA285") 30MACHINE_START(CO285, "co-EBSA285")
31 MAINTAINER("Mark van Doesburg") 31 /* Maintainer: Mark van Doesburg */
32 BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0x7cf00000) 32 .phys_ram = 0x00000000,
33 FIXUP(fixup_coebsa285) 33 .phys_io = DC21285_ARMCSR_BASE,
34 MAPIO(footbridge_map_io) 34 .io_pg_offst = ((0x7cf00000) >> 18) & 0xfffc,
35 INITIRQ(footbridge_init_irq) 35 .fixup = fixup_coebsa285,
36 .map_io = footbridge_map_io,
37 .init_irq = footbridge_init_irq,
36 .timer = &footbridge_timer, 38 .timer = &footbridge_timer,
37MACHINE_END 39MACHINE_END
38 40
diff --git a/arch/arm/mach-footbridge/ebsa285.c b/arch/arm/mach-footbridge/ebsa285.c
index d0931f5a63c8..1c37605268d5 100644
--- a/arch/arm/mach-footbridge/ebsa285.c
+++ b/arch/arm/mach-footbridge/ebsa285.c
@@ -13,12 +13,15 @@
13#include "common.h" 13#include "common.h"
14 14
15MACHINE_START(EBSA285, "EBSA285") 15MACHINE_START(EBSA285, "EBSA285")
16 MAINTAINER("Russell King") 16 /* Maintainer: Russell King */
17 BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000) 17 .phys_ram = 0x00000000,
18 BOOT_PARAMS(0x00000100) 18 .phys_io = DC21285_ARMCSR_BASE,
19 VIDEO(0x000a0000, 0x000bffff) 19 .io_pg_offst = ((0xfe000000) >> 18) & 0xfffc,
20 MAPIO(footbridge_map_io) 20 .boot_params = 0x00000100,
21 INITIRQ(footbridge_init_irq) 21 .video_start = 0x000a0000,
22 .video_end = 0x000bffff,
23 .map_io = footbridge_map_io,
24 .init_irq = footbridge_init_irq,
22 .timer = &footbridge_timer, 25 .timer = &footbridge_timer,
23MACHINE_END 26MACHINE_END
24 27
diff --git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c
index 1e1dfd79f4fe..775f85fc8513 100644
--- a/arch/arm/mach-footbridge/netwinder-hw.c
+++ b/arch/arm/mach-footbridge/netwinder-hw.c
@@ -647,14 +647,17 @@ fixup_netwinder(struct machine_desc *desc, struct tag *tags,
647} 647}
648 648
649MACHINE_START(NETWINDER, "Rebel-NetWinder") 649MACHINE_START(NETWINDER, "Rebel-NetWinder")
650 MAINTAINER("Russell King/Rebel.com") 650 /* Maintainer: Russell King/Rebel.com */
651 BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000) 651 .phys_ram = 0x00000000,
652 BOOT_PARAMS(0x00000100) 652 .phys_io = DC21285_ARMCSR_BASE,
653 VIDEO(0x000a0000, 0x000bffff) 653 .io_pg_offst = ((0xfe000000) >> 18) & 0xfffc,
654 DISABLE_PARPORT(0) 654 .boot_params = 0x00000100,
655 DISABLE_PARPORT(2) 655 .video_start = 0x000a0000,
656 FIXUP(fixup_netwinder) 656 .video_end = 0x000bffff,
657 MAPIO(footbridge_map_io) 657 .reserve_lp0 = 1,
658 INITIRQ(footbridge_init_irq) 658 .reserve_lp2 = 1,
659 .fixup = fixup_netwinder,
660 .map_io = footbridge_map_io,
661 .init_irq = footbridge_init_irq,
659 .timer = &isa_timer, 662 .timer = &isa_timer,
660MACHINE_END 663MACHINE_END
diff --git a/arch/arm/mach-footbridge/personal.c b/arch/arm/mach-footbridge/personal.c
index 415086d7bbee..0146b8bb59da 100644
--- a/arch/arm/mach-footbridge/personal.c
+++ b/arch/arm/mach-footbridge/personal.c
@@ -13,11 +13,13 @@
13#include "common.h" 13#include "common.h"
14 14
15MACHINE_START(PERSONAL_SERVER, "Compaq-PersonalServer") 15MACHINE_START(PERSONAL_SERVER, "Compaq-PersonalServer")
16 MAINTAINER("Jamey Hicks / George France") 16 /* Maintainer: Jamey Hicks / George France */
17 BOOT_MEM(0x00000000, DC21285_ARMCSR_BASE, 0xfe000000) 17 .phys_ram = 0x00000000,
18 BOOT_PARAMS(0x00000100) 18 .phys_io = DC21285_ARMCSR_BASE,
19 MAPIO(footbridge_map_io) 19 .io_pg_offst = ((0xfe000000) >> 18) & 0xfffc,
20 INITIRQ(footbridge_init_irq) 20 .boot_params = 0x00000100,
21 .map_io = footbridge_map_io,
22 .init_irq = footbridge_init_irq,
21 .timer = &footbridge_timer, 23 .timer = &footbridge_timer,
22MACHINE_END 24MACHINE_END
23 25
diff --git a/arch/arm/mach-h720x/h7201-eval.c b/arch/arm/mach-h720x/h7201-eval.c
index 9b24b9b0db15..fa59e9e2a5c8 100644
--- a/arch/arm/mach-h720x/h7201-eval.c
+++ b/arch/arm/mach-h720x/h7201-eval.c
@@ -30,10 +30,12 @@
30#include "common.h" 30#include "common.h"
31 31
32MACHINE_START(H7201, "Hynix GMS30C7201") 32MACHINE_START(H7201, "Hynix GMS30C7201")
33 MAINTAINER("Robert Schwebel, Pengutronix") 33 /* Maintainer: Robert Schwebel, Pengutronix */
34 BOOT_MEM(0x40000000, 0x80000000, 0xf0000000) 34 .phys_ram = 0x40000000,
35 BOOT_PARAMS(0xc0001000) 35 .phys_io = 0x80000000,
36 MAPIO(h720x_map_io) 36 .io_pg_offst = ((0xf0000000) >> 18) & 0xfffc,
37 INITIRQ(h720x_init_irq) 37 .boot_params = 0xc0001000,
38 .timer = &h7201_timer, 38 .map_io = h720x_map_io,
39 .init_irq = h720x_init_irq,
40 .timer = &h7201_timer,
39MACHINE_END 41MACHINE_END
diff --git a/arch/arm/mach-h720x/h7202-eval.c b/arch/arm/mach-h720x/h7202-eval.c
index 3456a00d5f5c..db9078ad008c 100644
--- a/arch/arm/mach-h720x/h7202-eval.c
+++ b/arch/arm/mach-h720x/h7202-eval.c
@@ -71,11 +71,13 @@ static void __init init_eval_h7202(void)
71} 71}
72 72
73MACHINE_START(H7202, "Hynix HMS30C7202") 73MACHINE_START(H7202, "Hynix HMS30C7202")
74 MAINTAINER("Robert Schwebel, Pengutronix") 74 /* Maintainer: Robert Schwebel, Pengutronix */
75 BOOT_MEM(0x40000000, 0x80000000, 0xf0000000) 75 .phys_ram = 0x40000000,
76 BOOT_PARAMS(0x40000100) 76 .phys_io = 0x80000000,
77 MAPIO(h720x_map_io) 77 .io_pg_offst = ((0xf0000000) >> 18) & 0xfffc,
78 INITIRQ(h7202_init_irq) 78 .boot_params = 0x40000100,
79 .timer = &h7202_timer, 79 .map_io = h720x_map_io,
80 INIT_MACHINE(init_eval_h7202) 80 .init_irq = h7202_init_irq,
81 .timer = &h7202_timer,
82 .init_machine = init_eval_h7202,
81MACHINE_END 83MACHINE_END
diff --git a/arch/arm/mach-imx/mx1ads.c b/arch/arm/mach-imx/mx1ads.c
index 625dd01c2578..5d25434d332c 100644
--- a/arch/arm/mach-imx/mx1ads.c
+++ b/arch/arm/mach-imx/mx1ads.c
@@ -78,11 +78,13 @@ mx1ads_map_io(void)
78} 78}
79 79
80MACHINE_START(MX1ADS, "Motorola MX1ADS") 80MACHINE_START(MX1ADS, "Motorola MX1ADS")
81 MAINTAINER("Sascha Hauer, Pengutronix") 81 /* Maintainer: Sascha Hauer, Pengutronix */
82 BOOT_MEM(0x08000000, 0x00200000, 0xe0200000) 82 .phys_ram = 0x08000000,
83 BOOT_PARAMS(0x08000100) 83 .phys_io = 0x00200000,
84 MAPIO(mx1ads_map_io) 84 .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc,
85 INITIRQ(imx_init_irq) 85 .boot_params = 0x08000100,
86 .map_io = mx1ads_map_io,
87 .init_irq = imx_init_irq,
86 .timer = &imx_timer, 88 .timer = &imx_timer,
87 INIT_MACHINE(mx1ads_init) 89 .init_machine = mx1ads_init,
88MACHINE_END 90MACHINE_END
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 91ba9fd79c87..36e2b6eb67b7 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -292,11 +292,13 @@ static struct sys_timer ap_timer = {
292}; 292};
293 293
294MACHINE_START(INTEGRATOR, "ARM-Integrator") 294MACHINE_START(INTEGRATOR, "ARM-Integrator")
295 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") 295 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
296 BOOT_MEM(0x00000000, 0x16000000, 0xf1600000) 296 .phys_ram = 0x00000000,
297 BOOT_PARAMS(0x00000100) 297 .phys_io = 0x16000000,
298 MAPIO(ap_map_io) 298 .io_pg_offst = ((0xf1600000) >> 18) & 0xfffc,
299 INITIRQ(ap_init_irq) 299 .boot_params = 0x00000100,
300 .map_io = ap_map_io,
301 .init_irq = ap_init_irq,
300 .timer = &ap_timer, 302 .timer = &ap_timer,
301 INIT_MACHINE(ap_init) 303 .init_machine = ap_init,
302MACHINE_END 304MACHINE_END
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index e0a01eef0993..569f328c479d 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -532,11 +532,13 @@ static struct sys_timer cp_timer = {
532}; 532};
533 533
534MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP") 534MACHINE_START(CINTEGRATOR, "ARM-IntegratorCP")
535 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") 535 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
536 BOOT_MEM(0x00000000, 0x16000000, 0xf1600000) 536 .phys_ram = 0x00000000,
537 BOOT_PARAMS(0x00000100) 537 .phys_io = 0x16000000,
538 MAPIO(intcp_map_io) 538 .io_pg_offst = ((0xf1600000) >> 18) & 0xfffc,
539 INITIRQ(intcp_init_irq) 539 .boot_params = 0x00000100,
540 .map_io = intcp_map_io,
541 .init_irq = intcp_init_irq,
540 .timer = &cp_timer, 542 .timer = &cp_timer,
541 INIT_MACHINE(intcp_init) 543 .init_machine = intcp_init,
542MACHINE_END 544MACHINE_END
diff --git a/arch/arm/mach-iop3xx/iop321-setup.c b/arch/arm/mach-iop3xx/iop321-setup.c
index bf23e0fd2843..0f921ba2750c 100644
--- a/arch/arm/mach-iop3xx/iop321-setup.c
+++ b/arch/arm/mach-iop3xx/iop321-setup.c
@@ -146,23 +146,27 @@ extern void iop321_init_time(void);
146 146
147#if defined(CONFIG_ARCH_IQ80321) 147#if defined(CONFIG_ARCH_IQ80321)
148MACHINE_START(IQ80321, "Intel IQ80321") 148MACHINE_START(IQ80321, "Intel IQ80321")
149 MAINTAINER("Intel Corporation") 149 /* Maintainer: Intel Corporation */
150 BOOT_MEM(PHYS_OFFSET, IQ80321_UART, IQ80321_UART) 150 .phys_ram = PHYS_OFFSET,
151 MAPIO(iq80321_map_io) 151 .phys_io = IQ80321_UART,
152 INITIRQ(iop321_init_irq) 152 .io_pg_offst = ((IQ80321_UART) >> 18) & 0xfffc,
153 .map_io = iq80321_map_io,
154 .init_irq = iop321_init_irq,
153 .timer = &iop321_timer, 155 .timer = &iop321_timer,
154 BOOT_PARAMS(0xa0000100) 156 .boot_params = 0xa0000100,
155 INIT_MACHINE(iop32x_init) 157 .init_machine = iop32x_init,
156MACHINE_END 158MACHINE_END
157#elif defined(CONFIG_ARCH_IQ31244) 159#elif defined(CONFIG_ARCH_IQ31244)
158MACHINE_START(IQ31244, "Intel IQ31244") 160MACHINE_START(IQ31244, "Intel IQ31244")
159 MAINTAINER("Intel Corp.") 161 /* Maintainer: Intel Corp. */
160 BOOT_MEM(PHYS_OFFSET, IQ31244_UART, IQ31244_UART) 162 .phys_ram = PHYS_OFFSET,
161 MAPIO(iq31244_map_io) 163 .phys_io = IQ31244_UART,
162 INITIRQ(iop321_init_irq) 164 .io_pg_offst = ((IQ31244_UART) >> 18) & 0xfffc,
165 .map_io = iq31244_map_io,
166 .init_irq = iop321_init_irq,
163 .timer = &iop321_timer, 167 .timer = &iop321_timer,
164 BOOT_PARAMS(0xa0000100) 168 .boot_params = 0xa0000100,
165 INIT_MACHINE(iop32x_init) 169 .init_machine = iop32x_init,
166MACHINE_END 170MACHINE_END
167#else 171#else
168#error No machine descriptor defined for this IOP3XX implementation 172#error No machine descriptor defined for this IOP3XX implementation
diff --git a/arch/arm/mach-iop3xx/iop331-setup.c b/arch/arm/mach-iop3xx/iop331-setup.c
index 622e7914819a..fc74b722f72f 100644
--- a/arch/arm/mach-iop3xx/iop331-setup.c
+++ b/arch/arm/mach-iop3xx/iop331-setup.c
@@ -148,26 +148,28 @@ extern void iq80332_map_io(void);
148 148
149#if defined(CONFIG_ARCH_IQ80331) 149#if defined(CONFIG_ARCH_IQ80331)
150MACHINE_START(IQ80331, "Intel IQ80331") 150MACHINE_START(IQ80331, "Intel IQ80331")
151 MAINTAINER("Intel Corp.") 151 /* Maintainer: Intel Corp. */
152 BOOT_MEM(PHYS_OFFSET, 0xfefff000, 0xfffff000) // virtual, physical 152 .phys_ram = PHYS_OFFSET,
153 //BOOT_MEM(PHYS_OFFSET, IOP331_UART0_VIRT, IOP331_UART0_PHYS) 153 .phys_io = 0xfefff000,
154 MAPIO(iq80331_map_io) 154 .io_pg_offst = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
155 INITIRQ(iop331_init_irq) 155 .map_io = iq80331_map_io,
156 .init_irq = iop331_init_irq,
156 .timer = &iop331_timer, 157 .timer = &iop331_timer,
157 BOOT_PARAMS(0x0100) 158 .boot_params = 0x0100,
158 INIT_MACHINE(iop33x_init) 159 .init_machine = iop33x_init,
159MACHINE_END 160MACHINE_END
160 161
161#elif defined(CONFIG_MACH_IQ80332) 162#elif defined(CONFIG_MACH_IQ80332)
162MACHINE_START(IQ80332, "Intel IQ80332") 163MACHINE_START(IQ80332, "Intel IQ80332")
163 MAINTAINER("Intel Corp.") 164 /* Maintainer: Intel Corp. */
164 BOOT_MEM(PHYS_OFFSET, 0xfefff000, 0xfffff000) // virtual, physical 165 .phys_ram = PHYS_OFFSET,
165 //BOOT_MEM(PHYS_OFFSET, IOP331_UART0_VIRT, IOP331_UART0_PHYS) 166 .phys_io = 0xfefff000,
166 MAPIO(iq80332_map_io) 167 .io_pg_offst = ((0xfffff000) >> 18) & 0xfffc, // virtual, physical
167 INITIRQ(iop331_init_irq) 168 .map_io = iq80332_map_io,
169 .init_irq = iop331_init_irq,
168 .timer = &iop331_timer, 170 .timer = &iop331_timer,
169 BOOT_PARAMS(0x0100) 171 .boot_params = 0x0100,
170 INIT_MACHINE(iop33x_init) 172 .init_machine = iop33x_init,
171MACHINE_END 173MACHINE_END
172 174
173#else 175#else
diff --git a/arch/arm/mach-ixp2000/enp2611.c b/arch/arm/mach-ixp2000/enp2611.c
index f3a291b6a9fb..b7ebf3898fc5 100644
--- a/arch/arm/mach-ixp2000/enp2611.c
+++ b/arch/arm/mach-ixp2000/enp2611.c
@@ -223,13 +223,15 @@ static void __init enp2611_init_machine(void)
223 223
224 224
225MACHINE_START(ENP2611, "Radisys ENP-2611 PCI network processor board") 225MACHINE_START(ENP2611, "Radisys ENP-2611 PCI network processor board")
226 MAINTAINER("Lennert Buytenhek <buytenh@wantstofly.org>") 226 /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
227 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE) 227 .phys_ram = 0x00000000,
228 BOOT_PARAMS(0x00000100) 228 .phys_io = IXP2000_UART_PHYS_BASE,
229 MAPIO(ixp2000_map_io) 229 .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
230 INITIRQ(ixp2000_init_irq) 230 .boot_params = 0x00000100,
231 .map_io = ixp2000_map_io,
232 .init_irq = ixp2000_init_irq,
231 .timer = &enp2611_timer, 233 .timer = &enp2611_timer,
232 INIT_MACHINE(enp2611_init_machine) 234 .init_machine = enp2611_init_machine,
233MACHINE_END 235MACHINE_END
234 236
235 237
diff --git a/arch/arm/mach-ixp2000/ixdp2400.c b/arch/arm/mach-ixp2000/ixdp2400.c
index df3ff26c8cdd..fd280a93637e 100644
--- a/arch/arm/mach-ixp2000/ixdp2400.c
+++ b/arch/arm/mach-ixp2000/ixdp2400.c
@@ -168,12 +168,14 @@ void ixdp2400_init_irq(void)
168} 168}
169 169
170MACHINE_START(IXDP2400, "Intel IXDP2400 Development Platform") 170MACHINE_START(IXDP2400, "Intel IXDP2400 Development Platform")
171 MAINTAINER("MontaVista Software, Inc.") 171 /* Maintainer: MontaVista Software, Inc. */
172 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE) 172 .phys_ram = 0x00000000,
173 BOOT_PARAMS(0x00000100) 173 .phys_io = IXP2000_UART_PHYS_BASE,
174 MAPIO(ixdp2x00_map_io) 174 .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
175 INITIRQ(ixdp2400_init_irq) 175 .boot_params = 0x00000100,
176 .map_io = ixdp2x00_map_io,
177 .init_irq = ixdp2400_init_irq,
176 .timer = &ixdp2400_timer, 178 .timer = &ixdp2400_timer,
177 INIT_MACHINE(ixdp2x00_init_machine) 179 .init_machine = ixdp2x00_init_machine,
178MACHINE_END 180MACHINE_END
179 181
diff --git a/arch/arm/mach-ixp2000/ixdp2800.c b/arch/arm/mach-ixp2000/ixdp2800.c
index 468a4bbfb724..f9073aa28615 100644
--- a/arch/arm/mach-ixp2000/ixdp2800.c
+++ b/arch/arm/mach-ixp2000/ixdp2800.c
@@ -284,12 +284,14 @@ void ixdp2800_init_irq(void)
284} 284}
285 285
286MACHINE_START(IXDP2800, "Intel IXDP2800 Development Platform") 286MACHINE_START(IXDP2800, "Intel IXDP2800 Development Platform")
287 MAINTAINER("MontaVista Software, Inc.") 287 /* Maintainer: MontaVista Software, Inc. */
288 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE) 288 .phys_ram = 0x00000000,
289 BOOT_PARAMS(0x00000100) 289 .phys_io = IXP2000_UART_PHYS_BASE,
290 MAPIO(ixdp2x00_map_io) 290 .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
291 INITIRQ(ixdp2800_init_irq) 291 .boot_params = 0x00000100,
292 .map_io = ixdp2x00_map_io,
293 .init_irq = ixdp2800_init_irq,
292 .timer = &ixdp2800_timer, 294 .timer = &ixdp2800_timer,
293 INIT_MACHINE(ixdp2x00_init_machine) 295 .init_machine = ixdp2x00_init_machine,
294MACHINE_END 296MACHINE_END
295 297
diff --git a/arch/arm/mach-ixp2000/ixdp2x01.c b/arch/arm/mach-ixp2000/ixdp2x01.c
index e94dace3d412..c73588743ee1 100644
--- a/arch/arm/mach-ixp2000/ixdp2x01.c
+++ b/arch/arm/mach-ixp2000/ixdp2x01.c
@@ -375,25 +375,29 @@ static void __init ixdp2x01_init_machine(void)
375 375
376#ifdef CONFIG_ARCH_IXDP2401 376#ifdef CONFIG_ARCH_IXDP2401
377MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform") 377MACHINE_START(IXDP2401, "Intel IXDP2401 Development Platform")
378 MAINTAINER("MontaVista Software, Inc.") 378 /* Maintainer: MontaVista Software, Inc. */
379 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE) 379 .phys_ram = 0x00000000,
380 BOOT_PARAMS(0x00000100) 380 .phys_io = IXP2000_UART_PHYS_BASE,
381 MAPIO(ixdp2x01_map_io) 381 .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
382 INITIRQ(ixdp2x01_init_irq) 382 .boot_params = 0x00000100,
383 .map_io = ixdp2x01_map_io,
384 .init_irq = ixdp2x01_init_irq,
383 .timer = &ixdp2x01_timer, 385 .timer = &ixdp2x01_timer,
384 INIT_MACHINE(ixdp2x01_init_machine) 386 .init_machine = ixdp2x01_init_machine,
385MACHINE_END 387MACHINE_END
386#endif 388#endif
387 389
388#ifdef CONFIG_ARCH_IXDP2801 390#ifdef CONFIG_ARCH_IXDP2801
389MACHINE_START(IXDP2801, "Intel IXDP2801 Development Platform") 391MACHINE_START(IXDP2801, "Intel IXDP2801 Development Platform")
390 MAINTAINER("MontaVista Software, Inc.") 392 /* Maintainer: MontaVista Software, Inc. */
391 BOOT_MEM(0x00000000, IXP2000_UART_PHYS_BASE, IXP2000_UART_VIRT_BASE) 393 .phys_ram = 0x00000000,
392 BOOT_PARAMS(0x00000100) 394 .phys_io = IXP2000_UART_PHYS_BASE,
393 MAPIO(ixdp2x01_map_io) 395 .io_pg_offst = ((IXP2000_UART_VIRT_BASE) >> 18) & 0xfffc,
394 INITIRQ(ixdp2x01_init_irq) 396 .boot_params = 0x00000100,
397 .map_io = ixdp2x01_map_io,
398 .init_irq = ixdp2x01_init_irq,
395 .timer = &ixdp2x01_timer, 399 .timer = &ixdp2x01_timer,
396 INIT_MACHINE(ixdp2x01_init_machine) 400 .init_machine = ixdp2x01_init_machine,
397MACHINE_END 401MACHINE_END
398#endif 402#endif
399 403
diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c
index 8a05a1227e5f..c6335f51907d 100644
--- a/arch/arm/mach-ixp4xx/coyote-setup.c
+++ b/arch/arm/mach-ixp4xx/coyote-setup.c
@@ -100,14 +100,15 @@ static void __init coyote_init(void)
100 100
101#ifdef CONFIG_ARCH_ADI_COYOTE 101#ifdef CONFIG_ARCH_ADI_COYOTE
102MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote") 102MACHINE_START(ADI_COYOTE, "ADI Engineering Coyote")
103 MAINTAINER("MontaVista Software, Inc.") 103 /* Maintainer: MontaVista Software, Inc. */
104 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, 104 .phys_ram = PHYS_OFFSET,
105 IXP4XX_PERIPHERAL_BASE_VIRT) 105 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
106 MAPIO(coyote_map_io) 106 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
107 INITIRQ(ixp4xx_init_irq) 107 .map_io = coyote_map_io,
108 .init_irq = ixp4xx_init_irq,
108 .timer = &ixp4xx_timer, 109 .timer = &ixp4xx_timer,
109 BOOT_PARAMS(0x0100) 110 .boot_params = 0x0100,
110 INIT_MACHINE(coyote_init) 111 .init_machine = coyote_init,
111MACHINE_END 112MACHINE_END
112#endif 113#endif
113 114
@@ -117,14 +118,15 @@ MACHINE_END
117 */ 118 */
118#ifdef CONFIG_MACH_IXDPG425 119#ifdef CONFIG_MACH_IXDPG425
119MACHINE_START(IXDPG425, "Intel IXDPG425") 120MACHINE_START(IXDPG425, "Intel IXDPG425")
120 MAINTAINER("MontaVista Software, Inc.") 121 /* Maintainer: MontaVista Software, Inc. */
121 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, 122 .phys_ram = PHYS_OFFSET,
122 IXP4XX_PERIPHERAL_BASE_VIRT) 123 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
123 MAPIO(coyote_map_io) 124 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
124 INITIRQ(ixp4xx_init_irq) 125 .map_io = coyote_map_io,
126 .init_irq = ixp4xx_init_irq,
125 .timer = &ixp4xx_timer, 127 .timer = &ixp4xx_timer,
126 BOOT_PARAMS(0x0100) 128 .boot_params = 0x0100,
127 INIT_MACHINE(coyote_init) 129 .init_machine = coyote_init,
128MACHINE_END 130MACHINE_END
129#endif 131#endif
130 132
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
index e77c86efd21d..8ba1cd9406e7 100644
--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
@@ -140,14 +140,15 @@ static void __init gtwx5715_init(void)
140 140
141 141
142MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)") 142MACHINE_START(GTWX5715, "Gemtek GTWX5715 (Linksys WRV54G)")
143 MAINTAINER("George Joseph") 143 /* Maintainer: George Joseph */
144 BOOT_MEM(PHYS_OFFSET, IXP4XX_UART2_BASE_PHYS, 144 .phys_ram = PHYS_OFFSET,
145 IXP4XX_UART2_BASE_VIRT) 145 .phys_io = IXP4XX_UART2_BASE_PHYS,
146 MAPIO(gtwx5715_map_io) 146 .io_pg_offst = ((IXP4XX_UART2_BASE_VIRT) >> 18) & 0xfffc,
147 INITIRQ(ixp4xx_init_irq) 147 .map_io = gtwx5715_map_io,
148 .timer = &ixp4xx_timer, 148 .init_irq = ixp4xx_init_irq,
149 BOOT_PARAMS(0x0100) 149 .timer = &ixp4xx_timer,
150 INIT_MACHINE(gtwx5715_init) 150 .boot_params = 0x0100,
151 .init_machine = gtwx5715_init,
151MACHINE_END 152MACHINE_END
152 153
153 154
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index 77346c1f676b..f2e9c0ea0501 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -128,36 +128,39 @@ static void __init ixdp425_init(void)
128} 128}
129 129
130MACHINE_START(IXDP425, "Intel IXDP425 Development Platform") 130MACHINE_START(IXDP425, "Intel IXDP425 Development Platform")
131 MAINTAINER("MontaVista Software, Inc.") 131 /* Maintainer: MontaVista Software, Inc. */
132 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, 132 .phys_ram = PHYS_OFFSET,
133 IXP4XX_PERIPHERAL_BASE_VIRT) 133 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
134 MAPIO(ixdp425_map_io) 134 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
135 INITIRQ(ixp4xx_init_irq) 135 .map_io = ixdp425_map_io,
136 .init_irq = ixp4xx_init_irq,
136 .timer = &ixp4xx_timer, 137 .timer = &ixp4xx_timer,
137 BOOT_PARAMS(0x0100) 138 .boot_params = 0x0100,
138 INIT_MACHINE(ixdp425_init) 139 .init_machine = ixdp425_init,
139MACHINE_END 140MACHINE_END
140 141
141MACHINE_START(IXDP465, "Intel IXDP465 Development Platform") 142MACHINE_START(IXDP465, "Intel IXDP465 Development Platform")
142 MAINTAINER("MontaVista Software, Inc.") 143 /* Maintainer: MontaVista Software, Inc. */
143 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, 144 .phys_ram = PHYS_OFFSET,
144 IXP4XX_PERIPHERAL_BASE_VIRT) 145 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
145 MAPIO(ixdp425_map_io) 146 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
146 INITIRQ(ixp4xx_init_irq) 147 .map_io = ixdp425_map_io,
148 .init_irq = ixp4xx_init_irq,
147 .timer = &ixp4xx_timer, 149 .timer = &ixp4xx_timer,
148 BOOT_PARAMS(0x0100) 150 .boot_params = 0x0100,
149 INIT_MACHINE(ixdp425_init) 151 .init_machine = ixdp425_init,
150MACHINE_END 152MACHINE_END
151 153
152MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform") 154MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
153 MAINTAINER("MontaVista Software, Inc.") 155 /* Maintainer: MontaVista Software, Inc. */
154 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, 156 .phys_ram = PHYS_OFFSET,
155 IXP4XX_PERIPHERAL_BASE_VIRT) 157 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
156 MAPIO(ixdp425_map_io) 158 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
157 INITIRQ(ixp4xx_init_irq) 159 .map_io = ixdp425_map_io,
160 .init_irq = ixp4xx_init_irq,
158 .timer = &ixp4xx_timer, 161 .timer = &ixp4xx_timer,
159 BOOT_PARAMS(0x0100) 162 .boot_params = 0x0100,
160 INIT_MACHINE(ixdp425_init) 163 .init_machine = ixdp425_init,
161MACHINE_END 164MACHINE_END
162 165
163/* 166/*
@@ -168,14 +171,15 @@ MACHINE_END
168 */ 171 */
169#ifdef CONFIG_ARCH_AVILA 172#ifdef CONFIG_ARCH_AVILA
170MACHINE_START(AVILA, "Gateworks Avila Network Platform") 173MACHINE_START(AVILA, "Gateworks Avila Network Platform")
171 MAINTAINER("Deepak Saxena <dsaxena@plexity.net>") 174 /* Maintainer: Deepak Saxena <dsaxena@plexity.net> */
172 BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, 175 .phys_ram = PHYS_OFFSET,
173 IXP4XX_PERIPHERAL_BASE_VIRT) 176 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
174 MAPIO(ixdp425_map_io) 177 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
175 INITIRQ(ixp4xx_init_irq) 178 .map_io = ixdp425_map_io,
179 .init_irq = ixp4xx_init_irq,
176 .timer = &ixp4xx_timer, 180 .timer = &ixp4xx_timer,
177 BOOT_PARAMS(0x0100) 181 .boot_params = 0x0100,
178 INIT_MACHINE(ixdp425_init) 182 .init_machine = ixdp425_init,
179MACHINE_END 183MACHINE_END
180#endif 184#endif
181 185
diff --git a/arch/arm/mach-l7200/core.c b/arch/arm/mach-l7200/core.c
index 606ca95f8217..2a7fee2a7635 100644
--- a/arch/arm/mach-l7200/core.c
+++ b/arch/arm/mach-l7200/core.c
@@ -81,9 +81,11 @@ static void __init l7200_map_io(void)
81} 81}
82 82
83MACHINE_START(L7200, "LinkUp Systems L7200") 83MACHINE_START(L7200, "LinkUp Systems L7200")
84 MAINTAINER("Steve Hill / Scott McConnell") 84 /* Maintainer: Steve Hill / Scott McConnell */
85 BOOT_MEM(0xf0000000, 0x80040000, 0xd0000000) 85 .phys_ram = 0xf0000000,
86 MAPIO(l7200_map_io) 86 .phys_io = 0x80040000,
87 INITIRQ(l7200_init_irq) 87 .io_pg_offst = ((0xd0000000) >> 18) & 0xfffc,
88 .map_io = l7200_map_io,
89 .init_irq = l7200_init_irq,
88MACHINE_END 90MACHINE_END
89 91
diff --git a/arch/arm/mach-lh7a40x/arch-kev7a400.c b/arch/arm/mach-lh7a40x/arch-kev7a400.c
index be5d17fe9dcb..cb3dcd3bd00a 100644
--- a/arch/arm/mach-lh7a40x/arch-kev7a400.c
+++ b/arch/arm/mach-lh7a40x/arch-kev7a400.c
@@ -102,10 +102,12 @@ void __init lh7a40x_init_board_irq (void)
102} 102}
103 103
104MACHINE_START (KEV7A400, "Sharp KEV7a400") 104MACHINE_START (KEV7A400, "Sharp KEV7a400")
105 MAINTAINER ("Marc Singer") 105 /* Maintainer: Marc Singer */
106 BOOT_MEM (0xc0000000, 0x80000000, io_p2v (0x80000000)) 106 .phys_ram = 0xc0000000,
107 BOOT_PARAMS (0xc0000100) 107 .phys_io = 0x80000000,
108 MAPIO (kev7a400_map_io) 108 .io_pg_offst = ((io_p2v (0x80000000))>>18) & 0xfffc,
109 INITIRQ (lh7a400_init_irq) 109 .boot_params = 0xc0000100,
110 .map_io = kev7a400_map_io,
111 .init_irq = lh7a400_init_irq,
110 .timer = &lh7a40x_timer, 112 .timer = &lh7a40x_timer,
111MACHINE_END 113MACHINE_END
diff --git a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
index c823447a150f..6eb61a17c63b 100644
--- a/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
+++ b/arch/arm/mach-lh7a40x/arch-lpd7a40x.c
@@ -260,13 +260,15 @@ lpd7a400_map_io(void)
260#ifdef CONFIG_MACH_LPD7A400 260#ifdef CONFIG_MACH_LPD7A400
261 261
262MACHINE_START (LPD7A400, "Logic Product Development LPD7A400-10") 262MACHINE_START (LPD7A400, "Logic Product Development LPD7A400-10")
263 MAINTAINER ("Marc Singer") 263 /* Maintainer: Marc Singer */
264 BOOT_MEM (0xc0000000, 0x80000000, io_p2v (0x80000000)) 264 .phys_ram = 0xc0000000,
265 BOOT_PARAMS (0xc0000100) 265 .phys_io = 0x80000000,
266 MAPIO (lpd7a400_map_io) 266 .io_pg_offst = ((io_p2v (0x80000000))>>18) & 0xfffc,
267 INITIRQ (lh7a400_init_irq) 267 .boot_params = 0xc0000100,
268 .map_io = lpd7a400_map_io,
269 .init_irq = lh7a400_init_irq,
268 .timer = &lh7a40x_timer, 270 .timer = &lh7a40x_timer,
269 INIT_MACHINE (lpd7a40x_init) 271 .init_machine = lpd7a40x_init,
270MACHINE_END 272MACHINE_END
271 273
272#endif 274#endif
@@ -274,13 +276,15 @@ MACHINE_END
274#ifdef CONFIG_MACH_LPD7A404 276#ifdef CONFIG_MACH_LPD7A404
275 277
276MACHINE_START (LPD7A404, "Logic Product Development LPD7A404-10") 278MACHINE_START (LPD7A404, "Logic Product Development LPD7A404-10")
277 MAINTAINER ("Marc Singer") 279 /* Maintainer: Marc Singer */
278 BOOT_MEM (0xc0000000, 0x80000000, io_p2v (0x80000000)) 280 .phys_ram = 0xc0000000,
279 BOOT_PARAMS (0xc0000100) 281 .phys_io = 0x80000000,
280 MAPIO (lpd7a400_map_io) 282 .io_pg_offst = ((io_p2v (0x80000000))>>18) & 0xfffc,
281 INITIRQ (lh7a404_init_irq) 283 .boot_params = 0xc0000100,
284 .map_io = lpd7a400_map_io,
285 .init_irq = lh7a404_init_irq,
282 .timer = &lh7a40x_timer, 286 .timer = &lh7a40x_timer,
283 INIT_MACHINE (lpd7a40x_init) 287 .init_machine = lpd7a40x_init,
284MACHINE_END 288MACHINE_END
285 289
286#endif 290#endif
diff --git a/arch/arm/mach-omap/board-generic.c b/arch/arm/mach-omap/board-generic.c
index 2102a2cd1013..384bc7cec1db 100644
--- a/arch/arm/mach-omap/board-generic.c
+++ b/arch/arm/mach-omap/board-generic.c
@@ -88,11 +88,13 @@ static void __init omap_generic_map_io(void)
88} 88}
89 89
90MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710") 90MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710")
91 MAINTAINER("Tony Lindgren <tony@atomide.com>") 91 /* Maintainer: Tony Lindgren <tony@atomide.com> */
92 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 92 .phys_ram = 0x10000000,
93 BOOT_PARAMS(0x10000100) 93 .phys_io = 0xfff00000,
94 MAPIO(omap_generic_map_io) 94 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
95 INITIRQ(omap_generic_init_irq) 95 .boot_params = 0x10000100,
96 INIT_MACHINE(omap_generic_init) 96 .map_io = omap_generic_map_io,
97 .init_irq = omap_generic_init_irq,
98 .init_machine = omap_generic_init,
97 .timer = &omap_timer, 99 .timer = &omap_timer,
98MACHINE_END 100MACHINE_END
diff --git a/arch/arm/mach-omap/board-h2.c b/arch/arm/mach-omap/board-h2.c
index 1f067830d1fc..f37c76a9b163 100644
--- a/arch/arm/mach-omap/board-h2.c
+++ b/arch/arm/mach-omap/board-h2.c
@@ -177,11 +177,13 @@ static void __init h2_map_io(void)
177} 177}
178 178
179MACHINE_START(OMAP_H2, "TI-H2") 179MACHINE_START(OMAP_H2, "TI-H2")
180 MAINTAINER("Imre Deak <imre.deak@nokia.com>") 180 /* Maintainer: Imre Deak <imre.deak@nokia.com> */
181 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 181 .phys_ram = 0x10000000,
182 BOOT_PARAMS(0x10000100) 182 .phys_io = 0xfff00000,
183 MAPIO(h2_map_io) 183 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
184 INITIRQ(h2_init_irq) 184 .boot_params = 0x10000100,
185 INIT_MACHINE(h2_init) 185 .map_io = h2_map_io,
186 .init_irq = h2_init_irq,
187 .init_machine = h2_init,
186 .timer = &omap_timer, 188 .timer = &omap_timer,
187MACHINE_END 189MACHINE_END
diff --git a/arch/arm/mach-omap/board-h3.c b/arch/arm/mach-omap/board-h3.c
index 486a5a006c9a..705e48594e9a 100644
--- a/arch/arm/mach-omap/board-h3.c
+++ b/arch/arm/mach-omap/board-h3.c
@@ -195,11 +195,13 @@ static void __init h3_map_io(void)
195} 195}
196 196
197MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board") 197MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
198 MAINTAINER("Texas Instruments, Inc.") 198 /* Maintainer: Texas Instruments, Inc. */
199 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 199 .phys_ram = 0x10000000,
200 BOOT_PARAMS(0x10000100) 200 .phys_io = 0xfff00000,
201 MAPIO(h3_map_io) 201 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
202 INITIRQ(h3_init_irq) 202 .boot_params = 0x10000100,
203 INIT_MACHINE(h3_init) 203 .map_io = h3_map_io,
204 .init_irq = h3_init_irq,
205 .init_machine = h3_init,
204 .timer = &omap_timer, 206 .timer = &omap_timer,
205MACHINE_END 207MACHINE_END
diff --git a/arch/arm/mach-omap/board-innovator.c b/arch/arm/mach-omap/board-innovator.c
index 57cf4da88d55..523363f18cc0 100644
--- a/arch/arm/mach-omap/board-innovator.c
+++ b/arch/arm/mach-omap/board-innovator.c
@@ -270,11 +270,13 @@ static void __init innovator_map_io(void)
270} 270}
271 271
272MACHINE_START(OMAP_INNOVATOR, "TI-Innovator") 272MACHINE_START(OMAP_INNOVATOR, "TI-Innovator")
273 MAINTAINER("MontaVista Software, Inc.") 273 /* Maintainer: MontaVista Software, Inc. */
274 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 274 .phys_ram = 0x10000000,
275 BOOT_PARAMS(0x10000100) 275 .phys_io = 0xfff00000,
276 MAPIO(innovator_map_io) 276 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
277 INITIRQ(innovator_init_irq) 277 .boot_params = 0x10000100,
278 INIT_MACHINE(innovator_init) 278 .map_io = innovator_map_io,
279 .init_irq = innovator_init_irq,
280 .init_machine = innovator_init,
279 .timer = &omap_timer, 281 .timer = &omap_timer,
280MACHINE_END 282MACHINE_END
diff --git a/arch/arm/mach-omap/board-netstar.c b/arch/arm/mach-omap/board-netstar.c
index 54acbd215c4b..8c653734d5a3 100644
--- a/arch/arm/mach-omap/board-netstar.c
+++ b/arch/arm/mach-omap/board-netstar.c
@@ -141,11 +141,13 @@ static int __init netstar_late_init(void)
141postcore_initcall(netstar_late_init); 141postcore_initcall(netstar_late_init);
142 142
143MACHINE_START(NETSTAR, "NetStar OMAP5910") 143MACHINE_START(NETSTAR, "NetStar OMAP5910")
144 MAINTAINER("Ladislav Michl <michl@2n.cz>") 144 /* Maintainer: Ladislav Michl <michl@2n.cz> */
145 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 145 .phys_ram = 0x10000000,
146 BOOT_PARAMS(0x10000100) 146 .phys_io = 0xfff00000,
147 MAPIO(netstar_map_io) 147 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
148 INITIRQ(netstar_init_irq) 148 .boot_params = 0x10000100,
149 INIT_MACHINE(netstar_init) 149 .map_io = netstar_map_io,
150 .timer = &omap_timer, 150 .init_irq = netstar_init_irq,
151 .init_machine = netstar_init,
152 .timer = &omap_timer,
151MACHINE_END 153MACHINE_END
diff --git a/arch/arm/mach-omap/board-osk.c b/arch/arm/mach-omap/board-osk.c
index a951fc82459b..cb433436aa08 100644
--- a/arch/arm/mach-omap/board-osk.c
+++ b/arch/arm/mach-omap/board-osk.c
@@ -159,11 +159,13 @@ static void __init osk_map_io(void)
159} 159}
160 160
161MACHINE_START(OMAP_OSK, "TI-OSK") 161MACHINE_START(OMAP_OSK, "TI-OSK")
162 MAINTAINER("Dirk Behme <dirk.behme@de.bosch.com>") 162 /* Maintainer: Dirk Behme <dirk.behme@de.bosch.com> */
163 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 163 .phys_ram = 0x10000000,
164 BOOT_PARAMS(0x10000100) 164 .phys_io = 0xfff00000,
165 MAPIO(osk_map_io) 165 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
166 INITIRQ(osk_init_irq) 166 .boot_params = 0x10000100,
167 INIT_MACHINE(osk_init) 167 .map_io = osk_map_io,
168 .init_irq = osk_init_irq,
169 .init_machine = osk_init,
168 .timer = &omap_timer, 170 .timer = &omap_timer,
169MACHINE_END 171MACHINE_END
diff --git a/arch/arm/mach-omap/board-perseus2.c b/arch/arm/mach-omap/board-perseus2.c
index 64515aeb49cf..d5342043d48f 100644
--- a/arch/arm/mach-omap/board-perseus2.c
+++ b/arch/arm/mach-omap/board-perseus2.c
@@ -179,11 +179,13 @@ static void __init omap_perseus2_map_io(void)
179} 179}
180 180
181MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2") 181MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2")
182 MAINTAINER("Kevin Hilman <kjh@hilman.org>") 182 /* Maintainer: Kevin Hilman <kjh@hilman.org> */
183 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 183 .phys_ram = 0x10000000,
184 BOOT_PARAMS(0x10000100) 184 .phys_io = 0xfff00000,
185 MAPIO(omap_perseus2_map_io) 185 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
186 INITIRQ(omap_perseus2_init_irq) 186 .boot_params = 0x10000100,
187 INIT_MACHINE(omap_perseus2_init) 187 .map_io = omap_perseus2_map_io,
188 .init_irq = omap_perseus2_init_irq,
189 .init_machine = omap_perseus2_init,
188 .timer = &omap_timer, 190 .timer = &omap_timer,
189MACHINE_END 191MACHINE_END
diff --git a/arch/arm/mach-omap/board-voiceblue.c b/arch/arm/mach-omap/board-voiceblue.c
index f1a5bffac666..6b0c5003d719 100644
--- a/arch/arm/mach-omap/board-voiceblue.c
+++ b/arch/arm/mach-omap/board-voiceblue.c
@@ -246,11 +246,13 @@ EXPORT_SYMBOL(voiceblue_wdt_disable);
246EXPORT_SYMBOL(voiceblue_wdt_ping); 246EXPORT_SYMBOL(voiceblue_wdt_ping);
247 247
248MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910") 248MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910")
249 MAINTAINER("Ladislav Michl <michl@2n.cz>") 249 /* Maintainer: Ladislav Michl <michl@2n.cz> */
250 BOOT_MEM(0x10000000, 0xfff00000, 0xfef00000) 250 .phys_ram = 0x10000000,
251 BOOT_PARAMS(0x10000100) 251 .phys_io = 0xfff00000,
252 MAPIO(voiceblue_map_io) 252 .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
253 INITIRQ(voiceblue_init_irq) 253 .boot_params = 0x10000100,
254 INIT_MACHINE(voiceblue_init) 254 .map_io = voiceblue_map_io,
255 .timer = &omap_timer, 255 .init_irq = voiceblue_init_irq,
256 .init_machine = voiceblue_init,
257 .timer = &omap_timer,
256MACHINE_END 258MACHINE_END
diff --git a/arch/arm/mach-omap/usb.c b/arch/arm/mach-omap/usb.c
index 7f37857b1a28..fd483ff9f8fe 100644
--- a/arch/arm/mach-omap/usb.c
+++ b/arch/arm/mach-omap/usb.c
@@ -41,7 +41,6 @@
41 41
42/* These routines should handle the standard chip-specific modes 42/* These routines should handle the standard chip-specific modes
43 * for usb0/1/2 ports, covering basic mux and transceiver setup. 43 * for usb0/1/2 ports, covering basic mux and transceiver setup.
44 * Call omap_usb_init() once, from INIT_MACHINE().
45 * 44 *
46 * Some board-*.c files will need to set up additional mux options, 45 * Some board-*.c files will need to set up additional mux options,
47 * like for suspend handling, vbus sensing, GPIOs, and the D+ pullup. 46 * like for suspend handling, vbus sensing, GPIOs, and the D+ pullup.
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index c4e6d2523585..efc2f657184e 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -24,3 +24,7 @@ obj-$(CONFIG_LEDS) += $(led-y)
24 24
25# Misc features 25# Misc features
26obj-$(CONFIG_PM) += pm.o sleep.o 26obj-$(CONFIG_PM) += pm.o sleep.o
27
28ifeq ($(CONFIG_PXA27x),y)
29obj-$(CONFIG_PM) += standby.o
30endif
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index f691cf77d390..276431bf1ce7 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -287,34 +287,40 @@ static void __init corgi_map_io(void)
287 287
288#ifdef CONFIG_MACH_CORGI 288#ifdef CONFIG_MACH_CORGI
289MACHINE_START(CORGI, "SHARP Corgi") 289MACHINE_START(CORGI, "SHARP Corgi")
290 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) 290 .phys_ram = 0xa0000000,
291 FIXUP(fixup_corgi) 291 .phys_io = 0x40000000,
292 MAPIO(corgi_map_io) 292 .io_pg_offst = ((io_p2v(0x40000000) >> 18) & 0xfffc,)
293 INITIRQ(corgi_init_irq) 293 .fixup = fixup_corgi,
294 .init_machine = corgi_init, 294 .map_io = corgi_map_io,
295 .timer = &pxa_timer, 295 .init_irq = corgi_init_irq,
296 .init_machine = corgi_init,
297 .timer = &pxa_timer,
296MACHINE_END 298MACHINE_END
297#endif 299#endif
298 300
299#ifdef CONFIG_MACH_SHEPHERD 301#ifdef CONFIG_MACH_SHEPHERD
300MACHINE_START(SHEPHERD, "SHARP Shepherd") 302MACHINE_START(SHEPHERD, "SHARP Shepherd")
301 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) 303 .phys_ram = 0xa0000000,
302 FIXUP(fixup_corgi) 304 .phys_io = 0x40000000,
303 MAPIO(corgi_map_io) 305 .io_pg_offst = ((io_p2v(0x40000000) >> 18) & 0xfffc,)
304 INITIRQ(corgi_init_irq) 306 .fixup = fixup_corgi,
305 .init_machine = corgi_init, 307 .map_io = corgi_map_io,
306 .timer = &pxa_timer, 308 .init_irq = corgi_init_irq,
309 .init_machine = corgi_init,
310 .timer = &pxa_timer,
307MACHINE_END 311MACHINE_END
308#endif 312#endif
309 313
310#ifdef CONFIG_MACH_HUSKY 314#ifdef CONFIG_MACH_HUSKY
311MACHINE_START(HUSKY, "SHARP Husky") 315MACHINE_START(HUSKY, "SHARP Husky")
312 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) 316 .phys_ram = 0xa0000000,
313 FIXUP(fixup_corgi) 317 .phys_io = 0x40000000,
314 MAPIO(corgi_map_io) 318 .io_pg_offst = ((io_p2v(0x40000000) >> 18) & 0xfffc,)
315 INITIRQ(corgi_init_irq) 319 .fixup = fixup_corgi,
316 .init_machine = corgi_init, 320 .map_io = corgi_map_io,
317 .timer = &pxa_timer, 321 .init_irq = corgi_init_irq,
322 .init_machine = corgi_init,
323 .timer = &pxa_timer,
318MACHINE_END 324MACHINE_END
319#endif 325#endif
320 326
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
index c5a66bf4d3d5..f82f5aad560a 100644
--- a/arch/arm/mach-pxa/idp.c
+++ b/arch/arm/mach-pxa/idp.c
@@ -181,10 +181,12 @@ static void __init idp_map_io(void)
181 181
182 182
183MACHINE_START(PXA_IDP, "Vibren PXA255 IDP") 183MACHINE_START(PXA_IDP, "Vibren PXA255 IDP")
184 MAINTAINER("Vibren Technologies") 184 /* Maintainer: Vibren Technologies */
185 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) 185 .phys_ram = 0xa0000000,
186 MAPIO(idp_map_io) 186 .phys_io = 0x40000000,
187 INITIRQ(idp_init_irq) 187 .io_pg_offst = ((io_p2v(0x40000000) >> 18) & 0xfffc,)
188 .map_io = idp_map_io,
189 .init_irq = idp_init_irq,
188 .timer = &pxa_timer, 190 .timer = &pxa_timer,
189 INIT_MACHINE(idp_init) 191 .init_machine = idp_init,
190MACHINE_END 192MACHINE_END
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index f2c9e0d2b24b..e30b7c62270d 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -268,10 +268,12 @@ static void __init lubbock_map_io(void)
268} 268}
269 269
270MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)") 270MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)")
271 MAINTAINER("MontaVista Software Inc.") 271 /* Maintainer: MontaVista Software Inc. */
272 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) 272 .phys_ram = 0xa0000000,
273 MAPIO(lubbock_map_io) 273 .phys_io = 0x40000000,
274 INITIRQ(lubbock_init_irq) 274 .io_pg_offst = ((io_p2v(0x40000000) >> 18) & 0xfffc,)
275 .map_io = lubbock_map_io,
276 .init_irq = lubbock_init_irq,
275 .timer = &pxa_timer, 277 .timer = &pxa_timer,
276 INIT_MACHINE(lubbock_init) 278 .init_machine = lubbock_init,
277MACHINE_END 279MACHINE_END
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 9896afca751f..5d2f76b6df0e 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -345,10 +345,12 @@ static void __init mainstone_map_io(void)
345} 345}
346 346
347MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") 347MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
348 MAINTAINER("MontaVista Software Inc.") 348 /* Maintainer: MontaVista Software Inc. */
349 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) 349 .phys_ram = 0xa0000000,
350 MAPIO(mainstone_map_io) 350 .phys_io = 0x40000000,
351 INITIRQ(mainstone_init_irq) 351 .io_pg_offst = ((io_p2v(0x40000000) >> 18) & 0xfffc,)
352 .map_io = mainstone_map_io,
353 .init_irq = mainstone_init_irq,
352 .timer = &pxa_timer, 354 .timer = &pxa_timer,
353 INIT_MACHINE(mainstone_init) 355 .init_machine = mainstone_init,
354MACHINE_END 356MACHINE_END
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index b6c746ea3830..ebae969e8830 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -180,10 +180,12 @@ static void __init poodle_map_io(void)
180} 180}
181 181
182MACHINE_START(POODLE, "SHARP Poodle") 182MACHINE_START(POODLE, "SHARP Poodle")
183 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000)) 183 .phys_ram = 0xa0000000,
184 FIXUP(fixup_poodle) 184 .phys_io = 0x40000000,
185 MAPIO(poodle_map_io) 185 .io_pg_offst = ((io_p2v(0x40000000) >> 18) & 0xfffc,)
186 INITIRQ(pxa_init_irq) 186 .fixup = fixup_poodle,
187 .timer = &pxa_timer, 187 .map_io = poodle_map_io,
188 .init_machine = poodle_init, 188 .init_irq = pxa_init_irq,
189 .timer = &pxa_timer,
190 .init_machine = poodle_init,
189MACHINE_END 191MACHINE_END
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 893964fb9659..9a791b07118d 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -126,6 +126,7 @@ int pxa_cpu_pm_prepare(suspend_state_t state)
126{ 126{
127 switch (state) { 127 switch (state) {
128 case PM_SUSPEND_MEM: 128 case PM_SUSPEND_MEM:
129 case PM_SUSPEND_STANDBY:
129 return 0; 130 return 0;
130 default: 131 default:
131 return -EINVAL; 132 return -EINVAL;
@@ -138,7 +139,10 @@ void pxa_cpu_pm_enter(suspend_state_t state)
138 extern void pxa_cpu_suspend(unsigned int); 139 extern void pxa_cpu_suspend(unsigned int);
139 extern void pxa_cpu_resume(void); 140 extern void pxa_cpu_resume(void);
140 141
141 CKEN = CKEN22_MEMC | CKEN9_OSTIMER; 142 if (state == PM_SUSPEND_STANDBY)
143 CKEN = CKEN22_MEMC | CKEN9_OSTIMER | CKEN16_LCD |CKEN0_PWM0;
144 else
145 CKEN = CKEN22_MEMC | CKEN9_OSTIMER;
142 146
143 /* ensure voltage-change sequencer not initiated, which hangs */ 147 /* ensure voltage-change sequencer not initiated, which hangs */
144 PCFR &= ~PCFR_FVC; 148 PCFR &= ~PCFR_FVC;
@@ -147,6 +151,9 @@ void pxa_cpu_pm_enter(suspend_state_t state)
147 PEDR = 0xDF12FE1B; 151 PEDR = 0xDF12FE1B;
148 152
149 switch (state) { 153 switch (state) {
154 case PM_SUSPEND_STANDBY:
155 pxa_cpu_standby();
156 break;
150 case PM_SUSPEND_MEM: 157 case PM_SUSPEND_MEM:
151 /* set resume return address */ 158 /* set resume return address */
152 PSPR = virt_to_phys(pxa_cpu_resume); 159 PSPR = virt_to_phys(pxa_cpu_resume);
diff --git a/arch/arm/mach-pxa/standby.S b/arch/arm/mach-pxa/standby.S
new file mode 100644
index 000000000000..8a3f27b76784
--- /dev/null
+++ b/arch/arm/mach-pxa/standby.S
@@ -0,0 +1,32 @@
1/*
2 * PXA27x standby mode
3 *
4 * Author: David Burrage
5 *
6 * 2005 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#include <linux/config.h>
13#include <linux/linkage.h>
14#include <asm/assembler.h>
15#include <asm/hardware.h>
16
17#include <asm/arch/pxa-regs.h>
18
19 .text
20
21ENTRY(pxa_cpu_standby)
22 ldr r0, =PSSR
23 mov r1, #(PSSR_PH | PSSR_STS)
24 mov r2, #2
25 mov r3, #UNCACHED_PHYS_0 @ Read mem context in.
26 ldr ip, [r3]
27 b 1f
28
29 .align 5
301: mcr p14, 0, r2, c7, c0, 0 @ put the system into Standby
31 str r1, [r0] @ make sure PSSR_PH/STS are clear
32 mov pc, lr
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index 437106881436..a10268618f74 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -163,12 +163,14 @@ arch_initcall(rpc_init);
163extern struct sys_timer ioc_timer; 163extern struct sys_timer ioc_timer;
164 164
165MACHINE_START(RISCPC, "Acorn-RiscPC") 165MACHINE_START(RISCPC, "Acorn-RiscPC")
166 MAINTAINER("Russell King") 166 /* Maintainer: Russell King */
167 BOOT_MEM(0x10000000, 0x03000000, 0xe0000000) 167 .phys_ram = 0x10000000,
168 BOOT_PARAMS(0x10000100) 168 .phys_io = 0x03000000,
169 DISABLE_PARPORT(0) 169 .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc,
170 DISABLE_PARPORT(1) 170 .boot_params = 0x10000100,
171 MAPIO(rpc_map_io) 171 .reserve_lp0 = 1,
172 INITIRQ(rpc_init_irq) 172 .reserve_lp1 = 1,
173 .map_io = rpc_map_io,
174 .init_irq = rpc_init_irq,
173 .timer = &ioc_timer, 175 .timer = &ioc_timer,
174MACHINE_END 176MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 549bcb1f32c0..ccb6bcefa46c 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -407,10 +407,11 @@ void __init bast_map_io(void)
407 407
408 408
409MACHINE_START(BAST, "Simtec-BAST") 409MACHINE_START(BAST, "Simtec-BAST")
410 MAINTAINER("Ben Dooks <ben@simtec.co.uk>") 410 /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
411 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 411 .phys_ram = S3C2410_SDRAM_PA,
412 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 412 .phys_io = S3C2410_PA_UART,
413 413 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
414 .boot_params = S3C2410_SDRAM_PA + 0x100,
414 .map_io = bast_map_io, 415 .map_io = bast_map_io,
415 .init_irq = s3c24xx_init_irq, 416 .init_irq = s3c24xx_init_irq,
416 .timer = &s3c24xx_timer, 417 .timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index 2924afc068a4..ea4fb1a97a50 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -117,10 +117,12 @@ void __init h1940_init_irq(void)
117} 117}
118 118
119MACHINE_START(H1940, "IPAQ-H1940") 119MACHINE_START(H1940, "IPAQ-H1940")
120 MAINTAINER("Ben Dooks <ben@fluff.org>") 120 /* Maintainer: Ben Dooks <ben@fluff.org> */
121 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 121 .phys_ram = S3C2410_SDRAM_PA,
122 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 122 .phys_io = S3C2410_PA_UART,
123 MAPIO(h1940_map_io) 123 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
124 INITIRQ(h1940_init_irq) 124 .boot_params = S3C2410_SDRAM_PA + 0x100,
125 .map_io = h1940_map_io,
126 .init_irq = h1940_init_irq,
125 .timer = &s3c24xx_timer, 127 .timer = &s3c24xx_timer,
126MACHINE_END 128MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index bd15998c129b..79044d9bce38 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -137,10 +137,11 @@ void __init n30_init(void)
137} 137}
138 138
139MACHINE_START(N30, "Acer-N30") 139MACHINE_START(N30, "Acer-N30")
140 MAINTAINER("Christer Weinigel <christer@weinigel.se>, Ben Dooks <ben-linux@fluff.org>") 140 /* Maintainer: Christer Weinigel <christer@weinigel.se>, Ben Dooks <ben-linux@fluff.org> */
141 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 141 .phys_ram = S3C2410_SDRAM_PA,
142 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 142 .phys_io = S3C2410_PA_UART,
143 143 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
144 .boot_params = S3C2410_SDRAM_PA + 0x100,
144 .timer = &s3c24xx_timer, 145 .timer = &s3c24xx_timer,
145 .init_machine = n30_init, 146 .init_machine = n30_init,
146 .init_irq = n30_init_irq, 147 .init_irq = n30_init_irq,
diff --git a/arch/arm/mach-s3c2410/mach-nexcoder.c b/arch/arm/mach-s3c2410/mach-nexcoder.c
index 70487bf4b71e..d24c242414ca 100644
--- a/arch/arm/mach-s3c2410/mach-nexcoder.c
+++ b/arch/arm/mach-s3c2410/mach-nexcoder.c
@@ -147,9 +147,11 @@ void __init nexcoder_map_io(void)
147 147
148 148
149MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440") 149MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440")
150 MAINTAINER("Guillaume GOURAT <guillaume.gourat@nexvision.tv>") 150 /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */
151 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 151 .phys_ram = S3C2410_SDRAM_PA,
152 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 152 .phys_io = S3C2410_PA_UART,
153 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
154 .boot_params = S3C2410_SDRAM_PA + 0x100,
153 .map_io = nexcoder_map_io, 155 .map_io = nexcoder_map_io,
154 .init_irq = s3c24xx_init_irq, 156 .init_irq = s3c24xx_init_irq,
155 .timer = &s3c24xx_timer, 157 .timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2410/mach-otom.c b/arch/arm/mach-s3c2410/mach-otom.c
index 67d8ce8fb00f..d901ed492ff5 100644
--- a/arch/arm/mach-s3c2410/mach-otom.c
+++ b/arch/arm/mach-s3c2410/mach-otom.c
@@ -115,9 +115,11 @@ void __init otom11_map_io(void)
115 115
116 116
117MACHINE_START(OTOM, "Nex Vision - Otom 1.1") 117MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
118 MAINTAINER("Guillaume GOURAT <guillaume.gourat@nexvision.tv>") 118 /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */
119 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 119 .phys_ram = S3C2410_SDRAM_PA,
120 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 120 .phys_io = S3C2410_PA_UART,
121 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
122 .boot_params = S3C2410_SDRAM_PA + 0x100,
121 .map_io = otom11_map_io, 123 .map_io = otom11_map_io,
122 .init_irq = s3c24xx_init_irq, 124 .init_irq = s3c24xx_init_irq,
123 .timer = &s3c24xx_timer, 125 .timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-s3c2410/mach-rx3715.c b/arch/arm/mach-s3c2410/mach-rx3715.c
index f8d3a9784e71..a73d61c1de46 100644
--- a/arch/arm/mach-s3c2410/mach-rx3715.c
+++ b/arch/arm/mach-s3c2410/mach-rx3715.c
@@ -131,11 +131,13 @@ static void __init rx3715_init_machine(void)
131#endif 131#endif
132 132
133MACHINE_START(RX3715, "IPAQ-RX3715") 133MACHINE_START(RX3715, "IPAQ-RX3715")
134 MAINTAINER("Ben Dooks <ben@fluff.org>") 134 /* Maintainer: Ben Dooks <ben@fluff.org> */
135 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 135 .phys_ram = S3C2410_SDRAM_PA,
136 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 136 .phys_io = S3C2410_PA_UART,
137 MAPIO(rx3715_map_io) 137 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
138 INITIRQ(rx3715_init_irq) 138 .boot_params = S3C2410_SDRAM_PA + 0x100,
139 INIT_MACHINE(rx3715_init_machine) 139 .map_io = rx3715_map_io,
140 .init_irq = rx3715_init_irq,
141 .init_machine = rx3715_init_machine,
140 .timer = &s3c24xx_timer, 142 .timer = &s3c24xx_timer,
141MACHINE_END 143MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c2410/mach-smdk2410.c
index c1a4a1420ea0..67e903a700d3 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2410.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2410.c
@@ -112,11 +112,13 @@ void __init smdk2410_init_irq(void)
112 112
113MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch 113MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch
114 * to SMDK2410 */ 114 * to SMDK2410 */
115 MAINTAINER("Jonas Dietsche") 115 /* Maintainer: Jonas Dietsche */
116 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 116 .phys_ram = S3C2410_SDRAM_PA,
117 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 117 .phys_io = S3C2410_PA_UART,
118 MAPIO(smdk2410_map_io) 118 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
119 INITIRQ(smdk2410_init_irq) 119 .boot_params = S3C2410_SDRAM_PA + 0x100,
120 .map_io = smdk2410_map_io,
121 .init_irq = smdk2410_init_irq,
120 .timer = &s3c24xx_timer, 122 .timer = &s3c24xx_timer,
121MACHINE_END 123MACHINE_END
122 124
diff --git a/arch/arm/mach-s3c2410/mach-smdk2440.c b/arch/arm/mach-s3c2410/mach-smdk2440.c
index 7857176d9bcb..357522106f68 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2440.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2440.c
@@ -124,9 +124,11 @@ void __init smdk2440_machine_init(void)
124} 124}
125 125
126MACHINE_START(S3C2440, "SMDK2440") 126MACHINE_START(S3C2440, "SMDK2440")
127 MAINTAINER("Ben Dooks <ben@fluff.org>") 127 /* Maintainer: Ben Dooks <ben@fluff.org> */
128 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 128 .phys_ram = S3C2410_SDRAM_PA,
129 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 129 .phys_io = S3C2410_PA_UART,
130 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
131 .boot_params = S3C2410_SDRAM_PA + 0x100,
130 132
131 .init_irq = s3c24xx_init_irq, 133 .init_irq = s3c24xx_init_irq,
132 .map_io = smdk2440_map_io, 134 .map_io = smdk2440_map_io,
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 1db2855e3e56..924e8464c212 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -373,9 +373,11 @@ void __init vr1000_map_io(void)
373 373
374 374
375MACHINE_START(VR1000, "Thorcom-VR1000") 375MACHINE_START(VR1000, "Thorcom-VR1000")
376 MAINTAINER("Ben Dooks <ben@simtec.co.uk>") 376 /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
377 BOOT_MEM(S3C2410_SDRAM_PA, S3C2410_PA_UART, (u32)S3C24XX_VA_UART) 377 .phys_ram = S3C2410_SDRAM_PA,
378 BOOT_PARAMS(S3C2410_SDRAM_PA + 0x100) 378 .phys_io = S3C2410_PA_UART,
379 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
380 .boot_params = S3C2410_SDRAM_PA + 0x100,
379 .map_io = vr1000_map_io, 381 .map_io = vr1000_map_io,
380 .init_irq = s3c24xx_init_irq, 382 .init_irq = s3c24xx_init_irq,
381 .timer = &s3c24xx_timer, 383 .timer = &s3c24xx_timer,
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index bedf88fafe08..4d4d303ee3a8 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -431,11 +431,13 @@ static void __init assabet_map_io(void)
431 431
432 432
433MACHINE_START(ASSABET, "Intel-Assabet") 433MACHINE_START(ASSABET, "Intel-Assabet")
434 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 434 .phys_ram = 0xc0000000,
435 BOOT_PARAMS(0xc0000100) 435 .phys_io = 0x80000000,
436 FIXUP(fixup_assabet) 436 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
437 MAPIO(assabet_map_io) 437 .boot_params = 0xc0000100,
438 INITIRQ(sa1100_init_irq) 438 .fixup = fixup_assabet,
439 .map_io = assabet_map_io,
440 .init_irq = sa1100_init_irq,
439 .timer = &sa1100_timer, 441 .timer = &sa1100_timer,
440 .init_machine = assabet_init, 442 .init_machine = assabet_init,
441MACHINE_END 443MACHINE_END
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c
index 6a60b497ab42..b6169cb09196 100644
--- a/arch/arm/mach-sa1100/badge4.c
+++ b/arch/arm/mach-sa1100/badge4.c
@@ -285,9 +285,11 @@ static void __init badge4_map_io(void)
285} 285}
286 286
287MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4") 287MACHINE_START(BADGE4, "Hewlett-Packard Laboratories BadgePAD 4")
288 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 288 .phys_ram = 0xc0000000,
289 BOOT_PARAMS(0xc0000100) 289 .phys_io = 0x80000000,
290 MAPIO(badge4_map_io) 290 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
291 INITIRQ(sa1100_init_irq) 291 .boot_params = 0xc0000100,
292 .map_io = badge4_map_io,
293 .init_irq = sa1100_init_irq,
292 .timer = &sa1100_timer, 294 .timer = &sa1100_timer,
293MACHINE_END 295MACHINE_END
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c
index f8edde5e7cbf..0aa918e24c31 100644
--- a/arch/arm/mach-sa1100/cerf.c
+++ b/arch/arm/mach-sa1100/cerf.c
@@ -123,10 +123,12 @@ static void __init cerf_init(void)
123} 123}
124 124
125MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube") 125MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
126 MAINTAINER("support@intrinsyc.com") 126 /* Maintainer: support@intrinsyc.com */
127 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 127 .phys_ram = 0xc0000000,
128 MAPIO(cerf_map_io) 128 .phys_io = 0x80000000,
129 INITIRQ(cerf_init_irq) 129 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
130 .map_io = cerf_map_io,
131 .init_irq = cerf_init_irq,
130 .timer = &sa1100_timer, 132 .timer = &sa1100_timer,
131 .init_machine = cerf_init, 133 .init_machine = cerf_init,
132MACHINE_END 134MACHINE_END
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c
index 99287890d396..8cb69113a57c 100644
--- a/arch/arm/mach-sa1100/collie.c
+++ b/arch/arm/mach-sa1100/collie.c
@@ -184,9 +184,11 @@ static void __init collie_map_io(void)
184} 184}
185 185
186MACHINE_START(COLLIE, "Sharp-Collie") 186MACHINE_START(COLLIE, "Sharp-Collie")
187 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 187 .phys_ram = 0xc0000000,
188 MAPIO(collie_map_io) 188 .phys_io = 0x80000000,
189 INITIRQ(sa1100_init_irq) 189 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
190 .map_io = collie_map_io,
191 .init_irq = sa1100_init_irq,
190 .timer = &sa1100_timer, 192 .timer = &sa1100_timer,
191 .init_machine = collie_init, 193 .init_machine = collie_init,
192MACHINE_END 194MACHINE_END
diff --git a/arch/arm/mach-sa1100/cpu-sa1110.c b/arch/arm/mach-sa1100/cpu-sa1110.c
index 8d2a89a2ea01..04c94ab6c18b 100644
--- a/arch/arm/mach-sa1100/cpu-sa1110.c
+++ b/arch/arm/mach-sa1100/cpu-sa1110.c
@@ -271,8 +271,7 @@ static int sa1110_target(struct cpufreq_policy *policy,
271 */ 271 */
272 sdram_set_refresh(2); 272 sdram_set_refresh(2);
273 if (!irqs_disabled()) { 273 if (!irqs_disabled()) {
274 set_current_state(TASK_UNINTERRUPTIBLE); 274 msleep(20);
275 schedule_timeout(20 * HZ / 1000);
276 } else { 275 } else {
277 mdelay(20); 276 mdelay(20);
278 } 277 }
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index 65dbe991426d..e7aa2681ca64 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -380,10 +380,12 @@ static void __init h3100_map_io(void)
380} 380}
381 381
382MACHINE_START(H3100, "Compaq iPAQ H3100") 382MACHINE_START(H3100, "Compaq iPAQ H3100")
383 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 383 .phys_ram = 0xc0000000,
384 BOOT_PARAMS(0xc0000100) 384 .phys_io = 0x80000000,
385 MAPIO(h3100_map_io) 385 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
386 INITIRQ(sa1100_init_irq) 386 .boot_params = 0xc0000100,
387 .map_io = h3100_map_io,
388 .init_irq = sa1100_init_irq,
387 .timer = &sa1100_timer, 389 .timer = &sa1100_timer,
388 .init_machine = h3xxx_mach_init, 390 .init_machine = h3xxx_mach_init,
389MACHINE_END 391MACHINE_END
@@ -496,10 +498,12 @@ static void __init h3600_map_io(void)
496} 498}
497 499
498MACHINE_START(H3600, "Compaq iPAQ H3600") 500MACHINE_START(H3600, "Compaq iPAQ H3600")
499 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 501 .phys_ram = 0xc0000000,
500 BOOT_PARAMS(0xc0000100) 502 .phys_io = 0x80000000,
501 MAPIO(h3600_map_io) 503 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
502 INITIRQ(sa1100_init_irq) 504 .boot_params = 0xc0000100,
505 .map_io = h3600_map_io,
506 .init_irq = sa1100_init_irq,
503 .timer = &sa1100_timer, 507 .timer = &sa1100_timer,
504 .init_machine = h3xxx_mach_init, 508 .init_machine = h3xxx_mach_init,
505MACHINE_END 509MACHINE_END
@@ -881,10 +885,12 @@ static void __init h3800_map_io(void)
881} 885}
882 886
883MACHINE_START(H3800, "Compaq iPAQ H3800") 887MACHINE_START(H3800, "Compaq iPAQ H3800")
884 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 888 .phys_ram = 0xc0000000,
885 BOOT_PARAMS(0xc0000100) 889 .phys_io = 0x80000000,
886 MAPIO(h3800_map_io) 890 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
887 INITIRQ(h3800_init_irq) 891 .boot_params = 0xc0000100,
892 .map_io = h3800_map_io,
893 .init_irq = h3800_init_irq,
888 .timer = &sa1100_timer, 894 .timer = &sa1100_timer,
889 .init_machine = h3xxx_mach_init, 895 .init_machine = h3xxx_mach_init,
890MACHINE_END 896MACHINE_END
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
index 570841779714..502d65cfe654 100644
--- a/arch/arm/mach-sa1100/hackkit.c
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -191,10 +191,12 @@ static void __init hackkit_init(void)
191 */ 191 */
192 192
193MACHINE_START(HACKKIT, "HackKit Cpu Board") 193MACHINE_START(HACKKIT, "HackKit Cpu Board")
194 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 194 .phys_ram = 0xc0000000,
195 BOOT_PARAMS(0xc0000100) 195 .phys_io = 0x80000000,
196 MAPIO(hackkit_map_io) 196 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
197 INITIRQ(sa1100_init_irq) 197 .boot_params = 0xc0000100,
198 .map_io = hackkit_map_io,
199 .init_irq = sa1100_init_irq,
198 .timer = &sa1100_timer, 200 .timer = &sa1100_timer,
199 .init_machine = hackkit_init, 201 .init_machine = hackkit_init,
200MACHINE_END 202MACHINE_END
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index 6be78291a878..eee3cbc5ec4f 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -97,9 +97,11 @@ static void __init jornada720_map_io(void)
97} 97}
98 98
99MACHINE_START(JORNADA720, "HP Jornada 720") 99MACHINE_START(JORNADA720, "HP Jornada 720")
100 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 100 .phys_ram = 0xc0000000,
101 BOOT_PARAMS(0xc0000100) 101 .phys_io = 0x80000000,
102 MAPIO(jornada720_map_io) 102 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
103 INITIRQ(sa1100_init_irq) 103 .boot_params = 0xc0000100,
104 .map_io = jornada720_map_io,
105 .init_irq = sa1100_init_irq,
104 .timer = &sa1100_timer, 106 .timer = &sa1100_timer,
105MACHINE_END 107MACHINE_END
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c
index 51c08ccfb8db..870b488aeda4 100644
--- a/arch/arm/mach-sa1100/lart.c
+++ b/arch/arm/mach-sa1100/lart.c
@@ -41,9 +41,11 @@ static void __init lart_map_io(void)
41} 41}
42 42
43MACHINE_START(LART, "LART") 43MACHINE_START(LART, "LART")
44 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 44 .phys_ram = 0xc0000000,
45 BOOT_PARAMS(0xc0000100) 45 .phys_io = 0x80000000,
46 MAPIO(lart_map_io) 46 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
47 INITIRQ(sa1100_init_irq) 47 .boot_params = 0xc0000100,
48 .map_io = lart_map_io,
49 .init_irq = sa1100_init_irq,
48 .timer = &sa1100_timer, 50 .timer = &sa1100_timer,
49MACHINE_END 51MACHINE_END
diff --git a/arch/arm/mach-sa1100/pleb.c b/arch/arm/mach-sa1100/pleb.c
index 5606bd71b024..e17b58fb9c9c 100644
--- a/arch/arm/mach-sa1100/pleb.c
+++ b/arch/arm/mach-sa1100/pleb.c
@@ -146,9 +146,11 @@ static void __init pleb_map_io(void)
146} 146}
147 147
148MACHINE_START(PLEB, "PLEB") 148MACHINE_START(PLEB, "PLEB")
149 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 149 .phys_ram = 0xc0000000,
150 MAPIO(pleb_map_io) 150 .phys_io = 0x80000000,
151 INITIRQ(sa1100_init_irq) 151 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
152 .map_io = pleb_map_io,
153 .init_irq = sa1100_init_irq,
152 .timer = &sa1100_timer, 154 .timer = &sa1100_timer,
153 .init_machine = pleb_init, 155 .init_machine = pleb_init,
154MACHINE_END 156MACHINE_END
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c
index edddd559be02..43a00359fcdd 100644
--- a/arch/arm/mach-sa1100/shannon.c
+++ b/arch/arm/mach-sa1100/shannon.c
@@ -76,10 +76,12 @@ static void __init shannon_map_io(void)
76} 76}
77 77
78MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)") 78MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
79 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 79 .phys_ram = 0xc0000000,
80 BOOT_PARAMS(0xc0000100) 80 .phys_io = 0x80000000,
81 MAPIO(shannon_map_io) 81 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
82 INITIRQ(sa1100_init_irq) 82 .boot_params = 0xc0000100,
83 .map_io = shannon_map_io,
84 .init_irq = sa1100_init_irq,
83 .timer = &sa1100_timer, 85 .timer = &sa1100_timer,
84 .init_machine = shannon_init, 86 .init_machine = shannon_init,
85MACHINE_END 87MACHINE_END
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index 8d113d629867..77978586b126 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -215,10 +215,12 @@ arch_initcall(simpad_init);
215 215
216 216
217MACHINE_START(SIMPAD, "Simpad") 217MACHINE_START(SIMPAD, "Simpad")
218 MAINTAINER("Holger Freyther") 218 /* Maintainer: Holger Freyther */
219 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000) 219 .phys_ram = 0xc0000000,
220 BOOT_PARAMS(0xc0000100) 220 .phys_io = 0x80000000,
221 MAPIO(simpad_map_io) 221 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
222 INITIRQ(sa1100_init_irq) 222 .boot_params = 0xc0000100,
223 .map_io = simpad_map_io,
224 .init_irq = sa1100_init_irq,
223 .timer = &sa1100_timer, 225 .timer = &sa1100_timer,
224MACHINE_END 226MACHINE_END
diff --git a/arch/arm/mach-shark/core.c b/arch/arm/mach-shark/core.c
index aa0e2f6e02f6..726445895b5c 100644
--- a/arch/arm/mach-shark/core.c
+++ b/arch/arm/mach-shark/core.c
@@ -105,10 +105,12 @@ static struct sys_timer shark_timer = {
105}; 105};
106 106
107MACHINE_START(SHARK, "Shark") 107MACHINE_START(SHARK, "Shark")
108 MAINTAINER("Alexander Schulz") 108 /* Maintainer: Alexander Schulz */
109 BOOT_MEM(0x08000000, 0x40000000, 0xe0000000) 109 .phys_ram = 0x08000000,
110 BOOT_PARAMS(0x08003000) 110 .phys_io = 0x40000000,
111 MAPIO(shark_map_io) 111 .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc,
112 INITIRQ(shark_init_irq) 112 .boot_params = 0x08003000,
113 .map_io = shark_map_io,
114 .init_irq = shark_init_irq,
113 .timer = &shark_timer, 115 .timer = &shark_timer,
114MACHINE_END 116MACHINE_END
diff --git a/arch/arm/mach-versatile/versatile_ab.c b/arch/arm/mach-versatile/versatile_ab.c
index d332084586cf..8b0b3bef24ae 100644
--- a/arch/arm/mach-versatile/versatile_ab.c
+++ b/arch/arm/mach-versatile/versatile_ab.c
@@ -35,11 +35,13 @@
35#include "core.h" 35#include "core.h"
36 36
37MACHINE_START(VERSATILE_AB, "ARM-Versatile AB") 37MACHINE_START(VERSATILE_AB, "ARM-Versatile AB")
38 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") 38 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
39 BOOT_MEM(0x00000000, 0x101f1000, 0xf11f1000) 39 .phys_ram = 0x00000000,
40 BOOT_PARAMS(0x00000100) 40 .phys_io = 0x101f1000,
41 MAPIO(versatile_map_io) 41 .io_pg_offst = ((0xf11f1000) >> 18) & 0xfffc,
42 INITIRQ(versatile_init_irq) 42 .boot_params = 0x00000100,
43 .map_io = versatile_map_io,
44 .init_irq = versatile_init_irq,
43 .timer = &versatile_timer, 45 .timer = &versatile_timer,
44 INIT_MACHINE(versatile_init) 46 .init_machine = versatile_init,
45MACHINE_END 47MACHINE_END
diff --git a/arch/arm/mach-versatile/versatile_pb.c b/arch/arm/mach-versatile/versatile_pb.c
index 2702099a68f3..7c3078c38916 100644
--- a/arch/arm/mach-versatile/versatile_pb.c
+++ b/arch/arm/mach-versatile/versatile_pb.c
@@ -99,11 +99,13 @@ static int __init versatile_pb_init(void)
99arch_initcall(versatile_pb_init); 99arch_initcall(versatile_pb_init);
100 100
101MACHINE_START(VERSATILE_PB, "ARM-Versatile PB") 101MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
102 MAINTAINER("ARM Ltd/Deep Blue Solutions Ltd") 102 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
103 BOOT_MEM(0x00000000, 0x101f1000, 0xf11f1000) 103 .phys_ram = 0x00000000,
104 BOOT_PARAMS(0x00000100) 104 .phys_io = 0x101f1000,
105 MAPIO(versatile_map_io) 105 .io_pg_offst = ((0xf11f1000) >> 18) & 0xfffc,
106 INITIRQ(versatile_init_irq) 106 .boot_params = 0x00000100,
107 .map_io = versatile_map_io,
108 .init_irq = versatile_init_irq,
107 .timer = &versatile_timer, 109 .timer = &versatile_timer,
108 INIT_MACHINE(versatile_init) 110 .init_machine = versatile_init,
109MACHINE_END 111MACHINE_END
diff --git a/arch/arm/mm/blockops.c b/arch/arm/mm/blockops.c
index 806c6eeb1b0c..4f5ee2d08996 100644
--- a/arch/arm/mm/blockops.c
+++ b/arch/arm/mm/blockops.c
@@ -25,13 +25,14 @@ blk_flush_kern_dcache_page(void *kaddr)
25{ 25{
26 asm( 26 asm(
27 "add r1, r0, %0 \n\ 27 "add r1, r0, %0 \n\
28 sub r1, r1, %1 \n\
281: .word 0xec401f0e @ mcrr p15, 0, r0, r1, c14, 0 @ blocking \n\ 291: .word 0xec401f0e @ mcrr p15, 0, r0, r1, c14, 0 @ blocking \n\
29 mov r0, #0 \n\ 30 mov r0, #0 \n\
30 mcr p15, 0, r0, c7, c5, 0 \n\ 31 mcr p15, 0, r0, c7, c5, 0 \n\
31 mcr p15, 0, r0, c7, c10, 4 \n\ 32 mcr p15, 0, r0, c7, c10, 4 \n\
32 mov pc, lr" 33 mov pc, lr"
33 : 34 :
34 : "I" (PAGE_SIZE)); 35 : "I" (PAGE_SIZE), "I" (L1_CACHE_BYTES));
35} 36}
36 37
37/* 38/*
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
index e25b4fd8412c..65bfe84b6d67 100644
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -372,49 +372,50 @@ do_bad(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
372static struct fsr_info { 372static struct fsr_info {
373 int (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs); 373 int (*fn)(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
374 int sig; 374 int sig;
375 int code;
375 const char *name; 376 const char *name;
376} fsr_info[] = { 377} fsr_info[] = {
377 /* 378 /*
378 * The following are the standard ARMv3 and ARMv4 aborts. ARMv5 379 * The following are the standard ARMv3 and ARMv4 aborts. ARMv5
379 * defines these to be "precise" aborts. 380 * defines these to be "precise" aborts.
380 */ 381 */
381 { do_bad, SIGSEGV, "vector exception" }, 382 { do_bad, SIGSEGV, 0, "vector exception" },
382 { do_bad, SIGILL, "alignment exception" }, 383 { do_bad, SIGILL, BUS_ADRALN, "alignment exception" },
383 { do_bad, SIGKILL, "terminal exception" }, 384 { do_bad, SIGKILL, 0, "terminal exception" },
384 { do_bad, SIGILL, "alignment exception" }, 385 { do_bad, SIGILL, BUS_ADRALN, "alignment exception" },
385 { do_bad, SIGBUS, "external abort on linefetch" }, 386 { do_bad, SIGBUS, 0, "external abort on linefetch" },
386 { do_translation_fault, SIGSEGV, "section translation fault" }, 387 { do_translation_fault, SIGSEGV, SEGV_MAPERR, "section translation fault" },
387 { do_bad, SIGBUS, "external abort on linefetch" }, 388 { do_bad, SIGBUS, 0, "external abort on linefetch" },
388 { do_page_fault, SIGSEGV, "page translation fault" }, 389 { do_page_fault, SIGSEGV, SEGV_MAPERR, "page translation fault" },
389 { do_bad, SIGBUS, "external abort on non-linefetch" }, 390 { do_bad, SIGBUS, 0, "external abort on non-linefetch" },
390 { do_bad, SIGSEGV, "section domain fault" }, 391 { do_bad, SIGSEGV, SEGV_ACCERR, "section domain fault" },
391 { do_bad, SIGBUS, "external abort on non-linefetch" }, 392 { do_bad, SIGBUS, 0, "external abort on non-linefetch" },
392 { do_bad, SIGSEGV, "page domain fault" }, 393 { do_bad, SIGSEGV, SEGV_ACCERR, "page domain fault" },
393 { do_bad, SIGBUS, "external abort on translation" }, 394 { do_bad, SIGBUS, 0, "external abort on translation" },
394 { do_sect_fault, SIGSEGV, "section permission fault" }, 395 { do_sect_fault, SIGSEGV, SEGV_ACCERR, "section permission fault" },
395 { do_bad, SIGBUS, "external abort on translation" }, 396 { do_bad, SIGBUS, 0, "external abort on translation" },
396 { do_page_fault, SIGSEGV, "page permission fault" }, 397 { do_page_fault, SIGSEGV, SEGV_ACCERR, "page permission fault" },
397 /* 398 /*
398 * The following are "imprecise" aborts, which are signalled by bit 399 * The following are "imprecise" aborts, which are signalled by bit
399 * 10 of the FSR, and may not be recoverable. These are only 400 * 10 of the FSR, and may not be recoverable. These are only
400 * supported if the CPU abort handler supports bit 10. 401 * supported if the CPU abort handler supports bit 10.
401 */ 402 */
402 { do_bad, SIGBUS, "unknown 16" }, 403 { do_bad, SIGBUS, 0, "unknown 16" },
403 { do_bad, SIGBUS, "unknown 17" }, 404 { do_bad, SIGBUS, 0, "unknown 17" },
404 { do_bad, SIGBUS, "unknown 18" }, 405 { do_bad, SIGBUS, 0, "unknown 18" },
405 { do_bad, SIGBUS, "unknown 19" }, 406 { do_bad, SIGBUS, 0, "unknown 19" },
406 { do_bad, SIGBUS, "lock abort" }, /* xscale */ 407 { do_bad, SIGBUS, 0, "lock abort" }, /* xscale */
407 { do_bad, SIGBUS, "unknown 21" }, 408 { do_bad, SIGBUS, 0, "unknown 21" },
408 { do_bad, SIGBUS, "imprecise external abort" }, /* xscale */ 409 { do_bad, SIGBUS, BUS_OBJERR, "imprecise external abort" }, /* xscale */
409 { do_bad, SIGBUS, "unknown 23" }, 410 { do_bad, SIGBUS, 0, "unknown 23" },
410 { do_bad, SIGBUS, "dcache parity error" }, /* xscale */ 411 { do_bad, SIGBUS, 0, "dcache parity error" }, /* xscale */
411 { do_bad, SIGBUS, "unknown 25" }, 412 { do_bad, SIGBUS, 0, "unknown 25" },
412 { do_bad, SIGBUS, "unknown 26" }, 413 { do_bad, SIGBUS, 0, "unknown 26" },
413 { do_bad, SIGBUS, "unknown 27" }, 414 { do_bad, SIGBUS, 0, "unknown 27" },
414 { do_bad, SIGBUS, "unknown 28" }, 415 { do_bad, SIGBUS, 0, "unknown 28" },
415 { do_bad, SIGBUS, "unknown 29" }, 416 { do_bad, SIGBUS, 0, "unknown 29" },
416 { do_bad, SIGBUS, "unknown 30" }, 417 { do_bad, SIGBUS, 0, "unknown 30" },
417 { do_bad, SIGBUS, "unknown 31" } 418 { do_bad, SIGBUS, 0, "unknown 31" }
418}; 419};
419 420
420void __init 421void __init
@@ -435,15 +436,19 @@ asmlinkage void
435do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs) 436do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
436{ 437{
437 const struct fsr_info *inf = fsr_info + (fsr & 15) + ((fsr & (1 << 10)) >> 6); 438 const struct fsr_info *inf = fsr_info + (fsr & 15) + ((fsr & (1 << 10)) >> 6);
439 struct siginfo info;
438 440
439 if (!inf->fn(addr, fsr, regs)) 441 if (!inf->fn(addr, fsr, regs))
440 return; 442 return;
441 443
442 printk(KERN_ALERT "Unhandled fault: %s (0x%03x) at 0x%08lx\n", 444 printk(KERN_ALERT "Unhandled fault: %s (0x%03x) at 0x%08lx\n",
443 inf->name, fsr, addr); 445 inf->name, fsr, addr);
444 force_sig(inf->sig, current); 446
445 show_pte(current->mm, addr); 447 info.si_signo = inf->sig;
446 die_if_kernel("Oops", regs, 0); 448 info.si_errno = 0;
449 info.si_code = inf->code;
450 info.si_addr = (void __user *)addr;
451 notify_die("", regs, &info, fsr, 0);
447} 452}
448 453
449asmlinkage void 454asmlinkage void
diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S
index 1f325231b9e4..5c0ae5260d1c 100644
--- a/arch/arm/mm/proc-arm1020.S
+++ b/arch/arm/mm/proc-arm1020.S
@@ -445,14 +445,14 @@ __arm1020_setup:
445 /* 445 /*
446 * R 446 * R
447 * .RVI ZFRS BLDP WCAM 447 * .RVI ZFRS BLDP WCAM
448 * .0.1 1001 ..11 0101 /* FIXME: why no V bit? */ 448 * .011 1001 ..11 0101
449 */ 449 */
450 .type arm1020_cr1_clear, #object 450 .type arm1020_cr1_clear, #object
451 .type arm1020_cr1_set, #object 451 .type arm1020_cr1_set, #object
452arm1020_cr1_clear: 452arm1020_cr1_clear:
453 .word 0x593f 453 .word 0x593f
454arm1020_cr1_set: 454arm1020_cr1_set:
455 .word 0x1935 455 .word 0x3935
456 456
457 __INITDATA 457 __INITDATA
458 458
diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S
index 142a2c2d6f0b..d69389c4d4ba 100644
--- a/arch/arm/mm/proc-arm1020e.S
+++ b/arch/arm/mm/proc-arm1020e.S
@@ -427,14 +427,14 @@ __arm1020e_setup:
427 /* 427 /*
428 * R 428 * R
429 * .RVI ZFRS BLDP WCAM 429 * .RVI ZFRS BLDP WCAM
430 * .0.1 1001 ..11 0101 /* FIXME: why no V bit? */ 430 * .011 1001 ..11 0101
431 */ 431 */
432 .type arm1020e_cr1_clear, #object 432 .type arm1020e_cr1_clear, #object
433 .type arm1020e_cr1_set, #object 433 .type arm1020e_cr1_set, #object
434arm1020e_cr1_clear: 434arm1020e_cr1_clear:
435 .word 0x5f3f 435 .word 0x5f3f
436arm1020e_cr1_set: 436arm1020e_cr1_set:
437 .word 0x1935 437 .word 0x3935
438 438
439 __INITDATA 439 __INITDATA
440 440
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
index 93df90bbb87e..bd1dbf3bd223 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/i386/kernel/apic.c
@@ -35,6 +35,7 @@
35#include <asm/desc.h> 35#include <asm/desc.h>
36#include <asm/arch_hooks.h> 36#include <asm/arch_hooks.h>
37#include <asm/hpet.h> 37#include <asm/hpet.h>
38#include <asm/i8253.h>
38 39
39#include <mach_apic.h> 40#include <mach_apic.h>
40 41
@@ -879,7 +880,6 @@ fake_ioapic_page:
879 */ 880 */
880static unsigned int __devinit get_8254_timer_count(void) 881static unsigned int __devinit get_8254_timer_count(void)
881{ 882{
882 extern spinlock_t i8253_lock;
883 unsigned long flags; 883 unsigned long flags;
884 884
885 unsigned int count; 885 unsigned int count;
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index d48ce9290963..064211d5f41b 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -228,10 +228,10 @@
228#include <asm/system.h> 228#include <asm/system.h>
229#include <asm/uaccess.h> 229#include <asm/uaccess.h>
230#include <asm/desc.h> 230#include <asm/desc.h>
231#include <asm/i8253.h>
231 232
232#include "io_ports.h" 233#include "io_ports.h"
233 234
234extern spinlock_t i8253_lock;
235extern unsigned long get_cmos_time(void); 235extern unsigned long get_cmos_time(void);
236extern void machine_real_restart(unsigned char *, int); 236extern void machine_real_restart(unsigned char *, int);
237 237
@@ -1168,8 +1168,7 @@ static void get_time_diff(void)
1168static void reinit_timer(void) 1168static void reinit_timer(void)
1169{ 1169{
1170#ifdef INIT_TIMER_AFTER_SUSPEND 1170#ifdef INIT_TIMER_AFTER_SUSPEND
1171 unsigned long flags; 1171 unsigned long flags;
1172 extern spinlock_t i8253_lock;
1173 1172
1174 spin_lock_irqsave(&i8253_lock, flags); 1173 spin_lock_irqsave(&i8253_lock, flags);
1175 /* set the clock to 100 Hz */ 1174 /* set the clock to 100 Hz */
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 35eb8e29c485..6578f40bd501 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -37,6 +37,7 @@
37#include <asm/smp.h> 37#include <asm/smp.h>
38#include <asm/desc.h> 38#include <asm/desc.h>
39#include <asm/timer.h> 39#include <asm/timer.h>
40#include <asm/i8259.h>
40 41
41#include <mach_apic.h> 42#include <mach_apic.h>
42 43
@@ -1566,7 +1567,6 @@ void print_all_local_APICs (void)
1566 1567
1567void /*__init*/ print_PIC(void) 1568void /*__init*/ print_PIC(void)
1568{ 1569{
1569 extern spinlock_t i8259A_lock;
1570 unsigned int v; 1570 unsigned int v;
1571 unsigned long flags; 1571 unsigned long flags;
1572 1572
diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
index e68d9fdb0759..2854c357377f 100644
--- a/arch/i386/kernel/time.c
+++ b/arch/i386/kernel/time.c
@@ -68,7 +68,8 @@
68 68
69#include "io_ports.h" 69#include "io_ports.h"
70 70
71extern spinlock_t i8259A_lock; 71#include <asm/i8259.h>
72
72int pit_latch_buggy; /* extern */ 73int pit_latch_buggy; /* extern */
73 74
74#include "do_timer.h" 75#include "do_timer.h"
@@ -85,6 +86,8 @@ extern unsigned long wall_jiffies;
85DEFINE_SPINLOCK(rtc_lock); 86DEFINE_SPINLOCK(rtc_lock);
86EXPORT_SYMBOL(rtc_lock); 87EXPORT_SYMBOL(rtc_lock);
87 88
89#include <asm/i8253.h>
90
88DEFINE_SPINLOCK(i8253_lock); 91DEFINE_SPINLOCK(i8253_lock);
89EXPORT_SYMBOL(i8253_lock); 92EXPORT_SYMBOL(i8253_lock);
90 93
diff --git a/arch/i386/kernel/timers/timer_cyclone.c b/arch/i386/kernel/timers/timer_cyclone.c
index f6f1206a11bb..13892a65c941 100644
--- a/arch/i386/kernel/timers/timer_cyclone.c
+++ b/arch/i386/kernel/timers/timer_cyclone.c
@@ -17,9 +17,9 @@
17#include <asm/io.h> 17#include <asm/io.h>
18#include <asm/pgtable.h> 18#include <asm/pgtable.h>
19#include <asm/fixmap.h> 19#include <asm/fixmap.h>
20#include "io_ports.h" 20#include <asm/i8253.h>
21 21
22extern spinlock_t i8253_lock; 22#include "io_ports.h"
23 23
24/* Number of usecs that the last interrupt was delayed */ 24/* Number of usecs that the last interrupt was delayed */
25static int delay_at_last_interrupt; 25static int delay_at_last_interrupt;
diff --git a/arch/i386/kernel/timers/timer_pit.c b/arch/i386/kernel/timers/timer_pit.c
index 967d5453cd0e..06de036a820c 100644
--- a/arch/i386/kernel/timers/timer_pit.c
+++ b/arch/i386/kernel/timers/timer_pit.c
@@ -15,9 +15,8 @@
15#include <asm/smp.h> 15#include <asm/smp.h>
16#include <asm/io.h> 16#include <asm/io.h>
17#include <asm/arch_hooks.h> 17#include <asm/arch_hooks.h>
18#include <asm/i8253.h>
18 19
19extern spinlock_t i8259A_lock;
20extern spinlock_t i8253_lock;
21#include "do_timer.h" 20#include "do_timer.h"
22#include "io_ports.h" 21#include "io_ports.h"
23 22
@@ -166,7 +165,6 @@ struct init_timer_opts __initdata timer_pit_init = {
166 165
167void setup_pit_timer(void) 166void setup_pit_timer(void)
168{ 167{
169 extern spinlock_t i8253_lock;
170 unsigned long flags; 168 unsigned long flags;
171 169
172 spin_lock_irqsave(&i8253_lock, flags); 170 spin_lock_irqsave(&i8253_lock, flags);
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index f46e625bab67..8f4e4d5bc560 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -24,6 +24,7 @@
24#include "mach_timer.h" 24#include "mach_timer.h"
25 25
26#include <asm/hpet.h> 26#include <asm/hpet.h>
27#include <asm/i8253.h>
27 28
28#ifdef CONFIG_HPET_TIMER 29#ifdef CONFIG_HPET_TIMER
29static unsigned long hpet_usec_quotient; 30static unsigned long hpet_usec_quotient;
@@ -35,8 +36,6 @@ static inline void cpufreq_delayed_get(void);
35 36
36int tsc_disable __devinitdata = 0; 37int tsc_disable __devinitdata = 0;
37 38
38extern spinlock_t i8253_lock;
39
40static int use_tsc; 39static int use_tsc;
41/* Number of usecs that the last interrupt was delayed */ 40/* Number of usecs that the last interrupt was delayed */
42static int delay_at_last_interrupt; 41static int delay_at_last_interrupt;
diff --git a/arch/i386/mach-voyager/voyager_basic.c b/arch/i386/mach-voyager/voyager_basic.c
index 602aea240e9b..3e439ce5e1b2 100644
--- a/arch/i386/mach-voyager/voyager_basic.c
+++ b/arch/i386/mach-voyager/voyager_basic.c
@@ -30,6 +30,7 @@
30#include <linux/irq.h> 30#include <linux/irq.h>
31#include <asm/tlbflush.h> 31#include <asm/tlbflush.h>
32#include <asm/arch_hooks.h> 32#include <asm/arch_hooks.h>
33#include <asm/i8253.h>
33 34
34/* 35/*
35 * Power off function, if any 36 * Power off function, if any
@@ -182,7 +183,6 @@ voyager_timer_interrupt(struct pt_regs *regs)
182 * and swiftly introduce it to something sharp and 183 * and swiftly introduce it to something sharp and
183 * pointy. */ 184 * pointy. */
184 __u16 val; 185 __u16 val;
185 extern spinlock_t i8253_lock;
186 186
187 spin_lock(&i8253_lock); 187 spin_lock(&i8253_lock);
188 188
diff --git a/arch/ppc/kernel/relocate_kernel.S b/arch/ppc/kernel/relocate_kernel.S
index 7ff69c4af920..9b2ad48e988c 100644
--- a/arch/ppc/kernel/relocate_kernel.S
+++ b/arch/ppc/kernel/relocate_kernel.S
@@ -34,9 +34,9 @@ relocate_new_kernel:
34 34
35 mr r8, r0 35 mr r8, r0
36 ori r8, r8, MSR_RI|MSR_ME 36 ori r8, r8, MSR_RI|MSR_ME
37 mtspr SRR1, r8 37 mtspr SPRN_SRR1, r8
38 addi r8, r4, 1f - relocate_new_kernel 38 addi r8, r4, 1f - relocate_new_kernel
39 mtspr SRR0, r8 39 mtspr SPRN_SRR0, r8
40 sync 40 sync
41 rfi 41 rfi
42 42
diff --git a/arch/ppc/platforms/85xx/mpc8540_ads.c b/arch/ppc/platforms/85xx/mpc8540_ads.c
index ddd2e9a5bb12..f761fdf160db 100644
--- a/arch/ppc/platforms/85xx/mpc8540_ads.c
+++ b/arch/ppc/platforms/85xx/mpc8540_ads.c
@@ -111,8 +111,8 @@ mpc8540ads_setup_arch(void)
111 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6); 111 memcpy(pdata->mac_addr, binfo->bi_enet1addr, 6);
112 } 112 }
113 113
114 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC);
114 if (pdata) { 115 if (pdata) {
115 pdata = (struct gianfar_platform_data *) ppc_sys_get_pdata(MPC85xx_FEC);
116 pdata->board_flags = 0; 116 pdata->board_flags = 0;
117 pdata->interruptPHY = MPC85xx_IRQ_EXT5; 117 pdata->interruptPHY = MPC85xx_IRQ_EXT5;
118 pdata->phyid = 3; 118 pdata->phyid = 3;
diff --git a/arch/ppc64/boot/Makefile b/arch/ppc64/boot/Makefile
index d3e1d6af9203..683b2d43c15f 100644
--- a/arch/ppc64/boot/Makefile
+++ b/arch/ppc64/boot/Makefile
@@ -52,7 +52,7 @@ obj-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.o, $(section)))
52src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.c, $(section))) 52src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.c, $(section)))
53gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section))) 53gz-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section)))
54 54
55hostprogs-y := piggy addnote addRamDisk 55hostprogs-y := addnote addRamDisk
56targets += zImage zImage.initrd imagesize.c \ 56targets += zImage zImage.initrd imagesize.c \
57 $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \ 57 $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \
58 $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \ 58 $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \
@@ -78,9 +78,6 @@ addsection = $(CROSS32OBJCOPY) $(1) \
78quiet_cmd_addnote = ADDNOTE $@ 78quiet_cmd_addnote = ADDNOTE $@
79 cmd_addnote = $(CROSS32LD) $(BOOTLFLAGS) -o $@ $(obj-boot) && $(obj)/addnote $@ 79 cmd_addnote = $(CROSS32LD) $(BOOTLFLAGS) -o $@ $(obj-boot) && $(obj)/addnote $@
80 80
81quiet_cmd_piggy = PIGGY $@
82 cmd_piggy = $(obj)/piggyback $(@:.o=) < $< | $(CROSS32AS) -o $@
83
84$(call gz-sec, $(required)): $(obj)/kernel-%.gz: % FORCE 81$(call gz-sec, $(required)): $(obj)/kernel-%.gz: % FORCE
85 $(call if_changed,gzip) 82 $(call if_changed,gzip)
86 83
diff --git a/arch/ppc64/boot/main.c b/arch/ppc64/boot/main.c
index da12ea2ca464..199d9804f61c 100644
--- a/arch/ppc64/boot/main.c
+++ b/arch/ppc64/boot/main.c
@@ -17,7 +17,6 @@
17 17
18extern void *finddevice(const char *); 18extern void *finddevice(const char *);
19extern int getprop(void *, const char *, void *, int); 19extern int getprop(void *, const char *, void *, int);
20extern void printk(char *fmt, ...);
21extern void printf(const char *fmt, ...); 20extern void printf(const char *fmt, ...);
22extern int sprintf(char *buf, const char *fmt, ...); 21extern int sprintf(char *buf, const char *fmt, ...);
23void gunzip(void *, int, unsigned char *, int *); 22void gunzip(void *, int, unsigned char *, int *);
@@ -147,10 +146,10 @@ void start(unsigned long a1, unsigned long a2, void *promptr)
147 } 146 }
148 a1 = initrd.addr; 147 a1 = initrd.addr;
149 a2 = initrd.size; 148 a2 = initrd.size;
150 printf("initial ramdisk moving 0x%lx <- 0x%lx (%lx bytes)\n\r", 149 printf("initial ramdisk moving 0x%lx <- 0x%lx (0x%lx bytes)\n\r",
151 initrd.addr, (unsigned long)_initrd_start, initrd.size); 150 initrd.addr, (unsigned long)_initrd_start, initrd.size);
152 memmove((void *)initrd.addr, (void *)_initrd_start, initrd.size); 151 memmove((void *)initrd.addr, (void *)_initrd_start, initrd.size);
153 printf("initrd head: 0x%lx\n\r", *((u32 *)initrd.addr)); 152 printf("initrd head: 0x%lx\n\r", *((unsigned long *)initrd.addr));
154 } 153 }
155 154
156 /* Eventually gunzip the kernel */ 155 /* Eventually gunzip the kernel */
@@ -201,9 +200,6 @@ void start(unsigned long a1, unsigned long a2, void *promptr)
201 200
202 flush_cache((void *)vmlinux.addr, vmlinux.size); 201 flush_cache((void *)vmlinux.addr, vmlinux.size);
203 202
204 if (a1)
205 printf("initrd head: 0x%lx\n\r", *((u32 *)initrd.addr));
206
207 kernel_entry = (kernel_entry_t)vmlinux.addr; 203 kernel_entry = (kernel_entry_t)vmlinux.addr;
208#ifdef DEBUG 204#ifdef DEBUG
209 printf( "kernel:\n\r" 205 printf( "kernel:\n\r"
diff --git a/arch/ppc64/boot/mknote.c b/arch/ppc64/boot/mknote.c
deleted file mode 100644
index 120cc1d89739..000000000000
--- a/arch/ppc64/boot/mknote.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * Copyright (C) Cort Dougan 1999.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 *
9 * Generate a note section as per the CHRP specification.
10 *
11 */
12
13#include <stdio.h>
14
15#define PL(x) printf("%c%c%c%c", ((x)>>24)&0xff, ((x)>>16)&0xff, ((x)>>8)&0xff, (x)&0xff );
16
17int main(void)
18{
19/* header */
20 /* namesz */
21 PL(strlen("PowerPC")+1);
22 /* descrsz */
23 PL(6*4);
24 /* type */
25 PL(0x1275);
26 /* name */
27 printf("PowerPC"); printf("%c", 0);
28
29/* descriptor */
30 /* real-mode */
31 PL(0xffffffff);
32 /* real-base */
33 PL(0x00c00000);
34 /* real-size */
35 PL(0xffffffff);
36 /* virt-base */
37 PL(0xffffffff);
38 /* virt-size */
39 PL(0xffffffff);
40 /* load-base */
41 PL(0x4000);
42 return 0;
43}
diff --git a/arch/ppc64/boot/piggyback.c b/arch/ppc64/boot/piggyback.c
deleted file mode 100644
index 235c7a87269c..000000000000
--- a/arch/ppc64/boot/piggyback.c
+++ /dev/null
@@ -1,83 +0,0 @@
1/*
2 * Copyright 2001 IBM Corp
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9#include <stdio.h>
10#include <unistd.h>
11#include <string.h>
12
13extern long ce_exec_config[];
14
15int main(int argc, char *argv[])
16{
17 int i, cnt, pos, len;
18 unsigned int cksum, val;
19 unsigned char *lp;
20 unsigned char buf[8192];
21 char *varname;
22 if (argc != 2)
23 {
24 fprintf(stderr, "usage: %s name <in-file >out-file\n",
25 argv[0]);
26 exit(1);
27 }
28
29 varname = strrchr(argv[1], '/');
30 if (varname)
31 varname++;
32 else
33 varname = argv[1];
34
35 fprintf(stdout, "#\n");
36 fprintf(stdout, "# Miscellaneous data structures:\n");
37 fprintf(stdout, "# WARNING - this file is automatically generated!\n");
38 fprintf(stdout, "#\n");
39 fprintf(stdout, "\n");
40 fprintf(stdout, "\t.data\n");
41 fprintf(stdout, "\t.globl %s_data\n", varname);
42 fprintf(stdout, "%s_data:\n", varname);
43 pos = 0;
44 cksum = 0;
45 while ((len = read(0, buf, sizeof(buf))) > 0)
46 {
47 cnt = 0;
48 lp = (unsigned char *)buf;
49 len = (len + 3) & ~3; /* Round up to longwords */
50 for (i = 0; i < len; i += 4)
51 {
52 if (cnt == 0)
53 {
54 fprintf(stdout, "\t.long\t");
55 }
56 fprintf(stdout, "0x%02X%02X%02X%02X", lp[0], lp[1], lp[2], lp[3]);
57 val = *(unsigned long *)lp;
58 cksum ^= val;
59 lp += 4;
60 if (++cnt == 4)
61 {
62 cnt = 0;
63 fprintf(stdout, " # %x \n", pos+i-12);
64 fflush(stdout);
65 } else
66 {
67 fprintf(stdout, ",");
68 }
69 }
70 if (cnt)
71 {
72 fprintf(stdout, "0\n");
73 }
74 pos += len;
75 }
76 fprintf(stdout, "\t.globl %s_len\n", varname);
77 fprintf(stdout, "%s_len:\t.long\t0x%x\n", varname, pos);
78 fflush(stdout);
79 fclose(stdout);
80 fprintf(stderr, "cksum = %x\n", cksum);
81 exit(0);
82}
83
diff --git a/arch/ppc64/boot/prom.c b/arch/ppc64/boot/prom.c
index d5218b15824e..5e48b80ff5a0 100644
--- a/arch/ppc64/boot/prom.c
+++ b/arch/ppc64/boot/prom.c
@@ -40,7 +40,7 @@ void *finddevice(const char *name);
40int getprop(void *phandle, const char *name, void *buf, int buflen); 40int getprop(void *phandle, const char *name, void *buf, int buflen);
41void chrpboot(int a1, int a2, void *prom); /* in main.c */ 41void chrpboot(int a1, int a2, void *prom); /* in main.c */
42 42
43void printk(char *fmt, ...); 43int printf(char *fmt, ...);
44 44
45/* there is no convenient header to get this from... -- paulus */ 45/* there is no convenient header to get this from... -- paulus */
46extern unsigned long strlen(const char *); 46extern unsigned long strlen(const char *);
@@ -220,7 +220,7 @@ readchar(void)
220 case 1: 220 case 1:
221 return ch; 221 return ch;
222 case -1: 222 case -1:
223 printk("read(stdin) returned -1\r\n"); 223 printf("read(stdin) returned -1\r\n");
224 return -1; 224 return -1;
225 } 225 }
226 } 226 }
@@ -627,18 +627,6 @@ int sprintf(char * buf, const char *fmt, ...)
627 627
628static char sprint_buf[1024]; 628static char sprint_buf[1024];
629 629
630void
631printk(char *fmt, ...)
632{
633 va_list args;
634 int n;
635
636 va_start(args, fmt);
637 n = vsprintf(sprint_buf, fmt, args);
638 va_end(args);
639 write(stdout, sprint_buf, n);
640}
641
642int 630int
643printf(char *fmt, ...) 631printf(char *fmt, ...)
644{ 632{
diff --git a/arch/ppc64/kernel/ItLpQueue.c b/arch/ppc64/kernel/ItLpQueue.c
index cdea00d7707f..4231861288a3 100644
--- a/arch/ppc64/kernel/ItLpQueue.c
+++ b/arch/ppc64/kernel/ItLpQueue.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * ItLpQueue.c 2 * ItLpQueue.c
3 * Copyright (C) 2001 Mike Corrigan IBM Corporation 3 * Copyright (C) 2001 Mike Corrigan IBM Corporation
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or 7 * the Free Software Foundation; either version 2 of the License, or
@@ -11,156 +11,252 @@
11#include <linux/stddef.h> 11#include <linux/stddef.h>
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/bootmem.h>
15#include <linux/seq_file.h>
16#include <linux/proc_fs.h>
14#include <asm/system.h> 17#include <asm/system.h>
15#include <asm/paca.h> 18#include <asm/paca.h>
16#include <asm/iSeries/ItLpQueue.h> 19#include <asm/iSeries/ItLpQueue.h>
17#include <asm/iSeries/HvLpEvent.h> 20#include <asm/iSeries/HvLpEvent.h>
18#include <asm/iSeries/HvCallEvent.h> 21#include <asm/iSeries/HvCallEvent.h>
19 22
20static __inline__ int set_inUse( struct ItLpQueue * lpQueue ) 23/*
21{ 24 * The LpQueue is used to pass event data from the hypervisor to
22 int t; 25 * the partition. This is where I/O interrupt events are communicated.
23 u32 * inUseP = &(lpQueue->xInUseWord); 26 *
24 27 * It is written to by the hypervisor so cannot end up in the BSS.
25 __asm__ __volatile__("\n\ 28 */
261: lwarx %0,0,%2 \n\ 29struct hvlpevent_queue hvlpevent_queue __attribute__((__section__(".data")));
27 cmpwi 0,%0,0 \n\
28 li %0,0 \n\
29 bne- 2f \n\
30 addi %0,%0,1 \n\
31 stwcx. %0,0,%2 \n\
32 bne- 1b \n\
332: eieio"
34 : "=&r" (t), "=m" (lpQueue->xInUseWord)
35 : "r" (inUseP), "m" (lpQueue->xInUseWord)
36 : "cc");
37
38 return t;
39}
40 30
41static __inline__ void clear_inUse( struct ItLpQueue * lpQueue ) 31DEFINE_PER_CPU(unsigned long[HvLpEvent_Type_NumTypes], hvlpevent_counts);
42{ 32
43 lpQueue->xInUseWord = 0; 33static char *event_types[HvLpEvent_Type_NumTypes] = {
44} 34 "Hypervisor",
35 "Machine Facilities",
36 "Session Manager",
37 "SPD I/O",
38 "Virtual Bus",
39 "PCI I/O",
40 "RIO I/O",
41 "Virtual Lan",
42 "Virtual I/O"
43};
45 44
46/* Array of LpEvent handler functions */ 45/* Array of LpEvent handler functions */
47extern LpEventHandler lpEventHandler[HvLpEvent_Type_NumTypes]; 46extern LpEventHandler lpEventHandler[HvLpEvent_Type_NumTypes];
48unsigned long ItLpQueueInProcess = 0;
49 47
50struct HvLpEvent * ItLpQueue_getNextLpEvent( struct ItLpQueue * lpQueue ) 48static struct HvLpEvent * get_next_hvlpevent(void)
51{ 49{
52 struct HvLpEvent * nextLpEvent = 50 struct HvLpEvent * event;
53 (struct HvLpEvent *)lpQueue->xSlicCurEventPtr; 51 event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr;
54 if ( nextLpEvent->xFlags.xValid ) { 52
53 if (event->xFlags.xValid) {
55 /* rmb() needed only for weakly consistent machines (regatta) */ 54 /* rmb() needed only for weakly consistent machines (regatta) */
56 rmb(); 55 rmb();
57 /* Set pointer to next potential event */ 56 /* Set pointer to next potential event */
58 lpQueue->xSlicCurEventPtr += ((nextLpEvent->xSizeMinus1 + 57 hvlpevent_queue.xSlicCurEventPtr += ((event->xSizeMinus1 +
59 LpEventAlign ) / 58 LpEventAlign) / LpEventAlign) * LpEventAlign;
60 LpEventAlign ) * 59
61 LpEventAlign;
62 /* Wrap to beginning if no room at end */ 60 /* Wrap to beginning if no room at end */
63 if (lpQueue->xSlicCurEventPtr > lpQueue->xSlicLastValidEventPtr) 61 if (hvlpevent_queue.xSlicCurEventPtr >
64 lpQueue->xSlicCurEventPtr = lpQueue->xSlicEventStackPtr; 62 hvlpevent_queue.xSlicLastValidEventPtr) {
63 hvlpevent_queue.xSlicCurEventPtr =
64 hvlpevent_queue.xSlicEventStackPtr;
65 }
66 } else {
67 event = NULL;
65 } 68 }
66 else
67 nextLpEvent = NULL;
68 69
69 return nextLpEvent; 70 return event;
70} 71}
71 72
72int ItLpQueue_isLpIntPending( struct ItLpQueue * lpQueue ) 73static unsigned long spread_lpevents = NR_CPUS;
74
75int hvlpevent_is_pending(void)
73{ 76{
74 int retval = 0; 77 struct HvLpEvent *next_event;
75 struct HvLpEvent * nextLpEvent; 78
76 if ( lpQueue ) { 79 if (smp_processor_id() >= spread_lpevents)
77 nextLpEvent = (struct HvLpEvent *)lpQueue->xSlicCurEventPtr; 80 return 0;
78 retval = nextLpEvent->xFlags.xValid | lpQueue->xPlicOverflowIntPending; 81
79 } 82 next_event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr;
80 return retval; 83
84 return next_event->xFlags.xValid |
85 hvlpevent_queue.xPlicOverflowIntPending;
81} 86}
82 87
83void ItLpQueue_clearValid( struct HvLpEvent * event ) 88static void hvlpevent_clear_valid(struct HvLpEvent * event)
84{ 89{
85 /* Clear the valid bit of the event 90 /* Tell the Hypervisor that we're done with this event.
86 * Also clear bits within this event that might 91 * Also clear bits within this event that might look like valid bits.
87 * look like valid bits (on 64-byte boundaries) 92 * ie. on 64-byte boundaries.
88 */ 93 */
89 unsigned extra = (( event->xSizeMinus1 + LpEventAlign ) / 94 struct HvLpEvent *tmp;
90 LpEventAlign ) - 1; 95 unsigned extra = ((event->xSizeMinus1 + LpEventAlign) /
91 switch ( extra ) { 96 LpEventAlign) - 1;
92 case 3: 97
93 ((struct HvLpEvent*)((char*)event+3*LpEventAlign))->xFlags.xValid=0; 98 switch (extra) {
94 case 2: 99 case 3:
95 ((struct HvLpEvent*)((char*)event+2*LpEventAlign))->xFlags.xValid=0; 100 tmp = (struct HvLpEvent*)((char*)event + 3 * LpEventAlign);
96 case 1: 101 tmp->xFlags.xValid = 0;
97 ((struct HvLpEvent*)((char*)event+1*LpEventAlign))->xFlags.xValid=0; 102 case 2:
98 case 0: 103 tmp = (struct HvLpEvent*)((char*)event + 2 * LpEventAlign);
99 ; 104 tmp->xFlags.xValid = 0;
105 case 1:
106 tmp = (struct HvLpEvent*)((char*)event + 1 * LpEventAlign);
107 tmp->xFlags.xValid = 0;
100 } 108 }
109
101 mb(); 110 mb();
111
102 event->xFlags.xValid = 0; 112 event->xFlags.xValid = 0;
103} 113}
104 114
105unsigned ItLpQueue_process( struct ItLpQueue * lpQueue, struct pt_regs *regs ) 115void process_hvlpevents(struct pt_regs *regs)
106{ 116{
107 unsigned numIntsProcessed = 0; 117 struct HvLpEvent * event;
108 struct HvLpEvent * nextLpEvent;
109 118
110 /* If we have recursed, just return */ 119 /* If we have recursed, just return */
111 if ( !set_inUse( lpQueue ) ) 120 if (!spin_trylock(&hvlpevent_queue.lock))
112 return 0; 121 return;
113
114 if (ItLpQueueInProcess == 0)
115 ItLpQueueInProcess = 1;
116 else
117 BUG();
118 122
119 for (;;) { 123 for (;;) {
120 nextLpEvent = ItLpQueue_getNextLpEvent( lpQueue ); 124 event = get_next_hvlpevent();
121 if ( nextLpEvent ) { 125 if (event) {
122 /* Count events to return to caller 126 /* Call appropriate handler here, passing
123 * and count processed events in lpQueue
124 */
125 ++numIntsProcessed;
126 lpQueue->xLpIntCount++;
127 /* Call appropriate handler here, passing
128 * a pointer to the LpEvent. The handler 127 * a pointer to the LpEvent. The handler
129 * must make a copy of the LpEvent if it 128 * must make a copy of the LpEvent if it
130 * needs it in a bottom half. (perhaps for 129 * needs it in a bottom half. (perhaps for
131 * an ACK) 130 * an ACK)
132 * 131 *
133 * Handlers are responsible for ACK processing 132 * Handlers are responsible for ACK processing
134 * 133 *
135 * The Hypervisor guarantees that LpEvents will 134 * The Hypervisor guarantees that LpEvents will
136 * only be delivered with types that we have 135 * only be delivered with types that we have
137 * registered for, so no type check is necessary 136 * registered for, so no type check is necessary
138 * here! 137 * here!
139 */ 138 */
140 if ( nextLpEvent->xType < HvLpEvent_Type_NumTypes ) 139 if (event->xType < HvLpEvent_Type_NumTypes)
141 lpQueue->xLpIntCountByType[nextLpEvent->xType]++; 140 __get_cpu_var(hvlpevent_counts)[event->xType]++;
142 if ( nextLpEvent->xType < HvLpEvent_Type_NumTypes && 141 if (event->xType < HvLpEvent_Type_NumTypes &&
143 lpEventHandler[nextLpEvent->xType] ) 142 lpEventHandler[event->xType])
144 lpEventHandler[nextLpEvent->xType](nextLpEvent, regs); 143 lpEventHandler[event->xType](event, regs);
145 else 144 else
146 printk(KERN_INFO "Unexpected Lp Event type=%d\n", nextLpEvent->xType ); 145 printk(KERN_INFO "Unexpected Lp Event type=%d\n", event->xType );
147 146
148 ItLpQueue_clearValid( nextLpEvent ); 147 hvlpevent_clear_valid(event);
149 } else if ( lpQueue->xPlicOverflowIntPending ) 148 } else if (hvlpevent_queue.xPlicOverflowIntPending)
150 /* 149 /*
151 * No more valid events. If overflow events are 150 * No more valid events. If overflow events are
152 * pending process them 151 * pending process them
153 */ 152 */
154 HvCallEvent_getOverflowLpEvents( lpQueue->xIndex); 153 HvCallEvent_getOverflowLpEvents(hvlpevent_queue.xIndex);
155 else 154 else
156 break; 155 break;
157 } 156 }
158 157
159 ItLpQueueInProcess = 0; 158 spin_unlock(&hvlpevent_queue.lock);
160 mb(); 159}
161 clear_inUse( lpQueue ); 160
161static int set_spread_lpevents(char *str)
162{
163 unsigned long val = simple_strtoul(str, NULL, 0);
164
165 /*
166 * The parameter is the number of processors to share in processing
167 * lp events.
168 */
169 if (( val > 0) && (val <= NR_CPUS)) {
170 spread_lpevents = val;
171 printk("lpevent processing spread over %ld processors\n", val);
172 } else {
173 printk("invalid spread_lpevents %ld\n", val);
174 }
162 175
163 get_paca()->lpevent_count += numIntsProcessed; 176 return 1;
177}
178__setup("spread_lpevents=", set_spread_lpevents);
179
180void setup_hvlpevent_queue(void)
181{
182 void *eventStack;
183
184 /*
185 * Allocate a page for the Event Stack. The Hypervisor needs the
186 * absolute real address, so we subtract out the KERNELBASE and add
187 * in the absolute real address of the kernel load area.
188 */
189 eventStack = alloc_bootmem_pages(LpEventStackSize);
190 memset(eventStack, 0, LpEventStackSize);
191
192 /* Invoke the hypervisor to initialize the event stack */
193 HvCallEvent_setLpEventStack(0, eventStack, LpEventStackSize);
194
195 hvlpevent_queue.xSlicEventStackPtr = (char *)eventStack;
196 hvlpevent_queue.xSlicCurEventPtr = (char *)eventStack;
197 hvlpevent_queue.xSlicLastValidEventPtr = (char *)eventStack +
198 (LpEventStackSize - LpEventMaxSize);
199 hvlpevent_queue.xIndex = 0;
200}
201
202static int proc_lpevents_show(struct seq_file *m, void *v)
203{
204 int cpu, i;
205 unsigned long sum;
206 static unsigned long cpu_totals[NR_CPUS];
207
208 /* FIXME: do we care that there's no locking here? */
209 sum = 0;
210 for_each_online_cpu(cpu) {
211 cpu_totals[cpu] = 0;
212 for (i = 0; i < HvLpEvent_Type_NumTypes; i++) {
213 cpu_totals[cpu] += per_cpu(hvlpevent_counts, cpu)[i];
214 }
215 sum += cpu_totals[cpu];
216 }
217
218 seq_printf(m, "LpEventQueue 0\n");
219 seq_printf(m, " events processed:\t%lu\n", sum);
220
221 for (i = 0; i < HvLpEvent_Type_NumTypes; ++i) {
222 sum = 0;
223 for_each_online_cpu(cpu) {
224 sum += per_cpu(hvlpevent_counts, cpu)[i];
225 }
226
227 seq_printf(m, " %-20s %10lu\n", event_types[i], sum);
228 }
229
230 seq_printf(m, "\n events processed by processor:\n");
231
232 for_each_online_cpu(cpu) {
233 seq_printf(m, " CPU%02d %10lu\n", cpu, cpu_totals[cpu]);
234 }
235
236 return 0;
237}
238
239static int proc_lpevents_open(struct inode *inode, struct file *file)
240{
241 return single_open(file, proc_lpevents_show, NULL);
242}
164 243
165 return numIntsProcessed; 244static struct file_operations proc_lpevents_operations = {
245 .open = proc_lpevents_open,
246 .read = seq_read,
247 .llseek = seq_lseek,
248 .release = single_release,
249};
250
251static int __init proc_lpevents_init(void)
252{
253 struct proc_dir_entry *e;
254
255 e = create_proc_entry("iSeries/lpevents", S_IFREG|S_IRUGO, NULL);
256 if (e)
257 e->proc_fops = &proc_lpevents_operations;
258
259 return 0;
166} 260}
261__initcall(proc_lpevents_init);
262
diff --git a/arch/ppc64/kernel/LparData.c b/arch/ppc64/kernel/LparData.c
index badc5a443614..6ffcf67dd507 100644
--- a/arch/ppc64/kernel/LparData.c
+++ b/arch/ppc64/kernel/LparData.c
@@ -28,13 +28,6 @@
28#include <asm/iSeries/IoHriProcessorVpd.h> 28#include <asm/iSeries/IoHriProcessorVpd.h>
29#include <asm/iSeries/ItSpCommArea.h> 29#include <asm/iSeries/ItSpCommArea.h>
30 30
31/* The LpQueue is used to pass event data from the hypervisor to
32 * the partition. This is where I/O interrupt events are communicated.
33 */
34
35/* May be filled in by the hypervisor so cannot end up in the BSS */
36struct ItLpQueue xItLpQueue __attribute__((__section__(".data")));
37
38 31
39/* The HvReleaseData is the root of the information shared between 32/* The HvReleaseData is the root of the information shared between
40 * the hypervisor and Linux. 33 * the hypervisor and Linux.
@@ -200,7 +193,7 @@ struct ItVpdAreas itVpdAreas = {
200 0,0,0, /* 13 - 15 */ 193 0,0,0, /* 13 - 15 */
201 sizeof(struct IoHriProcessorVpd),/* 16 length of Proc Vpd */ 194 sizeof(struct IoHriProcessorVpd),/* 16 length of Proc Vpd */
202 0,0,0,0,0,0, /* 17 - 22 */ 195 0,0,0,0,0,0, /* 17 - 22 */
203 sizeof(struct ItLpQueue),/* 23 length of Lp Queue */ 196 sizeof(struct hvlpevent_queue), /* 23 length of Lp Queue */
204 0,0 /* 24 - 25 */ 197 0,0 /* 24 - 25 */
205 }, 198 },
206 .xSlicVpdAdrs = { /* VPD addresses */ 199 .xSlicVpdAdrs = { /* VPD addresses */
@@ -218,7 +211,7 @@ struct ItVpdAreas itVpdAreas = {
218 0,0,0, /* 13 - 15 */ 211 0,0,0, /* 13 - 15 */
219 &xIoHriProcessorVpd, /* 16 Proc Vpd */ 212 &xIoHriProcessorVpd, /* 16 Proc Vpd */
220 0,0,0,0,0,0, /* 17 - 22 */ 213 0,0,0,0,0,0, /* 17 - 22 */
221 &xItLpQueue, /* 23 Lp Queue */ 214 &hvlpevent_queue, /* 23 Lp Queue */
222 0,0 215 0,0
223 } 216 }
224}; 217};
diff --git a/arch/ppc64/kernel/iSeries_proc.c b/arch/ppc64/kernel/iSeries_proc.c
index 356bd9931fcc..0fe3116eba29 100644
--- a/arch/ppc64/kernel/iSeries_proc.c
+++ b/arch/ppc64/kernel/iSeries_proc.c
@@ -40,50 +40,6 @@ static int __init iseries_proc_create(void)
40} 40}
41core_initcall(iseries_proc_create); 41core_initcall(iseries_proc_create);
42 42
43static char *event_types[9] = {
44 "Hypervisor\t\t",
45 "Machine Facilities\t",
46 "Session Manager\t",
47 "SPD I/O\t\t",
48 "Virtual Bus\t\t",
49 "PCI I/O\t\t",
50 "RIO I/O\t\t",
51 "Virtual Lan\t\t",
52 "Virtual I/O\t\t"
53};
54
55static int proc_lpevents_show(struct seq_file *m, void *v)
56{
57 unsigned int i;
58
59 seq_printf(m, "LpEventQueue 0\n");
60 seq_printf(m, " events processed:\t%lu\n",
61 (unsigned long)xItLpQueue.xLpIntCount);
62
63 for (i = 0; i < 9; ++i)
64 seq_printf(m, " %s %10lu\n", event_types[i],
65 (unsigned long)xItLpQueue.xLpIntCountByType[i]);
66
67 seq_printf(m, "\n events processed by processor:\n");
68
69 for_each_online_cpu(i)
70 seq_printf(m, " CPU%02d %10u\n", i, paca[i].lpevent_count);
71
72 return 0;
73}
74
75static int proc_lpevents_open(struct inode *inode, struct file *file)
76{
77 return single_open(file, proc_lpevents_show, NULL);
78}
79
80static struct file_operations proc_lpevents_operations = {
81 .open = proc_lpevents_open,
82 .read = seq_read,
83 .llseek = seq_lseek,
84 .release = single_release,
85};
86
87static unsigned long startTitan = 0; 43static unsigned long startTitan = 0;
88static unsigned long startTb = 0; 44static unsigned long startTb = 0;
89 45
@@ -148,10 +104,6 @@ static int __init iseries_proc_init(void)
148{ 104{
149 struct proc_dir_entry *e; 105 struct proc_dir_entry *e;
150 106
151 e = create_proc_entry("iSeries/lpevents", S_IFREG|S_IRUGO, NULL);
152 if (e)
153 e->proc_fops = &proc_lpevents_operations;
154
155 e = create_proc_entry("iSeries/titanTod", S_IFREG|S_IRUGO, NULL); 107 e = create_proc_entry("iSeries/titanTod", S_IFREG|S_IRUGO, NULL);
156 if (e) 108 if (e)
157 e->proc_fops = &proc_titantod_operations; 109 e->proc_fops = &proc_titantod_operations;
diff --git a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c
index 86966ce76b58..b3f770f6d402 100644
--- a/arch/ppc64/kernel/iSeries_setup.c
+++ b/arch/ppc64/kernel/iSeries_setup.c
@@ -24,7 +24,6 @@
24#include <linux/smp.h> 24#include <linux/smp.h>
25#include <linux/param.h> 25#include <linux/param.h>
26#include <linux/string.h> 26#include <linux/string.h>
27#include <linux/bootmem.h>
28#include <linux/initrd.h> 27#include <linux/initrd.h>
29#include <linux/seq_file.h> 28#include <linux/seq_file.h>
30#include <linux/kdev_t.h> 29#include <linux/kdev_t.h>
@@ -676,7 +675,6 @@ static void __init iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr)
676 */ 675 */
677static void __init iSeries_setup_arch(void) 676static void __init iSeries_setup_arch(void)
678{ 677{
679 void *eventStack;
680 unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index; 678 unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index;
681 679
682 /* Add an eye catcher and the systemcfg layout version number */ 680 /* Add an eye catcher and the systemcfg layout version number */
@@ -685,24 +683,7 @@ static void __init iSeries_setup_arch(void)
685 systemcfg->version.minor = SYSTEMCFG_MINOR; 683 systemcfg->version.minor = SYSTEMCFG_MINOR;
686 684
687 /* Setup the Lp Event Queue */ 685 /* Setup the Lp Event Queue */
688 686 setup_hvlpevent_queue();
689 /* Allocate a page for the Event Stack
690 * The hypervisor wants the absolute real address, so
691 * we subtract out the KERNELBASE and add in the
692 * absolute real address of the kernel load area
693 */
694 eventStack = alloc_bootmem_pages(LpEventStackSize);
695 memset(eventStack, 0, LpEventStackSize);
696
697 /* Invoke the hypervisor to initialize the event stack */
698 HvCallEvent_setLpEventStack(0, eventStack, LpEventStackSize);
699
700 /* Initialize fields in our Lp Event Queue */
701 xItLpQueue.xSlicEventStackPtr = (char *)eventStack;
702 xItLpQueue.xSlicCurEventPtr = (char *)eventStack;
703 xItLpQueue.xSlicLastValidEventPtr = (char *)eventStack +
704 (LpEventStackSize - LpEventMaxSize);
705 xItLpQueue.xIndex = 0;
706 687
707 /* Compute processor frequency */ 688 /* Compute processor frequency */
708 procFreqHz = ((1UL << 34) * 1000000) / 689 procFreqHz = ((1UL << 34) * 1000000) /
@@ -853,28 +834,6 @@ static int __init iSeries_src_init(void)
853 834
854late_initcall(iSeries_src_init); 835late_initcall(iSeries_src_init);
855 836
856static int set_spread_lpevents(char *str)
857{
858 unsigned long i;
859 unsigned long val = simple_strtoul(str, NULL, 0);
860
861 /*
862 * The parameter is the number of processors to share in processing
863 * lp events.
864 */
865 if (( val > 0) && (val <= NR_CPUS)) {
866 for (i = 1; i < val; ++i)
867 paca[i].lpqueue_ptr = paca[0].lpqueue_ptr;
868
869 printk("lpevent processing spread over %ld processors\n", val);
870 } else {
871 printk("invalid spread_lpevents %ld\n", val);
872 }
873
874 return 1;
875}
876__setup("spread_lpevents=", set_spread_lpevents);
877
878#ifndef CONFIG_PCI 837#ifndef CONFIG_PCI
879void __init iSeries_init_IRQ(void) { } 838void __init iSeries_init_IRQ(void) { }
880#endif 839#endif
diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c
index bdf13b4dc1c8..08952c7e6216 100644
--- a/arch/ppc64/kernel/idle.c
+++ b/arch/ppc64/kernel/idle.c
@@ -88,7 +88,7 @@ static int iSeries_idle(void)
88 88
89 while (1) { 89 while (1) {
90 if (lpaca->lppaca.shared_proc) { 90 if (lpaca->lppaca.shared_proc) {
91 if (ItLpQueue_isLpIntPending(lpaca->lpqueue_ptr)) 91 if (hvlpevent_is_pending())
92 process_iSeries_events(); 92 process_iSeries_events();
93 if (!need_resched()) 93 if (!need_resched())
94 yield_shared_processor(); 94 yield_shared_processor();
@@ -100,7 +100,7 @@ static int iSeries_idle(void)
100 100
101 while (!need_resched()) { 101 while (!need_resched()) {
102 HMT_medium(); 102 HMT_medium();
103 if (ItLpQueue_isLpIntPending(lpaca->lpqueue_ptr)) 103 if (hvlpevent_is_pending())
104 process_iSeries_events(); 104 process_iSeries_events();
105 HMT_low(); 105 HMT_low();
106 } 106 }
diff --git a/arch/ppc64/kernel/irq.c b/arch/ppc64/kernel/irq.c
index ffe300611f00..f41afe545045 100644
--- a/arch/ppc64/kernel/irq.c
+++ b/arch/ppc64/kernel/irq.c
@@ -66,7 +66,6 @@ EXPORT_SYMBOL(irq_desc);
66int distribute_irqs = 1; 66int distribute_irqs = 1;
67int __irq_offset_value; 67int __irq_offset_value;
68int ppc_spurious_interrupts; 68int ppc_spurious_interrupts;
69unsigned long lpevent_count;
70u64 ppc64_interrupt_controller; 69u64 ppc64_interrupt_controller;
71 70
72int show_interrupts(struct seq_file *p, void *v) 71int show_interrupts(struct seq_file *p, void *v)
@@ -269,7 +268,6 @@ out:
269void do_IRQ(struct pt_regs *regs) 268void do_IRQ(struct pt_regs *regs)
270{ 269{
271 struct paca_struct *lpaca; 270 struct paca_struct *lpaca;
272 struct ItLpQueue *lpq;
273 271
274 irq_enter(); 272 irq_enter();
275 273
@@ -295,9 +293,8 @@ void do_IRQ(struct pt_regs *regs)
295 iSeries_smp_message_recv(regs); 293 iSeries_smp_message_recv(regs);
296 } 294 }
297#endif /* CONFIG_SMP */ 295#endif /* CONFIG_SMP */
298 lpq = lpaca->lpqueue_ptr; 296 if (hvlpevent_is_pending())
299 if (lpq && ItLpQueue_isLpIntPending(lpq)) 297 process_hvlpevents(regs);
300 lpevent_count += ItLpQueue_process(lpq, regs);
301 298
302 irq_exit(); 299 irq_exit();
303 300
diff --git a/arch/ppc64/kernel/mf.c b/arch/ppc64/kernel/mf.c
index d98bebf7042f..ef4a338ebd01 100644
--- a/arch/ppc64/kernel/mf.c
+++ b/arch/ppc64/kernel/mf.c
@@ -801,10 +801,8 @@ int mf_get_boot_rtc(struct rtc_time *tm)
801 return rc; 801 return rc;
802 /* We need to poll here as we are not yet taking interrupts */ 802 /* We need to poll here as we are not yet taking interrupts */
803 while (rtc_data.busy) { 803 while (rtc_data.busy) {
804 extern unsigned long lpevent_count; 804 if (hvlpevent_is_pending())
805 struct ItLpQueue *lpq = get_paca()->lpqueue_ptr; 805 process_hvlpevents(NULL);
806 if (lpq && ItLpQueue_isLpIntPending(lpq))
807 lpevent_count += ItLpQueue_process(lpq, NULL);
808 } 806 }
809 return rtc_set_tm(rtc_data.rc, rtc_data.ce_msg.ce_msg, tm); 807 return rtc_set_tm(rtc_data.rc, rtc_data.ce_msg.ce_msg, tm);
810} 808}
diff --git a/arch/ppc64/kernel/nvram.c b/arch/ppc64/kernel/nvram.c
index 4e71781a4414..4fb1a9f5060d 100644
--- a/arch/ppc64/kernel/nvram.c
+++ b/arch/ppc64/kernel/nvram.c
@@ -338,9 +338,8 @@ static int nvram_remove_os_partition(void)
338 */ 338 */
339static int nvram_create_os_partition(void) 339static int nvram_create_os_partition(void)
340{ 340{
341 struct list_head * p; 341 struct nvram_partition *part;
342 struct nvram_partition *part = NULL; 342 struct nvram_partition *new_part;
343 struct nvram_partition *new_part = NULL;
344 struct nvram_partition *free_part = NULL; 343 struct nvram_partition *free_part = NULL;
345 int seq_init[2] = { 0, 0 }; 344 int seq_init[2] = { 0, 0 };
346 loff_t tmp_index; 345 loff_t tmp_index;
@@ -349,8 +348,7 @@ static int nvram_create_os_partition(void)
349 348
350 /* Find a free partition that will give us the maximum needed size 349 /* Find a free partition that will give us the maximum needed size
351 If can't find one that will give us the minimum size needed */ 350 If can't find one that will give us the minimum size needed */
352 list_for_each(p, &nvram_part->partition) { 351 list_for_each_entry(part, &nvram_part->partition, partition) {
353 part = list_entry(p, struct nvram_partition, partition);
354 if (part->header.signature != NVRAM_SIG_FREE) 352 if (part->header.signature != NVRAM_SIG_FREE)
355 continue; 353 continue;
356 354
diff --git a/arch/ppc64/kernel/pacaData.c b/arch/ppc64/kernel/pacaData.c
index a3e0975c26c1..6316188737b6 100644
--- a/arch/ppc64/kernel/pacaData.c
+++ b/arch/ppc64/kernel/pacaData.c
@@ -42,21 +42,7 @@ extern unsigned long __toc_start;
42 * processors. The processor VPD array needs one entry per physical 42 * processors. The processor VPD array needs one entry per physical
43 * processor (not thread). 43 * processor (not thread).
44 */ 44 */
45#ifdef CONFIG_PPC_ISERIES 45#define PACA_INIT_COMMON(number, start, asrr, asrv) \
46#define EXTRA_INITS(number, lpq) \
47 .lppaca_ptr = &paca[number].lppaca, \
48 .lpqueue_ptr = (lpq), /* &xItLpQueue, */ \
49 .reg_save_ptr = &paca[number].reg_save, \
50 .reg_save = { \
51 .xDesc = 0xd397d9e2, /* "LpRS" */ \
52 .xSize = sizeof(struct ItLpRegSave) \
53 },
54#else
55#define EXTRA_INITS(number, lpq)
56#endif
57
58#define PACAINITDATA(number,start,lpq,asrr,asrv) \
59{ \
60 .lock_token = 0x8000, \ 46 .lock_token = 0x8000, \
61 .paca_index = (number), /* Paca Index */ \ 47 .paca_index = (number), /* Paca Index */ \
62 .default_decr = 0x00ff0000, /* Initial Decr */ \ 48 .default_decr = 0x00ff0000, /* Initial Decr */ \
@@ -74,147 +60,79 @@ extern unsigned long __toc_start;
74 .end_of_quantum = 0xfffffffffffffffful, \ 60 .end_of_quantum = 0xfffffffffffffffful, \
75 .slb_count = 64, \ 61 .slb_count = 64, \
76 }, \ 62 }, \
77 EXTRA_INITS((number), (lpq)) \
78}
79 63
80struct paca_struct paca[] = {
81#ifdef CONFIG_PPC_ISERIES 64#ifdef CONFIG_PPC_ISERIES
82 PACAINITDATA( 0, 1, &xItLpQueue, 0, STAB0_VIRT_ADDR), 65#define PACA_INIT_ISERIES(number) \
66 .lppaca_ptr = &paca[number].lppaca, \
67 .reg_save_ptr = &paca[number].reg_save, \
68 .reg_save = { \
69 .xDesc = 0xd397d9e2, /* "LpRS" */ \
70 .xSize = sizeof(struct ItLpRegSave) \
71 }
72
73#define PACA_INIT(number) \
74{ \
75 PACA_INIT_COMMON(number, 0, 0, 0) \
76 PACA_INIT_ISERIES(number) \
77}
78
79#define BOOTCPU_PACA_INIT(number) \
80{ \
81 PACA_INIT_COMMON(number, 1, 0, STAB0_VIRT_ADDR) \
82 PACA_INIT_ISERIES(number) \
83}
84
83#else 85#else
84 PACAINITDATA( 0, 1, NULL, STAB0_PHYS_ADDR, STAB0_VIRT_ADDR), 86#define PACA_INIT(number) \
87{ \
88 PACA_INIT_COMMON(number, 0, 0, 0) \
89}
90
91#define BOOTCPU_PACA_INIT(number) \
92{ \
93 PACA_INIT_COMMON(number, 1, STAB0_PHYS_ADDR, STAB0_VIRT_ADDR) \
94}
85#endif 95#endif
96
97struct paca_struct paca[] = {
98 BOOTCPU_PACA_INIT(0),
86#if NR_CPUS > 1 99#if NR_CPUS > 1
87 PACAINITDATA( 1, 0, NULL, 0, 0), 100 PACA_INIT( 1), PACA_INIT( 2), PACA_INIT( 3),
88 PACAINITDATA( 2, 0, NULL, 0, 0),
89 PACAINITDATA( 3, 0, NULL, 0, 0),
90#if NR_CPUS > 4 101#if NR_CPUS > 4
91 PACAINITDATA( 4, 0, NULL, 0, 0), 102 PACA_INIT( 4), PACA_INIT( 5), PACA_INIT( 6), PACA_INIT( 7),
92 PACAINITDATA( 5, 0, NULL, 0, 0),
93 PACAINITDATA( 6, 0, NULL, 0, 0),
94 PACAINITDATA( 7, 0, NULL, 0, 0),
95#if NR_CPUS > 8 103#if NR_CPUS > 8
96 PACAINITDATA( 8, 0, NULL, 0, 0), 104 PACA_INIT( 8), PACA_INIT( 9), PACA_INIT( 10), PACA_INIT( 11),
97 PACAINITDATA( 9, 0, NULL, 0, 0), 105 PACA_INIT( 12), PACA_INIT( 13), PACA_INIT( 14), PACA_INIT( 15),
98 PACAINITDATA(10, 0, NULL, 0, 0), 106 PACA_INIT( 16), PACA_INIT( 17), PACA_INIT( 18), PACA_INIT( 19),
99 PACAINITDATA(11, 0, NULL, 0, 0), 107 PACA_INIT( 20), PACA_INIT( 21), PACA_INIT( 22), PACA_INIT( 23),
100 PACAINITDATA(12, 0, NULL, 0, 0), 108 PACA_INIT( 24), PACA_INIT( 25), PACA_INIT( 26), PACA_INIT( 27),
101 PACAINITDATA(13, 0, NULL, 0, 0), 109 PACA_INIT( 28), PACA_INIT( 29), PACA_INIT( 30), PACA_INIT( 31),
102 PACAINITDATA(14, 0, NULL, 0, 0),
103 PACAINITDATA(15, 0, NULL, 0, 0),
104 PACAINITDATA(16, 0, NULL, 0, 0),
105 PACAINITDATA(17, 0, NULL, 0, 0),
106 PACAINITDATA(18, 0, NULL, 0, 0),
107 PACAINITDATA(19, 0, NULL, 0, 0),
108 PACAINITDATA(20, 0, NULL, 0, 0),
109 PACAINITDATA(21, 0, NULL, 0, 0),
110 PACAINITDATA(22, 0, NULL, 0, 0),
111 PACAINITDATA(23, 0, NULL, 0, 0),
112 PACAINITDATA(24, 0, NULL, 0, 0),
113 PACAINITDATA(25, 0, NULL, 0, 0),
114 PACAINITDATA(26, 0, NULL, 0, 0),
115 PACAINITDATA(27, 0, NULL, 0, 0),
116 PACAINITDATA(28, 0, NULL, 0, 0),
117 PACAINITDATA(29, 0, NULL, 0, 0),
118 PACAINITDATA(30, 0, NULL, 0, 0),
119 PACAINITDATA(31, 0, NULL, 0, 0),
120#if NR_CPUS > 32 110#if NR_CPUS > 32
121 PACAINITDATA(32, 0, NULL, 0, 0), 111 PACA_INIT( 32), PACA_INIT( 33), PACA_INIT( 34), PACA_INIT( 35),
122 PACAINITDATA(33, 0, NULL, 0, 0), 112 PACA_INIT( 36), PACA_INIT( 37), PACA_INIT( 38), PACA_INIT( 39),
123 PACAINITDATA(34, 0, NULL, 0, 0), 113 PACA_INIT( 40), PACA_INIT( 41), PACA_INIT( 42), PACA_INIT( 43),
124 PACAINITDATA(35, 0, NULL, 0, 0), 114 PACA_INIT( 44), PACA_INIT( 45), PACA_INIT( 46), PACA_INIT( 47),
125 PACAINITDATA(36, 0, NULL, 0, 0), 115 PACA_INIT( 48), PACA_INIT( 49), PACA_INIT( 50), PACA_INIT( 51),
126 PACAINITDATA(37, 0, NULL, 0, 0), 116 PACA_INIT( 52), PACA_INIT( 53), PACA_INIT( 54), PACA_INIT( 55),
127 PACAINITDATA(38, 0, NULL, 0, 0), 117 PACA_INIT( 56), PACA_INIT( 57), PACA_INIT( 58), PACA_INIT( 59),
128 PACAINITDATA(39, 0, NULL, 0, 0), 118 PACA_INIT( 60), PACA_INIT( 61), PACA_INIT( 62), PACA_INIT( 63),
129 PACAINITDATA(40, 0, NULL, 0, 0),
130 PACAINITDATA(41, 0, NULL, 0, 0),
131 PACAINITDATA(42, 0, NULL, 0, 0),
132 PACAINITDATA(43, 0, NULL, 0, 0),
133 PACAINITDATA(44, 0, NULL, 0, 0),
134 PACAINITDATA(45, 0, NULL, 0, 0),
135 PACAINITDATA(46, 0, NULL, 0, 0),
136 PACAINITDATA(47, 0, NULL, 0, 0),
137 PACAINITDATA(48, 0, NULL, 0, 0),
138 PACAINITDATA(49, 0, NULL, 0, 0),
139 PACAINITDATA(50, 0, NULL, 0, 0),
140 PACAINITDATA(51, 0, NULL, 0, 0),
141 PACAINITDATA(52, 0, NULL, 0, 0),
142 PACAINITDATA(53, 0, NULL, 0, 0),
143 PACAINITDATA(54, 0, NULL, 0, 0),
144 PACAINITDATA(55, 0, NULL, 0, 0),
145 PACAINITDATA(56, 0, NULL, 0, 0),
146 PACAINITDATA(57, 0, NULL, 0, 0),
147 PACAINITDATA(58, 0, NULL, 0, 0),
148 PACAINITDATA(59, 0, NULL, 0, 0),
149 PACAINITDATA(60, 0, NULL, 0, 0),
150 PACAINITDATA(61, 0, NULL, 0, 0),
151 PACAINITDATA(62, 0, NULL, 0, 0),
152 PACAINITDATA(63, 0, NULL, 0, 0),
153#if NR_CPUS > 64 119#if NR_CPUS > 64
154 PACAINITDATA(64, 0, NULL, 0, 0), 120 PACA_INIT( 64), PACA_INIT( 65), PACA_INIT( 66), PACA_INIT( 67),
155 PACAINITDATA(65, 0, NULL, 0, 0), 121 PACA_INIT( 68), PACA_INIT( 69), PACA_INIT( 70), PACA_INIT( 71),
156 PACAINITDATA(66, 0, NULL, 0, 0), 122 PACA_INIT( 72), PACA_INIT( 73), PACA_INIT( 74), PACA_INIT( 75),
157 PACAINITDATA(67, 0, NULL, 0, 0), 123 PACA_INIT( 76), PACA_INIT( 77), PACA_INIT( 78), PACA_INIT( 79),
158 PACAINITDATA(68, 0, NULL, 0, 0), 124 PACA_INIT( 80), PACA_INIT( 81), PACA_INIT( 82), PACA_INIT( 83),
159 PACAINITDATA(69, 0, NULL, 0, 0), 125 PACA_INIT( 84), PACA_INIT( 85), PACA_INIT( 86), PACA_INIT( 87),
160 PACAINITDATA(70, 0, NULL, 0, 0), 126 PACA_INIT( 88), PACA_INIT( 89), PACA_INIT( 90), PACA_INIT( 91),
161 PACAINITDATA(71, 0, NULL, 0, 0), 127 PACA_INIT( 92), PACA_INIT( 93), PACA_INIT( 94), PACA_INIT( 95),
162 PACAINITDATA(72, 0, NULL, 0, 0), 128 PACA_INIT( 96), PACA_INIT( 97), PACA_INIT( 98), PACA_INIT( 99),
163 PACAINITDATA(73, 0, NULL, 0, 0), 129 PACA_INIT(100), PACA_INIT(101), PACA_INIT(102), PACA_INIT(103),
164 PACAINITDATA(74, 0, NULL, 0, 0), 130 PACA_INIT(104), PACA_INIT(105), PACA_INIT(106), PACA_INIT(107),
165 PACAINITDATA(75, 0, NULL, 0, 0), 131 PACA_INIT(108), PACA_INIT(109), PACA_INIT(110), PACA_INIT(111),
166 PACAINITDATA(76, 0, NULL, 0, 0), 132 PACA_INIT(112), PACA_INIT(113), PACA_INIT(114), PACA_INIT(115),
167 PACAINITDATA(77, 0, NULL, 0, 0), 133 PACA_INIT(116), PACA_INIT(117), PACA_INIT(118), PACA_INIT(119),
168 PACAINITDATA(78, 0, NULL, 0, 0), 134 PACA_INIT(120), PACA_INIT(121), PACA_INIT(122), PACA_INIT(123),
169 PACAINITDATA(79, 0, NULL, 0, 0), 135 PACA_INIT(124), PACA_INIT(125), PACA_INIT(126), PACA_INIT(127),
170 PACAINITDATA(80, 0, NULL, 0, 0),
171 PACAINITDATA(81, 0, NULL, 0, 0),
172 PACAINITDATA(82, 0, NULL, 0, 0),
173 PACAINITDATA(83, 0, NULL, 0, 0),
174 PACAINITDATA(84, 0, NULL, 0, 0),
175 PACAINITDATA(85, 0, NULL, 0, 0),
176 PACAINITDATA(86, 0, NULL, 0, 0),
177 PACAINITDATA(87, 0, NULL, 0, 0),
178 PACAINITDATA(88, 0, NULL, 0, 0),
179 PACAINITDATA(89, 0, NULL, 0, 0),
180 PACAINITDATA(90, 0, NULL, 0, 0),
181 PACAINITDATA(91, 0, NULL, 0, 0),
182 PACAINITDATA(92, 0, NULL, 0, 0),
183 PACAINITDATA(93, 0, NULL, 0, 0),
184 PACAINITDATA(94, 0, NULL, 0, 0),
185 PACAINITDATA(95, 0, NULL, 0, 0),
186 PACAINITDATA(96, 0, NULL, 0, 0),
187 PACAINITDATA(97, 0, NULL, 0, 0),
188 PACAINITDATA(98, 0, NULL, 0, 0),
189 PACAINITDATA(99, 0, NULL, 0, 0),
190 PACAINITDATA(100, 0, NULL, 0, 0),
191 PACAINITDATA(101, 0, NULL, 0, 0),
192 PACAINITDATA(102, 0, NULL, 0, 0),
193 PACAINITDATA(103, 0, NULL, 0, 0),
194 PACAINITDATA(104, 0, NULL, 0, 0),
195 PACAINITDATA(105, 0, NULL, 0, 0),
196 PACAINITDATA(106, 0, NULL, 0, 0),
197 PACAINITDATA(107, 0, NULL, 0, 0),
198 PACAINITDATA(108, 0, NULL, 0, 0),
199 PACAINITDATA(109, 0, NULL, 0, 0),
200 PACAINITDATA(110, 0, NULL, 0, 0),
201 PACAINITDATA(111, 0, NULL, 0, 0),
202 PACAINITDATA(112, 0, NULL, 0, 0),
203 PACAINITDATA(113, 0, NULL, 0, 0),
204 PACAINITDATA(114, 0, NULL, 0, 0),
205 PACAINITDATA(115, 0, NULL, 0, 0),
206 PACAINITDATA(116, 0, NULL, 0, 0),
207 PACAINITDATA(117, 0, NULL, 0, 0),
208 PACAINITDATA(118, 0, NULL, 0, 0),
209 PACAINITDATA(119, 0, NULL, 0, 0),
210 PACAINITDATA(120, 0, NULL, 0, 0),
211 PACAINITDATA(121, 0, NULL, 0, 0),
212 PACAINITDATA(122, 0, NULL, 0, 0),
213 PACAINITDATA(123, 0, NULL, 0, 0),
214 PACAINITDATA(124, 0, NULL, 0, 0),
215 PACAINITDATA(125, 0, NULL, 0, 0),
216 PACAINITDATA(126, 0, NULL, 0, 0),
217 PACAINITDATA(127, 0, NULL, 0, 0),
218#endif 136#endif
219#endif 137#endif
220#endif 138#endif
diff --git a/arch/ppc64/kernel/sysfs.c b/arch/ppc64/kernel/sysfs.c
index c8fa6569b2fd..2f704a2cafb1 100644
--- a/arch/ppc64/kernel/sysfs.c
+++ b/arch/ppc64/kernel/sysfs.c
@@ -400,7 +400,12 @@ static int __init topology_init(void)
400 struct cpu *c = &per_cpu(cpu_devices, cpu); 400 struct cpu *c = &per_cpu(cpu_devices, cpu);
401 401
402#ifdef CONFIG_NUMA 402#ifdef CONFIG_NUMA
403 parent = &node_devices[cpu_to_node(cpu)]; 403 /* The node to which a cpu belongs can't be known
404 * until the cpu is made present.
405 */
406 parent = NULL;
407 if (cpu_present(cpu))
408 parent = &node_devices[cpu_to_node(cpu)];
404#endif 409#endif
405 /* 410 /*
406 * For now, we just see if the system supports making 411 * For now, we just see if the system supports making
diff --git a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c
index 2a532db9138a..909462e1adea 100644
--- a/arch/ppc64/kernel/time.c
+++ b/arch/ppc64/kernel/time.c
@@ -99,7 +99,6 @@ unsigned long tb_to_ns_shift;
99struct gettimeofday_struct do_gtod; 99struct gettimeofday_struct do_gtod;
100 100
101extern unsigned long wall_jiffies; 101extern unsigned long wall_jiffies;
102extern unsigned long lpevent_count;
103extern int smp_tb_synchronized; 102extern int smp_tb_synchronized;
104 103
105extern struct timezone sys_tz; 104extern struct timezone sys_tz;
@@ -367,11 +366,8 @@ int timer_interrupt(struct pt_regs * regs)
367 set_dec(next_dec); 366 set_dec(next_dec);
368 367
369#ifdef CONFIG_PPC_ISERIES 368#ifdef CONFIG_PPC_ISERIES
370 { 369 if (hvlpevent_is_pending())
371 struct ItLpQueue *lpq = lpaca->lpqueue_ptr; 370 process_hvlpevents(regs);
372 if (lpq && ItLpQueue_isLpIntPending(lpq))
373 lpevent_count += ItLpQueue_process(lpq, regs);
374 }
375#endif 371#endif
376 372
377/* collect purr register values often, for accurate calculations */ 373/* collect purr register values often, for accurate calculations */
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index 157190d986bb..d206d7e49cf5 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -1064,7 +1064,6 @@ void print_all_local_APICs (void)
1064 1064
1065void __apicdebuginit print_PIC(void) 1065void __apicdebuginit print_PIC(void)
1066{ 1066{
1067 extern spinlock_t i8259A_lock;
1068 unsigned int v; 1067 unsigned int v;
1069 unsigned long flags; 1068 unsigned long flags;
1070 1069
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig
index 3e89767cea72..c9b5d298e3c4 100644
--- a/arch/xtensa/Kconfig
+++ b/arch/xtensa/Kconfig
@@ -132,7 +132,7 @@ config XTENSA_CPU_CLOCK
132config GENERIC_CALIBRATE_DELAY 132config GENERIC_CALIBRATE_DELAY
133 bool "Auto calibration of the BogoMIPS value" 133 bool "Auto calibration of the BogoMIPS value"
134 ---help--- 134 ---help---
135 The BogoMIPS value can easily derived from the CPU frequency. 135 The BogoMIPS value can easily be derived from the CPU frequency.
136 136
137config CMDLINE_BOOL 137config CMDLINE_BOOL
138 bool "Default bootloader kernel arguments" 138 bool "Default bootloader kernel arguments"
@@ -158,6 +158,8 @@ config XTENSA_ISS_NETWORK
158 depends on XTENSA_PLATFORM_ISS 158 depends on XTENSA_PLATFORM_ISS
159 default y 159 default y
160 160
161source "mm/Kconfig"
162
161endmenu 163endmenu
162 164
163menu "Bus options" 165menu "Bus options"
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
index 4fa27453b1f9..27847e4ffcbf 100644
--- a/arch/xtensa/Makefile
+++ b/arch/xtensa/Makefile
@@ -21,23 +21,17 @@ export CPU
21 21
22# Platform configuration 22# Platform configuration
23 23
24platform-y := common
25platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000 24platform-$(CONFIG_XTENSA_PLATFORM_XT2000) := xt2000
26platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss 25platform-$(CONFIG_XTENSA_PLATFORM_ISS) := iss
27 26
28PLATFORM = $(platform-y) 27PLATFORM = $(platform-y)
29export PLATFORM 28export PLATFORM
30 29
31#LDFLAGS_vmlinux := -T$(word 1,$(LINKSCRIPT)) 30CPPFLAGS += $(if $(KBUILD_SRC),-I$(srctree)/include/asm-xtensa/)
32AFLAGS_vmlinux.lds.o := -Uxtensa 31CPPFLAGS += -Iinclude/asm
33CPPFLAGS += -Iarch/xtensa -Iinclude/asm -mlongcalls -g 32CFLAGS += -pipe -mlongcalls
34AFLAGS += -Iarch/xtensa -Iinclude/asm
35CPP = $(CC) -E $(CFLAGS)
36 33
37cflags-y += -Iarch/xtensa -pipe -mlongcalls 34KBUILD_DEFCONFIG := iss_defconfig
38
39
40KBUILD_DEFCONFIG := common_defconfig
41 35
42# ramdisk/initrd support 36# ramdisk/initrd support
43# You need a compressed ramdisk image, named ramdisk.gz in 37# You need a compressed ramdisk image, named ramdisk.gz in
@@ -62,30 +56,36 @@ endif
62LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) 56LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
63 57
64head-y := arch/xtensa/kernel/head.o 58head-y := arch/xtensa/kernel/head.o
65core-y += arch/xtensa/kernel/ \ 59core-y += arch/xtensa/kernel/ arch/xtensa/mm/
66 arch/xtensa/mm/ arch/xtensa/platform-$(PLATFORM)/ 60ifneq ($(PLATFORM),)
61core-y += arch/xtensa/platform-$(PLATFORM)/
62endif
67libs-y += arch/xtensa/lib/ $(LIBGCC) 63libs-y += arch/xtensa/lib/ $(LIBGCC)
68 64
69boot := arch/xtensa/boot 65boot := arch/xtensa/boot
66
67archinc := include/asm-xtensa
70 68
71arch/xtensa/kernel/asm-offsets.s: \ 69arch/xtensa/kernel/asm-offsets.s: \
72 arch/xtensa/kernel/asm-offsets.c \ 70 arch/xtensa/kernel/asm-offsets.c $(archinc)/.platform
73 include/asm-xtensa/.platform
74 71
75include/asm-xtensa/offsets.h: arch/xtensa/kernel/asm-offsets.s 72include/asm-xtensa/offsets.h: arch/xtensa/kernel/asm-offsets.s
76 $(call filechk,gen-asm-offsets) 73 $(call filechk,gen-asm-offsets)
77 74
78prepare: include/asm-xtensa/.platform include/asm-xtensa/offsets.h 75prepare: $(archinc)/.platform $(archinc)/offsets.h
79 76
80# Update machine cpu and platform symlinks if something which affects 77# Update machine cpu and platform symlinks if something which affects
81# them changed. 78# them changed.
82 79
83include/asm-xtensa/.platform: $(wildcard include/config/arch/*.h) 80$(archinc)/.platform: $(wildcard include/config/arch/*.h) include/config/MARKER
84 @echo ' Setting up cpu ($(CPU)) and platform ($(PLATFORM)) symlinks' 81 @echo ' SYMLINK $(archinc)/xtensa/config -> $(archinc)/xtensa/config-$(CPU)'
85 $(Q)rm -f include/asm-xtensa/platform 82 $(Q)mkdir -p $(archinc)
86 $(Q)rm -f include/asm-xtensa/xtensa/config 83 $(Q)mkdir -p $(archinc)/xtensa
87 $(Q)(cd include/asm-xtensa/; ln -sf platform-$(PLATFORM) platform) 84 $(Q)ln -fsn $(srctree)/$(archinc)/xtensa/config-$(CPU) $(archinc)/xtensa/config
88 $(Q)(cd include/asm-xtensa/xtensa; ln -sf config-$(CPU) config) 85 @echo ' SYMLINK $(archinc)/platform -> $(archinc)/platform-$(PLATFORM)'
86 $(Q)ln -fsn $(srctree)/$(archinc)/platform-$(PLATFORM) $(archinc)/platform
87 @touch $@
88
89 89
90all: zImage 90all: zImage
91 91
@@ -94,7 +94,9 @@ bzImage : zImage
94zImage zImage.initrd: vmlinux 94zImage zImage.initrd: vmlinux
95 $(Q)$(MAKE) $(build)=$(boot) $@ 95 $(Q)$(MAKE) $(build)=$(boot) $@
96 96
97CLEAN_FILES += arch/xtensa/vmlinux.lds include/asm-xtensa/offset.h 97CLEAN_FILES += arch/xtensa/vmlinux.lds $(archinc)/offset.h \
98 $(archinc)/platform $(archinc)/xtensa/config \
99 $(archinc)/.platform
98 100
99define archhelp 101define archhelp
100 @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)' 102 @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
diff --git a/arch/xtensa/boot/Makefile b/arch/xtensa/boot/Makefile
index 260f456ccf0b..820b31d10ae4 100644
--- a/arch/xtensa/boot/Makefile
+++ b/arch/xtensa/boot/Makefile
@@ -11,21 +11,19 @@
11CFLAGS += -fno-builtin -Iarch/$(ARCH)/boot/include 11CFLAGS += -fno-builtin -Iarch/$(ARCH)/boot/include
12HOSTFLAGS += -Iarch/$(ARCH)/boot/include 12HOSTFLAGS += -Iarch/$(ARCH)/boot/include
13 13
14BIG_ENDIAN := $(shell echo -e "\#ifdef __XTENSA_EL__\nint little;\n\#else\nint big;\n\#endif" | $(CC) -E -|grep -c big) 14BIG_ENDIAN := $(shell echo -e __XTENSA_EB__ | $(CC) -E - | grep -v "\#")
15
16 15
17export CFLAGS 16export CFLAGS
18export AFLAGS 17export AFLAGS
19export BIG_ENDIAN 18export BIG_ENDIAN
20 19
20subdir-y := lib
21
21# Subdirs for the boot loader(s) 22# Subdirs for the boot loader(s)
22 23
23bootdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf 24bootdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf
24bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf 25bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf
25 26
26subdir-y := lib/
27
28subdir-y += boot-elf/ boot-redboot/
29 27
30zImage zImage.initrd Image Image.initrd: $(bootdir-y) 28zImage zImage.initrd Image Image.initrd: $(bootdir-y)
31 29
@@ -33,5 +31,3 @@ $(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \
33 $(addprefix $(obj)/,$(host-progs)) 31 $(addprefix $(obj)/,$(host-progs))
34 $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS) 32 $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
35 33
36
37
diff --git a/arch/xtensa/boot/boot-elf/Makefile b/arch/xtensa/boot/boot-elf/Makefile
index f6ef6a369667..734db7f76583 100644
--- a/arch/xtensa/boot/boot-elf/Makefile
+++ b/arch/xtensa/boot/boot-elf/Makefile
@@ -27,7 +27,7 @@ Image: vmlinux $(OBJS)
27 --set-section-flags image=contents,alloc,load,load,data \ 27 --set-section-flags image=contents,alloc,load,load,data \
28 $(OBJS) $@.tmp 28 $(OBJS) $@.tmp
29 $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \ 29 $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
30 -T arch/$(ARCH)/boot/boot-elf/boot.ld \ 30 -T $(srctree)/arch/$(ARCH)/boot/boot-elf/boot.ld \
31 -o arch/$(ARCH)/boot/$@.elf $@.tmp 31 -o arch/$(ARCH)/boot/$@.elf $@.tmp
32 rm -f $@.tmp vmlinux.tmp 32 rm -f $@.tmp vmlinux.tmp
33 33
@@ -41,7 +41,7 @@ Image.initrd: vmlinux $(OBJS)
41 --set-section-flags image=contents,alloc,load,load,data \ 41 --set-section-flags image=contents,alloc,load,load,data \
42 $(OBJS) $@.tmp 42 $(OBJS) $@.tmp
43 $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \ 43 $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
44 -T arch/$(ARCH)/boot/boot-elf/boot.ld \ 44 -T $(srctree)/arch/$(ARCH)/boot/boot-elf/boot.ld \
45 -o arch/$(ARCH)/boot/$@.elf $@.tmp 45 -o arch/$(ARCH)/boot/$@.elf $@.tmp
46 rm -f $@.tmp vmlinux.tmp 46 rm -f $@.tmp vmlinux.tmp
47 47
diff --git a/arch/xtensa/boot/boot-redboot/Makefile b/arch/xtensa/boot/boot-redboot/Makefile
index ca8a68bc8472..f53262c2e1f3 100644
--- a/arch/xtensa/boot/boot-redboot/Makefile
+++ b/arch/xtensa/boot/boot-redboot/Makefile
@@ -12,24 +12,24 @@ else
12OBJCOPY_ARGS := -O elf32-xtensa-le 12OBJCOPY_ARGS := -O elf32-xtensa-le
13endif 13endif
14 14
15LD_ARGS = -T $(obj)/boot.ld 15LD_ARGS = -T $(srctree)/$(obj)/boot.ld
16 16
17boot-y := bootstrap.o 17boot-y := bootstrap.o
18 18
19OBJS := $(addprefix $(obj)/,$(boot-y)) 19OBJS := $(addprefix $(obj)/,$(boot-y))
20LIBS := arch/$(ARCH)/boot/lib/lib.a arch/$(ARCH)/lib/lib.a 20LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
21 21
22LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) 22LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
23 23
24zImage: vmlinux $(OBJS) $(LIBS) 24zImage: vmlinux $(OBJS) $(LIBS)
25 $(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \ 25 $(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \
26 $(TOPDIR)/vmlinux vmlinux.tmp 26 vmlinux vmlinux.tmp
27 gzip -vf9 vmlinux.tmp 27 gzip -vf9 vmlinux.tmp
28 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \ 28 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
29 --add-section image=vmlinux.tmp.gz \ 29 --add-section image=vmlinux.tmp.gz \
30 --set-section-flags image=contents,alloc,load,load,data \ 30 --set-section-flags image=contents,alloc,load,load,data \
31 $(OBJS) $@.tmp 31 $(OBJS) $@.tmp
32 $(LD) $(LD_ARGS) -o $@.elf $@.tmp $(LIBS) -L/xtensa-elf/lib $(LIBGCC) 32 $(LD) $(LD_ARGS) -o $@.elf $@.tmp $(LIBS) -L/xtensa-elf/lib $(LIBGCC)
33 $(OBJCOPY) -S -O binary $@.elf arch/$(ARCH)/boot/images/$@.redboot 33 $(OBJCOPY) -S -O binary $@.elf arch/$(ARCH)/boot/$@.redboot
34# rm -f $@.tmp $@.elf vmlinux.tmp.gz 34 rm -f $@.tmp $@.elf vmlinux.tmp.gz
35 35
diff --git a/arch/xtensa/boot/include/zlib.h b/arch/xtensa/boot/include/zlib.h
deleted file mode 100644
index ea29b6237852..000000000000
--- a/arch/xtensa/boot/include/zlib.h
+++ /dev/null
@@ -1,433 +0,0 @@
1/*
2 * BK Id: SCCS/s.zlib.h 1.8 05/18/01 15:17:23 cort
3 */
4/*
5 * This file is derived from zlib.h and zconf.h from the zlib-0.95
6 * distribution by Jean-loup Gailly and Mark Adler, with some additions
7 * by Paul Mackerras to aid in implementing Deflate compression and
8 * decompression for PPP packets.
9 */
10
11/*
12 * ==FILEVERSION 960122==
13 *
14 * This marker is used by the Linux installation script to determine
15 * whether an up-to-date version of this file is already installed.
16 */
17
18/* zlib.h -- interface of the 'zlib' general purpose compression library
19 version 0.95, Aug 16th, 1995.
20
21 Copyright (C) 1995 Jean-loup Gailly and Mark Adler
22
23 This software is provided 'as-is', without any express or implied
24 warranty. In no event will the authors be held liable for any damages
25 arising from the use of this software.
26
27 Permission is granted to anyone to use this software for any purpose,
28 including commercial applications, and to alter it and redistribute it
29 freely, subject to the following restrictions:
30
31 1. The origin of this software must not be misrepresented; you must not
32 claim that you wrote the original software. If you use this software
33 in a product, an acknowledgment in the product documentation would be
34 appreciated but is not required.
35 2. Altered source versions must be plainly marked as such, and must not be
36 misrepresented as being the original software.
37 3. This notice may not be removed or altered from any source distribution.
38
39 Jean-loup Gailly Mark Adler
40 gzip@prep.ai.mit.edu madler@alumni.caltech.edu
41 */
42
43#ifndef _ZLIB_H
44#define _ZLIB_H
45
46/* #include "zconf.h" */ /* included directly here */
47
48/* zconf.h -- configuration of the zlib compression library
49 * Copyright (C) 1995 Jean-loup Gailly.
50 * For conditions of distribution and use, see copyright notice in zlib.h
51 */
52
53/* From: zconf.h,v 1.12 1995/05/03 17:27:12 jloup Exp */
54
55/*
56 The library does not install any signal handler. It is recommended to
57 add at least a handler for SIGSEGV when decompressing; the library checks
58 the consistency of the input data whenever possible but may go nuts
59 for some forms of corrupted input.
60 */
61
62/*
63 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
64 * than 64k bytes at a time (needed on systems with 16-bit int).
65 * Compile with -DUNALIGNED_OK if it is OK to access shorts or ints
66 * at addresses which are not a multiple of their size.
67 * Under DOS, -DFAR=far or -DFAR=__far may be needed.
68 */
69
70#ifndef STDC
71# if defined(MSDOS) || defined(__STDC__) || defined(__cplusplus)
72# define STDC
73# endif
74#endif
75
76#ifdef __MWERKS__ /* Metrowerks CodeWarrior declares fileno() in unix.h */
77# include <unix.h>
78#endif
79
80/* Maximum value for memLevel in deflateInit2 */
81#ifndef MAX_MEM_LEVEL
82# ifdef MAXSEG_64K
83# define MAX_MEM_LEVEL 8
84# else
85# define MAX_MEM_LEVEL 9
86# endif
87#endif
88
89#ifndef FAR
90# define FAR
91#endif
92
93/* Maximum value for windowBits in deflateInit2 and inflateInit2 */
94#ifndef MAX_WBITS
95# define MAX_WBITS 15 /* 32K LZ77 window */
96#endif
97
98/* The memory requirements for deflate are (in bytes):
99 1 << (windowBits+2) + 1 << (memLevel+9)
100 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
101 plus a few kilobytes for small objects. For example, if you want to reduce
102 the default memory requirements from 256K to 128K, compile with
103 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
104 Of course this will generally degrade compression (there's no free lunch).
105
106 The memory requirements for inflate are (in bytes) 1 << windowBits
107 that is, 32K for windowBits=15 (default value) plus a few kilobytes
108 for small objects.
109*/
110
111 /* Type declarations */
112
113#ifndef OF /* function prototypes */
114# ifdef STDC
115# define OF(args) args
116# else
117# define OF(args) ()
118# endif
119#endif
120
121typedef unsigned char Byte; /* 8 bits */
122typedef unsigned int uInt; /* 16 bits or more */
123typedef unsigned long uLong; /* 32 bits or more */
124
125typedef Byte FAR Bytef;
126typedef char FAR charf;
127typedef int FAR intf;
128typedef uInt FAR uIntf;
129typedef uLong FAR uLongf;
130
131#ifdef STDC
132 typedef void FAR *voidpf;
133 typedef void *voidp;
134#else
135 typedef Byte FAR *voidpf;
136 typedef Byte *voidp;
137#endif
138
139/* end of original zconf.h */
140
141#define ZLIB_VERSION "0.95P"
142
143/*
144 The 'zlib' compression library provides in-memory compression and
145 decompression functions, including integrity checks of the uncompressed
146 data. This version of the library supports only one compression method
147 (deflation) but other algorithms may be added later and will have the same
148 stream interface.
149
150 For compression the application must provide the output buffer and
151 may optionally provide the input buffer for optimization. For decompression,
152 the application must provide the input buffer and may optionally provide
153 the output buffer for optimization.
154
155 Compression can be done in a single step if the buffers are large
156 enough (for example if an input file is mmap'ed), or can be done by
157 repeated calls of the compression function. In the latter case, the
158 application must provide more input and/or consume the output
159 (providing more output space) before each call.
160*/
161
162typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
163typedef void (*free_func) OF((voidpf opaque, voidpf address, uInt nbytes));
164
165struct internal_state;
166
167typedef struct z_stream_s {
168 Bytef *next_in; /* next input byte */
169 uInt avail_in; /* number of bytes available at next_in */
170 uLong total_in; /* total nb of input bytes read so far */
171
172 Bytef *next_out; /* next output byte should be put there */
173 uInt avail_out; /* remaining free space at next_out */
174 uLong total_out; /* total nb of bytes output so far */
175
176 char *msg; /* last error message, NULL if no error */
177 struct internal_state FAR *state; /* not visible by applications */
178
179 alloc_func zalloc; /* used to allocate the internal state */
180 free_func zfree; /* used to free the internal state */
181 voidp opaque; /* private data object passed to zalloc and zfree */
182
183 Byte data_type; /* best guess about the data type: ascii or binary */
184
185} z_stream;
186
187/*
188 The application must update next_in and avail_in when avail_in has
189 dropped to zero. It must update next_out and avail_out when avail_out
190 has dropped to zero. The application must initialize zalloc, zfree and
191 opaque before calling the init function. All other fields are set by the
192 compression library and must not be updated by the application.
193
194 The opaque value provided by the application will be passed as the first
195 parameter for calls of zalloc and zfree. This can be useful for custom
196 memory management. The compression library attaches no meaning to the
197 opaque value.
198
199 zalloc must return Z_NULL if there is not enough memory for the object.
200 On 16-bit systems, the functions zalloc and zfree must be able to allocate
201 exactly 65536 bytes, but will not be required to allocate more than this
202 if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
203 pointers returned by zalloc for objects of exactly 65536 bytes *must*
204 have their offset normalized to zero. The default allocation function
205 provided by this library ensures this (see zutil.c). To reduce memory
206 requirements and avoid any allocation of 64K objects, at the expense of
207 compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
208
209 The fields total_in and total_out can be used for statistics or
210 progress reports. After compression, total_in holds the total size of
211 the uncompressed data and may be saved for use in the decompressor
212 (particularly if the decompressor wants to decompress everything in
213 a single step).
214*/
215
216 /* constants */
217
218#define Z_NO_FLUSH 0
219#define Z_PARTIAL_FLUSH 1
220#define Z_FULL_FLUSH 2
221#define Z_SYNC_FLUSH 3 /* experimental: partial_flush + byte align */
222#define Z_FINISH 4
223#define Z_PACKET_FLUSH 5
224/* See deflate() below for the usage of these constants */
225
226#define Z_OK 0
227#define Z_STREAM_END 1
228#define Z_ERRNO (-1)
229#define Z_STREAM_ERROR (-2)
230#define Z_DATA_ERROR (-3)
231#define Z_MEM_ERROR (-4)
232#define Z_BUF_ERROR (-5)
233/* error codes for the compression/decompression functions */
234
235#define Z_BEST_SPEED 1
236#define Z_BEST_COMPRESSION 9
237#define Z_DEFAULT_COMPRESSION (-1)
238/* compression levels */
239
240#define Z_FILTERED 1
241#define Z_HUFFMAN_ONLY 2
242#define Z_DEFAULT_STRATEGY 0
243
244#define Z_BINARY 0
245#define Z_ASCII 1
246#define Z_UNKNOWN 2
247/* Used to set the data_type field */
248
249#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
250
251extern char *zlib_version;
252/* The application can compare zlib_version and ZLIB_VERSION for consistency.
253 If the first character differs, the library code actually used is
254 not compatible with the zlib.h header file used by the application.
255 */
256
257 /* basic functions */
258
259extern int inflateInit OF((z_stream *strm));
260/*
261 Initializes the internal stream state for decompression. The fields
262 zalloc and zfree must be initialized before by the caller. If zalloc and
263 zfree are set to Z_NULL, inflateInit updates them to use default allocation
264 functions.
265
266 inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
267 enough memory. msg is set to null if there is no error message.
268 inflateInit does not perform any decompression: this will be done by
269 inflate().
270*/
271
272
273extern int inflate OF((z_stream *strm, int flush));
274/*
275 Performs one or both of the following actions:
276
277 - Decompress more input starting at next_in and update next_in and avail_in
278 accordingly. If not all input can be processed (because there is not
279 enough room in the output buffer), next_in is updated and processing
280 will resume at this point for the next call of inflate().
281
282 - Provide more output starting at next_out and update next_out and avail_out
283 accordingly. inflate() always provides as much output as possible
284 (until there is no more input data or no more space in the output buffer).
285
286 Before the call of inflate(), the application should ensure that at least
287 one of the actions is possible, by providing more input and/or consuming
288 more output, and updating the next_* and avail_* values accordingly.
289 The application can consume the uncompressed output when it wants, for
290 example when the output buffer is full (avail_out == 0), or after each
291 call of inflate().
292
293 If the parameter flush is set to Z_PARTIAL_FLUSH or Z_PACKET_FLUSH,
294 inflate flushes as much output as possible to the output buffer. The
295 flushing behavior of inflate is not specified for values of the flush
296 parameter other than Z_PARTIAL_FLUSH, Z_PACKET_FLUSH or Z_FINISH, but the
297 current implementation actually flushes as much output as possible
298 anyway. For Z_PACKET_FLUSH, inflate checks that once all the input data
299 has been consumed, it is expecting to see the length field of a stored
300 block; if not, it returns Z_DATA_ERROR.
301
302 inflate() should normally be called until it returns Z_STREAM_END or an
303 error. However if all decompression is to be performed in a single step
304 (a single call of inflate), the parameter flush should be set to
305 Z_FINISH. In this case all pending input is processed and all pending
306 output is flushed; avail_out must be large enough to hold all the
307 uncompressed data. (The size of the uncompressed data may have been saved
308 by the compressor for this purpose.) The next operation on this stream must
309 be inflateEnd to deallocate the decompression state. The use of Z_FINISH
310 is never required, but can be used to inform inflate that a faster routine
311 may be used for the single inflate() call.
312
313 inflate() returns Z_OK if some progress has been made (more input
314 processed or more output produced), Z_STREAM_END if the end of the
315 compressed data has been reached and all uncompressed output has been
316 produced, Z_DATA_ERROR if the input data was corrupted, Z_STREAM_ERROR if
317 the stream structure was inconsistent (for example if next_in or next_out
318 was NULL), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if no
319 progress is possible or if there was not enough room in the output buffer
320 when Z_FINISH is used. In the Z_DATA_ERROR case, the application may then
321 call inflateSync to look for a good compression block. */
322
323
324extern int inflateEnd OF((z_stream *strm));
325/*
326 All dynamically allocated data structures for this stream are freed.
327 This function discards any unprocessed input and does not flush any
328 pending output.
329
330 inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
331 was inconsistent. In the error case, msg may be set but then points to a
332 static string (which must not be deallocated).
333*/
334
335 /* advanced functions */
336
337extern int inflateInit2 OF((z_stream *strm,
338 int windowBits));
339/*
340 This is another version of inflateInit with more compression options. The
341 fields next_out, zalloc and zfree must be initialized before by the caller.
342
343 The windowBits parameter is the base two logarithm of the maximum window
344 size (the size of the history buffer). It should be in the range 8..15 for
345 this version of the library (the value 16 will be allowed soon). The
346 default value is 15 if inflateInit is used instead. If a compressed stream
347 with a larger window size is given as input, inflate() will return with
348 the error code Z_DATA_ERROR instead of trying to allocate a larger window.
349
350 If next_out is not null, the library will use this buffer for the history
351 buffer; the buffer must either be large enough to hold the entire output
352 data, or have at least 1<<windowBits bytes. If next_out is null, the
353 library will allocate its own buffer (and leave next_out null). next_in
354 need not be provided here but must be provided by the application for the
355 next call of inflate().
356
357 If the history buffer is provided by the application, next_out must
358 never be changed by the application since the decompressor maintains
359 history information inside this buffer from call to call; the application
360 can only reset next_out to the beginning of the history buffer when
361 avail_out is zero and all output has been consumed.
362
363 inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was
364 not enough memory, Z_STREAM_ERROR if a parameter is invalid (such as
365 windowBits < 8). msg is set to null if there is no error message.
366 inflateInit2 does not perform any decompression: this will be done by
367 inflate().
368*/
369
370extern int inflateSync OF((z_stream *strm));
371/*
372 Skips invalid compressed data until the special marker (see deflate()
373 above) can be found, or until all available input is skipped. No output
374 is provided.
375
376 inflateSync returns Z_OK if the special marker has been found, Z_BUF_ERROR
377 if no more input was provided, Z_DATA_ERROR if no marker has been found,
378 or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
379 case, the application may save the current current value of total_in which
380 indicates where valid compressed data was found. In the error case, the
381 application may repeatedly call inflateSync, providing more input each time,
382 until success or end of the input data.
383*/
384
385extern int inflateReset OF((z_stream *strm));
386/*
387 This function is equivalent to inflateEnd followed by inflateInit,
388 but does not free and reallocate all the internal decompression state.
389 The stream will keep attributes that may have been set by inflateInit2.
390
391 inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
392 stream state was inconsistent (such as zalloc or state being NULL).
393*/
394
395extern int inflateIncomp OF((z_stream *strm));
396/*
397 This function adds the data at next_in (avail_in bytes) to the output
398 history without performing any output. There must be no pending output,
399 and the decompressor must be expecting to see the start of a block.
400 Calling this function is equivalent to decompressing a stored block
401 containing the data at next_in (except that the data is not output).
402*/
403
404 /* checksum functions */
405
406/*
407 This function is not related to compression but is exported
408 anyway because it might be useful in applications using the
409 compression library.
410*/
411
412extern uLong adler32 OF((uLong adler, Bytef *buf, uInt len));
413
414/*
415 Update a running Adler-32 checksum with the bytes buf[0..len-1] and
416 return the updated checksum. If buf is NULL, this function returns
417 the required initial value for the checksum.
418 An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
419 much faster. Usage example:
420
421 uLong adler = adler32(0L, Z_NULL, 0);
422
423 while (read_buffer(buffer, length) != EOF) {
424 adler = adler32(adler, buffer, length);
425 }
426 if (adler != original_adler) error();
427*/
428
429#ifndef _Z_UTIL_H
430 struct internal_state {int dummy;}; /* hack for buggy compilers */
431#endif
432
433#endif /* _ZLIB_H */
diff --git a/arch/xtensa/boot/lib/Makefile b/arch/xtensa/boot/lib/Makefile
index c0a74dc3a0df..9e73bb8aeb7a 100644
--- a/arch/xtensa/boot/lib/Makefile
+++ b/arch/xtensa/boot/lib/Makefile
@@ -2,5 +2,16 @@
2# Makefile for some libs needed by zImage. 2# Makefile for some libs needed by zImage.
3# 3#
4 4
5zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c
5 6
6lib-y := zlib.o zmem.o 7lib-y += $(zlib:.c=.o) zmem.o
8
9EXTRA_CFLAGS += -Ilib/zlib_inflate
10
11quiet_cmd_copy_zlib = COPY $@
12 cmd_copy_zlib = cat $< > $@
13
14$(addprefix $(obj)/,$(zlib)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
15 $(call cmd,copy_zlib)
16
17clean-files := $(zlib)
diff --git a/arch/xtensa/boot/lib/memcpy.S b/arch/xtensa/boot/lib/memcpy.S
deleted file mode 100644
index a029f5df2d5c..000000000000
--- a/arch/xtensa/boot/lib/memcpy.S
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * arch/xtensa/lib/memcpy.S
3 *
4 * ANSI C standard library function memcpy
5 *
6 * This file is subject to the terms and conditions of the GNU General
7 * Public License. See the file "COPYING" in the main directory of
8 * this archive for more details.
9 *
10 * Copyright (C) 2002 Tensilica Inc.
11 */
12
13#define _ASMLANGUAGE
14#include <xtensa/config/core.h>
15
16.text
17.align 4
18.global bcopy
19.type bcopy,@function
20bcopy:
21 movi a14, xthal_bcopy // a14 safe to use regardless of whether caller
22 // used call4 or call8 (can't have used call12)
23 jx a14 // let the Core HAL do the work
24
25.text
26.align 4
27.global memcpy
28.type memcpy,@function
29memcpy:
30.global memmove
31.type memmove,@function
32memmove:
33 movi a14, xthal_memcpy // a14 safe to use regardless of whether caller
34 // used call4 or call8 (can't have used call12)
35 jx a14 // let the Core HAL do the work
36
diff --git a/arch/xtensa/boot/lib/zlib.c b/arch/xtensa/boot/lib/zlib.c
deleted file mode 100644
index e3859f631077..000000000000
--- a/arch/xtensa/boot/lib/zlib.c
+++ /dev/null
@@ -1,2150 +0,0 @@
1/*
2 * BK Id: SCCS/s.zlib.c 1.8 05/18/01 15:17:24 cort
3 */
4/*
5 * This file is derived from various .h and .c files from the zlib-0.95
6 * distribution by Jean-loup Gailly and Mark Adler, with some additions
7 * by Paul Mackerras to aid in implementing Deflate compression and
8 * decompression for PPP packets. See zlib.h for conditions of
9 * distribution and use.
10 *
11 * Changes that have been made include:
12 * - changed functions not used outside this file to "local"
13 * - added minCompression parameter to deflateInit2
14 * - added Z_PACKET_FLUSH (see zlib.h for details)
15 * - added inflateIncomp
16 *
17 */
18
19/*+++++*/
20/* zutil.h -- internal interface and configuration of the compression library
21 * Copyright (C) 1995 Jean-loup Gailly.
22 * For conditions of distribution and use, see copyright notice in zlib.h
23 */
24
25/* WARNING: this file should *not* be used by applications. It is
26 part of the implementation of the compression library and is
27 subject to change. Applications should only use zlib.h.
28 */
29
30/* From: zutil.h,v 1.9 1995/05/03 17:27:12 jloup Exp */
31
32#define _Z_UTIL_H
33
34#include "zlib.h"
35
36#ifndef local
37# define local static
38#endif
39/* compile with -Dlocal if your debugger can't find static symbols */
40
41#define FAR
42
43typedef unsigned char uch;
44typedef uch FAR uchf;
45typedef unsigned short ush;
46typedef ush FAR ushf;
47typedef unsigned long ulg;
48
49extern char *z_errmsg[]; /* indexed by 1-zlib_error */
50
51#define ERR_RETURN(strm,err) return (strm->msg=z_errmsg[1-err], err)
52/* To be used only when the state is known to be valid */
53
54#ifndef NULL
55#define NULL ((void *) 0)
56#endif
57
58 /* common constants */
59
60#define DEFLATED 8
61
62#ifndef DEF_WBITS
63# define DEF_WBITS MAX_WBITS
64#endif
65/* default windowBits for decompression. MAX_WBITS is for compression only */
66
67#if MAX_MEM_LEVEL >= 8
68# define DEF_MEM_LEVEL 8
69#else
70# define DEF_MEM_LEVEL MAX_MEM_LEVEL
71#endif
72/* default memLevel */
73
74#define STORED_BLOCK 0
75#define STATIC_TREES 1
76#define DYN_TREES 2
77/* The three kinds of block type */
78
79#define MIN_MATCH 3
80#define MAX_MATCH 258
81/* The minimum and maximum match lengths */
82
83 /* functions */
84
85#include <linux/string.h>
86#define zmemcpy memcpy
87#define zmemzero(dest, len) memset(dest, 0, len)
88
89/* Diagnostic functions */
90#ifdef DEBUG_ZLIB
91# include <stdio.h>
92# ifndef verbose
93# define verbose 0
94# endif
95# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
96# define Trace(x) fprintf x
97# define Tracev(x) {if (verbose) fprintf x ;}
98# define Tracevv(x) {if (verbose>1) fprintf x ;}
99# define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
100# define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
101#else
102# define Assert(cond,msg)
103# define Trace(x)
104# define Tracev(x)
105# define Tracevv(x)
106# define Tracec(c,x)
107# define Tracecv(c,x)
108#endif
109
110
111typedef uLong (*check_func) OF((uLong check, Bytef *buf, uInt len));
112
113/* voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); */
114/* void zcfree OF((voidpf opaque, voidpf ptr)); */
115
116#define ZALLOC(strm, items, size) \
117 (*((strm)->zalloc))((strm)->opaque, (items), (size))
118#define ZFREE(strm, addr, size) \
119 (*((strm)->zfree))((strm)->opaque, (voidpf)(addr), (size))
120#define TRY_FREE(s, p, n) {if (p) ZFREE(s, p, n);}
121
122/* deflate.h -- internal compression state
123 * Copyright (C) 1995 Jean-loup Gailly
124 * For conditions of distribution and use, see copyright notice in zlib.h
125 */
126
127/* WARNING: this file should *not* be used by applications. It is
128 part of the implementation of the compression library and is
129 subject to change. Applications should only use zlib.h.
130 */
131
132/*+++++*/
133/* infblock.h -- header to use infblock.c
134 * Copyright (C) 1995 Mark Adler
135 * For conditions of distribution and use, see copyright notice in zlib.h
136 */
137
138/* WARNING: this file should *not* be used by applications. It is
139 part of the implementation of the compression library and is
140 subject to change. Applications should only use zlib.h.
141 */
142
143struct inflate_blocks_state;
144typedef struct inflate_blocks_state FAR inflate_blocks_statef;
145
146local inflate_blocks_statef * inflate_blocks_new OF((
147 z_stream *z,
148 check_func c, /* check function */
149 uInt w)); /* window size */
150
151local int inflate_blocks OF((
152 inflate_blocks_statef *,
153 z_stream *,
154 int)); /* initial return code */
155
156local void inflate_blocks_reset OF((
157 inflate_blocks_statef *,
158 z_stream *,
159 uLongf *)); /* check value on output */
160
161local int inflate_blocks_free OF((
162 inflate_blocks_statef *,
163 z_stream *,
164 uLongf *)); /* check value on output */
165
166local int inflate_addhistory OF((
167 inflate_blocks_statef *,
168 z_stream *));
169
170local int inflate_packet_flush OF((
171 inflate_blocks_statef *));
172
173/*+++++*/
174/* inftrees.h -- header to use inftrees.c
175 * Copyright (C) 1995 Mark Adler
176 * For conditions of distribution and use, see copyright notice in zlib.h
177 */
178
179/* WARNING: this file should *not* be used by applications. It is
180 part of the implementation of the compression library and is
181 subject to change. Applications should only use zlib.h.
182 */
183
184/* Huffman code lookup table entry--this entry is four bytes for machines
185 that have 16-bit pointers (e.g. PC's in the small or medium model). */
186
187typedef struct inflate_huft_s FAR inflate_huft;
188
189struct inflate_huft_s {
190 union {
191 struct {
192 Byte Exop; /* number of extra bits or operation */
193 Byte Bits; /* number of bits in this code or subcode */
194 } what;
195 uInt Nalloc; /* number of these allocated here */
196 Bytef *pad; /* pad structure to a power of 2 (4 bytes for */
197 } word; /* 16-bit, 8 bytes for 32-bit machines) */
198 union {
199 uInt Base; /* literal, length base, or distance base */
200 inflate_huft *Next; /* pointer to next level of table */
201 } more;
202};
203
204#ifdef DEBUG_ZLIB
205 local uInt inflate_hufts;
206#endif
207
208local int inflate_trees_bits OF((
209 uIntf *, /* 19 code lengths */
210 uIntf *, /* bits tree desired/actual depth */
211 inflate_huft * FAR *, /* bits tree result */
212 z_stream *)); /* for zalloc, zfree functions */
213
214local int inflate_trees_dynamic OF((
215 uInt, /* number of literal/length codes */
216 uInt, /* number of distance codes */
217 uIntf *, /* that many (total) code lengths */
218 uIntf *, /* literal desired/actual bit depth */
219 uIntf *, /* distance desired/actual bit depth */
220 inflate_huft * FAR *, /* literal/length tree result */
221 inflate_huft * FAR *, /* distance tree result */
222 z_stream *)); /* for zalloc, zfree functions */
223
224local int inflate_trees_fixed OF((
225 uIntf *, /* literal desired/actual bit depth */
226 uIntf *, /* distance desired/actual bit depth */
227 inflate_huft * FAR *, /* literal/length tree result */
228 inflate_huft * FAR *)); /* distance tree result */
229
230local int inflate_trees_free OF((
231 inflate_huft *, /* tables to free */
232 z_stream *)); /* for zfree function */
233
234
235/*+++++*/
236/* infcodes.h -- header to use infcodes.c
237 * Copyright (C) 1995 Mark Adler
238 * For conditions of distribution and use, see copyright notice in zlib.h
239 */
240
241/* WARNING: this file should *not* be used by applications. It is
242 part of the implementation of the compression library and is
243 subject to change. Applications should only use zlib.h.
244 */
245
246struct inflate_codes_state;
247typedef struct inflate_codes_state FAR inflate_codes_statef;
248
249local inflate_codes_statef *inflate_codes_new OF((
250 uInt, uInt,
251 inflate_huft *, inflate_huft *,
252 z_stream *));
253
254local int inflate_codes OF((
255 inflate_blocks_statef *,
256 z_stream *,
257 int));
258
259local void inflate_codes_free OF((
260 inflate_codes_statef *,
261 z_stream *));
262
263
264/*+++++*/
265/* inflate.c -- zlib interface to inflate modules
266 * Copyright (C) 1995 Mark Adler
267 * For conditions of distribution and use, see copyright notice in zlib.h
268 */
269
270/* inflate private state */
271struct internal_state {
272
273 /* mode */
274 enum {
275 METHOD, /* waiting for method byte */
276 FLAG, /* waiting for flag byte */
277 BLOCKS, /* decompressing blocks */
278 CHECK4, /* four check bytes to go */
279 CHECK3, /* three check bytes to go */
280 CHECK2, /* two check bytes to go */
281 CHECK1, /* one check byte to go */
282 DONE, /* finished check, done */
283 BAD} /* got an error--stay here */
284 mode; /* current inflate mode */
285
286 /* mode dependent information */
287 union {
288 uInt method; /* if FLAGS, method byte */
289 struct {
290 uLong was; /* computed check value */
291 uLong need; /* stream check value */
292 } check; /* if CHECK, check values to compare */
293 uInt marker; /* if BAD, inflateSync's marker bytes count */
294 } sub; /* submode */
295
296 /* mode independent information */
297 int nowrap; /* flag for no wrapper */
298 uInt wbits; /* log2(window size) (8..15, defaults to 15) */
299 inflate_blocks_statef
300 *blocks; /* current inflate_blocks state */
301
302};
303
304
305int inflateReset(z)
306z_stream *z;
307{
308 uLong c;
309
310 if (z == Z_NULL || z->state == Z_NULL)
311 return Z_STREAM_ERROR;
312 z->total_in = z->total_out = 0;
313 z->msg = Z_NULL;
314 z->state->mode = z->state->nowrap ? BLOCKS : METHOD;
315 inflate_blocks_reset(z->state->blocks, z, &c);
316 Trace((stderr, "inflate: reset\n"));
317 return Z_OK;
318}
319
320
321int inflateEnd(z)
322z_stream *z;
323{
324 uLong c;
325
326 if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)
327 return Z_STREAM_ERROR;
328 if (z->state->blocks != Z_NULL)
329 inflate_blocks_free(z->state->blocks, z, &c);
330 ZFREE(z, z->state, sizeof(struct internal_state));
331 z->state = Z_NULL;
332 Trace((stderr, "inflate: end\n"));
333 return Z_OK;
334}
335
336
337int inflateInit2(z, w)
338z_stream *z;
339int w;
340{
341 /* initialize state */
342 if (z == Z_NULL)
343 return Z_STREAM_ERROR;
344/* if (z->zalloc == Z_NULL) z->zalloc = zcalloc; */
345/* if (z->zfree == Z_NULL) z->zfree = zcfree; */
346 if ((z->state = (struct internal_state FAR *)
347 ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL)
348 return Z_MEM_ERROR;
349 z->state->blocks = Z_NULL;
350
351 /* handle undocumented nowrap option (no zlib header or check) */
352 z->state->nowrap = 0;
353 if (w < 0)
354 {
355 w = - w;
356 z->state->nowrap = 1;
357 }
358
359 /* set window size */
360 if (w < 8 || w > 15)
361 {
362 inflateEnd(z);
363 return Z_STREAM_ERROR;
364 }
365 z->state->wbits = (uInt)w;
366
367 /* create inflate_blocks state */
368 if ((z->state->blocks =
369 inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, 1 << w))
370 == Z_NULL)
371 {
372 inflateEnd(z);
373 return Z_MEM_ERROR;
374 }
375 Trace((stderr, "inflate: allocated\n"));
376
377 /* reset state */
378 inflateReset(z);
379 return Z_OK;
380}
381
382
383int inflateInit(z)
384z_stream *z;
385{
386 return inflateInit2(z, DEF_WBITS);
387}
388
389
390#define NEEDBYTE {if(z->avail_in==0)goto empty;r=Z_OK;}
391#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
392
393int inflate(z, f)
394z_stream *z;
395int f;
396{
397 int r;
398 uInt b;
399
400 if (z == Z_NULL || z->next_in == Z_NULL)
401 return Z_STREAM_ERROR;
402 r = Z_BUF_ERROR;
403 while (1) switch (z->state->mode)
404 {
405 case METHOD:
406 NEEDBYTE
407 if (((z->state->sub.method = NEXTBYTE) & 0xf) != DEFLATED)
408 {
409 z->state->mode = BAD;
410 z->msg = "unknown compression method";
411 z->state->sub.marker = 5; /* can't try inflateSync */
412 break;
413 }
414 if ((z->state->sub.method >> 4) + 8 > z->state->wbits)
415 {
416 z->state->mode = BAD;
417 z->msg = "invalid window size";
418 z->state->sub.marker = 5; /* can't try inflateSync */
419 break;
420 }
421 z->state->mode = FLAG;
422 case FLAG:
423 NEEDBYTE
424 if ((b = NEXTBYTE) & 0x20)
425 {
426 z->state->mode = BAD;
427 z->msg = "invalid reserved bit";
428 z->state->sub.marker = 5; /* can't try inflateSync */
429 break;
430 }
431 if (((z->state->sub.method << 8) + b) % 31)
432 {
433 z->state->mode = BAD;
434 z->msg = "incorrect header check";
435 z->state->sub.marker = 5; /* can't try inflateSync */
436 break;
437 }
438 Trace((stderr, "inflate: zlib header ok\n"));
439 z->state->mode = BLOCKS;
440 case BLOCKS:
441 r = inflate_blocks(z->state->blocks, z, r);
442 if (f == Z_PACKET_FLUSH && z->avail_in == 0 && z->avail_out != 0)
443 r = inflate_packet_flush(z->state->blocks);
444 if (r == Z_DATA_ERROR)
445 {
446 z->state->mode = BAD;
447 z->state->sub.marker = 0; /* can try inflateSync */
448 break;
449 }
450 if (r != Z_STREAM_END)
451 return r;
452 r = Z_OK;
453 inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);
454 if (z->state->nowrap)
455 {
456 z->state->mode = DONE;
457 break;
458 }
459 z->state->mode = CHECK4;
460 case CHECK4:
461 NEEDBYTE
462 z->state->sub.check.need = (uLong)NEXTBYTE << 24;
463 z->state->mode = CHECK3;
464 case CHECK3:
465 NEEDBYTE
466 z->state->sub.check.need += (uLong)NEXTBYTE << 16;
467 z->state->mode = CHECK2;
468 case CHECK2:
469 NEEDBYTE
470 z->state->sub.check.need += (uLong)NEXTBYTE << 8;
471 z->state->mode = CHECK1;
472 case CHECK1:
473 NEEDBYTE
474 z->state->sub.check.need += (uLong)NEXTBYTE;
475
476 if (z->state->sub.check.was != z->state->sub.check.need)
477 {
478 z->state->mode = BAD;
479 z->msg = "incorrect data check";
480 z->state->sub.marker = 5; /* can't try inflateSync */
481 break;
482 }
483 Trace((stderr, "inflate: zlib check ok\n"));
484 z->state->mode = DONE;
485 case DONE:
486 return Z_STREAM_END;
487 case BAD:
488 return Z_DATA_ERROR;
489 default:
490 return Z_STREAM_ERROR;
491 }
492
493 empty:
494 if (f != Z_PACKET_FLUSH)
495 return r;
496 z->state->mode = BAD;
497 z->state->sub.marker = 0; /* can try inflateSync */
498 return Z_DATA_ERROR;
499}
500
501/*
502 * This subroutine adds the data at next_in/avail_in to the output history
503 * without performing any output. The output buffer must be "caught up";
504 * i.e. no pending output (hence s->read equals s->write), and the state must
505 * be BLOCKS (i.e. we should be willing to see the start of a series of
506 * BLOCKS). On exit, the output will also be caught up, and the checksum
507 * will have been updated if need be.
508 */
509
510int inflateIncomp(z)
511z_stream *z;
512{
513 if (z->state->mode != BLOCKS)
514 return Z_DATA_ERROR;
515 return inflate_addhistory(z->state->blocks, z);
516}
517
518
519int inflateSync(z)
520z_stream *z;
521{
522 uInt n; /* number of bytes to look at */
523 Bytef *p; /* pointer to bytes */
524 uInt m; /* number of marker bytes found in a row */
525 uLong r, w; /* temporaries to save total_in and total_out */
526
527 /* set up */
528 if (z == Z_NULL || z->state == Z_NULL)
529 return Z_STREAM_ERROR;
530 if (z->state->mode != BAD)
531 {
532 z->state->mode = BAD;
533 z->state->sub.marker = 0;
534 }
535 if ((n = z->avail_in) == 0)
536 return Z_BUF_ERROR;
537 p = z->next_in;
538 m = z->state->sub.marker;
539
540 /* search */
541 while (n && m < 4)
542 {
543 if (*p == (Byte)(m < 2 ? 0 : 0xff))
544 m++;
545 else if (*p)
546 m = 0;
547 else
548 m = 4 - m;
549 p++, n--;
550 }
551
552 /* restore */
553 z->total_in += p - z->next_in;
554 z->next_in = p;
555 z->avail_in = n;
556 z->state->sub.marker = m;
557
558 /* return no joy or set up to restart on a new block */
559 if (m != 4)
560 return Z_DATA_ERROR;
561 r = z->total_in; w = z->total_out;
562 inflateReset(z);
563 z->total_in = r; z->total_out = w;
564 z->state->mode = BLOCKS;
565 return Z_OK;
566}
567
568#undef NEEDBYTE
569#undef NEXTBYTE
570
571/*+++++*/
572/* infutil.h -- types and macros common to blocks and codes
573 * Copyright (C) 1995 Mark Adler
574 * For conditions of distribution and use, see copyright notice in zlib.h
575 */
576
577/* WARNING: this file should *not* be used by applications. It is
578 part of the implementation of the compression library and is
579 subject to change. Applications should only use zlib.h.
580 */
581
582/* inflate blocks semi-private state */
583struct inflate_blocks_state {
584
585 /* mode */
586 enum {
587 TYPE, /* get type bits (3, including end bit) */
588 LENS, /* get lengths for stored */
589 STORED, /* processing stored block */
590 TABLE, /* get table lengths */
591 BTREE, /* get bit lengths tree for a dynamic block */
592 DTREE, /* get length, distance trees for a dynamic block */
593 CODES, /* processing fixed or dynamic block */
594 DRY, /* output remaining window bytes */
595 DONEB, /* finished last block, done */
596 BADB} /* got a data error--stuck here */
597 mode; /* current inflate_block mode */
598
599 /* mode dependent information */
600 union {
601 uInt left; /* if STORED, bytes left to copy */
602 struct {
603 uInt table; /* table lengths (14 bits) */
604 uInt index; /* index into blens (or border) */
605 uIntf *blens; /* bit lengths of codes */
606 uInt bb; /* bit length tree depth */
607 inflate_huft *tb; /* bit length decoding tree */
608 int nblens; /* # elements allocated at blens */
609 } trees; /* if DTREE, decoding info for trees */
610 struct {
611 inflate_huft *tl, *td; /* trees to free */
612 inflate_codes_statef
613 *codes;
614 } decode; /* if CODES, current state */
615 } sub; /* submode */
616 uInt last; /* true if this block is the last block */
617
618 /* mode independent information */
619 uInt bitk; /* bits in bit buffer */
620 uLong bitb; /* bit buffer */
621 Bytef *window; /* sliding window */
622 Bytef *end; /* one byte after sliding window */
623 Bytef *read; /* window read pointer */
624 Bytef *write; /* window write pointer */
625 check_func checkfn; /* check function */
626 uLong check; /* check on output */
627
628};
629
630
631/* defines for inflate input/output */
632/* update pointers and return */
633#define UPDBITS {s->bitb=b;s->bitk=k;}
634#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;}
635#define UPDOUT {s->write=q;}
636#define UPDATE {UPDBITS UPDIN UPDOUT}
637#define LEAVE {UPDATE return inflate_flush(s,z,r);}
638/* get bytes and bits */
639#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}
640#define NEEDBYTE {if(n)r=Z_OK;else LEAVE}
641#define NEXTBYTE (n--,*p++)
642#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
643#define DUMPBITS(j) {b>>=(j);k-=(j);}
644/* output bytes */
645#define WAVAIL (q<s->read?s->read-q-1:s->end-q)
646#define LOADOUT {q=s->write;m=WAVAIL;}
647#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=WAVAIL;}}
648#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT}
649#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
650#define OUTBYTE(a) {*q++=(Byte)(a);m--;}
651/* load local pointers */
652#define LOAD {LOADIN LOADOUT}
653
654/*
655 * The IBM 150 firmware munges the data right after _etext[]. This
656 * protects it. -- Cort
657 */
658local uInt protect_mask[] = {0, 0, 0, 0, 0, 0, 0, 0, 0 ,0 ,0 ,0};
659/* And'ing with mask[n] masks the lower n bits */
660local uInt inflate_mask[] = {
661 0x0000,
662 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
663 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
664};
665
666/* copy as much as possible from the sliding window to the output area */
667local int inflate_flush OF((
668 inflate_blocks_statef *,
669 z_stream *,
670 int));
671
672/*+++++*/
673/* inffast.h -- header to use inffast.c
674 * Copyright (C) 1995 Mark Adler
675 * For conditions of distribution and use, see copyright notice in zlib.h
676 */
677
678/* WARNING: this file should *not* be used by applications. It is
679 part of the implementation of the compression library and is
680 subject to change. Applications should only use zlib.h.
681 */
682
683local int inflate_fast OF((
684 uInt,
685 uInt,
686 inflate_huft *,
687 inflate_huft *,
688 inflate_blocks_statef *,
689 z_stream *));
690
691
692/*+++++*/
693/* infblock.c -- interpret and process block types to last block
694 * Copyright (C) 1995 Mark Adler
695 * For conditions of distribution and use, see copyright notice in zlib.h
696 */
697
698/* Table for deflate from PKZIP's appnote.txt. */
699local uInt border[] = { /* Order of the bit length code lengths */
700 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
701
702/*
703 Notes beyond the 1.93a appnote.txt:
704
705 1. Distance pointers never point before the beginning of the output
706 stream.
707 2. Distance pointers can point back across blocks, up to 32k away.
708 3. There is an implied maximum of 7 bits for the bit length table and
709 15 bits for the actual data.
710 4. If only one code exists, then it is encoded using one bit. (Zero
711 would be more efficient, but perhaps a little confusing.) If two
712 codes exist, they are coded using one bit each (0 and 1).
713 5. There is no way of sending zero distance codes--a dummy must be
714 sent if there are none. (History: a pre 2.0 version of PKZIP would
715 store blocks with no distance codes, but this was discovered to be
716 too harsh a criterion.) Valid only for 1.93a. 2.04c does allow
717 zero distance codes, which is sent as one code of zero bits in
718 length.
719 6. There are up to 286 literal/length codes. Code 256 represents the
720 end-of-block. Note however that the static length tree defines
721 288 codes just to fill out the Huffman codes. Codes 286 and 287
722 cannot be used though, since there is no length base or extra bits
723 defined for them. Similarily, there are up to 30 distance codes.
724 However, static trees define 32 codes (all 5 bits) to fill out the
725 Huffman codes, but the last two had better not show up in the data.
726 7. Unzip can check dynamic Huffman blocks for complete code sets.
727 The exception is that a single code would not be complete (see #4).
728 8. The five bits following the block type is really the number of
729 literal codes sent minus 257.
730 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
731 (1+6+6). Therefore, to output three times the length, you output
732 three codes (1+1+1), whereas to output four times the same length,
733 you only need two codes (1+3). Hmm.
734 10. In the tree reconstruction algorithm, Code = Code + Increment
735 only if BitLength(i) is not zero. (Pretty obvious.)
736 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19)
737 12. Note: length code 284 can represent 227-258, but length code 285
738 really is 258. The last length deserves its own, short code
739 since it gets used a lot in very redundant files. The length
740 258 is special since 258 - 3 (the min match length) is 255.
741 13. The literal/length and distance code bit lengths are read as a
742 single stream of lengths. It is possible (and advantageous) for
743 a repeat code (16, 17, or 18) to go across the boundary between
744 the two sets of lengths.
745 */
746
747
748local void inflate_blocks_reset(s, z, c)
749inflate_blocks_statef *s;
750z_stream *z;
751uLongf *c;
752{
753 if (s->checkfn != Z_NULL)
754 *c = s->check;
755 if (s->mode == BTREE || s->mode == DTREE)
756 ZFREE(z, s->sub.trees.blens, s->sub.trees.nblens * sizeof(uInt));
757 if (s->mode == CODES)
758 {
759 inflate_codes_free(s->sub.decode.codes, z);
760 inflate_trees_free(s->sub.decode.td, z);
761 inflate_trees_free(s->sub.decode.tl, z);
762 }
763 s->mode = TYPE;
764 s->bitk = 0;
765 s->bitb = 0;
766 s->read = s->write = s->window;
767 if (s->checkfn != Z_NULL)
768 s->check = (*s->checkfn)(0L, Z_NULL, 0);
769 Trace((stderr, "inflate: blocks reset\n"));
770}
771
772
773local inflate_blocks_statef *inflate_blocks_new(z, c, w)
774z_stream *z;
775check_func c;
776uInt w;
777{
778 inflate_blocks_statef *s;
779
780 if ((s = (inflate_blocks_statef *)ZALLOC
781 (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)
782 return s;
783 if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)
784 {
785 ZFREE(z, s, sizeof(struct inflate_blocks_state));
786 return Z_NULL;
787 }
788 s->end = s->window + w;
789 s->checkfn = c;
790 s->mode = TYPE;
791 Trace((stderr, "inflate: blocks allocated\n"));
792 inflate_blocks_reset(s, z, &s->check);
793 return s;
794}
795
796
797local int inflate_blocks(s, z, r)
798inflate_blocks_statef *s;
799z_stream *z;
800int r;
801{
802 uInt t; /* temporary storage */
803 uLong b; /* bit buffer */
804 uInt k; /* bits in bit buffer */
805 Bytef *p; /* input data pointer */
806 uInt n; /* bytes available there */
807 Bytef *q; /* output window write pointer */
808 uInt m; /* bytes to end of window or read pointer */
809
810 /* copy input/output information to locals (UPDATE macro restores) */
811 LOAD
812
813 /* process input based on current state */
814 while (1) switch (s->mode)
815 {
816 case TYPE:
817 NEEDBITS(3)
818 t = (uInt)b & 7;
819 s->last = t & 1;
820 switch (t >> 1)
821 {
822 case 0: /* stored */
823 Trace((stderr, "inflate: stored block%s\n",
824 s->last ? " (last)" : ""));
825 DUMPBITS(3)
826 t = k & 7; /* go to byte boundary */
827 DUMPBITS(t)
828 s->mode = LENS; /* get length of stored block */
829 break;
830 case 1: /* fixed */
831 Trace((stderr, "inflate: fixed codes block%s\n",
832 s->last ? " (last)" : ""));
833 {
834 uInt bl, bd;
835 inflate_huft *tl, *td;
836
837 inflate_trees_fixed(&bl, &bd, &tl, &td);
838 s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);
839 if (s->sub.decode.codes == Z_NULL)
840 {
841 r = Z_MEM_ERROR;
842 LEAVE
843 }
844 s->sub.decode.tl = Z_NULL; /* don't try to free these */
845 s->sub.decode.td = Z_NULL;
846 }
847 DUMPBITS(3)
848 s->mode = CODES;
849 break;
850 case 2: /* dynamic */
851 Trace((stderr, "inflate: dynamic codes block%s\n",
852 s->last ? " (last)" : ""));
853 DUMPBITS(3)
854 s->mode = TABLE;
855 break;
856 case 3: /* illegal */
857 DUMPBITS(3)
858 s->mode = BADB;
859 z->msg = "invalid block type";
860 r = Z_DATA_ERROR;
861 LEAVE
862 }
863 break;
864 case LENS:
865 NEEDBITS(32)
866 if (((~b) >> 16) != (b & 0xffff))
867 {
868 s->mode = BADB;
869 z->msg = "invalid stored block lengths";
870 r = Z_DATA_ERROR;
871 LEAVE
872 }
873 s->sub.left = (uInt)b & 0xffff;
874 b = k = 0; /* dump bits */
875 Tracev((stderr, "inflate: stored length %u\n", s->sub.left));
876 s->mode = s->sub.left ? STORED : TYPE;
877 break;
878 case STORED:
879 if (n == 0)
880 LEAVE
881 NEEDOUT
882 t = s->sub.left;
883 if (t > n) t = n;
884 if (t > m) t = m;
885 zmemcpy(q, p, t);
886 p += t; n -= t;
887 q += t; m -= t;
888 if ((s->sub.left -= t) != 0)
889 break;
890 Tracev((stderr, "inflate: stored end, %lu total out\n",
891 z->total_out + (q >= s->read ? q - s->read :
892 (s->end - s->read) + (q - s->window))));
893 s->mode = s->last ? DRY : TYPE;
894 break;
895 case TABLE:
896 NEEDBITS(14)
897 s->sub.trees.table = t = (uInt)b & 0x3fff;
898#ifndef PKZIP_BUG_WORKAROUND
899 if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
900 {
901 s->mode = BADB;
902 z->msg = "too many length or distance symbols";
903 r = Z_DATA_ERROR;
904 LEAVE
905 }
906#endif
907 t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
908 if (t < 19)
909 t = 19;
910 if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)
911 {
912 r = Z_MEM_ERROR;
913 LEAVE
914 }
915 s->sub.trees.nblens = t;
916 DUMPBITS(14)
917 s->sub.trees.index = 0;
918 Tracev((stderr, "inflate: table sizes ok\n"));
919 s->mode = BTREE;
920 case BTREE:
921 while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
922 {
923 NEEDBITS(3)
924 s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;
925 DUMPBITS(3)
926 }
927 while (s->sub.trees.index < 19)
928 s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
929 s->sub.trees.bb = 7;
930 t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
931 &s->sub.trees.tb, z);
932 if (t != Z_OK)
933 {
934 r = t;
935 if (r == Z_DATA_ERROR)
936 s->mode = BADB;
937 LEAVE
938 }
939 s->sub.trees.index = 0;
940 Tracev((stderr, "inflate: bits tree ok\n"));
941 s->mode = DTREE;
942 case DTREE:
943 while (t = s->sub.trees.table,
944 s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
945 {
946 inflate_huft *h;
947 uInt i, j, c;
948
949 t = s->sub.trees.bb;
950 NEEDBITS(t)
951 h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);
952 t = h->word.what.Bits;
953 c = h->more.Base;
954 if (c < 16)
955 {
956 DUMPBITS(t)
957 s->sub.trees.blens[s->sub.trees.index++] = c;
958 }
959 else /* c == 16..18 */
960 {
961 i = c == 18 ? 7 : c - 14;
962 j = c == 18 ? 11 : 3;
963 NEEDBITS(t + i)
964 DUMPBITS(t)
965 j += (uInt)b & inflate_mask[i];
966 DUMPBITS(i)
967 i = s->sub.trees.index;
968 t = s->sub.trees.table;
969 if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
970 (c == 16 && i < 1))
971 {
972 s->mode = BADB;
973 z->msg = "invalid bit length repeat";
974 r = Z_DATA_ERROR;
975 LEAVE
976 }
977 c = c == 16 ? s->sub.trees.blens[i - 1] : 0;
978 do {
979 s->sub.trees.blens[i++] = c;
980 } while (--j);
981 s->sub.trees.index = i;
982 }
983 }
984 inflate_trees_free(s->sub.trees.tb, z);
985 s->sub.trees.tb = Z_NULL;
986 {
987 uInt bl, bd;
988 inflate_huft *tl, *td;
989 inflate_codes_statef *c;
990
991 bl = 9; /* must be <= 9 for lookahead assumptions */
992 bd = 6; /* must be <= 9 for lookahead assumptions */
993 t = s->sub.trees.table;
994 t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
995 s->sub.trees.blens, &bl, &bd, &tl, &td, z);
996 if (t != Z_OK)
997 {
998 if (t == (uInt)Z_DATA_ERROR)
999 s->mode = BADB;
1000 r = t;
1001 LEAVE
1002 }
1003 Tracev((stderr, "inflate: trees ok\n"));
1004 if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
1005 {
1006 inflate_trees_free(td, z);
1007 inflate_trees_free(tl, z);
1008 r = Z_MEM_ERROR;
1009 LEAVE
1010 }
1011 ZFREE(z, s->sub.trees.blens, s->sub.trees.nblens * sizeof(uInt));
1012 s->sub.decode.codes = c;
1013 s->sub.decode.tl = tl;
1014 s->sub.decode.td = td;
1015 }
1016 s->mode = CODES;
1017 case CODES:
1018 UPDATE
1019 if ((r = inflate_codes(s, z, r)) != Z_STREAM_END)
1020 return inflate_flush(s, z, r);
1021 r = Z_OK;
1022 inflate_codes_free(s->sub.decode.codes, z);
1023 inflate_trees_free(s->sub.decode.td, z);
1024 inflate_trees_free(s->sub.decode.tl, z);
1025 LOAD
1026 Tracev((stderr, "inflate: codes end, %lu total out\n",
1027 z->total_out + (q >= s->read ? q - s->read :
1028 (s->end - s->read) + (q - s->window))));
1029 if (!s->last)
1030 {
1031 s->mode = TYPE;
1032 break;
1033 }
1034 if (k > 7) /* return unused byte, if any */
1035 {
1036 Assert(k < 16, "inflate_codes grabbed too many bytes")
1037 k -= 8;
1038 n++;
1039 p--; /* can always return one */
1040 }
1041 s->mode = DRY;
1042 case DRY:
1043 FLUSH
1044 if (s->read != s->write)
1045 LEAVE
1046 s->mode = DONEB;
1047 case DONEB:
1048 r = Z_STREAM_END;
1049 LEAVE
1050 case BADB:
1051 r = Z_DATA_ERROR;
1052 LEAVE
1053 default:
1054 r = Z_STREAM_ERROR;
1055 LEAVE
1056 }
1057}
1058
1059
1060local int inflate_blocks_free(s, z, c)
1061inflate_blocks_statef *s;
1062z_stream *z;
1063uLongf *c;
1064{
1065 inflate_blocks_reset(s, z, c);
1066 ZFREE(z, s->window, s->end - s->window);
1067 ZFREE(z, s, sizeof(struct inflate_blocks_state));
1068 Trace((stderr, "inflate: blocks freed\n"));
1069 return Z_OK;
1070}
1071
1072/*
1073 * This subroutine adds the data at next_in/avail_in to the output history
1074 * without performing any output. The output buffer must be "caught up";
1075 * i.e. no pending output (hence s->read equals s->write), and the state must
1076 * be BLOCKS (i.e. we should be willing to see the start of a series of
1077 * BLOCKS). On exit, the output will also be caught up, and the checksum
1078 * will have been updated if need be.
1079 */
1080local int inflate_addhistory(s, z)
1081inflate_blocks_statef *s;
1082z_stream *z;
1083{
1084 uLong b; /* bit buffer */ /* NOT USED HERE */
1085 uInt k; /* bits in bit buffer */ /* NOT USED HERE */
1086 uInt t; /* temporary storage */
1087 Bytef *p; /* input data pointer */
1088 uInt n; /* bytes available there */
1089 Bytef *q; /* output window write pointer */
1090 uInt m; /* bytes to end of window or read pointer */
1091
1092 if (s->read != s->write)
1093 return Z_STREAM_ERROR;
1094 if (s->mode != TYPE)
1095 return Z_DATA_ERROR;
1096
1097 /* we're ready to rock */
1098 LOAD
1099 /* while there is input ready, copy to output buffer, moving
1100 * pointers as needed.
1101 */
1102 while (n) {
1103 t = n; /* how many to do */
1104 /* is there room until end of buffer? */
1105 if (t > m) t = m;
1106 /* update check information */
1107 if (s->checkfn != Z_NULL)
1108 s->check = (*s->checkfn)(s->check, q, t);
1109 zmemcpy(q, p, t);
1110 q += t;
1111 p += t;
1112 n -= t;
1113 z->total_out += t;
1114 s->read = q; /* drag read pointer forward */
1115/* WRAP */ /* expand WRAP macro by hand to handle s->read */
1116 if (q == s->end) {
1117 s->read = q = s->window;
1118 m = WAVAIL;
1119 }
1120 }
1121 UPDATE
1122 return Z_OK;
1123}
1124
1125
1126/*
1127 * At the end of a Deflate-compressed PPP packet, we expect to have seen
1128 * a `stored' block type value but not the (zero) length bytes.
1129 */
1130local int inflate_packet_flush(s)
1131 inflate_blocks_statef *s;
1132{
1133 if (s->mode != LENS)
1134 return Z_DATA_ERROR;
1135 s->mode = TYPE;
1136 return Z_OK;
1137}
1138
1139
1140/*+++++*/
1141/* inftrees.c -- generate Huffman trees for efficient decoding
1142 * Copyright (C) 1995 Mark Adler
1143 * For conditions of distribution and use, see copyright notice in zlib.h
1144 */
1145
1146/* simplify the use of the inflate_huft type with some defines */
1147#define base more.Base
1148#define next more.Next
1149#define exop word.what.Exop
1150#define bits word.what.Bits
1151
1152
1153local int huft_build OF((
1154 uIntf *, /* code lengths in bits */
1155 uInt, /* number of codes */
1156 uInt, /* number of "simple" codes */
1157 uIntf *, /* list of base values for non-simple codes */
1158 uIntf *, /* list of extra bits for non-simple codes */
1159 inflate_huft * FAR*,/* result: starting table */
1160 uIntf *, /* maximum lookup bits (returns actual) */
1161 z_stream *)); /* for zalloc function */
1162
1163local voidpf falloc OF((
1164 voidpf, /* opaque pointer (not used) */
1165 uInt, /* number of items */
1166 uInt)); /* size of item */
1167
1168local void ffree OF((
1169 voidpf q, /* opaque pointer (not used) */
1170 voidpf p, /* what to free (not used) */
1171 uInt n)); /* number of bytes (not used) */
1172
1173/* Tables for deflate from PKZIP's appnote.txt. */
1174local uInt cplens[] = { /* Copy lengths for literal codes 257..285 */
1175 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
1176 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
1177 /* actually lengths - 2; also see note #13 above about 258 */
1178local uInt cplext[] = { /* Extra bits for literal codes 257..285 */
1179 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
1180 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 192, 192}; /* 192==invalid */
1181local uInt cpdist[] = { /* Copy offsets for distance codes 0..29 */
1182 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
1183 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
1184 8193, 12289, 16385, 24577};
1185local uInt cpdext[] = { /* Extra bits for distance codes */
1186 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
1187 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
1188 12, 12, 13, 13};
1189
1190/*
1191 Huffman code decoding is performed using a multi-level table lookup.
1192 The fastest way to decode is to simply build a lookup table whose
1193 size is determined by the longest code. However, the time it takes
1194 to build this table can also be a factor if the data being decoded
1195 is not very long. The most common codes are necessarily the
1196 shortest codes, so those codes dominate the decoding time, and hence
1197 the speed. The idea is you can have a shorter table that decodes the
1198 shorter, more probable codes, and then point to subsidiary tables for
1199 the longer codes. The time it costs to decode the longer codes is
1200 then traded against the time it takes to make longer tables.
1201
1202 This results of this trade are in the variables lbits and dbits
1203 below. lbits is the number of bits the first level table for literal/
1204 length codes can decode in one step, and dbits is the same thing for
1205 the distance codes. Subsequent tables are also less than or equal to
1206 those sizes. These values may be adjusted either when all of the
1207 codes are shorter than that, in which case the longest code length in
1208 bits is used, or when the shortest code is *longer* than the requested
1209 table size, in which case the length of the shortest code in bits is
1210 used.
1211
1212 There are two different values for the two tables, since they code a
1213 different number of possibilities each. The literal/length table
1214 codes 286 possible values, or in a flat code, a little over eight
1215 bits. The distance table codes 30 possible values, or a little less
1216 than five bits, flat. The optimum values for speed end up being
1217 about one bit more than those, so lbits is 8+1 and dbits is 5+1.
1218 The optimum values may differ though from machine to machine, and
1219 possibly even between compilers. Your mileage may vary.
1220 */
1221
1222
1223/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */
1224#define BMAX 15 /* maximum bit length of any code */
1225#define N_MAX 288 /* maximum number of codes in any set */
1226
1227#ifdef DEBUG_ZLIB
1228 uInt inflate_hufts;
1229#endif
1230
1231local int huft_build(b, n, s, d, e, t, m, zs)
1232uIntf *b; /* code lengths in bits (all assumed <= BMAX) */
1233uInt n; /* number of codes (assumed <= N_MAX) */
1234uInt s; /* number of simple-valued codes (0..s-1) */
1235uIntf *d; /* list of base values for non-simple codes */
1236uIntf *e; /* list of extra bits for non-simple codes */
1237inflate_huft * FAR *t; /* result: starting table */
1238uIntf *m; /* maximum lookup bits, returns actual */
1239z_stream *zs; /* for zalloc function */
1240/* Given a list of code lengths and a maximum table size, make a set of
1241 tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
1242 if the given code set is incomplete (the tables are still built in this
1243 case), Z_DATA_ERROR if the input is invalid (all zero length codes or an
1244 over-subscribed set of lengths), or Z_MEM_ERROR if not enough memory. */
1245{
1246
1247 uInt a; /* counter for codes of length k */
1248 uInt c[BMAX+1]; /* bit length count table */
1249 uInt f; /* i repeats in table every f entries */
1250 int g; /* maximum code length */
1251 int h; /* table level */
1252 register uInt i; /* counter, current code */
1253 register uInt j; /* counter */
1254 register int k; /* number of bits in current code */
1255 int l; /* bits per table (returned in m) */
1256 register uIntf *p; /* pointer into c[], b[], or v[] */
1257 inflate_huft *q; /* points to current table */
1258 struct inflate_huft_s r; /* table entry for structure assignment */
1259 inflate_huft *u[BMAX]; /* table stack */
1260 uInt v[N_MAX]; /* values in order of bit length */
1261 register int w; /* bits before this table == (l * h) */
1262 uInt x[BMAX+1]; /* bit offsets, then code stack */
1263 uIntf *xp; /* pointer into x */
1264 int y; /* number of dummy codes added */
1265 uInt z; /* number of entries in current table */
1266
1267
1268 /* Generate counts for each bit length */
1269 p = c;
1270#define C0 *p++ = 0;
1271#define C2 C0 C0 C0 C0
1272#define C4 C2 C2 C2 C2
1273 C4 /* clear c[]--assume BMAX+1 is 16 */
1274 p = b; i = n;
1275 do {
1276 c[*p++]++; /* assume all entries <= BMAX */
1277 } while (--i);
1278 if (c[0] == n) /* null input--all zero length codes */
1279 {
1280 *t = (inflate_huft *)Z_NULL;
1281 *m = 0;
1282 return Z_OK;
1283 }
1284
1285
1286 /* Find minimum and maximum length, bound *m by those */
1287 l = *m;
1288 for (j = 1; j <= BMAX; j++)
1289 if (c[j])
1290 break;
1291 k = j; /* minimum code length */
1292 if ((uInt)l < j)
1293 l = j;
1294 for (i = BMAX; i; i--)
1295 if (c[i])
1296 break;
1297 g = i; /* maximum code length */
1298 if ((uInt)l > i)
1299 l = i;
1300 *m = l;
1301
1302
1303 /* Adjust last length count to fill out codes, if needed */
1304 for (y = 1 << j; j < i; j++, y <<= 1)
1305 if ((y -= c[j]) < 0)
1306 return Z_DATA_ERROR;
1307 if ((y -= c[i]) < 0)
1308 return Z_DATA_ERROR;
1309 c[i] += y;
1310
1311
1312 /* Generate starting offsets into the value table for each length */
1313 x[1] = j = 0;
1314 p = c + 1; xp = x + 2;
1315 while (--i) { /* note that i == g from above */
1316 *xp++ = (j += *p++);
1317 }
1318
1319
1320 /* Make a table of values in order of bit lengths */
1321 p = b; i = 0;
1322 do {
1323 if ((j = *p++) != 0)
1324 v[x[j]++] = i;
1325 } while (++i < n);
1326
1327
1328 /* Generate the Huffman codes and for each, make the table entries */
1329 x[0] = i = 0; /* first Huffman code is zero */
1330 p = v; /* grab values in bit order */
1331 h = -1; /* no tables yet--level -1 */
1332 w = -l; /* bits decoded == (l * h) */
1333 u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */
1334 q = (inflate_huft *)Z_NULL; /* ditto */
1335 z = 0; /* ditto */
1336
1337 /* go through the bit lengths (k already is bits in shortest code) */
1338 for (; k <= g; k++)
1339 {
1340 a = c[k];
1341 while (a--)
1342 {
1343 /* here i is the Huffman code of length k bits for value *p */
1344 /* make tables up to required level */
1345 while (k > w + l)
1346 {
1347 h++;
1348 w += l; /* previous table always l bits */
1349
1350 /* compute minimum size table less than or equal to l bits */
1351 z = (z = g - w) > (uInt)l ? l : z; /* table size upper limit */
1352 if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */
1353 { /* too few codes for k-w bit table */
1354 f -= a + 1; /* deduct codes from patterns left */
1355 xp = c + k;
1356 if (j < z)
1357 while (++j < z) /* try smaller tables up to z bits */
1358 {
1359 if ((f <<= 1) <= *++xp)
1360 break; /* enough codes to use up j bits */
1361 f -= *xp; /* else deduct codes from patterns */
1362 }
1363 }
1364 z = 1 << j; /* table entries for j-bit table */
1365
1366 /* allocate and link in new table */
1367 if ((q = (inflate_huft *)ZALLOC
1368 (zs,z + 1,sizeof(inflate_huft))) == Z_NULL)
1369 {
1370 if (h)
1371 inflate_trees_free(u[0], zs);
1372 return Z_MEM_ERROR; /* not enough memory */
1373 }
1374 q->word.Nalloc = z + 1;
1375#ifdef DEBUG_ZLIB
1376 inflate_hufts += z + 1;
1377#endif
1378 *t = q + 1; /* link to list for huft_free() */
1379 *(t = &(q->next)) = Z_NULL;
1380 u[h] = ++q; /* table starts after link */
1381
1382 /* connect to last table, if there is one */
1383 if (h)
1384 {
1385 x[h] = i; /* save pattern for backing up */
1386 r.bits = (Byte)l; /* bits to dump before this table */
1387 r.exop = (Byte)j; /* bits in this table */
1388 r.next = q; /* pointer to this table */
1389 j = i >> (w - l); /* (get around Turbo C bug) */
1390 u[h-1][j] = r; /* connect to last table */
1391 }
1392 }
1393
1394 /* set up table entry in r */
1395 r.bits = (Byte)(k - w);
1396 if (p >= v + n)
1397 r.exop = 128 + 64; /* out of values--invalid code */
1398 else if (*p < s)
1399 {
1400 r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */
1401 r.base = *p++; /* simple code is just the value */
1402 }
1403 else
1404 {
1405 r.exop = (Byte)e[*p - s] + 16 + 64; /* non-simple--look up in lists */
1406 r.base = d[*p++ - s];
1407 }
1408
1409 /* fill code-like entries with r */
1410 f = 1 << (k - w);
1411 for (j = i >> w; j < z; j += f)
1412 q[j] = r;
1413
1414 /* backwards increment the k-bit code i */
1415 for (j = 1 << (k - 1); i & j; j >>= 1)
1416 i ^= j;
1417 i ^= j;
1418
1419 /* backup over finished tables */
1420 while ((i & ((1 << w) - 1)) != x[h])
1421 {
1422 h--; /* don't need to update q */
1423 w -= l;
1424 }
1425 }
1426 }
1427
1428
1429 /* Return Z_BUF_ERROR if we were given an incomplete table */
1430 return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;
1431}
1432
1433
1434local int inflate_trees_bits(c, bb, tb, z)
1435uIntf *c; /* 19 code lengths */
1436uIntf *bb; /* bits tree desired/actual depth */
1437inflate_huft * FAR *tb; /* bits tree result */
1438z_stream *z; /* for zfree function */
1439{
1440 int r;
1441
1442 r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL, tb, bb, z);
1443 if (r == Z_DATA_ERROR)
1444 z->msg = "oversubscribed dynamic bit lengths tree";
1445 else if (r == Z_BUF_ERROR)
1446 {
1447 inflate_trees_free(*tb, z);
1448 z->msg = "incomplete dynamic bit lengths tree";
1449 r = Z_DATA_ERROR;
1450 }
1451 return r;
1452}
1453
1454
1455local int inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, z)
1456uInt nl; /* number of literal/length codes */
1457uInt nd; /* number of distance codes */
1458uIntf *c; /* that many (total) code lengths */
1459uIntf *bl; /* literal desired/actual bit depth */
1460uIntf *bd; /* distance desired/actual bit depth */
1461inflate_huft * FAR *tl; /* literal/length tree result */
1462inflate_huft * FAR *td; /* distance tree result */
1463z_stream *z; /* for zfree function */
1464{
1465 int r;
1466
1467 /* build literal/length tree */
1468 if ((r = huft_build(c, nl, 257, cplens, cplext, tl, bl, z)) != Z_OK)
1469 {
1470 if (r == Z_DATA_ERROR)
1471 z->msg = "oversubscribed literal/length tree";
1472 else if (r == Z_BUF_ERROR)
1473 {
1474 inflate_trees_free(*tl, z);
1475 z->msg = "incomplete literal/length tree";
1476 r = Z_DATA_ERROR;
1477 }
1478 return r;
1479 }
1480
1481 /* build distance tree */
1482 if ((r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, z)) != Z_OK)
1483 {
1484 if (r == Z_DATA_ERROR)
1485 z->msg = "oversubscribed literal/length tree";
1486 else if (r == Z_BUF_ERROR) {
1487#ifdef PKZIP_BUG_WORKAROUND
1488 r = Z_OK;
1489 }
1490#else
1491 inflate_trees_free(*td, z);
1492 z->msg = "incomplete literal/length tree";
1493 r = Z_DATA_ERROR;
1494 }
1495 inflate_trees_free(*tl, z);
1496 return r;
1497#endif
1498 }
1499
1500 /* done */
1501 return Z_OK;
1502}
1503
1504
1505/* build fixed tables only once--keep them here */
1506local int fixed_lock = 0;
1507local int fixed_built = 0;
1508#define FIXEDH 530 /* number of hufts used by fixed tables */
1509local uInt fixed_left = FIXEDH;
1510local inflate_huft fixed_mem[FIXEDH];
1511local uInt fixed_bl;
1512local uInt fixed_bd;
1513local inflate_huft *fixed_tl;
1514local inflate_huft *fixed_td;
1515
1516
1517local voidpf falloc(q, n, s)
1518voidpf q; /* opaque pointer (not used) */
1519uInt n; /* number of items */
1520uInt s; /* size of item */
1521{
1522 Assert(s == sizeof(inflate_huft) && n <= fixed_left,
1523 "inflate_trees falloc overflow");
1524 if (q) s++; /* to make some compilers happy */
1525 fixed_left -= n;
1526 return (voidpf)(fixed_mem + fixed_left);
1527}
1528
1529
1530local void ffree(q, p, n)
1531voidpf q;
1532voidpf p;
1533uInt n;
1534{
1535 Assert(0, "inflate_trees ffree called!");
1536 if (q) q = p; /* to make some compilers happy */
1537}
1538
1539
1540local int inflate_trees_fixed(bl, bd, tl, td)
1541uIntf *bl; /* literal desired/actual bit depth */
1542uIntf *bd; /* distance desired/actual bit depth */
1543inflate_huft * FAR *tl; /* literal/length tree result */
1544inflate_huft * FAR *td; /* distance tree result */
1545{
1546 /* build fixed tables if not built already--lock out other instances */
1547 while (++fixed_lock > 1)
1548 fixed_lock--;
1549 if (!fixed_built)
1550 {
1551 int k; /* temporary variable */
1552 unsigned c[288]; /* length list for huft_build */
1553 z_stream z; /* for falloc function */
1554
1555 /* set up fake z_stream for memory routines */
1556 z.zalloc = falloc;
1557 z.zfree = ffree;
1558 z.opaque = Z_NULL;
1559
1560 /* literal table */
1561 for (k = 0; k < 144; k++)
1562 c[k] = 8;
1563 for (; k < 256; k++)
1564 c[k] = 9;
1565 for (; k < 280; k++)
1566 c[k] = 7;
1567 for (; k < 288; k++)
1568 c[k] = 8;
1569 fixed_bl = 7;
1570 huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl, &z);
1571
1572 /* distance table */
1573 for (k = 0; k < 30; k++)
1574 c[k] = 5;
1575 fixed_bd = 5;
1576 huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd, &z);
1577
1578 /* done */
1579 fixed_built = 1;
1580 }
1581 fixed_lock--;
1582 *bl = fixed_bl;
1583 *bd = fixed_bd;
1584 *tl = fixed_tl;
1585 *td = fixed_td;
1586 return Z_OK;
1587}
1588
1589
1590local int inflate_trees_free(t, z)
1591inflate_huft *t; /* table to free */
1592z_stream *z; /* for zfree function */
1593/* Free the malloc'ed tables built by huft_build(), which makes a linked
1594 list of the tables it made, with the links in a dummy first entry of
1595 each table. */
1596{
1597 register inflate_huft *p, *q;
1598
1599 /* Go through linked list, freeing from the malloced (t[-1]) address. */
1600 p = t;
1601 while (p != Z_NULL)
1602 {
1603 q = (--p)->next;
1604 ZFREE(z, p, p->word.Nalloc * sizeof(inflate_huft));
1605 p = q;
1606 }
1607 return Z_OK;
1608}
1609
1610/*+++++*/
1611/* infcodes.c -- process literals and length/distance pairs
1612 * Copyright (C) 1995 Mark Adler
1613 * For conditions of distribution and use, see copyright notice in zlib.h
1614 */
1615
1616/* simplify the use of the inflate_huft type with some defines */
1617#define base more.Base
1618#define next more.Next
1619#define exop word.what.Exop
1620#define bits word.what.Bits
1621
1622/* inflate codes private state */
1623struct inflate_codes_state {
1624
1625 /* mode */
1626 enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
1627 START, /* x: set up for LEN */
1628 LEN, /* i: get length/literal/eob next */
1629 LENEXT, /* i: getting length extra (have base) */
1630 DIST, /* i: get distance next */
1631 DISTEXT, /* i: getting distance extra */
1632 COPY, /* o: copying bytes in window, waiting for space */
1633 LIT, /* o: got literal, waiting for output space */
1634 WASH, /* o: got eob, possibly still output waiting */
1635 END, /* x: got eob and all data flushed */
1636 BADCODE} /* x: got error */
1637 mode; /* current inflate_codes mode */
1638
1639 /* mode dependent information */
1640 uInt len;
1641 union {
1642 struct {
1643 inflate_huft *tree; /* pointer into tree */
1644 uInt need; /* bits needed */
1645 } code; /* if LEN or DIST, where in tree */
1646 uInt lit; /* if LIT, literal */
1647 struct {
1648 uInt get; /* bits to get for extra */
1649 uInt dist; /* distance back to copy from */
1650 } copy; /* if EXT or COPY, where and how much */
1651 } sub; /* submode */
1652
1653 /* mode independent information */
1654 Byte lbits; /* ltree bits decoded per branch */
1655 Byte dbits; /* dtree bits decoder per branch */
1656 inflate_huft *ltree; /* literal/length/eob tree */
1657 inflate_huft *dtree; /* distance tree */
1658
1659};
1660
1661
1662local inflate_codes_statef *inflate_codes_new(bl, bd, tl, td, z)
1663uInt bl, bd;
1664inflate_huft *tl, *td;
1665z_stream *z;
1666{
1667 inflate_codes_statef *c;
1668
1669 if ((c = (inflate_codes_statef *)
1670 ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL)
1671 {
1672 c->mode = START;
1673 c->lbits = (Byte)bl;
1674 c->dbits = (Byte)bd;
1675 c->ltree = tl;
1676 c->dtree = td;
1677 Tracev((stderr, "inflate: codes new\n"));
1678 }
1679 return c;
1680}
1681
1682
1683local int inflate_codes(s, z, r)
1684inflate_blocks_statef *s;
1685z_stream *z;
1686int r;
1687{
1688 uInt j; /* temporary storage */
1689 inflate_huft *t; /* temporary pointer */
1690 uInt e; /* extra bits or operation */
1691 uLong b; /* bit buffer */
1692 uInt k; /* bits in bit buffer */
1693 Bytef *p; /* input data pointer */
1694 uInt n; /* bytes available there */
1695 Bytef *q; /* output window write pointer */
1696 uInt m; /* bytes to end of window or read pointer */
1697 Bytef *f; /* pointer to copy strings from */
1698 inflate_codes_statef *c = s->sub.decode.codes; /* codes state */
1699
1700 /* copy input/output information to locals (UPDATE macro restores) */
1701 LOAD
1702
1703 /* process input and output based on current state */
1704 while (1) switch (c->mode)
1705 { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
1706 case START: /* x: set up for LEN */
1707#ifndef SLOW
1708 if (m >= 258 && n >= 10)
1709 {
1710 UPDATE
1711 r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z);
1712 LOAD
1713 if (r != Z_OK)
1714 {
1715 c->mode = r == Z_STREAM_END ? WASH : BADCODE;
1716 break;
1717 }
1718 }
1719#endif /* !SLOW */
1720 c->sub.code.need = c->lbits;
1721 c->sub.code.tree = c->ltree;
1722 c->mode = LEN;
1723 case LEN: /* i: get length/literal/eob next */
1724 j = c->sub.code.need;
1725 NEEDBITS(j)
1726 t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
1727 DUMPBITS(t->bits)
1728 e = (uInt)(t->exop);
1729 if (e == 0) /* literal */
1730 {
1731 c->sub.lit = t->base;
1732 Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
1733 "inflate: literal '%c'\n" :
1734 "inflate: literal 0x%02x\n", t->base));
1735 c->mode = LIT;
1736 break;
1737 }
1738 if (e & 16) /* length */
1739 {
1740 c->sub.copy.get = e & 15;
1741 c->len = t->base;
1742 c->mode = LENEXT;
1743 break;
1744 }
1745 if ((e & 64) == 0) /* next table */
1746 {
1747 c->sub.code.need = e;
1748 c->sub.code.tree = t->next;
1749 break;
1750 }
1751 if (e & 32) /* end of block */
1752 {
1753 Tracevv((stderr, "inflate: end of block\n"));
1754 c->mode = WASH;
1755 break;
1756 }
1757 c->mode = BADCODE; /* invalid code */
1758 z->msg = "invalid literal/length code";
1759 r = Z_DATA_ERROR;
1760 LEAVE
1761 case LENEXT: /* i: getting length extra (have base) */
1762 j = c->sub.copy.get;
1763 NEEDBITS(j)
1764 c->len += (uInt)b & inflate_mask[j];
1765 DUMPBITS(j)
1766 c->sub.code.need = c->dbits;
1767 c->sub.code.tree = c->dtree;
1768 Tracevv((stderr, "inflate: length %u\n", c->len));
1769 c->mode = DIST;
1770 case DIST: /* i: get distance next */
1771 j = c->sub.code.need;
1772 NEEDBITS(j)
1773 t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
1774 DUMPBITS(t->bits)
1775 e = (uInt)(t->exop);
1776 if (e & 16) /* distance */
1777 {
1778 c->sub.copy.get = e & 15;
1779 c->sub.copy.dist = t->base;
1780 c->mode = DISTEXT;
1781 break;
1782 }
1783 if ((e & 64) == 0) /* next table */
1784 {
1785 c->sub.code.need = e;
1786 c->sub.code.tree = t->next;
1787 break;
1788 }
1789 c->mode = BADCODE; /* invalid code */
1790 z->msg = "invalid distance code";
1791 r = Z_DATA_ERROR;
1792 LEAVE
1793 case DISTEXT: /* i: getting distance extra */
1794 j = c->sub.copy.get;
1795 NEEDBITS(j)
1796 c->sub.copy.dist += (uInt)b & inflate_mask[j];
1797 DUMPBITS(j)
1798 Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist));
1799 c->mode = COPY;
1800 case COPY: /* o: copying bytes in window, waiting for space */
1801#ifndef __TURBOC__ /* Turbo C bug for following expression */
1802 f = (uInt)(q - s->window) < c->sub.copy.dist ?
1803 s->end - (c->sub.copy.dist - (q - s->window)) :
1804 q - c->sub.copy.dist;
1805#else
1806 f = q - c->sub.copy.dist;
1807 if ((uInt)(q - s->window) < c->sub.copy.dist)
1808 f = s->end - (c->sub.copy.dist - (q - s->window));
1809#endif
1810 while (c->len)
1811 {
1812 NEEDOUT
1813 OUTBYTE(*f++)
1814 if (f == s->end)
1815 f = s->window;
1816 c->len--;
1817 }
1818 c->mode = START;
1819 break;
1820 case LIT: /* o: got literal, waiting for output space */
1821 NEEDOUT
1822 OUTBYTE(c->sub.lit)
1823 c->mode = START;
1824 break;
1825 case WASH: /* o: got eob, possibly more output */
1826 FLUSH
1827 if (s->read != s->write)
1828 LEAVE
1829 c->mode = END;
1830 case END:
1831 r = Z_STREAM_END;
1832 LEAVE
1833 case BADCODE: /* x: got error */
1834 r = Z_DATA_ERROR;
1835 LEAVE
1836 default:
1837 r = Z_STREAM_ERROR;
1838 LEAVE
1839 }
1840}
1841
1842
1843local void inflate_codes_free(c, z)
1844inflate_codes_statef *c;
1845z_stream *z;
1846{
1847 ZFREE(z, c, sizeof(struct inflate_codes_state));
1848 Tracev((stderr, "inflate: codes free\n"));
1849}
1850
1851/*+++++*/
1852/* inflate_util.c -- data and routines common to blocks and codes
1853 * Copyright (C) 1995 Mark Adler
1854 * For conditions of distribution and use, see copyright notice in zlib.h
1855 */
1856
1857/* copy as much as possible from the sliding window to the output area */
1858local int inflate_flush(s, z, r)
1859inflate_blocks_statef *s;
1860z_stream *z;
1861int r;
1862{
1863 uInt n;
1864 Bytef *p, *q;
1865
1866 /* local copies of source and destination pointers */
1867 p = z->next_out;
1868 q = s->read;
1869
1870 /* compute number of bytes to copy as far as end of window */
1871 n = (uInt)((q <= s->write ? s->write : s->end) - q);
1872 if (n > z->avail_out) n = z->avail_out;
1873 if (n && r == Z_BUF_ERROR) r = Z_OK;
1874
1875 /* update counters */
1876 z->avail_out -= n;
1877 z->total_out += n;
1878
1879 /* update check information */
1880 if (s->checkfn != Z_NULL)
1881 s->check = (*s->checkfn)(s->check, q, n);
1882
1883 /* copy as far as end of window */
1884 zmemcpy(p, q, n);
1885 p += n;
1886 q += n;
1887
1888 /* see if more to copy at beginning of window */
1889 if (q == s->end)
1890 {
1891 /* wrap pointers */
1892 q = s->window;
1893 if (s->write == s->end)
1894 s->write = s->window;
1895
1896 /* compute bytes to copy */
1897 n = (uInt)(s->write - q);
1898 if (n > z->avail_out) n = z->avail_out;
1899 if (n && r == Z_BUF_ERROR) r = Z_OK;
1900
1901 /* update counters */
1902 z->avail_out -= n;
1903 z->total_out += n;
1904
1905 /* update check information */
1906 if (s->checkfn != Z_NULL)
1907 s->check = (*s->checkfn)(s->check, q, n);
1908
1909 /* copy */
1910 zmemcpy(p, q, n);
1911 p += n;
1912 q += n;
1913 }
1914
1915 /* update pointers */
1916 z->next_out = p;
1917 s->read = q;
1918
1919 /* done */
1920 return r;
1921}
1922
1923
1924/*+++++*/
1925/* inffast.c -- process literals and length/distance pairs fast
1926 * Copyright (C) 1995 Mark Adler
1927 * For conditions of distribution and use, see copyright notice in zlib.h
1928 */
1929
1930/* simplify the use of the inflate_huft type with some defines */
1931#define base more.Base
1932#define next more.Next
1933#define exop word.what.Exop
1934#define bits word.what.Bits
1935
1936/* macros for bit input with no checking and for returning unused bytes */
1937#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
1938#define UNGRAB {n+=(c=k>>3);p-=c;k&=7;}
1939
1940/* Called with number of bytes left to write in window at least 258
1941 (the maximum string length) and number of input bytes available
1942 at least ten. The ten bytes are six bytes for the longest length/
1943 distance pair plus four bytes for overloading the bit buffer. */
1944
1945local int inflate_fast(bl, bd, tl, td, s, z)
1946uInt bl, bd;
1947inflate_huft *tl, *td;
1948inflate_blocks_statef *s;
1949z_stream *z;
1950{
1951 inflate_huft *t; /* temporary pointer */
1952 uInt e; /* extra bits or operation */
1953 uLong b; /* bit buffer */
1954 uInt k; /* bits in bit buffer */
1955 Bytef *p; /* input data pointer */
1956 uInt n; /* bytes available there */
1957 Bytef *q; /* output window write pointer */
1958 uInt m; /* bytes to end of window or read pointer */
1959 uInt ml; /* mask for literal/length tree */
1960 uInt md; /* mask for distance tree */
1961 uInt c; /* bytes to copy */
1962 uInt d; /* distance back to copy from */
1963 Bytef *r; /* copy source pointer */
1964
1965 /* load input, output, bit values */
1966 LOAD
1967
1968 /* initialize masks */
1969 ml = inflate_mask[bl];
1970 md = inflate_mask[bd];
1971
1972 /* do until not enough input or output space for fast loop */
1973 do { /* assume called with m >= 258 && n >= 10 */
1974 /* get literal/length code */
1975 GRABBITS(20) /* max bits for literal/length code */
1976 if ((e = (t = tl + ((uInt)b & ml))->exop) == 0)
1977 {
1978 DUMPBITS(t->bits)
1979 Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
1980 "inflate: * literal '%c'\n" :
1981 "inflate: * literal 0x%02x\n", t->base));
1982 *q++ = (Byte)t->base;
1983 m--;
1984 continue;
1985 }
1986 do {
1987 DUMPBITS(t->bits)
1988 if (e & 16)
1989 {
1990 /* get extra bits for length */
1991 e &= 15;
1992 c = t->base + ((uInt)b & inflate_mask[e]);
1993 DUMPBITS(e)
1994 Tracevv((stderr, "inflate: * length %u\n", c));
1995
1996 /* decode distance base of block to copy */
1997 GRABBITS(15); /* max bits for distance code */
1998 e = (t = td + ((uInt)b & md))->exop;
1999 do {
2000 DUMPBITS(t->bits)
2001 if (e & 16)
2002 {
2003 /* get extra bits to add to distance base */
2004 e &= 15;
2005 GRABBITS(e) /* get extra bits (up to 13) */
2006 d = t->base + ((uInt)b & inflate_mask[e]);
2007 DUMPBITS(e)
2008 Tracevv((stderr, "inflate: * distance %u\n", d));
2009
2010 /* do the copy */
2011 m -= c;
2012 if ((uInt)(q - s->window) >= d) /* offset before dest */
2013 { /* just copy */
2014 r = q - d;
2015 *q++ = *r++; c--; /* minimum count is three, */
2016 *q++ = *r++; c--; /* so unroll loop a little */
2017 }
2018 else /* else offset after destination */
2019 {
2020 e = d - (q - s->window); /* bytes from offset to end */
2021 r = s->end - e; /* pointer to offset */
2022 if (c > e) /* if source crosses, */
2023 {
2024 c -= e; /* copy to end of window */
2025 do {
2026 *q++ = *r++;
2027 } while (--e);
2028 r = s->window; /* copy rest from start of window */
2029 }
2030 }
2031 do { /* copy all or what's left */
2032 *q++ = *r++;
2033 } while (--c);
2034 break;
2035 }
2036 else if ((e & 64) == 0)
2037 e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop;
2038 else
2039 {
2040 z->msg = "invalid distance code";
2041 UNGRAB
2042 UPDATE
2043 return Z_DATA_ERROR;
2044 }
2045 } while (1);
2046 break;
2047 }
2048 if ((e & 64) == 0)
2049 {
2050 if ((e = (t = t->next + ((uInt)b & inflate_mask[e]))->exop) == 0)
2051 {
2052 DUMPBITS(t->bits)
2053 Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
2054 "inflate: * literal '%c'\n" :
2055 "inflate: * literal 0x%02x\n", t->base));
2056 *q++ = (Byte)t->base;
2057 m--;
2058 break;
2059 }
2060 }
2061 else if (e & 32)
2062 {
2063 Tracevv((stderr, "inflate: * end of block\n"));
2064 UNGRAB
2065 UPDATE
2066 return Z_STREAM_END;
2067 }
2068 else
2069 {
2070 z->msg = "invalid literal/length code";
2071 UNGRAB
2072 UPDATE
2073 return Z_DATA_ERROR;
2074 }
2075 } while (1);
2076 } while (m >= 258 && n >= 10);
2077
2078 /* not enough input or output--restore pointers and return */
2079 UNGRAB
2080 UPDATE
2081 return Z_OK;
2082}
2083
2084
2085/*+++++*/
2086/* zutil.c -- target dependent utility functions for the compression library
2087 * Copyright (C) 1995 Jean-loup Gailly.
2088 * For conditions of distribution and use, see copyright notice in zlib.h
2089 */
2090
2091/* From: zutil.c,v 1.8 1995/05/03 17:27:12 jloup Exp */
2092
2093char *zlib_version = ZLIB_VERSION;
2094
2095char *z_errmsg[] = {
2096"stream end", /* Z_STREAM_END 1 */
2097"", /* Z_OK 0 */
2098"file error", /* Z_ERRNO (-1) */
2099"stream error", /* Z_STREAM_ERROR (-2) */
2100"data error", /* Z_DATA_ERROR (-3) */
2101"insufficient memory", /* Z_MEM_ERROR (-4) */
2102"buffer error", /* Z_BUF_ERROR (-5) */
2103""};
2104
2105
2106/*+++++*/
2107/* adler32.c -- compute the Adler-32 checksum of a data stream
2108 * Copyright (C) 1995 Mark Adler
2109 * For conditions of distribution and use, see copyright notice in zlib.h
2110 */
2111
2112/* From: adler32.c,v 1.6 1995/05/03 17:27:08 jloup Exp */
2113
2114#define BASE 65521L /* largest prime smaller than 65536 */
2115#define NMAX 5552
2116/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
2117
2118#define DO1(buf) {s1 += *buf++; s2 += s1;}
2119#define DO2(buf) DO1(buf); DO1(buf);
2120#define DO4(buf) DO2(buf); DO2(buf);
2121#define DO8(buf) DO4(buf); DO4(buf);
2122#define DO16(buf) DO8(buf); DO8(buf);
2123
2124/* ========================================================================= */
2125uLong adler32(adler, buf, len)
2126 uLong adler;
2127 Bytef *buf;
2128 uInt len;
2129{
2130 unsigned long s1 = adler & 0xffff;
2131 unsigned long s2 = (adler >> 16) & 0xffff;
2132 int k;
2133
2134 if (buf == Z_NULL) return 1L;
2135
2136 while (len > 0) {
2137 k = len < NMAX ? len : NMAX;
2138 len -= k;
2139 while (k >= 16) {
2140 DO16(buf);
2141 k -= 16;
2142 }
2143 if (k != 0) do {
2144 DO1(buf);
2145 } while (--k);
2146 s1 %= BASE;
2147 s2 %= BASE;
2148 }
2149 return (s2 << 16) | s1;
2150}
diff --git a/arch/xtensa/boot/lib/zmem.c b/arch/xtensa/boot/lib/zmem.c
index 7848f126d67d..d9862aa8ca25 100644
--- a/arch/xtensa/boot/lib/zmem.c
+++ b/arch/xtensa/boot/lib/zmem.c
@@ -1,4 +1,4 @@
1#include "zlib.h" 1#include <linux/zlib.h>
2 2
3/* bits taken from ppc */ 3/* bits taken from ppc */
4 4
@@ -9,11 +9,10 @@ void exit (void)
9 for (;;); 9 for (;;);
10} 10}
11 11
12void *zalloc(void *x, unsigned items, unsigned size) 12void *zalloc(unsigned size)
13{ 13{
14 void *p = avail_ram; 14 void *p = avail_ram;
15 15
16 size *= items;
17 size = (size + 7) & -8; 16 size = (size + 7) & -8;
18 avail_ram += size; 17 avail_ram += size;
19 if (avail_ram > end_avail) { 18 if (avail_ram > end_avail) {
@@ -24,11 +23,6 @@ void *zalloc(void *x, unsigned items, unsigned size)
24 return p; 23 return p;
25} 24}
26 25
27void zfree(void *x, void *addr, unsigned nb)
28{
29}
30
31
32#define HEAD_CRC 2 26#define HEAD_CRC 2
33#define EXTRA_FIELD 4 27#define EXTRA_FIELD 4
34#define ORIG_NAME 8 28#define ORIG_NAME 8
@@ -43,7 +37,6 @@ void gunzip (void *dst, int dstlen, unsigned char *src, int *lenp)
43 int r, i, flags; 37 int r, i, flags;
44 38
45 /* skip header */ 39 /* skip header */
46
47 i = 10; 40 i = 10;
48 flags = src[3]; 41 flags = src[3];
49 if (src[2] != DEFLATED || (flags & RESERVED) != 0) { 42 if (src[2] != DEFLATED || (flags & RESERVED) != 0) {
@@ -65,9 +58,8 @@ void gunzip (void *dst, int dstlen, unsigned char *src, int *lenp)
65 exit(); 58 exit();
66 } 59 }
67 60
68 s.zalloc = zalloc; 61 s.workspace = zalloc(zlib_inflate_workspacesize());
69 s.zfree = zfree; 62 r = zlib_inflateInit2(&s, -MAX_WBITS);
70 r = inflateInit2(&s, -MAX_WBITS);
71 if (r != Z_OK) { 63 if (r != Z_OK) {
72 //puts("inflateInit2 returned "); puthex(r); puts("\n"); 64 //puts("inflateInit2 returned "); puthex(r); puts("\n");
73 exit(); 65 exit();
@@ -76,12 +68,12 @@ void gunzip (void *dst, int dstlen, unsigned char *src, int *lenp)
76 s.avail_in = *lenp - i; 68 s.avail_in = *lenp - i;
77 s.next_out = dst; 69 s.next_out = dst;
78 s.avail_out = dstlen; 70 s.avail_out = dstlen;
79 r = inflate(&s, Z_FINISH); 71 r = zlib_inflate(&s, Z_FINISH);
80 if (r != Z_OK && r != Z_STREAM_END) { 72 if (r != Z_OK && r != Z_STREAM_END) {
81 //puts("inflate returned "); puthex(r); puts("\n"); 73 //puts("inflate returned "); puthex(r); puts("\n");
82 exit(); 74 exit();
83 } 75 }
84 *lenp = s.next_out - (unsigned char *) dst; 76 *lenp = s.next_out - (unsigned char *) dst;
85 inflateEnd(&s); 77 zlib_inflateEnd(&s);
86} 78}
87 79
diff --git a/arch/xtensa/kernel/pci.c b/arch/xtensa/kernel/pci.c
index d29a81648637..09887c96e9a1 100644
--- a/arch/xtensa/kernel/pci.c
+++ b/arch/xtensa/kernel/pci.c
@@ -57,50 +57,6 @@ struct pci_controller** pci_ctrl_tail = &pci_ctrl_head;
57 57
58static int pci_bus_count; 58static int pci_bus_count;
59 59
60static void pcibios_fixup_resources(struct pci_dev* dev);
61
62#if 0 // FIXME
63struct pci_fixup pcibios_fixups[] = {
64 { DECLARE_PCI_FIXUP_HEADER, PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources },
65 { 0 }
66};
67#endif
68
69void
70pcibios_update_resource(struct pci_dev *dev, struct resource *root,
71 struct resource *res, int resource)
72{
73 u32 new, check, mask;
74 int reg;
75 struct pci_controller* pci_ctrl = dev->sysdata;
76
77 new = res->start;
78 if (pci_ctrl && res->flags & IORESOURCE_IO) {
79 new -= pci_ctrl->io_space.base;
80 }
81 new |= (res->flags & PCI_REGION_FLAG_MASK);
82 if (resource < 6) {
83 reg = PCI_BASE_ADDRESS_0 + 4*resource;
84 } else if (resource == PCI_ROM_RESOURCE) {
85 res->flags |= PCI_ROM_ADDRESS_ENABLE;
86 reg = dev->rom_base_reg;
87 } else {
88 /* Somebody might have asked allocation of a non-standard resource */
89 return;
90 }
91
92 pci_write_config_dword(dev, reg, new);
93 pci_read_config_dword(dev, reg, &check);
94 mask = (new & PCI_BASE_ADDRESS_SPACE_IO) ?
95 PCI_BASE_ADDRESS_IO_MASK : PCI_BASE_ADDRESS_MEM_MASK;
96
97 if ((new ^ check) & mask) {
98 printk(KERN_ERR "PCI: Error while updating region "
99 "%s/%d (%08x != %08x)\n", dev->slot_name, resource,
100 new, check);
101 }
102}
103
104/* 60/*
105 * We need to avoid collisions with `mirrored' VGA ports 61 * We need to avoid collisions with `mirrored' VGA ports
106 * and other strange ISA hardware, so we always want the 62 * and other strange ISA hardware, so we always want the
@@ -125,7 +81,7 @@ pcibios_align_resource(void *data, struct resource *res, unsigned long size,
125 81
126 if (size > 0x100) { 82 if (size > 0x100) {
127 printk(KERN_ERR "PCI: I/O Region %s/%d too large" 83 printk(KERN_ERR "PCI: I/O Region %s/%d too large"
128 " (%ld bytes)\n", dev->slot_name, 84 " (%ld bytes)\n", pci_name(dev),
129 dev->resource - res, size); 85 dev->resource - res, size);
130 } 86 }
131 87
@@ -149,7 +105,7 @@ pcibios_enable_resources(struct pci_dev *dev, int mask)
149 r = &dev->resource[idx]; 105 r = &dev->resource[idx];
150 if (!r->start && r->end) { 106 if (!r->start && r->end) {
151 printk (KERN_ERR "PCI: Device %s not available because " 107 printk (KERN_ERR "PCI: Device %s not available because "
152 "of resource collisions\n", dev->slot_name); 108 "of resource collisions\n", pci_name(dev));
153 return -EINVAL; 109 return -EINVAL;
154 } 110 }
155 if (r->flags & IORESOURCE_IO) 111 if (r->flags & IORESOURCE_IO)
@@ -161,7 +117,7 @@ pcibios_enable_resources(struct pci_dev *dev, int mask)
161 cmd |= PCI_COMMAND_MEMORY; 117 cmd |= PCI_COMMAND_MEMORY;
162 if (cmd != old_cmd) { 118 if (cmd != old_cmd) {
163 printk("PCI: Enabling device %s (%04x -> %04x)\n", 119 printk("PCI: Enabling device %s (%04x -> %04x)\n",
164 dev->slot_name, old_cmd, cmd); 120 pci_name(dev), old_cmd, cmd);
165 pci_write_config_word(dev, PCI_COMMAND, cmd); 121 pci_write_config_word(dev, PCI_COMMAND, cmd);
166 } 122 }
167 return 0; 123 return 0;
@@ -293,7 +249,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
293 r = &dev->resource[idx]; 249 r = &dev->resource[idx];
294 if (!r->start && r->end) { 250 if (!r->start && r->end) {
295 printk(KERN_ERR "PCI: Device %s not available because " 251 printk(KERN_ERR "PCI: Device %s not available because "
296 "of resource collisions\n", dev->slot_name); 252 "of resource collisions\n", pci_name(dev));
297 return -EINVAL; 253 return -EINVAL;
298 } 254 }
299 if (r->flags & IORESOURCE_IO) 255 if (r->flags & IORESOURCE_IO)
@@ -303,7 +259,7 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
303 } 259 }
304 if (cmd != old_cmd) { 260 if (cmd != old_cmd) {
305 printk("PCI: Enabling device %s (%04x -> %04x)\n", 261 printk("PCI: Enabling device %s (%04x -> %04x)\n",
306 dev->slot_name, old_cmd, cmd); 262 pci_name(dev), old_cmd, cmd);
307 pci_write_config_word(dev, PCI_COMMAND, cmd); 263 pci_write_config_word(dev, PCI_COMMAND, cmd);
308 } 264 }
309 265
@@ -325,47 +281,6 @@ pci_controller_num(struct pci_dev *dev)
325 281
326#endif /* CONFIG_PROC_FS */ 282#endif /* CONFIG_PROC_FS */
327 283
328
329static void
330pcibios_fixup_resources(struct pci_dev *dev)
331{
332 struct pci_controller* pci_ctrl = (struct pci_controller *)dev->sysdata;
333 int i;
334 unsigned long offset;
335
336 if (!pci_ctrl) {
337 printk(KERN_ERR "No pci_ctrl for PCI dev %s!\n",dev->slot_name);
338 return;
339 }
340 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
341 struct resource *res = dev->resource + i;
342 if (!res->start || !res->flags)
343 continue;
344 if (res->end == 0xffffffff) {
345 DBG("PCI:%s Resource %d [%08lx-%08lx] is unassigned\n",
346 dev->slot_name, i, res->start, res->end);
347 res->end -= res->start;
348 res->start = 0;
349 continue;
350 }
351 offset = 0;
352 if (res->flags & IORESOURCE_IO)
353 offset = (unsigned long) pci_ctrl->io_space.base;
354 else if (res->flags & IORESOURCE_MEM)
355 offset = (unsigned long) pci_ctrl->mem_space.base;
356
357 if (offset != 0) {
358 res->start += offset;
359 res->end += offset;
360#ifdef DEBUG
361 printk("Fixup res %d (%lx) of dev %s: %lx -> %lx\n",
362 i, res->flags, dev->slot_name,
363 res->start - offset, res->start);
364#endif
365 }
366 }
367}
368
369/* 284/*
370 * Platform support for /proc/bus/pci/X/Y mmap()s, 285 * Platform support for /proc/bus/pci/X/Y mmap()s,
371 * modelled on the sparc64 implementation by Dave Miller. 286 * modelled on the sparc64 implementation by Dave Miller.
diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c
index 9ef07a4dd2a2..2659efdd4e99 100644
--- a/arch/xtensa/kernel/ptrace.c
+++ b/arch/xtensa/kernel/ptrace.c
@@ -22,6 +22,7 @@
22#include <linux/smp.h> 22#include <linux/smp.h>
23#include <linux/smp_lock.h> 23#include <linux/smp_lock.h>
24#include <linux/security.h> 24#include <linux/security.h>
25#include <linux/signal.h>
25 26
26#include <asm/pgtable.h> 27#include <asm/pgtable.h>
27#include <asm/page.h> 28#include <asm/page.h>
@@ -239,7 +240,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
239 case PTRACE_CONT: /* restart after signal. */ 240 case PTRACE_CONT: /* restart after signal. */
240 { 241 {
241 ret = -EIO; 242 ret = -EIO;
242 if ((unsigned long) data > _NSIG) 243 if (!valid_signal(data))
243 break; 244 break;
244 if (request == PTRACE_SYSCALL) 245 if (request == PTRACE_SYSCALL)
245 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 246 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
@@ -269,7 +270,7 @@ int sys_ptrace(long request, long pid, long addr, long data)
269 270
270 case PTRACE_SINGLESTEP: 271 case PTRACE_SINGLESTEP:
271 ret = -EIO; 272 ret = -EIO;
272 if ((unsigned long) data > _NSIG) 273 if (!valid_signal(data))
273 break; 274 break;
274 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 275 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
275 child->ptrace |= PT_SINGLESTEP; 276 child->ptrace |= PT_SINGLESTEP;
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 8dbf802ee7f8..d1f42b972821 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -433,7 +433,7 @@ acpi_pci_irq_enable (
433 printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: no GSI", 433 printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: no GSI",
434 pci_name(dev), ('A' + pin)); 434 pci_name(dev), ('A' + pin));
435 /* Interrupt Line values above 0xF are forbidden */ 435 /* Interrupt Line values above 0xF are forbidden */
436 if (dev->irq >= 0 && (dev->irq <= 0xF)) { 436 if (dev->irq > 0 && (dev->irq <= 0xF)) {
437 printk(" - using IRQ %d\n", dev->irq); 437 printk(" - using IRQ %d\n", dev->irq);
438 acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW); 438 acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW);
439 return_VALUE(0); 439 return_VALUE(0);
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 645f62692920..783752b68a9a 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -5,6 +5,7 @@ extern int bus_add_driver(struct device_driver *);
5extern void bus_remove_driver(struct device_driver *); 5extern void bus_remove_driver(struct device_driver *);
6 6
7extern void driver_detach(struct device_driver * drv); 7extern void driver_detach(struct device_driver * drv);
8extern int driver_probe_device(struct device_driver *, struct device *);
8 9
9static inline struct class_device *to_class_dev(struct kobject *obj) 10static inline struct class_device *to_class_dev(struct kobject *obj)
10{ 11{
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index c3fac7fd555e..96fe2f956754 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -133,6 +133,58 @@ static struct kobj_type ktype_bus = {
133decl_subsys(bus, &ktype_bus, NULL); 133decl_subsys(bus, &ktype_bus, NULL);
134 134
135 135
136/* Manually detach a device from it's associated driver. */
137static int driver_helper(struct device *dev, void *data)
138{
139 const char *name = data;
140
141 if (strcmp(name, dev->bus_id) == 0)
142 return 1;
143 return 0;
144}
145
146static ssize_t driver_unbind(struct device_driver *drv,
147 const char *buf, size_t count)
148{
149 struct bus_type *bus = get_bus(drv->bus);
150 struct device *dev;
151 int err = -ENODEV;
152
153 dev = bus_find_device(bus, NULL, (void *)buf, driver_helper);
154 if ((dev) &&
155 (dev->driver == drv)) {
156 device_release_driver(dev);
157 err = count;
158 }
159 return err;
160}
161static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind);
162
163/*
164 * Manually attach a device to a driver.
165 * Note: the driver must want to bind to the device,
166 * it is not possible to override the driver's id table.
167 */
168static ssize_t driver_bind(struct device_driver *drv,
169 const char *buf, size_t count)
170{
171 struct bus_type *bus = get_bus(drv->bus);
172 struct device *dev;
173 int err = -ENODEV;
174
175 dev = bus_find_device(bus, NULL, (void *)buf, driver_helper);
176 if ((dev) &&
177 (dev->driver == NULL)) {
178 down(&dev->sem);
179 err = driver_probe_device(drv, dev);
180 up(&dev->sem);
181 put_device(dev);
182 }
183 return err;
184}
185static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind);
186
187
136static struct device * next_device(struct klist_iter * i) 188static struct device * next_device(struct klist_iter * i)
137{ 189{
138 struct klist_node * n = klist_next(i); 190 struct klist_node * n = klist_next(i);
@@ -177,6 +229,39 @@ int bus_for_each_dev(struct bus_type * bus, struct device * start,
177 return error; 229 return error;
178} 230}
179 231
232/**
233 * bus_find_device - device iterator for locating a particular device.
234 * @bus: bus type
235 * @start: Device to begin with
236 * @data: Data to pass to match function
237 * @match: Callback function to check device
238 *
239 * This is similar to the bus_for_each_dev() function above, but it
240 * returns a reference to a device that is 'found' for later use, as
241 * determined by the @match callback.
242 *
243 * The callback should return 0 if the device doesn't match and non-zero
244 * if it does. If the callback returns non-zero, this function will
245 * return to the caller and not iterate over any more devices.
246 */
247struct device * bus_find_device(struct bus_type *bus,
248 struct device *start, void *data,
249 int (*match)(struct device *, void *))
250{
251 struct klist_iter i;
252 struct device *dev;
253
254 if (!bus)
255 return NULL;
256
257 klist_iter_init_node(&bus->klist_devices, &i,
258 (start ? &start->knode_bus : NULL));
259 while ((dev = next_device(&i)))
260 if (match(dev, data) && get_device(dev))
261 break;
262 klist_iter_exit(&i);
263 return dev;
264}
180 265
181 266
182static struct device_driver * next_driver(struct klist_iter * i) 267static struct device_driver * next_driver(struct klist_iter * i)
@@ -363,6 +448,8 @@ int bus_add_driver(struct device_driver * drv)
363 module_add_driver(drv->owner, drv); 448 module_add_driver(drv->owner, drv);
364 449
365 driver_add_attrs(bus, drv); 450 driver_add_attrs(bus, drv);
451 driver_create_file(drv, &driver_attr_unbind);
452 driver_create_file(drv, &driver_attr_bind);
366 } 453 }
367 return error; 454 return error;
368} 455}
@@ -380,6 +467,8 @@ int bus_add_driver(struct device_driver * drv)
380void bus_remove_driver(struct device_driver * drv) 467void bus_remove_driver(struct device_driver * drv)
381{ 468{
382 if (drv->bus) { 469 if (drv->bus) {
470 driver_remove_file(drv, &driver_attr_bind);
471 driver_remove_file(drv, &driver_attr_unbind);
383 driver_remove_attrs(drv->bus, drv); 472 driver_remove_attrs(drv->bus, drv);
384 klist_remove(&drv->knode_bus); 473 klist_remove(&drv->knode_bus);
385 pr_debug("bus %s: remove driver %s\n", drv->bus->name, drv->name); 474 pr_debug("bus %s: remove driver %s\n", drv->bus->name, drv->name);
@@ -394,31 +483,22 @@ void bus_remove_driver(struct device_driver * drv)
394/* Helper for bus_rescan_devices's iter */ 483/* Helper for bus_rescan_devices's iter */
395static int bus_rescan_devices_helper(struct device *dev, void *data) 484static int bus_rescan_devices_helper(struct device *dev, void *data)
396{ 485{
397 int *count = data; 486 if (!dev->driver)
398 487 device_attach(dev);
399 if (!dev->driver && (device_attach(dev) > 0))
400 (*count)++;
401
402 return 0; 488 return 0;
403} 489}
404 490
405
406/** 491/**
407 * bus_rescan_devices - rescan devices on the bus for possible drivers 492 * bus_rescan_devices - rescan devices on the bus for possible drivers
408 * @bus: the bus to scan. 493 * @bus: the bus to scan.
409 * 494 *
410 * This function will look for devices on the bus with no driver 495 * This function will look for devices on the bus with no driver
411 * attached and rescan it against existing drivers to see if it 496 * attached and rescan it against existing drivers to see if it matches
412 * matches any. Calls device_attach(). Returns the number of devices 497 * any by calling device_attach() for the unbound devices.
413 * that were sucessfully bound to a driver.
414 */ 498 */
415int bus_rescan_devices(struct bus_type * bus) 499void bus_rescan_devices(struct bus_type * bus)
416{ 500{
417 int count = 0; 501 bus_for_each_dev(bus, NULL, NULL, bus_rescan_devices_helper);
418
419 bus_for_each_dev(bus, NULL, &count, bus_rescan_devices_helper);
420
421 return count;
422} 502}
423 503
424 504
@@ -557,6 +637,7 @@ int __init buses_init(void)
557 637
558 638
559EXPORT_SYMBOL_GPL(bus_for_each_dev); 639EXPORT_SYMBOL_GPL(bus_for_each_dev);
640EXPORT_SYMBOL_GPL(bus_find_device);
560EXPORT_SYMBOL_GPL(bus_for_each_drv); 641EXPORT_SYMBOL_GPL(bus_for_each_drv);
561 642
562EXPORT_SYMBOL_GPL(bus_add_device); 643EXPORT_SYMBOL_GPL(bus_add_device);
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 86d79755fbfb..efe03a024a5b 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -333,7 +333,7 @@ void device_del(struct device * dev)
333 struct device * parent = dev->parent; 333 struct device * parent = dev->parent;
334 334
335 if (parent) 335 if (parent)
336 klist_remove(&dev->knode_parent); 336 klist_del(&dev->knode_parent);
337 337
338 /* Notify the platform of the removal, in case they 338 /* Notify the platform of the removal, in case they
339 * need to do anything... 339 * need to do anything...
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 6db3a789c54f..16323f9cbff0 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -65,7 +65,7 @@ void device_bind_driver(struct device * dev)
65 * 65 *
66 * This function must be called with @dev->sem held. 66 * This function must be called with @dev->sem held.
67 */ 67 */
68static int driver_probe_device(struct device_driver * drv, struct device * dev) 68int driver_probe_device(struct device_driver * drv, struct device * dev)
69{ 69{
70 int ret = 0; 70 int ret = 0;
71 71
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 1b645886e9eb..291c5954a3af 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -56,6 +56,41 @@ EXPORT_SYMBOL_GPL(driver_for_each_device);
56 56
57 57
58/** 58/**
59 * driver_find_device - device iterator for locating a particular device.
60 * @driver: The device's driver
61 * @start: Device to begin with
62 * @data: Data to pass to match function
63 * @match: Callback function to check device
64 *
65 * This is similar to the driver_for_each_device() function above, but
66 * it returns a reference to a device that is 'found' for later use, as
67 * determined by the @match callback.
68 *
69 * The callback should return 0 if the device doesn't match and non-zero
70 * if it does. If the callback returns non-zero, this function will
71 * return to the caller and not iterate over any more devices.
72 */
73struct device * driver_find_device(struct device_driver *drv,
74 struct device * start, void * data,
75 int (*match)(struct device *, void *))
76{
77 struct klist_iter i;
78 struct device *dev;
79
80 if (!drv)
81 return NULL;
82
83 klist_iter_init_node(&drv->klist_devices, &i,
84 (start ? &start->knode_driver : NULL));
85 while ((dev = next_device(&i)))
86 if (match(dev, data) && get_device(dev))
87 break;
88 klist_iter_exit(&i);
89 return dev;
90}
91EXPORT_SYMBOL_GPL(driver_find_device);
92
93/**
59 * driver_create_file - create sysfs file for driver. 94 * driver_create_file - create sysfs file for driver.
60 * @drv: driver. 95 * @drv: driver.
61 * @attr: driver attribute descriptor. 96 * @attr: driver attribute descriptor.
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 854475c54f0e..049d128ae7f0 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -464,7 +464,7 @@ void __devexit tpm_remove(struct pci_dev *pci_dev)
464 464
465 pci_set_drvdata(pci_dev, NULL); 465 pci_set_drvdata(pci_dev, NULL);
466 misc_deregister(&chip->vendor->miscdev); 466 misc_deregister(&chip->vendor->miscdev);
467 kfree(&chip->vendor->miscdev.name); 467 kfree(chip->vendor->miscdev.name);
468 468
469 sysfs_remove_group(&pci_dev->dev.kobj, chip->vendor->attr_group); 469 sysfs_remove_group(&pci_dev->dev.kobj, chip->vendor->attr_group);
470 470
diff --git a/drivers/ide/Makefile b/drivers/ide/Makefile
index 5be8ad6dc9ed..cca9c075966d 100644
--- a/drivers/ide/Makefile
+++ b/drivers/ide/Makefile
@@ -20,7 +20,6 @@ ide-core-$(CONFIG_BLK_DEV_CMD640) += pci/cmd640.o
20# Core IDE code - must come before legacy 20# Core IDE code - must come before legacy
21ide-core-$(CONFIG_BLK_DEV_IDEPCI) += setup-pci.o 21ide-core-$(CONFIG_BLK_DEV_IDEPCI) += setup-pci.o
22ide-core-$(CONFIG_BLK_DEV_IDEDMA) += ide-dma.o 22ide-core-$(CONFIG_BLK_DEV_IDEDMA) += ide-dma.o
23ide-core-$(CONFIG_BLK_DEV_IDE_TCQ) += ide-tcq.o
24ide-core-$(CONFIG_PROC_FS) += ide-proc.o 23ide-core-$(CONFIG_PROC_FS) += ide-proc.o
25ide-core-$(CONFIG_BLK_DEV_IDEPNP) += ide-pnp.o 24ide-core-$(CONFIG_BLK_DEV_IDEPNP) += ide-pnp.o
26 25
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index 6806d407e9c1..b09a6537c7a8 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -487,8 +487,7 @@ static u8 ide_dump_ata_status(ide_drive_t *drive, const char *msg, u8 stat)
487 u8 err = 0; 487 u8 err = 0;
488 488
489 local_irq_set(flags); 489 local_irq_set(flags);
490 printk("%s: %s: status=0x%02x", drive->name, msg, stat); 490 printk("%s: %s: status=0x%02x { ", drive->name, msg, stat);
491 printk(" { ");
492 if (stat & BUSY_STAT) 491 if (stat & BUSY_STAT)
493 printk("Busy "); 492 printk("Busy ");
494 else { 493 else {
@@ -500,15 +499,13 @@ static u8 ide_dump_ata_status(ide_drive_t *drive, const char *msg, u8 stat)
500 if (stat & INDEX_STAT) printk("Index "); 499 if (stat & INDEX_STAT) printk("Index ");
501 if (stat & ERR_STAT) printk("Error "); 500 if (stat & ERR_STAT) printk("Error ");
502 } 501 }
503 printk("}"); 502 printk("}\n");
504 printk("\n");
505 if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) { 503 if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) {
506 err = hwif->INB(IDE_ERROR_REG); 504 err = hwif->INB(IDE_ERROR_REG);
507 printk("%s: %s: error=0x%02x", drive->name, msg, err); 505 printk("%s: %s: error=0x%02x { ", drive->name, msg, err);
508 printk(" { ");
509 if (err & ABRT_ERR) printk("DriveStatusError "); 506 if (err & ABRT_ERR) printk("DriveStatusError ");
510 if (err & ICRC_ERR) 507 if (err & ICRC_ERR)
511 printk("Bad%s ", (err & ABRT_ERR) ? "CRC" : "Sector"); 508 printk((err & ABRT_ERR) ? "BadCRC " : "BadSector ");
512 if (err & ECC_ERR) printk("UncorrectableError "); 509 if (err & ECC_ERR) printk("UncorrectableError ");
513 if (err & ID_ERR) printk("SectorIdNotFound "); 510 if (err & ID_ERR) printk("SectorIdNotFound ");
514 if (err & TRK0_ERR) printk("TrackZeroNotFound "); 511 if (err & TRK0_ERR) printk("TrackZeroNotFound ");
@@ -546,8 +543,8 @@ static u8 ide_dump_ata_status(ide_drive_t *drive, const char *msg, u8 stat)
546 printk(", sector=%llu", 543 printk(", sector=%llu",
547 (unsigned long long)HWGROUP(drive)->rq->sector); 544 (unsigned long long)HWGROUP(drive)->rq->sector);
548 } 545 }
546 printk("\n");
549 } 547 }
550 printk("\n");
551 ide_dump_opcode(drive); 548 ide_dump_opcode(drive);
552 local_irq_restore(flags); 549 local_irq_restore(flags);
553 return err; 550 return err;
diff --git a/drivers/ide/legacy/hd.c b/drivers/ide/legacy/hd.c
index e884cd4b22fd..242029c9c0ca 100644
--- a/drivers/ide/legacy/hd.c
+++ b/drivers/ide/legacy/hd.c
@@ -156,11 +156,13 @@ else \
156 156
157 157
158#if (HD_DELAY > 0) 158#if (HD_DELAY > 0)
159
160#include <asm/i8253.h>
161
159unsigned long last_req; 162unsigned long last_req;
160 163
161unsigned long read_timer(void) 164unsigned long read_timer(void)
162{ 165{
163 extern spinlock_t i8253_lock;
164 unsigned long t, flags; 166 unsigned long t, flags;
165 int i; 167 int i;
166 168
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index 67efb38a9f6c..6cf49394a80f 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -583,7 +583,7 @@ static int ali15x3_dma_setup(ide_drive_t *drive)
583 * appropriate also sets up the 1533 southbridge. 583 * appropriate also sets up the 1533 southbridge.
584 */ 584 */
585 585
586static unsigned int __init init_chipset_ali15x3 (struct pci_dev *dev, const char *name) 586static unsigned int __devinit init_chipset_ali15x3 (struct pci_dev *dev, const char *name)
587{ 587{
588 unsigned long flags; 588 unsigned long flags;
589 u8 tmpbyte; 589 u8 tmpbyte;
@@ -677,7 +677,7 @@ static unsigned int __init init_chipset_ali15x3 (struct pci_dev *dev, const char
677 * FIXME: frobs bits that are not defined on newer ALi devicea 677 * FIXME: frobs bits that are not defined on newer ALi devicea
678 */ 678 */
679 679
680static unsigned int __init ata66_ali15x3 (ide_hwif_t *hwif) 680static unsigned int __devinit ata66_ali15x3 (ide_hwif_t *hwif)
681{ 681{
682 struct pci_dev *dev = hwif->pci_dev; 682 struct pci_dev *dev = hwif->pci_dev;
683 unsigned int ata66 = 0; 683 unsigned int ata66 = 0;
@@ -748,7 +748,7 @@ static unsigned int __init ata66_ali15x3 (ide_hwif_t *hwif)
748 * Initialize the IDE structure side of the ALi 15x3 driver. 748 * Initialize the IDE structure side of the ALi 15x3 driver.
749 */ 749 */
750 750
751static void __init init_hwif_common_ali15x3 (ide_hwif_t *hwif) 751static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif)
752{ 752{
753 hwif->autodma = 0; 753 hwif->autodma = 0;
754 hwif->tuneproc = &ali15x3_tune_drive; 754 hwif->tuneproc = &ali15x3_tune_drive;
@@ -794,7 +794,7 @@ static void __init init_hwif_common_ali15x3 (ide_hwif_t *hwif)
794 * Sparc systems 794 * Sparc systems
795 */ 795 */
796 796
797static void __init init_hwif_ali15x3 (ide_hwif_t *hwif) 797static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif)
798{ 798{
799 u8 ideic, inmir; 799 u8 ideic, inmir;
800 s8 irq_routing_table[] = { -1, 9, 3, 10, 4, 5, 7, 6, 800 s8 irq_routing_table[] = { -1, 9, 3, 10, 4, 5, 7, 6,
@@ -847,7 +847,7 @@ static void __init init_hwif_ali15x3 (ide_hwif_t *hwif)
847 * the actual work. 847 * the actual work.
848 */ 848 */
849 849
850static void __init init_dma_ali15x3 (ide_hwif_t *hwif, unsigned long dmabase) 850static void __devinit init_dma_ali15x3 (ide_hwif_t *hwif, unsigned long dmabase)
851{ 851{
852 if (m5229_revision < 0x20) 852 if (m5229_revision < 0x20)
853 return; 853 return;
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
index 4e0f13d1d060..844a6c9fb949 100644
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -73,6 +73,7 @@ static struct amd_ide_chip {
73 { PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, 0x50, AMD_UDMA_133 }, 73 { PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, 0x50, AMD_UDMA_133 },
74 { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, 0x50, AMD_UDMA_133 }, 74 { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, 0x50, AMD_UDMA_133 },
75 { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, 0x50, AMD_UDMA_133 }, 75 { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, 0x50, AMD_UDMA_133 },
76 { PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE, 0x50, AMD_UDMA_133 },
76 { 0 } 77 { 0 }
77}; 78};
78 79
@@ -309,7 +310,7 @@ static int amd74xx_ide_dma_check(ide_drive_t *drive)
309 * and initialize its drive independent registers. 310 * and initialize its drive independent registers.
310 */ 311 */
311 312
312static unsigned int __init init_chipset_amd74xx(struct pci_dev *dev, const char *name) 313static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const char *name)
313{ 314{
314 unsigned char t; 315 unsigned char t;
315 unsigned int u; 316 unsigned int u;
@@ -413,7 +414,7 @@ static unsigned int __init init_chipset_amd74xx(struct pci_dev *dev, const char
413 return dev->irq; 414 return dev->irq;
414} 415}
415 416
416static void __init init_hwif_amd74xx(ide_hwif_t *hwif) 417static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
417{ 418{
418 int i; 419 int i;
419 420
@@ -489,6 +490,7 @@ static ide_pci_device_t amd74xx_chipsets[] __devinitdata = {
489 /* 13 */ DECLARE_NV_DEV("NFORCE-CK804"), 490 /* 13 */ DECLARE_NV_DEV("NFORCE-CK804"),
490 /* 14 */ DECLARE_NV_DEV("NFORCE-MCP04"), 491 /* 14 */ DECLARE_NV_DEV("NFORCE-MCP04"),
491 /* 15 */ DECLARE_NV_DEV("NFORCE-MCP51"), 492 /* 15 */ DECLARE_NV_DEV("NFORCE-MCP51"),
493 /* 16 */ DECLARE_NV_DEV("NFORCE-MCP55"),
492}; 494};
493 495
494static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id) 496static int __devinit amd74xx_probe(struct pci_dev *dev, const struct pci_device_id *id)
@@ -524,6 +526,7 @@ static struct pci_device_id amd74xx_pci_tbl[] = {
524 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13 }, 526 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 13 },
525 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14 }, 527 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 14 },
526 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15 }, 528 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 15 },
529 { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 16 },
527 { 0, }, 530 { 0, },
528}; 531};
529MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl); 532MODULE_DEVICE_TABLE(pci, amd74xx_pci_tbl);
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c
index 0381961db263..09269e574b3e 100644
--- a/drivers/ide/pci/cs5530.c
+++ b/drivers/ide/pci/cs5530.c
@@ -217,7 +217,7 @@ static int cs5530_config_dma (ide_drive_t *drive)
217 * Initialize the cs5530 bridge for reliable IDE DMA operation. 217 * Initialize the cs5530 bridge for reliable IDE DMA operation.
218 */ 218 */
219 219
220static unsigned int __init init_chipset_cs5530 (struct pci_dev *dev, const char *name) 220static unsigned int __devinit init_chipset_cs5530 (struct pci_dev *dev, const char *name)
221{ 221{
222 struct pci_dev *master_0 = NULL, *cs5530_0 = NULL; 222 struct pci_dev *master_0 = NULL, *cs5530_0 = NULL;
223 unsigned long flags; 223 unsigned long flags;
@@ -308,7 +308,7 @@ static unsigned int __init init_chipset_cs5530 (struct pci_dev *dev, const char
308 * performs channel-specific pre-initialization before drive probing. 308 * performs channel-specific pre-initialization before drive probing.
309 */ 309 */
310 310
311static void __init init_hwif_cs5530 (ide_hwif_t *hwif) 311static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif)
312{ 312{
313 unsigned long basereg; 313 unsigned long basereg;
314 u32 d0_timings; 314 u32 d0_timings;
diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c
index 80d67e99ccb5..5a33513f3dd1 100644
--- a/drivers/ide/pci/cy82c693.c
+++ b/drivers/ide/pci/cy82c693.c
@@ -391,7 +391,7 @@ static void cy82c693_tune_drive (ide_drive_t *drive, u8 pio)
391/* 391/*
392 * this function is called during init and is used to setup the cy82c693 chip 392 * this function is called during init and is used to setup the cy82c693 chip
393 */ 393 */
394static unsigned int __init init_chipset_cy82c693(struct pci_dev *dev, const char *name) 394static unsigned int __devinit init_chipset_cy82c693(struct pci_dev *dev, const char *name)
395{ 395{
396 if (PCI_FUNC(dev->devfn) != 1) 396 if (PCI_FUNC(dev->devfn) != 1)
397 return 0; 397 return 0;
@@ -443,7 +443,7 @@ static unsigned int __init init_chipset_cy82c693(struct pci_dev *dev, const char
443/* 443/*
444 * the init function - called for each ide channel once 444 * the init function - called for each ide channel once
445 */ 445 */
446static void __init init_hwif_cy82c693(ide_hwif_t *hwif) 446static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif)
447{ 447{
448 hwif->autodma = 0; 448 hwif->autodma = 0;
449 449
@@ -467,9 +467,9 @@ static void __init init_hwif_cy82c693(ide_hwif_t *hwif)
467 hwif->drives[1].autodma = hwif->autodma; 467 hwif->drives[1].autodma = hwif->autodma;
468} 468}
469 469
470static __initdata ide_hwif_t *primary; 470static __devinitdata ide_hwif_t *primary;
471 471
472void __init init_iops_cy82c693(ide_hwif_t *hwif) 472void __devinit init_iops_cy82c693(ide_hwif_t *hwif)
473{ 473{
474 if (PCI_FUNC(hwif->pci_dev->devfn) == 1) 474 if (PCI_FUNC(hwif->pci_dev->devfn) == 1)
475 primary = hwif; 475 primary = hwif;
diff --git a/drivers/ide/pci/it8172.c b/drivers/ide/pci/it8172.c
index 631927cf17d4..93462926b9d5 100644
--- a/drivers/ide/pci/it8172.c
+++ b/drivers/ide/pci/it8172.c
@@ -216,7 +216,7 @@ fast_ata_pio:
216 return 0; 216 return 0;
217} 217}
218 218
219static unsigned int __init init_chipset_it8172 (struct pci_dev *dev, const char *name) 219static unsigned int __devinit init_chipset_it8172 (struct pci_dev *dev, const char *name)
220{ 220{
221 unsigned char progif; 221 unsigned char progif;
222 222
@@ -230,7 +230,7 @@ static unsigned int __init init_chipset_it8172 (struct pci_dev *dev, const char
230} 230}
231 231
232 232
233static void __init init_hwif_it8172 (ide_hwif_t *hwif) 233static void __devinit init_hwif_it8172 (ide_hwif_t *hwif)
234{ 234{
235 struct pci_dev* dev = hwif->pci_dev; 235 struct pci_dev* dev = hwif->pci_dev;
236 unsigned long cmdBase, ctrlBase; 236 unsigned long cmdBase, ctrlBase;
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c
index 205a32fbc2f0..fcd5142f5cfe 100644
--- a/drivers/ide/pci/ns87415.c
+++ b/drivers/ide/pci/ns87415.c
@@ -195,7 +195,7 @@ static int ns87415_ide_dma_check (ide_drive_t *drive)
195 return __ide_dma_check(drive); 195 return __ide_dma_check(drive);
196} 196}
197 197
198static void __init init_hwif_ns87415 (ide_hwif_t *hwif) 198static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
199{ 199{
200 struct pci_dev *dev = hwif->pci_dev; 200 struct pci_dev *dev = hwif->pci_dev;
201 unsigned int ctrl, using_inta; 201 unsigned int ctrl, using_inta;
diff --git a/drivers/ide/pci/opti621.c b/drivers/ide/pci/opti621.c
index cf4fd91d396a..7a7c2ef78ac2 100644
--- a/drivers/ide/pci/opti621.c
+++ b/drivers/ide/pci/opti621.c
@@ -326,7 +326,7 @@ static void opti621_tune_drive (ide_drive_t *drive, u8 pio)
326/* 326/*
327 * init_hwif_opti621() is called once for each hwif found at boot. 327 * init_hwif_opti621() is called once for each hwif found at boot.
328 */ 328 */
329static void __init init_hwif_opti621 (ide_hwif_t *hwif) 329static void __devinit init_hwif_opti621 (ide_hwif_t *hwif)
330{ 330{
331 hwif->autodma = 0; 331 hwif->autodma = 0;
332 hwif->drives[0].drive_data = PIO_DONT_KNOW; 332 hwif->drives[0].drive_data = PIO_DONT_KNOW;
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index 3bc3bf1be49b..10592cec6c43 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -459,7 +459,7 @@ printk("%s: SC1200: resume\n", hwif->name);
459 * This gets invoked by the IDE driver once for each channel, 459 * This gets invoked by the IDE driver once for each channel,
460 * and performs channel-specific pre-initialization before drive probing. 460 * and performs channel-specific pre-initialization before drive probing.
461 */ 461 */
462static void __init init_hwif_sc1200 (ide_hwif_t *hwif) 462static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif)
463{ 463{
464 if (hwif->mate) 464 if (hwif->mate)
465 hwif->serialized = hwif->mate->serialized = 1; 465 hwif->serialized = hwif->mate->serialized = 1;
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index 1d970a0de21a..ea0806c82be0 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -386,7 +386,7 @@ static unsigned int sl82c105_bridge_revision(struct pci_dev *dev)
386 * channel 0 here at least, but channel 1 has to be enabled by 386 * channel 0 here at least, but channel 1 has to be enabled by
387 * firmware or arch code. We still set both to 16 bits mode. 387 * firmware or arch code. We still set both to 16 bits mode.
388 */ 388 */
389static unsigned int __init init_chipset_sl82c105(struct pci_dev *dev, const char *msg) 389static unsigned int __devinit init_chipset_sl82c105(struct pci_dev *dev, const char *msg)
390{ 390{
391 u32 val; 391 u32 val;
392 392
@@ -399,7 +399,7 @@ static unsigned int __init init_chipset_sl82c105(struct pci_dev *dev, const char
399 return dev->irq; 399 return dev->irq;
400} 400}
401 401
402static void __init init_dma_sl82c105(ide_hwif_t *hwif, unsigned long dma_base) 402static void __devinit init_dma_sl82c105(ide_hwif_t *hwif, unsigned long dma_base)
403{ 403{
404 unsigned int rev; 404 unsigned int rev;
405 u8 dma_state; 405 u8 dma_state;
@@ -431,7 +431,7 @@ static void __init init_dma_sl82c105(ide_hwif_t *hwif, unsigned long dma_base)
431 * Initialise the chip 431 * Initialise the chip
432 */ 432 */
433 433
434static void __init init_hwif_sl82c105(ide_hwif_t *hwif) 434static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
435{ 435{
436 struct pci_dev *dev = hwif->pci_dev; 436 struct pci_dev *dev = hwif->pci_dev;
437 u32 val; 437 u32 val;
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c
index 7fbf36342f73..5112c726633b 100644
--- a/drivers/ide/pci/slc90e66.c
+++ b/drivers/ide/pci/slc90e66.c
@@ -196,7 +196,7 @@ fast_ata_pio:
196} 196}
197#endif /* CONFIG_BLK_DEV_IDEDMA */ 197#endif /* CONFIG_BLK_DEV_IDEDMA */
198 198
199static void __init init_hwif_slc90e66 (ide_hwif_t *hwif) 199static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)
200{ 200{
201 u8 reg47 = 0; 201 u8 reg47 = 0;
202 u8 mask = hwif->channel ? 0x01 : 0x02; /* bit0:Primary */ 202 u8 mask = hwif->channel ? 0x01 : 0x02; /* bit0:Primary */
diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c
index a1df2bfe3631..f96b56838f33 100644
--- a/drivers/ide/pci/triflex.c
+++ b/drivers/ide/pci/triflex.c
@@ -130,7 +130,7 @@ static int triflex_config_drive_xfer_rate(ide_drive_t *drive)
130 return hwif->ide_dma_off_quietly(drive); 130 return hwif->ide_dma_off_quietly(drive);
131} 131}
132 132
133static void __init init_hwif_triflex(ide_hwif_t *hwif) 133static void __devinit init_hwif_triflex(ide_hwif_t *hwif)
134{ 134{
135 hwif->tuneproc = &triflex_tune_drive; 135 hwif->tuneproc = &triflex_tune_drive;
136 hwif->speedproc = &triflex_tune_chipset; 136 hwif->speedproc = &triflex_tune_chipset;
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index 069dbffe2116..a4d099c937ff 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -415,7 +415,7 @@ static int via82cxxx_ide_dma_check (ide_drive_t *drive)
415 * and initialize its drive independent registers. 415 * and initialize its drive independent registers.
416 */ 416 */
417 417
418static unsigned int __init init_chipset_via82cxxx(struct pci_dev *dev, const char *name) 418static unsigned int __devinit init_chipset_via82cxxx(struct pci_dev *dev, const char *name)
419{ 419{
420 struct pci_dev *isa = NULL; 420 struct pci_dev *isa = NULL;
421 u8 t, v; 421 u8 t, v;
@@ -576,7 +576,7 @@ static unsigned int __init init_chipset_via82cxxx(struct pci_dev *dev, const cha
576 return 0; 576 return 0;
577} 577}
578 578
579static void __init init_hwif_via82cxxx(ide_hwif_t *hwif) 579static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
580{ 580{
581 int i; 581 int i;
582 582
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index 3e72c9b1461e..ab09cf4093e3 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -60,12 +60,13 @@ static void gameport_disconnect_port(struct gameport *gameport);
60 60
61#if defined(__i386__) 61#if defined(__i386__)
62 62
63#include <asm/i8253.h>
64
63#define DELTA(x,y) ((y)-(x)+((y)<(x)?1193182/HZ:0)) 65#define DELTA(x,y) ((y)-(x)+((y)<(x)?1193182/HZ:0))
64#define GET_TIME(x) do { x = get_time_pit(); } while (0) 66#define GET_TIME(x) do { x = get_time_pit(); } while (0)
65 67
66static unsigned int get_time_pit(void) 68static unsigned int get_time_pit(void)
67{ 69{
68 extern spinlock_t i8253_lock;
69 unsigned long flags; 70 unsigned long flags;
70 unsigned int count; 71 unsigned int count;
71 72
diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
index 504b7d550567..c3a5739030c3 100644
--- a/drivers/input/joystick/analog.c
+++ b/drivers/input/joystick/analog.c
@@ -140,12 +140,14 @@ struct analog_port {
140 */ 140 */
141 141
142#ifdef __i386__ 142#ifdef __i386__
143
144#include <asm/i8253.h>
145
143#define GET_TIME(x) do { if (cpu_has_tsc) rdtscl(x); else x = get_time_pit(); } while (0) 146#define GET_TIME(x) do { if (cpu_has_tsc) rdtscl(x); else x = get_time_pit(); } while (0)
144#define DELTA(x,y) (cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? CLOCK_TICK_RATE / HZ : 0))) 147#define DELTA(x,y) (cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? CLOCK_TICK_RATE / HZ : 0)))
145#define TIME_NAME (cpu_has_tsc?"TSC":"PIT") 148#define TIME_NAME (cpu_has_tsc?"TSC":"PIT")
146static unsigned int get_time_pit(void) 149static unsigned int get_time_pit(void)
147{ 150{
148 extern spinlock_t i8253_lock;
149 unsigned long flags; 151 unsigned long flags;
150 unsigned int count; 152 unsigned int count;
151 153
diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c
index 3a5f6ac5b364..7a42966d755b 100644
--- a/drivers/mmc/mmci.c
+++ b/drivers/mmc/mmci.c
@@ -20,6 +20,7 @@
20#include <linux/mmc/host.h> 20#include <linux/mmc/host.h>
21#include <linux/mmc/protocol.h> 21#include <linux/mmc/protocol.h>
22 22
23#include <asm/div64.h>
23#include <asm/io.h> 24#include <asm/io.h>
24#include <asm/irq.h> 25#include <asm/irq.h>
25#include <asm/scatterlist.h> 26#include <asm/scatterlist.h>
@@ -70,6 +71,7 @@ static void mmci_stop_data(struct mmci_host *host)
70static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) 71static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
71{ 72{
72 unsigned int datactrl, timeout, irqmask; 73 unsigned int datactrl, timeout, irqmask;
74 unsigned long long clks;
73 void __iomem *base; 75 void __iomem *base;
74 76
75 DBG(host, "blksz %04x blks %04x flags %08x\n", 77 DBG(host, "blksz %04x blks %04x flags %08x\n",
@@ -81,9 +83,10 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
81 83
82 mmci_init_sg(host, data); 84 mmci_init_sg(host, data);
83 85
84 timeout = data->timeout_clks + 86 clks = (unsigned long long)data->timeout_ns * host->cclk;
85 ((unsigned long long)data->timeout_ns * host->cclk) / 87 do_div(clks, 1000000000UL);
86 1000000000ULL; 88
89 timeout = data->timeout_clks + (unsigned int)clks;
87 90
88 base = host->base; 91 base = host->base;
89 writel(timeout, base + MMCIDATATIMER); 92 writel(timeout, base + MMCIDATATIMER);
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c
index b7fbd30b49a0..0c41d4b41a65 100644
--- a/drivers/mmc/wbsd.c
+++ b/drivers/mmc/wbsd.c
@@ -54,28 +54,6 @@
54#define DBGF(x...) do { } while (0) 54#define DBGF(x...) do { } while (0)
55#endif 55#endif
56 56
57#ifdef CONFIG_MMC_DEBUG
58void DBG_REG(int reg, u8 value)
59{
60 int i;
61
62 printk(KERN_DEBUG "wbsd: Register %d: 0x%02X %3d '%c' ",
63 reg, (int)value, (int)value, (value < 0x20)?'.':value);
64
65 for (i = 7;i >= 0;i--)
66 {
67 if (value & (1 << i))
68 printk("x");
69 else
70 printk(".");
71 }
72
73 printk("\n");
74}
75#else
76#define DBG_REG(r, v) do {} while (0)
77#endif
78
79/* 57/*
80 * Device resources 58 * Device resources
81 */ 59 */
@@ -92,6 +70,13 @@ MODULE_DEVICE_TABLE(pnp, pnp_dev_table);
92 70
93#endif /* CONFIG_PNP */ 71#endif /* CONFIG_PNP */
94 72
73static const int config_ports[] = { 0x2E, 0x4E };
74static const int unlock_codes[] = { 0x83, 0x87 };
75
76static const int valid_ids[] = {
77 0x7112,
78 };
79
95#ifdef CONFIG_PNP 80#ifdef CONFIG_PNP
96static unsigned int nopnp = 0; 81static unsigned int nopnp = 0;
97#else 82#else
@@ -1051,6 +1036,20 @@ static struct mmc_host_ops wbsd_ops = {
1051\*****************************************************************************/ 1036\*****************************************************************************/
1052 1037
1053/* 1038/*
1039 * Helper function for card detection
1040 */
1041static void wbsd_detect_card(unsigned long data)
1042{
1043 struct wbsd_host *host = (struct wbsd_host*)data;
1044
1045 BUG_ON(host == NULL);
1046
1047 DBG("Executing card detection\n");
1048
1049 mmc_detect_change(host->mmc);
1050}
1051
1052/*
1054 * Tasklets 1053 * Tasklets
1055 */ 1054 */
1056 1055
@@ -1075,7 +1074,6 @@ static void wbsd_tasklet_card(unsigned long param)
1075{ 1074{
1076 struct wbsd_host* host = (struct wbsd_host*)param; 1075 struct wbsd_host* host = (struct wbsd_host*)param;
1077 u8 csr; 1076 u8 csr;
1078 int change = 0;
1079 1077
1080 spin_lock(&host->lock); 1078 spin_lock(&host->lock);
1081 1079
@@ -1094,14 +1092,20 @@ static void wbsd_tasklet_card(unsigned long param)
1094 { 1092 {
1095 DBG("Card inserted\n"); 1093 DBG("Card inserted\n");
1096 host->flags |= WBSD_FCARD_PRESENT; 1094 host->flags |= WBSD_FCARD_PRESENT;
1097 change = 1; 1095
1096 /*
1097 * Delay card detection to allow electrical connections
1098 * to stabilise.
1099 */
1100 mod_timer(&host->timer, jiffies + HZ/2);
1098 } 1101 }
1102
1103 spin_unlock(&host->lock);
1099 } 1104 }
1100 else if (host->flags & WBSD_FCARD_PRESENT) 1105 else if (host->flags & WBSD_FCARD_PRESENT)
1101 { 1106 {
1102 DBG("Card removed\n"); 1107 DBG("Card removed\n");
1103 host->flags &= ~WBSD_FCARD_PRESENT; 1108 host->flags &= ~WBSD_FCARD_PRESENT;
1104 change = 1;
1105 1109
1106 if (host->mrq) 1110 if (host->mrq)
1107 { 1111 {
@@ -1112,15 +1116,14 @@ static void wbsd_tasklet_card(unsigned long param)
1112 host->mrq->cmd->error = MMC_ERR_FAILED; 1116 host->mrq->cmd->error = MMC_ERR_FAILED;
1113 tasklet_schedule(&host->finish_tasklet); 1117 tasklet_schedule(&host->finish_tasklet);
1114 } 1118 }
1115 } 1119
1116 1120 /*
1117 /* 1121 * Unlock first since we might get a call back.
1118 * Unlock first since we might get a call back. 1122 */
1119 */ 1123 spin_unlock(&host->lock);
1120 spin_unlock(&host->lock);
1121 1124
1122 if (change)
1123 mmc_detect_change(host->mmc); 1125 mmc_detect_change(host->mmc);
1126 }
1124} 1127}
1125 1128
1126static void wbsd_tasklet_fifo(unsigned long param) 1129static void wbsd_tasklet_fifo(unsigned long param)
@@ -1325,6 +1328,13 @@ static int __devinit wbsd_alloc_mmc(struct device* dev)
1325 spin_lock_init(&host->lock); 1328 spin_lock_init(&host->lock);
1326 1329
1327 /* 1330 /*
1331 * Set up detection timer
1332 */
1333 init_timer(&host->timer);
1334 host->timer.data = (unsigned long)host;
1335 host->timer.function = wbsd_detect_card;
1336
1337 /*
1328 * Maximum number of segments. Worst case is one sector per segment 1338 * Maximum number of segments. Worst case is one sector per segment
1329 * so this will be 64kB/512. 1339 * so this will be 64kB/512.
1330 */ 1340 */
@@ -1351,11 +1361,17 @@ static int __devinit wbsd_alloc_mmc(struct device* dev)
1351static void __devexit wbsd_free_mmc(struct device* dev) 1361static void __devexit wbsd_free_mmc(struct device* dev)
1352{ 1362{
1353 struct mmc_host* mmc; 1363 struct mmc_host* mmc;
1364 struct wbsd_host* host;
1354 1365
1355 mmc = dev_get_drvdata(dev); 1366 mmc = dev_get_drvdata(dev);
1356 if (!mmc) 1367 if (!mmc)
1357 return; 1368 return;
1358 1369
1370 host = mmc_priv(mmc);
1371 BUG_ON(host == NULL);
1372
1373 del_timer_sync(&host->timer);
1374
1359 mmc_free_host(mmc); 1375 mmc_free_host(mmc);
1360 1376
1361 dev_set_drvdata(dev, NULL); 1377 dev_set_drvdata(dev, NULL);
diff --git a/drivers/mmc/wbsd.h b/drivers/mmc/wbsd.h
index 864f30828d01..661a9f6a6e6f 100644
--- a/drivers/mmc/wbsd.h
+++ b/drivers/mmc/wbsd.h
@@ -8,13 +8,6 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11const int config_ports[] = { 0x2E, 0x4E };
12const int unlock_codes[] = { 0x83, 0x87 };
13
14const int valid_ids[] = {
15 0x7112,
16 };
17
18#define LOCK_CODE 0xAA 11#define LOCK_CODE 0xAA
19 12
20#define WBSD_CONF_SWRST 0x02 13#define WBSD_CONF_SWRST 0x02
@@ -187,4 +180,6 @@ struct wbsd_host
187 struct tasklet_struct timeout_tasklet; 180 struct tasklet_struct timeout_tasklet;
188 struct tasklet_struct finish_tasklet; 181 struct tasklet_struct finish_tasklet;
189 struct tasklet_struct block_tasklet; 182 struct tasklet_struct block_tasklet;
183
184 struct timer_list timer; /* Card detection timer */
190}; 185};
diff --git a/drivers/mtd/afs.c b/drivers/mtd/afs.c
index 801e6c7d0892..7363e101eb0f 100644
--- a/drivers/mtd/afs.c
+++ b/drivers/mtd/afs.c
@@ -219,7 +219,7 @@ static int parse_afs_partitions(struct mtd_info *mtd,
219 */ 219 */
220 for (idx = off = 0; off < mtd->size; off += mtd->erasesize) { 220 for (idx = off = 0; off < mtd->size; off += mtd->erasesize) {
221 struct image_info_struct iis; 221 struct image_info_struct iis;
222 u_int iis_ptr, img_ptr, size; 222 u_int iis_ptr, img_ptr;
223 223
224 /* Read the footer. */ 224 /* Read the footer. */
225 ret = afs_read_footer(mtd, &img_ptr, &iis_ptr, off, mask); 225 ret = afs_read_footer(mtd, &img_ptr, &iis_ptr, off, mask);
@@ -236,21 +236,9 @@ static int parse_afs_partitions(struct mtd_info *mtd,
236 continue; 236 continue;
237 237
238 strcpy(str, iis.name); 238 strcpy(str, iis.name);
239 size = mtd->erasesize + off - img_ptr;
240
241 /*
242 * In order to support JFFS2 partitions on this layout,
243 * we must lie to MTD about the real size of JFFS2
244 * partitions; this ensures that the AFS flash footer
245 * won't be erased by JFFS2. Please ensure that your
246 * JFFS2 partitions are given image numbers between
247 * 1000 and 2000 inclusive.
248 */
249 if (iis.imageNumber >= 1000 && iis.imageNumber < 2000)
250 size -= mtd->erasesize;
251 239
252 parts[idx].name = str; 240 parts[idx].name = str;
253 parts[idx].size = size; 241 parts[idx].size = (iis.length + mtd->erasesize - 1) & ~(mtd->erasesize - 1);
254 parts[idx].offset = img_ptr; 242 parts[idx].offset = img_ptr;
255 parts[idx].mask_flags = 0; 243 parts[idx].mask_flags = 0;
256 244
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index cabddd49f6ff..d5afd557fe37 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -847,7 +847,7 @@ pcmcia_device_stringattr(prod_id2, prod_id[1]);
847pcmcia_device_stringattr(prod_id3, prod_id[2]); 847pcmcia_device_stringattr(prod_id3, prod_id[2]);
848pcmcia_device_stringattr(prod_id4, prod_id[3]); 848pcmcia_device_stringattr(prod_id4, prod_id[3]);
849 849
850static ssize_t modalias_show(struct device *dev, char *buf) 850static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf)
851{ 851{
852 struct pcmcia_device *p_dev = to_pcmcia_dev(dev); 852 struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
853 int i; 853 int i;
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 9224fc3184ea..7e8fc7c1d4cc 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2061,7 +2061,8 @@ static void __init serial8250_isa_init_ports(void)
2061 up->port.ops = &serial8250_pops; 2061 up->port.ops = &serial8250_pops;
2062 } 2062 }
2063 2063
2064 for (i = 0, up = serial8250_ports; i < ARRAY_SIZE(old_serial_port); 2064 for (i = 0, up = serial8250_ports;
2065 i < ARRAY_SIZE(old_serial_port) && i < UART_NR;
2065 i++, up++) { 2066 i++, up++) {
2066 up->port.iobase = old_serial_port[i].port; 2067 up->port.iobase = old_serial_port[i].port;
2067 up->port.irq = irq_canonicalize(old_serial_port[i].irq); 2068 up->port.irq = irq_canonicalize(old_serial_port[i].irq);
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 5c4678478b1d..7365d4b50b95 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -522,14 +522,11 @@ static void s3c24xx_serial_shutdown(struct uart_port *port)
522static int s3c24xx_serial_startup(struct uart_port *port) 522static int s3c24xx_serial_startup(struct uart_port *port)
523{ 523{
524 struct s3c24xx_uart_port *ourport = to_ourport(port); 524 struct s3c24xx_uart_port *ourport = to_ourport(port);
525 unsigned long flags;
526 int ret; 525 int ret;
527 526
528 dbg("s3c24xx_serial_startup: port=%p (%08lx,%p)\n", 527 dbg("s3c24xx_serial_startup: port=%p (%08lx,%p)\n",
529 port->mapbase, port->membase); 528 port->mapbase, port->membase);
530 529
531 local_irq_save(flags);
532
533 rx_enabled(port) = 1; 530 rx_enabled(port) = 1;
534 531
535 ret = request_irq(RX_IRQ(port), 532 ret = request_irq(RX_IRQ(port),
@@ -563,12 +560,10 @@ static int s3c24xx_serial_startup(struct uart_port *port)
563 /* the port reset code should have done the correct 560 /* the port reset code should have done the correct
564 * register setup for the port controls */ 561 * register setup for the port controls */
565 562
566 local_irq_restore(flags);
567 return ret; 563 return ret;
568 564
569 err: 565 err:
570 s3c24xx_serial_shutdown(port); 566 s3c24xx_serial_shutdown(port);
571 local_irq_restore(flags);
572 return ret; 567 return ret;
573} 568}
574 569
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 139863a787f3..54699c3a00ab 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1808,6 +1808,12 @@ uart_set_options(struct uart_port *port, struct console *co,
1808 struct termios termios; 1808 struct termios termios;
1809 int i; 1809 int i;
1810 1810
1811 /*
1812 * Ensure that the serial console lock is initialised
1813 * early.
1814 */
1815 spin_lock_init(&port->lock);
1816
1811 memset(&termios, 0, sizeof(struct termios)); 1817 memset(&termios, 0, sizeof(struct termios));
1812 1818
1813 termios.c_cflag = CREAD | HUPCL | CLOCAL; 1819 termios.c_cflag = CREAD | HUPCL | CLOCAL;
@@ -2196,10 +2202,16 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port)
2196 2202
2197 state->port = port; 2203 state->port = port;
2198 2204
2199 spin_lock_init(&port->lock);
2200 port->cons = drv->cons; 2205 port->cons = drv->cons;
2201 port->info = state->info; 2206 port->info = state->info;
2202 2207
2208 /*
2209 * If this port is a console, then the spinlock is already
2210 * initialised.
2211 */
2212 if (!uart_console(port))
2213 spin_lock_init(&port->lock);
2214
2203 uart_configure_port(drv, state, port); 2215 uart_configure_port(drv, state, port);
2204 2216
2205 /* 2217 /*
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index b209adbd508a..9dd0fbccf994 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -142,7 +142,6 @@ static int fbcon_set_origin(struct vc_data *);
142#define CURSOR_DRAW_DELAY (1) 142#define CURSOR_DRAW_DELAY (1)
143 143
144/* # VBL ints between cursor state changes */ 144/* # VBL ints between cursor state changes */
145#define ARM_CURSOR_BLINK_RATE (10)
146#define ATARI_CURSOR_BLINK_RATE (42) 145#define ATARI_CURSOR_BLINK_RATE (42)
147#define MAC_CURSOR_BLINK_RATE (32) 146#define MAC_CURSOR_BLINK_RATE (32)
148#define DEFAULT_CURSOR_BLINK_RATE (20) 147#define DEFAULT_CURSOR_BLINK_RATE (20)
@@ -288,7 +287,7 @@ static void fb_flashcursor(void *private)
288 release_console_sem(); 287 release_console_sem();
289} 288}
290 289
291#if (defined(__arm__) && defined(IRQ_VSYNCPULSE)) || defined(CONFIG_ATARI) || defined(CONFIG_MAC) 290#if defined(CONFIG_ATARI) || defined(CONFIG_MAC)
292static int cursor_blink_rate; 291static int cursor_blink_rate;
293static irqreturn_t fb_vbl_handler(int irq, void *dev_id, struct pt_regs *fp) 292static irqreturn_t fb_vbl_handler(int irq, void *dev_id, struct pt_regs *fp)
294{ 293{
@@ -878,11 +877,6 @@ static const char *fbcon_startup(void)
878 } 877 }
879#endif /* CONFIG_MAC */ 878#endif /* CONFIG_MAC */
880 879
881#if defined(__arm__) && defined(IRQ_VSYNCPULSE)
882 cursor_blink_rate = ARM_CURSOR_BLINK_RATE;
883 irqres = request_irq(IRQ_VSYNCPULSE, fb_vbl_handler, SA_SHIRQ,
884 "framebuffer vbl", info);
885#endif
886 /* Initialize the work queue. If the driver provides its 880 /* Initialize the work queue. If the driver provides its
887 * own work queue this means it will use something besides 881 * own work queue this means it will use something besides
888 * default timer to flash the cursor. */ 882 * default timer to flash the cursor. */
diff --git a/fs/fat/cache.c b/fs/fat/cache.c
index 7c52e465a619..77c24fcf712a 100644
--- a/fs/fat/cache.c
+++ b/fs/fat/cache.c
@@ -56,7 +56,7 @@ int __init fat_cache_init(void)
56 return 0; 56 return 0;
57} 57}
58 58
59void __exit fat_cache_destroy(void) 59void fat_cache_destroy(void)
60{ 60{
61 if (kmem_cache_destroy(fat_cache_cachep)) 61 if (kmem_cache_destroy(fat_cache_cachep))
62 printk(KERN_INFO "fat_cache: not all structures were freed\n"); 62 printk(KERN_INFO "fat_cache: not all structures were freed\n");
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 8ccee8415488..96ae85b67eba 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -1327,16 +1327,25 @@ out_fail:
1327EXPORT_SYMBOL(fat_fill_super); 1327EXPORT_SYMBOL(fat_fill_super);
1328 1328
1329int __init fat_cache_init(void); 1329int __init fat_cache_init(void);
1330void __exit fat_cache_destroy(void); 1330void fat_cache_destroy(void);
1331 1331
1332static int __init init_fat_fs(void) 1332static int __init init_fat_fs(void)
1333{ 1333{
1334 int ret; 1334 int err;
1335 1335
1336 ret = fat_cache_init(); 1336 err = fat_cache_init();
1337 if (ret < 0) 1337 if (err)
1338 return ret; 1338 return err;
1339 return fat_init_inodecache(); 1339
1340 err = fat_init_inodecache();
1341 if (err)
1342 goto failed;
1343
1344 return 0;
1345
1346failed:
1347 fat_cache_destroy();
1348 return err;
1340} 1349}
1341 1350
1342static void __exit exit_fat_fs(void) 1351static void __exit exit_fat_fs(void)
diff --git a/fs/freevxfs/vxfs.h b/fs/freevxfs/vxfs.h
index 8da0252642a4..583bd78086d8 100644
--- a/fs/freevxfs/vxfs.h
+++ b/fs/freevxfs/vxfs.h
@@ -37,7 +37,6 @@
37 * superblocks of the Veritas Filesystem. 37 * superblocks of the Veritas Filesystem.
38 */ 38 */
39#include <linux/types.h> 39#include <linux/types.h>
40#include "vxfs_kcompat.h"
41 40
42 41
43/* 42/*
diff --git a/fs/freevxfs/vxfs_bmap.c b/fs/freevxfs/vxfs_bmap.c
index bc4b57da306a..d3f6b2835bc8 100644
--- a/fs/freevxfs/vxfs_bmap.c
+++ b/fs/freevxfs/vxfs_bmap.c
@@ -101,7 +101,7 @@ vxfs_bmap_ext4(struct inode *ip, long bn)
101 return 0; 101 return 0;
102 102
103fail_size: 103fail_size:
104 printk("vxfs: indirect extent to big!\n"); 104 printk("vxfs: indirect extent too big!\n");
105fail_buf: 105fail_buf:
106 return 0; 106 return 0;
107} 107}
diff --git a/fs/freevxfs/vxfs_fshead.c b/fs/freevxfs/vxfs_fshead.c
index 05b19f70bf97..6dee109aeea4 100644
--- a/fs/freevxfs/vxfs_fshead.c
+++ b/fs/freevxfs/vxfs_fshead.c
@@ -78,17 +78,18 @@ vxfs_getfsh(struct inode *ip, int which)
78 struct buffer_head *bp; 78 struct buffer_head *bp;
79 79
80 bp = vxfs_bread(ip, which); 80 bp = vxfs_bread(ip, which);
81 if (buffer_mapped(bp)) { 81 if (bp) {
82 struct vxfs_fsh *fhp; 82 struct vxfs_fsh *fhp;
83 83
84 if (!(fhp = kmalloc(sizeof(*fhp), SLAB_KERNEL))) 84 if (!(fhp = kmalloc(sizeof(*fhp), GFP_KERNEL)))
85 return NULL; 85 goto out;
86 memcpy(fhp, bp->b_data, sizeof(*fhp)); 86 memcpy(fhp, bp->b_data, sizeof(*fhp));
87 87
88 brelse(bp); 88 put_bh(bp);
89 return (fhp); 89 return (fhp);
90 } 90 }
91 91out:
92 brelse(bp);
92 return NULL; 93 return NULL;
93} 94}
94 95
diff --git a/fs/freevxfs/vxfs_kcompat.h b/fs/freevxfs/vxfs_kcompat.h
deleted file mode 100644
index 342a4cc860f4..000000000000
--- a/fs/freevxfs/vxfs_kcompat.h
+++ /dev/null
@@ -1,49 +0,0 @@
1#ifndef _VXFS_KCOMPAT_H
2#define _VXFS_KCOMPAT_H
3
4#include <linux/version.h>
5
6#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
7
8#include <linux/blkdev.h>
9
10typedef long sector_t;
11
12/* From include/linux/fs.h (Linux 2.5.2-pre3) */
13static inline struct buffer_head * sb_bread(struct super_block *sb, int block)
14{
15 return bread(sb->s_dev, block, sb->s_blocksize);
16}
17
18/* Dito. */
19static inline void map_bh(struct buffer_head *bh, struct super_block *sb, int block)
20{
21 bh->b_state |= 1 << BH_Mapped;
22 bh->b_dev = sb->s_dev;
23 bh->b_blocknr = block;
24}
25
26/* From fs/block_dev.c (Linux 2.5.2-pre2) */
27static inline int sb_set_blocksize(struct super_block *sb, int size)
28{
29 int bits;
30 if (set_blocksize(sb->s_dev, size) < 0)
31 return 0;
32 sb->s_blocksize = size;
33 for (bits = 9, size >>= 9; size >>= 1; bits++)
34 ;
35 sb->s_blocksize_bits = bits;
36 return sb->s_blocksize;
37}
38
39/* Dito. */
40static inline int sb_min_blocksize(struct super_block *sb, int size)
41{
42 int minsize = get_hardsect_size(sb->s_dev);
43 if (size < minsize)
44 size = minsize;
45 return sb_set_blocksize(sb, size);
46}
47
48#endif /* Kernel 2.4 */
49#endif /* _VXFS_KCOMPAT_H */
diff --git a/fs/freevxfs/vxfs_lookup.c b/fs/freevxfs/vxfs_lookup.c
index 506ae251d2c0..554eb455722c 100644
--- a/fs/freevxfs/vxfs_lookup.c
+++ b/fs/freevxfs/vxfs_lookup.c
@@ -61,13 +61,13 @@ struct file_operations vxfs_dir_operations = {
61}; 61};
62 62
63 63
64static __inline__ u_long 64static inline u_long
65dir_pages(struct inode *inode) 65dir_pages(struct inode *inode)
66{ 66{
67 return (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; 67 return (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
68} 68}
69 69
70static __inline__ u_long 70static inline u_long
71dir_blocks(struct inode *ip) 71dir_blocks(struct inode *ip)
72{ 72{
73 u_long bsize = ip->i_sb->s_blocksize; 73 u_long bsize = ip->i_sb->s_blocksize;
@@ -79,7 +79,7 @@ dir_blocks(struct inode *ip)
79 * 79 *
80 * len <= VXFS_NAMELEN and de != NULL are guaranteed by caller. 80 * len <= VXFS_NAMELEN and de != NULL are guaranteed by caller.
81 */ 81 */
82static __inline__ int 82static inline int
83vxfs_match(int len, const char * const name, struct vxfs_direct *de) 83vxfs_match(int len, const char * const name, struct vxfs_direct *de)
84{ 84{
85 if (len != de->d_namelen) 85 if (len != de->d_namelen)
@@ -89,7 +89,7 @@ vxfs_match(int len, const char * const name, struct vxfs_direct *de)
89 return !memcmp(name, de->d_name, len); 89 return !memcmp(name, de->d_name, len);
90} 90}
91 91
92static __inline__ struct vxfs_direct * 92static inline struct vxfs_direct *
93vxfs_next_entry(struct vxfs_direct *de) 93vxfs_next_entry(struct vxfs_direct *de)
94{ 94{
95 return ((struct vxfs_direct *)((char*)de + de->d_reclen)); 95 return ((struct vxfs_direct *)((char*)de + de->d_reclen));
diff --git a/fs/freevxfs/vxfs_olt.c b/fs/freevxfs/vxfs_olt.c
index 7a204e31aad9..133476201d84 100644
--- a/fs/freevxfs/vxfs_olt.c
+++ b/fs/freevxfs/vxfs_olt.c
@@ -38,7 +38,7 @@
38#include "vxfs_olt.h" 38#include "vxfs_olt.h"
39 39
40 40
41static __inline__ void 41static inline void
42vxfs_get_fshead(struct vxfs_oltfshead *fshp, struct vxfs_sb_info *infp) 42vxfs_get_fshead(struct vxfs_oltfshead *fshp, struct vxfs_sb_info *infp)
43{ 43{
44 if (infp->vsi_fshino) 44 if (infp->vsi_fshino)
@@ -46,7 +46,7 @@ vxfs_get_fshead(struct vxfs_oltfshead *fshp, struct vxfs_sb_info *infp)
46 infp->vsi_fshino = fshp->olt_fsino[0]; 46 infp->vsi_fshino = fshp->olt_fsino[0];
47} 47}
48 48
49static __inline__ void 49static inline void
50vxfs_get_ilist(struct vxfs_oltilist *ilistp, struct vxfs_sb_info *infp) 50vxfs_get_ilist(struct vxfs_oltilist *ilistp, struct vxfs_sb_info *infp)
51{ 51{
52 if (infp->vsi_iext) 52 if (infp->vsi_iext)
@@ -54,7 +54,7 @@ vxfs_get_ilist(struct vxfs_oltilist *ilistp, struct vxfs_sb_info *infp)
54 infp->vsi_iext = ilistp->olt_iext[0]; 54 infp->vsi_iext = ilistp->olt_iext[0];
55} 55}
56 56
57static __inline__ u_long 57static inline u_long
58vxfs_oblock(struct super_block *sbp, daddr_t block, u_long bsize) 58vxfs_oblock(struct super_block *sbp, daddr_t block, u_long bsize)
59{ 59{
60 if (sbp->s_blocksize % bsize) 60 if (sbp->s_blocksize % bsize)
@@ -104,8 +104,8 @@ vxfs_read_olt(struct super_block *sbp, u_long bsize)
104 goto fail; 104 goto fail;
105 } 105 }
106 106
107 oaddr = (char *)bp->b_data + op->olt_size; 107 oaddr = bp->b_data + op->olt_size;
108 eaddr = (char *)bp->b_data + (infp->vsi_oltsize * sbp->s_blocksize); 108 eaddr = bp->b_data + (infp->vsi_oltsize * sbp->s_blocksize);
109 109
110 while (oaddr < eaddr) { 110 while (oaddr < eaddr) {
111 struct vxfs_oltcommon *ocp = 111 struct vxfs_oltcommon *ocp =
diff --git a/fs/freevxfs/vxfs_subr.c b/fs/freevxfs/vxfs_subr.c
index 5e305612054a..50aae77651b2 100644
--- a/fs/freevxfs/vxfs_subr.c
+++ b/fs/freevxfs/vxfs_subr.c
@@ -36,7 +36,6 @@
36#include <linux/slab.h> 36#include <linux/slab.h>
37#include <linux/pagemap.h> 37#include <linux/pagemap.h>
38 38
39#include "vxfs_kcompat.h"
40#include "vxfs_extern.h" 39#include "vxfs_extern.h"
41 40
42 41
diff --git a/fs/freevxfs/vxfs_super.c b/fs/freevxfs/vxfs_super.c
index 0ae2c7b8182a..27f66d3e8a04 100644
--- a/fs/freevxfs/vxfs_super.c
+++ b/fs/freevxfs/vxfs_super.c
@@ -155,12 +155,11 @@ static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent)
155 155
156 sbp->s_flags |= MS_RDONLY; 156 sbp->s_flags |= MS_RDONLY;
157 157
158 infp = kmalloc(sizeof(*infp), GFP_KERNEL); 158 infp = kcalloc(1, sizeof(*infp), GFP_KERNEL);
159 if (!infp) { 159 if (!infp) {
160 printk(KERN_WARNING "vxfs: unable to allocate incore superblock\n"); 160 printk(KERN_WARNING "vxfs: unable to allocate incore superblock\n");
161 return -ENOMEM; 161 return -ENOMEM;
162 } 162 }
163 memset(infp, 0, sizeof(*infp));
164 163
165 bsize = sb_min_blocksize(sbp, BLOCK_SIZE); 164 bsize = sb_min_blocksize(sbp, BLOCK_SIZE);
166 if (!bsize) { 165 if (!bsize) {
@@ -196,7 +195,7 @@ static int vxfs_fill_super(struct super_block *sbp, void *dp, int silent)
196#endif 195#endif
197 196
198 sbp->s_magic = rsbp->vs_magic; 197 sbp->s_magic = rsbp->vs_magic;
199 sbp->s_fs_info = (void *)infp; 198 sbp->s_fs_info = infp;
200 199
201 infp->vsi_raw = rsbp; 200 infp->vsi_raw = rsbp;
202 infp->vsi_bp = bp; 201 infp->vsi_bp = bp;
@@ -263,7 +262,7 @@ vxfs_init(void)
263 sizeof(struct vxfs_inode_info), 0, 262 sizeof(struct vxfs_inode_info), 0,
264 SLAB_RECLAIM_ACCOUNT, NULL, NULL); 263 SLAB_RECLAIM_ACCOUNT, NULL, NULL);
265 if (vxfs_inode_cachep) 264 if (vxfs_inode_cachep)
266 return (register_filesystem(&vxfs_fs_type)); 265 return register_filesystem(&vxfs_fs_type);
267 return -ENOMEM; 266 return -ENOMEM;
268} 267}
269 268
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index d50a5cd860ce..4b80ab95d338 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -1053,10 +1053,9 @@ static void handle_barrier_mode(struct super_block *s, unsigned long bits) {
1053 1053
1054static void handle_attrs( struct super_block *s ) 1054static void handle_attrs( struct super_block *s )
1055{ 1055{
1056 struct reiserfs_super_block * rs; 1056 struct reiserfs_super_block * rs = SB_DISK_SUPER_BLOCK (s);
1057 1057
1058 if( reiserfs_attrs( s ) ) { 1058 if( reiserfs_attrs( s ) ) {
1059 rs = SB_DISK_SUPER_BLOCK (s);
1060 if( old_format_only(s) ) { 1059 if( old_format_only(s) ) {
1061 reiserfs_warning(s, "reiserfs: cannot support attributes on 3.5.x disk format" ); 1060 reiserfs_warning(s, "reiserfs: cannot support attributes on 3.5.x disk format" );
1062 REISERFS_SB(s) -> s_mount_opt &= ~ ( 1 << REISERFS_ATTRS ); 1061 REISERFS_SB(s) -> s_mount_opt &= ~ ( 1 << REISERFS_ATTRS );
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index 4673157b262f..ac191ed7df0a 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -164,11 +164,7 @@ udf_find_entry(struct inode *dir, struct dentry *dentry,
164 uint32_t extoffset, elen, offset; 164 uint32_t extoffset, elen, offset;
165 struct buffer_head *bh = NULL; 165 struct buffer_head *bh = NULL;
166 166
167 if (!dir)
168 return NULL;
169
170 size = (udf_ext0_offset(dir) + dir->i_size) >> 2; 167 size = (udf_ext0_offset(dir) + dir->i_size) >> 2;
171
172 f_pos = (udf_ext0_offset(dir) >> 2); 168 f_pos = (udf_ext0_offset(dir) >> 2);
173 169
174 fibh->soffset = fibh->eoffset = (f_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2; 170 fibh->soffset = fibh->eoffset = (f_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2;
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index b5e54a9e9fa7..51f0fe0ac165 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -1505,6 +1505,7 @@
1505#define PSSR_OTGPH (1 << 6) /* OTG Peripheral control Hold */ 1505#define PSSR_OTGPH (1 << 6) /* OTG Peripheral control Hold */
1506#define PSSR_RDH (1 << 5) /* Read Disable Hold */ 1506#define PSSR_RDH (1 << 5) /* Read Disable Hold */
1507#define PSSR_PH (1 << 4) /* Peripheral Control Hold */ 1507#define PSSR_PH (1 << 4) /* Peripheral Control Hold */
1508#define PSSR_STS (1 << 3) /* Standby Mode Status */
1508#define PSSR_VFS (1 << 2) /* VDD Fault Status */ 1509#define PSSR_VFS (1 << 2) /* VDD Fault Status */
1509#define PSSR_BFS (1 << 1) /* Battery Fault Status */ 1510#define PSSR_BFS (1 << 1) /* Battery Fault Status */
1510#define PSSR_SSS (1 << 0) /* Software Sleep Status */ 1511#define PSSR_SSS (1 << 0) /* Software Sleep Status */
@@ -1965,6 +1966,7 @@
1965#define MECR_NOS (1 << 0) /* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */ 1966#define MECR_NOS (1 << 0) /* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */
1966#define MECR_CIT (1 << 1) /* Card Is There: 0 -> no card, 1 -> card inserted */ 1967#define MECR_CIT (1 << 1) /* Card Is There: 0 -> no card, 1 -> card inserted */
1967 1968
1969#define MDREFR_K0DB4 (1 << 29) /* SDCLK0 Divide by 4 Control/Status */
1968#define MDREFR_K2FREE (1 << 25) /* SDRAM Free-Running Control */ 1970#define MDREFR_K2FREE (1 << 25) /* SDRAM Free-Running Control */
1969#define MDREFR_K1FREE (1 << 24) /* SDRAM Free-Running Control */ 1971#define MDREFR_K1FREE (1 << 24) /* SDRAM Free-Running Control */
1970#define MDREFR_K0FREE (1 << 23) /* SDRAM Free-Running Control */ 1972#define MDREFR_K0FREE (1 << 23) /* SDRAM Free-Running Control */
diff --git a/include/asm-arm/mach/arch.h b/include/asm-arm/mach/arch.h
index 3a32e929ec8c..a2fbb6558c15 100644
--- a/include/asm-arm/mach/arch.h
+++ b/include/asm-arm/mach/arch.h
@@ -54,38 +54,6 @@ const struct machine_desc __mach_desc_##_type \
54 .nr = MACH_TYPE_##_type, \ 54 .nr = MACH_TYPE_##_type, \
55 .name = _name, 55 .name = _name,
56 56
57#define MAINTAINER(n)
58
59#define BOOT_MEM(_pram,_pio,_vio) \
60 .phys_ram = _pram, \
61 .phys_io = _pio, \
62 .io_pg_offst = ((_vio)>>18)&0xfffc,
63
64#define BOOT_PARAMS(_params) \
65 .param_offset = _params,
66
67#define VIDEO(_start,_end) \
68 .video_start = _start, \
69 .video_end = _end,
70
71#define DISABLE_PARPORT(_n) \
72 .reserve_lp##_n = 1,
73
74#define SOFT_REBOOT \
75 .soft_reboot = 1,
76
77#define FIXUP(_func) \
78 .fixup = _func,
79
80#define MAPIO(_func) \
81 .map_io = _func,
82
83#define INITIRQ(_func) \
84 .init_irq = _func,
85
86#define INIT_MACHINE(_func) \
87 .init_machine = _func,
88
89#define MACHINE_END \ 57#define MACHINE_END \
90}; 58};
91 59
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index cdf49f442fd2..2f44b2044214 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -85,7 +85,9 @@ struct pt_regs;
85void die(const char *msg, struct pt_regs *regs, int err) 85void die(const char *msg, struct pt_regs *regs, int err)
86 __attribute__((noreturn)); 86 __attribute__((noreturn));
87 87
88void die_if_kernel(const char *str, struct pt_regs *regs, int err); 88struct siginfo;
89void notify_die(const char *str, struct pt_regs *regs, struct siginfo *info,
90 unsigned long err, unsigned long trap);
89 91
90void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, 92void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
91 struct pt_regs *), 93 struct pt_regs *),
diff --git a/include/asm-i386/i8253.h b/include/asm-i386/i8253.h
new file mode 100644
index 000000000000..015d8df07690
--- /dev/null
+++ b/include/asm-i386/i8253.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_I8253_H__
2#define __ASM_I8253_H__
3
4extern spinlock_t i8253_lock;
5
6#endif /* __ASM_I8253_H__ */
diff --git a/include/asm-i386/mach-default/do_timer.h b/include/asm-i386/mach-default/do_timer.h
index 03dd13a48a8c..56211414fc95 100644
--- a/include/asm-i386/mach-default/do_timer.h
+++ b/include/asm-i386/mach-default/do_timer.h
@@ -1,6 +1,7 @@
1/* defines for inline arch setup functions */ 1/* defines for inline arch setup functions */
2 2
3#include <asm/apic.h> 3#include <asm/apic.h>
4#include <asm/i8259.h>
4 5
5/** 6/**
6 * do_timer_interrupt_hook - hook into timer tick 7 * do_timer_interrupt_hook - hook into timer tick
diff --git a/include/asm-ppc64/iSeries/ItLpQueue.h b/include/asm-ppc64/iSeries/ItLpQueue.h
index 393299e04d7f..69b26ad74135 100644
--- a/include/asm-ppc64/iSeries/ItLpQueue.h
+++ b/include/asm-ppc64/iSeries/ItLpQueue.h
@@ -41,7 +41,7 @@ struct HvLpEvent;
41#define LpEventMaxSize 256 41#define LpEventMaxSize 256
42#define LpEventAlign 64 42#define LpEventAlign 64
43 43
44struct ItLpQueue { 44struct hvlpevent_queue {
45/* 45/*
46 * The xSlicCurEventPtr is the pointer to the next event stack entry 46 * The xSlicCurEventPtr is the pointer to the next event stack entry
47 * that will become valid. The OS must peek at this entry to determine 47 * that will become valid. The OS must peek at this entry to determine
@@ -69,16 +69,13 @@ struct ItLpQueue {
69 char *xSlicEventStackPtr; // 0x20 69 char *xSlicEventStackPtr; // 0x20
70 u8 xIndex; // 0x28 unique sequential index. 70 u8 xIndex; // 0x28 unique sequential index.
71 u8 xSlicRsvd[3]; // 0x29-2b 71 u8 xSlicRsvd[3]; // 0x29-2b
72 u32 xInUseWord; // 0x2C 72 spinlock_t lock;
73 u64 xLpIntCount; // 0x30 Total Lp Int msgs processed
74 u64 xLpIntCountByType[9]; // 0x38-0x7F Event counts by type
75}; 73};
76 74
77extern struct ItLpQueue xItLpQueue; 75extern struct hvlpevent_queue hvlpevent_queue;
78 76
79extern struct HvLpEvent *ItLpQueue_getNextLpEvent(struct ItLpQueue *); 77extern int hvlpevent_is_pending(void);
80extern int ItLpQueue_isLpIntPending(struct ItLpQueue *); 78extern void process_hvlpevents(struct pt_regs *);
81extern unsigned ItLpQueue_process(struct ItLpQueue *, struct pt_regs *); 79extern void setup_hvlpevent_queue(void);
82extern void ItLpQueue_clearValid(struct HvLpEvent *);
83 80
84#endif /* _ITLPQUEUE_H */ 81#endif /* _ITLPQUEUE_H */
diff --git a/include/asm-ppc64/paca.h b/include/asm-ppc64/paca.h
index ae76cae1483f..2f0f36f73d38 100644
--- a/include/asm-ppc64/paca.h
+++ b/include/asm-ppc64/paca.h
@@ -20,7 +20,6 @@
20#include <asm/types.h> 20#include <asm/types.h>
21#include <asm/lppaca.h> 21#include <asm/lppaca.h>
22#include <asm/iSeries/ItLpRegSave.h> 22#include <asm/iSeries/ItLpRegSave.h>
23#include <asm/iSeries/ItLpQueue.h>
24#include <asm/mmu.h> 23#include <asm/mmu.h>
25 24
26register struct paca_struct *local_paca asm("r13"); 25register struct paca_struct *local_paca asm("r13");
@@ -62,7 +61,6 @@ struct paca_struct {
62 u16 paca_index; /* Logical processor number */ 61 u16 paca_index; /* Logical processor number */
63 62
64 u32 default_decr; /* Default decrementer value */ 63 u32 default_decr; /* Default decrementer value */
65 struct ItLpQueue *lpqueue_ptr; /* LpQueue handled by this CPU */
66 u64 kernel_toc; /* Kernel TOC address */ 64 u64 kernel_toc; /* Kernel TOC address */
67 u64 stab_real; /* Absolute address of segment table */ 65 u64 stab_real; /* Absolute address of segment table */
68 u64 stab_addr; /* Virtual address of segment table */ 66 u64 stab_addr; /* Virtual address of segment table */
@@ -91,7 +89,6 @@ struct paca_struct {
91 u64 next_jiffy_update_tb; /* TB value for next jiffy update */ 89 u64 next_jiffy_update_tb; /* TB value for next jiffy update */
92 u64 saved_r1; /* r1 save for RTAS calls */ 90 u64 saved_r1; /* r1 save for RTAS calls */
93 u64 saved_msr; /* MSR saved here by enter_rtas */ 91 u64 saved_msr; /* MSR saved here by enter_rtas */
94 u32 lpevent_count; /* lpevents processed */
95 u8 proc_enabled; /* irq soft-enable flag */ 92 u8 proc_enabled; /* irq soft-enable flag */
96 93
97 /* not yet used */ 94 /* not yet used */
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h
index b4a9f05a93d6..864cae7e1fd6 100644
--- a/include/asm-s390/system.h
+++ b/include/asm-s390/system.h
@@ -107,11 +107,9 @@ static inline void restore_access_regs(unsigned int *acrs)
107#ifdef CONFIG_VIRT_CPU_ACCOUNTING 107#ifdef CONFIG_VIRT_CPU_ACCOUNTING
108extern void account_user_vtime(struct task_struct *); 108extern void account_user_vtime(struct task_struct *);
109extern void account_system_vtime(struct task_struct *); 109extern void account_system_vtime(struct task_struct *);
110#else
111#define account_system_vtime(prev) do { } while (0)
112#endif 110#endif
113 111
114#define finish_arch_switch(rq, prev) do { \ 112#define finish_arch_switch(prev) do { \
115 set_fs(current->thread.mm_segment); \ 113 set_fs(current->thread.mm_segment); \
116 account_system_vtime(prev); \ 114 account_system_vtime(prev); \
117} while (0) 115} while (0)
diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h
index 32573749004c..a8babd2bbe84 100644
--- a/include/asm-x86_64/io_apic.h
+++ b/include/asm-x86_64/io_apic.h
@@ -217,4 +217,6 @@ extern int assign_irq_vector(int irq);
217 217
218void enable_NMI_through_LVT0 (void * dummy); 218void enable_NMI_through_LVT0 (void * dummy);
219 219
220extern spinlock_t i8259A_lock;
221
220#endif 222#endif
diff --git a/include/asm-xtensa/delay.h b/include/asm-xtensa/delay.h
index 6359c55e77a8..0a123d53a636 100644
--- a/include/asm-xtensa/delay.h
+++ b/include/asm-xtensa/delay.h
@@ -21,7 +21,7 @@ extern unsigned long loops_per_jiffy;
21extern __inline__ void __delay(unsigned long loops) 21extern __inline__ void __delay(unsigned long loops)
22{ 22{
23 /* 2 cycles per loop. */ 23 /* 2 cycles per loop. */
24 __asm__ __volatile__ ("1: addi %0, %0, -2; bgeui %0, 1, 1b" 24 __asm__ __volatile__ ("1: addi %0, %0, -2; bgeui %0, 2, 1b"
25 : "=r" (loops) : "0" (loops)); 25 : "=r" (loops) : "0" (loops));
26} 26}
27 27
diff --git a/include/asm-xtensa/errno.h b/include/asm-xtensa/errno.h
index ced5194d2750..a0f3b96b79b4 100644
--- a/include/asm-xtensa/errno.h
+++ b/include/asm-xtensa/errno.h
@@ -11,132 +11,6 @@
11#ifndef _XTENSA_ERRNO_H 11#ifndef _XTENSA_ERRNO_H
12#define _XTENSA_ERRNO_H 12#define _XTENSA_ERRNO_H
13 13
14#define EPERM 1 /* Operation not permitted */ 14#include <asm-generic/errno.h>
15#define ENOENT 2 /* No such file or directory */
16#define ESRCH 3 /* No such process */
17#define EINTR 4 /* Interrupted system call */
18#define EIO 5 /* I/O error */
19#define ENXIO 6 /* No such device or address */
20#define E2BIG 7 /* Arg list too long */
21#define ENOEXEC 8 /* Exec format error */
22#define EBADF 9 /* Bad file number */
23#define ECHILD 10 /* No child processes */
24#define EAGAIN 11 /* Try again */
25#define ENOMEM 12 /* Out of memory */
26#define EACCES 13 /* Permission denied */
27#define EFAULT 14 /* Bad address */
28#define ENOTBLK 15 /* Block device required */
29#define EBUSY 16 /* Device or resource busy */
30#define EEXIST 17 /* File exists */
31#define EXDEV 18 /* Cross-device link */
32#define ENODEV 19 /* No such device */
33#define ENOTDIR 20 /* Not a directory */
34#define EISDIR 21 /* Is a directory */
35#define EINVAL 22 /* Invalid argument */
36#define ENFILE 23 /* File table overflow */
37#define EMFILE 24 /* Too many open files */
38#define ENOTTY 25 /* Not a typewriter */
39#define ETXTBSY 26 /* Text file busy */
40#define EFBIG 27 /* File too large */
41#define ENOSPC 28 /* No space left on device */
42#define ESPIPE 29 /* Illegal seek */
43#define EROFS 30 /* Read-only file system */
44#define EMLINK 31 /* Too many links */
45#define EPIPE 32 /* Broken pipe */
46#define EDOM 33 /* Math argument out of domain of func */
47#define ERANGE 34 /* Math result not representable */
48#define EDEADLK 35 /* Resource deadlock would occur */
49#define ENAMETOOLONG 36 /* File name too long */
50#define ENOLCK 37 /* No record locks available */
51#define ENOSYS 38 /* Function not implemented */
52#define ENOTEMPTY 39 /* Directory not empty */
53#define ELOOP 40 /* Too many symbolic links encountered */
54#define EWOULDBLOCK EAGAIN /* Operation would block */
55#define ENOMSG 42 /* No message of desired type */
56#define EIDRM 43 /* Identifier removed */
57#define ECHRNG 44 /* Channel number out of range */
58#define EL2NSYNC 45 /* Level 2 not synchronized */
59#define EL3HLT 46 /* Level 3 halted */
60#define EL3RST 47 /* Level 3 reset */
61#define ELNRNG 48 /* Link number out of range */
62#define EUNATCH 49 /* Protocol driver not attached */
63#define ENOCSI 50 /* No CSI structure available */
64#define EL2HLT 51 /* Level 2 halted */
65#define EBADE 52 /* Invalid exchange */
66#define EBADR 53 /* Invalid request descriptor */
67#define EXFULL 54 /* Exchange full */
68#define ENOANO 55 /* No anode */
69#define EBADRQC 56 /* Invalid request code */
70#define EBADSLT 57 /* Invalid slot */
71
72#define EDEADLOCK EDEADLK
73
74#define EBFONT 59 /* Bad font file format */
75#define ENOSTR 60 /* Device not a stream */
76#define ENODATA 61 /* No data available */
77#define ETIME 62 /* Timer expired */
78#define ENOSR 63 /* Out of streams resources */
79#define ENONET 64 /* Machine is not on the network */
80#define ENOPKG 65 /* Package not installed */
81#define EREMOTE 66 /* Object is remote */
82#define ENOLINK 67 /* Link has been severed */
83#define EADV 68 /* Advertise error */
84#define ESRMNT 69 /* Srmount error */
85#define ECOMM 70 /* Communication error on send */
86#define EPROTO 71 /* Protocol error */
87#define EMULTIHOP 72 /* Multihop attempted */
88#define EDOTDOT 73 /* RFS specific error */
89#define EBADMSG 74 /* Not a data message */
90#define EOVERFLOW 75 /* Value too large for defined data type */
91#define ENOTUNIQ 76 /* Name not unique on network */
92#define EBADFD 77 /* File descriptor in bad state */
93#define EREMCHG 78 /* Remote address changed */
94#define ELIBACC 79 /* Can not access a needed shared library */
95#define ELIBBAD 80 /* Accessing a corrupted shared library */
96#define ELIBSCN 81 /* .lib section in a.out corrupted */
97#define ELIBMAX 82 /* Attempting to link in too many shared libraries */
98#define ELIBEXEC 83 /* Cannot exec a shared library directly */
99#define EILSEQ 84 /* Illegal byte sequence */
100#define ERESTART 85 /* Interrupted system call should be restarted */
101#define ESTRPIPE 86 /* Streams pipe error */
102#define EUSERS 87 /* Too many users */
103#define ENOTSOCK 88 /* Socket operation on non-socket */
104#define EDESTADDRREQ 89 /* Destination address required */
105#define EMSGSIZE 90 /* Message too long */
106#define EPROTOTYPE 91 /* Protocol wrong type for socket */
107#define ENOPROTOOPT 92 /* Protocol not available */
108#define EPROTONOSUPPORT 93 /* Protocol not supported */
109#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
110#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
111#define EPFNOSUPPORT 96 /* Protocol family not supported */
112#define EAFNOSUPPORT 97 /* Address family not supported by protocol */
113#define EADDRINUSE 98 /* Address already in use */
114#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
115#define ENETDOWN 100 /* Network is down */
116#define ENETUNREACH 101 /* Network is unreachable */
117#define ENETRESET 102 /* Network dropped connection because of reset */
118#define ECONNABORTED 103 /* Software caused connection abort */
119#define ECONNRESET 104 /* Connection reset by peer */
120#define ENOBUFS 105 /* No buffer space available */
121#define EISCONN 106 /* Transport endpoint is already connected */
122#define ENOTCONN 107 /* Transport endpoint is not connected */
123#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
124#define ETOOMANYREFS 109 /* Too many references: cannot splice */
125#define ETIMEDOUT 110 /* Connection timed out */
126#define ECONNREFUSED 111 /* Connection refused */
127#define EHOSTDOWN 112 /* Host is down */
128#define EHOSTUNREACH 113 /* No route to host */
129#define EALREADY 114 /* Operation already in progress */
130#define EINPROGRESS 115 /* Operation now in progress */
131#define ESTALE 116 /* Stale NFS file handle */
132#define EUCLEAN 117 /* Structure needs cleaning */
133#define ENOTNAM 118 /* Not a XENIX named type file */
134#define ENAVAIL 119 /* No XENIX semaphores available */
135#define EISNAM 120 /* Is a named type file */
136#define EREMOTEIO 121 /* Remote I/O error */
137#define EDQUOT 122 /* Quota exceeded */
138
139#define ENOMEDIUM 123 /* No medium found */
140#define EMEDIUMTYPE 124 /* Wrong medium type */
141 15
142#endif /* _XTENSA_ERRNO_H */ 16#endif /* _XTENSA_ERRNO_H */
diff --git a/include/asm-xtensa/ipc.h b/include/asm-xtensa/ipc.h
index d37bdb4d4c9c..a9eed4e21cb9 100644
--- a/include/asm-xtensa/ipc.h
+++ b/include/asm-xtensa/ipc.h
@@ -11,24 +11,6 @@
11#ifndef _XTENSA_IPC_H 11#ifndef _XTENSA_IPC_H
12#define _XTENSA_IPC_H 12#define _XTENSA_IPC_H
13 13
14struct ipc_kludge { 14#include <asm-generic/ipc.h>
15 struct msgbuf __user *msgp;
16 long msgtyp;
17};
18
19#define SEMOP 1
20#define SEMGET 2
21#define SEMCTL 3
22#define SEMTIMEDOP 4
23#define MSGSND 11
24#define MSGRCV 12
25#define MSGGET 13
26#define MSGCTL 14
27#define SHMAT 21
28#define SHMDT 22
29#define SHMGET 23
30#define SHMCTL 24
31
32#define IPCCALL(version,op) ((version)<<16 | (op))
33 15
34#endif /* _XTENSA_IPC_H */ 16#endif /* _XTENSA_IPC_H */
diff --git a/include/linux/device.h b/include/linux/device.h
index 7b781a72b293..f378c846e6d5 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -69,7 +69,7 @@ struct bus_type {
69extern int bus_register(struct bus_type * bus); 69extern int bus_register(struct bus_type * bus);
70extern void bus_unregister(struct bus_type * bus); 70extern void bus_unregister(struct bus_type * bus);
71 71
72extern int bus_rescan_devices(struct bus_type * bus); 72extern void bus_rescan_devices(struct bus_type * bus);
73 73
74extern struct bus_type * get_bus(struct bus_type * bus); 74extern struct bus_type * get_bus(struct bus_type * bus);
75extern void put_bus(struct bus_type * bus); 75extern void put_bus(struct bus_type * bus);
@@ -80,6 +80,8 @@ extern struct bus_type * find_bus(char * name);
80 80
81int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, 81int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data,
82 int (*fn)(struct device *, void *)); 82 int (*fn)(struct device *, void *));
83struct device * bus_find_device(struct bus_type *bus, struct device *start,
84 void *data, int (*match)(struct device *, void *));
83 85
84int bus_for_each_drv(struct bus_type * bus, struct device_driver * start, 86int bus_for_each_drv(struct bus_type * bus, struct device_driver * start,
85 void * data, int (*fn)(struct device_driver *, void *)); 87 void * data, int (*fn)(struct device_driver *, void *));
@@ -142,6 +144,9 @@ extern void driver_remove_file(struct device_driver *, struct driver_attribute *
142 144
143extern int driver_for_each_device(struct device_driver * drv, struct device * start, 145extern int driver_for_each_device(struct device_driver * drv, struct device * start,
144 void * data, int (*fn)(struct device *, void *)); 146 void * data, int (*fn)(struct device *, void *));
147struct device * driver_find_device(struct device_driver *drv,
148 struct device *start, void *data,
149 int (*match)(struct device *, void *));
145 150
146 151
147/* 152/*
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index c3ee1ae4545a..27348c22dacb 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1238,6 +1238,7 @@
1238#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265 1238#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265
1239#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 1239#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266
1240#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 1240#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267
1241#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E
1241#define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 1242#define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268
1242#define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 1243#define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269
1243#define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B 1244#define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index 4def882d0b31..a05cabd0fd10 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -86,7 +86,10 @@ static void __init handle_initrd(void)
86 printk("okay\n"); 86 printk("okay\n");
87 else { 87 else {
88 int fd = sys_open("/dev/root.old", O_RDWR, 0); 88 int fd = sys_open("/dev/root.old", O_RDWR, 0);
89 printk("failed\n"); 89 if (error == -ENOENT)
90 printk("/initrd does not exist. Ignored.\n");
91 else
92 printk("failed\n");
90 printk(KERN_NOTICE "Unmounting old root\n"); 93 printk(KERN_NOTICE "Unmounting old root\n");
91 sys_umount("/old", MNT_DETACH); 94 sys_umount("/old", MNT_DETACH);
92 printk(KERN_NOTICE "Trying to free ramdisk memory ... "); 95 printk(KERN_NOTICE "Trying to free ramdisk memory ... ");
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 17a1189f1ff8..6be273851144 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -68,6 +68,7 @@
68#include <linux/personality.h> 68#include <linux/personality.h>
69#include <linux/sysctl.h> 69#include <linux/sysctl.h>
70#include <linux/audit.h> 70#include <linux/audit.h>
71#include <linux/string.h>
71 72
72#include "avc.h" 73#include "avc.h"
73#include "objsec.h" 74#include "objsec.h"
@@ -1943,7 +1944,7 @@ static int selinux_sb_copy_data(struct file_system_type *type, void *orig, void
1943 } 1944 }
1944 } while (*in_end++); 1945 } while (*in_end++);
1945 1946
1946 copy_page(in_save, nosec_save); 1947 strcpy(in_save, nosec_save);
1947 free_page((unsigned long)nosec_save); 1948 free_page((unsigned long)nosec_save);
1948out: 1949out:
1949 return rc; 1950 return rc;