aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2005-07-27 13:36:54 -0400
committerTony Luck <tony.luck@intel.com>2005-07-27 13:36:54 -0400
commitc2834cf4746cf13501efc3489b1895bce58a4ccb (patch)
tree13614c2ed7ec156d8518fd5bff4e1c252fb05792 /arch
parent05cb784c81a0fd1f97732156ea464bd392ce875a (diff)
parent9e566d8bd61f939b7f5d7d969f5b178571471cf9 (diff)
Auto merge with /home/aegl/GIT/linus
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/process.c3
-rw-r--r--arch/arm/kernel/process.c4
-rw-r--r--arch/arm/mach-s3c2410/Makefile2
-rw-r--r--arch/arm/mach-s3c2410/clock.c57
-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.c13
-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/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/reboot.c19
-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/power.c2
-rw-r--r--arch/sparc64/kernel/process.c4
-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
41 files changed, 471 insertions, 503 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/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/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/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 206778ebfce7..1e7f343822d0 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -25,10 +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-2006 BJD Changed to platform device for SuperIO 16550s 31 * 17-Jul-2005 BJD Changed to platform device for SuperIO 16550s
32 * 25-Jul-2005 BJD Removed ASIX static mappings
32*/ 33*/
33 34
34#include <linux/kernel.h> 35#include <linux/kernel.h>
@@ -116,7 +117,6 @@ static struct map_desc bast_iodesc[] __initdata = {
116 /* slow, byte */ 117 /* slow, byte */
117 { 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 },
118 { 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 },
119 { VA_C2(BAST_VA_ASIXNET), PA_CS3(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
120 { 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 },
121 { 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 },
122 { 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 },
@@ -126,7 +126,6 @@ static struct map_desc bast_iodesc[] __initdata = {
126 /* slow, word */ 126 /* slow, word */
127 { 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 },
128 { 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 },
129 { VA_C3(BAST_VA_ASIXNET), PA_CS3(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
130 { 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 },
131 { 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 },
132 { 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 },
@@ -136,7 +135,6 @@ static struct map_desc bast_iodesc[] __initdata = {
136 /* fast, byte */ 135 /* fast, byte */
137 { 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 },
138 { 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 },
139 { VA_C4(BAST_VA_ASIXNET), PA_CS5(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
140 { 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 },
141 { 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 },
142 { 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 },
@@ -146,7 +144,6 @@ static struct map_desc bast_iodesc[] __initdata = {
146 /* fast, word */ 144 /* fast, word */
147 { 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 },
148 { 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 },
149 { VA_C5(BAST_VA_ASIXNET), PA_CS5(BAST_PA_ASIXNET), SZ_1M, MT_DEVICE },
150 { 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 },
151 { 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 },
152 { 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 },
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/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/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/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/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 cffb1c8ab4fc..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;
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);