aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/process.c3
-rw-r--r--arch/arm/boot/compressed/head-shark.S42
-rw-r--r--arch/arm/configs/bast_defconfig1
-rw-r--r--arch/arm/configs/s3c2410_defconfig1
-rw-r--r--arch/arm/kernel/process.c4
-rw-r--r--arch/arm/kernel/smp.c6
-rw-r--r--arch/arm/mach-integrator/platsmp.c8
-rw-r--r--arch/arm/mach-s3c2410/Makefile2
-rw-r--r--arch/arm/mach-s3c2410/clock.c57
-rw-r--r--arch/arm/mach-s3c2410/dma.c2
-rw-r--r--arch/arm/mach-s3c2410/irq.c260
-rw-r--r--arch/arm/mach-s3c2410/irq.h99
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c48
-rw-r--r--arch/arm/mach-s3c2410/s3c2440-clock.c116
-rw-r--r--arch/arm/mach-s3c2410/s3c2440-irq.c207
-rw-r--r--arch/arm/mm/mm-armv.c3
-rw-r--r--arch/arm/nwfpe/fpa11.h4
-rw-r--r--arch/arm/nwfpe/fpmodule.c2
-rw-r--r--arch/arm/nwfpe/fpmodule.inl14
-rw-r--r--arch/arm26/kernel/process.c5
-rw-r--r--arch/cris/kernel/process.c9
-rw-r--r--arch/h8300/kernel/process.c6
-rw-r--r--arch/i386/kernel/apm.c7
-rw-r--r--arch/i386/kernel/i387.c11
-rw-r--r--arch/i386/kernel/process.c20
-rw-r--r--arch/i386/kernel/reboot.c19
-rw-r--r--arch/i386/kernel/setup.c14
-rw-r--r--arch/i386/mach-visws/reboot.c5
-rw-r--r--arch/i386/mach-voyager/voyager_basic.c5
-rw-r--r--arch/ia64/kernel/process.c5
-rw-r--r--arch/ia64/sn/kernel/xpc_main.c2
-rw-r--r--arch/m32r/kernel/process.c6
-rw-r--r--arch/m68k/kernel/process.c6
-rw-r--r--arch/m68knommu/kernel/process.c6
-rw-r--r--arch/mips/kernel/reset.c5
-rw-r--r--arch/parisc/kernel/process.c6
-rw-r--r--arch/ppc/kernel/setup.c6
-rw-r--r--arch/ppc64/kernel/setup.c3
-rw-r--r--arch/s390/kernel/setup.c6
-rw-r--r--arch/sh/kernel/process.c6
-rw-r--r--arch/sparc/kernel/process.c6
-rw-r--r--arch/sparc64/kernel/entry.S17
-rw-r--r--arch/sparc64/kernel/irq.c20
-rw-r--r--arch/sparc64/kernel/power.c2
-rw-r--r--arch/sparc64/kernel/process.c6
-rw-r--r--arch/sparc64/kernel/smp.c2
-rw-r--r--arch/sparc64/kernel/traps.c2
-rw-r--r--arch/um/kernel/reboot.c6
-rw-r--r--arch/v850/kernel/anna.c6
-rw-r--r--arch/v850/kernel/as85ep1.c6
-rw-r--r--arch/v850/kernel/fpga85e2c.c6
-rw-r--r--arch/v850/kernel/rte_cb.c6
-rw-r--r--arch/v850/kernel/sim.c6
-rw-r--r--arch/v850/kernel/sim85e2.c5
-rw-r--r--arch/x86_64/ia32/ia32entry.S8
-rw-r--r--arch/x86_64/ia32/sys_ia32.c5
-rw-r--r--arch/x86_64/kernel/reboot.c31
57 files changed, 589 insertions, 588 deletions
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 4933f3ce5833..fa98dae3cd98 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -165,7 +165,6 @@ machine_restart(char *restart_cmd)
165 common_shutdown(LINUX_REBOOT_CMD_RESTART, restart_cmd); 165 common_shutdown(LINUX_REBOOT_CMD_RESTART, restart_cmd);
166} 166}
167 167
168EXPORT_SYMBOL(machine_restart);
169 168
170void 169void
171machine_halt(void) 170machine_halt(void)
@@ -173,7 +172,6 @@ machine_halt(void)
173 common_shutdown(LINUX_REBOOT_CMD_HALT, NULL); 172 common_shutdown(LINUX_REBOOT_CMD_HALT, NULL);
174} 173}
175 174
176EXPORT_SYMBOL(machine_halt);
177 175
178void 176void
179machine_power_off(void) 177machine_power_off(void)
@@ -181,7 +179,6 @@ machine_power_off(void)
181 common_shutdown(LINUX_REBOOT_CMD_POWER_OFF, NULL); 179 common_shutdown(LINUX_REBOOT_CMD_POWER_OFF, NULL);
182} 180}
183 181
184EXPORT_SYMBOL(machine_power_off);
185 182
186/* Used by sysrq-p, among others. I don't believe r9-r15 are ever 183/* Used by sysrq-p, among others. I don't believe r9-r15 are ever
187 saved in the context it's used. */ 184 saved in the context it's used. */
diff --git a/arch/arm/boot/compressed/head-shark.S b/arch/arm/boot/compressed/head-shark.S
index 848f60e5429b..089c560e07f1 100644
--- a/arch/arm/boot/compressed/head-shark.S
+++ b/arch/arm/boot/compressed/head-shark.S
@@ -63,8 +63,8 @@ __beginning: mov r4, r0 @ save the entry to the firmware
63 63
64 mov pc, r2 64 mov pc, r2
65 65
66__copy_target: .long 0x08508000 66__copy_target: .long 0x08507FFC
67__copy_end: .long 0x08608000 67__copy_end: .long 0x08607FFC
68 68
69 .word _start 69 .word _start
70 .word __bss_start 70 .word __bss_start
@@ -73,9 +73,10 @@ __copy_end: .long 0x08608000
73__temp_stack: .space 128 73__temp_stack: .space 128
74 74
75__mmu_off: 75__mmu_off:
76 adr r0, __ofw_data 76 adr r0, __ofw_data @ read the 1. entry of the memory map
77 ldr r0, [r0, #4] 77 ldr r0, [r0, #4]
78 orr r0, r0, #0x00600000 78 orr r0, r0, #0x00600000
79 sub r0, r0, #4
79 80
80 ldr r1, __copy_end 81 ldr r1, __copy_end
81 ldr r3, __copy_target 82 ldr r3, __copy_target
@@ -89,20 +90,43 @@ __mmu_off:
89 * from 0x08500000 to 0x08508000 if we have only 8MB 90 * from 0x08500000 to 0x08508000 if we have only 8MB
90 */ 91 */
91 92
93/* As we get more 2.6-kernels it gets more and more
94 * uncomfortable to be bound to kernel images of 1MB only.
95 * So we add a loop here, to be able to copy some more.
96 * Alexander Schulz 2005-07-17
97 */
98
99 mov r4, #3 @ How many megabytes to copy
100
101
102__MoveCode: sub r4, r4, #1
92 103
93__Copy: ldr r2, [r0], #-4 104__Copy: ldr r2, [r0], #-4
94 str r2, [r1], #-4 105 str r2, [r1], #-4
95 teq r1, r3 106 teq r1, r3
96 bne __Copy 107 bne __Copy
108
109 /* The firmware maps us in blocks of 1 MB, the next block is
110 _below_ the last one. So our decrementing source pointer
111 ist right here, but the destination pointer must be increased
112 by 2 MB */
113 add r1, r1, #0x00200000
114 add r3, r3, #0x00100000
115
116 teq r4, #0
117 bne __MoveCode
118
119
97 /* and jump to it */ 120 /* and jump to it */
98 adr r2, __go_on 121 adr r2, __go_on @ where we want to jump
99 adr r0, __ofw_data 122 adr r0, __ofw_data @ read the 1. entry of the memory map
100 ldr r0, [r0, #4] 123 ldr r0, [r0, #4]
101 sub r2, r2, r0 124 sub r2, r2, r0 @ we are mapped add 0e50 now, sub that (-0e00)
102 sub r2, r2, #0x00500000 125 sub r2, r2, #0x00500000 @ -0050
103 ldr r0, __copy_target 126 ldr r0, __copy_target @ and add 0850 8000 instead
127 add r0, r0, #4
104 add r2, r2, r0 128 add r2, r2, r0
105 mov pc, r2 129 mov pc, r2 @ and jump there
106 130
107__go_on: 131__go_on:
108 adr sp, __temp_stack 132 adr sp, __temp_stack
diff --git a/arch/arm/configs/bast_defconfig b/arch/arm/configs/bast_defconfig
index 2d985e9611cd..35e3a99bcbb6 100644
--- a/arch/arm/configs/bast_defconfig
+++ b/arch/arm/configs/bast_defconfig
@@ -561,7 +561,6 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
561# 561#
562CONFIG_SERIAL_S3C2410=y 562CONFIG_SERIAL_S3C2410=y
563CONFIG_SERIAL_S3C2410_CONSOLE=y 563CONFIG_SERIAL_S3C2410_CONSOLE=y
564CONFIG_SERIAL_BAST_SIO=y
565CONFIG_SERIAL_CORE=y 564CONFIG_SERIAL_CORE=y
566CONFIG_SERIAL_CORE_CONSOLE=y 565CONFIG_SERIAL_CORE_CONSOLE=y
567CONFIG_UNIX98_PTYS=y 566CONFIG_UNIX98_PTYS=y
diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig
index 98b72ff38832..96a794d8de84 100644
--- a/arch/arm/configs/s3c2410_defconfig
+++ b/arch/arm/configs/s3c2410_defconfig
@@ -570,7 +570,6 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
570# 570#
571CONFIG_SERIAL_S3C2410=y 571CONFIG_SERIAL_S3C2410=y
572CONFIG_SERIAL_S3C2410_CONSOLE=y 572CONFIG_SERIAL_S3C2410_CONSOLE=y
573CONFIG_SERIAL_BAST_SIO=y
574CONFIG_SERIAL_CORE=y 573CONFIG_SERIAL_CORE=y
575CONFIG_SERIAL_CORE_CONSOLE=y 574CONFIG_SERIAL_CORE_CONSOLE=y
576CONFIG_UNIX98_PTYS=y 575CONFIG_UNIX98_PTYS=y
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index bbea636ff687..409db6d5ec99 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -131,7 +131,6 @@ void machine_halt(void)
131{ 131{
132} 132}
133 133
134EXPORT_SYMBOL(machine_halt);
135 134
136void machine_power_off(void) 135void machine_power_off(void)
137{ 136{
@@ -139,7 +138,6 @@ void machine_power_off(void)
139 pm_power_off(); 138 pm_power_off();
140} 139}
141 140
142EXPORT_SYMBOL(machine_power_off);
143 141
144void machine_restart(char * __unused) 142void machine_restart(char * __unused)
145{ 143{
@@ -169,8 +167,6 @@ void machine_restart(char * __unused)
169 while (1); 167 while (1);
170} 168}
171 169
172EXPORT_SYMBOL(machine_restart);
173
174void __show_regs(struct pt_regs *regs) 170void __show_regs(struct pt_regs *regs)
175{ 171{
176 unsigned long flags = condition_codes(regs); 172 unsigned long flags = condition_codes(regs);
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 7ae45c3fc834..295e0a8379cf 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -78,7 +78,7 @@ struct smp_call_struct {
78static struct smp_call_struct * volatile smp_call_function_data; 78static struct smp_call_struct * volatile smp_call_function_data;
79static DEFINE_SPINLOCK(smp_call_function_lock); 79static DEFINE_SPINLOCK(smp_call_function_lock);
80 80
81int __init __cpu_up(unsigned int cpu) 81int __cpuinit __cpu_up(unsigned int cpu)
82{ 82{
83 struct task_struct *idle; 83 struct task_struct *idle;
84 pgd_t *pgd; 84 pgd_t *pgd;
@@ -159,7 +159,7 @@ int __init __cpu_up(unsigned int cpu)
159 * This is the secondary CPU boot entry. We're using this CPUs 159 * This is the secondary CPU boot entry. We're using this CPUs
160 * idle thread stack, but a set of temporary page tables. 160 * idle thread stack, but a set of temporary page tables.
161 */ 161 */
162asmlinkage void __init secondary_start_kernel(void) 162asmlinkage void __cpuinit secondary_start_kernel(void)
163{ 163{
164 struct mm_struct *mm = &init_mm; 164 struct mm_struct *mm = &init_mm;
165 unsigned int cpu = smp_processor_id(); 165 unsigned int cpu = smp_processor_id();
@@ -209,7 +209,7 @@ asmlinkage void __init secondary_start_kernel(void)
209 * Called by both boot and secondaries to move global data into 209 * Called by both boot and secondaries to move global data into
210 * per-processor storage. 210 * per-processor storage.
211 */ 211 */
212void __init smp_store_cpu_info(unsigned int cpuid) 212void __cpuinit smp_store_cpu_info(unsigned int cpuid)
213{ 213{
214 struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid); 214 struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid);
215 215
diff --git a/arch/arm/mach-integrator/platsmp.c b/arch/arm/mach-integrator/platsmp.c
index 2ba025777098..aecf47ba033a 100644
--- a/arch/arm/mach-integrator/platsmp.c
+++ b/arch/arm/mach-integrator/platsmp.c
@@ -27,12 +27,12 @@ extern void integrator_secondary_startup(void);
27 * control for which core is the next to come out of the secondary 27 * control for which core is the next to come out of the secondary
28 * boot "holding pen" 28 * boot "holding pen"
29 */ 29 */
30volatile int __initdata pen_release = -1; 30volatile int __cpuinitdata pen_release = -1;
31unsigned long __initdata phys_pen_release = 0; 31unsigned long __cpuinitdata phys_pen_release = 0;
32 32
33static DEFINE_SPINLOCK(boot_lock); 33static DEFINE_SPINLOCK(boot_lock);
34 34
35void __init platform_secondary_init(unsigned int cpu) 35void __cpuinit platform_secondary_init(unsigned int cpu)
36{ 36{
37 /* 37 /*
38 * the primary core may have used a "cross call" soft interrupt 38 * the primary core may have used a "cross call" soft interrupt
@@ -61,7 +61,7 @@ void __init platform_secondary_init(unsigned int cpu)
61 spin_unlock(&boot_lock); 61 spin_unlock(&boot_lock);
62} 62}
63 63
64int __init boot_secondary(unsigned int cpu, struct task_struct *idle) 64int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
65{ 65{
66 unsigned long timeout; 66 unsigned long timeout;
67 67
diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile
index f99b689e4392..55ed7c7e57da 100644
--- a/arch/arm/mach-s3c2410/Makefile
+++ b/arch/arm/mach-s3c2410/Makefile
@@ -23,6 +23,8 @@ obj-$(CONFIG_PM_SIMTEC) += pm-simtec.o
23# S3C2440 support 23# S3C2440 support
24 24
25obj-$(CONFIG_CPU_S3C2440) += s3c2440.o s3c2440-dsc.o 25obj-$(CONFIG_CPU_S3C2440) += s3c2440.o s3c2440-dsc.o
26obj-$(CONFIG_CPU_S3C2440) += s3c2440-irq.o
27obj-$(CONFIG_CPU_S3C2440) += s3c2440-clock.o
26 28
27# machine specific support 29# machine specific support
28 30
diff --git a/arch/arm/mach-s3c2410/clock.c b/arch/arm/mach-s3c2410/clock.c
index 8d986b8401c2..9a66050e887d 100644
--- a/arch/arm/mach-s3c2410/clock.c
+++ b/arch/arm/mach-s3c2410/clock.c
@@ -448,60 +448,3 @@ int __init s3c24xx_setup_clocks(unsigned long xtal,
448 448
449 return 0; 449 return 0;
450} 450}
451
452/* S3C2440 extended clock support */
453
454#ifdef CONFIG_CPU_S3C2440
455
456static struct clk s3c2440_clk_upll = {
457 .name = "upll",
458 .id = -1,
459};
460
461static struct clk s3c2440_clk_cam = {
462 .name = "camif",
463 .parent = &clk_h,
464 .id = -1,
465 .enable = s3c24xx_clkcon_enable,
466 .ctrlbit = S3C2440_CLKCON_CAMERA,
467};
468
469static struct clk s3c2440_clk_ac97 = {
470 .name = "ac97",
471 .parent = &clk_p,
472 .id = -1,
473 .enable = s3c24xx_clkcon_enable,
474 .ctrlbit = S3C2440_CLKCON_CAMERA,
475};
476
477static int s3c2440_clk_add(struct sys_device *sysdev)
478{
479 unsigned long upllcon = __raw_readl(S3C2410_UPLLCON);
480
481 s3c2440_clk_upll.rate = s3c2410_get_pll(upllcon, clk_xtal.rate);
482
483 printk("S3C2440: Clock Support, UPLL %ld.%03ld MHz\n",
484 print_mhz(s3c2440_clk_upll.rate));
485
486 s3c24xx_register_clock(&s3c2440_clk_ac97);
487 s3c24xx_register_clock(&s3c2440_clk_cam);
488 s3c24xx_register_clock(&s3c2440_clk_upll);
489
490 clk_disable(&s3c2440_clk_ac97);
491 clk_disable(&s3c2440_clk_cam);
492
493 return 0;
494}
495
496static struct sysdev_driver s3c2440_clk_driver = {
497 .add = s3c2440_clk_add,
498};
499
500static int s3c24xx_clk_driver(void)
501{
502 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_clk_driver);
503}
504
505arch_initcall(s3c24xx_clk_driver);
506
507#endif /* CONFIG_CPU_S3C2440 */
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c
index c7c28890d406..65feaf20d23e 100644
--- a/arch/arm/mach-s3c2410/dma.c
+++ b/arch/arm/mach-s3c2410/dma.c
@@ -436,7 +436,7 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id,
436 436
437 buf = kmem_cache_alloc(dma_kmem, GFP_ATOMIC); 437 buf = kmem_cache_alloc(dma_kmem, GFP_ATOMIC);
438 if (buf == NULL) { 438 if (buf == NULL) {
439 pr_debug("%s: out of memory (%d alloc)\n", 439 pr_debug("%s: out of memory (%ld alloc)\n",
440 __FUNCTION__, sizeof(*buf)); 440 __FUNCTION__, sizeof(*buf));
441 return -ENOMEM; 441 return -ENOMEM;
442 } 442 }
diff --git a/arch/arm/mach-s3c2410/irq.c b/arch/arm/mach-s3c2410/irq.c
index cf9f46d88061..973a5fe6769c 100644
--- a/arch/arm/mach-s3c2410/irq.c
+++ b/arch/arm/mach-s3c2410/irq.c
@@ -45,6 +45,9 @@
45 * 45 *
46 * 28-Jun-2005 Ben Dooks 46 * 28-Jun-2005 Ben Dooks
47 * Mark IRQ_LCD valid 47 * Mark IRQ_LCD valid
48 *
49 * 25-Jul-2005 Ben Dooks
50 * Split the S3C2440 IRQ code to seperate file
48*/ 51*/
49 52
50#include <linux/init.h> 53#include <linux/init.h>
@@ -65,11 +68,7 @@
65 68
66#include "cpu.h" 69#include "cpu.h"
67#include "pm.h" 70#include "pm.h"
68 71#include "irq.h"
69#define irqdbf(x...)
70#define irqdbf2(x...)
71
72#define EXTINT_OFF (IRQ_EINT4 - 4)
73 72
74/* wakeup irq control */ 73/* wakeup irq control */
75 74
@@ -181,7 +180,7 @@ s3c_irq_unmask(unsigned int irqno)
181 __raw_writel(mask, S3C2410_INTMSK); 180 __raw_writel(mask, S3C2410_INTMSK);
182} 181}
183 182
184static struct irqchip s3c_irq_level_chip = { 183struct irqchip s3c_irq_level_chip = {
185 .ack = s3c_irq_maskack, 184 .ack = s3c_irq_maskack,
186 .mask = s3c_irq_mask, 185 .mask = s3c_irq_mask,
187 .unmask = s3c_irq_unmask, 186 .unmask = s3c_irq_unmask,
@@ -370,84 +369,6 @@ static struct irqchip s3c_irq_eint0t4 = {
370#define INTMSK_UART2 (1UL << (IRQ_UART2 - IRQ_EINT0)) 369#define INTMSK_UART2 (1UL << (IRQ_UART2 - IRQ_EINT0))
371#define INTMSK_ADCPARENT (1UL << (IRQ_ADCPARENT - IRQ_EINT0)) 370#define INTMSK_ADCPARENT (1UL << (IRQ_ADCPARENT - IRQ_EINT0))
372 371
373static inline void
374s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
375 int subcheck)
376{
377 unsigned long mask;
378 unsigned long submask;
379
380 submask = __raw_readl(S3C2410_INTSUBMSK);
381 mask = __raw_readl(S3C2410_INTMSK);
382
383 submask |= (1UL << (irqno - IRQ_S3CUART_RX0));
384
385 /* check to see if we need to mask the parent IRQ */
386
387 if ((submask & subcheck) == subcheck) {
388 __raw_writel(mask | parentbit, S3C2410_INTMSK);
389 }
390
391 /* write back masks */
392 __raw_writel(submask, S3C2410_INTSUBMSK);
393
394}
395
396static inline void
397s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit)
398{
399 unsigned long mask;
400 unsigned long submask;
401
402 submask = __raw_readl(S3C2410_INTSUBMSK);
403 mask = __raw_readl(S3C2410_INTMSK);
404
405 submask &= ~(1UL << (irqno - IRQ_S3CUART_RX0));
406 mask &= ~parentbit;
407
408 /* write back masks */
409 __raw_writel(submask, S3C2410_INTSUBMSK);
410 __raw_writel(mask, S3C2410_INTMSK);
411}
412
413
414static inline void
415s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int group)
416{
417 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
418
419 s3c_irqsub_mask(irqno, parentmask, group);
420
421 __raw_writel(bit, S3C2410_SUBSRCPND);
422
423 /* only ack parent if we've got all the irqs (seems we must
424 * ack, all and hope that the irq system retriggers ok when
425 * the interrupt goes off again)
426 */
427
428 if (1) {
429 __raw_writel(parentmask, S3C2410_SRCPND);
430 __raw_writel(parentmask, S3C2410_INTPND);
431 }
432}
433
434static inline void
435s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group)
436{
437 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
438
439 __raw_writel(bit, S3C2410_SUBSRCPND);
440
441 /* only ack parent if we've got all the irqs (seems we must
442 * ack, all and hope that the irq system retriggers ok when
443 * the interrupt goes off again)
444 */
445
446 if (1) {
447 __raw_writel(parentmask, S3C2410_SRCPND);
448 __raw_writel(parentmask, S3C2410_INTPND);
449 }
450}
451 372
452/* UART0 */ 373/* UART0 */
453 374
@@ -794,174 +715,3 @@ void __init s3c24xx_init_irq(void)
794 715
795 irqdbf("s3c2410: registered interrupt handlers\n"); 716 irqdbf("s3c2410: registered interrupt handlers\n");
796} 717}
797
798/* s3c2440 irq code
799*/
800
801#ifdef CONFIG_CPU_S3C2440
802
803/* WDT/AC97 */
804
805static void s3c_irq_demux_wdtac97(unsigned int irq,
806 struct irqdesc *desc,
807 struct pt_regs *regs)
808{
809 unsigned int subsrc, submsk;
810 struct irqdesc *mydesc;
811
812 /* read the current pending interrupts, and the mask
813 * for what it is available */
814
815 subsrc = __raw_readl(S3C2410_SUBSRCPND);
816 submsk = __raw_readl(S3C2410_INTSUBMSK);
817
818 subsrc &= ~submsk;
819 subsrc >>= 13;
820 subsrc &= 3;
821
822 if (subsrc != 0) {
823 if (subsrc & 1) {
824 mydesc = irq_desc + IRQ_S3C2440_WDT;
825 mydesc->handle( IRQ_S3C2440_WDT, mydesc, regs);
826 }
827 if (subsrc & 2) {
828 mydesc = irq_desc + IRQ_S3C2440_AC97;
829 mydesc->handle(IRQ_S3C2440_AC97, mydesc, regs);
830 }
831 }
832}
833
834
835#define INTMSK_WDT (1UL << (IRQ_WDT - IRQ_EINT0))
836
837static void
838s3c_irq_wdtac97_mask(unsigned int irqno)
839{
840 s3c_irqsub_mask(irqno, INTMSK_WDT, 3<<13);
841}
842
843static void
844s3c_irq_wdtac97_unmask(unsigned int irqno)
845{
846 s3c_irqsub_unmask(irqno, INTMSK_WDT);
847}
848
849static void
850s3c_irq_wdtac97_ack(unsigned int irqno)
851{
852 s3c_irqsub_maskack(irqno, INTMSK_WDT, 3<<13);
853}
854
855static struct irqchip s3c_irq_wdtac97 = {
856 .mask = s3c_irq_wdtac97_mask,
857 .unmask = s3c_irq_wdtac97_unmask,
858 .ack = s3c_irq_wdtac97_ack,
859};
860
861/* camera irq */
862
863static void s3c_irq_demux_cam(unsigned int irq,
864 struct irqdesc *desc,
865 struct pt_regs *regs)
866{
867 unsigned int subsrc, submsk;
868 struct irqdesc *mydesc;
869
870 /* read the current pending interrupts, and the mask
871 * for what it is available */
872
873 subsrc = __raw_readl(S3C2410_SUBSRCPND);
874 submsk = __raw_readl(S3C2410_INTSUBMSK);
875
876 subsrc &= ~submsk;
877 subsrc >>= 11;
878 subsrc &= 3;
879
880 if (subsrc != 0) {
881 if (subsrc & 1) {
882 mydesc = irq_desc + IRQ_S3C2440_CAM_C;
883 mydesc->handle( IRQ_S3C2440_WDT, mydesc, regs);
884 }
885 if (subsrc & 2) {
886 mydesc = irq_desc + IRQ_S3C2440_CAM_P;
887 mydesc->handle(IRQ_S3C2440_AC97, mydesc, regs);
888 }
889 }
890}
891
892#define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0))
893
894static void
895s3c_irq_cam_mask(unsigned int irqno)
896{
897 s3c_irqsub_mask(irqno, INTMSK_CAM, 3<<11);
898}
899
900static void
901s3c_irq_cam_unmask(unsigned int irqno)
902{
903 s3c_irqsub_unmask(irqno, INTMSK_CAM);
904}
905
906static void
907s3c_irq_cam_ack(unsigned int irqno)
908{
909 s3c_irqsub_maskack(irqno, INTMSK_CAM, 3<<11);
910}
911
912static struct irqchip s3c_irq_cam = {
913 .mask = s3c_irq_cam_mask,
914 .unmask = s3c_irq_cam_unmask,
915 .ack = s3c_irq_cam_ack,
916};
917
918static int s3c2440_irq_add(struct sys_device *sysdev)
919{
920 unsigned int irqno;
921
922 printk("S3C2440: IRQ Support\n");
923
924 set_irq_chip(IRQ_NFCON, &s3c_irq_level_chip);
925 set_irq_handler(IRQ_NFCON, do_level_IRQ);
926 set_irq_flags(IRQ_NFCON, IRQF_VALID);
927
928 /* add new chained handler for wdt, ac7 */
929
930 set_irq_chip(IRQ_WDT, &s3c_irq_level_chip);
931 set_irq_handler(IRQ_WDT, do_level_IRQ);
932 set_irq_chained_handler(IRQ_WDT, s3c_irq_demux_wdtac97);
933
934 for (irqno = IRQ_S3C2440_WDT; irqno <= IRQ_S3C2440_AC97; irqno++) {
935 set_irq_chip(irqno, &s3c_irq_wdtac97);
936 set_irq_handler(irqno, do_level_IRQ);
937 set_irq_flags(irqno, IRQF_VALID);
938 }
939
940 /* add chained handler for camera */
941
942 set_irq_chip(IRQ_CAM, &s3c_irq_level_chip);
943 set_irq_handler(IRQ_CAM, do_level_IRQ);
944 set_irq_chained_handler(IRQ_CAM, s3c_irq_demux_cam);
945
946 for (irqno = IRQ_S3C2440_CAM_C; irqno <= IRQ_S3C2440_CAM_P; irqno++) {
947 set_irq_chip(irqno, &s3c_irq_cam);
948 set_irq_handler(irqno, do_level_IRQ);
949 set_irq_flags(irqno, IRQF_VALID);
950 }
951
952 return 0;
953}
954
955static struct sysdev_driver s3c2440_irq_driver = {
956 .add = s3c2440_irq_add,
957};
958
959static int s3c24xx_irq_driver(void)
960{
961 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver);
962}
963
964arch_initcall(s3c24xx_irq_driver);
965
966#endif /* CONFIG_CPU_S3C2440 */
967
diff --git a/arch/arm/mach-s3c2410/irq.h b/arch/arm/mach-s3c2410/irq.h
new file mode 100644
index 000000000000..4abf0ca14e00
--- /dev/null
+++ b/arch/arm/mach-s3c2410/irq.h
@@ -0,0 +1,99 @@
1/* arch/arm/mach-s3c2410/irq.h
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for S3C24XX CPU IRQ support
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * Modifications:
13*/
14
15#define irqdbf(x...)
16#define irqdbf2(x...)
17
18#define EXTINT_OFF (IRQ_EINT4 - 4)
19
20extern struct irqchip s3c_irq_level_chip;
21
22static inline void
23s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
24 int subcheck)
25{
26 unsigned long mask;
27 unsigned long submask;
28
29 submask = __raw_readl(S3C2410_INTSUBMSK);
30 mask = __raw_readl(S3C2410_INTMSK);
31
32 submask |= (1UL << (irqno - IRQ_S3CUART_RX0));
33
34 /* check to see if we need to mask the parent IRQ */
35
36 if ((submask & subcheck) == subcheck) {
37 __raw_writel(mask | parentbit, S3C2410_INTMSK);
38 }
39
40 /* write back masks */
41 __raw_writel(submask, S3C2410_INTSUBMSK);
42
43}
44
45static inline void
46s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit)
47{
48 unsigned long mask;
49 unsigned long submask;
50
51 submask = __raw_readl(S3C2410_INTSUBMSK);
52 mask = __raw_readl(S3C2410_INTMSK);
53
54 submask &= ~(1UL << (irqno - IRQ_S3CUART_RX0));
55 mask &= ~parentbit;
56
57 /* write back masks */
58 __raw_writel(submask, S3C2410_INTSUBMSK);
59 __raw_writel(mask, S3C2410_INTMSK);
60}
61
62
63static inline void
64s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int group)
65{
66 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
67
68 s3c_irqsub_mask(irqno, parentmask, group);
69
70 __raw_writel(bit, S3C2410_SUBSRCPND);
71
72 /* only ack parent if we've got all the irqs (seems we must
73 * ack, all and hope that the irq system retriggers ok when
74 * the interrupt goes off again)
75 */
76
77 if (1) {
78 __raw_writel(parentmask, S3C2410_SRCPND);
79 __raw_writel(parentmask, S3C2410_INTPND);
80 }
81}
82
83static inline void
84s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group)
85{
86 unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
87
88 __raw_writel(bit, S3C2410_SUBSRCPND);
89
90 /* only ack parent if we've got all the irqs (seems we must
91 * ack, all and hope that the irq system retriggers ok when
92 * the interrupt goes off again)
93 */
94
95 if (1) {
96 __raw_writel(parentmask, S3C2410_SRCPND);
97 __raw_writel(parentmask, S3C2410_INTPND);
98 }
99}
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index ccb6bcefa46c..1e7f343822d0 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -25,9 +25,11 @@
25 * 14-Jan-2005 BJD Add support for muitlple NAND devices 25 * 14-Jan-2005 BJD Add support for muitlple NAND devices
26 * 03-Mar-2005 BJD Ensured that bast-cpld.h is included 26 * 03-Mar-2005 BJD Ensured that bast-cpld.h is included
27 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA 27 * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
28 * 14-Mar-2006 BJD Updated for __iomem changes 28 * 14-Mar-2005 BJD Updated for __iomem changes
29 * 22-Jun-2006 BJD Added DM9000 platform information 29 * 22-Jun-2005 BJD Added DM9000 platform information
30 * 28-Jun-2006 BJD Moved pm functionality out to common code 30 * 28-Jun-2005 BJD Moved pm functionality out to common code
31 * 17-Jul-2005 BJD Changed to platform device for SuperIO 16550s
32 * 25-Jul-2005 BJD Removed ASIX static mappings
31*/ 33*/
32 34
33#include <linux/kernel.h> 35#include <linux/kernel.h>
@@ -64,6 +66,8 @@
64#include <linux/mtd/nand_ecc.h> 66#include <linux/mtd/nand_ecc.h>
65#include <linux/mtd/partitions.h> 67#include <linux/mtd/partitions.h>
66 68
69#include <linux/serial_8250.h>
70
67#include "clock.h" 71#include "clock.h"
68#include "devs.h" 72#include "devs.h"
69#include "cpu.h" 73#include "cpu.h"
@@ -113,7 +117,6 @@ static struct map_desc bast_iodesc[] __initdata = {
113 /* slow, byte */ 117 /* slow, byte */
114 { VA_C2(BAST_VA_ISAIO), PA_CS2(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 118 { VA_C2(BAST_VA_ISAIO), PA_CS2(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
115 { VA_C2(BAST_VA_ISAMEM), PA_CS2(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE }, 119 { VA_C2(BAST_VA_ISAMEM), PA_CS2(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
116 { VA_C2(BAST_VA_ASIXNET), PA_CS3(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
117 { VA_C2(BAST_VA_SUPERIO), PA_CS2(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE }, 120 { VA_C2(BAST_VA_SUPERIO), PA_CS2(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
118 { VA_C2(BAST_VA_IDEPRI), PA_CS3(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE }, 121 { VA_C2(BAST_VA_IDEPRI), PA_CS3(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE },
119 { VA_C2(BAST_VA_IDESEC), PA_CS3(BAST_PA_IDESEC), SZ_1M, MT_DEVICE }, 122 { VA_C2(BAST_VA_IDESEC), PA_CS3(BAST_PA_IDESEC), SZ_1M, MT_DEVICE },
@@ -123,7 +126,6 @@ static struct map_desc bast_iodesc[] __initdata = {
123 /* slow, word */ 126 /* slow, word */
124 { VA_C3(BAST_VA_ISAIO), PA_CS3(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 127 { VA_C3(BAST_VA_ISAIO), PA_CS3(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
125 { VA_C3(BAST_VA_ISAMEM), PA_CS3(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE }, 128 { VA_C3(BAST_VA_ISAMEM), PA_CS3(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
126 { VA_C3(BAST_VA_ASIXNET), PA_CS3(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
127 { VA_C3(BAST_VA_SUPERIO), PA_CS3(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE }, 129 { VA_C3(BAST_VA_SUPERIO), PA_CS3(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
128 { VA_C3(BAST_VA_IDEPRI), PA_CS3(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE }, 130 { VA_C3(BAST_VA_IDEPRI), PA_CS3(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE },
129 { VA_C3(BAST_VA_IDESEC), PA_CS3(BAST_PA_IDESEC), SZ_1M, MT_DEVICE }, 131 { VA_C3(BAST_VA_IDESEC), PA_CS3(BAST_PA_IDESEC), SZ_1M, MT_DEVICE },
@@ -133,7 +135,6 @@ static struct map_desc bast_iodesc[] __initdata = {
133 /* fast, byte */ 135 /* fast, byte */
134 { VA_C4(BAST_VA_ISAIO), PA_CS4(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 136 { VA_C4(BAST_VA_ISAIO), PA_CS4(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
135 { VA_C4(BAST_VA_ISAMEM), PA_CS4(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE }, 137 { VA_C4(BAST_VA_ISAMEM), PA_CS4(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
136 { VA_C4(BAST_VA_ASIXNET), PA_CS5(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
137 { VA_C4(BAST_VA_SUPERIO), PA_CS4(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE }, 138 { VA_C4(BAST_VA_SUPERIO), PA_CS4(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
138 { VA_C4(BAST_VA_IDEPRI), PA_CS5(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE }, 139 { VA_C4(BAST_VA_IDEPRI), PA_CS5(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE },
139 { VA_C4(BAST_VA_IDESEC), PA_CS5(BAST_PA_IDESEC), SZ_1M, MT_DEVICE }, 140 { VA_C4(BAST_VA_IDESEC), PA_CS5(BAST_PA_IDESEC), SZ_1M, MT_DEVICE },
@@ -143,7 +144,6 @@ static struct map_desc bast_iodesc[] __initdata = {
143 /* fast, word */ 144 /* fast, word */
144 { VA_C5(BAST_VA_ISAIO), PA_CS5(BAST_PA_ISAIO), SZ_16M, MT_DEVICE }, 145 { VA_C5(BAST_VA_ISAIO), PA_CS5(BAST_PA_ISAIO), SZ_16M, MT_DEVICE },
145 { VA_C5(BAST_VA_ISAMEM), PA_CS5(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE }, 146 { VA_C5(BAST_VA_ISAMEM), PA_CS5(BAST_PA_ISAMEM), SZ_16M, MT_DEVICE },
146 { VA_C5(BAST_VA_ASIXNET), PA_CS5(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
147 { VA_C5(BAST_VA_SUPERIO), PA_CS5(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE }, 147 { VA_C5(BAST_VA_SUPERIO), PA_CS5(BAST_PA_SUPERIO), SZ_1M, MT_DEVICE },
148 { VA_C5(BAST_VA_IDEPRI), PA_CS5(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE }, 148 { VA_C5(BAST_VA_IDEPRI), PA_CS5(BAST_PA_IDEPRI), SZ_1M, MT_DEVICE },
149 { VA_C5(BAST_VA_IDESEC), PA_CS5(BAST_PA_IDESEC), SZ_1M, MT_DEVICE }, 149 { VA_C5(BAST_VA_IDESEC), PA_CS5(BAST_PA_IDESEC), SZ_1M, MT_DEVICE },
@@ -351,6 +351,39 @@ static struct platform_device bast_device_dm9k = {
351 } 351 }
352}; 352};
353 353
354/* serial devices */
355
356#define SERIAL_BASE (S3C2410_CS2 + BAST_PA_SUPERIO)
357#define SERIAL_FLAGS (UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SHARE_IRQ)
358#define SERIAL_CLK (1843200)
359
360static struct plat_serial8250_port bast_sio_data[] = {
361 [0] = {
362 .mapbase = SERIAL_BASE + 0x2f8,
363 .irq = IRQ_PCSERIAL1,
364 .flags = SERIAL_FLAGS,
365 .iotype = UPIO_MEM,
366 .regshift = 0,
367 .uartclk = SERIAL_CLK,
368 },
369 [1] = {
370 .mapbase = SERIAL_BASE + 0x3f8,
371 .irq = IRQ_PCSERIAL2,
372 .flags = SERIAL_FLAGS,
373 .iotype = UPIO_MEM,
374 .regshift = 0,
375 .uartclk = SERIAL_CLK,
376 },
377 { }
378};
379
380static struct platform_device bast_sio = {
381 .name = "serial8250",
382 .id = 0,
383 .dev = {
384 .platform_data = &bast_sio_data,
385 },
386};
354 387
355/* Standard BAST devices */ 388/* Standard BAST devices */
356 389
@@ -364,6 +397,7 @@ static struct platform_device *bast_devices[] __initdata = {
364 &s3c_device_nand, 397 &s3c_device_nand,
365 &bast_device_nor, 398 &bast_device_nor,
366 &bast_device_dm9k, 399 &bast_device_dm9k,
400 &bast_sio,
367}; 401};
368 402
369static struct clk *bast_clocks[] = { 403static struct clk *bast_clocks[] = {
diff --git a/arch/arm/mach-s3c2410/s3c2440-clock.c b/arch/arm/mach-s3c2410/s3c2440-clock.c
new file mode 100644
index 000000000000..b018a1f680ce
--- /dev/null
+++ b/arch/arm/mach-s3c2410/s3c2440-clock.c
@@ -0,0 +1,116 @@
1/* linux/arch/arm/mach-s3c2410/s3c2440-clock.c
2 *
3 * Copyright (c) 2004-2005 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C2440 Clock support
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22*/
23
24#include <linux/init.h>
25#include <linux/module.h>
26#include <linux/kernel.h>
27#include <linux/list.h>
28#include <linux/errno.h>
29#include <linux/err.h>
30#include <linux/device.h>
31#include <linux/sysdev.h>
32
33#include <linux/interrupt.h>
34#include <linux/ioport.h>
35
36#include <asm/hardware.h>
37#include <asm/atomic.h>
38#include <asm/irq.h>
39#include <asm/io.h>
40
41#include <asm/hardware/clock.h>
42#include <asm/arch/regs-clock.h>
43
44#include "clock.h"
45#include "cpu.h"
46
47/* S3C2440 extended clock support */
48
49static struct clk s3c2440_clk_upll = {
50 .name = "upll",
51 .id = -1,
52};
53
54static struct clk s3c2440_clk_cam = {
55 .name = "camif",
56 .id = -1,
57 .enable = s3c24xx_clkcon_enable,
58 .ctrlbit = S3C2440_CLKCON_CAMERA,
59};
60
61static struct clk s3c2440_clk_ac97 = {
62 .name = "ac97",
63 .id = -1,
64 .enable = s3c24xx_clkcon_enable,
65 .ctrlbit = S3C2440_CLKCON_CAMERA,
66};
67
68static int s3c2440_clk_add(struct sys_device *sysdev)
69{
70 unsigned long upllcon = __raw_readl(S3C2410_UPLLCON);
71 struct clk *clk_h;
72 struct clk *clk_p;
73 struct clk *clk_xtal;
74
75 clk_xtal = clk_get(NULL, "xtal");
76 if (IS_ERR(clk_xtal)) {
77 printk(KERN_ERR "S3C2440: Failed to get clk_xtal\n");
78 return -EINVAL;
79 }
80
81 s3c2440_clk_upll.rate = s3c2410_get_pll(upllcon, clk_xtal->rate);
82
83 printk("S3C2440: Clock Support, UPLL %ld.%03ld MHz\n",
84 print_mhz(s3c2440_clk_upll.rate));
85
86 clk_p = clk_get(NULL, "pclk");
87 clk_h = clk_get(NULL, "hclk");
88
89 if (IS_ERR(clk_p) || IS_ERR(clk_h)) {
90 printk(KERN_ERR "S3C2440: Failed to get parent clocks\n");
91 return -EINVAL;
92 }
93
94 s3c2440_clk_cam.parent = clk_h;
95 s3c2440_clk_ac97.parent = clk_p;
96
97 s3c24xx_register_clock(&s3c2440_clk_ac97);
98 s3c24xx_register_clock(&s3c2440_clk_cam);
99 s3c24xx_register_clock(&s3c2440_clk_upll);
100
101 clk_disable(&s3c2440_clk_ac97);
102 clk_disable(&s3c2440_clk_cam);
103
104 return 0;
105}
106
107static struct sysdev_driver s3c2440_clk_driver = {
108 .add = s3c2440_clk_add,
109};
110
111static __init int s3c24xx_clk_driver(void)
112{
113 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_clk_driver);
114}
115
116arch_initcall(s3c24xx_clk_driver);
diff --git a/arch/arm/mach-s3c2410/s3c2440-irq.c b/arch/arm/mach-s3c2410/s3c2440-irq.c
new file mode 100644
index 000000000000..7cb9912242a3
--- /dev/null
+++ b/arch/arm/mach-s3c2410/s3c2440-irq.c
@@ -0,0 +1,207 @@
1/* linux/arch/arm/mach-s3c2410/s3c2440-irq.c
2 *
3 * Copyright (c) 2003,2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * Changelog:
21 * 25-Jul-2005 BJD Split from irq.c
22 *
23*/
24
25#include <linux/init.h>
26#include <linux/module.h>
27#include <linux/interrupt.h>
28#include <linux/ioport.h>
29#include <linux/ptrace.h>
30#include <linux/sysdev.h>
31
32#include <asm/hardware.h>
33#include <asm/irq.h>
34#include <asm/io.h>
35
36#include <asm/mach/irq.h>
37
38#include <asm/arch/regs-irq.h>
39#include <asm/arch/regs-gpio.h>
40
41#include "cpu.h"
42#include "pm.h"
43#include "irq.h"
44
45/* WDT/AC97 */
46
47static void s3c_irq_demux_wdtac97(unsigned int irq,
48 struct irqdesc *desc,
49 struct pt_regs *regs)
50{
51 unsigned int subsrc, submsk;
52 struct irqdesc *mydesc;
53
54 /* read the current pending interrupts, and the mask
55 * for what it is available */
56
57 subsrc = __raw_readl(S3C2410_SUBSRCPND);
58 submsk = __raw_readl(S3C2410_INTSUBMSK);
59
60 subsrc &= ~submsk;
61 subsrc >>= 13;
62 subsrc &= 3;
63
64 if (subsrc != 0) {
65 if (subsrc & 1) {
66 mydesc = irq_desc + IRQ_S3C2440_WDT;
67 mydesc->handle( IRQ_S3C2440_WDT, mydesc, regs);
68 }
69 if (subsrc & 2) {
70 mydesc = irq_desc + IRQ_S3C2440_AC97;
71 mydesc->handle(IRQ_S3C2440_AC97, mydesc, regs);
72 }
73 }
74}
75
76
77#define INTMSK_WDT (1UL << (IRQ_WDT - IRQ_EINT0))
78
79static void
80s3c_irq_wdtac97_mask(unsigned int irqno)
81{
82 s3c_irqsub_mask(irqno, INTMSK_WDT, 3<<13);
83}
84
85static void
86s3c_irq_wdtac97_unmask(unsigned int irqno)
87{
88 s3c_irqsub_unmask(irqno, INTMSK_WDT);
89}
90
91static void
92s3c_irq_wdtac97_ack(unsigned int irqno)
93{
94 s3c_irqsub_maskack(irqno, INTMSK_WDT, 3<<13);
95}
96
97static struct irqchip s3c_irq_wdtac97 = {
98 .mask = s3c_irq_wdtac97_mask,
99 .unmask = s3c_irq_wdtac97_unmask,
100 .ack = s3c_irq_wdtac97_ack,
101};
102
103/* camera irq */
104
105static void s3c_irq_demux_cam(unsigned int irq,
106 struct irqdesc *desc,
107 struct pt_regs *regs)
108{
109 unsigned int subsrc, submsk;
110 struct irqdesc *mydesc;
111
112 /* read the current pending interrupts, and the mask
113 * for what it is available */
114
115 subsrc = __raw_readl(S3C2410_SUBSRCPND);
116 submsk = __raw_readl(S3C2410_INTSUBMSK);
117
118 subsrc &= ~submsk;
119 subsrc >>= 11;
120 subsrc &= 3;
121
122 if (subsrc != 0) {
123 if (subsrc & 1) {
124 mydesc = irq_desc + IRQ_S3C2440_CAM_C;
125 mydesc->handle( IRQ_S3C2440_WDT, mydesc, regs);
126 }
127 if (subsrc & 2) {
128 mydesc = irq_desc + IRQ_S3C2440_CAM_P;
129 mydesc->handle(IRQ_S3C2440_AC97, mydesc, regs);
130 }
131 }
132}
133
134#define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0))
135
136static void
137s3c_irq_cam_mask(unsigned int irqno)
138{
139 s3c_irqsub_mask(irqno, INTMSK_CAM, 3<<11);
140}
141
142static void
143s3c_irq_cam_unmask(unsigned int irqno)
144{
145 s3c_irqsub_unmask(irqno, INTMSK_CAM);
146}
147
148static void
149s3c_irq_cam_ack(unsigned int irqno)
150{
151 s3c_irqsub_maskack(irqno, INTMSK_CAM, 3<<11);
152}
153
154static struct irqchip s3c_irq_cam = {
155 .mask = s3c_irq_cam_mask,
156 .unmask = s3c_irq_cam_unmask,
157 .ack = s3c_irq_cam_ack,
158};
159
160static int s3c2440_irq_add(struct sys_device *sysdev)
161{
162 unsigned int irqno;
163
164 printk("S3C2440: IRQ Support\n");
165
166 set_irq_chip(IRQ_NFCON, &s3c_irq_level_chip);
167 set_irq_handler(IRQ_NFCON, do_level_IRQ);
168 set_irq_flags(IRQ_NFCON, IRQF_VALID);
169
170 /* add new chained handler for wdt, ac7 */
171
172 set_irq_chip(IRQ_WDT, &s3c_irq_level_chip);
173 set_irq_handler(IRQ_WDT, do_level_IRQ);
174 set_irq_chained_handler(IRQ_WDT, s3c_irq_demux_wdtac97);
175
176 for (irqno = IRQ_S3C2440_WDT; irqno <= IRQ_S3C2440_AC97; irqno++) {
177 set_irq_chip(irqno, &s3c_irq_wdtac97);
178 set_irq_handler(irqno, do_level_IRQ);
179 set_irq_flags(irqno, IRQF_VALID);
180 }
181
182 /* add chained handler for camera */
183
184 set_irq_chip(IRQ_CAM, &s3c_irq_level_chip);
185 set_irq_handler(IRQ_CAM, do_level_IRQ);
186 set_irq_chained_handler(IRQ_CAM, s3c_irq_demux_cam);
187
188 for (irqno = IRQ_S3C2440_CAM_C; irqno <= IRQ_S3C2440_CAM_P; irqno++) {
189 set_irq_chip(irqno, &s3c_irq_cam);
190 set_irq_handler(irqno, do_level_IRQ);
191 set_irq_flags(irqno, IRQF_VALID);
192 }
193
194 return 0;
195}
196
197static struct sysdev_driver s3c2440_irq_driver = {
198 .add = s3c2440_irq_add,
199};
200
201static int s3c24xx_irq_driver(void)
202{
203 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver);
204}
205
206arch_initcall(s3c24xx_irq_driver);
207
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
index b19f00e99a21..e33fe4229d05 100644
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -425,6 +425,9 @@ static void __init build_mem_type_table(void)
425 mem_types[MT_ROM].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; 425 mem_types[MT_ROM].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
426 mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; 426 mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
427 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; 427 mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
428
429 mem_types[MT_DEVICE].prot_pte |= L_PTE_BUFFERABLE;
430 mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED;
428 } 431 }
429 432
430 cp = &cache_policies[cachepolicy]; 433 cp = &cache_policies[cachepolicy];
diff --git a/arch/arm/nwfpe/fpa11.h b/arch/arm/nwfpe/fpa11.h
index 45cc65426a22..e4a61aea534b 100644
--- a/arch/arm/nwfpe/fpa11.h
+++ b/arch/arm/nwfpe/fpa11.h
@@ -29,9 +29,7 @@
29 * stack+task struct. Use the same method as 'current' uses to 29 * stack+task struct. Use the same method as 'current' uses to
30 * reach them. 30 * reach them.
31 */ 31 */
32register unsigned long *user_registers asm("sl"); 32#define GET_USERREG() ((struct pt_regs *)(THREAD_START_SP + (unsigned long)current_thread_info()) - 1)
33
34#define GET_USERREG() (user_registers)
35 33
36#include <linux/config.h> 34#include <linux/config.h>
37#include <linux/thread_info.h> 35#include <linux/thread_info.h>
diff --git a/arch/arm/nwfpe/fpmodule.c b/arch/arm/nwfpe/fpmodule.c
index a8efcf34888e..12885f31d347 100644
--- a/arch/arm/nwfpe/fpmodule.c
+++ b/arch/arm/nwfpe/fpmodule.c
@@ -132,7 +132,7 @@ void float_raise(signed char flags)
132 printk(KERN_DEBUG 132 printk(KERN_DEBUG
133 "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n", 133 "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n",
134 current->comm, current->pid, flags, 134 current->comm, current->pid, flags,
135 __builtin_return_address(0), GET_USERREG()[15]); 135 __builtin_return_address(0), GET_USERREG()->ARM_pc);
136#endif 136#endif
137 137
138 /* Keep SoftFloat exception flags up to date. */ 138 /* Keep SoftFloat exception flags up to date. */
diff --git a/arch/arm/nwfpe/fpmodule.inl b/arch/arm/nwfpe/fpmodule.inl
index e5f59e9a3022..2c39ad408f22 100644
--- a/arch/arm/nwfpe/fpmodule.inl
+++ b/arch/arm/nwfpe/fpmodule.inl
@@ -28,8 +28,8 @@ static inline unsigned long readRegister(const unsigned int nReg)
28 for this in this routine. LDF/STF instructions with Rn = PC 28 for this in this routine. LDF/STF instructions with Rn = PC
29 depend on the PC being correct, as they use PC+8 in their 29 depend on the PC being correct, as they use PC+8 in their
30 address calculations. */ 30 address calculations. */
31 unsigned long *userRegisters = GET_USERREG(); 31 struct pt_regs *regs = GET_USERREG();
32 unsigned int val = userRegisters[nReg]; 32 unsigned int val = regs->uregs[nReg];
33 if (REG_PC == nReg) 33 if (REG_PC == nReg)
34 val -= 4; 34 val -= 4;
35 return val; 35 return val;
@@ -38,8 +38,8 @@ static inline unsigned long readRegister(const unsigned int nReg)
38static inline void 38static inline void
39writeRegister(const unsigned int nReg, const unsigned long val) 39writeRegister(const unsigned int nReg, const unsigned long val)
40{ 40{
41 unsigned long *userRegisters = GET_USERREG(); 41 struct pt_regs *regs = GET_USERREG();
42 userRegisters[nReg] = val; 42 regs->uregs[nReg] = val;
43} 43}
44 44
45static inline unsigned long readCPSR(void) 45static inline unsigned long readCPSR(void)
@@ -63,12 +63,12 @@ static inline unsigned long readConditionCodes(void)
63 63
64static inline void writeConditionCodes(const unsigned long val) 64static inline void writeConditionCodes(const unsigned long val)
65{ 65{
66 unsigned long *userRegisters = GET_USERREG(); 66 struct pt_regs *regs = GET_USERREG();
67 unsigned long rval; 67 unsigned long rval;
68 /* 68 /*
69 * Operate directly on userRegisters since 69 * Operate directly on userRegisters since
70 * the CPSR may be the PC register itself. 70 * the CPSR may be the PC register itself.
71 */ 71 */
72 rval = userRegisters[REG_CPSR] & ~CC_MASK; 72 rval = regs->ARM_cpsr & ~CC_MASK;
73 userRegisters[REG_CPSR] = rval | (val & CC_MASK); 73 regs->ARM_cpsr = rval | (val & CC_MASK);
74} 74}
diff --git a/arch/arm26/kernel/process.c b/arch/arm26/kernel/process.c
index 46aea6ac194d..9eb9964d32a7 100644
--- a/arch/arm26/kernel/process.c
+++ b/arch/arm26/kernel/process.c
@@ -103,9 +103,6 @@ void machine_power_off(void)
103{ 103{
104} 104}
105 105
106EXPORT_SYMBOL(machine_halt);
107EXPORT_SYMBOL(machine_power_off);
108
109void machine_restart(char * __unused) 106void machine_restart(char * __unused)
110{ 107{
111 /* 108 /*
@@ -136,8 +133,6 @@ void machine_restart(char * __unused)
136 while (1); 133 while (1);
137} 134}
138 135
139EXPORT_SYMBOL(machine_restart);
140
141void show_regs(struct pt_regs * regs) 136void show_regs(struct pt_regs * regs)
142{ 137{
143 unsigned long flags; 138 unsigned long flags;
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c
index 9f7cad7c7849..a5ad2b675853 100644
--- a/arch/cris/kernel/process.c
+++ b/arch/cris/kernel/process.c
@@ -113,6 +113,7 @@
113#include <linux/user.h> 113#include <linux/user.h>
114#include <linux/elfcore.h> 114#include <linux/elfcore.h>
115#include <linux/mqueue.h> 115#include <linux/mqueue.h>
116#include <linux/reboot.h>
116 117
117//#define DEBUG 118//#define DEBUG
118 119
@@ -208,13 +209,11 @@ void cpu_idle (void)
208 209
209void hard_reset_now (void); 210void hard_reset_now (void);
210 211
211void machine_restart(void) 212void machine_restart(char *cmd)
212{ 213{
213 hard_reset_now(); 214 hard_reset_now();
214} 215}
215 216
216EXPORT_SYMBOL(machine_restart);
217
218/* 217/*
219 * Similar to machine_power_off, but don't shut off power. Add code 218 * Similar to machine_power_off, but don't shut off power. Add code
220 * here to freeze the system for e.g. post-mortem debug purpose when 219 * here to freeze the system for e.g. post-mortem debug purpose when
@@ -225,16 +224,12 @@ void machine_halt(void)
225{ 224{
226} 225}
227 226
228EXPORT_SYMBOL(machine_halt);
229
230/* If or when software power-off is implemented, add code here. */ 227/* If or when software power-off is implemented, add code here. */
231 228
232void machine_power_off(void) 229void machine_power_off(void)
233{ 230{
234} 231}
235 232
236EXPORT_SYMBOL(machine_power_off);
237
238/* 233/*
239 * When a process does an "exec", machine state like FPU and debug 234 * When a process does an "exec", machine state like FPU and debug
240 * registers need to be reset. This is a hook function for that. 235 * registers need to be reset. This is a hook function for that.
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c
index b5f83e9f04db..27f1fce64ce4 100644
--- a/arch/h8300/kernel/process.c
+++ b/arch/h8300/kernel/process.c
@@ -90,8 +90,6 @@ void machine_restart(char * __unused)
90 __asm__("jmp @@0"); 90 __asm__("jmp @@0");
91} 91}
92 92
93EXPORT_SYMBOL(machine_restart);
94
95void machine_halt(void) 93void machine_halt(void)
96{ 94{
97 local_irq_disable(); 95 local_irq_disable();
@@ -99,8 +97,6 @@ void machine_halt(void)
99 for (;;); 97 for (;;);
100} 98}
101 99
102EXPORT_SYMBOL(machine_halt);
103
104void machine_power_off(void) 100void machine_power_off(void)
105{ 101{
106 local_irq_disable(); 102 local_irq_disable();
@@ -108,8 +104,6 @@ void machine_power_off(void)
108 for (;;); 104 for (;;);
109} 105}
110 106
111EXPORT_SYMBOL(machine_power_off);
112
113void show_regs(struct pt_regs * regs) 107void show_regs(struct pt_regs * regs)
114{ 108{
115 printk("\nPC: %08lx Status: %02x", 109 printk("\nPC: %08lx Status: %02x",
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c
index 064211d5f41b..d7811c4e8b50 100644
--- a/arch/i386/kernel/apm.c
+++ b/arch/i386/kernel/apm.c
@@ -911,14 +911,7 @@ static void apm_power_off(void)
911 0xcd, 0x15 /* int $0x15 */ 911 0xcd, 0x15 /* int $0x15 */
912 }; 912 };
913 913
914 /*
915 * This may be called on an SMP machine.
916 */
917#ifdef CONFIG_SMP
918 /* Some bioses don't like being called from CPU != 0 */ 914 /* Some bioses don't like being called from CPU != 0 */
919 set_cpus_allowed(current, cpumask_of_cpu(0));
920 BUG_ON(smp_processor_id() != 0);
921#endif
922 if (apm_info.realmode_power_off) 915 if (apm_info.realmode_power_off)
923 { 916 {
924 (void)apm_save_cpus(); 917 (void)apm_save_cpus();
diff --git a/arch/i386/kernel/i387.c b/arch/i386/kernel/i387.c
index b817168d9c62..d75524758daf 100644
--- a/arch/i386/kernel/i387.c
+++ b/arch/i386/kernel/i387.c
@@ -82,17 +82,6 @@ void kernel_fpu_begin(void)
82} 82}
83EXPORT_SYMBOL_GPL(kernel_fpu_begin); 83EXPORT_SYMBOL_GPL(kernel_fpu_begin);
84 84
85void restore_fpu( struct task_struct *tsk )
86{
87 if ( cpu_has_fxsr ) {
88 asm volatile( "fxrstor %0"
89 : : "m" (tsk->thread.i387.fxsave) );
90 } else {
91 asm volatile( "frstor %0"
92 : : "m" (tsk->thread.i387.fsave) );
93 }
94}
95
96/* 85/*
97 * FPU tag word conversions. 86 * FPU tag word conversions.
98 */ 87 */
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index ba243a4cc119..d9492058aaf3 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -700,23 +700,27 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
700 700
701 /* 701 /*
702 * Restore %fs and %gs if needed. 702 * Restore %fs and %gs if needed.
703 *
704 * Glibc normally makes %fs be zero, and %gs is one of
705 * the TLS segments.
703 */ 706 */
704 if (unlikely(prev->fs | prev->gs | next->fs | next->gs)) { 707 if (unlikely(prev->fs | next->fs))
705 loadsegment(fs, next->fs); 708 loadsegment(fs, next->fs);
709
710 if (prev->gs | next->gs)
706 loadsegment(gs, next->gs); 711 loadsegment(gs, next->gs);
707 }
708 712
709 /* 713 /*
710 * Now maybe reload the debug registers 714 * Now maybe reload the debug registers
711 */ 715 */
712 if (unlikely(next->debugreg[7])) { 716 if (unlikely(next->debugreg[7])) {
713 set_debugreg(current->thread.debugreg[0], 0); 717 set_debugreg(next->debugreg[0], 0);
714 set_debugreg(current->thread.debugreg[1], 1); 718 set_debugreg(next->debugreg[1], 1);
715 set_debugreg(current->thread.debugreg[2], 2); 719 set_debugreg(next->debugreg[2], 2);
716 set_debugreg(current->thread.debugreg[3], 3); 720 set_debugreg(next->debugreg[3], 3);
717 /* no 4 and 5 */ 721 /* no 4 and 5 */
718 set_debugreg(current->thread.debugreg[6], 6); 722 set_debugreg(next->debugreg[6], 6);
719 set_debugreg(current->thread.debugreg[7], 7); 723 set_debugreg(next->debugreg[7], 7);
720 } 724 }
721 725
722 if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr)) 726 if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr))
diff --git a/arch/i386/kernel/reboot.c b/arch/i386/kernel/reboot.c
index b3e584849961..c71fef31dc47 100644
--- a/arch/i386/kernel/reboot.c
+++ b/arch/i386/kernel/reboot.c
@@ -284,7 +284,7 @@ void machine_shutdown(void)
284 reboot_cpu_id = 0; 284 reboot_cpu_id = 0;
285 285
286 /* See if there has been given a command line override */ 286 /* See if there has been given a command line override */
287 if ((reboot_cpu_id != -1) && (reboot_cpu < NR_CPUS) && 287 if ((reboot_cpu != -1) && (reboot_cpu < NR_CPUS) &&
288 cpu_isset(reboot_cpu, cpu_online_map)) { 288 cpu_isset(reboot_cpu, cpu_online_map)) {
289 reboot_cpu_id = reboot_cpu; 289 reboot_cpu_id = reboot_cpu;
290 } 290 }
@@ -311,10 +311,8 @@ void machine_shutdown(void)
311#endif 311#endif
312} 312}
313 313
314void machine_restart(char * __unused) 314void machine_emergency_restart(void)
315{ 315{
316 machine_shutdown();
317
318 if (!reboot_thru_bios) { 316 if (!reboot_thru_bios) {
319 if (efi_enabled) { 317 if (efi_enabled) {
320 efi.reset_system(EFI_RESET_COLD, EFI_SUCCESS, 0, NULL); 318 efi.reset_system(EFI_RESET_COLD, EFI_SUCCESS, 0, NULL);
@@ -337,23 +335,22 @@ void machine_restart(char * __unused)
337 machine_real_restart(jump_to_bios, sizeof(jump_to_bios)); 335 machine_real_restart(jump_to_bios, sizeof(jump_to_bios));
338} 336}
339 337
340EXPORT_SYMBOL(machine_restart); 338void machine_restart(char * __unused)
339{
340 machine_shutdown();
341 machine_emergency_restart();
342}
341 343
342void machine_halt(void) 344void machine_halt(void)
343{ 345{
344} 346}
345 347
346EXPORT_SYMBOL(machine_halt);
347
348void machine_power_off(void) 348void machine_power_off(void)
349{ 349{
350 lapic_shutdown(); 350 machine_shutdown();
351 351
352 if (efi_enabled)
353 efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
354 if (pm_power_off) 352 if (pm_power_off)
355 pm_power_off(); 353 pm_power_off();
356} 354}
357 355
358EXPORT_SYMBOL(machine_power_off);
359 356
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 7306353c520e..af4de58cab54 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -1414,7 +1414,7 @@ static struct nop {
1414 This runs before SMP is initialized to avoid SMP problems with 1414 This runs before SMP is initialized to avoid SMP problems with
1415 self modifying code. This implies that assymetric systems where 1415 self modifying code. This implies that assymetric systems where
1416 APs have less capabilities than the boot processor are not handled. 1416 APs have less capabilities than the boot processor are not handled.
1417 In this case boot with "noreplacement". */ 1417 Tough. Make sure you disable such features by hand. */
1418void apply_alternatives(void *start, void *end) 1418void apply_alternatives(void *start, void *end)
1419{ 1419{
1420 struct alt_instr *a; 1420 struct alt_instr *a;
@@ -1442,24 +1442,12 @@ void apply_alternatives(void *start, void *end)
1442 } 1442 }
1443} 1443}
1444 1444
1445static int no_replacement __initdata = 0;
1446
1447void __init alternative_instructions(void) 1445void __init alternative_instructions(void)
1448{ 1446{
1449 extern struct alt_instr __alt_instructions[], __alt_instructions_end[]; 1447 extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
1450 if (no_replacement)
1451 return;
1452 apply_alternatives(__alt_instructions, __alt_instructions_end); 1448 apply_alternatives(__alt_instructions, __alt_instructions_end);
1453} 1449}
1454 1450
1455static int __init noreplacement_setup(char *s)
1456{
1457 no_replacement = 1;
1458 return 0;
1459}
1460
1461__setup("noreplacement", noreplacement_setup);
1462
1463static char * __init machine_specific_memory_setup(void); 1451static char * __init machine_specific_memory_setup(void);
1464 1452
1465#ifdef CONFIG_MCA 1453#ifdef CONFIG_MCA
diff --git a/arch/i386/mach-visws/reboot.c b/arch/i386/mach-visws/reboot.c
index 95e4676594e1..9e9296676f93 100644
--- a/arch/i386/mach-visws/reboot.c
+++ b/arch/i386/mach-visws/reboot.c
@@ -22,8 +22,6 @@ void machine_restart(char * __unused)
22 outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT); 22 outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT);
23} 23}
24 24
25EXPORT_SYMBOL(machine_restart);
26
27void machine_power_off(void) 25void machine_power_off(void)
28{ 26{
29 unsigned short pm_status; 27 unsigned short pm_status;
@@ -43,10 +41,7 @@ void machine_power_off(void)
43 outl(PIIX_SPECIAL_STOP, 0xCFC); 41 outl(PIIX_SPECIAL_STOP, 0xCFC);
44} 42}
45 43
46EXPORT_SYMBOL(machine_power_off);
47
48void machine_halt(void) 44void machine_halt(void)
49{ 45{
50} 46}
51 47
52EXPORT_SYMBOL(machine_halt);
diff --git a/arch/i386/mach-voyager/voyager_basic.c b/arch/i386/mach-voyager/voyager_basic.c
index 8680080a6a89..b3eda46e0fe9 100644
--- a/arch/i386/mach-voyager/voyager_basic.c
+++ b/arch/i386/mach-voyager/voyager_basic.c
@@ -278,8 +278,6 @@ machine_restart(char *cmd)
278 } 278 }
279} 279}
280 280
281EXPORT_SYMBOL(machine_restart);
282
283void 281void
284mca_nmi_hook(void) 282mca_nmi_hook(void)
285{ 283{
@@ -315,12 +313,9 @@ machine_halt(void)
315 machine_power_off(); 313 machine_power_off();
316} 314}
317 315
318EXPORT_SYMBOL(machine_halt);
319
320void machine_power_off(void) 316void machine_power_off(void)
321{ 317{
322 if (pm_power_off) 318 if (pm_power_off)
323 pm_power_off(); 319 pm_power_off();
324} 320}
325 321
326EXPORT_SYMBOL(machine_power_off);
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index e484910246ad..66e840609808 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -807,16 +807,12 @@ machine_restart (char *restart_cmd)
807 (*efi.reset_system)(EFI_RESET_WARM, 0, 0, NULL); 807 (*efi.reset_system)(EFI_RESET_WARM, 0, 0, NULL);
808} 808}
809 809
810EXPORT_SYMBOL(machine_restart);
811
812void 810void
813machine_halt (void) 811machine_halt (void)
814{ 812{
815 cpu_halt(); 813 cpu_halt();
816} 814}
817 815
818EXPORT_SYMBOL(machine_halt);
819
820void 816void
821machine_power_off (void) 817machine_power_off (void)
822{ 818{
@@ -825,4 +821,3 @@ machine_power_off (void)
825 machine_halt(); 821 machine_halt();
826} 822}
827 823
828EXPORT_SYMBOL(machine_power_off);
diff --git a/arch/ia64/sn/kernel/xpc_main.c b/arch/ia64/sn/kernel/xpc_main.c
index d580adcad927..bb1d5cf30440 100644
--- a/arch/ia64/sn/kernel/xpc_main.c
+++ b/arch/ia64/sn/kernel/xpc_main.c
@@ -420,7 +420,7 @@ xpc_activating(void *__partid)
420 partid_t partid = (u64) __partid; 420 partid_t partid = (u64) __partid;
421 struct xpc_partition *part = &xpc_partitions[partid]; 421 struct xpc_partition *part = &xpc_partitions[partid];
422 unsigned long irq_flags; 422 unsigned long irq_flags;
423 struct sched_param param = { sched_priority: MAX_USER_RT_PRIO - 1 }; 423 struct sched_param param = { sched_priority: MAX_RT_PRIO - 1 };
424 int ret; 424 int ret;
425 425
426 426
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c
index b556c3cf6495..ea13a8f4d8b0 100644
--- a/arch/m32r/kernel/process.c
+++ b/arch/m32r/kernel/process.c
@@ -115,8 +115,6 @@ void machine_restart(char *__unused)
115 cpu_relax(); 115 cpu_relax();
116} 116}
117 117
118EXPORT_SYMBOL(machine_restart);
119
120void machine_halt(void) 118void machine_halt(void)
121{ 119{
122 printk("Please push reset button!\n"); 120 printk("Please push reset button!\n");
@@ -124,15 +122,11 @@ void machine_halt(void)
124 cpu_relax(); 122 cpu_relax();
125} 123}
126 124
127EXPORT_SYMBOL(machine_halt);
128
129void machine_power_off(void) 125void machine_power_off(void)
130{ 126{
131 /* M32R_FIXME */ 127 /* M32R_FIXME */
132} 128}
133 129
134EXPORT_SYMBOL(machine_power_off);
135
136static int __init idle_setup (char *str) 130static int __init idle_setup (char *str)
137{ 131{
138 if (!strncmp(str, "poll", 4)) { 132 if (!strncmp(str, "poll", 4)) {
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index 93b043e2a435..11b1b90ba6ba 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -113,8 +113,6 @@ void machine_restart(char * __unused)
113 for (;;); 113 for (;;);
114} 114}
115 115
116EXPORT_SYMBOL(machine_restart);
117
118void machine_halt(void) 116void machine_halt(void)
119{ 117{
120 if (mach_halt) 118 if (mach_halt)
@@ -122,8 +120,6 @@ void machine_halt(void)
122 for (;;); 120 for (;;);
123} 121}
124 122
125EXPORT_SYMBOL(machine_halt);
126
127void machine_power_off(void) 123void machine_power_off(void)
128{ 124{
129 if (mach_power_off) 125 if (mach_power_off)
@@ -131,8 +127,6 @@ void machine_power_off(void)
131 for (;;); 127 for (;;);
132} 128}
133 129
134EXPORT_SYMBOL(machine_power_off);
135
136void show_regs(struct pt_regs * regs) 130void show_regs(struct pt_regs * regs)
137{ 131{
138 printk("\n"); 132 printk("\n");
diff --git a/arch/m68knommu/kernel/process.c b/arch/m68knommu/kernel/process.c
index c4a33f265dc0..82e7ec888806 100644
--- a/arch/m68knommu/kernel/process.c
+++ b/arch/m68knommu/kernel/process.c
@@ -80,8 +80,6 @@ void machine_restart(char * __unused)
80 for (;;); 80 for (;;);
81} 81}
82 82
83EXPORT_SYMBOL(machine_restart);
84
85void machine_halt(void) 83void machine_halt(void)
86{ 84{
87 if (mach_halt) 85 if (mach_halt)
@@ -89,8 +87,6 @@ void machine_halt(void)
89 for (;;); 87 for (;;);
90} 88}
91 89
92EXPORT_SYMBOL(machine_halt);
93
94void machine_power_off(void) 90void machine_power_off(void)
95{ 91{
96 if (mach_power_off) 92 if (mach_power_off)
@@ -98,8 +94,6 @@ void machine_power_off(void)
98 for (;;); 94 for (;;);
99} 95}
100 96
101EXPORT_SYMBOL(machine_power_off);
102
103void show_regs(struct pt_regs * regs) 97void show_regs(struct pt_regs * regs)
104{ 98{
105 printk(KERN_NOTICE "\n"); 99 printk(KERN_NOTICE "\n");
diff --git a/arch/mips/kernel/reset.c b/arch/mips/kernel/reset.c
index 7e0a9821931a..ae2ba67b7ef6 100644
--- a/arch/mips/kernel/reset.c
+++ b/arch/mips/kernel/reset.c
@@ -26,18 +26,13 @@ void machine_restart(char *command)
26 _machine_restart(command); 26 _machine_restart(command);
27} 27}
28 28
29EXPORT_SYMBOL(machine_restart);
30
31void machine_halt(void) 29void machine_halt(void)
32{ 30{
33 _machine_halt(); 31 _machine_halt();
34} 32}
35 33
36EXPORT_SYMBOL(machine_halt);
37
38void machine_power_off(void) 34void machine_power_off(void)
39{ 35{
40 _machine_power_off(); 36 _machine_power_off();
41} 37}
42 38
43EXPORT_SYMBOL(machine_power_off);
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 46e4a6881f11..4fc04501d5e5 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -150,8 +150,6 @@ void machine_restart(char *cmd)
150 150
151} 151}
152 152
153EXPORT_SYMBOL(machine_restart);
154
155void machine_halt(void) 153void machine_halt(void)
156{ 154{
157 /* 155 /*
@@ -160,8 +158,6 @@ void machine_halt(void)
160 */ 158 */
161} 159}
162 160
163EXPORT_SYMBOL(machine_halt);
164
165 161
166/* 162/*
167 * This routine is called from sys_reboot to actually turn off the 163 * This routine is called from sys_reboot to actually turn off the
@@ -187,8 +183,6 @@ void machine_power_off(void)
187 KERN_EMERG "Please power this system off now."); 183 KERN_EMERG "Please power this system off now.");
188} 184}
189 185
190EXPORT_SYMBOL(machine_power_off);
191
192 186
193/* 187/*
194 * Create a kernel thread 188 * Create a kernel thread
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
index c42f75326939..929e5d1cc7fe 100644
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -121,8 +121,6 @@ void machine_restart(char *cmd)
121 ppc_md.restart(cmd); 121 ppc_md.restart(cmd);
122} 122}
123 123
124EXPORT_SYMBOL(machine_restart);
125
126void machine_power_off(void) 124void machine_power_off(void)
127{ 125{
128#ifdef CONFIG_NVRAM 126#ifdef CONFIG_NVRAM
@@ -131,8 +129,6 @@ void machine_power_off(void)
131 ppc_md.power_off(); 129 ppc_md.power_off();
132} 130}
133 131
134EXPORT_SYMBOL(machine_power_off);
135
136void machine_halt(void) 132void machine_halt(void)
137{ 133{
138#ifdef CONFIG_NVRAM 134#ifdef CONFIG_NVRAM
@@ -141,8 +137,6 @@ void machine_halt(void)
141 ppc_md.halt(); 137 ppc_md.halt();
142} 138}
143 139
144EXPORT_SYMBOL(machine_halt);
145
146void (*pm_power_off)(void) = machine_power_off; 140void (*pm_power_off)(void) = machine_power_off;
147 141
148#ifdef CONFIG_TAU 142#ifdef CONFIG_TAU
diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c
index d1b33f0b26cb..e80f10c89824 100644
--- a/arch/ppc64/kernel/setup.c
+++ b/arch/ppc64/kernel/setup.c
@@ -694,7 +694,6 @@ void machine_restart(char *cmd)
694 local_irq_disable(); 694 local_irq_disable();
695 while (1) ; 695 while (1) ;
696} 696}
697EXPORT_SYMBOL(machine_restart);
698 697
699void machine_power_off(void) 698void machine_power_off(void)
700{ 699{
@@ -707,7 +706,6 @@ void machine_power_off(void)
707 local_irq_disable(); 706 local_irq_disable();
708 while (1) ; 707 while (1) ;
709} 708}
710EXPORT_SYMBOL(machine_power_off);
711 709
712void machine_halt(void) 710void machine_halt(void)
713{ 711{
@@ -720,7 +718,6 @@ void machine_halt(void)
720 local_irq_disable(); 718 local_irq_disable();
721 while (1) ; 719 while (1) ;
722} 720}
723EXPORT_SYMBOL(machine_halt);
724 721
725static int ppc64_panic_event(struct notifier_block *this, 722static int ppc64_panic_event(struct notifier_block *this,
726 unsigned long event, void *ptr) 723 unsigned long event, void *ptr)
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index b6d740ac0e6e..a12183989a79 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -299,24 +299,18 @@ void machine_restart(char *command)
299 _machine_restart(command); 299 _machine_restart(command);
300} 300}
301 301
302EXPORT_SYMBOL(machine_restart);
303
304void machine_halt(void) 302void machine_halt(void)
305{ 303{
306 console_unblank(); 304 console_unblank();
307 _machine_halt(); 305 _machine_halt();
308} 306}
309 307
310EXPORT_SYMBOL(machine_halt);
311
312void machine_power_off(void) 308void machine_power_off(void)
313{ 309{
314 console_unblank(); 310 console_unblank();
315 _machine_power_off(); 311 _machine_power_off();
316} 312}
317 313
318EXPORT_SYMBOL(machine_power_off);
319
320static void __init 314static void __init
321add_memory_hole(unsigned long start, unsigned long end) 315add_memory_hole(unsigned long start, unsigned long end)
322{ 316{
diff --git a/arch/sh/kernel/process.c b/arch/sh/kernel/process.c
index 3d024590c24e..6dce9d0b81f8 100644
--- a/arch/sh/kernel/process.c
+++ b/arch/sh/kernel/process.c
@@ -80,8 +80,6 @@ void machine_restart(char * __unused)
80 "mov.l @%1, %0" : : "r" (0x10000000), "r" (0x80000001)); 80 "mov.l @%1, %0" : : "r" (0x10000000), "r" (0x80000001));
81} 81}
82 82
83EXPORT_SYMBOL(machine_restart);
84
85void machine_halt(void) 83void machine_halt(void)
86{ 84{
87#if defined(CONFIG_SH_HS7751RVOIP) 85#if defined(CONFIG_SH_HS7751RVOIP)
@@ -96,8 +94,6 @@ void machine_halt(void)
96 cpu_sleep(); 94 cpu_sleep();
97} 95}
98 96
99EXPORT_SYMBOL(machine_halt);
100
101void machine_power_off(void) 97void machine_power_off(void)
102{ 98{
103#if defined(CONFIG_SH_HS7751RVOIP) 99#if defined(CONFIG_SH_HS7751RVOIP)
@@ -110,8 +106,6 @@ void machine_power_off(void)
110#endif 106#endif
111} 107}
112 108
113EXPORT_SYMBOL(machine_power_off);
114
115void show_regs(struct pt_regs * regs) 109void show_regs(struct pt_regs * regs)
116{ 110{
117 printk("\n"); 111 printk("\n");
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c
index 2c216ffeea90..29e72b57d4fd 100644
--- a/arch/sparc/kernel/process.c
+++ b/arch/sparc/kernel/process.c
@@ -158,8 +158,6 @@ void machine_halt(void)
158 panic("Halt failed!"); 158 panic("Halt failed!");
159} 159}
160 160
161EXPORT_SYMBOL(machine_halt);
162
163void machine_restart(char * cmd) 161void machine_restart(char * cmd)
164{ 162{
165 char *p; 163 char *p;
@@ -180,8 +178,6 @@ void machine_restart(char * cmd)
180 panic("Reboot failed!"); 178 panic("Reboot failed!");
181} 179}
182 180
183EXPORT_SYMBOL(machine_restart);
184
185void machine_power_off(void) 181void machine_power_off(void)
186{ 182{
187#ifdef CONFIG_SUN_AUXIO 183#ifdef CONFIG_SUN_AUXIO
@@ -191,8 +187,6 @@ void machine_power_off(void)
191 machine_halt(); 187 machine_halt();
192} 188}
193 189
194EXPORT_SYMBOL(machine_power_off);
195
196static DEFINE_SPINLOCK(sparc_backtrace_lock); 190static DEFINE_SPINLOCK(sparc_backtrace_lock);
197 191
198void __show_backtrace(unsigned long fp) 192void __show_backtrace(unsigned long fp)
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S
index d781f10adc52..88332f00094a 100644
--- a/arch/sparc64/kernel/entry.S
+++ b/arch/sparc64/kernel/entry.S
@@ -1600,11 +1600,11 @@ sys_clone: flushw
1600 ba,pt %xcc, sparc_do_fork 1600 ba,pt %xcc, sparc_do_fork
1601 add %sp, PTREGS_OFF, %o2 1601 add %sp, PTREGS_OFF, %o2
1602ret_from_syscall: 1602ret_from_syscall:
1603 /* Clear SPARC_FLAG_NEWCHILD, switch_to leaves thread.flags in 1603 /* Clear current_thread_info()->new_child, and
1604 * %o7 for us. Check performance counter stuff too. 1604 * check performance counter stuff too.
1605 */ 1605 */
1606 andn %o7, _TIF_NEWCHILD, %l0 1606 stb %g0, [%g6 + TI_NEW_CHILD]
1607 stx %l0, [%g6 + TI_FLAGS] 1607 ldx [%g6 + TI_FLAGS], %l0
1608 call schedule_tail 1608 call schedule_tail
1609 mov %g7, %o0 1609 mov %g7, %o0
1610 andcc %l0, _TIF_PERFCTR, %g0 1610 andcc %l0, _TIF_PERFCTR, %g0
@@ -1720,12 +1720,11 @@ ret_sys_call:
1720 /* Check if force_successful_syscall_return() 1720 /* Check if force_successful_syscall_return()
1721 * was invoked. 1721 * was invoked.
1722 */ 1722 */
1723 ldx [%curptr + TI_FLAGS], %l0 1723 ldub [%curptr + TI_SYS_NOERROR], %l0
1724 andcc %l0, _TIF_SYSCALL_SUCCESS, %g0 1724 brz,pt %l0, 1f
1725 be,pt %icc, 1f 1725 nop
1726 andn %l0, _TIF_SYSCALL_SUCCESS, %l0
1727 ba,pt %xcc, 80f 1726 ba,pt %xcc, 80f
1728 stx %l0, [%curptr + TI_FLAGS] 1727 stb %g0, [%curptr + TI_SYS_NOERROR]
1729 1728
17301: 17291:
1731 cmp %o0, -ERESTART_RESTARTBLOCK 1730 cmp %o0, -ERESTART_RESTARTBLOCK
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index daa2fb93052c..c9b69167632a 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -782,8 +782,14 @@ static void distribute_irqs(void)
782} 782}
783#endif 783#endif
784 784
785struct sun5_timer {
786 u64 count0;
787 u64 limit0;
788 u64 count1;
789 u64 limit1;
790};
785 791
786struct sun5_timer *prom_timers; 792static struct sun5_timer *prom_timers;
787static u64 prom_limit0, prom_limit1; 793static u64 prom_limit0, prom_limit1;
788 794
789static void map_prom_timers(void) 795static void map_prom_timers(void)
@@ -839,18 +845,6 @@ static void kill_prom_timer(void)
839 : "g1", "g2"); 845 : "g1", "g2");
840} 846}
841 847
842void enable_prom_timer(void)
843{
844 if (!prom_timers)
845 return;
846
847 /* Set it to whatever was there before. */
848 prom_timers->limit1 = prom_limit1;
849 prom_timers->count1 = 0;
850 prom_timers->limit0 = prom_limit0;
851 prom_timers->count0 = 0;
852}
853
854void init_irqwork_curcpu(void) 848void init_irqwork_curcpu(void)
855{ 849{
856 register struct irq_work_struct *workp asm("o2"); 850 register struct irq_work_struct *workp asm("o2");
diff --git a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c
index 533104c7907d..946cee0257ea 100644
--- a/arch/sparc64/kernel/power.c
+++ b/arch/sparc64/kernel/power.c
@@ -69,8 +69,6 @@ void machine_power_off(void)
69 machine_halt(); 69 machine_halt();
70} 70}
71 71
72EXPORT_SYMBOL(machine_power_off);
73
74#ifdef CONFIG_PCI 72#ifdef CONFIG_PCI
75static int powerd(void *__unused) 73static int powerd(void *__unused)
76{ 74{
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index a0cd2b2494d6..07424b075938 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -124,8 +124,6 @@ void machine_halt(void)
124 panic("Halt failed!"); 124 panic("Halt failed!");
125} 125}
126 126
127EXPORT_SYMBOL(machine_halt);
128
129void machine_alt_power_off(void) 127void machine_alt_power_off(void)
130{ 128{
131 if (!serial_console && prom_palette) 129 if (!serial_console && prom_palette)
@@ -154,8 +152,6 @@ void machine_restart(char * cmd)
154 panic("Reboot failed!"); 152 panic("Reboot failed!");
155} 153}
156 154
157EXPORT_SYMBOL(machine_restart);
158
159static void show_regwindow32(struct pt_regs *regs) 155static void show_regwindow32(struct pt_regs *regs)
160{ 156{
161 struct reg_window32 __user *rw; 157 struct reg_window32 __user *rw;
@@ -621,8 +617,8 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
621 memcpy(child_trap_frame, (((struct sparc_stackf *)regs)-1), (TRACEREG_SZ+STACKFRAME_SZ)); 617 memcpy(child_trap_frame, (((struct sparc_stackf *)regs)-1), (TRACEREG_SZ+STACKFRAME_SZ));
622 618
623 t->flags = (t->flags & ~((0xffUL << TI_FLAG_CWP_SHIFT) | (0xffUL << TI_FLAG_CURRENT_DS_SHIFT))) | 619 t->flags = (t->flags & ~((0xffUL << TI_FLAG_CWP_SHIFT) | (0xffUL << TI_FLAG_CURRENT_DS_SHIFT))) |
624 _TIF_NEWCHILD |
625 (((regs->tstate + 1) & TSTATE_CWP) << TI_FLAG_CWP_SHIFT); 620 (((regs->tstate + 1) & TSTATE_CWP) << TI_FLAG_CWP_SHIFT);
621 t->new_child = 1;
626 t->ksp = ((unsigned long) child_trap_frame) - STACK_BIAS; 622 t->ksp = ((unsigned long) child_trap_frame) - STACK_BIAS;
627 t->kregs = (struct pt_regs *)(child_trap_frame+sizeof(struct sparc_stackf)); 623 t->kregs = (struct pt_regs *)(child_trap_frame+sizeof(struct sparc_stackf));
628 t->fpsaved[0] = 0; 624 t->fpsaved[0] = 0;
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 7e8e2919e186..b9b42491e118 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -137,7 +137,7 @@ void __init smp_callin(void)
137 /* Clear this or we will die instantly when we 137 /* Clear this or we will die instantly when we
138 * schedule back to this idler... 138 * schedule back to this idler...
139 */ 139 */
140 clear_thread_flag(TIF_NEWCHILD); 140 current_thread_info()->new_child = 0;
141 141
142 /* Attach to the address space of init_task. */ 142 /* Attach to the address space of init_task. */
143 atomic_inc(&init_mm.mm_count); 143 atomic_inc(&init_mm.mm_count);
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c
index a9f4596d7c2b..100b0107c4be 100644
--- a/arch/sparc64/kernel/traps.c
+++ b/arch/sparc64/kernel/traps.c
@@ -2125,6 +2125,8 @@ void __init trap_init(void)
2125 TI_PCR != offsetof(struct thread_info, pcr_reg) || 2125 TI_PCR != offsetof(struct thread_info, pcr_reg) ||
2126 TI_CEE_STUFF != offsetof(struct thread_info, cee_stuff) || 2126 TI_CEE_STUFF != offsetof(struct thread_info, cee_stuff) ||
2127 TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) || 2127 TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) ||
2128 TI_NEW_CHILD != offsetof(struct thread_info, new_child) ||
2129 TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) ||
2128 TI_FPREGS != offsetof(struct thread_info, fpregs) || 2130 TI_FPREGS != offsetof(struct thread_info, fpregs) ||
2129 (TI_FPREGS & (64 - 1))) 2131 (TI_FPREGS & (64 - 1)))
2130 thread_info_offsets_are_bolixed_dave(); 2132 thread_info_offsets_are_bolixed_dave();
diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c
index fcec51da1d37..a637e885c583 100644
--- a/arch/um/kernel/reboot.c
+++ b/arch/um/kernel/reboot.c
@@ -49,23 +49,17 @@ void machine_restart(char * __unused)
49 CHOOSE_MODE(reboot_tt(), reboot_skas()); 49 CHOOSE_MODE(reboot_tt(), reboot_skas());
50} 50}
51 51
52EXPORT_SYMBOL(machine_restart);
53
54void machine_power_off(void) 52void machine_power_off(void)
55{ 53{
56 uml_cleanup(); 54 uml_cleanup();
57 CHOOSE_MODE(halt_tt(), halt_skas()); 55 CHOOSE_MODE(halt_tt(), halt_skas());
58} 56}
59 57
60EXPORT_SYMBOL(machine_power_off);
61
62void machine_halt(void) 58void machine_halt(void)
63{ 59{
64 machine_power_off(); 60 machine_power_off();
65} 61}
66 62
67EXPORT_SYMBOL(machine_halt);
68
69/* 63/*
70 * Overrides for Emacs so that we follow Linus's tabbing style. 64 * Overrides for Emacs so that we follow Linus's tabbing style.
71 * Emacs will notice this stuff at the end of the file and automatically 65 * Emacs will notice this stuff at the end of the file and automatically
diff --git a/arch/v850/kernel/anna.c b/arch/v850/kernel/anna.c
index 6aaeab5e8a40..d0502e142437 100644
--- a/arch/v850/kernel/anna.c
+++ b/arch/v850/kernel/anna.c
@@ -132,8 +132,6 @@ void machine_restart (char *__unused)
132 asm ("jmp r0"); /* Jump to the reset vector. */ 132 asm ("jmp r0"); /* Jump to the reset vector. */
133} 133}
134 134
135EXPORT_SYMBOL(machine_restart);
136
137void machine_halt (void) 135void machine_halt (void)
138{ 136{
139#ifdef CONFIG_RESET_GUARD 137#ifdef CONFIG_RESET_GUARD
@@ -145,15 +143,11 @@ void machine_halt (void)
145 asm ("halt; nop; nop; nop; nop; nop"); 143 asm ("halt; nop; nop; nop; nop; nop");
146} 144}
147 145
148EXPORT_SYMBOL(machine_halt);
149
150void machine_power_off (void) 146void machine_power_off (void)
151{ 147{
152 machine_halt (); 148 machine_halt ();
153} 149}
154 150
155EXPORT_SYMBOL(machine_power_off);
156
157/* Called before configuring an on-chip UART. */ 151/* Called before configuring an on-chip UART. */
158void anna_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud) 152void anna_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud)
159{ 153{
diff --git a/arch/v850/kernel/as85ep1.c b/arch/v850/kernel/as85ep1.c
index 4059b1df11b5..d78c5e4ea9bc 100644
--- a/arch/v850/kernel/as85ep1.c
+++ b/arch/v850/kernel/as85ep1.c
@@ -160,8 +160,6 @@ void machine_restart (char *__unused)
160 asm ("jmp r0"); /* Jump to the reset vector. */ 160 asm ("jmp r0"); /* Jump to the reset vector. */
161} 161}
162 162
163EXPORT_SYMBOL(machine_restart);
164
165void machine_halt (void) 163void machine_halt (void)
166{ 164{
167#ifdef CONFIG_RESET_GUARD 165#ifdef CONFIG_RESET_GUARD
@@ -173,15 +171,11 @@ void machine_halt (void)
173 asm ("halt; nop; nop; nop; nop; nop"); 171 asm ("halt; nop; nop; nop; nop; nop");
174} 172}
175 173
176EXPORT_SYMBOL(machine_halt);
177
178void machine_power_off (void) 174void machine_power_off (void)
179{ 175{
180 machine_halt (); 176 machine_halt ();
181} 177}
182 178
183EXPORT_SYMBOL(machine_power_off);
184
185/* Called before configuring an on-chip UART. */ 179/* Called before configuring an on-chip UART. */
186void as85ep1_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud) 180void as85ep1_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud)
187{ 181{
diff --git a/arch/v850/kernel/fpga85e2c.c b/arch/v850/kernel/fpga85e2c.c
index 4bac5149b3c2..d8094519ad85 100644
--- a/arch/v850/kernel/fpga85e2c.c
+++ b/arch/v850/kernel/fpga85e2c.c
@@ -121,22 +121,16 @@ void machine_halt (void)
121 } 121 }
122} 122}
123 123
124EXPORT_SYMBOL(machine_halt);
125
126void machine_restart (char *__unused) 124void machine_restart (char *__unused)
127{ 125{
128 machine_halt (); 126 machine_halt ();
129} 127}
130 128
131EXPORT_SYMBOL(machine_restart);
132
133void machine_power_off (void) 129void machine_power_off (void)
134{ 130{
135 machine_halt (); 131 machine_halt ();
136} 132}
137 133
138EXPORT_SYMBOL(machine_power_off);
139
140 134
141/* Interrupts */ 135/* Interrupts */
142 136
diff --git a/arch/v850/kernel/rte_cb.c b/arch/v850/kernel/rte_cb.c
index 7ba397f77aca..0c794b9e0f9b 100644
--- a/arch/v850/kernel/rte_cb.c
+++ b/arch/v850/kernel/rte_cb.c
@@ -67,8 +67,6 @@ void machine_restart (char *__unused)
67 asm ("jmp r0"); /* Jump to the reset vector. */ 67 asm ("jmp r0"); /* Jump to the reset vector. */
68} 68}
69 69
70EXPORT_SYMBOL(machine_restart);
71
72/* This says `HALt.' in LEDese. */ 70/* This says `HALt.' in LEDese. */
73static unsigned char halt_leds_msg[] = { 0x76, 0x77, 0x38, 0xF8 }; 71static unsigned char halt_leds_msg[] = { 0x76, 0x77, 0x38, 0xF8 };
74 72
@@ -89,15 +87,11 @@ void machine_halt (void)
89 asm ("halt; nop; nop; nop; nop; nop"); 87 asm ("halt; nop; nop; nop; nop; nop");
90} 88}
91 89
92EXPORT_SYMBOL(machine_halt);
93
94void machine_power_off (void) 90void machine_power_off (void)
95{ 91{
96 machine_halt (); 92 machine_halt ();
97} 93}
98 94
99EXPORT_SYMBOL(machine_power_off);
100
101 95
102/* Animated LED display for timer tick. */ 96/* Animated LED display for timer tick. */
103 97
diff --git a/arch/v850/kernel/sim.c b/arch/v850/kernel/sim.c
index 4f31da962632..e2cc5580fa2a 100644
--- a/arch/v850/kernel/sim.c
+++ b/arch/v850/kernel/sim.c
@@ -104,24 +104,18 @@ void machine_restart (char *__unused)
104 V850_SIM_SYSCALL (exit, 0); 104 V850_SIM_SYSCALL (exit, 0);
105} 105}
106 106
107EXPORT_SYMBOL(machine_restart);
108
109void machine_halt (void) 107void machine_halt (void)
110{ 108{
111 V850_SIM_SYSCALL (write, 1, "HALT\n", 5); 109 V850_SIM_SYSCALL (write, 1, "HALT\n", 5);
112 V850_SIM_SYSCALL (exit, 0); 110 V850_SIM_SYSCALL (exit, 0);
113} 111}
114 112
115EXPORT_SYMBOL(machine_halt);
116
117void machine_power_off (void) 113void machine_power_off (void)
118{ 114{
119 V850_SIM_SYSCALL (write, 1, "POWER OFF\n", 10); 115 V850_SIM_SYSCALL (write, 1, "POWER OFF\n", 10);
120 V850_SIM_SYSCALL (exit, 0); 116 V850_SIM_SYSCALL (exit, 0);
121} 117}
122 118
123EXPORT_SYMBOL(machine_power_off);
124
125 119
126/* Load data from a file called NAME into ram. The address and length 120/* Load data from a file called NAME into ram. The address and length
127 of the data image are returned in ADDR and LEN. */ 121 of the data image are returned in ADDR and LEN. */
diff --git a/arch/v850/kernel/sim85e2.c b/arch/v850/kernel/sim85e2.c
index 93a722b516bb..9111613fb53a 100644
--- a/arch/v850/kernel/sim85e2.c
+++ b/arch/v850/kernel/sim85e2.c
@@ -184,18 +184,13 @@ void machine_halt (void)
184 for (;;) {} 184 for (;;) {}
185} 185}
186 186
187EXPORT_SYMBOL(machine_halt);
188
189void machine_restart (char *__unused) 187void machine_restart (char *__unused)
190{ 188{
191 machine_halt (); 189 machine_halt ();
192} 190}
193 191
194EXPORT_SYMBOL(machine_restart);
195
196void machine_power_off (void) 192void machine_power_off (void)
197{ 193{
198 machine_halt (); 194 machine_halt ();
199} 195}
200 196
201EXPORT_SYMBOL(machine_power_off);
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
index cc935427d532..c45d6a05b984 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86_64/ia32/ia32entry.S
@@ -591,11 +591,15 @@ ia32_sys_call_table:
591 .quad compat_sys_mq_getsetattr 591 .quad compat_sys_mq_getsetattr
592 .quad compat_sys_kexec_load /* reserved for kexec */ 592 .quad compat_sys_kexec_load /* reserved for kexec */
593 .quad compat_sys_waitid 593 .quad compat_sys_waitid
594 .quad quiet_ni_syscall /* sys_altroot */ 594 .quad quiet_ni_syscall /* 285: sys_altroot */
595 .quad sys_add_key 595 .quad sys_add_key
596 .quad sys_request_key 596 .quad sys_request_key
597 .quad sys_keyctl 597 .quad sys_keyctl
598 /* don't forget to change IA32_NR_syscalls */ 598 .quad sys_ioprio_set
599 .quad sys_ioprio_get /* 290 */
600 .quad sys_inotify_init
601 .quad sys_inotify_add_watch
602 .quad sys_inotify_rm_watch
599ia32_syscall_end: 603ia32_syscall_end:
600 .rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8 604 .rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8
601 .quad ni_syscall 605 .quad ni_syscall
diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
index 68a9ab06ee7c..be996d1b691e 100644
--- a/arch/x86_64/ia32/sys_ia32.c
+++ b/arch/x86_64/ia32/sys_ia32.c
@@ -61,6 +61,7 @@
61#include <linux/ptrace.h> 61#include <linux/ptrace.h>
62#include <linux/highuid.h> 62#include <linux/highuid.h>
63#include <linux/vmalloc.h> 63#include <linux/vmalloc.h>
64#include <linux/fsnotify.h>
64#include <asm/mman.h> 65#include <asm/mman.h>
65#include <asm/types.h> 66#include <asm/types.h>
66#include <asm/uaccess.h> 67#include <asm/uaccess.h>
@@ -984,8 +985,10 @@ asmlinkage long sys32_open(const char __user * filename, int flags, int mode)
984 if (IS_ERR(f)) { 985 if (IS_ERR(f)) {
985 put_unused_fd(fd); 986 put_unused_fd(fd);
986 fd = error; 987 fd = error;
987 } else 988 } else {
989 fsnotify_open(f->f_dentry);
988 fd_install(fd, f); 990 fd_install(fd, f);
991 }
989 } 992 }
990 putname(tmp); 993 putname(tmp);
991 } 994 }
diff --git a/arch/x86_64/kernel/reboot.c b/arch/x86_64/kernel/reboot.c
index 57e71dbdfd69..47f95687905f 100644
--- a/arch/x86_64/kernel/reboot.c
+++ b/arch/x86_64/kernel/reboot.c
@@ -109,23 +109,10 @@ void machine_shutdown(void)
109 local_irq_enable(); 109 local_irq_enable();
110} 110}
111 111
112void machine_restart(char * __unused) 112void machine_emergency_restart(void)
113{ 113{
114 int i; 114 int i;
115 115
116 printk("machine restart\n");
117
118 machine_shutdown();
119
120 if (!reboot_force) {
121 local_irq_disable();
122#ifndef CONFIG_SMP
123 disable_local_APIC();
124#endif
125 disable_IO_APIC();
126 local_irq_enable();
127 }
128
129 /* Tell the BIOS if we want cold or warm reboot */ 116 /* Tell the BIOS if we want cold or warm reboot */
130 *((unsigned short *)__va(0x472)) = reboot_mode; 117 *((unsigned short *)__va(0x472)) = reboot_mode;
131 118
@@ -150,18 +137,26 @@ void machine_restart(char * __unused)
150 } 137 }
151} 138}
152 139
153EXPORT_SYMBOL(machine_restart); 140void machine_restart(char * __unused)
141{
142 printk("machine restart\n");
143
144 if (!reboot_force) {
145 machine_shutdown();
146 }
147 machine_emergency_restart();
148}
154 149
155void machine_halt(void) 150void machine_halt(void)
156{ 151{
157} 152}
158 153
159EXPORT_SYMBOL(machine_halt);
160
161void machine_power_off(void) 154void machine_power_off(void)
162{ 155{
156 if (!reboot_force) {
157 machine_shutdown();
158 }
163 if (pm_power_off) 159 if (pm_power_off)
164 pm_power_off(); 160 pm_power_off();
165} 161}
166 162
167EXPORT_SYMBOL(machine_power_off);