aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2008-01-23 18:07:21 -0500
committerPaul Mackerras <paulus@samba.org>2008-01-23 18:07:21 -0500
commit9156ad48338e0306e508ead5c0d9986050744475 (patch)
tree37f3a90e38190052ecf3cdf9171dfdddd37b56fd /arch
parentfa28237cfcc5827553044cbd6ee52e33692b0faa (diff)
parent8f7b3d156d348b6766833cd4e272d0d19b501e64 (diff)
Merge branch 'linux-2.6'
Diffstat (limited to 'arch')
-rw-r--r--arch/.gitignore2
-rw-r--r--arch/alpha/math-emu/math.c2
-rw-r--r--arch/arm/Kconfig4
-rw-r--r--arch/arm/Kconfig.instrumentation52
-rw-r--r--arch/arm/mach-at91/board-ek.c9
-rw-r--r--arch/arm/mach-omap1/board-fsample.c14
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c4
-rw-r--r--arch/arm/mach-omap1/board-perseus2.c14
-rw-r--r--arch/arm/mach-pxa/pxa25x.c13
-rw-r--r--arch/arm/mach-pxa/sleep.S6
-rw-r--r--arch/arm/vfp/vfp.h2
-rw-r--r--arch/arm/vfp/vfpdouble.c14
-rw-r--r--arch/blackfin/Kconfig4
-rw-r--r--arch/cris/arch-v10/drivers/ds1302.c131
-rw-r--r--arch/cris/arch-v10/kernel/io_interface_mux.c1
-rw-r--r--arch/cris/arch-v10/kernel/signal.c251
-rw-r--r--arch/cris/arch-v10/kernel/time.c1
-rw-r--r--arch/cris/arch-v10/vmlinux.lds.S33
-rw-r--r--arch/ia64/kernel/unaligned.c11
-rw-r--r--arch/ia64/sn/kernel/xp_nofault.S10
-rw-r--r--arch/mips/Kconfig6
-rw-r--r--arch/mips/au1000/common/pci.c8
-rw-r--r--arch/mips/cobalt/console.c5
-rw-r--r--arch/mips/kernel/head.S3
-rw-r--r--arch/mips/kernel/setup.c7
-rw-r--r--arch/mips/kernel/time.c4
-rw-r--r--arch/mips/lasat/image/Makefile6
-rw-r--r--arch/mips/mips-boards/generic/memory.c2
-rw-r--r--arch/mips/mips-boards/generic/reset.c10
-rw-r--r--arch/mips/mips-boards/malta/malta_setup.c2
-rw-r--r--arch/mips/mm/dma-default.c2
-rw-r--r--arch/mips/pci/fixup-cobalt.c2
-rw-r--r--arch/mips/pci/ops-au1000.c53
-rw-r--r--arch/mips/pci/ops-mace.c7
-rw-r--r--arch/mips/pci/pci-ip32.c4
-rw-r--r--arch/mips/philips/pnx8550/common/time.c109
-rw-r--r--arch/mips/sgi-ip32/ip32-irq.c1
-rw-r--r--arch/mips/sgi-ip32/ip32-platform.c20
-rw-r--r--arch/mips/tx4938/toshiba_rbtx4938/setup.c4
-rw-r--r--arch/powerpc/boot/flatdevtree_env.h2
-rw-r--r--arch/powerpc/kernel/iommu.c17
-rw-r--r--arch/powerpc/kernel/prom_init.c39
-rw-r--r--arch/powerpc/mm/slb.c2
-rw-r--r--arch/powerpc/platforms/cell/Kconfig5
-rw-r--r--arch/powerpc/platforms/cell/Makefile1
-rw-r--r--arch/powerpc/platforms/cell/spu_notify.c67
-rw-r--r--arch/powerpc/platforms/cell/spu_syscalls.c14
-rw-r--r--arch/powerpc/platforms/cell/spufs/context.c16
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c26
-rw-r--r--arch/powerpc/platforms/cell/spufs/syscalls.c1
-rw-r--r--arch/powerpc/platforms/ps3/os-area.c40
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-cpu.c2
-rw-r--r--arch/sparc/kernel/ptrace.c2
-rw-r--r--arch/sparc/kernel/time.c9
-rw-r--r--arch/sparc64/kernel/ktlb.S6
-rw-r--r--arch/sparc64/kernel/pci.c16
-rw-r--r--arch/sparc64/kernel/pci_schizo.c2
-rw-r--r--arch/sparc64/kernel/sun4v_tlb_miss.S2
-rw-r--r--arch/sparc64/kernel/traps.c4
-rw-r--r--arch/um/drivers/harddog_user.c4
-rw-r--r--arch/x86/kernel/apm_32.c10
-rw-r--r--arch/x86/kernel/head_32.S2
-rw-r--r--arch/x86/kernel/hpet.c2
-rw-r--r--arch/x86/kernel/io_apic_32.c12
-rw-r--r--arch/x86/kernel/mfgpt_32.c15
-rw-r--r--arch/x86/kernel/nmi_32.c9
-rw-r--r--arch/x86/kernel/process_32.c11
-rw-r--r--arch/x86/kernel/process_64.c11
-rw-r--r--arch/x86/kernel/smpboot_64.c4
-rw-r--r--arch/x86/kernel/traps_32.c1
-rw-r--r--arch/x86/kernel/traps_64.c1
-rw-r--r--arch/x86/mm/init_32.c9
-rw-r--r--arch/x86/oprofile/nmi_int.c2
73 files changed, 678 insertions, 521 deletions
diff --git a/arch/.gitignore b/arch/.gitignore
new file mode 100644
index 000000000000..741468920320
--- /dev/null
+++ b/arch/.gitignore
@@ -0,0 +1,2 @@
1i386
2x86_64
diff --git a/arch/alpha/math-emu/math.c b/arch/alpha/math-emu/math.c
index ae79dd970b02..58c2669a1dd4 100644
--- a/arch/alpha/math-emu/math.c
+++ b/arch/alpha/math-emu/math.c
@@ -225,7 +225,7 @@ alpha_fp_emul (unsigned long pc)
225 FP_UNPACK_SP(SB, &vb); 225 FP_UNPACK_SP(SB, &vb);
226 DR_c = DB_c; 226 DR_c = DB_c;
227 DR_s = DB_s; 227 DR_s = DB_s;
228 DR_e = DB_e; 228 DR_e = DB_e + (1024 - 128);
229 DR_f = SB_f << (52 - 23); 229 DR_f = SB_f << (52 - 23);
230 goto pack_d; 230 goto pack_d;
231 } 231 }
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index c4de2d4664d7..a04f507e7f2c 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1072,11 +1072,13 @@ source "drivers/rtc/Kconfig"
1072 1072
1073source "drivers/dma/Kconfig" 1073source "drivers/dma/Kconfig"
1074 1074
1075source "drivers/dca/Kconfig"
1076
1075endmenu 1077endmenu
1076 1078
1077source "fs/Kconfig" 1079source "fs/Kconfig"
1078 1080
1079source "kernel/Kconfig.instrumentation" 1081source "arch/arm/Kconfig.instrumentation"
1080 1082
1081source "arch/arm/Kconfig.debug" 1083source "arch/arm/Kconfig.debug"
1082 1084
diff --git a/arch/arm/Kconfig.instrumentation b/arch/arm/Kconfig.instrumentation
new file mode 100644
index 000000000000..63b8c6d5606a
--- /dev/null
+++ b/arch/arm/Kconfig.instrumentation
@@ -0,0 +1,52 @@
1menuconfig INSTRUMENTATION
2 bool "Instrumentation Support"
3 default y
4 ---help---
5 Say Y here to get to see options related to performance measurement,
6 system-wide debugging, and testing. This option alone does not add any
7 kernel code.
8
9 If you say N, all options in this submenu will be skipped and
10 disabled. If you're trying to debug the kernel itself, go see the
11 Kernel Hacking menu.
12
13if INSTRUMENTATION
14
15config PROFILING
16 bool "Profiling support (EXPERIMENTAL)"
17 help
18 Say Y here to enable the extended profiling support mechanisms used
19 by profilers such as OProfile.
20
21config OPROFILE
22 tristate "OProfile system profiling (EXPERIMENTAL)"
23 depends on PROFILING && !UML
24 help
25 OProfile is a profiling system capable of profiling the
26 whole system, include the kernel, kernel modules, libraries,
27 and applications.
28
29 If unsure, say N.
30
31config OPROFILE_ARMV6
32 bool
33 depends on OPROFILE && CPU_V6 && !SMP
34 default y
35 select OPROFILE_ARM11_CORE
36
37config OPROFILE_MPCORE
38 bool
39 depends on OPROFILE && CPU_V6 && SMP
40 default y
41 select OPROFILE_ARM11_CORE
42
43config OPROFILE_ARM11_CORE
44 bool
45
46config MARKERS
47 bool "Activate markers"
48 help
49 Place an empty function call at each marker site. Can be
50 dynamically changed for a probe function.
51
52endif # INSTRUMENTATION
diff --git a/arch/arm/mach-at91/board-ek.c b/arch/arm/mach-at91/board-ek.c
index d05b1b2be9fb..53a5ef9e72ee 100644
--- a/arch/arm/mach-at91/board-ek.c
+++ b/arch/arm/mach-at91/board-ek.c
@@ -109,6 +109,15 @@ static struct spi_board_info ek_spi_devices[] = {
109#endif 109#endif
110}; 110};
111 111
112static struct i2c_board_info __initdata ek_i2c_devices[] = {
113 {
114 I2C_BOARD_INFO("ics1523", 0x26),
115 },
116 {
117 I2C_BOARD_INFO("dac3550", 0x4d),
118 }
119};
120
112#define EK_FLASH_BASE AT91_CHIPSELECT_0 121#define EK_FLASH_BASE AT91_CHIPSELECT_0
113#define EK_FLASH_SIZE 0x200000 122#define EK_FLASH_SIZE 0x200000
114 123
diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c
index f65baa95986e..d5f6ea14fc7b 100644
--- a/arch/arm/mach-omap1/board-fsample.c
+++ b/arch/arm/mach-omap1/board-fsample.c
@@ -40,31 +40,29 @@ static int fsample_keymap[] = {
40 KEY(0,1,KEY_RIGHT), 40 KEY(0,1,KEY_RIGHT),
41 KEY(0,2,KEY_LEFT), 41 KEY(0,2,KEY_LEFT),
42 KEY(0,3,KEY_DOWN), 42 KEY(0,3,KEY_DOWN),
43 KEY(0,4,KEY_CENTER), 43 KEY(0,4,KEY_ENTER),
44 KEY(0,5,KEY_0_5), 44 KEY(1,0,KEY_F10),
45 KEY(1,0,KEY_SOFT2),
46 KEY(1,1,KEY_SEND), 45 KEY(1,1,KEY_SEND),
47 KEY(1,2,KEY_END), 46 KEY(1,2,KEY_END),
48 KEY(1,3,KEY_VOLUMEDOWN), 47 KEY(1,3,KEY_VOLUMEDOWN),
49 KEY(1,4,KEY_VOLUMEUP), 48 KEY(1,4,KEY_VOLUMEUP),
50 KEY(1,5,KEY_RECORD), 49 KEY(1,5,KEY_RECORD),
51 KEY(2,0,KEY_SOFT1), 50 KEY(2,0,KEY_F9),
52 KEY(2,1,KEY_3), 51 KEY(2,1,KEY_3),
53 KEY(2,2,KEY_6), 52 KEY(2,2,KEY_6),
54 KEY(2,3,KEY_9), 53 KEY(2,3,KEY_9),
55 KEY(2,4,KEY_SHARP), 54 KEY(2,4,KEY_KPDOT),
56 KEY(2,5,KEY_2_5),
57 KEY(3,0,KEY_BACK), 55 KEY(3,0,KEY_BACK),
58 KEY(3,1,KEY_2), 56 KEY(3,1,KEY_2),
59 KEY(3,2,KEY_5), 57 KEY(3,2,KEY_5),
60 KEY(3,3,KEY_8), 58 KEY(3,3,KEY_8),
61 KEY(3,4,KEY_0), 59 KEY(3,4,KEY_0),
62 KEY(3,5,KEY_HEADSETHOOK), 60 KEY(3,5,KEY_KPSLASH),
63 KEY(4,0,KEY_HOME), 61 KEY(4,0,KEY_HOME),
64 KEY(4,1,KEY_1), 62 KEY(4,1,KEY_1),
65 KEY(4,2,KEY_4), 63 KEY(4,2,KEY_4),
66 KEY(4,3,KEY_7), 64 KEY(4,3,KEY_7),
67 KEY(4,4,KEY_STAR), 65 KEY(4,4,KEY_KPASTERISK),
68 KEY(4,5,KEY_POWER), 66 KEY(4,5,KEY_POWER),
69 0 67 0
70}; 68};
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 22db19a53647..182a98a9df4c 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -36,8 +36,6 @@
36#include <asm/arch/omapfb.h> 36#include <asm/arch/omapfb.h>
37#include <asm/arch/lcd_mipid.h> 37#include <asm/arch/lcd_mipid.h>
38 38
39#include "../plat-omap/dsp/dsp_common.h"
40
41#define ADS7846_PENDOWN_GPIO 15 39#define ADS7846_PENDOWN_GPIO 15
42 40
43static void __init omap_nokia770_init_irq(void) 41static void __init omap_nokia770_init_irq(void)
@@ -318,6 +316,8 @@ static __init int omap_dsp_init(void)
318 out: 316 out:
319 return ret; 317 return ret;
320} 318}
319#else
320#define omap_dsp_init() do {} while (0)
321#endif /* CONFIG_OMAP_DSP */ 321#endif /* CONFIG_OMAP_DSP */
322 322
323static void __init omap_nokia770_init(void) 323static void __init omap_nokia770_init(void)
diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c
index 1d5c8d509722..e44437e10eef 100644
--- a/arch/arm/mach-omap1/board-perseus2.c
+++ b/arch/arm/mach-omap1/board-perseus2.c
@@ -39,31 +39,29 @@ static int p2_keymap[] = {
39 KEY(0,1,KEY_RIGHT), 39 KEY(0,1,KEY_RIGHT),
40 KEY(0,2,KEY_LEFT), 40 KEY(0,2,KEY_LEFT),
41 KEY(0,3,KEY_DOWN), 41 KEY(0,3,KEY_DOWN),
42 KEY(0,4,KEY_CENTER), 42 KEY(0,4,KEY_ENTER),
43 KEY(0,5,KEY_0_5), 43 KEY(1,0,KEY_F10),
44 KEY(1,0,KEY_SOFT2),
45 KEY(1,1,KEY_SEND), 44 KEY(1,1,KEY_SEND),
46 KEY(1,2,KEY_END), 45 KEY(1,2,KEY_END),
47 KEY(1,3,KEY_VOLUMEDOWN), 46 KEY(1,3,KEY_VOLUMEDOWN),
48 KEY(1,4,KEY_VOLUMEUP), 47 KEY(1,4,KEY_VOLUMEUP),
49 KEY(1,5,KEY_RECORD), 48 KEY(1,5,KEY_RECORD),
50 KEY(2,0,KEY_SOFT1), 49 KEY(2,0,KEY_F9),
51 KEY(2,1,KEY_3), 50 KEY(2,1,KEY_3),
52 KEY(2,2,KEY_6), 51 KEY(2,2,KEY_6),
53 KEY(2,3,KEY_9), 52 KEY(2,3,KEY_9),
54 KEY(2,4,KEY_SHARP), 53 KEY(2,4,KEY_KPDOT),
55 KEY(2,5,KEY_2_5),
56 KEY(3,0,KEY_BACK), 54 KEY(3,0,KEY_BACK),
57 KEY(3,1,KEY_2), 55 KEY(3,1,KEY_2),
58 KEY(3,2,KEY_5), 56 KEY(3,2,KEY_5),
59 KEY(3,3,KEY_8), 57 KEY(3,3,KEY_8),
60 KEY(3,4,KEY_0), 58 KEY(3,4,KEY_0),
61 KEY(3,5,KEY_HEADSETHOOK), 59 KEY(3,5,KEY_KPSLASH),
62 KEY(4,0,KEY_HOME), 60 KEY(4,0,KEY_HOME),
63 KEY(4,1,KEY_1), 61 KEY(4,1,KEY_1),
64 KEY(4,2,KEY_4), 62 KEY(4,2,KEY_4),
65 KEY(4,3,KEY_7), 63 KEY(4,3,KEY_7),
66 KEY(4,4,KEY_STAR), 64 KEY(4,4,KEY_KPASTERISK),
67 KEY(4,5,KEY_POWER), 65 KEY(4,5,KEY_POWER),
68 0 66 0
69}; 67};
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index dcd81f8d0833..9732d5d9466b 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -178,13 +178,19 @@ static void pxa25x_cpu_pm_save(unsigned long *sleep_save)
178 SAVE(GAFR1_L); SAVE(GAFR1_U); 178 SAVE(GAFR1_L); SAVE(GAFR1_U);
179 SAVE(GAFR2_L); SAVE(GAFR2_U); 179 SAVE(GAFR2_L); SAVE(GAFR2_U);
180 180
181 SAVE(ICMR); 181 SAVE(ICMR); ICMR = 0;
182 SAVE(CKEN); 182 SAVE(CKEN);
183 SAVE(PSTR); 183 SAVE(PSTR);
184
185 /* Clear GPIO transition detect bits */
186 GEDR0 = GEDR0; GEDR1 = GEDR1; GEDR2 = GEDR2;
184} 187}
185 188
186static void pxa25x_cpu_pm_restore(unsigned long *sleep_save) 189static void pxa25x_cpu_pm_restore(unsigned long *sleep_save)
187{ 190{
191 /* ensure not to come back here if it wasn't intended */
192 PSPR = 0;
193
188 /* restore registers */ 194 /* restore registers */
189 RESTORE_GPLEVEL(0); RESTORE_GPLEVEL(1); RESTORE_GPLEVEL(2); 195 RESTORE_GPLEVEL(0); RESTORE_GPLEVEL(1); RESTORE_GPLEVEL(2);
190 RESTORE(GPDR0); RESTORE(GPDR1); RESTORE(GPDR2); 196 RESTORE(GPDR0); RESTORE(GPDR1); RESTORE(GPDR2);
@@ -195,7 +201,12 @@ static void pxa25x_cpu_pm_restore(unsigned long *sleep_save)
195 RESTORE(GFER0); RESTORE(GFER1); RESTORE(GFER2); 201 RESTORE(GFER0); RESTORE(GFER1); RESTORE(GFER2);
196 RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2); 202 RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2);
197 203
204 PSSR = PSSR_RDH | PSSR_PH;
205
198 RESTORE(CKEN); 206 RESTORE(CKEN);
207
208 ICLR = 0;
209 ICCR = 1;
199 RESTORE(ICMR); 210 RESTORE(ICMR);
200 RESTORE(PSTR); 211 RESTORE(PSTR);
201} 212}
diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S
index aff71fec618a..d0447723b73a 100644
--- a/arch/arm/mach-pxa/sleep.S
+++ b/arch/arm/mach-pxa/sleep.S
@@ -43,11 +43,11 @@ pxa_cpu_save_cp:
43pxa_cpu_save_sp: 43pxa_cpu_save_sp:
44 @ preserve phys address of stack 44 @ preserve phys address of stack
45 mov r0, sp 45 mov r0, sp
46 mov r2, lr 46 str lr, [sp, #-4]!
47 bl sleep_phys_sp 47 bl sleep_phys_sp
48 ldr r1, =sleep_save_sp 48 ldr r1, =sleep_save_sp
49 str r0, [r1] 49 str r0, [r1]
50 mov pc, r2 50 ldr pc, [sp], #4
51 51
52/* 52/*
53 * pxa27x_cpu_suspend() 53 * pxa27x_cpu_suspend()
@@ -270,5 +270,3 @@ resume_after_mmu:
270 mar acc0, r2, r3 270 mar acc0, r2, r3
271#endif 271#endif
272 ldmfd sp!, {r4 - r12, pc} @ return to caller 272 ldmfd sp!, {r4 - r12, pc} @ return to caller
273
274
diff --git a/arch/arm/vfp/vfp.h b/arch/arm/vfp/vfp.h
index 54a2ad6d9ca2..791d0238c68f 100644
--- a/arch/arm/vfp/vfp.h
+++ b/arch/arm/vfp/vfp.h
@@ -361,10 +361,12 @@ u32 vfp_estimate_sqrt_significand(u32 exponent, u32 significand);
361 * OP_SCALAR - this operation always operates in scalar mode 361 * OP_SCALAR - this operation always operates in scalar mode
362 * OP_SD - the instruction exceptionally writes to a single precision result. 362 * OP_SD - the instruction exceptionally writes to a single precision result.
363 * OP_DD - the instruction exceptionally writes to a double precision result. 363 * OP_DD - the instruction exceptionally writes to a double precision result.
364 * OP_SM - the instruction exceptionally reads from a single precision operand.
364 */ 365 */
365#define OP_SCALAR (1 << 0) 366#define OP_SCALAR (1 << 0)
366#define OP_SD (1 << 1) 367#define OP_SD (1 << 1)
367#define OP_DD (1 << 1) 368#define OP_DD (1 << 1)
369#define OP_SM (1 << 2)
368 370
369struct op { 371struct op {
370 u32 (* const fn)(int dd, int dn, int dm, u32 fpscr); 372 u32 (* const fn)(int dd, int dn, int dm, u32 fpscr);
diff --git a/arch/arm/vfp/vfpdouble.c b/arch/arm/vfp/vfpdouble.c
index 190a09ad18eb..6cac43bd1d86 100644
--- a/arch/arm/vfp/vfpdouble.c
+++ b/arch/arm/vfp/vfpdouble.c
@@ -668,8 +668,8 @@ static struct op fops_ext[32] = {
668 [FEXT_TO_IDX(FEXT_FCMPZ)] = { vfp_double_fcmpz, OP_SCALAR }, 668 [FEXT_TO_IDX(FEXT_FCMPZ)] = { vfp_double_fcmpz, OP_SCALAR },
669 [FEXT_TO_IDX(FEXT_FCMPEZ)] = { vfp_double_fcmpez, OP_SCALAR }, 669 [FEXT_TO_IDX(FEXT_FCMPEZ)] = { vfp_double_fcmpez, OP_SCALAR },
670 [FEXT_TO_IDX(FEXT_FCVT)] = { vfp_double_fcvts, OP_SCALAR|OP_SD }, 670 [FEXT_TO_IDX(FEXT_FCVT)] = { vfp_double_fcvts, OP_SCALAR|OP_SD },
671 [FEXT_TO_IDX(FEXT_FUITO)] = { vfp_double_fuito, OP_SCALAR }, 671 [FEXT_TO_IDX(FEXT_FUITO)] = { vfp_double_fuito, OP_SCALAR|OP_SM },
672 [FEXT_TO_IDX(FEXT_FSITO)] = { vfp_double_fsito, OP_SCALAR }, 672 [FEXT_TO_IDX(FEXT_FSITO)] = { vfp_double_fsito, OP_SCALAR|OP_SM },
673 [FEXT_TO_IDX(FEXT_FTOUI)] = { vfp_double_ftoui, OP_SCALAR|OP_SD }, 673 [FEXT_TO_IDX(FEXT_FTOUI)] = { vfp_double_ftoui, OP_SCALAR|OP_SD },
674 [FEXT_TO_IDX(FEXT_FTOUIZ)] = { vfp_double_ftouiz, OP_SCALAR|OP_SD }, 674 [FEXT_TO_IDX(FEXT_FTOUIZ)] = { vfp_double_ftouiz, OP_SCALAR|OP_SD },
675 [FEXT_TO_IDX(FEXT_FTOSI)] = { vfp_double_ftosi, OP_SCALAR|OP_SD }, 675 [FEXT_TO_IDX(FEXT_FTOSI)] = { vfp_double_ftosi, OP_SCALAR|OP_SD },
@@ -1128,7 +1128,7 @@ u32 vfp_double_cpdo(u32 inst, u32 fpscr)
1128 u32 exceptions = 0; 1128 u32 exceptions = 0;
1129 unsigned int dest; 1129 unsigned int dest;
1130 unsigned int dn = vfp_get_dn(inst); 1130 unsigned int dn = vfp_get_dn(inst);
1131 unsigned int dm = vfp_get_dm(inst); 1131 unsigned int dm;
1132 unsigned int vecitr, veclen, vecstride; 1132 unsigned int vecitr, veclen, vecstride;
1133 struct op *fop; 1133 struct op *fop;
1134 1134
@@ -1146,6 +1146,14 @@ u32 vfp_double_cpdo(u32 inst, u32 fpscr)
1146 dest = vfp_get_dd(inst); 1146 dest = vfp_get_dd(inst);
1147 1147
1148 /* 1148 /*
1149 * f[us]ito takes a sN operand, not a dN operand.
1150 */
1151 if (fop->flags & OP_SM)
1152 dm = vfp_get_sm(inst);
1153 else
1154 dm = vfp_get_dm(inst);
1155
1156 /*
1149 * If destination bank is zero, vector length is always '1'. 1157 * If destination bank is zero, vector length is always '1'.
1150 * ARM DDI0100F C5.1.3, C5.3.2. 1158 * ARM DDI0100F C5.1.3, C5.3.2.
1151 */ 1159 */
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 2a3a7ea5958c..25232ba08119 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -65,6 +65,10 @@ config GENERIC_CALIBRATE_DELAY
65 bool 65 bool
66 default y 66 default y
67 67
68config HARDWARE_PM
69 def_bool y
70 depends on OPROFILE
71
68source "init/Kconfig" 72source "init/Kconfig"
69source "kernel/Kconfig.preempt" 73source "kernel/Kconfig.preempt"
70 74
diff --git a/arch/cris/arch-v10/drivers/ds1302.c b/arch/cris/arch-v10/drivers/ds1302.c
index 88eff7f54ea6..1d1936a18133 100644
--- a/arch/cris/arch-v10/drivers/ds1302.c
+++ b/arch/cris/arch-v10/drivers/ds1302.c
@@ -6,136 +6,9 @@
6*! 6*!
7*! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_init 7*! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_init
8*! 8*!
9*! $Log: ds1302.c,v $
10*! Revision 1.18 2005/01/24 09:11:26 mikaelam
11*! Minor changes to get DS1302 RTC chip driver to work
12*!
13*! Revision 1.17 2005/01/05 06:11:22 starvik
14*! No need to do local_irq_disable after local_irq_save.
15*!
16*! Revision 1.16 2004/12/13 12:21:52 starvik
17*! Added I/O and DMA allocators from Linux 2.4
18*!
19*! Revision 1.14 2004/08/24 06:48:43 starvik
20*! Whitespace cleanup
21*!
22*! Revision 1.13 2004/05/28 09:26:59 starvik
23*! Modified I2C initialization to work in 2.6.
24*!
25*! Revision 1.12 2004/05/14 07:58:03 starvik
26*! Merge of changes from 2.4
27*!
28*! Revision 1.10 2004/02/04 09:25:12 starvik
29*! Merge of Linux 2.6.2
30*!
31*! Revision 1.9 2003/07/04 08:27:37 starvik
32*! Merge of Linux 2.5.74
33*!
34*! Revision 1.8 2003/04/09 05:20:47 starvik
35*! Merge of Linux 2.5.67
36*!
37*! Revision 1.6 2003/01/09 14:42:51 starvik
38*! Merge of Linux 2.5.55
39*!
40*! Revision 1.4 2002/12/11 13:13:57 starvik
41*! Added arch/ to v10 specific includes
42*! Added fix from Linux 2.4 in serial.c (flush_to_flip_buffer)
43*!
44*! Revision 1.3 2002/11/20 11:56:10 starvik
45*! Merge of Linux 2.5.48
46*!
47*! Revision 1.2 2002/11/18 13:16:06 starvik
48*! Linux 2.5 port of latest 2.4 drivers
49*!
50*! Revision 1.15 2002/10/11 16:14:33 johana
51*! Added CONFIG_ETRAX_DS1302_TRICKLE_CHARGE and initial setting of the
52*! trcklecharge register.
53*!
54*! Revision 1.14 2002/10/10 12:15:38 magnusmn
55*! Added support for having the RST signal on bit g0
56*!
57*! Revision 1.13 2002/05/29 15:16:08 johana
58*! Removed unused variables.
59*!
60*! Revision 1.12 2002/04/10 15:35:25 johana
61*! Moved probe function closer to init function and marked it __init.
62*!
63*! Revision 1.11 2001/06/14 12:35:52 jonashg
64*! The ATA hack is back. It is unfortunately the only way to set g27 to output.
65*!
66*! Revision 1.9 2001/06/14 10:00:14 jonashg
67*! No need for tempudelay to be inline anymore (had to adjust the usec to
68*! loops conversion because of this to make it slow enough to be a udelay).
69*!
70*! Revision 1.8 2001/06/14 08:06:32 jonashg
71*! Made tempudelay delay usecs (well, just a tad more).
72*!
73*! Revision 1.7 2001/06/13 14:18:11 jonashg
74*! Only allow processes with SYS_TIME capability to set time and charge.
75*!
76*! Revision 1.6 2001/06/12 15:22:07 jonashg
77*! * Made init function __init.
78*! * Parameter to out_byte() is unsigned char.
79*! * The magic number 42 has got a name.
80*! * Removed comment about /proc (nothing is exported there).
81*!
82*! Revision 1.5 2001/06/12 14:35:13 jonashg
83*! Gave the module a name and added it to printk's.
84*!
85*! Revision 1.4 2001/05/31 14:53:40 jonashg
86*! Made tempudelay() inline so that the watchdog doesn't reset (see
87*! function comment).
88*!
89*! Revision 1.3 2001/03/26 16:03:06 bjornw
90*! Needs linux/config.h
91*!
92*! Revision 1.2 2001/03/20 19:42:00 bjornw
93*! Use the ETRAX prefix on the DS1302 options
94*!
95*! Revision 1.1 2001/03/20 09:13:50 magnusmn
96*! Linux 2.4 port
97*!
98*! Revision 1.10 2000/07/05 15:38:23 bjornw
99*! Dont update kernel time when a RTC_SET_TIME is done
100*!
101*! Revision 1.9 2000/03/02 15:42:59 macce
102*! * Hack to make RTC work on all 2100/2400
103*!
104*! Revision 1.8 2000/02/23 16:59:18 torbjore
105*! added setup of R_GEN_CONFIG when RTC is connected to the generic port.
106*!
107*! Revision 1.7 2000/01/17 15:51:43 johana
108*! Added RTC_SET_CHARGE ioctl to enable trickle charger.
109*!
110*! Revision 1.6 1999/10/27 13:19:47 bjornw
111*! Added update_xtime_from_cmos which reads back the updated RTC into the kernel.
112*! /dev/rtc calls it now.
113*!
114*! Revision 1.5 1999/10/27 12:39:37 bjornw
115*! Disabled superuser check. Anyone can now set the time.
116*!
117*! Revision 1.4 1999/09/02 13:27:46 pkj
118*! Added shadow for R_PORT_PB_CONFIG.
119*! Renamed port_g_shadow to port_g_data_shadow.
120*!
121*! Revision 1.3 1999/09/02 08:28:06 pkj
122*! Made it possible to select either port PB or the generic port for the RST
123*! signal line to the DS1302 RTC.
124*! Also make sure the RST bit is configured as output on Port PB (if used).
125*!
126*! Revision 1.2 1999/09/01 14:47:20 bjornw
127*! Added support for /dev/rtc operations with ioctl RD_TIME and SET_TIME to read
128*! and set the date. Register as major 121.
129*!
130*! Revision 1.1 1999/09/01 09:45:29 bjornw
131*! Implemented a DS1302 RTC driver.
132*!
133*!
134*! --------------------------------------------------------------------------- 9*! ---------------------------------------------------------------------------
135*! 10*!
136*! (C) Copyright 1999, 2000, 2001, 2002, 2003, 2004 Axis Communications AB, LUND, SWEDEN 11*! (C) Copyright 1999-2007 Axis Communications AB, LUND, SWEDEN
137*!
138*! $Id: ds1302.c,v 1.18 2005/01/24 09:11:26 mikaelam Exp $
139*! 12*!
140*!***************************************************************************/ 13*!***************************************************************************/
141 14
@@ -156,6 +29,8 @@
156#include <asm/rtc.h> 29#include <asm/rtc.h>
157#include <asm/arch/io_interface_mux.h> 30#include <asm/arch/io_interface_mux.h>
158 31
32#include "i2c.h"
33
159#define RTC_MAJOR_NR 121 /* local major, change later */ 34#define RTC_MAJOR_NR 121 /* local major, change later */
160 35
161static const char ds1302_name[] = "ds1302"; 36static const char ds1302_name[] = "ds1302";
diff --git a/arch/cris/arch-v10/kernel/io_interface_mux.c b/arch/cris/arch-v10/kernel/io_interface_mux.c
index 3a9114e89edf..f3b327d4ed9c 100644
--- a/arch/cris/arch-v10/kernel/io_interface_mux.c
+++ b/arch/cris/arch-v10/kernel/io_interface_mux.c
@@ -392,6 +392,7 @@ int cris_request_io_interface(enum cris_io_interface ioif, const char *device_id
392 if (((interfaces[ioif].gpio_g_in & gpio_in_pins) != interfaces[ioif].gpio_g_in) || 392 if (((interfaces[ioif].gpio_g_in & gpio_in_pins) != interfaces[ioif].gpio_g_in) ||
393 ((interfaces[ioif].gpio_g_out & gpio_out_pins) != interfaces[ioif].gpio_g_out) || 393 ((interfaces[ioif].gpio_g_out & gpio_out_pins) != interfaces[ioif].gpio_g_out) ||
394 ((interfaces[ioif].gpio_b & gpio_pb_pins) != interfaces[ioif].gpio_b)) { 394 ((interfaces[ioif].gpio_b & gpio_pb_pins) != interfaces[ioif].gpio_b)) {
395 local_irq_restore(flags);
395 printk(KERN_CRIT "cris_request_io_interface: Could not get required pins for interface %u\n", 396 printk(KERN_CRIT "cris_request_io_interface: Could not get required pins for interface %u\n",
396 ioif); 397 ioif);
397 return -EBUSY; 398 return -EBUSY;
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c
index 41d4a5f93284..b6be705c2a3e 100644
--- a/arch/cris/arch-v10/kernel/signal.c
+++ b/arch/cris/arch-v10/kernel/signal.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * Ideas also taken from arch/arm. 8 * Ideas also taken from arch/arm.
9 * 9 *
10 * Copyright (C) 2000, 2001 Axis Communications AB 10 * Copyright (C) 2000-2007 Axis Communications AB
11 * 11 *
12 * Authors: Bjorn Wesen (bjornw@axis.com) 12 * Authors: Bjorn Wesen (bjornw@axis.com)
13 * 13 *
@@ -40,84 +40,30 @@
40 */ 40 */
41#define RESTART_CRIS_SYS(regs) regs->r10 = regs->orig_r10; regs->irp -= 2; 41#define RESTART_CRIS_SYS(regs) regs->r10 = regs->orig_r10; regs->irp -= 2;
42 42
43int do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs); 43void do_signal(int canrestart, struct pt_regs *regs);
44 44
45/* 45/*
46 * Atomically swap in the new signal mask, and wait for a signal. Define 46 * Atomically swap in the new signal mask, and wait for a signal. Define
47 * dummy arguments to be able to reach the regs argument. (Note that this 47 * dummy arguments to be able to reach the regs argument. (Note that this
48 * arrangement relies on old_sigset_t occupying one register.) 48 * arrangement relies on old_sigset_t occupying one register.)
49 */ 49 */
50int 50int sys_sigsuspend(old_sigset_t mask, long r11, long r12, long r13, long mof,
51sys_sigsuspend(old_sigset_t mask, long r11, long r12, long r13, long mof, 51 long srp, struct pt_regs *regs)
52 long srp, struct pt_regs *regs)
53{ 52{
54 sigset_t saveset;
55
56 mask &= _BLOCKABLE; 53 mask &= _BLOCKABLE;
57 spin_lock_irq(&current->sighand->siglock); 54 spin_lock_irq(&current->sighand->siglock);
58 saveset = current->blocked; 55 current->saved_sigmask = current->blocked;
59 siginitset(&current->blocked, mask); 56 siginitset(&current->blocked, mask);
60 recalc_sigpending(); 57 recalc_sigpending();
61 spin_unlock_irq(&current->sighand->siglock); 58 spin_unlock_irq(&current->sighand->siglock);
62 59 current->state = TASK_INTERRUPTIBLE;
63 regs->r10 = -EINTR; 60 schedule();
64 while (1) { 61 set_thread_flag(TIF_RESTORE_SIGMASK);
65 current->state = TASK_INTERRUPTIBLE; 62 return -ERESTARTNOHAND;
66 schedule();
67 if (do_signal(0, &saveset, regs))
68 /* We will get here twice: once to call the signal
69 handler, then again to return from the
70 sigsuspend system call. When calling the
71 signal handler, R10 holds the signal number as
72 set through do_signal. The sigsuspend call
73 will return with the restored value set above;
74 always -EINTR. */
75 return regs->r10;
76 }
77} 63}
78 64
79/* Define dummy arguments to be able to reach the regs argument. (Note that 65int sys_sigaction(int sig, const struct old_sigaction __user *act,
80 * this arrangement relies on size_t occupying one register.) 66 struct old_sigaction *oact)
81 */
82int
83sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, long r12, long r13,
84 long mof, long srp, struct pt_regs *regs)
85{
86 sigset_t saveset, newset;
87
88 /* XXX: Don't preclude handling different sized sigset_t's. */
89 if (sigsetsize != sizeof(sigset_t))
90 return -EINVAL;
91
92 if (copy_from_user(&newset, unewset, sizeof(newset)))
93 return -EFAULT;
94 sigdelsetmask(&newset, ~_BLOCKABLE);
95
96 spin_lock_irq(&current->sighand->siglock);
97 saveset = current->blocked;
98 current->blocked = newset;
99 recalc_sigpending();
100 spin_unlock_irq(&current->sighand->siglock);
101
102 regs->r10 = -EINTR;
103 while (1) {
104 current->state = TASK_INTERRUPTIBLE;
105 schedule();
106 if (do_signal(0, &saveset, regs))
107 /* We will get here twice: once to call the signal
108 handler, then again to return from the
109 sigsuspend system call. When calling the
110 signal handler, R10 holds the signal number as
111 set through do_signal. The sigsuspend call
112 will return with the restored value set above;
113 always -EINTR. */
114 return regs->r10;
115 }
116}
117
118int
119sys_sigaction(int sig, const struct old_sigaction __user *act,
120 struct old_sigaction *oact)
121{ 67{
122 struct k_sigaction new_ka, old_ka; 68 struct k_sigaction new_ka, old_ka;
123 int ret; 69 int ret;
@@ -147,8 +93,7 @@ sys_sigaction(int sig, const struct old_sigaction __user *act,
147 return ret; 93 return ret;
148} 94}
149 95
150int 96int sys_sigaltstack(const stack_t *uss, stack_t __user *uoss)
151sys_sigaltstack(const stack_t *uss, stack_t __user *uoss)
152{ 97{
153 return do_sigaltstack(uss, uoss, rdusp()); 98 return do_sigaltstack(uss, uoss, rdusp());
154} 99}
@@ -205,7 +150,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
205 150
206 /* TODO: the other ports use regs->orig_XX to disable syscall checks 151 /* TODO: the other ports use regs->orig_XX to disable syscall checks
207 * after this completes, but we don't use that mechanism. maybe we can 152 * after this completes, but we don't use that mechanism. maybe we can
208 * use it now ? 153 * use it now ?
209 */ 154 */
210 155
211 return err; 156 return err;
@@ -216,7 +161,7 @@ badframe:
216 161
217/* Define dummy arguments to be able to reach the regs argument. */ 162/* Define dummy arguments to be able to reach the regs argument. */
218 163
219asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof, 164asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof,
220 long srp, struct pt_regs *regs) 165 long srp, struct pt_regs *regs)
221{ 166{
222 struct sigframe __user *frame = (struct sigframe *)rdusp(); 167 struct sigframe __user *frame = (struct sigframe *)rdusp();
@@ -243,7 +188,7 @@ asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof,
243 current->blocked = set; 188 current->blocked = set;
244 recalc_sigpending(); 189 recalc_sigpending();
245 spin_unlock_irq(&current->sighand->siglock); 190 spin_unlock_irq(&current->sighand->siglock);
246 191
247 if (restore_sigcontext(regs, &frame->sc)) 192 if (restore_sigcontext(regs, &frame->sc))
248 goto badframe; 193 goto badframe;
249 194
@@ -254,11 +199,11 @@ asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof,
254badframe: 199badframe:
255 force_sig(SIGSEGV, current); 200 force_sig(SIGSEGV, current);
256 return 0; 201 return 0;
257} 202}
258 203
259/* Define dummy arguments to be able to reach the regs argument. */ 204/* Define dummy arguments to be able to reach the regs argument. */
260 205
261asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13, 206asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13,
262 long mof, long srp, struct pt_regs *regs) 207 long mof, long srp, struct pt_regs *regs)
263{ 208{
264 struct rt_sigframe __user *frame = (struct rt_sigframe *)rdusp(); 209 struct rt_sigframe __user *frame = (struct rt_sigframe *)rdusp();
@@ -282,7 +227,7 @@ asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13,
282 current->blocked = set; 227 current->blocked = set;
283 recalc_sigpending(); 228 recalc_sigpending();
284 spin_unlock_irq(&current->sighand->siglock); 229 spin_unlock_irq(&current->sighand->siglock);
285 230
286 if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) 231 if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
287 goto badframe; 232 goto badframe;
288 233
@@ -294,14 +239,14 @@ asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13,
294badframe: 239badframe:
295 force_sig(SIGSEGV, current); 240 force_sig(SIGSEGV, current);
296 return 0; 241 return 0;
297} 242}
298 243
299/* 244/*
300 * Set up a signal frame. 245 * Set up a signal frame.
301 */ 246 */
302 247
303static int 248static int setup_sigcontext(struct sigcontext __user *sc,
304setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, unsigned long mask) 249 struct pt_regs *regs, unsigned long mask)
305{ 250{
306 int err = 0; 251 int err = 0;
307 unsigned long usp = rdusp(); 252 unsigned long usp = rdusp();
@@ -324,10 +269,11 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, unsigned lo
324 return err; 269 return err;
325} 270}
326 271
327/* figure out where we want to put the new signal frame - usually on the stack */ 272/* Figure out where we want to put the new signal frame
273 * - usually on the stack. */
328 274
329static inline void __user * 275static inline void __user *
330get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size) 276get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
331{ 277{
332 unsigned long sp = rdusp(); 278 unsigned long sp = rdusp();
333 279
@@ -345,15 +291,15 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
345} 291}
346 292
347/* grab and setup a signal frame. 293/* grab and setup a signal frame.
348 * 294 *
349 * basically we stack a lot of state info, and arrange for the 295 * basically we stack a lot of state info, and arrange for the
350 * user-mode program to return to the kernel using either a 296 * user-mode program to return to the kernel using either a
351 * trampoline which performs the syscall sigreturn, or a provided 297 * trampoline which performs the syscall sigreturn, or a provided
352 * user-mode trampoline. 298 * user-mode trampoline.
353 */ 299 */
354 300
355static void setup_frame(int sig, struct k_sigaction *ka, 301static int setup_frame(int sig, struct k_sigaction *ka,
356 sigset_t *set, struct pt_regs * regs) 302 sigset_t *set, struct pt_regs *regs)
357{ 303{
358 struct sigframe __user *frame; 304 struct sigframe __user *frame;
359 unsigned long return_ip; 305 unsigned long return_ip;
@@ -401,14 +347,15 @@ static void setup_frame(int sig, struct k_sigaction *ka,
401 347
402 wrusp((unsigned long)frame); 348 wrusp((unsigned long)frame);
403 349
404 return; 350 return 0;
405 351
406give_sigsegv: 352give_sigsegv:
407 force_sigsegv(sig, current); 353 force_sigsegv(sig, current);
354 return -EFAULT;
408} 355}
409 356
410static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, 357static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
411 sigset_t *set, struct pt_regs * regs) 358 sigset_t *set, struct pt_regs *regs)
412{ 359{
413 struct rt_sigframe __user *frame; 360 struct rt_sigframe __user *frame;
414 unsigned long return_ip; 361 unsigned long return_ip;
@@ -443,9 +390,10 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
443 /* trampoline - the desired return ip is the retcode itself */ 390 /* trampoline - the desired return ip is the retcode itself */
444 return_ip = (unsigned long)&frame->retcode; 391 return_ip = (unsigned long)&frame->retcode;
445 /* This is movu.w __NR_rt_sigreturn, r9; break 13; */ 392 /* This is movu.w __NR_rt_sigreturn, r9; break 13; */
446 err |= __put_user(0x9c5f, (short __user*)(frame->retcode+0)); 393 err |= __put_user(0x9c5f, (short __user *)(frame->retcode+0));
447 err |= __put_user(__NR_rt_sigreturn, (short __user*)(frame->retcode+2)); 394 err |= __put_user(__NR_rt_sigreturn,
448 err |= __put_user(0xe93d, (short __user*)(frame->retcode+4)); 395 (short __user *)(frame->retcode+2));
396 err |= __put_user(0xe93d, (short __user *)(frame->retcode+4));
449 } 397 }
450 398
451 if (err) 399 if (err)
@@ -455,73 +403,81 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
455 403
456 /* Set up registers for signal handler */ 404 /* Set up registers for signal handler */
457 405
458 regs->irp = (unsigned long) ka->sa.sa_handler; /* what we enter NOW */ 406 /* What we enter NOW */
459 regs->srp = return_ip; /* what we enter LATER */ 407 regs->irp = (unsigned long) ka->sa.sa_handler;
460 regs->r10 = sig; /* first argument is signo */ 408 /* What we enter LATER */
461 regs->r11 = (unsigned long) &frame->info; /* second argument is (siginfo_t *) */ 409 regs->srp = return_ip;
462 regs->r12 = 0; /* third argument is unused */ 410 /* First argument is signo */
463 411 regs->r10 = sig;
464 /* actually move the usp to reflect the stacked frame */ 412 /* Second argument is (siginfo_t *) */
465 413 regs->r11 = (unsigned long)&frame->info;
414 /* Third argument is unused */
415 regs->r12 = 0;
416
417 /* Actually move the usp to reflect the stacked frame */
466 wrusp((unsigned long)frame); 418 wrusp((unsigned long)frame);
467 419
468 return; 420 return 0;
469 421
470give_sigsegv: 422give_sigsegv:
471 force_sigsegv(sig, current); 423 force_sigsegv(sig, current);
424 return -EFAULT;
472} 425}
473 426
474/* 427/*
475 * OK, we're invoking a handler 428 * OK, we're invoking a handler
476 */ 429 */
477 430
478static inline void 431static inline int handle_signal(int canrestart, unsigned long sig,
479handle_signal(int canrestart, unsigned long sig, 432 siginfo_t *info, struct k_sigaction *ka,
480 siginfo_t *info, struct k_sigaction *ka, 433 sigset_t *oldset, struct pt_regs *regs)
481 sigset_t *oldset, struct pt_regs * regs)
482{ 434{
435 int ret;
436
483 /* Are we from a system call? */ 437 /* Are we from a system call? */
484 if (canrestart) { 438 if (canrestart) {
485 /* If so, check system call restarting.. */ 439 /* If so, check system call restarting.. */
486 switch (regs->r10) { 440 switch (regs->r10) {
487 case -ERESTART_RESTARTBLOCK: 441 case -ERESTART_RESTARTBLOCK:
488 case -ERESTARTNOHAND: 442 case -ERESTARTNOHAND:
489 /* ERESTARTNOHAND means that the syscall should only be 443 /* ERESTARTNOHAND means that the syscall should
490 restarted if there was no handler for the signal, and since 444 * only be restarted if there was no handler for
491 we only get here if there is a handler, we don't restart */ 445 * the signal, and since we only get here if there
446 * is a handler, we don't restart */
447 regs->r10 = -EINTR;
448 break;
449 case -ERESTARTSYS:
450 /* ERESTARTSYS means to restart the syscall if
451 * there is no handler or the handler was
452 * registered with SA_RESTART */
453 if (!(ka->sa.sa_flags & SA_RESTART)) {
492 regs->r10 = -EINTR; 454 regs->r10 = -EINTR;
493 break; 455 break;
494 456 }
495 case -ERESTARTSYS: 457 /* fallthrough */
496 /* ERESTARTSYS means to restart the syscall if there is no 458 case -ERESTARTNOINTR:
497 handler or the handler was registered with SA_RESTART */ 459 /* ERESTARTNOINTR means that the syscall should
498 if (!(ka->sa.sa_flags & SA_RESTART)) { 460 * be called again after the signal handler returns. */
499 regs->r10 = -EINTR; 461 RESTART_CRIS_SYS(regs);
500 break;
501 }
502 /* fallthrough */
503 case -ERESTARTNOINTR:
504 /* ERESTARTNOINTR means that the syscall should be called again
505 after the signal handler returns. */
506 RESTART_CRIS_SYS(regs);
507 } 462 }
508 } 463 }
509 464
510 /* Set up the stack frame */ 465 /* Set up the stack frame */
511 if (ka->sa.sa_flags & SA_SIGINFO) 466 if (ka->sa.sa_flags & SA_SIGINFO)
512 setup_rt_frame(sig, ka, info, oldset, regs); 467 ret = setup_rt_frame(sig, ka, info, oldset, regs);
513 else 468 else
514 setup_frame(sig, ka, oldset, regs); 469 ret = setup_frame(sig, ka, oldset, regs);
515 470
516 if (ka->sa.sa_flags & SA_ONESHOT) 471 if (ret == 0) {
517 ka->sa.sa_handler = SIG_DFL; 472 spin_lock_irq(&current->sighand->siglock);
518 473 sigorsets(&current->blocked, &current->blocked,
519 spin_lock_irq(&current->sighand->siglock); 474 &ka->sa.sa_mask);
520 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask); 475 if (!(ka->sa.sa_flags & SA_NODEFER))
521 if (!(ka->sa.sa_flags & SA_NODEFER)) 476 sigaddset(&current->blocked, sig);
522 sigaddset(&current->blocked,sig); 477 recalc_sigpending();
523 recalc_sigpending(); 478 spin_unlock_irq(&current->sighand->siglock);
524 spin_unlock_irq(&current->sighand->siglock); 479 }
480 return ret;
525} 481}
526 482
527/* 483/*
@@ -536,11 +492,12 @@ handle_signal(int canrestart, unsigned long sig,
536 * mode below. 492 * mode below.
537 */ 493 */
538 494
539int do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs) 495void do_signal(int canrestart, struct pt_regs *regs)
540{ 496{
541 siginfo_t info; 497 siginfo_t info;
542 int signr; 498 int signr;
543 struct k_sigaction ka; 499 struct k_sigaction ka;
500 sigset_t *oldset;
544 501
545 /* 502 /*
546 * We want the common case to go fast, which 503 * We want the common case to go fast, which
@@ -549,16 +506,26 @@ int do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs)
549 * if so. 506 * if so.
550 */ 507 */
551 if (!user_mode(regs)) 508 if (!user_mode(regs))
552 return 1; 509 return;
553 510
554 if (!oldset) 511 if (test_thread_flag(TIF_RESTORE_SIGMASK))
512 oldset = &current->saved_sigmask;
513 else
555 oldset = &current->blocked; 514 oldset = &current->blocked;
556 515
557 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 516 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
558 if (signr > 0) { 517 if (signr > 0) {
559 /* Whee! Actually deliver the signal. */ 518 /* Whee! Actually deliver the signal. */
560 handle_signal(canrestart, signr, &info, &ka, oldset, regs); 519 if (handle_signal(canrestart, signr, &info, &ka,
561 return 1; 520 oldset, regs)) {
521 /* a signal was successfully delivered; the saved
522 * sigmask will have been stored in the signal frame,
523 * and will be restored by sigreturn, so we can simply
524 * clear the TIF_RESTORE_SIGMASK flag */
525 if (test_thread_flag(TIF_RESTORE_SIGMASK))
526 clear_thread_flag(TIF_RESTORE_SIGMASK);
527 }
528 return;
562 } 529 }
563 530
564 /* Did we come from a system call? */ 531 /* Did we come from a system call? */
@@ -569,10 +536,16 @@ int do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs)
569 regs->r10 == -ERESTARTNOINTR) { 536 regs->r10 == -ERESTARTNOINTR) {
570 RESTART_CRIS_SYS(regs); 537 RESTART_CRIS_SYS(regs);
571 } 538 }
572 if (regs->r10 == -ERESTART_RESTARTBLOCK){ 539 if (regs->r10 == -ERESTART_RESTARTBLOCK) {
573 regs->r10 = __NR_restart_syscall; 540 regs->r10 = __NR_restart_syscall;
574 regs->irp -= 2; 541 regs->irp -= 2;
575 } 542 }
576 } 543 }
577 return 0; 544
545 /* if there's no signal to deliver, we just put the saved sigmask
546 * back */
547 if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
548 clear_thread_flag(TIF_RESTORE_SIGMASK);
549 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
550 }
578} 551}
diff --git a/arch/cris/arch-v10/kernel/time.c b/arch/cris/arch-v10/kernel/time.c
index 5976f6199c47..9310a7b476e9 100644
--- a/arch/cris/arch-v10/kernel/time.c
+++ b/arch/cris/arch-v10/kernel/time.c
@@ -13,6 +13,7 @@
13#include <linux/swap.h> 13#include <linux/swap.h>
14#include <linux/sched.h> 14#include <linux/sched.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/vmstat.h>
16#include <asm/arch/svinto.h> 17#include <asm/arch/svinto.h>
17#include <asm/types.h> 18#include <asm/types.h>
18#include <asm/signal.h> 19#include <asm/signal.h>
diff --git a/arch/cris/arch-v10/vmlinux.lds.S b/arch/cris/arch-v10/vmlinux.lds.S
index 9859d49d088b..97a7876ed681 100644
--- a/arch/cris/arch-v10/vmlinux.lds.S
+++ b/arch/cris/arch-v10/vmlinux.lds.S
@@ -9,7 +9,8 @@
9 */ 9 */
10 10
11#include <asm-generic/vmlinux.lds.h> 11#include <asm-generic/vmlinux.lds.h>
12 12#include <asm/page.h>
13
13jiffies = jiffies_64; 14jiffies = jiffies_64;
14SECTIONS 15SECTIONS
15{ 16{
@@ -23,7 +24,7 @@ SECTIONS
23 _stext = .; 24 _stext = .;
24 __stext = .; 25 __stext = .;
25 .text : { 26 .text : {
26 *(.text) 27 TEXT_TEXT
27 SCHED_TEXT 28 SCHED_TEXT
28 LOCK_TEXT 29 LOCK_TEXT
29 *(.fixup) 30 *(.fixup)
@@ -49,10 +50,10 @@ SECTIONS
49 __edata = . ; /* End of data section */ 50 __edata = . ; /* End of data section */
50 _edata = . ; 51 _edata = . ;
51 52
52 . = ALIGN(8192); /* init_task and stack, must be aligned */ 53 . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned */
53 .data.init_task : { *(.data.init_task) } 54 .data.init_task : { *(.data.init_task) }
54 55
55 . = ALIGN(8192); /* Init code and data */ 56 . = ALIGN(PAGE_SIZE); /* Init code and data */
56 __init_begin = .; 57 __init_begin = .;
57 .init.text : { 58 .init.text : {
58 _sinittext = .; 59 _sinittext = .;
@@ -66,13 +67,7 @@ SECTIONS
66 __setup_end = .; 67 __setup_end = .;
67 .initcall.init : { 68 .initcall.init : {
68 __initcall_start = .; 69 __initcall_start = .;
69 *(.initcall1.init); 70 INITCALLS
70 *(.initcall2.init);
71 *(.initcall3.init);
72 *(.initcall4.init);
73 *(.initcall5.init);
74 *(.initcall6.init);
75 *(.initcall7.init);
76 __initcall_end = .; 71 __initcall_end = .;
77 } 72 }
78 73
@@ -88,16 +83,18 @@ SECTIONS
88 __initramfs_start = .; 83 __initramfs_start = .;
89 *(.init.ramfs) 84 *(.init.ramfs)
90 __initramfs_end = .; 85 __initramfs_end = .;
91 /* We fill to the next page, so we can discard all init
92 pages without needing to consider what payload might be
93 appended to the kernel image. */
94 FILL (0);
95 . = ALIGN (8192);
96 } 86 }
97#endif 87#endif
98
99 __vmlinux_end = .; /* last address of the physical file */ 88 __vmlinux_end = .; /* last address of the physical file */
100 __init_end = .; 89
90 /*
91 * We fill to the next page, so we can discard all init
92 * pages without needing to consider what payload might be
93 * appended to the kernel image.
94 */
95 . = ALIGN(PAGE_SIZE);
96
97 __init_end = .;
101 98
102 __data_end = . ; /* Move to _edata ? */ 99 __data_end = . ; /* Move to _edata ? */
103 __bss_start = .; /* BSS */ 100 __bss_start = .; /* BSS */
diff --git a/arch/ia64/kernel/unaligned.c b/arch/ia64/kernel/unaligned.c
index 2173de9fe917..f6a1aeb742b3 100644
--- a/arch/ia64/kernel/unaligned.c
+++ b/arch/ia64/kernel/unaligned.c
@@ -1488,16 +1488,19 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
1488 case LDFA_OP: 1488 case LDFA_OP:
1489 case LDFCCLR_OP: 1489 case LDFCCLR_OP:
1490 case LDFCNC_OP: 1490 case LDFCNC_OP:
1491 case LDF_IMM_OP:
1492 case LDFA_IMM_OP:
1493 case LDFCCLR_IMM_OP:
1494 case LDFCNC_IMM_OP:
1495 if (u.insn.x) 1491 if (u.insn.x)
1496 ret = emulate_load_floatpair(ifa, u.insn, regs); 1492 ret = emulate_load_floatpair(ifa, u.insn, regs);
1497 else 1493 else
1498 ret = emulate_load_float(ifa, u.insn, regs); 1494 ret = emulate_load_float(ifa, u.insn, regs);
1499 break; 1495 break;
1500 1496
1497 case LDF_IMM_OP:
1498 case LDFA_IMM_OP:
1499 case LDFCCLR_IMM_OP:
1500 case LDFCNC_IMM_OP:
1501 ret = emulate_load_float(ifa, u.insn, regs);
1502 break;
1503
1501 case STF_OP: 1504 case STF_OP:
1502 case STF_IMM_OP: 1505 case STF_IMM_OP:
1503 ret = emulate_store_float(ifa, u.insn, regs); 1506 ret = emulate_store_float(ifa, u.insn, regs);
diff --git a/arch/ia64/sn/kernel/xp_nofault.S b/arch/ia64/sn/kernel/xp_nofault.S
index 54e8973b6e99..98e7c7dbfdd8 100644
--- a/arch/ia64/sn/kernel/xp_nofault.S
+++ b/arch/ia64/sn/kernel/xp_nofault.S
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (c) 2004-2005 Silicon Graphics, Inc. All Rights Reserved. 6 * Copyright (c) 2004-2007 Silicon Graphics, Inc. All Rights Reserved.
7 */ 7 */
8 8
9 9
@@ -14,6 +14,11 @@
14 * PIO read fails, the MCA handler will force the error to look 14 * PIO read fails, the MCA handler will force the error to look
15 * corrected and vector to the xp_error_PIOR which will return an error. 15 * corrected and vector to the xp_error_PIOR which will return an error.
16 * 16 *
17 * The definition of "consumption" and the time it takes for an MCA
18 * to surface is processor implementation specific. This code
19 * is sufficient on Itanium through the Montvale processor family.
20 * It may need to be adjusted for future processor implementations.
21 *
17 * extern int xp_nofault_PIOR(void *remote_register); 22 * extern int xp_nofault_PIOR(void *remote_register);
18 */ 23 */
19 24
@@ -22,11 +27,10 @@ xp_nofault_PIOR:
22 mov r8=r0 // Stage a success return value 27 mov r8=r0 // Stage a success return value
23 ld8.acq r9=[r32];; // PIO Read the specified register 28 ld8.acq r9=[r32];; // PIO Read the specified register
24 adds r9=1,r9;; // Add to force consumption 29 adds r9=1,r9;; // Add to force consumption
25 or r9=r9,r9;; // Or to force consumption 30 srlz.i;; // Allow time for MCA to surface
26 br.ret.sptk.many b0;; // Return success 31 br.ret.sptk.many b0;; // Return success
27 32
28 .global xp_error_PIOR 33 .global xp_error_PIOR
29xp_error_PIOR: 34xp_error_PIOR:
30 mov r8=1 // Return value of 1 35 mov r8=1 // Return value of 1
31 br.ret.sptk.many b0;; // Return failure 36 br.ret.sptk.many b0;; // Return failure
32
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index c6fc405a6c8e..b22c043b6ef8 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -59,6 +59,8 @@ config BCM47XX
59 select SYS_SUPPORTS_LITTLE_ENDIAN 59 select SYS_SUPPORTS_LITTLE_ENDIAN
60 select SSB 60 select SSB
61 select SSB_DRIVER_MIPS 61 select SSB_DRIVER_MIPS
62 select SSB_DRIVER_EXTIF
63 select SSB_PCICORE_HOSTMODE if PCI
62 select GENERIC_GPIO 64 select GENERIC_GPIO
63 select SYS_HAS_EARLY_PRINTK 65 select SYS_HAS_EARLY_PRINTK
64 select CFE 66 select CFE
@@ -992,8 +994,6 @@ config BOOT_ELF64
992 994
993menu "CPU selection" 995menu "CPU selection"
994 996
995source "kernel/time/Kconfig"
996
997choice 997choice
998 prompt "CPU type" 998 prompt "CPU type"
999 default CPU_R4X00 999 default CPU_R4X00
@@ -1768,6 +1768,8 @@ config NR_CPUS
1768 performance should round up your number of processors to the next 1768 performance should round up your number of processors to the next
1769 power of two. 1769 power of two.
1770 1770
1771source "kernel/time/Kconfig"
1772
1771# 1773#
1772# Timer Interrupt Frequency Configuration 1774# Timer Interrupt Frequency Configuration
1773# 1775#
diff --git a/arch/mips/au1000/common/pci.c b/arch/mips/au1000/common/pci.c
index 6fa70a36a250..ce771487567d 100644
--- a/arch/mips/au1000/common/pci.c
+++ b/arch/mips/au1000/common/pci.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * BRIEF MODULE DESCRIPTION 2 * BRIEF MODULE DESCRIPTION
3 * Alchemy/AMD Au1x00 pci support. 3 * Alchemy/AMD Au1x00 PCI support.
4 * 4 *
5 * Copyright 2001,2002,2003 MontaVista Software Inc. 5 * Copyright 2001-2003, 2007 MontaVista Software Inc.
6 * Author: MontaVista Software, Inc. 6 * Author: MontaVista Software, Inc.
7 * ppopov@mvista.com or source@mvista.com 7 * ppopov@mvista.com or source@mvista.com
8 * 8 *
@@ -66,6 +66,8 @@ static unsigned long virt_io_addr;
66 66
67static int __init au1x_pci_setup(void) 67static int __init au1x_pci_setup(void)
68{ 68{
69 extern void au1x_pci_cfg_init(void);
70
69#if defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550) 71#if defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
70 virt_io_addr = (unsigned long)ioremap(Au1500_PCI_IO_START, 72 virt_io_addr = (unsigned long)ioremap(Au1500_PCI_IO_START,
71 Au1500_PCI_IO_END - Au1500_PCI_IO_START + 1); 73 Au1500_PCI_IO_END - Au1500_PCI_IO_START + 1);
@@ -94,6 +96,8 @@ static int __init au1x_pci_setup(void)
94 set_io_port_base(virt_io_addr); 96 set_io_port_base(virt_io_addr);
95#endif 97#endif
96 98
99 au1x_pci_cfg_init();
100
97 register_pci_controller(&au1x_controller); 101 register_pci_controller(&au1x_controller);
98 return 0; 102 return 0;
99} 103}
diff --git a/arch/mips/cobalt/console.c b/arch/mips/cobalt/console.c
index db330e811025..d1ba701c9dd1 100644
--- a/arch/mips/cobalt/console.c
+++ b/arch/mips/cobalt/console.c
@@ -4,10 +4,15 @@
4#include <linux/io.h> 4#include <linux/io.h>
5#include <linux/serial_reg.h> 5#include <linux/serial_reg.h>
6 6
7#include <cobalt.h>
8
7#define UART_BASE ((void __iomem *)CKSEG1ADDR(0x1c800000)) 9#define UART_BASE ((void __iomem *)CKSEG1ADDR(0x1c800000))
8 10
9void prom_putchar(char c) 11void prom_putchar(char c)
10{ 12{
13 if (cobalt_board_id <= COBALT_BRD_ID_QUBE1)
14 return;
15
11 while (!(readb(UART_BASE + UART_LSR) & UART_LSR_THRE)) 16 while (!(readb(UART_BASE + UART_LSR) & UART_LSR_THRE))
12 ; 17 ;
13 18
diff --git a/arch/mips/kernel/head.S b/arch/mips/kernel/head.S
index 236768731063..50be56c9e9ef 100644
--- a/arch/mips/kernel/head.S
+++ b/arch/mips/kernel/head.S
@@ -136,7 +136,8 @@ EXPORT(_stext)
136 * kernel load address. This is needed because this platform does 136 * kernel load address. This is needed because this platform does
137 * not have a ELF loader yet. 137 * not have a ELF loader yet.
138 */ 138 */
139 __INIT 139FEXPORT(__kernel_entry)
140 j kernel_entry
140#endif 141#endif
141 142
142 __INIT_REFOK 143 __INIT_REFOK
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 7f6ddcb5d485..f8a535afce39 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -269,7 +269,7 @@ static void __init bootmem_init(void)
269 269
270static void __init bootmem_init(void) 270static void __init bootmem_init(void)
271{ 271{
272 unsigned long init_begin, reserved_end; 272 unsigned long reserved_end;
273 unsigned long mapstart = ~0UL; 273 unsigned long mapstart = ~0UL;
274 unsigned long bootmap_size; 274 unsigned long bootmap_size;
275 int i; 275 int i;
@@ -344,7 +344,6 @@ static void __init bootmem_init(void)
344 min_low_pfn, max_low_pfn); 344 min_low_pfn, max_low_pfn);
345 345
346 346
347 init_begin = PFN_UP(__pa_symbol(&__init_begin));
348 for (i = 0; i < boot_mem_map.nr_map; i++) { 347 for (i = 0; i < boot_mem_map.nr_map; i++) {
349 unsigned long start, end; 348 unsigned long start, end;
350 349
@@ -352,8 +351,8 @@ static void __init bootmem_init(void)
352 end = PFN_DOWN(boot_mem_map.map[i].addr 351 end = PFN_DOWN(boot_mem_map.map[i].addr
353 + boot_mem_map.map[i].size); 352 + boot_mem_map.map[i].size);
354 353
355 if (start <= init_begin) 354 if (start <= min_low_pfn)
356 start = init_begin; 355 start = min_low_pfn;
357 if (start >= end) 356 if (start >= end)
358 continue; 357 continue;
359 358
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index 1ecfbb7eba6c..2995be1ab3ca 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -147,9 +147,9 @@ static __init int cpu_has_mfc0_count_bug(void)
147 return 1; 147 return 1;
148 148
149 /* 149 /*
150 * I don't have erratas for newer R4400 so be paranoid. 150 * we assume newer revisions are ok
151 */ 151 */
152 return 1; 152 return 0;
153 } 153 }
154 154
155 return 0; 155 return 0;
diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile
index 5332449ec040..460626b6d62f 100644
--- a/arch/mips/lasat/image/Makefile
+++ b/arch/mips/lasat/image/Makefile
@@ -12,11 +12,11 @@ endif
12 12
13MKLASATIMG = mklasatimg 13MKLASATIMG = mklasatimg
14MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200 14MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200
15KERNEL_IMAGE = $(TOPDIR)/vmlinux 15KERNEL_IMAGE = vmlinux
16KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ ) 16KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ )
17KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ ) 17KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ )
18 18
19LDSCRIPT= -L$(obj) -Tromscript.normal 19LDSCRIPT= -L$(srctree)/$(src) -Tromscript.normal
20 20
21HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ 21HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
22 -D_kernel_entry=0x$(KERNEL_ENTRY) \ 22 -D_kernel_entry=0x$(KERNEL_ENTRY) \
@@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
24 -D TIMESTAMP=$(shell date +%s) 24 -D TIMESTAMP=$(shell date +%s)
25 25
26$(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE) 26$(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
27 $(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $< 27 $(CC) -fno-pic $(HEAD_DEFINES) $(LINUXINCLUDE) -c -o $@ $<
28 28
29OBJECTS = head.o kImage.o 29OBJECTS = head.o kImage.o
30 30
diff --git a/arch/mips/mips-boards/generic/memory.c b/arch/mips/mips-boards/generic/memory.c
index 2c5c27c8e86d..dc272c188233 100644
--- a/arch/mips/mips-boards/generic/memory.c
+++ b/arch/mips/mips-boards/generic/memory.c
@@ -169,7 +169,6 @@ void __init prom_meminit(void)
169 169
170void __init prom_free_prom_memory(void) 170void __init prom_free_prom_memory(void)
171{ 171{
172#if 0 /* for now ... */
173 unsigned long addr; 172 unsigned long addr;
174 int i; 173 int i;
175 174
@@ -181,5 +180,4 @@ void __init prom_free_prom_memory(void)
181 free_init_pages("prom memory", 180 free_init_pages("prom memory",
182 addr, addr + boot_mem_map.map[i].size); 181 addr, addr + boot_mem_map.map[i].size);
183 } 182 }
184#endif
185} 183}
diff --git a/arch/mips/mips-boards/generic/reset.c b/arch/mips/mips-boards/generic/reset.c
index 7a1bb51f81ee..583d468d98a9 100644
--- a/arch/mips/mips-boards/generic/reset.c
+++ b/arch/mips/mips-boards/generic/reset.c
@@ -39,16 +39,18 @@ static void atlas_machine_power_off(void);
39 39
40static void mips_machine_restart(char *command) 40static void mips_machine_restart(char *command)
41{ 41{
42 unsigned int __iomem *softres_reg = ioremap(SOFTRES_REG, sizeof(unsigned int)); 42 unsigned int __iomem *softres_reg =
43 ioremap(SOFTRES_REG, sizeof(unsigned int));
43 44
44 writew(GORESET, softres_reg); 45 __raw_writel(GORESET, softres_reg);
45} 46}
46 47
47static void mips_machine_halt(void) 48static void mips_machine_halt(void)
48{ 49{
49 unsigned int __iomem *softres_reg = ioremap(SOFTRES_REG, sizeof(unsigned int)); 50 unsigned int __iomem *softres_reg =
51 ioremap(SOFTRES_REG, sizeof(unsigned int));
50 52
51 writew(GORESET, softres_reg); 53 __raw_writel(GORESET, softres_reg);
52} 54}
53 55
54#if defined(CONFIG_MIPS_ATLAS) 56#if defined(CONFIG_MIPS_ATLAS)
diff --git a/arch/mips/mips-boards/malta/malta_setup.c b/arch/mips/mips-boards/malta/malta_setup.c
index 9a2636e56243..bc43a5c2224d 100644
--- a/arch/mips/mips-boards/malta/malta_setup.c
+++ b/arch/mips/mips-boards/malta/malta_setup.c
@@ -149,7 +149,7 @@ void __init plat_mem_setup(void)
149 /* Check PCI clock */ 149 /* Check PCI clock */
150 { 150 {
151 unsigned int __iomem *jmpr_p = (unsigned int *) ioremap(MALTA_JMPRS_REG, sizeof(unsigned int)); 151 unsigned int __iomem *jmpr_p = (unsigned int *) ioremap(MALTA_JMPRS_REG, sizeof(unsigned int));
152 int jmpr = (readw(jmpr_p) >> 2) & 0x07; 152 int jmpr = (__raw_readl(jmpr_p) >> 2) & 0x07;
153 static const int pciclocks[] __initdata = { 153 static const int pciclocks[] __initdata = {
154 33, 20, 25, 30, 12, 16, 37, 10 154 33, 20, 25, 30, 12, 16, 37, 10
155 }; 155 };
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index ae76795685cc..810535dd091b 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -45,7 +45,7 @@ static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp)
45 /* ignore region specifiers */ 45 /* ignore region specifiers */
46 gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM); 46 gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);
47 47
48#ifdef CONFIG_ZONE_DMA32 48#ifdef CONFIG_ZONE_DMA
49 if (dev == NULL) 49 if (dev == NULL)
50 gfp |= __GFP_DMA; 50 gfp |= __GFP_DMA;
51 else if (dev->coherent_dma_mask < DMA_BIT_MASK(24)) 51 else if (dev->coherent_dma_mask < DMA_BIT_MASK(24))
diff --git a/arch/mips/pci/fixup-cobalt.c b/arch/mips/pci/fixup-cobalt.c
index f7df1142912b..9553b14002dd 100644
--- a/arch/mips/pci/fixup-cobalt.c
+++ b/arch/mips/pci/fixup-cobalt.c
@@ -177,7 +177,7 @@ static char irq_tab_raq2[] __initdata = {
177 177
178int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 178int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
179{ 179{
180 if (cobalt_board_id < COBALT_BRD_ID_QUBE2) 180 if (cobalt_board_id <= COBALT_BRD_ID_QUBE1)
181 return irq_tab_qube1[slot]; 181 return irq_tab_qube1[slot];
182 182
183 if (cobalt_board_id == COBALT_BRD_ID_RAQ2) 183 if (cobalt_board_id == COBALT_BRD_ID_RAQ2)
diff --git a/arch/mips/pci/ops-au1000.c b/arch/mips/pci/ops-au1000.c
index 6b29904acf45..1314bd58f036 100644
--- a/arch/mips/pci/ops-au1000.c
+++ b/arch/mips/pci/ops-au1000.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * BRIEF MODULE DESCRIPTION 2 * BRIEF MODULE DESCRIPTION
3 * Alchemy/AMD Au1x00 pci support. 3 * Alchemy/AMD Au1x00 PCI support.
4 * 4 *
5 * Copyright 2001,2002,2003 MontaVista Software Inc. 5 * Copyright 2001-2003, 2007 MontaVista Software Inc.
6 * Author: MontaVista Software, Inc. 6 * Author: MontaVista Software, Inc.
7 * ppopov@mvista.com or source@mvista.com 7 * ppopov@mvista.com or source@mvista.com
8 * 8 *
@@ -69,10 +69,27 @@ void mod_wired_entry(int entry, unsigned long entrylo0,
69 write_c0_pagemask(old_pagemask); 69 write_c0_pagemask(old_pagemask);
70} 70}
71 71
72struct vm_struct *pci_cfg_vm; 72static struct vm_struct *pci_cfg_vm;
73static int pci_cfg_wired_entry; 73static int pci_cfg_wired_entry;
74static int first_cfg = 1; 74static unsigned long last_entryLo0, last_entryLo1;
75unsigned long last_entryLo0, last_entryLo1; 75
76/*
77 * We can't ioremap the entire pci config space because it's too large.
78 * Nor can we call ioremap dynamically because some device drivers use
79 * the PCI config routines from within interrupt handlers and that
80 * becomes a problem in get_vm_area(). We use one wired TLB to handle
81 * all config accesses for all busses.
82 */
83void __init au1x_pci_cfg_init(void)
84{
85 /* Reserve a wired entry for PCI config accesses */
86 pci_cfg_vm = get_vm_area(0x2000, VM_IOREMAP);
87 if (!pci_cfg_vm)
88 panic(KERN_ERR "PCI unable to get vm area\n");
89 pci_cfg_wired_entry = read_c0_wired();
90 add_wired_entry(0, 0, (unsigned long)pci_cfg_vm->addr, PM_4K);
91 last_entryLo0 = last_entryLo1 = 0xffffffff;
92}
76 93
77static int config_access(unsigned char access_type, struct pci_bus *bus, 94static int config_access(unsigned char access_type, struct pci_bus *bus,
78 unsigned int dev_fn, unsigned char where, 95 unsigned int dev_fn, unsigned char where,
@@ -97,27 +114,6 @@ static int config_access(unsigned char access_type, struct pci_bus *bus,
97 Au1500_PCI_STATCMD); 114 Au1500_PCI_STATCMD);
98 au_sync_udelay(1); 115 au_sync_udelay(1);
99 116
100 /*
101 * We can't ioremap the entire pci config space because it's
102 * too large. Nor can we call ioremap dynamically because some
103 * device drivers use the pci config routines from within
104 * interrupt handlers and that becomes a problem in get_vm_area().
105 * We use one wired tlb to handle all config accesses for all
106 * busses. To improve performance, if the current device
107 * is the same as the last device accessed, we don't touch the
108 * tlb.
109 */
110 if (first_cfg) {
111 /* reserve a wired entry for pci config accesses */
112 first_cfg = 0;
113 pci_cfg_vm = get_vm_area(0x2000, VM_IOREMAP);
114 if (!pci_cfg_vm)
115 panic(KERN_ERR "PCI unable to get vm area\n");
116 pci_cfg_wired_entry = read_c0_wired();
117 add_wired_entry(0, 0, (unsigned long)pci_cfg_vm->addr, PM_4K);
118 last_entryLo0 = last_entryLo1 = 0xffffffff;
119 }
120
121 /* Allow board vendors to implement their own off-chip idsel. 117 /* Allow board vendors to implement their own off-chip idsel.
122 * If it doesn't succeed, may as well bail out at this point. 118 * If it doesn't succeed, may as well bail out at this point.
123 */ 119 */
@@ -144,9 +140,12 @@ static int config_access(unsigned char access_type, struct pci_bus *bus,
144 /* page boundary */ 140 /* page boundary */
145 cfg_base = cfg_base & PAGE_MASK; 141 cfg_base = cfg_base & PAGE_MASK;
146 142
143 /*
144 * To improve performance, if the current device is the same as
145 * the last device accessed, we don't touch the TLB.
146 */
147 entryLo0 = (6 << 26) | (cfg_base >> 6) | (2 << 3) | 7; 147 entryLo0 = (6 << 26) | (cfg_base >> 6) | (2 << 3) | 7;
148 entryLo1 = (6 << 26) | (cfg_base >> 6) | (0x1000 >> 6) | (2 << 3) | 7; 148 entryLo1 = (6 << 26) | (cfg_base >> 6) | (0x1000 >> 6) | (2 << 3) | 7;
149
150 if ((entryLo0 != last_entryLo0) || (entryLo1 != last_entryLo1)) { 149 if ((entryLo0 != last_entryLo0) || (entryLo1 != last_entryLo1)) {
151 mod_wired_entry(pci_cfg_wired_entry, entryLo0, entryLo1, 150 mod_wired_entry(pci_cfg_wired_entry, entryLo0, entryLo1,
152 (unsigned long)pci_cfg_vm->addr, PM_4K); 151 (unsigned long)pci_cfg_vm->addr, PM_4K);
diff --git a/arch/mips/pci/ops-mace.c b/arch/mips/pci/ops-mace.c
index fe5451449304..e95881897ec9 100644
--- a/arch/mips/pci/ops-mace.c
+++ b/arch/mips/pci/ops-mace.c
@@ -42,6 +42,10 @@ static int
42mace_pci_read_config(struct pci_bus *bus, unsigned int devfn, 42mace_pci_read_config(struct pci_bus *bus, unsigned int devfn,
43 int reg, int size, u32 *val) 43 int reg, int size, u32 *val)
44{ 44{
45 u32 control = mace->pci.control;
46
47 /* disable master aborts interrupts during config read */
48 mace->pci.control = control & ~MACEPCI_CONTROL_MAR_INT;
45 mace->pci.config_addr = mkaddr(bus, devfn, reg); 49 mace->pci.config_addr = mkaddr(bus, devfn, reg);
46 switch (size) { 50 switch (size) {
47 case 1: 51 case 1:
@@ -54,6 +58,9 @@ mace_pci_read_config(struct pci_bus *bus, unsigned int devfn,
54 *val = mace->pci.config_data.l; 58 *val = mace->pci.config_data.l;
55 break; 59 break;
56 } 60 }
61 /* ack possible master abort */
62 mace->pci.error &= ~MACEPCI_ERROR_MASTER_ABORT;
63 mace->pci.control = control;
57 64
58 DPRINTK("read%d: reg=%08x,val=%02x\n", size * 8, reg, *val); 65 DPRINTK("read%d: reg=%08x,val=%02x\n", size * 8, reg, *val);
59 66
diff --git a/arch/mips/pci/pci-ip32.c b/arch/mips/pci/pci-ip32.c
index 618ea7dbc474..532b561b4442 100644
--- a/arch/mips/pci/pci-ip32.c
+++ b/arch/mips/pci/pci-ip32.c
@@ -119,6 +119,7 @@ static struct pci_controller mace_pci_controller = {
119 .iommu = 0, 119 .iommu = 0,
120 .mem_offset = MACE_PCI_MEM_OFFSET, 120 .mem_offset = MACE_PCI_MEM_OFFSET,
121 .io_offset = 0, 121 .io_offset = 0,
122 .io_map_base = CKSEG1ADDR(MACEPCI_LOW_IO),
122}; 123};
123 124
124static int __init mace_init(void) 125static int __init mace_init(void)
@@ -135,7 +136,8 @@ static int __init mace_init(void)
135 BUG_ON(request_irq(MACE_PCI_BRIDGE_IRQ, macepci_error, 0, 136 BUG_ON(request_irq(MACE_PCI_BRIDGE_IRQ, macepci_error, 0,
136 "MACE PCI error", NULL)); 137 "MACE PCI error", NULL));
137 138
138 iomem_resource = mace_pci_mem_resource; 139 /* extend memory resources */
140 iomem_resource.end = mace_pci_mem_resource.end;
139 ioport_resource = mace_pci_io_resource; 141 ioport_resource = mace_pci_io_resource;
140 142
141 register_pci_controller(&mace_pci_controller); 143 register_pci_controller(&mace_pci_controller);
diff --git a/arch/mips/philips/pnx8550/common/time.c b/arch/mips/philips/pnx8550/common/time.c
index e818fd0f1584..6d494e0de3d9 100644
--- a/arch/mips/philips/pnx8550/common/time.c
+++ b/arch/mips/philips/pnx8550/common/time.c
@@ -22,7 +22,6 @@
22#include <linux/kernel_stat.h> 22#include <linux/kernel_stat.h>
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/module.h>
26 25
27#include <asm/bootinfo.h> 26#include <asm/bootinfo.h>
28#include <asm/cpu.h> 27#include <asm/cpu.h>
@@ -41,11 +40,60 @@ static cycle_t hpt_read(void)
41 return read_c0_count2(); 40 return read_c0_count2();
42} 41}
43 42
43static struct clocksource pnx_clocksource = {
44 .name = "pnx8xxx",
45 .rating = 200,
46 .read = hpt_read,
47 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
48};
49
44static void timer_ack(void) 50static void timer_ack(void)
45{ 51{
46 write_c0_compare(cpj); 52 write_c0_compare(cpj);
47} 53}
48 54
55static irqreturn_t pnx8xxx_timer_interrupt(int irq, void *dev_id)
56{
57 struct clock_event_device *c = dev_id;
58
59 /* clear MATCH, signal the event */
60 c->event_handler(c);
61
62 return IRQ_HANDLED;
63}
64
65static struct irqaction pnx8xxx_timer_irq = {
66 .handler = pnx8xxx_timer_interrupt,
67 .flags = IRQF_DISABLED | IRQF_PERCPU,
68 .name = "pnx8xxx_timer",
69};
70
71static irqreturn_t monotonic_interrupt(int irq, void *dev_id)
72{
73 /* Timer 2 clear interrupt */
74 write_c0_compare2(-1);
75 return IRQ_HANDLED;
76}
77
78static struct irqaction monotonic_irqaction = {
79 .handler = monotonic_interrupt,
80 .flags = IRQF_DISABLED,
81 .name = "Monotonic timer",
82};
83
84static int pnx8xxx_set_next_event(unsigned long delta,
85 struct clock_event_device *evt)
86{
87 write_c0_compare(delta);
88 return 0;
89}
90
91static struct clock_event_device pnx8xxx_clockevent = {
92 .name = "pnx8xxx_clockevent",
93 .features = CLOCK_EVT_FEAT_ONESHOT,
94 .set_next_event = pnx8xxx_set_next_event,
95};
96
49/* 97/*
50 * plat_time_init() - it does the following things: 98 * plat_time_init() - it does the following things:
51 * 99 *
@@ -58,11 +106,34 @@ static void timer_ack(void)
58 106
59__init void plat_time_init(void) 107__init void plat_time_init(void)
60{ 108{
109 unsigned int configPR;
61 unsigned int n; 110 unsigned int n;
62 unsigned int m; 111 unsigned int m;
63 unsigned int p; 112 unsigned int p;
64 unsigned int pow2p; 113 unsigned int pow2p;
65 114
115 clockevents_register_device(&pnx8xxx_clockevent);
116 clocksource_register(&pnx_clocksource);
117
118 setup_irq(PNX8550_INT_TIMER1, &pnx8xxx_timer_irq);
119 setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction);
120
121 /* Timer 1 start */
122 configPR = read_c0_config7();
123 configPR &= ~0x00000008;
124 write_c0_config7(configPR);
125
126 /* Timer 2 start */
127 configPR = read_c0_config7();
128 configPR &= ~0x00000010;
129 write_c0_config7(configPR);
130
131 /* Timer 3 stop */
132 configPR = read_c0_config7();
133 configPR |= 0x00000020;
134 write_c0_config7(configPR);
135
136
66 /* PLL0 sets MIPS clock (PLL1 <=> TM1, PLL6 <=> TM2, PLL5 <=> mem) */ 137 /* PLL0 sets MIPS clock (PLL1 <=> TM1, PLL6 <=> TM2, PLL5 <=> mem) */
67 /* (but only if CLK_MIPS_CTL select value [bits 3:1] is 1: FIXME) */ 138 /* (but only if CLK_MIPS_CTL select value [bits 3:1] is 1: FIXME) */
68 139
@@ -87,42 +158,6 @@ __init void plat_time_init(void)
87 write_c0_count2(0); 158 write_c0_count2(0);
88 write_c0_compare2(0xffffffff); 159 write_c0_compare2(0xffffffff);
89 160
90 clocksource_mips.read = hpt_read;
91 mips_timer_ack = timer_ack;
92}
93
94static irqreturn_t monotonic_interrupt(int irq, void *dev_id)
95{
96 /* Timer 2 clear interrupt */
97 write_c0_compare2(-1);
98 return IRQ_HANDLED;
99} 161}
100 162
101static struct irqaction monotonic_irqaction = {
102 .handler = monotonic_interrupt,
103 .flags = IRQF_DISABLED,
104 .name = "Monotonic timer",
105};
106 163
107void __init plat_timer_setup(struct irqaction *irq)
108{
109 int configPR;
110
111 setup_irq(PNX8550_INT_TIMER1, irq);
112 setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction);
113
114 /* Timer 1 start */
115 configPR = read_c0_config7();
116 configPR &= ~0x00000008;
117 write_c0_config7(configPR);
118
119 /* Timer 2 start */
120 configPR = read_c0_config7();
121 configPR &= ~0x00000010;
122 write_c0_config7(configPR);
123
124 /* Timer 3 stop */
125 configPR = read_c0_config7();
126 configPR |= 0x00000020;
127 write_c0_config7(configPR);
128}
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c
index cab7cc22ab67..b0ea0e43ba48 100644
--- a/arch/mips/sgi-ip32/ip32-irq.c
+++ b/arch/mips/sgi-ip32/ip32-irq.c
@@ -426,7 +426,6 @@ static void ip32_irq0(void)
426 426
427 crime_int = crime->istat & crime_mask; 427 crime_int = crime->istat & crime_mask;
428 irq = MACE_VID_IN1_IRQ + __ffs(crime_int); 428 irq = MACE_VID_IN1_IRQ + __ffs(crime_int);
429 crime_int = 1 << irq;
430 429
431 if (crime_int & CRIME_MACEISA_INT_MASK) { 430 if (crime_int & CRIME_MACEISA_INT_MASK) {
432 unsigned long mace_int = mace->perif.ctrl.istat; 431 unsigned long mace_int = mace->perif.ctrl.istat;
diff --git a/arch/mips/sgi-ip32/ip32-platform.c b/arch/mips/sgi-ip32/ip32-platform.c
index 77febd68fcd4..89a71f49b692 100644
--- a/arch/mips/sgi-ip32/ip32-platform.c
+++ b/arch/mips/sgi-ip32/ip32-platform.c
@@ -13,21 +13,22 @@
13#include <asm/ip32/mace.h> 13#include <asm/ip32/mace.h>
14#include <asm/ip32/ip32_ints.h> 14#include <asm/ip32/ip32_ints.h>
15 15
16/* 16#define MACEISA_SERIAL1_OFFS offsetof(struct sgi_mace, isa.serial1)
17 * .iobase isn't a constant (in the sense of C) so we fill it in at runtime. 17#define MACEISA_SERIAL2_OFFS offsetof(struct sgi_mace, isa.serial2)
18 */ 18
19#define MACE_PORT(int) \ 19#define MACE_PORT(offset,_irq) \
20{ \ 20{ \
21 .irq = int, \ 21 .mapbase = MACE_BASE + offset, \
22 .irq = _irq, \
22 .uartclk = 1843200, \ 23 .uartclk = 1843200, \
23 .iotype = UPIO_MEM, \ 24 .iotype = UPIO_MEM, \
24 .flags = UPF_SKIP_TEST, \ 25 .flags = UPF_SKIP_TEST|UPF_IOREMAP, \
25 .regshift = 8, \ 26 .regshift = 8, \
26} 27}
27 28
28static struct plat_serial8250_port uart8250_data[] = { 29static struct plat_serial8250_port uart8250_data[] = {
29 MACE_PORT(MACEISA_SERIAL1_IRQ), 30 MACE_PORT(MACEISA_SERIAL1_OFFS, MACEISA_SERIAL1_IRQ),
30 MACE_PORT(MACEISA_SERIAL2_IRQ), 31 MACE_PORT(MACEISA_SERIAL2_OFFS, MACEISA_SERIAL2_IRQ),
31 { }, 32 { },
32}; 33};
33 34
@@ -41,9 +42,6 @@ static struct platform_device uart8250_device = {
41 42
42static int __init uart8250_init(void) 43static int __init uart8250_init(void)
43{ 44{
44 uart8250_data[0].membase = (void __iomem *) &mace->isa.serial1;
45 uart8250_data[1].membase = (void __iomem *) &mace->isa.serial2;
46
47 return platform_device_register(&uart8250_device); 45 return platform_device_register(&uart8250_device);
48} 46}
49 47
diff --git a/arch/mips/tx4938/toshiba_rbtx4938/setup.c b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
index 4a8152375efe..632e5d201353 100644
--- a/arch/mips/tx4938/toshiba_rbtx4938/setup.c
+++ b/arch/mips/tx4938/toshiba_rbtx4938/setup.c
@@ -598,8 +598,8 @@ static int __init rbtx4938_ethaddr_init(void)
598 printk(KERN_WARNING "seeprom: bad checksum.\n"); 598 printk(KERN_WARNING "seeprom: bad checksum.\n");
599 } 599 }
600 for (i = 0; i < 2; i++) { 600 for (i = 0; i < 2; i++) {
601 unsigned int slot = TX4938_PCIC_IDSEL_AD_TO_SLOT(31 - i); 601 unsigned int id =
602 unsigned int id = (1 << 8) | PCI_DEVFN(slot, 0); /* bus 1 */ 602 TXX9_IRQ_BASE + (i ? TX4938_IR_ETH1 : TX4938_IR_ETH0);
603 struct platform_device *pdev; 603 struct platform_device *pdev;
604 if (!(tx4938_ccfgptr->pcfg & 604 if (!(tx4938_ccfgptr->pcfg &
605 (i ? TX4938_PCFG_ETH1_SEL : TX4938_PCFG_ETH0_SEL))) 605 (i ? TX4938_PCFG_ETH1_SEL : TX4938_PCFG_ETH0_SEL)))
diff --git a/arch/powerpc/boot/flatdevtree_env.h b/arch/powerpc/boot/flatdevtree_env.h
index ad0420da8921..66e0ebb1a364 100644
--- a/arch/powerpc/boot/flatdevtree_env.h
+++ b/arch/powerpc/boot/flatdevtree_env.h
@@ -2,7 +2,7 @@
2 * This file adds the header file glue so that the shared files 2 * This file adds the header file glue so that the shared files
3 * flatdevicetree.[ch] can compile and work in the powerpc bootwrapper. 3 * flatdevicetree.[ch] can compile and work in the powerpc bootwrapper.
4 * 4 *
5 * strncmp & strchr copied from <file:lib/strings.c> 5 * strncmp & strchr copied from <file:lib/string.c>
6 * Copyright (C) 1991, 1992 Linus Torvalds 6 * Copyright (C) 1991, 1992 Linus Torvalds
7 * 7 *
8 * Maintained by: Mark A. Greer <mgreer@mvista.com> 8 * Maintained by: Mark A. Greer <mgreer@mvista.com>
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index 47c3fe55242f..a3c406aca664 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -278,6 +278,7 @@ int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist,
278 unsigned long flags; 278 unsigned long flags;
279 struct scatterlist *s, *outs, *segstart; 279 struct scatterlist *s, *outs, *segstart;
280 int outcount, incount, i; 280 int outcount, incount, i;
281 unsigned int align;
281 unsigned long handle; 282 unsigned long handle;
282 283
283 BUG_ON(direction == DMA_NONE); 284 BUG_ON(direction == DMA_NONE);
@@ -309,7 +310,12 @@ int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist,
309 /* Allocate iommu entries for that segment */ 310 /* Allocate iommu entries for that segment */
310 vaddr = (unsigned long) sg_virt(s); 311 vaddr = (unsigned long) sg_virt(s);
311 npages = iommu_num_pages(vaddr, slen); 312 npages = iommu_num_pages(vaddr, slen);
312 entry = iommu_range_alloc(tbl, npages, &handle, mask >> IOMMU_PAGE_SHIFT, 0); 313 align = 0;
314 if (IOMMU_PAGE_SHIFT < PAGE_SHIFT && slen >= PAGE_SIZE &&
315 (vaddr & ~PAGE_MASK) == 0)
316 align = PAGE_SHIFT - IOMMU_PAGE_SHIFT;
317 entry = iommu_range_alloc(tbl, npages, &handle,
318 mask >> IOMMU_PAGE_SHIFT, align);
313 319
314 DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen); 320 DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen);
315 321
@@ -570,7 +576,7 @@ dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
570{ 576{
571 dma_addr_t dma_handle = DMA_ERROR_CODE; 577 dma_addr_t dma_handle = DMA_ERROR_CODE;
572 unsigned long uaddr; 578 unsigned long uaddr;
573 unsigned int npages; 579 unsigned int npages, align;
574 580
575 BUG_ON(direction == DMA_NONE); 581 BUG_ON(direction == DMA_NONE);
576 582
@@ -578,8 +584,13 @@ dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
578 npages = iommu_num_pages(uaddr, size); 584 npages = iommu_num_pages(uaddr, size);
579 585
580 if (tbl) { 586 if (tbl) {
587 align = 0;
588 if (IOMMU_PAGE_SHIFT < PAGE_SHIFT && size >= PAGE_SIZE &&
589 ((unsigned long)vaddr & ~PAGE_MASK) == 0)
590 align = PAGE_SHIFT - IOMMU_PAGE_SHIFT;
591
581 dma_handle = iommu_alloc(tbl, vaddr, npages, direction, 592 dma_handle = iommu_alloc(tbl, vaddr, npages, direction,
582 mask >> IOMMU_PAGE_SHIFT, 0); 593 mask >> IOMMU_PAGE_SHIFT, align);
583 if (dma_handle == DMA_ERROR_CODE) { 594 if (dma_handle == DMA_ERROR_CODE) {
584 if (printk_ratelimit()) { 595 if (printk_ratelimit()) {
585 printk(KERN_INFO "iommu_alloc failed, " 596 printk(KERN_INFO "iommu_alloc failed, "
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 1add6efdb315..5d89a21dd0d6 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2216,6 +2216,45 @@ static void __init fixup_device_tree_efika(void)
2216 prom_printf("fixup_device_tree_efika: ", 2216 prom_printf("fixup_device_tree_efika: ",
2217 "skipped entry %x - setprop error\n", i); 2217 "skipped entry %x - setprop error\n", i);
2218 } 2218 }
2219
2220 /* Make sure ethernet mdio bus node exists */
2221 node = call_prom("finddevice", 1, 1, ADDR("/builtin/mdio"));
2222 if (!PHANDLE_VALID(node)) {
2223 prom_printf("Adding Ethernet MDIO node\n");
2224 call_prom("interpret", 1, 1,
2225 " s\" /builtin\" find-device"
2226 " new-device"
2227 " 1 encode-int s\" #address-cells\" property"
2228 " 0 encode-int s\" #size-cells\" property"
2229 " s\" mdio\" 2dup device-name device-type"
2230 " s\" mpc5200b-fec-phy\" encode-string"
2231 " s\" compatible\" property"
2232 " 0xf0003000 0x400 reg"
2233 " 0x2 encode-int"
2234 " 0x5 encode-int encode+"
2235 " 0x3 encode-int encode+"
2236 " s\" interrupts\" property"
2237 " finish-device");
2238 };
2239
2240 /* Make sure ethernet phy device node exist */
2241 node = call_prom("finddevice", 1, 1, ADDR("/builtin/mdio/ethernet-phy"));
2242 if (!PHANDLE_VALID(node)) {
2243 prom_printf("Adding Ethernet PHY node\n");
2244 call_prom("interpret", 1, 1,
2245 " s\" /builtin/mdio\" find-device"
2246 " new-device"
2247 " s\" ethernet-phy\" device-name"
2248 " 0x10 encode-int s\" reg\" property"
2249 " my-self"
2250 " ihandle>phandle"
2251 " finish-device"
2252 " s\" /builtin/ethernet\" find-device"
2253 " encode-int"
2254 " s\" phy-handle\" property"
2255 " device-end");
2256 }
2257
2219} 2258}
2220#else 2259#else
2221#define fixup_device_tree_efika() 2260#define fixup_device_tree_efika()
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index 3cf0802cd2b6..47b06bad24ad 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -295,6 +295,8 @@ void slb_initialize(void)
295 295
296 create_shadowed_slbe(VMALLOC_START, mmu_kernel_ssize, vflags, 1); 296 create_shadowed_slbe(VMALLOC_START, mmu_kernel_ssize, vflags, 1);
297 297
298 slb_shadow_clear(2);
299
298 /* We don't bolt the stack for the time being - we're in boot, 300 /* We don't bolt the stack for the time being - we're in boot,
299 * so the stack is in the bolted segment. By the time it goes 301 * so the stack is in the bolted segment. By the time it goes
300 * elsewhere, we'll call _switch() which will bolt in the new 302 * elsewhere, we'll call _switch() which will bolt in the new
diff --git a/arch/powerpc/platforms/cell/Kconfig b/arch/powerpc/platforms/cell/Kconfig
index e1e2f6a43019..3a963b4a9be0 100644
--- a/arch/powerpc/platforms/cell/Kconfig
+++ b/arch/powerpc/platforms/cell/Kconfig
@@ -88,3 +88,8 @@ config CBE_CPUFREQ_PMI
88 but also at lower core voltage. 88 but also at lower core voltage.
89 89
90endmenu 90endmenu
91
92config OPROFILE_CELL
93 def_bool y
94 depends on PPC_CELL_NATIVE && (OPROFILE = m || OPROFILE = y)
95
diff --git a/arch/powerpc/platforms/cell/Makefile b/arch/powerpc/platforms/cell/Makefile
index 3cd565a04d0a..c89964c6fb1f 100644
--- a/arch/powerpc/platforms/cell/Makefile
+++ b/arch/powerpc/platforms/cell/Makefile
@@ -19,6 +19,7 @@ spu-manage-$(CONFIG_PPC_CELLEB) += spu_manage.o
19spu-manage-$(CONFIG_PPC_CELL_NATIVE) += spu_manage.o 19spu-manage-$(CONFIG_PPC_CELL_NATIVE) += spu_manage.o
20 20
21obj-$(CONFIG_SPU_BASE) += spu_callbacks.o spu_base.o \ 21obj-$(CONFIG_SPU_BASE) += spu_callbacks.o spu_base.o \
22 spu_notify.o \
22 spu_syscalls.o spu_fault.o \ 23 spu_syscalls.o spu_fault.o \
23 $(spu-priv1-y) \ 24 $(spu-priv1-y) \
24 $(spu-manage-y) \ 25 $(spu-manage-y) \
diff --git a/arch/powerpc/platforms/cell/spu_notify.c b/arch/powerpc/platforms/cell/spu_notify.c
new file mode 100644
index 000000000000..34d156959f39
--- /dev/null
+++ b/arch/powerpc/platforms/cell/spu_notify.c
@@ -0,0 +1,67 @@
1/*
2 * Move OProfile dependencies from spufs module to the kernel so it
3 * can run on non-cell PPC.
4 *
5 * Copyright (C) IBM 2005
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#undef DEBUG
23
24#include <linux/module.h>
25#include <asm/spu.h>
26#include "spufs/spufs.h"
27
28static BLOCKING_NOTIFIER_HEAD(spu_switch_notifier);
29
30void spu_switch_notify(struct spu *spu, struct spu_context *ctx)
31{
32 blocking_notifier_call_chain(&spu_switch_notifier,
33 ctx ? ctx->object_id : 0, spu);
34}
35EXPORT_SYMBOL_GPL(spu_switch_notify);
36
37int spu_switch_event_register(struct notifier_block *n)
38{
39 int ret;
40 ret = blocking_notifier_chain_register(&spu_switch_notifier, n);
41 if (!ret)
42 notify_spus_active();
43 return ret;
44}
45EXPORT_SYMBOL_GPL(spu_switch_event_register);
46
47int spu_switch_event_unregister(struct notifier_block *n)
48{
49 return blocking_notifier_chain_unregister(&spu_switch_notifier, n);
50}
51EXPORT_SYMBOL_GPL(spu_switch_event_unregister);
52
53void spu_set_profile_private_kref(struct spu_context *ctx,
54 struct kref *prof_info_kref,
55 void (* prof_info_release) (struct kref *kref))
56{
57 ctx->prof_priv_kref = prof_info_kref;
58 ctx->prof_priv_release = prof_info_release;
59}
60EXPORT_SYMBOL_GPL(spu_set_profile_private_kref);
61
62void *spu_get_profile_private_kref(struct spu_context *ctx)
63{
64 return ctx->prof_priv_kref;
65}
66EXPORT_SYMBOL_GPL(spu_get_profile_private_kref);
67
diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c b/arch/powerpc/platforms/cell/spu_syscalls.c
index a9438b719fe8..75530d99eda6 100644
--- a/arch/powerpc/platforms/cell/spu_syscalls.c
+++ b/arch/powerpc/platforms/cell/spu_syscalls.c
@@ -145,6 +145,20 @@ int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset)
145 return ret; 145 return ret;
146} 146}
147 147
148void notify_spus_active(void)
149{
150 struct spufs_calls *calls;
151
152 calls = spufs_calls_get();
153 if (!calls)
154 return;
155
156 calls->notify_spus_active();
157 spufs_calls_put(calls);
158
159 return;
160}
161
148int register_spu_syscalls(struct spufs_calls *calls) 162int register_spu_syscalls(struct spufs_calls *calls)
149{ 163{
150 if (spufs_calls) 164 if (spufs_calls)
diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c
index 237e152d31dc..133995ed5cc7 100644
--- a/arch/powerpc/platforms/cell/spufs/context.c
+++ b/arch/powerpc/platforms/cell/spufs/context.c
@@ -177,19 +177,3 @@ void spu_release_saved(struct spu_context *ctx)
177 spu_release(ctx); 177 spu_release(ctx);
178} 178}
179 179
180void spu_set_profile_private_kref(struct spu_context *ctx,
181 struct kref *prof_info_kref,
182 void ( * prof_info_release) (struct kref *kref))
183{
184 ctx->prof_priv_kref = prof_info_kref;
185 ctx->prof_priv_release = prof_info_release;
186}
187EXPORT_SYMBOL_GPL(spu_set_profile_private_kref);
188
189void *spu_get_profile_private_kref(struct spu_context *ctx)
190{
191 return ctx->prof_priv_kref;
192}
193EXPORT_SYMBOL_GPL(spu_get_profile_private_kref);
194
195
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 8c8af11b35b4..00d914232af1 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -182,15 +182,7 @@ static int node_allowed(struct spu_context *ctx, int node)
182 return rval; 182 return rval;
183} 183}
184 184
185static BLOCKING_NOTIFIER_HEAD(spu_switch_notifier); 185void do_notify_spus_active(void)
186
187void spu_switch_notify(struct spu *spu, struct spu_context *ctx)
188{
189 blocking_notifier_call_chain(&spu_switch_notifier,
190 ctx ? ctx->object_id : 0, spu);
191}
192
193static void notify_spus_active(void)
194{ 186{
195 int node; 187 int node;
196 188
@@ -217,22 +209,6 @@ static void notify_spus_active(void)
217 } 209 }
218} 210}
219 211
220int spu_switch_event_register(struct notifier_block * n)
221{
222 int ret;
223 ret = blocking_notifier_chain_register(&spu_switch_notifier, n);
224 if (!ret)
225 notify_spus_active();
226 return ret;
227}
228EXPORT_SYMBOL_GPL(spu_switch_event_register);
229
230int spu_switch_event_unregister(struct notifier_block * n)
231{
232 return blocking_notifier_chain_unregister(&spu_switch_notifier, n);
233}
234EXPORT_SYMBOL_GPL(spu_switch_event_unregister);
235
236/** 212/**
237 * spu_bind_context - bind spu context to physical spu 213 * spu_bind_context - bind spu context to physical spu
238 * @spu: physical spu to bind to 214 * @spu: physical spu to bind to
diff --git a/arch/powerpc/platforms/cell/spufs/syscalls.c b/arch/powerpc/platforms/cell/spufs/syscalls.c
index 2c34f7170190..430404413178 100644
--- a/arch/powerpc/platforms/cell/spufs/syscalls.c
+++ b/arch/powerpc/platforms/cell/spufs/syscalls.c
@@ -86,5 +86,6 @@ struct spufs_calls spufs_calls = {
86 .spu_run = do_spu_run, 86 .spu_run = do_spu_run,
87 .coredump_extra_notes_size = spufs_coredump_extra_notes_size, 87 .coredump_extra_notes_size = spufs_coredump_extra_notes_size,
88 .coredump_extra_notes_write = spufs_coredump_extra_notes_write, 88 .coredump_extra_notes_write = spufs_coredump_extra_notes_write,
89 .notify_spus_active = do_notify_spus_active,
89 .owner = THIS_MODULE, 90 .owner = THIS_MODULE,
90}; 91};
diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c
index 766685ab26f8..b9ea09d9d2fb 100644
--- a/arch/powerpc/platforms/ps3/os-area.c
+++ b/arch/powerpc/platforms/ps3/os-area.c
@@ -23,6 +23,7 @@
23#include <linux/workqueue.h> 23#include <linux/workqueue.h>
24#include <linux/fs.h> 24#include <linux/fs.h>
25#include <linux/syscalls.h> 25#include <linux/syscalls.h>
26#include <linux/ctype.h>
26 27
27#include <asm/lmb.h> 28#include <asm/lmb.h>
28 29
@@ -37,6 +38,8 @@ enum os_area_ldr_format {
37 HEADER_LDR_FORMAT_GZIP = 1, 38 HEADER_LDR_FORMAT_GZIP = 1,
38}; 39};
39 40
41#define OS_AREA_HEADER_MAGIC_NUM "cell_ext_os_area"
42
40/** 43/**
41 * struct os_area_header - os area header segment. 44 * struct os_area_header - os area header segment.
42 * @magic_num: Always 'cell_ext_os_area'. 45 * @magic_num: Always 'cell_ext_os_area'.
@@ -114,13 +117,11 @@ struct os_area_params {
114 u8 _reserved_5[8]; 117 u8 _reserved_5[8];
115}; 118};
116 119
117enum { 120#define OS_AREA_DB_MAGIC_NUM "-db-"
118 OS_AREA_DB_MAGIC_NUM = 0x2d64622dU,
119};
120 121
121/** 122/**
122 * struct os_area_db - Shared flash memory database. 123 * struct os_area_db - Shared flash memory database.
123 * @magic_num: Always '-db-' = 0x2d64622d. 124 * @magic_num: Always '-db-'.
124 * @version: os_area_db format version number. 125 * @version: os_area_db format version number.
125 * @index_64: byte offset of the database id index for 64 bit variables. 126 * @index_64: byte offset of the database id index for 64 bit variables.
126 * @count_64: number of usable 64 bit index entries 127 * @count_64: number of usable 64 bit index entries
@@ -135,7 +136,7 @@ enum {
135 */ 136 */
136 137
137struct os_area_db { 138struct os_area_db {
138 u32 magic_num; 139 u8 magic_num[4];
139 u16 version; 140 u16 version;
140 u16 _reserved_1; 141 u16 _reserved_1;
141 u16 index_64; 142 u16 index_64;
@@ -265,12 +266,26 @@ static void __init os_area_get_property(struct device_node *node,
265 prop->name); 266 prop->name);
266} 267}
267 268
269static void dump_field(char *s, const u8 *field, int size_of_field)
270{
271#if defined(DEBUG)
272 int i;
273
274 for (i = 0; i < size_of_field; i++)
275 s[i] = isprint(field[i]) ? field[i] : '.';
276 s[i] = 0;
277#endif
278}
279
268#define dump_header(_a) _dump_header(_a, __func__, __LINE__) 280#define dump_header(_a) _dump_header(_a, __func__, __LINE__)
269static void _dump_header(const struct os_area_header *h, const char *func, 281static void _dump_header(const struct os_area_header *h, const char *func,
270 int line) 282 int line)
271{ 283{
284 char str[sizeof(h->magic_num) + 1];
285
286 dump_field(str, h->magic_num, sizeof(h->magic_num));
272 pr_debug("%s:%d: h.magic_num: '%s'\n", func, line, 287 pr_debug("%s:%d: h.magic_num: '%s'\n", func, line,
273 h->magic_num); 288 str);
274 pr_debug("%s:%d: h.hdr_version: %u\n", func, line, 289 pr_debug("%s:%d: h.hdr_version: %u\n", func, line,
275 h->hdr_version); 290 h->hdr_version);
276 pr_debug("%s:%d: h.db_area_offset: %u\n", func, line, 291 pr_debug("%s:%d: h.db_area_offset: %u\n", func, line,
@@ -311,7 +326,8 @@ static void _dump_params(const struct os_area_params *p, const char *func,
311 326
312static int verify_header(const struct os_area_header *header) 327static int verify_header(const struct os_area_header *header)
313{ 328{
314 if (memcmp(header->magic_num, "cell_ext_os_area", 16)) { 329 if (memcmp(header->magic_num, OS_AREA_HEADER_MAGIC_NUM,
330 sizeof(header->magic_num))) {
315 pr_debug("%s:%d magic_num failed\n", __func__, __LINE__); 331 pr_debug("%s:%d magic_num failed\n", __func__, __LINE__);
316 return -1; 332 return -1;
317 } 333 }
@@ -331,7 +347,8 @@ static int verify_header(const struct os_area_header *header)
331 347
332static int db_verify(const struct os_area_db *db) 348static int db_verify(const struct os_area_db *db)
333{ 349{
334 if (db->magic_num != OS_AREA_DB_MAGIC_NUM) { 350 if (memcmp(db->magic_num, OS_AREA_DB_MAGIC_NUM,
351 sizeof(db->magic_num))) {
335 pr_debug("%s:%d magic_num failed\n", __func__, __LINE__); 352 pr_debug("%s:%d magic_num failed\n", __func__, __LINE__);
336 return -1; 353 return -1;
337 } 354 }
@@ -484,8 +501,11 @@ static int db_get_rtc_diff(const struct os_area_db *db, int64_t *rtc_diff)
484static void _dump_db(const struct os_area_db *db, const char *func, 501static void _dump_db(const struct os_area_db *db, const char *func,
485 int line) 502 int line)
486{ 503{
504 char str[sizeof(db->magic_num) + 1];
505
506 dump_field(str, db->magic_num, sizeof(db->magic_num));
487 pr_debug("%s:%d: db.magic_num: '%s'\n", func, line, 507 pr_debug("%s:%d: db.magic_num: '%s'\n", func, line,
488 (const char*)&db->magic_num); 508 str);
489 pr_debug("%s:%d: db.version: %u\n", func, line, 509 pr_debug("%s:%d: db.version: %u\n", func, line,
490 db->version); 510 db->version);
491 pr_debug("%s:%d: db.index_64: %u\n", func, line, 511 pr_debug("%s:%d: db.index_64: %u\n", func, line,
@@ -516,7 +536,7 @@ static void os_area_db_init(struct os_area_db *db)
516 536
517 memset(db, 0, sizeof(struct os_area_db)); 537 memset(db, 0, sizeof(struct os_area_db));
518 538
519 db->magic_num = OS_AREA_DB_MAGIC_NUM; 539 memcpy(db->magic_num, OS_AREA_DB_MAGIC_NUM, sizeof(db->magic_num));
520 db->version = 1; 540 db->version = 1;
521 db->index_64 = HEADER_SIZE; 541 db->index_64 = HEADER_SIZE;
522 db->count_64 = VALUES_64_COUNT; 542 db->count_64 = VALUES_64_COUNT;
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index fc48b96c81bf..412e6b42986f 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -29,6 +29,7 @@
29#include <asm/vdso_datapage.h> 29#include <asm/vdso_datapage.h>
30#include <asm/pSeries_reconfig.h> 30#include <asm/pSeries_reconfig.h>
31#include "xics.h" 31#include "xics.h"
32#include "plpar_wrappers.h"
32 33
33/* This version can't take the spinlock, because it never returns */ 34/* This version can't take the spinlock, because it never returns */
34static struct rtas_args rtas_stop_self_args = { 35static struct rtas_args rtas_stop_self_args = {
@@ -58,6 +59,7 @@ static void pseries_mach_cpu_die(void)
58 local_irq_disable(); 59 local_irq_disable();
59 idle_task_exit(); 60 idle_task_exit();
60 xics_teardown_cpu(0); 61 xics_teardown_cpu(0);
62 unregister_slb_shadow(hard_smp_processor_id(), __pa(get_slb_shadow()));
61 rtas_stop_self(); 63 rtas_stop_self();
62 /* Should never get here... */ 64 /* Should never get here... */
63 BUG(); 65 BUG();
diff --git a/arch/sparc/kernel/ptrace.c b/arch/sparc/kernel/ptrace.c
index fe562db475e9..7452269bba2a 100644
--- a/arch/sparc/kernel/ptrace.c
+++ b/arch/sparc/kernel/ptrace.c
@@ -5,7 +5,7 @@
5 * Based upon code written by Ross Biro, Linus Torvalds, Bob Manson, 5 * Based upon code written by Ross Biro, Linus Torvalds, Bob Manson,
6 * and David Mosberger. 6 * and David Mosberger.
7 * 7 *
8 * Added Linux support -miguel (weird, eh?, the orignal code was meant 8 * Added Linux support -miguel (weird, eh?, the original code was meant
9 * to emulate SunOS). 9 * to emulate SunOS).
10 */ 10 */
11 11
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c
index 45cb7c5286d7..00b393c3a4a0 100644
--- a/arch/sparc/kernel/time.c
+++ b/arch/sparc/kernel/time.c
@@ -436,7 +436,14 @@ void __init time_init(void)
436 436
437static inline unsigned long do_gettimeoffset(void) 437static inline unsigned long do_gettimeoffset(void)
438{ 438{
439 return (*master_l10_counter >> 10) & 0x1fffff; 439 unsigned long val = *master_l10_counter;
440 unsigned long usec = (val >> 10) & 0x1fffff;
441
442 /* Limit hit? */
443 if (val & 0x80000000)
444 usec += 1000000 / HZ;
445
446 return usec;
440} 447}
441 448
442/* Ok, my cute asm atomicity trick doesn't work anymore. 449/* Ok, my cute asm atomicity trick doesn't work anymore.
diff --git a/arch/sparc64/kernel/ktlb.S b/arch/sparc64/kernel/ktlb.S
index 964527d2ffa0..cef8defcd7a9 100644
--- a/arch/sparc64/kernel/ktlb.S
+++ b/arch/sparc64/kernel/ktlb.S
@@ -1,6 +1,6 @@
1/* arch/sparc64/kernel/ktlb.S: Kernel mapping TLB miss handling. 1/* arch/sparc64/kernel/ktlb.S: Kernel mapping TLB miss handling.
2 * 2 *
3 * Copyright (C) 1995, 1997, 2005 David S. Miller <davem@davemloft.net> 3 * Copyright (C) 1995, 1997, 2005, 2008 David S. Miller <davem@davemloft.net>
4 * Copyright (C) 1996 Eddie C. Dost (ecd@brainaid.de) 4 * Copyright (C) 1996 Eddie C. Dost (ecd@brainaid.de)
5 * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) 5 * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx)
6 * Copyright (C) 1996,98,99 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 6 * Copyright (C) 1996,98,99 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -226,6 +226,7 @@ kvmap_dtlb_load:
226 ba,pt %xcc, sun4v_dtlb_load 226 ba,pt %xcc, sun4v_dtlb_load
227 mov %g5, %g3 227 mov %g5, %g3
228 228
229#ifdef CONFIG_SPARSEMEM_VMEMMAP
229kvmap_vmemmap: 230kvmap_vmemmap:
230 sub %g4, %g5, %g5 231 sub %g4, %g5, %g5
231 srlx %g5, 22, %g5 232 srlx %g5, 22, %g5
@@ -234,6 +235,7 @@ kvmap_vmemmap:
234 or %g1, %lo(vmemmap_table), %g1 235 or %g1, %lo(vmemmap_table), %g1
235 ba,pt %xcc, kvmap_dtlb_load 236 ba,pt %xcc, kvmap_dtlb_load
236 ldx [%g1 + %g5], %g5 237 ldx [%g1 + %g5], %g5
238#endif
237 239
238kvmap_dtlb_nonlinear: 240kvmap_dtlb_nonlinear:
239 /* Catch kernel NULL pointer derefs. */ 241 /* Catch kernel NULL pointer derefs. */
@@ -242,12 +244,14 @@ kvmap_dtlb_nonlinear:
242 bleu,pn %xcc, kvmap_dtlb_longpath 244 bleu,pn %xcc, kvmap_dtlb_longpath
243 nop 245 nop
244 246
247#ifdef CONFIG_SPARSEMEM_VMEMMAP
245 /* Do not use the TSB for vmemmap. */ 248 /* Do not use the TSB for vmemmap. */
246 mov (VMEMMAP_BASE >> 24), %g5 249 mov (VMEMMAP_BASE >> 24), %g5
247 sllx %g5, 24, %g5 250 sllx %g5, 24, %g5
248 cmp %g4,%g5 251 cmp %g4,%g5
249 bgeu,pn %xcc, kvmap_vmemmap 252 bgeu,pn %xcc, kvmap_vmemmap
250 nop 253 nop
254#endif
251 255
252 KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load) 256 KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load)
253 257
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index 63b3ebc0c3c2..a61c38fe75ea 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -1275,4 +1275,20 @@ int pci_dma_supported(struct pci_dev *pdev, u64 device_mask)
1275 return (device_mask & dma_addr_mask) == dma_addr_mask; 1275 return (device_mask & dma_addr_mask) == dma_addr_mask;
1276} 1276}
1277 1277
1278void pci_resource_to_user(const struct pci_dev *pdev, int bar,
1279 const struct resource *rp, resource_size_t *start,
1280 resource_size_t *end)
1281{
1282 struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller;
1283 unsigned long offset;
1284
1285 if (rp->flags & IORESOURCE_IO)
1286 offset = pbm->io_space.start;
1287 else
1288 offset = pbm->mem_space.start;
1289
1290 *start = rp->start - offset;
1291 *end = rp->end - offset;
1292}
1293
1278#endif /* !(CONFIG_PCI) */ 1294#endif /* !(CONFIG_PCI) */
diff --git a/arch/sparc64/kernel/pci_schizo.c b/arch/sparc64/kernel/pci_schizo.c
index 9546ba9f5dee..e752e75cce83 100644
--- a/arch/sparc64/kernel/pci_schizo.c
+++ b/arch/sparc64/kernel/pci_schizo.c
@@ -850,7 +850,7 @@ static int pbm_routes_this_ino(struct pci_pbm_info *pbm, u32 ino)
850/* How the Tomatillo IRQs are routed around is pure guesswork here. 850/* How the Tomatillo IRQs are routed around is pure guesswork here.
851 * 851 *
852 * All the Tomatillo devices I see in prtconf dumps seem to have only 852 * All the Tomatillo devices I see in prtconf dumps seem to have only
853 * a single PCI bus unit attached to it. It would seem they are seperate 853 * a single PCI bus unit attached to it. It would seem they are separate
854 * devices because their PortID (ie. JBUS ID) values are all different 854 * devices because their PortID (ie. JBUS ID) values are all different
855 * and thus the registers are mapped to totally different locations. 855 * and thus the registers are mapped to totally different locations.
856 * 856 *
diff --git a/arch/sparc64/kernel/sun4v_tlb_miss.S b/arch/sparc64/kernel/sun4v_tlb_miss.S
index 9871dbb1ab42..fd9430562e0b 100644
--- a/arch/sparc64/kernel/sun4v_tlb_miss.S
+++ b/arch/sparc64/kernel/sun4v_tlb_miss.S
@@ -215,6 +215,7 @@ sun4v_itlb_error:
215 215
2161: ba,pt %xcc, etrap 2161: ba,pt %xcc, etrap
2172: or %g7, %lo(2b), %g7 2172: or %g7, %lo(2b), %g7
218 mov %l4, %o1
218 call sun4v_itlb_error_report 219 call sun4v_itlb_error_report
219 add %sp, PTREGS_OFF, %o0 220 add %sp, PTREGS_OFF, %o0
220 221
@@ -241,6 +242,7 @@ sun4v_dtlb_error:
241 242
2421: ba,pt %xcc, etrap 2431: ba,pt %xcc, etrap
2432: or %g7, %lo(2b), %g7 2442: or %g7, %lo(2b), %g7
245 mov %l4, %o1
244 call sun4v_dtlb_error_report 246 call sun4v_dtlb_error_report
245 add %sp, PTREGS_OFF, %o0 247 add %sp, PTREGS_OFF, %o0
246 248
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index 04998388259f..2b6abf633343 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -1950,6 +1950,8 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl)
1950 printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n", 1950 printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n",
1951 regs->tpc, tl); 1951 regs->tpc, tl);
1952 print_symbol(KERN_EMERG "SUN4V-ITLB: TPC<%s>\n", regs->tpc); 1952 print_symbol(KERN_EMERG "SUN4V-ITLB: TPC<%s>\n", regs->tpc);
1953 printk(KERN_EMERG "SUN4V-ITLB: O7[%lx]\n", regs->u_regs[UREG_I7]);
1954 print_symbol(KERN_EMERG "SUN4V-ITLB: O7<%s>\n", regs->u_regs[UREG_I7]);
1953 printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] " 1955 printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] "
1954 "pte[%lx] error[%lx]\n", 1956 "pte[%lx] error[%lx]\n",
1955 sun4v_err_itlb_vaddr, sun4v_err_itlb_ctx, 1957 sun4v_err_itlb_vaddr, sun4v_err_itlb_ctx,
@@ -1971,6 +1973,8 @@ void sun4v_dtlb_error_report(struct pt_regs *regs, int tl)
1971 printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n", 1973 printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n",
1972 regs->tpc, tl); 1974 regs->tpc, tl);
1973 print_symbol(KERN_EMERG "SUN4V-DTLB: TPC<%s>\n", regs->tpc); 1975 print_symbol(KERN_EMERG "SUN4V-DTLB: TPC<%s>\n", regs->tpc);
1976 printk(KERN_EMERG "SUN4V-DTLB: O7[%lx]\n", regs->u_regs[UREG_I7]);
1977 print_symbol(KERN_EMERG "SUN4V-DTLB: O7<%s>\n", regs->u_regs[UREG_I7]);
1974 printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] " 1978 printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] "
1975 "pte[%lx] error[%lx]\n", 1979 "pte[%lx] error[%lx]\n",
1976 sun4v_err_dtlb_vaddr, sun4v_err_dtlb_ctx, 1980 sun4v_err_dtlb_vaddr, sun4v_err_dtlb_ctx,
diff --git a/arch/um/drivers/harddog_user.c b/arch/um/drivers/harddog_user.c
index b56f8e0196a9..448ba59207a1 100644
--- a/arch/um/drivers/harddog_user.c
+++ b/arch/um/drivers/harddog_user.c
@@ -79,14 +79,14 @@ int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock)
79 n = read(in_fds[0], &c, sizeof(c)); 79 n = read(in_fds[0], &c, sizeof(c));
80 if (n == 0) { 80 if (n == 0) {
81 printk("harddog_open - EOF on watchdog pipe\n"); 81 printk("harddog_open - EOF on watchdog pipe\n");
82 helper_wait(pid); 82 helper_wait(pid, 1, NULL);
83 err = -EIO; 83 err = -EIO;
84 goto out_close_out; 84 goto out_close_out;
85 } 85 }
86 else if (n < 0) { 86 else if (n < 0) {
87 printk("harddog_open - read of watchdog pipe failed, " 87 printk("harddog_open - read of watchdog pipe failed, "
88 "err = %d\n", errno); 88 "err = %d\n", errno);
89 helper_wait(pid); 89 helper_wait(pid, 1, NULL);
90 err = n; 90 err = n;
91 goto out_close_out; 91 goto out_close_out;
92 } 92 }
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 17089a041028..af045ca0f653 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -2256,14 +2256,12 @@ static int __init apm_init(void)
2256 apm_info.disabled = 1; 2256 apm_info.disabled = 1;
2257 return -ENODEV; 2257 return -ENODEV;
2258 } 2258 }
2259 if (PM_IS_ACTIVE()) { 2259 if (pm_flags & PM_ACPI) {
2260 printk(KERN_NOTICE "apm: overridden by ACPI.\n"); 2260 printk(KERN_NOTICE "apm: overridden by ACPI.\n");
2261 apm_info.disabled = 1; 2261 apm_info.disabled = 1;
2262 return -ENODEV; 2262 return -ENODEV;
2263 } 2263 }
2264#ifdef CONFIG_PM_LEGACY 2264 pm_flags |= PM_APM;
2265 pm_active = 1;
2266#endif
2267 2265
2268 /* 2266 /*
2269 * Set up a segment that references the real mode segment 0x40 2267 * Set up a segment that references the real mode segment 0x40
@@ -2366,9 +2364,7 @@ static void __exit apm_exit(void)
2366 kthread_stop(kapmd_task); 2364 kthread_stop(kapmd_task);
2367 kapmd_task = NULL; 2365 kapmd_task = NULL;
2368 } 2366 }
2369#ifdef CONFIG_PM_LEGACY 2367 pm_flags &= ~PM_APM;
2370 pm_active = 0;
2371#endif
2372} 2368}
2373 2369
2374module_init(apm_init); 2370module_init(apm_init);
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index ac0637a6d71c..fbad51fce672 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -196,7 +196,7 @@ default_entry:
196 /* Do an early initialization of the fixmap area */ 196 /* Do an early initialization of the fixmap area */
197 movl $(swapper_pg_dir - __PAGE_OFFSET), %edx 197 movl $(swapper_pg_dir - __PAGE_OFFSET), %edx
198 movl $(swapper_pg_pmd - __PAGE_OFFSET), %eax 198 movl $(swapper_pg_pmd - __PAGE_OFFSET), %eax
199 addl $0x007, %eax /* 0x007 = PRESENT+RW+USER */ 199 addl $0x67, %eax /* 0x67 == _PAGE_TABLE */
200 movl %eax, 4092(%edx) 200 movl %eax, 4092(%edx)
201 201
202 xorl %ebx,%ebx /* This is the boot CPU (BSP) */ 202 xorl %ebx,%ebx /* This is the boot CPU (BSP) */
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 4a86ffd67ec5..2f99ee206b95 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -657,7 +657,7 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
657 hpet_pie_count = 0; 657 hpet_pie_count = 0;
658 } 658 }
659 659
660 if (hpet_rtc_flags & RTC_PIE && 660 if (hpet_rtc_flags & RTC_AIE &&
661 (curr_time.tm_sec == hpet_alarm_time.tm_sec) && 661 (curr_time.tm_sec == hpet_alarm_time.tm_sec) &&
662 (curr_time.tm_min == hpet_alarm_time.tm_min) && 662 (curr_time.tm_min == hpet_alarm_time.tm_min) &&
663 (curr_time.tm_hour == hpet_alarm_time.tm_hour)) 663 (curr_time.tm_hour == hpet_alarm_time.tm_hour))
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
index c3a565bba106..a6b1490e00c4 100644
--- a/arch/x86/kernel/io_apic_32.c
+++ b/arch/x86/kernel/io_apic_32.c
@@ -2169,14 +2169,10 @@ static inline void __init check_timer(void)
2169{ 2169{
2170 int apic1, pin1, apic2, pin2; 2170 int apic1, pin1, apic2, pin2;
2171 int vector; 2171 int vector;
2172 unsigned int ver;
2173 unsigned long flags; 2172 unsigned long flags;
2174 2173
2175 local_irq_save(flags); 2174 local_irq_save(flags);
2176 2175
2177 ver = apic_read(APIC_LVR);
2178 ver = GET_APIC_VERSION(ver);
2179
2180 /* 2176 /*
2181 * get/set the timer IRQ vector: 2177 * get/set the timer IRQ vector:
2182 */ 2178 */
@@ -2189,15 +2185,11 @@ static inline void __init check_timer(void)
2189 * mode for the 8259A whenever interrupts are routed 2185 * mode for the 8259A whenever interrupts are routed
2190 * through I/O APICs. Also IRQ0 has to be enabled in 2186 * through I/O APICs. Also IRQ0 has to be enabled in
2191 * the 8259A which implies the virtual wire has to be 2187 * the 8259A which implies the virtual wire has to be
2192 * disabled in the local APIC. Finally timer interrupts 2188 * disabled in the local APIC.
2193 * need to be acknowledged manually in the 8259A for
2194 * timer_interrupt() and for the i82489DX when using
2195 * the NMI watchdog.
2196 */ 2189 */
2197 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); 2190 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
2198 init_8259A(1); 2191 init_8259A(1);
2199 timer_ack = !cpu_has_tsc; 2192 timer_ack = 1;
2200 timer_ack |= (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver));
2201 if (timer_over_8254 > 0) 2193 if (timer_over_8254 > 0)
2202 enable_8259A_irq(0); 2194 enable_8259A_irq(0);
2203 2195
diff --git a/arch/x86/kernel/mfgpt_32.c b/arch/x86/kernel/mfgpt_32.c
index 0ab680f2d9db..3960ab7e1497 100644
--- a/arch/x86/kernel/mfgpt_32.c
+++ b/arch/x86/kernel/mfgpt_32.c
@@ -278,12 +278,12 @@ static int mfgpt_next_event(unsigned long delta, struct clock_event_device *evt)
278 278
279static irqreturn_t mfgpt_tick(int irq, void *dev_id) 279static irqreturn_t mfgpt_tick(int irq, void *dev_id)
280{ 280{
281 /* Turn off the clock (and clear the event) */
282 mfgpt_disable_timer(mfgpt_event_clock);
283
281 if (mfgpt_tick_mode == CLOCK_EVT_MODE_SHUTDOWN) 284 if (mfgpt_tick_mode == CLOCK_EVT_MODE_SHUTDOWN)
282 return IRQ_HANDLED; 285 return IRQ_HANDLED;
283 286
284 /* Turn off the clock */
285 mfgpt_disable_timer(mfgpt_event_clock);
286
287 /* Clear the counter */ 287 /* Clear the counter */
288 geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_COUNTER, 0); 288 geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_COUNTER, 0);
289 289
@@ -319,10 +319,6 @@ static int __init mfgpt_timer_setup(void)
319 } 319 }
320 320
321 mfgpt_event_clock = timer; 321 mfgpt_event_clock = timer;
322 /* Set the clock scale and enable the event mode for CMP2 */
323 val = MFGPT_SCALE | (3 << 8);
324
325 geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP, val);
326 322
327 /* Set up the IRQ on the MFGPT side */ 323 /* Set up the IRQ on the MFGPT side */
328 if (geode_mfgpt_setup_irq(mfgpt_event_clock, MFGPT_CMP2, irq)) { 324 if (geode_mfgpt_setup_irq(mfgpt_event_clock, MFGPT_CMP2, irq)) {
@@ -339,6 +335,11 @@ static int __init mfgpt_timer_setup(void)
339 goto err; 335 goto err;
340 } 336 }
341 337
338 /* Set the clock scale and enable the event mode for CMP2 */
339 val = MFGPT_SCALE | (3 << 8);
340
341 geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP, val);
342
342 /* Set up the clock event */ 343 /* Set up the clock event */
343 mfgpt_clockevent.mult = div_sc(MFGPT_HZ, NSEC_PER_SEC, 32); 344 mfgpt_clockevent.mult = div_sc(MFGPT_HZ, NSEC_PER_SEC, 32);
344 mfgpt_clockevent.min_delta_ns = clockevent_delta2ns(0xF, 345 mfgpt_clockevent.min_delta_ns = clockevent_delta2ns(0xF,
diff --git a/arch/x86/kernel/nmi_32.c b/arch/x86/kernel/nmi_32.c
index 80ca72e5ac29..852db2906921 100644
--- a/arch/x86/kernel/nmi_32.c
+++ b/arch/x86/kernel/nmi_32.c
@@ -25,7 +25,6 @@
25 25
26#include <asm/smp.h> 26#include <asm/smp.h>
27#include <asm/nmi.h> 27#include <asm/nmi.h>
28#include <asm/timer.h>
29 28
30#include "mach_traps.h" 29#include "mach_traps.h"
31 30
@@ -84,7 +83,7 @@ static int __init check_nmi_watchdog(void)
84 83
85 prev_nmi_count = kmalloc(NR_CPUS * sizeof(int), GFP_KERNEL); 84 prev_nmi_count = kmalloc(NR_CPUS * sizeof(int), GFP_KERNEL);
86 if (!prev_nmi_count) 85 if (!prev_nmi_count)
87 goto error; 86 return -1;
88 87
89 printk(KERN_INFO "Testing NMI watchdog ... "); 88 printk(KERN_INFO "Testing NMI watchdog ... ");
90 89
@@ -119,7 +118,7 @@ static int __init check_nmi_watchdog(void)
119 if (!atomic_read(&nmi_active)) { 118 if (!atomic_read(&nmi_active)) {
120 kfree(prev_nmi_count); 119 kfree(prev_nmi_count);
121 atomic_set(&nmi_active, -1); 120 atomic_set(&nmi_active, -1);
122 goto error; 121 return -1;
123 } 122 }
124 printk("OK.\n"); 123 printk("OK.\n");
125 124
@@ -130,10 +129,6 @@ static int __init check_nmi_watchdog(void)
130 129
131 kfree(prev_nmi_count); 130 kfree(prev_nmi_count);
132 return 0; 131 return 0;
133error:
134 timer_ack = !cpu_has_tsc;
135
136 return -1;
137} 132}
138/* This needs to happen later in boot so counters are working */ 133/* This needs to happen later in boot so counters are working */
139late_initcall(check_nmi_watchdog); 134late_initcall(check_nmi_watchdog);
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 9663c2a74830..46d391d49de8 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -204,6 +204,10 @@ void cpu_idle(void)
204 } 204 }
205} 205}
206 206
207static void do_nothing(void *unused)
208{
209}
210
207void cpu_idle_wait(void) 211void cpu_idle_wait(void)
208{ 212{
209 unsigned int cpu, this_cpu = get_cpu(); 213 unsigned int cpu, this_cpu = get_cpu();
@@ -228,6 +232,13 @@ void cpu_idle_wait(void)
228 cpu_clear(cpu, map); 232 cpu_clear(cpu, map);
229 } 233 }
230 cpus_and(map, map, cpu_online_map); 234 cpus_and(map, map, cpu_online_map);
235 /*
236 * We waited 1 sec, if a CPU still did not call idle
237 * it may be because it is in idle and not waking up
238 * because it has nothing to do.
239 * Give all the remaining CPUS a kick.
240 */
241 smp_call_function_mask(map, do_nothing, 0, 0);
231 } while (!cpus_empty(map)); 242 } while (!cpus_empty(map));
232 243
233 set_cpus_allowed(current, tmp); 244 set_cpus_allowed(current, tmp);
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 6309b275cb9c..ab79e1dfa023 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -135,6 +135,10 @@ static void poll_idle (void)
135 cpu_relax(); 135 cpu_relax();
136} 136}
137 137
138static void do_nothing(void *unused)
139{
140}
141
138void cpu_idle_wait(void) 142void cpu_idle_wait(void)
139{ 143{
140 unsigned int cpu, this_cpu = get_cpu(); 144 unsigned int cpu, this_cpu = get_cpu();
@@ -160,6 +164,13 @@ void cpu_idle_wait(void)
160 cpu_clear(cpu, map); 164 cpu_clear(cpu, map);
161 } 165 }
162 cpus_and(map, map, cpu_online_map); 166 cpus_and(map, map, cpu_online_map);
167 /*
168 * We waited 1 sec, if a CPU still did not call idle
169 * it may be because it is in idle and not waking up
170 * because it has nothing to do.
171 * Give all the remaining CPUS a kick.
172 */
173 smp_call_function_mask(map, do_nothing, 0, 0);
163 } while (!cpus_empty(map)); 174 } while (!cpus_empty(map));
164 175
165 set_cpus_allowed(current, tmp); 176 set_cpus_allowed(current, tmp);
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c
index 594889521da1..aaf4e1291217 100644
--- a/arch/x86/kernel/smpboot_64.c
+++ b/arch/x86/kernel/smpboot_64.c
@@ -141,8 +141,8 @@ static void __cpuinit smp_store_cpu_info(int id)
141 struct cpuinfo_x86 *c = &cpu_data(id); 141 struct cpuinfo_x86 *c = &cpu_data(id);
142 142
143 *c = boot_cpu_data; 143 *c = boot_cpu_data;
144 identify_cpu(c);
145 c->cpu_index = id; 144 c->cpu_index = id;
145 identify_cpu(c);
146 print_cpu_info(c); 146 print_cpu_info(c);
147} 147}
148 148
@@ -526,7 +526,7 @@ struct create_idle {
526 int cpu; 526 int cpu;
527}; 527};
528 528
529void do_fork_idle(struct work_struct *work) 529static void __cpuinit do_fork_idle(struct work_struct *work)
530{ 530{
531 struct create_idle *c_idle = 531 struct create_idle *c_idle =
532 container_of(work, struct create_idle, work); 532 container_of(work, struct create_idle, work);
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index c88bbffcaa03..02d1e1e58e81 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -541,6 +541,7 @@ fastcall void do_##name(struct pt_regs * regs, long error_code) \
541 info.si_errno = 0; \ 541 info.si_errno = 0; \
542 info.si_code = sicode; \ 542 info.si_code = sicode; \
543 info.si_addr = (void __user *)siaddr; \ 543 info.si_addr = (void __user *)siaddr; \
544 trace_hardirqs_fixup(); \
544 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ 545 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
545 == NOTIFY_STOP) \ 546 == NOTIFY_STOP) \
546 return; \ 547 return; \
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index d11525ad81b4..cc68b92316cd 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -635,6 +635,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
635 info.si_errno = 0; \ 635 info.si_errno = 0; \
636 info.si_code = sicode; \ 636 info.si_code = sicode; \
637 info.si_addr = (void __user *)siaddr; \ 637 info.si_addr = (void __user *)siaddr; \
638 trace_hardirqs_fixup(); \
638 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ 639 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
639 == NOTIFY_STOP) \ 640 == NOTIFY_STOP) \
640 return; \ 641 return; \
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index c7d19471261d..3c76d194fd2c 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -321,8 +321,13 @@ extern void set_highmem_pages_init(int);
321static void __init set_highmem_pages_init(int bad_ppro) 321static void __init set_highmem_pages_init(int bad_ppro)
322{ 322{
323 int pfn; 323 int pfn;
324 for (pfn = highstart_pfn; pfn < highend_pfn; pfn++) 324 for (pfn = highstart_pfn; pfn < highend_pfn; pfn++) {
325 add_one_highpage_init(pfn_to_page(pfn), pfn, bad_ppro); 325 /*
326 * Holes under sparsemem might not have no mem_map[]:
327 */
328 if (pfn_valid(pfn))
329 add_one_highpage_init(pfn_to_page(pfn), pfn, bad_ppro);
330 }
326 totalram_pages += totalhigh_pages; 331 totalram_pages += totalhigh_pages;
327} 332}
328#endif /* CONFIG_FLATMEM */ 333#endif /* CONFIG_FLATMEM */
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 2d0eeac7251f..944bbcdd2b8d 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -380,7 +380,7 @@ static int __init ppro_init(char ** cpu_type)
380 380
381 if (cpu_model == 14) 381 if (cpu_model == 14)
382 *cpu_type = "i386/core"; 382 *cpu_type = "i386/core";
383 else if (cpu_model == 15) 383 else if (cpu_model == 15 || cpu_model == 23)
384 *cpu_type = "i386/core_2"; 384 *cpu_type = "i386/core_2";
385 else if (cpu_model > 0xd) 385 else if (cpu_model > 0xd)
386 return 0; 386 return 0;