diff options
Diffstat (limited to 'arch')
190 files changed, 1406 insertions, 645 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 60cde53d266c..8bb936226dee 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig | |||
@@ -51,7 +51,7 @@ config GENERIC_CMOS_UPDATE | |||
51 | def_bool y | 51 | def_bool y |
52 | 52 | ||
53 | config GENERIC_GPIO | 53 | config GENERIC_GPIO |
54 | def_bool y | 54 | bool |
55 | 55 | ||
56 | config ZONE_DMA | 56 | config ZONE_DMA |
57 | bool | 57 | bool |
diff --git a/arch/alpha/include/asm/sysinfo.h b/arch/alpha/include/asm/sysinfo.h index 086aba284df2..e77d77cd07b8 100644 --- a/arch/alpha/include/asm/sysinfo.h +++ b/arch/alpha/include/asm/sysinfo.h | |||
@@ -27,13 +27,4 @@ | |||
27 | #define UAC_NOFIX 2 | 27 | #define UAC_NOFIX 2 |
28 | #define UAC_SIGBUS 4 | 28 | #define UAC_SIGBUS 4 |
29 | 29 | ||
30 | |||
31 | #ifdef __KERNEL__ | ||
32 | |||
33 | /* This is the shift that is applied to the UAC bits as stored in the | ||
34 | per-thread flags. See thread_info.h. */ | ||
35 | #define UAC_SHIFT 6 | ||
36 | |||
37 | #endif | ||
38 | |||
39 | #endif /* __ASM_ALPHA_SYSINFO_H */ | 30 | #endif /* __ASM_ALPHA_SYSINFO_H */ |
diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h index 6f32f9c84a2d..ff73db022342 100644 --- a/arch/alpha/include/asm/thread_info.h +++ b/arch/alpha/include/asm/thread_info.h | |||
@@ -74,9 +74,9 @@ register struct thread_info *__current_thread_info __asm__("$8"); | |||
74 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ | 74 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ |
75 | #define TIF_POLLING_NRFLAG 8 /* poll_idle is polling NEED_RESCHED */ | 75 | #define TIF_POLLING_NRFLAG 8 /* poll_idle is polling NEED_RESCHED */ |
76 | #define TIF_DIE_IF_KERNEL 9 /* dik recursion lock */ | 76 | #define TIF_DIE_IF_KERNEL 9 /* dik recursion lock */ |
77 | #define TIF_UAC_NOPRINT 10 /* see sysinfo.h */ | 77 | #define TIF_UAC_NOPRINT 10 /* ! Preserve sequence of following */ |
78 | #define TIF_UAC_NOFIX 11 | 78 | #define TIF_UAC_NOFIX 11 /* ! flags as they match */ |
79 | #define TIF_UAC_SIGBUS 12 | 79 | #define TIF_UAC_SIGBUS 12 /* ! userspace part of 'osf_sysinfo' */ |
80 | #define TIF_MEMDIE 13 /* is terminating due to OOM killer */ | 80 | #define TIF_MEMDIE 13 /* is terminating due to OOM killer */ |
81 | #define TIF_RESTORE_SIGMASK 14 /* restore signal mask in do_signal */ | 81 | #define TIF_RESTORE_SIGMASK 14 /* restore signal mask in do_signal */ |
82 | #define TIF_FREEZE 16 /* is freezing for suspend */ | 82 | #define TIF_FREEZE 16 /* is freezing for suspend */ |
@@ -97,7 +97,7 @@ register struct thread_info *__current_thread_info __asm__("$8"); | |||
97 | #define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \ | 97 | #define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \ |
98 | | _TIF_SYSCALL_TRACE) | 98 | | _TIF_SYSCALL_TRACE) |
99 | 99 | ||
100 | #define ALPHA_UAC_SHIFT 10 | 100 | #define ALPHA_UAC_SHIFT TIF_UAC_NOPRINT |
101 | #define ALPHA_UAC_MASK (1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \ | 101 | #define ALPHA_UAC_MASK (1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \ |
102 | 1 << TIF_UAC_SIGBUS) | 102 | 1 << TIF_UAC_SIGBUS) |
103 | 103 | ||
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 326f0a2d56e5..01e8715e26d9 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <asm/uaccess.h> | 42 | #include <asm/uaccess.h> |
43 | #include <asm/system.h> | 43 | #include <asm/system.h> |
44 | #include <asm/sysinfo.h> | 44 | #include <asm/sysinfo.h> |
45 | #include <asm/thread_info.h> | ||
45 | #include <asm/hwrpb.h> | 46 | #include <asm/hwrpb.h> |
46 | #include <asm/processor.h> | 47 | #include <asm/processor.h> |
47 | 48 | ||
@@ -633,9 +634,10 @@ SYSCALL_DEFINE5(osf_getsysinfo, unsigned long, op, void __user *, buffer, | |||
633 | case GSI_UACPROC: | 634 | case GSI_UACPROC: |
634 | if (nbytes < sizeof(unsigned int)) | 635 | if (nbytes < sizeof(unsigned int)) |
635 | return -EINVAL; | 636 | return -EINVAL; |
636 | w = (current_thread_info()->flags >> UAC_SHIFT) & UAC_BITMASK; | 637 | w = (current_thread_info()->flags >> ALPHA_UAC_SHIFT) & |
637 | if (put_user(w, (unsigned int __user *)buffer)) | 638 | UAC_BITMASK; |
638 | return -EFAULT; | 639 | if (put_user(w, (unsigned int __user *)buffer)) |
640 | return -EFAULT; | ||
639 | return 1; | 641 | return 1; |
640 | 642 | ||
641 | case GSI_PROC_TYPE: | 643 | case GSI_PROC_TYPE: |
@@ -756,8 +758,8 @@ SYSCALL_DEFINE5(osf_setsysinfo, unsigned long, op, void __user *, buffer, | |||
756 | case SSIN_UACPROC: | 758 | case SSIN_UACPROC: |
757 | again: | 759 | again: |
758 | old = current_thread_info()->flags; | 760 | old = current_thread_info()->flags; |
759 | new = old & ~(UAC_BITMASK << UAC_SHIFT); | 761 | new = old & ~(UAC_BITMASK << ALPHA_UAC_SHIFT); |
760 | new = new | (w & UAC_BITMASK) << UAC_SHIFT; | 762 | new = new | (w & UAC_BITMASK) << ALPHA_UAC_SHIFT; |
761 | if (cmpxchg(¤t_thread_info()->flags, | 763 | if (cmpxchg(¤t_thread_info()->flags, |
762 | old, new) != old) | 764 | old, new) != old) |
763 | goto again; | 765 | goto again; |
diff --git a/arch/alpha/kernel/systbls.S b/arch/alpha/kernel/systbls.S index b9c28f3f1956..6acea1f96de3 100644 --- a/arch/alpha/kernel/systbls.S +++ b/arch/alpha/kernel/systbls.S | |||
@@ -360,7 +360,7 @@ sys_call_table: | |||
360 | .quad sys_newuname | 360 | .quad sys_newuname |
361 | .quad sys_nanosleep /* 340 */ | 361 | .quad sys_nanosleep /* 340 */ |
362 | .quad sys_mremap | 362 | .quad sys_mremap |
363 | .quad sys_nfsservctl | 363 | .quad sys_ni_syscall /* old nfsservctl */ |
364 | .quad sys_setresuid | 364 | .quad sys_setresuid |
365 | .quad sys_getresuid | 365 | .quad sys_getresuid |
366 | .quad sys_pciconfig_read /* 345 */ | 366 | .quad sys_pciconfig_read /* 345 */ |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 5ebc5d922ea1..3269576dbfa8 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -1271,6 +1271,18 @@ config ARM_ERRATA_754327 | |||
1271 | This workaround defines cpu_relax() as smp_mb(), preventing correctly | 1271 | This workaround defines cpu_relax() as smp_mb(), preventing correctly |
1272 | written polling loops from denying visibility of updates to memory. | 1272 | written polling loops from denying visibility of updates to memory. |
1273 | 1273 | ||
1274 | config ARM_ERRATA_364296 | ||
1275 | bool "ARM errata: Possible cache data corruption with hit-under-miss enabled" | ||
1276 | depends on CPU_V6 && !SMP | ||
1277 | help | ||
1278 | This options enables the workaround for the 364296 ARM1136 | ||
1279 | r0p2 erratum (possible cache data corruption with | ||
1280 | hit-under-miss enabled). It sets the undocumented bit 31 in | ||
1281 | the auxiliary control register and the FI bit in the control | ||
1282 | register, thus disabling hit-under-miss without putting the | ||
1283 | processor into full low interrupt latency mode. ARM11MPCore | ||
1284 | is not affected. | ||
1285 | |||
1274 | endmenu | 1286 | endmenu |
1275 | 1287 | ||
1276 | source "arch/arm/common/Kconfig" | 1288 | source "arch/arm/common/Kconfig" |
diff --git a/arch/arm/boot/compressed/mmcif-sh7372.c b/arch/arm/boot/compressed/mmcif-sh7372.c index b6f61d9a5a1b..672ae95db5c3 100644 --- a/arch/arm/boot/compressed/mmcif-sh7372.c +++ b/arch/arm/boot/compressed/mmcif-sh7372.c | |||
@@ -82,7 +82,7 @@ asmlinkage void mmc_loader(unsigned char *buf, unsigned long len) | |||
82 | 82 | ||
83 | 83 | ||
84 | /* Disable clock to MMC hardware block */ | 84 | /* Disable clock to MMC hardware block */ |
85 | __raw_writel(__raw_readl(SMSTPCR3) & (1 << 12), SMSTPCR3); | 85 | __raw_writel(__raw_readl(SMSTPCR3) | (1 << 12), SMSTPCR3); |
86 | 86 | ||
87 | mmc_update_progress(MMC_PROGRESS_DONE); | 87 | mmc_update_progress(MMC_PROGRESS_DONE); |
88 | } | 88 | } |
diff --git a/arch/arm/boot/compressed/sdhi-sh7372.c b/arch/arm/boot/compressed/sdhi-sh7372.c index d403a8b24d7f..d279294f2381 100644 --- a/arch/arm/boot/compressed/sdhi-sh7372.c +++ b/arch/arm/boot/compressed/sdhi-sh7372.c | |||
@@ -85,7 +85,7 @@ asmlinkage void mmc_loader(unsigned short *buf, unsigned long len) | |||
85 | goto err; | 85 | goto err; |
86 | 86 | ||
87 | /* Disable clock to SDHI1 hardware block */ | 87 | /* Disable clock to SDHI1 hardware block */ |
88 | __raw_writel(__raw_readl(SMSTPCR3) & (1 << 13), SMSTPCR3); | 88 | __raw_writel(__raw_readl(SMSTPCR3) | (1 << 13), SMSTPCR3); |
89 | 89 | ||
90 | mmc_update_progress(MMC_PROGRESS_DONE); | 90 | mmc_update_progress(MMC_PROGRESS_DONE); |
91 | 91 | ||
diff --git a/arch/arm/boot/dts/tegra-harmony.dts b/arch/arm/boot/dts/tegra-harmony.dts index 4c053340ce33..e5818668d091 100644 --- a/arch/arm/boot/dts/tegra-harmony.dts +++ b/arch/arm/boot/dts/tegra-harmony.dts | |||
@@ -57,14 +57,14 @@ | |||
57 | }; | 57 | }; |
58 | 58 | ||
59 | sdhci@c8000200 { | 59 | sdhci@c8000200 { |
60 | gpios = <&gpio 69 0>, /* cd, gpio PI5 */ | 60 | cd-gpios = <&gpio 69 0>; /* gpio PI5 */ |
61 | <&gpio 57 0>, /* wp, gpio PH1 */ | 61 | wp-gpios = <&gpio 57 0>; /* gpio PH1 */ |
62 | <&gpio 155 0>; /* power, gpio PT3 */ | 62 | power-gpios = <&gpio 155 0>; /* gpio PT3 */ |
63 | }; | 63 | }; |
64 | 64 | ||
65 | sdhci@c8000600 { | 65 | sdhci@c8000600 { |
66 | gpios = <&gpio 58 0>, /* cd, gpio PH2 */ | 66 | cd-gpios = <&gpio 58 0>; /* gpio PH2 */ |
67 | <&gpio 59 0>, /* wp, gpio PH3 */ | 67 | wp-gpios = <&gpio 59 0>; /* gpio PH3 */ |
68 | <&gpio 70 0>; /* power, gpio PI6 */ | 68 | power-gpios = <&gpio 70 0>; /* gpio PI6 */ |
69 | }; | 69 | }; |
70 | }; | 70 | }; |
diff --git a/arch/arm/boot/dts/tegra-seaboard.dts b/arch/arm/boot/dts/tegra-seaboard.dts index 1940cae00748..64cedca6fc79 100644 --- a/arch/arm/boot/dts/tegra-seaboard.dts +++ b/arch/arm/boot/dts/tegra-seaboard.dts | |||
@@ -21,8 +21,8 @@ | |||
21 | }; | 21 | }; |
22 | 22 | ||
23 | sdhci@c8000400 { | 23 | sdhci@c8000400 { |
24 | gpios = <&gpio 69 0>, /* cd, gpio PI5 */ | 24 | cd-gpios = <&gpio 69 0>; /* gpio PI5 */ |
25 | <&gpio 57 0>, /* wp, gpio PH1 */ | 25 | wp-gpios = <&gpio 57 0>; /* gpio PH1 */ |
26 | <&gpio 70 0>; /* power, gpio PI6 */ | 26 | power-gpios = <&gpio 70 0>; /* gpio PI6 */ |
27 | }; | 27 | }; |
28 | }; | 28 | }; |
diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h index 16bd48031583..99a6ed7e1bfd 100644 --- a/arch/arm/include/asm/hardware/cache-l2x0.h +++ b/arch/arm/include/asm/hardware/cache-l2x0.h | |||
@@ -45,8 +45,13 @@ | |||
45 | #define L2X0_CLEAN_INV_LINE_PA 0x7F0 | 45 | #define L2X0_CLEAN_INV_LINE_PA 0x7F0 |
46 | #define L2X0_CLEAN_INV_LINE_IDX 0x7F8 | 46 | #define L2X0_CLEAN_INV_LINE_IDX 0x7F8 |
47 | #define L2X0_CLEAN_INV_WAY 0x7FC | 47 | #define L2X0_CLEAN_INV_WAY 0x7FC |
48 | #define L2X0_LOCKDOWN_WAY_D 0x900 | 48 | /* |
49 | #define L2X0_LOCKDOWN_WAY_I 0x904 | 49 | * The lockdown registers repeat 8 times for L310, the L210 has only one |
50 | * D and one I lockdown register at 0x0900 and 0x0904. | ||
51 | */ | ||
52 | #define L2X0_LOCKDOWN_WAY_D_BASE 0x900 | ||
53 | #define L2X0_LOCKDOWN_WAY_I_BASE 0x904 | ||
54 | #define L2X0_LOCKDOWN_STRIDE 0x08 | ||
50 | #define L2X0_TEST_OPERATION 0xF00 | 55 | #define L2X0_TEST_OPERATION 0xF00 |
51 | #define L2X0_LINE_DATA 0xF10 | 56 | #define L2X0_LINE_DATA 0xF10 |
52 | #define L2X0_LINE_TAG 0xF30 | 57 | #define L2X0_LINE_TAG 0xF30 |
@@ -64,7 +69,7 @@ | |||
64 | #define L2X0_AUX_CTRL_MASK 0xc0000fff | 69 | #define L2X0_AUX_CTRL_MASK 0xc0000fff |
65 | #define L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT 16 | 70 | #define L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT 16 |
66 | #define L2X0_AUX_CTRL_WAY_SIZE_SHIFT 17 | 71 | #define L2X0_AUX_CTRL_WAY_SIZE_SHIFT 17 |
67 | #define L2X0_AUX_CTRL_WAY_SIZE_MASK (0x3 << 17) | 72 | #define L2X0_AUX_CTRL_WAY_SIZE_MASK (0x7 << 17) |
68 | #define L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT 22 | 73 | #define L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT 22 |
69 | #define L2X0_AUX_CTRL_NS_LOCKDOWN_SHIFT 26 | 74 | #define L2X0_AUX_CTRL_NS_LOCKDOWN_SHIFT 26 |
70 | #define L2X0_AUX_CTRL_NS_INT_CTRL_SHIFT 27 | 75 | #define L2X0_AUX_CTRL_NS_INT_CTRL_SHIFT 27 |
diff --git a/arch/arm/include/asm/pmu.h b/arch/arm/include/asm/pmu.h index 67c70a31a1be..b7e82c4aced6 100644 --- a/arch/arm/include/asm/pmu.h +++ b/arch/arm/include/asm/pmu.h | |||
@@ -41,7 +41,7 @@ struct arm_pmu_platdata { | |||
41 | * encoded error on failure. | 41 | * encoded error on failure. |
42 | */ | 42 | */ |
43 | extern struct platform_device * | 43 | extern struct platform_device * |
44 | reserve_pmu(enum arm_pmu_type device); | 44 | reserve_pmu(enum arm_pmu_type type); |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * release_pmu() - Relinquish control of the performance counters | 47 | * release_pmu() - Relinquish control of the performance counters |
@@ -62,26 +62,26 @@ release_pmu(enum arm_pmu_type type); | |||
62 | * the actual hardware initialisation. | 62 | * the actual hardware initialisation. |
63 | */ | 63 | */ |
64 | extern int | 64 | extern int |
65 | init_pmu(enum arm_pmu_type device); | 65 | init_pmu(enum arm_pmu_type type); |
66 | 66 | ||
67 | #else /* CONFIG_CPU_HAS_PMU */ | 67 | #else /* CONFIG_CPU_HAS_PMU */ |
68 | 68 | ||
69 | #include <linux/err.h> | 69 | #include <linux/err.h> |
70 | 70 | ||
71 | static inline struct platform_device * | 71 | static inline struct platform_device * |
72 | reserve_pmu(enum arm_pmu_type device) | 72 | reserve_pmu(enum arm_pmu_type type) |
73 | { | 73 | { |
74 | return ERR_PTR(-ENODEV); | 74 | return ERR_PTR(-ENODEV); |
75 | } | 75 | } |
76 | 76 | ||
77 | static inline int | 77 | static inline int |
78 | release_pmu(struct platform_device *pdev) | 78 | release_pmu(enum arm_pmu_type type) |
79 | { | 79 | { |
80 | return -ENODEV; | 80 | return -ENODEV; |
81 | } | 81 | } |
82 | 82 | ||
83 | static inline int | 83 | static inline int |
84 | init_pmu(enum arm_pmu_type device) | 84 | init_pmu(enum arm_pmu_type type) |
85 | { | 85 | { |
86 | return -ENODEV; | 86 | return -ENODEV; |
87 | } | 87 | } |
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index 80f7896cc016..9943e9e74a1b 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S | |||
@@ -178,7 +178,7 @@ | |||
178 | CALL(sys_ni_syscall) /* vm86 */ | 178 | CALL(sys_ni_syscall) /* vm86 */ |
179 | CALL(sys_ni_syscall) /* was sys_query_module */ | 179 | CALL(sys_ni_syscall) /* was sys_query_module */ |
180 | CALL(sys_poll) | 180 | CALL(sys_poll) |
181 | CALL(sys_nfsservctl) | 181 | CALL(sys_ni_syscall) /* was nfsservctl */ |
182 | /* 170 */ CALL(sys_setresgid16) | 182 | /* 170 */ CALL(sys_setresgid16) |
183 | CALL(sys_getresgid16) | 183 | CALL(sys_getresgid16) |
184 | CALL(sys_prctl) | 184 | CALL(sys_prctl) |
diff --git a/arch/arm/kernel/pmu.c b/arch/arm/kernel/pmu.c index 2b70709376c3..c53474fe84df 100644 --- a/arch/arm/kernel/pmu.c +++ b/arch/arm/kernel/pmu.c | |||
@@ -31,7 +31,7 @@ static int __devinit pmu_register(struct platform_device *pdev, | |||
31 | { | 31 | { |
32 | if (type < 0 || type >= ARM_NUM_PMU_DEVICES) { | 32 | if (type < 0 || type >= ARM_NUM_PMU_DEVICES) { |
33 | pr_warning("received registration request for unknown " | 33 | pr_warning("received registration request for unknown " |
34 | "device %d\n", type); | 34 | "PMU device type %d\n", type); |
35 | return -EINVAL; | 35 | return -EINVAL; |
36 | } | 36 | } |
37 | 37 | ||
@@ -112,17 +112,17 @@ static int __init register_pmu_driver(void) | |||
112 | device_initcall(register_pmu_driver); | 112 | device_initcall(register_pmu_driver); |
113 | 113 | ||
114 | struct platform_device * | 114 | struct platform_device * |
115 | reserve_pmu(enum arm_pmu_type device) | 115 | reserve_pmu(enum arm_pmu_type type) |
116 | { | 116 | { |
117 | struct platform_device *pdev; | 117 | struct platform_device *pdev; |
118 | 118 | ||
119 | if (test_and_set_bit_lock(device, &pmu_lock)) { | 119 | if (test_and_set_bit_lock(type, &pmu_lock)) { |
120 | pdev = ERR_PTR(-EBUSY); | 120 | pdev = ERR_PTR(-EBUSY); |
121 | } else if (pmu_devices[device] == NULL) { | 121 | } else if (pmu_devices[type] == NULL) { |
122 | clear_bit_unlock(device, &pmu_lock); | 122 | clear_bit_unlock(type, &pmu_lock); |
123 | pdev = ERR_PTR(-ENODEV); | 123 | pdev = ERR_PTR(-ENODEV); |
124 | } else { | 124 | } else { |
125 | pdev = pmu_devices[device]; | 125 | pdev = pmu_devices[type]; |
126 | } | 126 | } |
127 | 127 | ||
128 | return pdev; | 128 | return pdev; |
@@ -130,11 +130,11 @@ reserve_pmu(enum arm_pmu_type device) | |||
130 | EXPORT_SYMBOL_GPL(reserve_pmu); | 130 | EXPORT_SYMBOL_GPL(reserve_pmu); |
131 | 131 | ||
132 | int | 132 | int |
133 | release_pmu(enum arm_pmu_type device) | 133 | release_pmu(enum arm_pmu_type type) |
134 | { | 134 | { |
135 | if (WARN_ON(!pmu_devices[device])) | 135 | if (WARN_ON(!pmu_devices[type])) |
136 | return -EINVAL; | 136 | return -EINVAL; |
137 | clear_bit_unlock(device, &pmu_lock); | 137 | clear_bit_unlock(type, &pmu_lock); |
138 | return 0; | 138 | return 0; |
139 | } | 139 | } |
140 | EXPORT_SYMBOL_GPL(release_pmu); | 140 | EXPORT_SYMBOL_GPL(release_pmu); |
@@ -182,17 +182,17 @@ init_cpu_pmu(void) | |||
182 | } | 182 | } |
183 | 183 | ||
184 | int | 184 | int |
185 | init_pmu(enum arm_pmu_type device) | 185 | init_pmu(enum arm_pmu_type type) |
186 | { | 186 | { |
187 | int err = 0; | 187 | int err = 0; |
188 | 188 | ||
189 | switch (device) { | 189 | switch (type) { |
190 | case ARM_PMU_DEVICE_CPU: | 190 | case ARM_PMU_DEVICE_CPU: |
191 | err = init_cpu_pmu(); | 191 | err = init_cpu_pmu(); |
192 | break; | 192 | break; |
193 | default: | 193 | default: |
194 | pr_warning("attempt to initialise unknown device %d\n", | 194 | pr_warning("attempt to initialise PMU of unknown " |
195 | device); | 195 | "type %d\n", type); |
196 | err = -EINVAL; | 196 | err = -EINVAL; |
197 | } | 197 | } |
198 | 198 | ||
diff --git a/arch/arm/kernel/relocate_kernel.S b/arch/arm/kernel/relocate_kernel.S index 9cf4cbf8f95b..d0cdedf4864d 100644 --- a/arch/arm/kernel/relocate_kernel.S +++ b/arch/arm/kernel/relocate_kernel.S | |||
@@ -57,7 +57,8 @@ relocate_new_kernel: | |||
57 | mov r0,#0 | 57 | mov r0,#0 |
58 | ldr r1,kexec_mach_type | 58 | ldr r1,kexec_mach_type |
59 | ldr r2,kexec_boot_atags | 59 | ldr r2,kexec_boot_atags |
60 | mov pc,lr | 60 | ARM( mov pc, lr ) |
61 | THUMB( bx lr ) | ||
61 | 62 | ||
62 | .align | 63 | .align |
63 | 64 | ||
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 70bca649e925..e514c76043b4 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -280,18 +280,19 @@ static void __init cacheid_init(void) | |||
280 | if (arch >= CPU_ARCH_ARMv6) { | 280 | if (arch >= CPU_ARCH_ARMv6) { |
281 | if ((cachetype & (7 << 29)) == 4 << 29) { | 281 | if ((cachetype & (7 << 29)) == 4 << 29) { |
282 | /* ARMv7 register format */ | 282 | /* ARMv7 register format */ |
283 | arch = CPU_ARCH_ARMv7; | ||
283 | cacheid = CACHEID_VIPT_NONALIASING; | 284 | cacheid = CACHEID_VIPT_NONALIASING; |
284 | if ((cachetype & (3 << 14)) == 1 << 14) | 285 | if ((cachetype & (3 << 14)) == 1 << 14) |
285 | cacheid |= CACHEID_ASID_TAGGED; | 286 | cacheid |= CACHEID_ASID_TAGGED; |
286 | else if (cpu_has_aliasing_icache(CPU_ARCH_ARMv7)) | ||
287 | cacheid |= CACHEID_VIPT_I_ALIASING; | ||
288 | } else if (cachetype & (1 << 23)) { | ||
289 | cacheid = CACHEID_VIPT_ALIASING; | ||
290 | } else { | 287 | } else { |
291 | cacheid = CACHEID_VIPT_NONALIASING; | 288 | arch = CPU_ARCH_ARMv6; |
292 | if (cpu_has_aliasing_icache(CPU_ARCH_ARMv6)) | 289 | if (cachetype & (1 << 23)) |
293 | cacheid |= CACHEID_VIPT_I_ALIASING; | 290 | cacheid = CACHEID_VIPT_ALIASING; |
291 | else | ||
292 | cacheid = CACHEID_VIPT_NONALIASING; | ||
294 | } | 293 | } |
294 | if (cpu_has_aliasing_icache(arch)) | ||
295 | cacheid |= CACHEID_VIPT_I_ALIASING; | ||
295 | } else { | 296 | } else { |
296 | cacheid = CACHEID_VIVT; | 297 | cacheid = CACHEID_VIVT; |
297 | } | 298 | } |
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index 2c277d40cee6..01c186222f3b 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c | |||
@@ -137,8 +137,8 @@ void __cpuinit twd_timer_setup(struct clock_event_device *clk) | |||
137 | clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk); | 137 | clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk); |
138 | clk->min_delta_ns = clockevent_delta2ns(0xf, clk); | 138 | clk->min_delta_ns = clockevent_delta2ns(0xf, clk); |
139 | 139 | ||
140 | clockevents_register_device(clk); | ||
141 | |||
140 | /* Make sure our local interrupt controller has this enabled */ | 142 | /* Make sure our local interrupt controller has this enabled */ |
141 | gic_enable_ppi(clk->irq); | 143 | gic_enable_ppi(clk->irq); |
142 | |||
143 | clockevents_register_device(clk); | ||
144 | } | 144 | } |
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c index d522b47e30b5..6c8e3b5f669f 100644 --- a/arch/arm/mach-at91/at91sam9261.c +++ b/arch/arm/mach-at91/at91sam9261.c | |||
@@ -157,7 +157,7 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
157 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), | 157 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), |
158 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), | 158 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), |
159 | CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk), | 159 | CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk), |
160 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc1_clk), | 160 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk), |
161 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), | 161 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), |
162 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | 162 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), |
163 | CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), | 163 | CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), |
diff --git a/arch/arm/mach-cns3xxx/include/mach/entry-macro.S b/arch/arm/mach-cns3xxx/include/mach/entry-macro.S index 6bd83ed90afe..d87bfc397d39 100644 --- a/arch/arm/mach-cns3xxx/include/mach/entry-macro.S +++ b/arch/arm/mach-cns3xxx/include/mach/entry-macro.S | |||
@@ -8,7 +8,6 @@ | |||
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <mach/hardware.h> | ||
12 | #include <asm/hardware/entry-macro-gic.S> | 11 | #include <asm/hardware/entry-macro-gic.S> |
13 | 12 | ||
14 | .macro disable_fiq | 13 | .macro disable_fiq |
diff --git a/arch/arm/mach-cns3xxx/include/mach/system.h b/arch/arm/mach-cns3xxx/include/mach/system.h index 58bb03ae3cf4..4f16c9b79f78 100644 --- a/arch/arm/mach-cns3xxx/include/mach/system.h +++ b/arch/arm/mach-cns3xxx/include/mach/system.h | |||
@@ -13,7 +13,6 @@ | |||
13 | 13 | ||
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <asm/proc-fns.h> | 15 | #include <asm/proc-fns.h> |
16 | #include <mach/hardware.h> | ||
17 | 16 | ||
18 | static inline void arch_idle(void) | 17 | static inline void arch_idle(void) |
19 | { | 18 | { |
diff --git a/arch/arm/mach-cns3xxx/include/mach/uncompress.h b/arch/arm/mach-cns3xxx/include/mach/uncompress.h index de8ead9b91f7..a91b6058ab4f 100644 --- a/arch/arm/mach-cns3xxx/include/mach/uncompress.h +++ b/arch/arm/mach-cns3xxx/include/mach/uncompress.h | |||
@@ -8,7 +8,6 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <asm/mach-types.h> | 10 | #include <asm/mach-types.h> |
11 | #include <mach/hardware.h> | ||
12 | #include <mach/cns3xxx.h> | 11 | #include <mach/cns3xxx.h> |
13 | 12 | ||
14 | #define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00)) | 13 | #define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00)) |
diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c index 06fd25d70aec..0f8fca48a5ed 100644 --- a/arch/arm/mach-cns3xxx/pcie.c +++ b/arch/arm/mach-cns3xxx/pcie.c | |||
@@ -49,7 +49,7 @@ static struct cns3xxx_pcie *sysdata_to_cnspci(void *sysdata) | |||
49 | return &cns3xxx_pcie[root->domain]; | 49 | return &cns3xxx_pcie[root->domain]; |
50 | } | 50 | } |
51 | 51 | ||
52 | static struct cns3xxx_pcie *pdev_to_cnspci(struct pci_dev *dev) | 52 | static struct cns3xxx_pcie *pdev_to_cnspci(const struct pci_dev *dev) |
53 | { | 53 | { |
54 | return sysdata_to_cnspci(dev->sysdata); | 54 | return sysdata_to_cnspci(dev->sysdata); |
55 | } | 55 | } |
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index bd5394537c88..008d51407cd7 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c | |||
@@ -115,6 +115,32 @@ static struct spi_board_info da850evm_spi_info[] = { | |||
115 | }, | 115 | }, |
116 | }; | 116 | }; |
117 | 117 | ||
118 | #ifdef CONFIG_MTD | ||
119 | static void da850_evm_m25p80_notify_add(struct mtd_info *mtd) | ||
120 | { | ||
121 | char *mac_addr = davinci_soc_info.emac_pdata->mac_addr; | ||
122 | size_t retlen; | ||
123 | |||
124 | if (!strcmp(mtd->name, "MAC-Address")) { | ||
125 | mtd->read(mtd, 0, ETH_ALEN, &retlen, mac_addr); | ||
126 | if (retlen == ETH_ALEN) | ||
127 | pr_info("Read MAC addr from SPI Flash: %pM\n", | ||
128 | mac_addr); | ||
129 | } | ||
130 | } | ||
131 | |||
132 | static struct mtd_notifier da850evm_spi_notifier = { | ||
133 | .add = da850_evm_m25p80_notify_add, | ||
134 | }; | ||
135 | |||
136 | static void da850_evm_setup_mac_addr(void) | ||
137 | { | ||
138 | register_mtd_user(&da850evm_spi_notifier); | ||
139 | } | ||
140 | #else | ||
141 | static void da850_evm_setup_mac_addr(void) { } | ||
142 | #endif | ||
143 | |||
118 | static struct mtd_partition da850_evm_norflash_partition[] = { | 144 | static struct mtd_partition da850_evm_norflash_partition[] = { |
119 | { | 145 | { |
120 | .name = "bootloaders + env", | 146 | .name = "bootloaders + env", |
@@ -1244,6 +1270,8 @@ static __init void da850_evm_init(void) | |||
1244 | if (ret) | 1270 | if (ret) |
1245 | pr_warning("da850_evm_init: sata registration failed: %d\n", | 1271 | pr_warning("da850_evm_init: sata registration failed: %d\n", |
1246 | ret); | 1272 | ret); |
1273 | |||
1274 | da850_evm_setup_mac_addr(); | ||
1247 | } | 1275 | } |
1248 | 1276 | ||
1249 | #ifdef CONFIG_SERIAL_8250_CONSOLE | 1277 | #ifdef CONFIG_SERIAL_8250_CONSOLE |
diff --git a/arch/arm/mach-davinci/include/mach/psc.h b/arch/arm/mach-davinci/include/mach/psc.h index 47fd0bc3d3e7..fa59c097223d 100644 --- a/arch/arm/mach-davinci/include/mach/psc.h +++ b/arch/arm/mach-davinci/include/mach/psc.h | |||
@@ -243,7 +243,7 @@ | |||
243 | #define PSC_STATE_DISABLE 2 | 243 | #define PSC_STATE_DISABLE 2 |
244 | #define PSC_STATE_ENABLE 3 | 244 | #define PSC_STATE_ENABLE 3 |
245 | 245 | ||
246 | #define MDSTAT_STATE_MASK 0x1f | 246 | #define MDSTAT_STATE_MASK 0x3f |
247 | #define MDCTL_FORCE BIT(31) | 247 | #define MDCTL_FORCE BIT(31) |
248 | 248 | ||
249 | #ifndef __ASSEMBLER__ | 249 | #ifndef __ASSEMBLER__ |
diff --git a/arch/arm/mach-davinci/sleep.S b/arch/arm/mach-davinci/sleep.S index fb5e72b532b0..5f1e045a3ad1 100644 --- a/arch/arm/mach-davinci/sleep.S +++ b/arch/arm/mach-davinci/sleep.S | |||
@@ -217,7 +217,11 @@ ddr2clk_stop_done: | |||
217 | ENDPROC(davinci_ddr_psc_config) | 217 | ENDPROC(davinci_ddr_psc_config) |
218 | 218 | ||
219 | CACHE_FLUSH: | 219 | CACHE_FLUSH: |
220 | .word arm926_flush_kern_cache_all | 220 | #ifdef CONFIG_CPU_V6 |
221 | .word v6_flush_kern_cache_all | ||
222 | #else | ||
223 | .word arm926_flush_kern_cache_all | ||
224 | #endif | ||
221 | 225 | ||
222 | ENTRY(davinci_cpu_suspend_sz) | 226 | ENTRY(davinci_cpu_suspend_sz) |
223 | .word . - davinci_cpu_suspend | 227 | .word . - davinci_cpu_suspend |
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c index 83dce859886d..a9e0dae86a26 100644 --- a/arch/arm/mach-dove/common.c +++ b/arch/arm/mach-dove/common.c | |||
@@ -158,7 +158,7 @@ void __init dove_spi0_init(void) | |||
158 | 158 | ||
159 | void __init dove_spi1_init(void) | 159 | void __init dove_spi1_init(void) |
160 | { | 160 | { |
161 | orion_spi_init(DOVE_SPI1_PHYS_BASE, get_tclk()); | 161 | orion_spi_1_init(DOVE_SPI1_PHYS_BASE, get_tclk()); |
162 | } | 162 | } |
163 | 163 | ||
164 | /***************************************************************************** | 164 | /***************************************************************************** |
diff --git a/arch/arm/mach-ep93xx/include/mach/ts72xx.h b/arch/arm/mach-ep93xx/include/mach/ts72xx.h index 0eabec62cd9d..f1397a13e76b 100644 --- a/arch/arm/mach-ep93xx/include/mach/ts72xx.h +++ b/arch/arm/mach-ep93xx/include/mach/ts72xx.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * TS72xx memory map: | 6 | * TS72xx memory map: |
7 | * | 7 | * |
8 | * virt phys size | 8 | * virt phys size |
9 | * febff000 22000000 4K model number register | 9 | * febff000 22000000 4K model number register (bits 0-2) |
10 | * febfe000 22400000 4K options register | 10 | * febfe000 22400000 4K options register |
11 | * febfd000 22800000 4K options register #2 | 11 | * febfd000 22800000 4K options register #2 |
12 | * febf9000 10800000 4K TS-5620 RTC index register | 12 | * febf9000 10800000 4K TS-5620 RTC index register |
@@ -20,6 +20,9 @@ | |||
20 | #define TS72XX_MODEL_TS7200 0x00 | 20 | #define TS72XX_MODEL_TS7200 0x00 |
21 | #define TS72XX_MODEL_TS7250 0x01 | 21 | #define TS72XX_MODEL_TS7250 0x01 |
22 | #define TS72XX_MODEL_TS7260 0x02 | 22 | #define TS72XX_MODEL_TS7260 0x02 |
23 | #define TS72XX_MODEL_TS7300 0x03 | ||
24 | #define TS72XX_MODEL_TS7400 0x04 | ||
25 | #define TS72XX_MODEL_MASK 0x07 | ||
23 | 26 | ||
24 | 27 | ||
25 | #define TS72XX_OPTIONS_PHYS_BASE 0x22400000 | 28 | #define TS72XX_OPTIONS_PHYS_BASE 0x22400000 |
@@ -51,19 +54,34 @@ | |||
51 | 54 | ||
52 | #ifndef __ASSEMBLY__ | 55 | #ifndef __ASSEMBLY__ |
53 | 56 | ||
57 | static inline int ts72xx_model(void) | ||
58 | { | ||
59 | return __raw_readb(TS72XX_MODEL_VIRT_BASE) & TS72XX_MODEL_MASK; | ||
60 | } | ||
61 | |||
54 | static inline int board_is_ts7200(void) | 62 | static inline int board_is_ts7200(void) |
55 | { | 63 | { |
56 | return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7200; | 64 | return ts72xx_model() == TS72XX_MODEL_TS7200; |
57 | } | 65 | } |
58 | 66 | ||
59 | static inline int board_is_ts7250(void) | 67 | static inline int board_is_ts7250(void) |
60 | { | 68 | { |
61 | return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7250; | 69 | return ts72xx_model() == TS72XX_MODEL_TS7250; |
62 | } | 70 | } |
63 | 71 | ||
64 | static inline int board_is_ts7260(void) | 72 | static inline int board_is_ts7260(void) |
65 | { | 73 | { |
66 | return __raw_readb(TS72XX_MODEL_VIRT_BASE) == TS72XX_MODEL_TS7260; | 74 | return ts72xx_model() == TS72XX_MODEL_TS7260; |
75 | } | ||
76 | |||
77 | static inline int board_is_ts7300(void) | ||
78 | { | ||
79 | return ts72xx_model() == TS72XX_MODEL_TS7300; | ||
80 | } | ||
81 | |||
82 | static inline int board_is_ts7400(void) | ||
83 | { | ||
84 | return ts72xx_model() == TS72XX_MODEL_TS7400; | ||
67 | } | 85 | } |
68 | 86 | ||
69 | static inline int is_max197_installed(void) | 87 | static inline int is_max197_installed(void) |
diff --git a/arch/arm/mach-exynos4/clock.c b/arch/arm/mach-exynos4/clock.c index 851dea018578..79d6cd0c8e7b 100644 --- a/arch/arm/mach-exynos4/clock.c +++ b/arch/arm/mach-exynos4/clock.c | |||
@@ -520,7 +520,7 @@ static struct clk init_clocks_off[] = { | |||
520 | .ctrlbit = (1 << 21), | 520 | .ctrlbit = (1 << 21), |
521 | }, { | 521 | }, { |
522 | .name = "ac97", | 522 | .name = "ac97", |
523 | .id = -1, | 523 | .devname = "samsung-ac97", |
524 | .enable = exynos4_clk_ip_peril_ctrl, | 524 | .enable = exynos4_clk_ip_peril_ctrl, |
525 | .ctrlbit = (1 << 27), | 525 | .ctrlbit = (1 << 27), |
526 | }, { | 526 | }, { |
@@ -1160,7 +1160,7 @@ void __init_or_cpufreq exynos4_setup_clocks(void) | |||
1160 | 1160 | ||
1161 | vpllsrc = clk_get_rate(&clk_vpllsrc.clk); | 1161 | vpllsrc = clk_get_rate(&clk_vpllsrc.clk); |
1162 | vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(S5P_VPLL_CON0), | 1162 | vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(S5P_VPLL_CON0), |
1163 | __raw_readl(S5P_VPLL_CON1), pll_4650); | 1163 | __raw_readl(S5P_VPLL_CON1), pll_4650c); |
1164 | 1164 | ||
1165 | clk_fout_apll.ops = &exynos4_fout_apll_ops; | 1165 | clk_fout_apll.ops = &exynos4_fout_apll_ops; |
1166 | clk_fout_mpll.rate = mpll; | 1166 | clk_fout_mpll.rate = mpll; |
diff --git a/arch/arm/mach-exynos4/cpu.c b/arch/arm/mach-exynos4/cpu.c index 2d8a40c9e6e5..746d6fc6d397 100644 --- a/arch/arm/mach-exynos4/cpu.c +++ b/arch/arm/mach-exynos4/cpu.c | |||
@@ -24,12 +24,13 @@ | |||
24 | #include <plat/exynos4.h> | 24 | #include <plat/exynos4.h> |
25 | #include <plat/adc-core.h> | 25 | #include <plat/adc-core.h> |
26 | #include <plat/sdhci.h> | 26 | #include <plat/sdhci.h> |
27 | #include <plat/devs.h> | ||
28 | #include <plat/fb-core.h> | 27 | #include <plat/fb-core.h> |
29 | #include <plat/fimc-core.h> | 28 | #include <plat/fimc-core.h> |
30 | #include <plat/iic-core.h> | 29 | #include <plat/iic-core.h> |
30 | #include <plat/reset.h> | ||
31 | 31 | ||
32 | #include <mach/regs-irq.h> | 32 | #include <mach/regs-irq.h> |
33 | #include <mach/regs-pmu.h> | ||
33 | 34 | ||
34 | extern int combiner_init(unsigned int combiner_nr, void __iomem *base, | 35 | extern int combiner_init(unsigned int combiner_nr, void __iomem *base, |
35 | unsigned int irq_start); | 36 | unsigned int irq_start); |
@@ -128,6 +129,11 @@ static void exynos4_idle(void) | |||
128 | local_irq_enable(); | 129 | local_irq_enable(); |
129 | } | 130 | } |
130 | 131 | ||
132 | static void exynos4_sw_reset(void) | ||
133 | { | ||
134 | __raw_writel(0x1, S5P_SWRESET); | ||
135 | } | ||
136 | |||
131 | /* | 137 | /* |
132 | * exynos4_map_io | 138 | * exynos4_map_io |
133 | * | 139 | * |
@@ -241,5 +247,8 @@ int __init exynos4_init(void) | |||
241 | /* set idle function */ | 247 | /* set idle function */ |
242 | pm_idle = exynos4_idle; | 248 | pm_idle = exynos4_idle; |
243 | 249 | ||
250 | /* set sw_reset function */ | ||
251 | s5p_reset_hook = exynos4_sw_reset; | ||
252 | |||
244 | return sysdev_register(&exynos4_sysdev); | 253 | return sysdev_register(&exynos4_sysdev); |
245 | } | 254 | } |
diff --git a/arch/arm/mach-exynos4/include/mach/irqs.h b/arch/arm/mach-exynos4/include/mach/irqs.h index 934d2a493982..f8952f8f3757 100644 --- a/arch/arm/mach-exynos4/include/mach/irqs.h +++ b/arch/arm/mach-exynos4/include/mach/irqs.h | |||
@@ -80,9 +80,8 @@ | |||
80 | #define IRQ_HSMMC3 IRQ_SPI(76) | 80 | #define IRQ_HSMMC3 IRQ_SPI(76) |
81 | #define IRQ_DWMCI IRQ_SPI(77) | 81 | #define IRQ_DWMCI IRQ_SPI(77) |
82 | 82 | ||
83 | #define IRQ_MIPICSI0 IRQ_SPI(78) | 83 | #define IRQ_MIPI_CSIS0 IRQ_SPI(78) |
84 | 84 | #define IRQ_MIPI_CSIS1 IRQ_SPI(80) | |
85 | #define IRQ_MIPICSI1 IRQ_SPI(80) | ||
86 | 85 | ||
87 | #define IRQ_ONENAND_AUDI IRQ_SPI(82) | 86 | #define IRQ_ONENAND_AUDI IRQ_SPI(82) |
88 | #define IRQ_ROTATOR IRQ_SPI(83) | 87 | #define IRQ_ROTATOR IRQ_SPI(83) |
diff --git a/arch/arm/mach-exynos4/include/mach/regs-pmu.h b/arch/arm/mach-exynos4/include/mach/regs-pmu.h index fa49bbb8e7b0..cdf9b47c303c 100644 --- a/arch/arm/mach-exynos4/include/mach/regs-pmu.h +++ b/arch/arm/mach-exynos4/include/mach/regs-pmu.h | |||
@@ -29,6 +29,8 @@ | |||
29 | #define S5P_USE_STANDBY_WFE1 (1 << 25) | 29 | #define S5P_USE_STANDBY_WFE1 (1 << 25) |
30 | #define S5P_USE_MASK ((0x3 << 16) | (0x3 << 24)) | 30 | #define S5P_USE_MASK ((0x3 << 16) | (0x3 << 24)) |
31 | 31 | ||
32 | #define S5P_SWRESET S5P_PMUREG(0x0400) | ||
33 | |||
32 | #define S5P_WAKEUP_STAT S5P_PMUREG(0x0600) | 34 | #define S5P_WAKEUP_STAT S5P_PMUREG(0x0600) |
33 | #define S5P_EINT_WAKEUP_MASK S5P_PMUREG(0x0604) | 35 | #define S5P_EINT_WAKEUP_MASK S5P_PMUREG(0x0604) |
34 | #define S5P_WAKEUP_MASK S5P_PMUREG(0x0608) | 36 | #define S5P_WAKEUP_MASK S5P_PMUREG(0x0608) |
diff --git a/arch/arm/mach-exynos4/irq-eint.c b/arch/arm/mach-exynos4/irq-eint.c index 9d87d2ac7f68..badb8c66fc9b 100644 --- a/arch/arm/mach-exynos4/irq-eint.c +++ b/arch/arm/mach-exynos4/irq-eint.c | |||
@@ -23,6 +23,8 @@ | |||
23 | 23 | ||
24 | #include <mach/regs-gpio.h> | 24 | #include <mach/regs-gpio.h> |
25 | 25 | ||
26 | #include <asm/mach/irq.h> | ||
27 | |||
26 | static DEFINE_SPINLOCK(eint_lock); | 28 | static DEFINE_SPINLOCK(eint_lock); |
27 | 29 | ||
28 | static unsigned int eint0_15_data[16]; | 30 | static unsigned int eint0_15_data[16]; |
@@ -184,8 +186,11 @@ static inline void exynos4_irq_demux_eint(unsigned int start) | |||
184 | 186 | ||
185 | static void exynos4_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc) | 187 | static void exynos4_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc) |
186 | { | 188 | { |
189 | struct irq_chip *chip = irq_get_chip(irq); | ||
190 | chained_irq_enter(chip, desc); | ||
187 | exynos4_irq_demux_eint(IRQ_EINT(16)); | 191 | exynos4_irq_demux_eint(IRQ_EINT(16)); |
188 | exynos4_irq_demux_eint(IRQ_EINT(24)); | 192 | exynos4_irq_demux_eint(IRQ_EINT(24)); |
193 | chained_irq_exit(chip, desc); | ||
189 | } | 194 | } |
190 | 195 | ||
191 | static void exynos4_irq_eint0_15(unsigned int irq, struct irq_desc *desc) | 196 | static void exynos4_irq_eint0_15(unsigned int irq, struct irq_desc *desc) |
@@ -193,6 +198,7 @@ static void exynos4_irq_eint0_15(unsigned int irq, struct irq_desc *desc) | |||
193 | u32 *irq_data = irq_get_handler_data(irq); | 198 | u32 *irq_data = irq_get_handler_data(irq); |
194 | struct irq_chip *chip = irq_get_chip(irq); | 199 | struct irq_chip *chip = irq_get_chip(irq); |
195 | 200 | ||
201 | chained_irq_enter(chip, desc); | ||
196 | chip->irq_mask(&desc->irq_data); | 202 | chip->irq_mask(&desc->irq_data); |
197 | 203 | ||
198 | if (chip->irq_ack) | 204 | if (chip->irq_ack) |
@@ -201,6 +207,7 @@ static void exynos4_irq_eint0_15(unsigned int irq, struct irq_desc *desc) | |||
201 | generic_handle_irq(*irq_data); | 207 | generic_handle_irq(*irq_data); |
202 | 208 | ||
203 | chip->irq_unmask(&desc->irq_data); | 209 | chip->irq_unmask(&desc->irq_data); |
210 | chained_irq_exit(chip, desc); | ||
204 | } | 211 | } |
205 | 212 | ||
206 | int __init exynos4_init_irq_eint(void) | 213 | int __init exynos4_init_irq_eint(void) |
diff --git a/arch/arm/mach-exynos4/mach-universal_c210.c b/arch/arm/mach-exynos4/mach-universal_c210.c index 0e280d12301e..b3b5d8911004 100644 --- a/arch/arm/mach-exynos4/mach-universal_c210.c +++ b/arch/arm/mach-exynos4/mach-universal_c210.c | |||
@@ -79,7 +79,7 @@ static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { | |||
79 | }; | 79 | }; |
80 | 80 | ||
81 | static struct regulator_consumer_supply max8952_consumer = | 81 | static struct regulator_consumer_supply max8952_consumer = |
82 | REGULATOR_SUPPLY("vddarm", NULL); | 82 | REGULATOR_SUPPLY("vdd_arm", NULL); |
83 | 83 | ||
84 | static struct max8952_platform_data universal_max8952_pdata __initdata = { | 84 | static struct max8952_platform_data universal_max8952_pdata __initdata = { |
85 | .gpio_vid0 = EXYNOS4_GPX0(3), | 85 | .gpio_vid0 = EXYNOS4_GPX0(3), |
@@ -105,7 +105,7 @@ static struct max8952_platform_data universal_max8952_pdata __initdata = { | |||
105 | }; | 105 | }; |
106 | 106 | ||
107 | static struct regulator_consumer_supply lp3974_buck1_consumer = | 107 | static struct regulator_consumer_supply lp3974_buck1_consumer = |
108 | REGULATOR_SUPPLY("vddint", NULL); | 108 | REGULATOR_SUPPLY("vdd_int", NULL); |
109 | 109 | ||
110 | static struct regulator_consumer_supply lp3974_buck2_consumer = | 110 | static struct regulator_consumer_supply lp3974_buck2_consumer = |
111 | REGULATOR_SUPPLY("vddg3d", NULL); | 111 | REGULATOR_SUPPLY("vddg3d", NULL); |
diff --git a/arch/arm/mach-exynos4/mct.c b/arch/arm/mach-exynos4/mct.c index 1ae059b7ad7b..ddd86864fb83 100644 --- a/arch/arm/mach-exynos4/mct.c +++ b/arch/arm/mach-exynos4/mct.c | |||
@@ -132,12 +132,18 @@ static cycle_t exynos4_frc_read(struct clocksource *cs) | |||
132 | return ((cycle_t)hi << 32) | lo; | 132 | return ((cycle_t)hi << 32) | lo; |
133 | } | 133 | } |
134 | 134 | ||
135 | static void exynos4_frc_resume(struct clocksource *cs) | ||
136 | { | ||
137 | exynos4_mct_frc_start(0, 0); | ||
138 | } | ||
139 | |||
135 | struct clocksource mct_frc = { | 140 | struct clocksource mct_frc = { |
136 | .name = "mct-frc", | 141 | .name = "mct-frc", |
137 | .rating = 400, | 142 | .rating = 400, |
138 | .read = exynos4_frc_read, | 143 | .read = exynos4_frc_read, |
139 | .mask = CLOCKSOURCE_MASK(64), | 144 | .mask = CLOCKSOURCE_MASK(64), |
140 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 145 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
146 | .resume = exynos4_frc_resume, | ||
141 | }; | 147 | }; |
142 | 148 | ||
143 | static void __init exynos4_clocksource_init(void) | 149 | static void __init exynos4_clocksource_init(void) |
@@ -389,9 +395,11 @@ static void exynos4_mct_tick_init(struct clock_event_device *evt) | |||
389 | } | 395 | } |
390 | 396 | ||
391 | /* Setup the local clock events for a CPU */ | 397 | /* Setup the local clock events for a CPU */ |
392 | void __cpuinit local_timer_setup(struct clock_event_device *evt) | 398 | int __cpuinit local_timer_setup(struct clock_event_device *evt) |
393 | { | 399 | { |
394 | exynos4_mct_tick_init(evt); | 400 | exynos4_mct_tick_init(evt); |
401 | |||
402 | return 0; | ||
395 | } | 403 | } |
396 | 404 | ||
397 | int local_timer_ack(void) | 405 | int local_timer_ack(void) |
diff --git a/arch/arm/mach-exynos4/platsmp.c b/arch/arm/mach-exynos4/platsmp.c index 7c2282c6ba81..df6ef1b2f98b 100644 --- a/arch/arm/mach-exynos4/platsmp.c +++ b/arch/arm/mach-exynos4/platsmp.c | |||
@@ -106,6 +106,8 @@ void __cpuinit platform_secondary_init(unsigned int cpu) | |||
106 | */ | 106 | */ |
107 | spin_lock(&boot_lock); | 107 | spin_lock(&boot_lock); |
108 | spin_unlock(&boot_lock); | 108 | spin_unlock(&boot_lock); |
109 | |||
110 | set_cpu_online(cpu, true); | ||
109 | } | 111 | } |
110 | 112 | ||
111 | int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) | 113 | int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle) |
diff --git a/arch/arm/mach-exynos4/setup-keypad.c b/arch/arm/mach-exynos4/setup-keypad.c index 1ee0ebff111f..7862bfb5933d 100644 --- a/arch/arm/mach-exynos4/setup-keypad.c +++ b/arch/arm/mach-exynos4/setup-keypad.c | |||
@@ -19,15 +19,16 @@ void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols) | |||
19 | 19 | ||
20 | if (rows > 8) { | 20 | if (rows > 8) { |
21 | /* Set all the necessary GPX2 pins: KP_ROW[0~7] */ | 21 | /* Set all the necessary GPX2 pins: KP_ROW[0~7] */ |
22 | s3c_gpio_cfgrange_nopull(EXYNOS4_GPX2(0), 8, S3C_GPIO_SFN(3)); | 22 | s3c_gpio_cfgall_range(EXYNOS4_GPX2(0), 8, S3C_GPIO_SFN(3), |
23 | S3C_GPIO_PULL_UP); | ||
23 | 24 | ||
24 | /* Set all the necessary GPX3 pins: KP_ROW[8~] */ | 25 | /* Set all the necessary GPX3 pins: KP_ROW[8~] */ |
25 | s3c_gpio_cfgrange_nopull(EXYNOS4_GPX3(0), (rows - 8), | 26 | s3c_gpio_cfgall_range(EXYNOS4_GPX3(0), (rows - 8), |
26 | S3C_GPIO_SFN(3)); | 27 | S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP); |
27 | } else { | 28 | } else { |
28 | /* Set all the necessary GPX2 pins: KP_ROW[x] */ | 29 | /* Set all the necessary GPX2 pins: KP_ROW[x] */ |
29 | s3c_gpio_cfgrange_nopull(EXYNOS4_GPX2(0), rows, | 30 | s3c_gpio_cfgall_range(EXYNOS4_GPX2(0), rows, S3C_GPIO_SFN(3), |
30 | S3C_GPIO_SFN(3)); | 31 | S3C_GPIO_PULL_UP); |
31 | } | 32 | } |
32 | 33 | ||
33 | /* Set all the necessary GPX1 pins to special-function 3: KP_COL[x] */ | 34 | /* Set all the necessary GPX1 pins to special-function 3: KP_COL[x] */ |
diff --git a/arch/arm/mach-exynos4/setup-usb-phy.c b/arch/arm/mach-exynos4/setup-usb-phy.c index 0883c1b824b9..39aca045f660 100644 --- a/arch/arm/mach-exynos4/setup-usb-phy.c +++ b/arch/arm/mach-exynos4/setup-usb-phy.c | |||
@@ -82,7 +82,7 @@ static int exynos4_usb_phy1_init(struct platform_device *pdev) | |||
82 | 82 | ||
83 | rstcon &= ~(HOST_LINK_PORT_SWRST_MASK | PHY1_SWRST_MASK); | 83 | rstcon &= ~(HOST_LINK_PORT_SWRST_MASK | PHY1_SWRST_MASK); |
84 | writel(rstcon, EXYNOS4_RSTCON); | 84 | writel(rstcon, EXYNOS4_RSTCON); |
85 | udelay(50); | 85 | udelay(80); |
86 | 86 | ||
87 | clk_disable(otg_clk); | 87 | clk_disable(otg_clk); |
88 | clk_put(otg_clk); | 88 | clk_put(otg_clk); |
diff --git a/arch/arm/mach-footbridge/Kconfig b/arch/arm/mach-footbridge/Kconfig index dc26fff22cf0..c8e7afcf14ec 100644 --- a/arch/arm/mach-footbridge/Kconfig +++ b/arch/arm/mach-footbridge/Kconfig | |||
@@ -62,6 +62,7 @@ config ARCH_EBSA285_HOST | |||
62 | config ARCH_NETWINDER | 62 | config ARCH_NETWINDER |
63 | bool "NetWinder" | 63 | bool "NetWinder" |
64 | select CLKSRC_I8253 | 64 | select CLKSRC_I8253 |
65 | select CLKEVT_I8253 | ||
65 | select FOOTBRIDGE_HOST | 66 | select FOOTBRIDGE_HOST |
66 | select ISA | 67 | select ISA |
67 | select ISA_DMA | 68 | select ISA_DMA |
diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c index 1331fff51ae2..18c32a5541d9 100644 --- a/arch/arm/mach-footbridge/dc21285.c +++ b/arch/arm/mach-footbridge/dc21285.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/irq.h> | 18 | #include <linux/irq.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
21 | #include <video/vga.h> | ||
21 | 22 | ||
22 | #include <asm/irq.h> | 23 | #include <asm/irq.h> |
23 | #include <asm/system.h> | 24 | #include <asm/system.h> |
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c index 87887ac5806b..f851fe903687 100644 --- a/arch/arm/mach-imx/mach-cpuimx27.c +++ b/arch/arm/mach-imx/mach-cpuimx27.c | |||
@@ -310,7 +310,7 @@ static struct sys_timer eukrea_cpuimx27_timer = { | |||
310 | .init = eukrea_cpuimx27_timer_init, | 310 | .init = eukrea_cpuimx27_timer_init, |
311 | }; | 311 | }; |
312 | 312 | ||
313 | MACHINE_START(CPUIMX27, "EUKREA CPUIMX27") | 313 | MACHINE_START(EUKREA_CPUIMX27, "EUKREA CPUIMX27") |
314 | .boot_params = MX27_PHYS_OFFSET + 0x100, | 314 | .boot_params = MX27_PHYS_OFFSET + 0x100, |
315 | .map_io = mx27_map_io, | 315 | .map_io = mx27_map_io, |
316 | .init_early = imx27_init_early, | 316 | .init_early = imx27_init_early, |
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c index f39a478ba1a6..4bd083ba9af2 100644 --- a/arch/arm/mach-imx/mach-cpuimx35.c +++ b/arch/arm/mach-imx/mach-cpuimx35.c | |||
@@ -192,7 +192,7 @@ struct sys_timer eukrea_cpuimx35_timer = { | |||
192 | .init = eukrea_cpuimx35_timer_init, | 192 | .init = eukrea_cpuimx35_timer_init, |
193 | }; | 193 | }; |
194 | 194 | ||
195 | MACHINE_START(EUKREA_CPUIMX35, "Eukrea CPUIMX35") | 195 | MACHINE_START(EUKREA_CPUIMX35SD, "Eukrea CPUIMX35") |
196 | /* Maintainer: Eukrea Electromatique */ | 196 | /* Maintainer: Eukrea Electromatique */ |
197 | .boot_params = MX3x_PHYS_OFFSET + 0x100, | 197 | .boot_params = MX3x_PHYS_OFFSET + 0x100, |
198 | .map_io = mx35_map_io, | 198 | .map_io = mx35_map_io, |
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c index da36da52969d..2442d5da883d 100644 --- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c +++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c | |||
@@ -161,7 +161,7 @@ static struct sys_timer eukrea_cpuimx25_timer = { | |||
161 | .init = eukrea_cpuimx25_timer_init, | 161 | .init = eukrea_cpuimx25_timer_init, |
162 | }; | 162 | }; |
163 | 163 | ||
164 | MACHINE_START(EUKREA_CPUIMX25, "Eukrea CPUIMX25") | 164 | MACHINE_START(EUKREA_CPUIMX25SD, "Eukrea CPUIMX25") |
165 | /* Maintainer: Eukrea Electromatique */ | 165 | /* Maintainer: Eukrea Electromatique */ |
166 | .boot_params = MX25_PHYS_OFFSET + 0x100, | 166 | .boot_params = MX25_PHYS_OFFSET + 0x100, |
167 | .map_io = mx25_map_io, | 167 | .map_io = mx25_map_io, |
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index 2fbbdd5eac35..8cdc730dcb3a 100644 --- a/arch/arm/mach-integrator/integrator_ap.c +++ b/arch/arm/mach-integrator/integrator_ap.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/interrupt.h> | 32 | #include <linux/interrupt.h> |
33 | #include <linux/io.h> | 33 | #include <linux/io.h> |
34 | #include <linux/mtd/physmap.h> | 34 | #include <linux/mtd/physmap.h> |
35 | #include <video/vga.h> | ||
35 | 36 | ||
36 | #include <mach/hardware.h> | 37 | #include <mach/hardware.h> |
37 | #include <mach/platform.h> | 38 | #include <mach/platform.h> |
@@ -154,6 +155,7 @@ static struct map_desc ap_io_desc[] __initdata = { | |||
154 | static void __init ap_map_io(void) | 155 | static void __init ap_map_io(void) |
155 | { | 156 | { |
156 | iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc)); | 157 | iotable_init(ap_io_desc, ARRAY_SIZE(ap_io_desc)); |
158 | vga_base = PCI_MEMORY_VADDR; | ||
157 | } | 159 | } |
158 | 160 | ||
159 | #define INTEGRATOR_SC_VALID_INT 0x003fffff | 161 | #define INTEGRATOR_SC_VALID_INT 0x003fffff |
@@ -337,15 +339,15 @@ static unsigned long timer_reload; | |||
337 | static void integrator_clocksource_init(u32 khz) | 339 | static void integrator_clocksource_init(u32 khz) |
338 | { | 340 | { |
339 | void __iomem *base = (void __iomem *)TIMER2_VA_BASE; | 341 | void __iomem *base = (void __iomem *)TIMER2_VA_BASE; |
340 | u32 ctrl = TIMER_CTRL_ENABLE; | 342 | u32 ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC; |
341 | 343 | ||
342 | if (khz >= 1500) { | 344 | if (khz >= 1500) { |
343 | khz /= 16; | 345 | khz /= 16; |
344 | ctrl = TIMER_CTRL_DIV16; | 346 | ctrl |= TIMER_CTRL_DIV16; |
345 | } | 347 | } |
346 | 348 | ||
347 | writel(ctrl, base + TIMER_CTRL); | ||
348 | writel(0xffff, base + TIMER_LOAD); | 349 | writel(0xffff, base + TIMER_LOAD); |
350 | writel(ctrl, base + TIMER_CTRL); | ||
349 | 351 | ||
350 | clocksource_mmio_init(base + TIMER_VALUE, "timer2", | 352 | clocksource_mmio_init(base + TIMER_VALUE, "timer2", |
351 | khz * 1000, 200, 16, clocksource_mmio_readl_down); | 353 | khz * 1000, 200, 16, clocksource_mmio_readl_down); |
diff --git a/arch/arm/mach-integrator/pci_v3.c b/arch/arm/mach-integrator/pci_v3.c index dd56bfb351e3..11b86e5b71c2 100644 --- a/arch/arm/mach-integrator/pci_v3.c +++ b/arch/arm/mach-integrator/pci_v3.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include <linux/spinlock.h> | 27 | #include <linux/spinlock.h> |
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
30 | #include <video/vga.h> | ||
31 | 30 | ||
32 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
33 | #include <mach/platform.h> | 32 | #include <mach/platform.h> |
@@ -505,7 +504,6 @@ void __init pci_v3_preinit(void) | |||
505 | 504 | ||
506 | pcibios_min_io = 0x6000; | 505 | pcibios_min_io = 0x6000; |
507 | pcibios_min_mem = 0x00100000; | 506 | pcibios_min_mem = 0x00100000; |
508 | vga_base = PCI_MEMORY_VADDR; | ||
509 | 507 | ||
510 | /* | 508 | /* |
511 | * Hook in our fault handler for PCI errors | 509 | * Hook in our fault handler for PCI errors |
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c index ffd55b1c4396..b9b844683147 100644 --- a/arch/arm/mach-omap2/clock3xxx_data.c +++ b/arch/arm/mach-omap2/clock3xxx_data.c | |||
@@ -3078,6 +3078,7 @@ static struct clk gpt12_fck = { | |||
3078 | .name = "gpt12_fck", | 3078 | .name = "gpt12_fck", |
3079 | .ops = &clkops_null, | 3079 | .ops = &clkops_null, |
3080 | .parent = &secure_32k_fck, | 3080 | .parent = &secure_32k_fck, |
3081 | .clkdm_name = "wkup_clkdm", | ||
3081 | .recalc = &followparent_recalc, | 3082 | .recalc = &followparent_recalc, |
3082 | }; | 3083 | }; |
3083 | 3084 | ||
@@ -3085,6 +3086,7 @@ static struct clk wdt1_fck = { | |||
3085 | .name = "wdt1_fck", | 3086 | .name = "wdt1_fck", |
3086 | .ops = &clkops_null, | 3087 | .ops = &clkops_null, |
3087 | .parent = &secure_32k_fck, | 3088 | .parent = &secure_32k_fck, |
3089 | .clkdm_name = "wkup_clkdm", | ||
3088 | .recalc = &followparent_recalc, | 3090 | .recalc = &followparent_recalc, |
3089 | }; | 3091 | }; |
3090 | 3092 | ||
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index 2af0e3f00ce1..c0b6fbda3408 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c | |||
@@ -3376,10 +3376,18 @@ int __init omap4xxx_clk_init(void) | |||
3376 | } else if (cpu_is_omap446x()) { | 3376 | } else if (cpu_is_omap446x()) { |
3377 | cpu_mask = RATE_IN_4460; | 3377 | cpu_mask = RATE_IN_4460; |
3378 | cpu_clkflg = CK_446X; | 3378 | cpu_clkflg = CK_446X; |
3379 | } else { | ||
3380 | return 0; | ||
3379 | } | 3381 | } |
3380 | 3382 | ||
3381 | clk_init(&omap2_clk_functions); | 3383 | clk_init(&omap2_clk_functions); |
3382 | omap2_clk_disable_clkdm_control(); | 3384 | |
3385 | /* | ||
3386 | * Must stay commented until all OMAP SoC drivers are | ||
3387 | * converted to runtime PM, or drivers may start crashing | ||
3388 | * | ||
3389 | * omap2_clk_disable_clkdm_control(); | ||
3390 | */ | ||
3383 | 3391 | ||
3384 | for (c = omap44xx_clks; c < omap44xx_clks + ARRAY_SIZE(omap44xx_clks); | 3392 | for (c = omap44xx_clks; c < omap44xx_clks + ARRAY_SIZE(omap44xx_clks); |
3385 | c++) | 3393 | c++) |
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index ab7db083f97f..8f0890685d7b 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c | |||
@@ -747,6 +747,7 @@ int clkdm_wakeup(struct clockdomain *clkdm) | |||
747 | spin_lock_irqsave(&clkdm->lock, flags); | 747 | spin_lock_irqsave(&clkdm->lock, flags); |
748 | clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED; | 748 | clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED; |
749 | ret = arch_clkdm->clkdm_wakeup(clkdm); | 749 | ret = arch_clkdm->clkdm_wakeup(clkdm); |
750 | ret |= pwrdm_state_switch(clkdm->pwrdm.ptr); | ||
750 | spin_unlock_irqrestore(&clkdm->lock, flags); | 751 | spin_unlock_irqrestore(&clkdm->lock, flags); |
751 | return ret; | 752 | return ret; |
752 | } | 753 | } |
@@ -818,6 +819,7 @@ void clkdm_deny_idle(struct clockdomain *clkdm) | |||
818 | spin_lock_irqsave(&clkdm->lock, flags); | 819 | spin_lock_irqsave(&clkdm->lock, flags); |
819 | clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED; | 820 | clkdm->_flags &= ~_CLKDM_FLAG_HWSUP_ENABLED; |
820 | arch_clkdm->clkdm_deny_idle(clkdm); | 821 | arch_clkdm->clkdm_deny_idle(clkdm); |
822 | pwrdm_state_switch(clkdm->pwrdm.ptr); | ||
821 | spin_unlock_irqrestore(&clkdm->lock, flags); | 823 | spin_unlock_irqrestore(&clkdm->lock, flags); |
822 | } | 824 | } |
823 | 825 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c index 16743c7d6e8e..408193d8e044 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c | |||
@@ -192,6 +192,7 @@ static struct omap_hwmod_addr_space omap2430_usbhsotg_addrs[] = { | |||
192 | .pa_end = OMAP243X_HS_BASE + SZ_4K - 1, | 192 | .pa_end = OMAP243X_HS_BASE + SZ_4K - 1, |
193 | .flags = ADDR_TYPE_RT | 193 | .flags = ADDR_TYPE_RT |
194 | }, | 194 | }, |
195 | { } | ||
195 | }; | 196 | }; |
196 | 197 | ||
197 | /* l4_core ->usbhsotg interface */ | 198 | /* l4_core ->usbhsotg interface */ |
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 3feb35911a32..472bf22d5e84 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -130,7 +130,6 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) | |||
130 | } else { | 130 | } else { |
131 | hwsup = clkdm_in_hwsup(pwrdm->pwrdm_clkdms[0]); | 131 | hwsup = clkdm_in_hwsup(pwrdm->pwrdm_clkdms[0]); |
132 | clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); | 132 | clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); |
133 | pwrdm_wait_transition(pwrdm); | ||
134 | sleep_switch = FORCEWAKEUP_SWITCH; | 133 | sleep_switch = FORCEWAKEUP_SWITCH; |
135 | } | 134 | } |
136 | } | 135 | } |
@@ -156,7 +155,6 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) | |||
156 | return ret; | 155 | return ret; |
157 | } | 156 | } |
158 | 157 | ||
159 | pwrdm_wait_transition(pwrdm); | ||
160 | pwrdm_state_switch(pwrdm); | 158 | pwrdm_state_switch(pwrdm); |
161 | err: | 159 | err: |
162 | return ret; | 160 | return ret; |
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 9af08473bf10..ef71fdd40fc4 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -195,28 +195,35 @@ static int _pwrdm_post_transition_cb(struct powerdomain *pwrdm, void *unused) | |||
195 | 195 | ||
196 | /** | 196 | /** |
197 | * pwrdm_init - set up the powerdomain layer | 197 | * pwrdm_init - set up the powerdomain layer |
198 | * @pwrdm_list: array of struct powerdomain pointers to register | 198 | * @pwrdms: array of struct powerdomain pointers to register |
199 | * @custom_funcs: func pointers for arch specific implementations | 199 | * @custom_funcs: func pointers for arch specific implementations |
200 | * | 200 | * |
201 | * Loop through the array of powerdomains @pwrdm_list, registering all | 201 | * Loop through the array of powerdomains @pwrdms, registering all |
202 | * that are available on the current CPU. If pwrdm_list is supplied | 202 | * that are available on the current CPU. Also, program all |
203 | * and not null, all of the referenced powerdomains will be | 203 | * powerdomain target state as ON; this is to prevent domains from |
204 | * registered. No return value. XXX pwrdm_list is not really a | 204 | * hitting low power states (if bootloader has target states set to |
205 | * "list"; it is an array. Rename appropriately. | 205 | * something other than ON) and potentially even losing context while |
206 | * PM is not fully initialized. The PM late init code can then program | ||
207 | * the desired target state for all the power domains. No return | ||
208 | * value. | ||
206 | */ | 209 | */ |
207 | void pwrdm_init(struct powerdomain **pwrdm_list, struct pwrdm_ops *custom_funcs) | 210 | void pwrdm_init(struct powerdomain **pwrdms, struct pwrdm_ops *custom_funcs) |
208 | { | 211 | { |
209 | struct powerdomain **p = NULL; | 212 | struct powerdomain **p = NULL; |
213 | struct powerdomain *temp_p; | ||
210 | 214 | ||
211 | if (!custom_funcs) | 215 | if (!custom_funcs) |
212 | WARN(1, "powerdomain: No custom pwrdm functions registered\n"); | 216 | WARN(1, "powerdomain: No custom pwrdm functions registered\n"); |
213 | else | 217 | else |
214 | arch_pwrdm = custom_funcs; | 218 | arch_pwrdm = custom_funcs; |
215 | 219 | ||
216 | if (pwrdm_list) { | 220 | if (pwrdms) { |
217 | for (p = pwrdm_list; *p; p++) | 221 | for (p = pwrdms; *p; p++) |
218 | _pwrdm_register(*p); | 222 | _pwrdm_register(*p); |
219 | } | 223 | } |
224 | |||
225 | list_for_each_entry(temp_p, &pwrdm_list, node) | ||
226 | pwrdm_set_next_pwrst(temp_p, PWRDM_POWER_ON); | ||
220 | } | 227 | } |
221 | 228 | ||
222 | /** | 229 | /** |
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c index a6eddae82a0b..c105556a0ee1 100644 --- a/arch/arm/mach-orion5x/dns323-setup.c +++ b/arch/arm/mach-orion5x/dns323-setup.c | |||
@@ -77,7 +77,7 @@ static int __init dns323_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | |||
77 | /* | 77 | /* |
78 | * Check for devices with hard-wired IRQs. | 78 | * Check for devices with hard-wired IRQs. |
79 | */ | 79 | */ |
80 | irq = orion5x_pci_map_irq(const dev, slot, pin); | 80 | irq = orion5x_pci_map_irq(dev, slot, pin); |
81 | if (irq != -1) | 81 | if (irq != -1) |
82 | return irq; | 82 | return irq; |
83 | 83 | ||
diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c index 28b8760ab9fa..bc4a920e26ee 100644 --- a/arch/arm/mach-orion5x/pci.c +++ b/arch/arm/mach-orion5x/pci.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/pci.h> | 14 | #include <linux/pci.h> |
15 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
16 | #include <linux/mbus.h> | 16 | #include <linux/mbus.h> |
17 | #include <video/vga.h> | ||
17 | #include <asm/irq.h> | 18 | #include <asm/irq.h> |
18 | #include <asm/mach/pci.h> | 19 | #include <asm/mach/pci.h> |
19 | #include <plat/pcie.h> | 20 | #include <plat/pcie.h> |
diff --git a/arch/arm/mach-prima2/clock.c b/arch/arm/mach-prima2/clock.c index f9a2aaf63f71..615a4e75ceab 100644 --- a/arch/arm/mach-prima2/clock.c +++ b/arch/arm/mach-prima2/clock.c | |||
@@ -481,6 +481,7 @@ static void __init sirfsoc_clk_init(void) | |||
481 | 481 | ||
482 | static struct of_device_id clkc_ids[] = { | 482 | static struct of_device_id clkc_ids[] = { |
483 | { .compatible = "sirf,prima2-clkc" }, | 483 | { .compatible = "sirf,prima2-clkc" }, |
484 | {}, | ||
484 | }; | 485 | }; |
485 | 486 | ||
486 | void __init sirfsoc_of_clk_init(void) | 487 | void __init sirfsoc_of_clk_init(void) |
diff --git a/arch/arm/mach-prima2/irq.c b/arch/arm/mach-prima2/irq.c index c3404cbb6ff7..7af254d046ba 100644 --- a/arch/arm/mach-prima2/irq.c +++ b/arch/arm/mach-prima2/irq.c | |||
@@ -51,6 +51,7 @@ static __init void sirfsoc_irq_init(void) | |||
51 | 51 | ||
52 | static struct of_device_id intc_ids[] = { | 52 | static struct of_device_id intc_ids[] = { |
53 | { .compatible = "sirf,prima2-intc" }, | 53 | { .compatible = "sirf,prima2-intc" }, |
54 | {}, | ||
54 | }; | 55 | }; |
55 | 56 | ||
56 | void __init sirfsoc_of_irq_init(void) | 57 | void __init sirfsoc_of_irq_init(void) |
diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c index d074786e83d4..492cfa8d2610 100644 --- a/arch/arm/mach-prima2/rstc.c +++ b/arch/arm/mach-prima2/rstc.c | |||
@@ -19,6 +19,7 @@ static DEFINE_MUTEX(rstc_lock); | |||
19 | 19 | ||
20 | static struct of_device_id rstc_ids[] = { | 20 | static struct of_device_id rstc_ids[] = { |
21 | { .compatible = "sirf,prima2-rstc" }, | 21 | { .compatible = "sirf,prima2-rstc" }, |
22 | {}, | ||
22 | }; | 23 | }; |
23 | 24 | ||
24 | static int __init sirfsoc_of_rstc_init(void) | 25 | static int __init sirfsoc_of_rstc_init(void) |
diff --git a/arch/arm/mach-prima2/timer.c b/arch/arm/mach-prima2/timer.c index 44027f34a88a..ed7ec48d11da 100644 --- a/arch/arm/mach-prima2/timer.c +++ b/arch/arm/mach-prima2/timer.c | |||
@@ -190,6 +190,7 @@ static void __init sirfsoc_timer_init(void) | |||
190 | 190 | ||
191 | static struct of_device_id timer_ids[] = { | 191 | static struct of_device_id timer_ids[] = { |
192 | { .compatible = "sirf,prima2-tick" }, | 192 | { .compatible = "sirf,prima2-tick" }, |
193 | {}, | ||
193 | }; | 194 | }; |
194 | 195 | ||
195 | static void __init sirfsoc_of_timer_map(void) | 196 | static void __init sirfsoc_of_timer_map(void) |
diff --git a/arch/arm/mach-realview/include/mach/system.h b/arch/arm/mach-realview/include/mach/system.h index a30f2e3ec178..6657ff231161 100644 --- a/arch/arm/mach-realview/include/mach/system.h +++ b/arch/arm/mach-realview/include/mach/system.h | |||
@@ -44,6 +44,7 @@ static inline void arch_reset(char mode, const char *cmd) | |||
44 | */ | 44 | */ |
45 | if (realview_reset) | 45 | if (realview_reset) |
46 | realview_reset(mode); | 46 | realview_reset(mode); |
47 | dsb(); | ||
47 | } | 48 | } |
48 | 49 | ||
49 | #endif | 50 | #endif |
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c index ecbea92bf83b..a9f3183e0290 100644 --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c | |||
@@ -262,45 +262,6 @@ static struct samsung_keypad_platdata smdk6410_keypad_data __initdata = { | |||
262 | .cols = 8, | 262 | .cols = 8, |
263 | }; | 263 | }; |
264 | 264 | ||
265 | static int smdk6410_backlight_init(struct device *dev) | ||
266 | { | ||
267 | int ret; | ||
268 | |||
269 | ret = gpio_request(S3C64XX_GPF(15), "Backlight"); | ||
270 | if (ret) { | ||
271 | printk(KERN_ERR "failed to request GPF for PWM-OUT1\n"); | ||
272 | return ret; | ||
273 | } | ||
274 | |||
275 | /* Configure GPIO pin with S3C64XX_GPF15_PWM_TOUT1 */ | ||
276 | s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_SFN(2)); | ||
277 | |||
278 | return 0; | ||
279 | } | ||
280 | |||
281 | static void smdk6410_backlight_exit(struct device *dev) | ||
282 | { | ||
283 | s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_OUTPUT); | ||
284 | gpio_free(S3C64XX_GPF(15)); | ||
285 | } | ||
286 | |||
287 | static struct platform_pwm_backlight_data smdk6410_backlight_data = { | ||
288 | .pwm_id = 1, | ||
289 | .max_brightness = 255, | ||
290 | .dft_brightness = 255, | ||
291 | .pwm_period_ns = 78770, | ||
292 | .init = smdk6410_backlight_init, | ||
293 | .exit = smdk6410_backlight_exit, | ||
294 | }; | ||
295 | |||
296 | static struct platform_device smdk6410_backlight_device = { | ||
297 | .name = "pwm-backlight", | ||
298 | .dev = { | ||
299 | .parent = &s3c_device_timer[1].dev, | ||
300 | .platform_data = &smdk6410_backlight_data, | ||
301 | }, | ||
302 | }; | ||
303 | |||
304 | static struct map_desc smdk6410_iodesc[] = {}; | 265 | static struct map_desc smdk6410_iodesc[] = {}; |
305 | 266 | ||
306 | static struct platform_device *smdk6410_devices[] __initdata = { | 267 | static struct platform_device *smdk6410_devices[] __initdata = { |
diff --git a/arch/arm/mach-s3c64xx/pm.c b/arch/arm/mach-s3c64xx/pm.c index 8bad64370689..055e2858b0dd 100644 --- a/arch/arm/mach-s3c64xx/pm.c +++ b/arch/arm/mach-s3c64xx/pm.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/suspend.h> | 16 | #include <linux/suspend.h> |
17 | #include <linux/serial_core.h> | 17 | #include <linux/serial_core.h> |
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <linux/gpio.h> | ||
19 | 20 | ||
20 | #include <mach/map.h> | 21 | #include <mach/map.h> |
21 | #include <mach/irqs.h> | 22 | #include <mach/irqs.h> |
diff --git a/arch/arm/mach-s5p64x0/irq-eint.c b/arch/arm/mach-s5p64x0/irq-eint.c index 69ed4545112b..fe7380f5c3cd 100644 --- a/arch/arm/mach-s5p64x0/irq-eint.c +++ b/arch/arm/mach-s5p64x0/irq-eint.c | |||
@@ -129,7 +129,7 @@ static int s5p64x0_alloc_gc(void) | |||
129 | } | 129 | } |
130 | 130 | ||
131 | ct = gc->chip_types; | 131 | ct = gc->chip_types; |
132 | ct->chip.irq_ack = irq_gc_ack; | 132 | ct->chip.irq_ack = irq_gc_ack_set_bit; |
133 | ct->chip.irq_mask = irq_gc_mask_set_bit; | 133 | ct->chip.irq_mask = irq_gc_mask_set_bit; |
134 | ct->chip.irq_unmask = irq_gc_mask_clr_bit; | 134 | ct->chip.irq_unmask = irq_gc_mask_clr_bit; |
135 | ct->chip.irq_set_type = s5p64x0_irq_eint_set_type; | 135 | ct->chip.irq_set_type = s5p64x0_irq_eint_set_type; |
diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c index 309e388a8a83..f149d278377b 100644 --- a/arch/arm/mach-s5pv210/pm.c +++ b/arch/arm/mach-s5pv210/pm.c | |||
@@ -88,7 +88,7 @@ static struct sleep_save s5pv210_core_save[] = { | |||
88 | SAVE_ITEM(S3C2410_TCNTO(0)), | 88 | SAVE_ITEM(S3C2410_TCNTO(0)), |
89 | }; | 89 | }; |
90 | 90 | ||
91 | void s5pv210_cpu_suspend(unsigned long arg) | 91 | static int s5pv210_cpu_suspend(unsigned long arg) |
92 | { | 92 | { |
93 | unsigned long tmp; | 93 | unsigned long tmp; |
94 | 94 | ||
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c index ce5c2513c6ce..cdfdd624d21d 100644 --- a/arch/arm/mach-shmobile/board-ag5evm.c +++ b/arch/arm/mach-shmobile/board-ag5evm.c | |||
@@ -341,6 +341,7 @@ static struct platform_device mipidsi0_device = { | |||
341 | static struct sh_mobile_sdhi_info sdhi0_info = { | 341 | static struct sh_mobile_sdhi_info sdhi0_info = { |
342 | .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, | 342 | .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, |
343 | .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, | 343 | .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, |
344 | .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT, | ||
344 | .tmio_caps = MMC_CAP_SD_HIGHSPEED, | 345 | .tmio_caps = MMC_CAP_SD_HIGHSPEED, |
345 | .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, | 346 | .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29, |
346 | }; | 347 | }; |
@@ -382,7 +383,7 @@ void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state) | |||
382 | } | 383 | } |
383 | 384 | ||
384 | static struct sh_mobile_sdhi_info sh_sdhi1_info = { | 385 | static struct sh_mobile_sdhi_info sh_sdhi1_info = { |
385 | .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE, | 386 | .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT, |
386 | .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ, | 387 | .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ, |
387 | .tmio_ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 388 | .tmio_ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
388 | .set_pwr = ag5evm_sdhi1_set_pwr, | 389 | .set_pwr = ag5evm_sdhi1_set_pwr, |
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c index 9e0856b2f9e9..523f608eb8cf 100644 --- a/arch/arm/mach-shmobile/board-ap4evb.c +++ b/arch/arm/mach-shmobile/board-ap4evb.c | |||
@@ -1412,6 +1412,7 @@ static void __init ap4evb_init(void) | |||
1412 | fsi_init_pm_clock(); | 1412 | fsi_init_pm_clock(); |
1413 | sh7372_pm_init(); | 1413 | sh7372_pm_init(); |
1414 | pm_clk_add(&fsi_device.dev, "spu2"); | 1414 | pm_clk_add(&fsi_device.dev, "spu2"); |
1415 | pm_clk_add(&lcdc1_device.dev, "hdmi"); | ||
1415 | } | 1416 | } |
1416 | 1417 | ||
1417 | static void __init ap4evb_timer_init(void) | 1418 | static void __init ap4evb_timer_init(void) |
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index d41c01f83f15..17c19dc25604 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c | |||
@@ -641,6 +641,8 @@ static struct usbhs_private usbhs0_private = { | |||
641 | }, | 641 | }, |
642 | .driver_param = { | 642 | .driver_param = { |
643 | .buswait_bwait = 4, | 643 | .buswait_bwait = 4, |
644 | .d0_tx_id = SHDMA_SLAVE_USB0_TX, | ||
645 | .d1_rx_id = SHDMA_SLAVE_USB0_RX, | ||
644 | }, | 646 | }, |
645 | }, | 647 | }, |
646 | }; | 648 | }; |
@@ -810,6 +812,8 @@ static struct usbhs_private usbhs1_private = { | |||
810 | .buswait_bwait = 4, | 812 | .buswait_bwait = 4, |
811 | .pipe_type = usbhs1_pipe_cfg, | 813 | .pipe_type = usbhs1_pipe_cfg, |
812 | .pipe_size = ARRAY_SIZE(usbhs1_pipe_cfg), | 814 | .pipe_size = ARRAY_SIZE(usbhs1_pipe_cfg), |
815 | .d0_tx_id = SHDMA_SLAVE_USB1_TX, | ||
816 | .d1_rx_id = SHDMA_SLAVE_USB1_RX, | ||
813 | }, | 817 | }, |
814 | }, | 818 | }, |
815 | }; | 819 | }; |
@@ -1588,6 +1592,7 @@ static void __init mackerel_init(void) | |||
1588 | hdmi_init_pm_clock(); | 1592 | hdmi_init_pm_clock(); |
1589 | sh7372_pm_init(); | 1593 | sh7372_pm_init(); |
1590 | pm_clk_add(&fsi_device.dev, "spu2"); | 1594 | pm_clk_add(&fsi_device.dev, "spu2"); |
1595 | pm_clk_add(&hdmi_lcdc_device.dev, "hdmi"); | ||
1591 | } | 1596 | } |
1592 | 1597 | ||
1593 | static void __init mackerel_timer_init(void) | 1598 | static void __init mackerel_timer_init(void) |
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c index 6b1619a65dba..66975921e646 100644 --- a/arch/arm/mach-shmobile/clock-sh7372.c +++ b/arch/arm/mach-shmobile/clock-sh7372.c | |||
@@ -503,16 +503,17 @@ static struct clk *late_main_clks[] = { | |||
503 | &sh7372_fsidivb_clk, | 503 | &sh7372_fsidivb_clk, |
504 | }; | 504 | }; |
505 | 505 | ||
506 | enum { MSTP001, | 506 | enum { MSTP001, MSTP000, |
507 | MSTP131, MSTP130, | 507 | MSTP131, MSTP130, |
508 | MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, | 508 | MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, |
509 | MSTP118, MSTP117, MSTP116, MSTP113, | 509 | MSTP118, MSTP117, MSTP116, MSTP113, |
510 | MSTP106, MSTP101, MSTP100, | 510 | MSTP106, MSTP101, MSTP100, |
511 | MSTP223, | 511 | MSTP223, |
512 | MSTP218, MSTP217, MSTP216, | 512 | MSTP218, MSTP217, MSTP216, MSTP214, MSTP208, MSTP207, |
513 | MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, | 513 | MSTP206, MSTP205, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, |
514 | MSTP329, MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312, | 514 | MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312, |
515 | MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP406, MSTP403, | 515 | MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP407, MSTP406, |
516 | MSTP405, MSTP404, MSTP403, MSTP400, | ||
516 | MSTP_NR }; | 517 | MSTP_NR }; |
517 | 518 | ||
518 | #define MSTP(_parent, _reg, _bit, _flags) \ | 519 | #define MSTP(_parent, _reg, _bit, _flags) \ |
@@ -520,6 +521,7 @@ enum { MSTP001, | |||
520 | 521 | ||
521 | static struct clk mstp_clks[MSTP_NR] = { | 522 | static struct clk mstp_clks[MSTP_NR] = { |
522 | [MSTP001] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 1, 0), /* IIC2 */ | 523 | [MSTP001] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 1, 0), /* IIC2 */ |
524 | [MSTP000] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 0, 0), /* MSIOF0 */ | ||
523 | [MSTP131] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 31, 0), /* VEU3 */ | 525 | [MSTP131] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 31, 0), /* VEU3 */ |
524 | [MSTP130] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 30, 0), /* VEU2 */ | 526 | [MSTP130] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 30, 0), /* VEU2 */ |
525 | [MSTP129] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 29, 0), /* VEU1 */ | 527 | [MSTP129] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 29, 0), /* VEU1 */ |
@@ -538,14 +540,16 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
538 | [MSTP218] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* DMAC1 */ | 540 | [MSTP218] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* DMAC1 */ |
539 | [MSTP217] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* DMAC2 */ | 541 | [MSTP217] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* DMAC2 */ |
540 | [MSTP216] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 16, 0), /* DMAC3 */ | 542 | [MSTP216] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 16, 0), /* DMAC3 */ |
543 | [MSTP214] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 14, 0), /* USBDMAC */ | ||
544 | [MSTP208] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 8, 0), /* MSIOF1 */ | ||
541 | [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ | 545 | [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ |
542 | [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ | 546 | [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ |
547 | [MSTP205] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 5, 0), /* MSIOF2 */ | ||
543 | [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ | 548 | [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ |
544 | [MSTP203] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */ | 549 | [MSTP203] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */ |
545 | [MSTP202] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */ | 550 | [MSTP202] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */ |
546 | [MSTP201] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 1, 0), /* SCIFA3 */ | 551 | [MSTP201] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 1, 0), /* SCIFA3 */ |
547 | [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */ | 552 | [MSTP200] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 0, 0), /* SCIFA4 */ |
548 | [MSTP329] = MSTP(&r_clk, SMSTPCR3, 29, 0), /* CMT10 */ | ||
549 | [MSTP328] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR3, 28, 0), /* FSI2 */ | 553 | [MSTP328] = MSTP(&div6_clks[DIV6_SPU], SMSTPCR3, 28, 0), /* FSI2 */ |
550 | [MSTP323] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */ | 554 | [MSTP323] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 23, 0), /* IIC1 */ |
551 | [MSTP322] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 22, 0), /* USB0 */ | 555 | [MSTP322] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR3, 22, 0), /* USB0 */ |
@@ -557,8 +561,12 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
557 | [MSTP413] = MSTP(&pllc1_div2_clk, SMSTPCR4, 13, 0), /* HDMI */ | 561 | [MSTP413] = MSTP(&pllc1_div2_clk, SMSTPCR4, 13, 0), /* HDMI */ |
558 | [MSTP411] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 11, 0), /* IIC3 */ | 562 | [MSTP411] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 11, 0), /* IIC3 */ |
559 | [MSTP410] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 10, 0), /* IIC4 */ | 563 | [MSTP410] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 10, 0), /* IIC4 */ |
564 | [MSTP407] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 7, 0), /* USB-DMAC1 */ | ||
560 | [MSTP406] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 6, 0), /* USB1 */ | 565 | [MSTP406] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 6, 0), /* USB1 */ |
566 | [MSTP405] = MSTP(&r_clk, SMSTPCR4, 5, 0), /* CMT4 */ | ||
567 | [MSTP404] = MSTP(&r_clk, SMSTPCR4, 4, 0), /* CMT3 */ | ||
561 | [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */ | 568 | [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */ |
569 | [MSTP400] = MSTP(&r_clk, SMSTPCR4, 0, 0), /* CMT2 */ | ||
562 | }; | 570 | }; |
563 | 571 | ||
564 | static struct clk_lookup lookups[] = { | 572 | static struct clk_lookup lookups[] = { |
@@ -609,6 +617,7 @@ static struct clk_lookup lookups[] = { | |||
609 | 617 | ||
610 | /* MSTP32 clocks */ | 618 | /* MSTP32 clocks */ |
611 | CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */ | 619 | CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */ |
620 | CLKDEV_DEV_ID("spi_sh_msiof.0", &mstp_clks[MSTP000]), /* MSIOF0 */ | ||
612 | CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */ | 621 | CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */ |
613 | CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */ | 622 | CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */ |
614 | CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[MSTP129]), /* VEU1 */ | 623 | CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[MSTP129]), /* VEU1 */ |
@@ -629,14 +638,16 @@ static struct clk_lookup lookups[] = { | |||
629 | CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* DMAC1 */ | 638 | CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* DMAC1 */ |
630 | CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* DMAC2 */ | 639 | CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* DMAC2 */ |
631 | CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]), /* DMAC3 */ | 640 | CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]), /* DMAC3 */ |
641 | CLKDEV_DEV_ID("sh-dma-engine.3", &mstp_clks[MSTP214]), /* USB-DMAC0 */ | ||
642 | CLKDEV_DEV_ID("spi_sh_msiof.1", &mstp_clks[MSTP208]), /* MSIOF1 */ | ||
632 | CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ | 643 | CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ |
633 | CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP206]), /* SCIFB */ | 644 | CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP206]), /* SCIFB */ |
645 | CLKDEV_DEV_ID("spi_sh_msiof.2", &mstp_clks[MSTP205]), /* MSIOF2 */ | ||
634 | CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ | 646 | CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ |
635 | CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */ | 647 | CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */ |
636 | CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */ | 648 | CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */ |
637 | CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), /* SCIFA3 */ | 649 | CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), /* SCIFA3 */ |
638 | CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */ | 650 | CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */ |
639 | CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */ | ||
640 | CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI2 */ | 651 | CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI2 */ |
641 | CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* IIC1 */ | 652 | CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), /* IIC1 */ |
642 | CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP322]), /* USB0 */ | 653 | CLKDEV_DEV_ID("r8a66597_hcd.0", &mstp_clks[MSTP322]), /* USB0 */ |
@@ -650,11 +661,17 @@ static struct clk_lookup lookups[] = { | |||
650 | CLKDEV_DEV_ID("sh-mobile-hdmi", &mstp_clks[MSTP413]), /* HDMI */ | 661 | CLKDEV_DEV_ID("sh-mobile-hdmi", &mstp_clks[MSTP413]), /* HDMI */ |
651 | CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* IIC3 */ | 662 | CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* IIC3 */ |
652 | CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* IIC4 */ | 663 | CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* IIC4 */ |
664 | CLKDEV_DEV_ID("sh-dma-engine.4", &mstp_clks[MSTP407]), /* USB-DMAC1 */ | ||
653 | CLKDEV_DEV_ID("r8a66597_hcd.1", &mstp_clks[MSTP406]), /* USB1 */ | 665 | CLKDEV_DEV_ID("r8a66597_hcd.1", &mstp_clks[MSTP406]), /* USB1 */ |
654 | CLKDEV_DEV_ID("r8a66597_udc.1", &mstp_clks[MSTP406]), /* USB1 */ | 666 | CLKDEV_DEV_ID("r8a66597_udc.1", &mstp_clks[MSTP406]), /* USB1 */ |
655 | CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */ | 667 | CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */ |
668 | CLKDEV_DEV_ID("sh_cmt.4", &mstp_clks[MSTP405]), /* CMT4 */ | ||
669 | CLKDEV_DEV_ID("sh_cmt.3", &mstp_clks[MSTP404]), /* CMT3 */ | ||
656 | CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */ | 670 | CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */ |
671 | CLKDEV_DEV_ID("sh_cmt.2", &mstp_clks[MSTP400]), /* CMT2 */ | ||
657 | 672 | ||
673 | CLKDEV_ICK_ID("hdmi", "sh_mobile_lcdc_fb.1", | ||
674 | &div6_reparent_clks[DIV6_HDMI]), | ||
658 | CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]), | 675 | CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]), |
659 | CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]), | 676 | CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]), |
660 | CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]), | 677 | CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]), |
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index 6db2ccabc2bf..61a846bb30f2 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c | |||
@@ -365,7 +365,7 @@ void __init sh73a0_clock_init(void) | |||
365 | __raw_writel(0x108, SD2CKCR); | 365 | __raw_writel(0x108, SD2CKCR); |
366 | 366 | ||
367 | /* detect main clock parent */ | 367 | /* detect main clock parent */ |
368 | switch ((__raw_readl(CKSCR) >> 24) & 0x03) { | 368 | switch ((__raw_readl(CKSCR) >> 28) & 0x03) { |
369 | case 0: | 369 | case 0: |
370 | main_clk.parent = &sh73a0_extal1_clk; | 370 | main_clk.parent = &sh73a0_extal1_clk; |
371 | break; | 371 | break; |
diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h index ce595cee86cd..24e63a85e669 100644 --- a/arch/arm/mach-shmobile/include/mach/sh7372.h +++ b/arch/arm/mach-shmobile/include/mach/sh7372.h | |||
@@ -459,6 +459,10 @@ enum { | |||
459 | SHDMA_SLAVE_SDHI2_TX, | 459 | SHDMA_SLAVE_SDHI2_TX, |
460 | SHDMA_SLAVE_MMCIF_RX, | 460 | SHDMA_SLAVE_MMCIF_RX, |
461 | SHDMA_SLAVE_MMCIF_TX, | 461 | SHDMA_SLAVE_MMCIF_TX, |
462 | SHDMA_SLAVE_USB0_TX, | ||
463 | SHDMA_SLAVE_USB0_RX, | ||
464 | SHDMA_SLAVE_USB1_TX, | ||
465 | SHDMA_SLAVE_USB1_RX, | ||
462 | }; | 466 | }; |
463 | 467 | ||
464 | extern struct clk sh7372_extal1_clk; | 468 | extern struct clk sh7372_extal1_clk; |
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c index 3b28743c77eb..739315e30eb9 100644 --- a/arch/arm/mach-shmobile/intc-sh7372.c +++ b/arch/arm/mach-shmobile/intc-sh7372.c | |||
@@ -379,7 +379,7 @@ enum { | |||
379 | /* BBIF2 */ | 379 | /* BBIF2 */ |
380 | VPU, | 380 | VPU, |
381 | TSIF1, | 381 | TSIF1, |
382 | _3DG_SGX530, | 382 | /* 3DG */ |
383 | _2DDMAC, | 383 | _2DDMAC, |
384 | IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2, | 384 | IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2, |
385 | IPMMU_IPMMUR, IPMMU_IPMMUR2, | 385 | IPMMU_IPMMUR, IPMMU_IPMMUR2, |
@@ -436,7 +436,7 @@ static struct intc_vect intcs_vectors[] = { | |||
436 | /* BBIF2 */ | 436 | /* BBIF2 */ |
437 | INTCS_VECT(VPU, 0x980), | 437 | INTCS_VECT(VPU, 0x980), |
438 | INTCS_VECT(TSIF1, 0x9a0), | 438 | INTCS_VECT(TSIF1, 0x9a0), |
439 | INTCS_VECT(_3DG_SGX530, 0x9e0), | 439 | /* 3DG */ |
440 | INTCS_VECT(_2DDMAC, 0xa00), | 440 | INTCS_VECT(_2DDMAC, 0xa00), |
441 | INTCS_VECT(IIC2_ALI2, 0xa80), INTCS_VECT(IIC2_TACKI2, 0xaa0), | 441 | INTCS_VECT(IIC2_ALI2, 0xa80), INTCS_VECT(IIC2_TACKI2, 0xaa0), |
442 | INTCS_VECT(IIC2_WAITI2, 0xac0), INTCS_VECT(IIC2_DTEI2, 0xae0), | 442 | INTCS_VECT(IIC2_WAITI2, 0xac0), INTCS_VECT(IIC2_DTEI2, 0xae0), |
@@ -521,7 +521,7 @@ static struct intc_mask_reg intcs_mask_registers[] = { | |||
521 | RTDMAC_1_DEI3, RTDMAC_1_DEI2, RTDMAC_1_DEI1, RTDMAC_1_DEI0 } }, | 521 | RTDMAC_1_DEI3, RTDMAC_1_DEI2, RTDMAC_1_DEI1, RTDMAC_1_DEI0 } }, |
522 | { 0xffd20198, 0xffd201d8, 8, /* IMR6SA / IMCR6SA */ | 522 | { 0xffd20198, 0xffd201d8, 8, /* IMR6SA / IMCR6SA */ |
523 | { 0, 0, MSIOF, 0, | 523 | { 0, 0, MSIOF, 0, |
524 | _3DG_SGX530, 0, 0, 0 } }, | 524 | 0, 0, 0, 0 } }, |
525 | { 0xffd2019c, 0xffd201dc, 8, /* IMR7SA / IMCR7SA */ | 525 | { 0xffd2019c, 0xffd201dc, 8, /* IMR7SA / IMCR7SA */ |
526 | { 0, TMU_TUNI2, TMU_TUNI1, TMU_TUNI0, | 526 | { 0, TMU_TUNI2, TMU_TUNI1, TMU_TUNI0, |
527 | 0, 0, 0, 0 } }, | 527 | 0, 0, 0, 0 } }, |
@@ -561,7 +561,6 @@ static struct intc_prio_reg intcs_prio_registers[] = { | |||
561 | TMU_TUNI2, TSIF1 } }, | 561 | TMU_TUNI2, TSIF1 } }, |
562 | { 0xffd2001c, 0, 16, 4, /* IPRHS */ { 0, 0, VEU, BEU } }, | 562 | { 0xffd2001c, 0, 16, 4, /* IPRHS */ { 0, 0, VEU, BEU } }, |
563 | { 0xffd20020, 0, 16, 4, /* IPRIS */ { 0, MSIOF, TSIF0, IIC0 } }, | 563 | { 0xffd20020, 0, 16, 4, /* IPRIS */ { 0, MSIOF, TSIF0, IIC0 } }, |
564 | { 0xffd20024, 0, 16, 4, /* IPRJS */ { 0, _3DG_SGX530, 0, 0 } }, | ||
565 | { 0xffd20028, 0, 16, 4, /* IPRKS */ { 0, 0, LMB, 0 } }, | 564 | { 0xffd20028, 0, 16, 4, /* IPRKS */ { 0, 0, LMB, 0 } }, |
566 | { 0xffd2002c, 0, 16, 4, /* IPRLS */ { IPMMU, 0, 0, 0 } }, | 565 | { 0xffd2002c, 0, 16, 4, /* IPRLS */ { IPMMU, 0, 0, 0 } }, |
567 | { 0xffd20030, 0, 16, 4, /* IPRMS */ { IIC2, 0, 0, 0 } }, | 566 | { 0xffd20030, 0, 16, 4, /* IPRMS */ { IIC2, 0, 0, 0 } }, |
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c index 79f0413d8725..2d9b1b1a2538 100644 --- a/arch/arm/mach-shmobile/setup-sh7372.c +++ b/arch/arm/mach-shmobile/setup-sh7372.c | |||
@@ -169,35 +169,35 @@ static struct platform_device scif6_device = { | |||
169 | }; | 169 | }; |
170 | 170 | ||
171 | /* CMT */ | 171 | /* CMT */ |
172 | static struct sh_timer_config cmt10_platform_data = { | 172 | static struct sh_timer_config cmt2_platform_data = { |
173 | .name = "CMT10", | 173 | .name = "CMT2", |
174 | .channel_offset = 0x10, | 174 | .channel_offset = 0x40, |
175 | .timer_bit = 0, | 175 | .timer_bit = 5, |
176 | .clockevent_rating = 125, | 176 | .clockevent_rating = 125, |
177 | .clocksource_rating = 125, | 177 | .clocksource_rating = 125, |
178 | }; | 178 | }; |
179 | 179 | ||
180 | static struct resource cmt10_resources[] = { | 180 | static struct resource cmt2_resources[] = { |
181 | [0] = { | 181 | [0] = { |
182 | .name = "CMT10", | 182 | .name = "CMT2", |
183 | .start = 0xe6138010, | 183 | .start = 0xe6130040, |
184 | .end = 0xe613801b, | 184 | .end = 0xe613004b, |
185 | .flags = IORESOURCE_MEM, | 185 | .flags = IORESOURCE_MEM, |
186 | }, | 186 | }, |
187 | [1] = { | 187 | [1] = { |
188 | .start = evt2irq(0x0b00), /* CMT1_CMT10 */ | 188 | .start = evt2irq(0x0b80), /* CMT2 */ |
189 | .flags = IORESOURCE_IRQ, | 189 | .flags = IORESOURCE_IRQ, |
190 | }, | 190 | }, |
191 | }; | 191 | }; |
192 | 192 | ||
193 | static struct platform_device cmt10_device = { | 193 | static struct platform_device cmt2_device = { |
194 | .name = "sh_cmt", | 194 | .name = "sh_cmt", |
195 | .id = 10, | 195 | .id = 2, |
196 | .dev = { | 196 | .dev = { |
197 | .platform_data = &cmt10_platform_data, | 197 | .platform_data = &cmt2_platform_data, |
198 | }, | 198 | }, |
199 | .resource = cmt10_resources, | 199 | .resource = cmt2_resources, |
200 | .num_resources = ARRAY_SIZE(cmt10_resources), | 200 | .num_resources = ARRAY_SIZE(cmt2_resources), |
201 | }; | 201 | }; |
202 | 202 | ||
203 | /* TMU */ | 203 | /* TMU */ |
@@ -602,6 +602,150 @@ static struct platform_device dma2_device = { | |||
602 | }, | 602 | }, |
603 | }; | 603 | }; |
604 | 604 | ||
605 | /* | ||
606 | * USB-DMAC | ||
607 | */ | ||
608 | |||
609 | unsigned int usbts_shift[] = {3, 4, 5}; | ||
610 | |||
611 | enum { | ||
612 | XMIT_SZ_8BYTE = 0, | ||
613 | XMIT_SZ_16BYTE = 1, | ||
614 | XMIT_SZ_32BYTE = 2, | ||
615 | }; | ||
616 | |||
617 | #define USBTS_INDEX2VAL(i) (((i) & 3) << 6) | ||
618 | |||
619 | static const struct sh_dmae_channel sh7372_usb_dmae_channels[] = { | ||
620 | { | ||
621 | .offset = 0, | ||
622 | }, { | ||
623 | .offset = 0x20, | ||
624 | }, | ||
625 | }; | ||
626 | |||
627 | /* USB DMAC0 */ | ||
628 | static const struct sh_dmae_slave_config sh7372_usb_dmae0_slaves[] = { | ||
629 | { | ||
630 | .slave_id = SHDMA_SLAVE_USB0_TX, | ||
631 | .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE), | ||
632 | }, { | ||
633 | .slave_id = SHDMA_SLAVE_USB0_RX, | ||
634 | .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE), | ||
635 | }, | ||
636 | }; | ||
637 | |||
638 | static struct sh_dmae_pdata usb_dma0_platform_data = { | ||
639 | .slave = sh7372_usb_dmae0_slaves, | ||
640 | .slave_num = ARRAY_SIZE(sh7372_usb_dmae0_slaves), | ||
641 | .channel = sh7372_usb_dmae_channels, | ||
642 | .channel_num = ARRAY_SIZE(sh7372_usb_dmae_channels), | ||
643 | .ts_low_shift = 6, | ||
644 | .ts_low_mask = 0xc0, | ||
645 | .ts_high_shift = 0, | ||
646 | .ts_high_mask = 0, | ||
647 | .ts_shift = usbts_shift, | ||
648 | .ts_shift_num = ARRAY_SIZE(usbts_shift), | ||
649 | .dmaor_init = DMAOR_DME, | ||
650 | .chcr_offset = 0x14, | ||
651 | .chcr_ie_bit = 1 << 5, | ||
652 | .dmaor_is_32bit = 1, | ||
653 | .needs_tend_set = 1, | ||
654 | .no_dmars = 1, | ||
655 | }; | ||
656 | |||
657 | static struct resource sh7372_usb_dmae0_resources[] = { | ||
658 | { | ||
659 | /* Channel registers and DMAOR */ | ||
660 | .start = 0xe68a0020, | ||
661 | .end = 0xe68a0064 - 1, | ||
662 | .flags = IORESOURCE_MEM, | ||
663 | }, | ||
664 | { | ||
665 | /* VCR/SWR/DMICR */ | ||
666 | .start = 0xe68a0000, | ||
667 | .end = 0xe68a0014 - 1, | ||
668 | .flags = IORESOURCE_MEM, | ||
669 | }, | ||
670 | { | ||
671 | /* IRQ for channels */ | ||
672 | .start = evt2irq(0x0a00), | ||
673 | .end = evt2irq(0x0a00), | ||
674 | .flags = IORESOURCE_IRQ, | ||
675 | }, | ||
676 | }; | ||
677 | |||
678 | static struct platform_device usb_dma0_device = { | ||
679 | .name = "sh-dma-engine", | ||
680 | .id = 3, | ||
681 | .resource = sh7372_usb_dmae0_resources, | ||
682 | .num_resources = ARRAY_SIZE(sh7372_usb_dmae0_resources), | ||
683 | .dev = { | ||
684 | .platform_data = &usb_dma0_platform_data, | ||
685 | }, | ||
686 | }; | ||
687 | |||
688 | /* USB DMAC1 */ | ||
689 | static const struct sh_dmae_slave_config sh7372_usb_dmae1_slaves[] = { | ||
690 | { | ||
691 | .slave_id = SHDMA_SLAVE_USB1_TX, | ||
692 | .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE), | ||
693 | }, { | ||
694 | .slave_id = SHDMA_SLAVE_USB1_RX, | ||
695 | .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE), | ||
696 | }, | ||
697 | }; | ||
698 | |||
699 | static struct sh_dmae_pdata usb_dma1_platform_data = { | ||
700 | .slave = sh7372_usb_dmae1_slaves, | ||
701 | .slave_num = ARRAY_SIZE(sh7372_usb_dmae1_slaves), | ||
702 | .channel = sh7372_usb_dmae_channels, | ||
703 | .channel_num = ARRAY_SIZE(sh7372_usb_dmae_channels), | ||
704 | .ts_low_shift = 6, | ||
705 | .ts_low_mask = 0xc0, | ||
706 | .ts_high_shift = 0, | ||
707 | .ts_high_mask = 0, | ||
708 | .ts_shift = usbts_shift, | ||
709 | .ts_shift_num = ARRAY_SIZE(usbts_shift), | ||
710 | .dmaor_init = DMAOR_DME, | ||
711 | .chcr_offset = 0x14, | ||
712 | .chcr_ie_bit = 1 << 5, | ||
713 | .dmaor_is_32bit = 1, | ||
714 | .needs_tend_set = 1, | ||
715 | .no_dmars = 1, | ||
716 | }; | ||
717 | |||
718 | static struct resource sh7372_usb_dmae1_resources[] = { | ||
719 | { | ||
720 | /* Channel registers and DMAOR */ | ||
721 | .start = 0xe68c0020, | ||
722 | .end = 0xe68c0064 - 1, | ||
723 | .flags = IORESOURCE_MEM, | ||
724 | }, | ||
725 | { | ||
726 | /* VCR/SWR/DMICR */ | ||
727 | .start = 0xe68c0000, | ||
728 | .end = 0xe68c0014 - 1, | ||
729 | .flags = IORESOURCE_MEM, | ||
730 | }, | ||
731 | { | ||
732 | /* IRQ for channels */ | ||
733 | .start = evt2irq(0x1d00), | ||
734 | .end = evt2irq(0x1d00), | ||
735 | .flags = IORESOURCE_IRQ, | ||
736 | }, | ||
737 | }; | ||
738 | |||
739 | static struct platform_device usb_dma1_device = { | ||
740 | .name = "sh-dma-engine", | ||
741 | .id = 4, | ||
742 | .resource = sh7372_usb_dmae1_resources, | ||
743 | .num_resources = ARRAY_SIZE(sh7372_usb_dmae1_resources), | ||
744 | .dev = { | ||
745 | .platform_data = &usb_dma1_platform_data, | ||
746 | }, | ||
747 | }; | ||
748 | |||
605 | /* VPU */ | 749 | /* VPU */ |
606 | static struct uio_info vpu_platform_data = { | 750 | static struct uio_info vpu_platform_data = { |
607 | .name = "VPU5HG", | 751 | .name = "VPU5HG", |
@@ -818,7 +962,7 @@ static struct platform_device *sh7372_early_devices[] __initdata = { | |||
818 | &scif4_device, | 962 | &scif4_device, |
819 | &scif5_device, | 963 | &scif5_device, |
820 | &scif6_device, | 964 | &scif6_device, |
821 | &cmt10_device, | 965 | &cmt2_device, |
822 | &tmu00_device, | 966 | &tmu00_device, |
823 | &tmu01_device, | 967 | &tmu01_device, |
824 | }; | 968 | }; |
@@ -829,6 +973,8 @@ static struct platform_device *sh7372_late_devices[] __initdata = { | |||
829 | &dma0_device, | 973 | &dma0_device, |
830 | &dma1_device, | 974 | &dma1_device, |
831 | &dma2_device, | 975 | &dma2_device, |
976 | &usb_dma0_device, | ||
977 | &usb_dma1_device, | ||
832 | &vpu_device, | 978 | &vpu_device, |
833 | &veu0_device, | 979 | &veu0_device, |
834 | &veu1_device, | 980 | &veu1_device, |
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c index 9e6b93b1a043..d0d267a8d3f9 100644 --- a/arch/arm/mach-vexpress/v2m.c +++ b/arch/arm/mach-vexpress/v2m.c | |||
@@ -318,6 +318,10 @@ static struct clk v2m_sp804_clk = { | |||
318 | .rate = 1000000, | 318 | .rate = 1000000, |
319 | }; | 319 | }; |
320 | 320 | ||
321 | static struct clk v2m_ref_clk = { | ||
322 | .rate = 32768, | ||
323 | }; | ||
324 | |||
321 | static struct clk dummy_apb_pclk; | 325 | static struct clk dummy_apb_pclk; |
322 | 326 | ||
323 | static struct clk_lookup v2m_lookups[] = { | 327 | static struct clk_lookup v2m_lookups[] = { |
@@ -348,6 +352,9 @@ static struct clk_lookup v2m_lookups[] = { | |||
348 | }, { /* CLCD */ | 352 | }, { /* CLCD */ |
349 | .dev_id = "mb:clcd", | 353 | .dev_id = "mb:clcd", |
350 | .clk = &osc1_clk, | 354 | .clk = &osc1_clk, |
355 | }, { /* SP805 WDT */ | ||
356 | .dev_id = "mb:wdt", | ||
357 | .clk = &v2m_ref_clk, | ||
351 | }, { /* SP804 timers */ | 358 | }, { /* SP804 timers */ |
352 | .dev_id = "sp804", | 359 | .dev_id = "sp804", |
353 | .con_id = "v2m-timer0", | 360 | .con_id = "v2m-timer0", |
diff --git a/arch/arm/mm/abort-macro.S b/arch/arm/mm/abort-macro.S index 52162d59407a..2cbf68ef0e83 100644 --- a/arch/arm/mm/abort-macro.S +++ b/arch/arm/mm/abort-macro.S | |||
@@ -17,7 +17,7 @@ | |||
17 | cmp \tmp, # 0x5600 @ Is it ldrsb? | 17 | cmp \tmp, # 0x5600 @ Is it ldrsb? |
18 | orreq \tmp, \tmp, #1 << 11 @ Set L-bit if yes | 18 | orreq \tmp, \tmp, #1 << 11 @ Set L-bit if yes |
19 | tst \tmp, #1 << 11 @ L = 0 -> write | 19 | tst \tmp, #1 << 11 @ L = 0 -> write |
20 | orreq \psr, \psr, #1 << 11 @ yes. | 20 | orreq \fsr, \fsr, #1 << 11 @ yes. |
21 | b do_DataAbort | 21 | b do_DataAbort |
22 | not_thumb: | 22 | not_thumb: |
23 | .endm | 23 | .endm |
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 44c086710d2b..9ecfdb511951 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
@@ -277,6 +277,25 @@ static void l2x0_disable(void) | |||
277 | spin_unlock_irqrestore(&l2x0_lock, flags); | 277 | spin_unlock_irqrestore(&l2x0_lock, flags); |
278 | } | 278 | } |
279 | 279 | ||
280 | static void __init l2x0_unlock(__u32 cache_id) | ||
281 | { | ||
282 | int lockregs; | ||
283 | int i; | ||
284 | |||
285 | if (cache_id == L2X0_CACHE_ID_PART_L310) | ||
286 | lockregs = 8; | ||
287 | else | ||
288 | /* L210 and unknown types */ | ||
289 | lockregs = 1; | ||
290 | |||
291 | for (i = 0; i < lockregs; i++) { | ||
292 | writel_relaxed(0x0, l2x0_base + L2X0_LOCKDOWN_WAY_D_BASE + | ||
293 | i * L2X0_LOCKDOWN_STRIDE); | ||
294 | writel_relaxed(0x0, l2x0_base + L2X0_LOCKDOWN_WAY_I_BASE + | ||
295 | i * L2X0_LOCKDOWN_STRIDE); | ||
296 | } | ||
297 | } | ||
298 | |||
280 | void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) | 299 | void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) |
281 | { | 300 | { |
282 | __u32 aux; | 301 | __u32 aux; |
@@ -328,6 +347,8 @@ void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask) | |||
328 | * accessing the below registers will fault. | 347 | * accessing the below registers will fault. |
329 | */ | 348 | */ |
330 | if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) { | 349 | if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) { |
350 | /* Make sure that I&D is not locked down when starting */ | ||
351 | l2x0_unlock(cache_id); | ||
331 | 352 | ||
332 | /* l2x0 controller is disabled */ | 353 | /* l2x0 controller is disabled */ |
333 | writel_relaxed(aux, l2x0_base + L2X0_AUX_CTRL); | 354 | writel_relaxed(aux, l2x0_base + L2X0_AUX_CTRL); |
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 91bca355cd31..cc7e2d8be9aa 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -298,7 +298,7 @@ static void __init arm_bootmem_free(unsigned long min, unsigned long max_low, | |||
298 | #ifdef CONFIG_HAVE_ARCH_PFN_VALID | 298 | #ifdef CONFIG_HAVE_ARCH_PFN_VALID |
299 | int pfn_valid(unsigned long pfn) | 299 | int pfn_valid(unsigned long pfn) |
300 | { | 300 | { |
301 | return memblock_is_memory(pfn << PAGE_SHIFT); | 301 | return memblock_is_memory(__pfn_to_phys(pfn)); |
302 | } | 302 | } |
303 | EXPORT_SYMBOL(pfn_valid); | 303 | EXPORT_SYMBOL(pfn_valid); |
304 | #endif | 304 | #endif |
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S index 92bd102e3982..2e6849b41f66 100644 --- a/arch/arm/mm/proc-arm920.S +++ b/arch/arm/mm/proc-arm920.S | |||
@@ -379,7 +379,7 @@ ENTRY(cpu_arm920_set_pte_ext) | |||
379 | 379 | ||
380 | /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ | 380 | /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ |
381 | .globl cpu_arm920_suspend_size | 381 | .globl cpu_arm920_suspend_size |
382 | .equ cpu_arm920_suspend_size, 4 * 3 | 382 | .equ cpu_arm920_suspend_size, 4 * 4 |
383 | #ifdef CONFIG_PM_SLEEP | 383 | #ifdef CONFIG_PM_SLEEP |
384 | ENTRY(cpu_arm920_do_suspend) | 384 | ENTRY(cpu_arm920_do_suspend) |
385 | stmfd sp!, {r4 - r7, lr} | 385 | stmfd sp!, {r4 - r7, lr} |
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S index 2bbcf053dffd..cd8f79c3a282 100644 --- a/arch/arm/mm/proc-arm926.S +++ b/arch/arm/mm/proc-arm926.S | |||
@@ -394,7 +394,7 @@ ENTRY(cpu_arm926_set_pte_ext) | |||
394 | 394 | ||
395 | /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ | 395 | /* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ |
396 | .globl cpu_arm926_suspend_size | 396 | .globl cpu_arm926_suspend_size |
397 | .equ cpu_arm926_suspend_size, 4 * 3 | 397 | .equ cpu_arm926_suspend_size, 4 * 4 |
398 | #ifdef CONFIG_PM_SLEEP | 398 | #ifdef CONFIG_PM_SLEEP |
399 | ENTRY(cpu_arm926_do_suspend) | 399 | ENTRY(cpu_arm926_do_suspend) |
400 | stmfd sp!, {r4 - r7, lr} | 400 | stmfd sp!, {r4 - r7, lr} |
diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S index 07219c2ae114..69e7f2ef7384 100644 --- a/arch/arm/mm/proc-sa1100.S +++ b/arch/arm/mm/proc-sa1100.S | |||
@@ -182,11 +182,11 @@ ENDPROC(cpu_sa1100_do_suspend) | |||
182 | 182 | ||
183 | ENTRY(cpu_sa1100_do_resume) | 183 | ENTRY(cpu_sa1100_do_resume) |
184 | ldmia r0, {r4 - r7} @ load cp regs | 184 | ldmia r0, {r4 - r7} @ load cp regs |
185 | mov r1, #0 | 185 | mov ip, #0 |
186 | mcr p15, 0, r1, c8, c7, 0 @ flush I+D TLBs | 186 | mcr p15, 0, ip, c8, c7, 0 @ flush I+D TLBs |
187 | mcr p15, 0, r1, c7, c7, 0 @ flush I&D cache | 187 | mcr p15, 0, ip, c7, c7, 0 @ flush I&D cache |
188 | mcr p15, 0, r1, c9, c0, 0 @ invalidate RB | 188 | mcr p15, 0, ip, c9, c0, 0 @ invalidate RB |
189 | mcr p15, 0, r1, c9, c0, 5 @ allow user space to use RB | 189 | mcr p15, 0, ip, c9, c0, 5 @ allow user space to use RB |
190 | 190 | ||
191 | mcr p15, 0, r4, c3, c0, 0 @ domain ID | 191 | mcr p15, 0, r4, c3, c0, 0 @ domain ID |
192 | mcr p15, 0, r5, c2, c0, 0 @ translation table base addr | 192 | mcr p15, 0, r5, c2, c0, 0 @ translation table base addr |
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S index 219138d2f158..a923aa0fd00d 100644 --- a/arch/arm/mm/proc-v6.S +++ b/arch/arm/mm/proc-v6.S | |||
@@ -223,6 +223,22 @@ __v6_setup: | |||
223 | mrc p15, 0, r0, c1, c0, 0 @ read control register | 223 | mrc p15, 0, r0, c1, c0, 0 @ read control register |
224 | bic r0, r0, r5 @ clear bits them | 224 | bic r0, r0, r5 @ clear bits them |
225 | orr r0, r0, r6 @ set them | 225 | orr r0, r0, r6 @ set them |
226 | #ifdef CONFIG_ARM_ERRATA_364296 | ||
227 | /* | ||
228 | * Workaround for the 364296 ARM1136 r0p2 erratum (possible cache data | ||
229 | * corruption with hit-under-miss enabled). The conditional code below | ||
230 | * (setting the undocumented bit 31 in the auxiliary control register | ||
231 | * and the FI bit in the control register) disables hit-under-miss | ||
232 | * without putting the processor into full low interrupt latency mode. | ||
233 | */ | ||
234 | ldr r6, =0x4107b362 @ id for ARM1136 r0p2 | ||
235 | mrc p15, 0, r5, c0, c0, 0 @ get processor id | ||
236 | teq r5, r6 @ check for the faulty core | ||
237 | mrceq p15, 0, r5, c1, c0, 1 @ load aux control reg | ||
238 | orreq r5, r5, #(1 << 31) @ set the undocumented bit 31 | ||
239 | mcreq p15, 0, r5, c1, c0, 1 @ write aux control reg | ||
240 | orreq r0, r0, #(1 << 21) @ low interrupt latency configuration | ||
241 | #endif | ||
226 | mov pc, lr @ return to head.S:__ret | 242 | mov pc, lr @ return to head.S:__ret |
227 | 243 | ||
228 | /* | 244 | /* |
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index a30e78542ccf..9049c0764db2 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -66,6 +66,7 @@ ENDPROC(cpu_v7_proc_fin) | |||
66 | ENTRY(cpu_v7_reset) | 66 | ENTRY(cpu_v7_reset) |
67 | mrc p15, 0, r1, c1, c0, 0 @ ctrl register | 67 | mrc p15, 0, r1, c1, c0, 0 @ ctrl register |
68 | bic r1, r1, #0x1 @ ...............m | 68 | bic r1, r1, #0x1 @ ...............m |
69 | THUMB( bic r1, r1, #1 << 30 ) @ SCTLR.TE (Thumb exceptions) | ||
69 | mcr p15, 0, r1, c1, c0, 0 @ disable MMU | 70 | mcr p15, 0, r1, c1, c0, 0 @ disable MMU |
70 | isb | 71 | isb |
71 | mov pc, r0 | 72 | mov pc, r0 |
@@ -247,13 +248,16 @@ ENTRY(cpu_v7_do_resume) | |||
247 | mcr p15, 0, r7, c2, c0, 0 @ TTB 0 | 248 | mcr p15, 0, r7, c2, c0, 0 @ TTB 0 |
248 | mcr p15, 0, r8, c2, c0, 1 @ TTB 1 | 249 | mcr p15, 0, r8, c2, c0, 1 @ TTB 1 |
249 | mcr p15, 0, ip, c2, c0, 2 @ TTB control register | 250 | mcr p15, 0, ip, c2, c0, 2 @ TTB control register |
250 | mcr p15, 0, r10, c1, c0, 1 @ Auxiliary control register | 251 | mrc p15, 0, r4, c1, c0, 1 @ Read Auxiliary control register |
252 | teq r4, r10 @ Is it already set? | ||
253 | mcrne p15, 0, r10, c1, c0, 1 @ No, so write it | ||
251 | mcr p15, 0, r11, c1, c0, 2 @ Co-processor access control | 254 | mcr p15, 0, r11, c1, c0, 2 @ Co-processor access control |
252 | ldr r4, =PRRR @ PRRR | 255 | ldr r4, =PRRR @ PRRR |
253 | ldr r5, =NMRR @ NMRR | 256 | ldr r5, =NMRR @ NMRR |
254 | mcr p15, 0, r4, c10, c2, 0 @ write PRRR | 257 | mcr p15, 0, r4, c10, c2, 0 @ write PRRR |
255 | mcr p15, 0, r5, c10, c2, 1 @ write NMRR | 258 | mcr p15, 0, r5, c10, c2, 1 @ write NMRR |
256 | isb | 259 | isb |
260 | dsb | ||
257 | mov r0, r9 @ control register | 261 | mov r0, r9 @ control register |
258 | mov r2, r7, lsr #14 @ get TTB0 base | 262 | mov r2, r7, lsr #14 @ get TTB0 base |
259 | mov r2, r2, lsl #14 | 263 | mov r2, r2, lsl #14 |
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S index 28c72a2006a1..755e1bf22681 100644 --- a/arch/arm/mm/proc-xsc3.S +++ b/arch/arm/mm/proc-xsc3.S | |||
@@ -406,7 +406,7 @@ ENTRY(cpu_xsc3_set_pte_ext) | |||
406 | .align | 406 | .align |
407 | 407 | ||
408 | .globl cpu_xsc3_suspend_size | 408 | .globl cpu_xsc3_suspend_size |
409 | .equ cpu_xsc3_suspend_size, 4 * 8 | 409 | .equ cpu_xsc3_suspend_size, 4 * 7 |
410 | #ifdef CONFIG_PM_SLEEP | 410 | #ifdef CONFIG_PM_SLEEP |
411 | ENTRY(cpu_xsc3_do_suspend) | 411 | ENTRY(cpu_xsc3_do_suspend) |
412 | stmfd sp!, {r4 - r10, lr} | 412 | stmfd sp!, {r4 - r10, lr} |
@@ -418,12 +418,12 @@ ENTRY(cpu_xsc3_do_suspend) | |||
418 | mrc p15, 0, r9, c1, c0, 1 @ auxiliary control reg | 418 | mrc p15, 0, r9, c1, c0, 1 @ auxiliary control reg |
419 | mrc p15, 0, r10, c1, c0, 0 @ control reg | 419 | mrc p15, 0, r10, c1, c0, 0 @ control reg |
420 | bic r4, r4, #2 @ clear frequency change bit | 420 | bic r4, r4, #2 @ clear frequency change bit |
421 | stmia r0, {r1, r4 - r10} @ store v:p offset + cp regs | 421 | stmia r0, {r4 - r10} @ store cp regs |
422 | ldmia sp!, {r4 - r10, pc} | 422 | ldmia sp!, {r4 - r10, pc} |
423 | ENDPROC(cpu_xsc3_do_suspend) | 423 | ENDPROC(cpu_xsc3_do_suspend) |
424 | 424 | ||
425 | ENTRY(cpu_xsc3_do_resume) | 425 | ENTRY(cpu_xsc3_do_resume) |
426 | ldmia r0, {r1, r4 - r10} @ load v:p offset + cp regs | 426 | ldmia r0, {r4 - r10} @ load cp regs |
427 | mov ip, #0 | 427 | mov ip, #0 |
428 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB | 428 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB |
429 | mcr p15, 0, ip, c7, c10, 4 @ drain write (&fill) buffer | 429 | mcr p15, 0, ip, c7, c10, 4 @ drain write (&fill) buffer |
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c index b6b409744954..02609eee0562 100644 --- a/arch/arm/plat-omap/omap_device.c +++ b/arch/arm/plat-omap/omap_device.c | |||
@@ -615,6 +615,9 @@ static int _od_resume_noirq(struct device *dev) | |||
615 | 615 | ||
616 | return pm_generic_resume_noirq(dev); | 616 | return pm_generic_resume_noirq(dev); |
617 | } | 617 | } |
618 | #else | ||
619 | #define _od_suspend_noirq NULL | ||
620 | #define _od_resume_noirq NULL | ||
618 | #endif | 621 | #endif |
619 | 622 | ||
620 | static struct dev_pm_domain omap_device_pm_domain = { | 623 | static struct dev_pm_domain omap_device_pm_domain = { |
@@ -622,7 +625,8 @@ static struct dev_pm_domain omap_device_pm_domain = { | |||
622 | SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume, | 625 | SET_RUNTIME_PM_OPS(_od_runtime_suspend, _od_runtime_resume, |
623 | _od_runtime_idle) | 626 | _od_runtime_idle) |
624 | USE_PLATFORM_PM_SLEEP_OPS | 627 | USE_PLATFORM_PM_SLEEP_OPS |
625 | SET_SYSTEM_SLEEP_PM_OPS(_od_suspend_noirq, _od_resume_noirq) | 628 | .suspend_noirq = _od_suspend_noirq, |
629 | .resume_noirq = _od_resume_noirq, | ||
626 | } | 630 | } |
627 | }; | 631 | }; |
628 | 632 | ||
diff --git a/arch/arm/plat-s5p/clock.c b/arch/arm/plat-s5p/clock.c index 02af235298e2..5f84a3f13ef9 100644 --- a/arch/arm/plat-s5p/clock.c +++ b/arch/arm/plat-s5p/clock.c | |||
@@ -192,7 +192,7 @@ unsigned long s5p_spdif_get_rate(struct clk *clk) | |||
192 | if (IS_ERR(pclk)) | 192 | if (IS_ERR(pclk)) |
193 | return -EINVAL; | 193 | return -EINVAL; |
194 | 194 | ||
195 | rate = pclk->ops->get_rate(clk); | 195 | rate = pclk->ops->get_rate(pclk); |
196 | clk_put(pclk); | 196 | clk_put(pclk); |
197 | 197 | ||
198 | return rate; | 198 | return rate; |
diff --git a/arch/arm/plat-s5p/irq-gpioint.c b/arch/arm/plat-s5p/irq-gpioint.c index 327ab9f662e8..f71078ef6bb5 100644 --- a/arch/arm/plat-s5p/irq-gpioint.c +++ b/arch/arm/plat-s5p/irq-gpioint.c | |||
@@ -23,6 +23,8 @@ | |||
23 | #include <plat/gpio-core.h> | 23 | #include <plat/gpio-core.h> |
24 | #include <plat/gpio-cfg.h> | 24 | #include <plat/gpio-cfg.h> |
25 | 25 | ||
26 | #include <asm/mach/irq.h> | ||
27 | |||
26 | #define GPIO_BASE(chip) (((unsigned long)(chip)->base) & 0xFFFFF000u) | 28 | #define GPIO_BASE(chip) (((unsigned long)(chip)->base) & 0xFFFFF000u) |
27 | 29 | ||
28 | #define CON_OFFSET 0x700 | 30 | #define CON_OFFSET 0x700 |
@@ -81,6 +83,9 @@ static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc) | |||
81 | int group, pend_offset, mask_offset; | 83 | int group, pend_offset, mask_offset; |
82 | unsigned int pend, mask; | 84 | unsigned int pend, mask; |
83 | 85 | ||
86 | struct irq_chip *chip = irq_get_chip(irq); | ||
87 | chained_irq_enter(chip, desc); | ||
88 | |||
84 | for (group = 0; group < bank->nr_groups; group++) { | 89 | for (group = 0; group < bank->nr_groups; group++) { |
85 | struct s3c_gpio_chip *chip = bank->chips[group]; | 90 | struct s3c_gpio_chip *chip = bank->chips[group]; |
86 | if (!chip) | 91 | if (!chip) |
@@ -102,6 +107,7 @@ static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc) | |||
102 | pend &= ~BIT(offset); | 107 | pend &= ~BIT(offset); |
103 | } | 108 | } |
104 | } | 109 | } |
110 | chained_irq_exit(chip, desc); | ||
105 | } | 111 | } |
106 | 112 | ||
107 | static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip) | 113 | static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip) |
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c index 302c42670bd1..3b4451979d1b 100644 --- a/arch/arm/plat-samsung/clock.c +++ b/arch/arm/plat-samsung/clock.c | |||
@@ -64,6 +64,17 @@ static LIST_HEAD(clocks); | |||
64 | */ | 64 | */ |
65 | DEFINE_SPINLOCK(clocks_lock); | 65 | DEFINE_SPINLOCK(clocks_lock); |
66 | 66 | ||
67 | /* Global watchdog clock used by arch_wtd_reset() callback */ | ||
68 | struct clk *s3c2410_wdtclk; | ||
69 | static int __init s3c_wdt_reset_init(void) | ||
70 | { | ||
71 | s3c2410_wdtclk = clk_get(NULL, "watchdog"); | ||
72 | if (IS_ERR(s3c2410_wdtclk)) | ||
73 | printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__); | ||
74 | return 0; | ||
75 | } | ||
76 | arch_initcall(s3c_wdt_reset_init); | ||
77 | |||
67 | /* enable and disable calls for use with the clk struct */ | 78 | /* enable and disable calls for use with the clk struct */ |
68 | 79 | ||
69 | static int clk_null_enable(struct clk *clk, int enable) | 80 | static int clk_null_enable(struct clk *clk, int enable) |
diff --git a/arch/arm/plat-samsung/include/plat/backlight.h b/arch/arm/plat-samsung/include/plat/backlight.h index 51d8da846a62..ad530c78fe8c 100644 --- a/arch/arm/plat-samsung/include/plat/backlight.h +++ b/arch/arm/plat-samsung/include/plat/backlight.h | |||
@@ -20,7 +20,7 @@ struct samsung_bl_gpio_info { | |||
20 | int func; | 20 | int func; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | extern void samsung_bl_set(struct samsung_bl_gpio_info *gpio_info, | 23 | extern void __init samsung_bl_set(struct samsung_bl_gpio_info *gpio_info, |
24 | struct platform_pwm_backlight_data *bl_data); | 24 | struct platform_pwm_backlight_data *bl_data); |
25 | 25 | ||
26 | #endif /* __ASM_PLAT_BACKLIGHT_H */ | 26 | #endif /* __ASM_PLAT_BACKLIGHT_H */ |
diff --git a/arch/arm/plat-samsung/include/plat/clock.h b/arch/arm/plat-samsung/include/plat/clock.h index 87d5b38a86fb..73c66d4d10fa 100644 --- a/arch/arm/plat-samsung/include/plat/clock.h +++ b/arch/arm/plat-samsung/include/plat/clock.h | |||
@@ -9,6 +9,9 @@ | |||
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifndef __ASM_PLAT_CLOCK_H | ||
13 | #define __ASM_PLAT_CLOCK_H __FILE__ | ||
14 | |||
12 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
13 | #include <linux/clkdev.h> | 16 | #include <linux/clkdev.h> |
14 | 17 | ||
@@ -121,3 +124,8 @@ extern int s3c64xx_sclk_ctrl(struct clk *clk, int enable); | |||
121 | 124 | ||
122 | extern void s3c_pwmclk_init(void); | 125 | extern void s3c_pwmclk_init(void); |
123 | 126 | ||
127 | /* Global watchdog clock used by arch_wtd_reset() callback */ | ||
128 | |||
129 | extern struct clk *s3c2410_wdtclk; | ||
130 | |||
131 | #endif /* __ASM_PLAT_CLOCK_H */ | ||
diff --git a/arch/arm/plat-samsung/include/plat/watchdog-reset.h b/arch/arm/plat-samsung/include/plat/watchdog-reset.h index 54b762acb5a0..40dbb2b0ae22 100644 --- a/arch/arm/plat-samsung/include/plat/watchdog-reset.h +++ b/arch/arm/plat-samsung/include/plat/watchdog-reset.h | |||
@@ -10,6 +10,7 @@ | |||
10 | * published by the Free Software Foundation. | 10 | * published by the Free Software Foundation. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <plat/clock.h> | ||
13 | #include <plat/regs-watchdog.h> | 14 | #include <plat/regs-watchdog.h> |
14 | #include <mach/map.h> | 15 | #include <mach/map.h> |
15 | 16 | ||
@@ -19,17 +20,12 @@ | |||
19 | 20 | ||
20 | static inline void arch_wdt_reset(void) | 21 | static inline void arch_wdt_reset(void) |
21 | { | 22 | { |
22 | struct clk *wdtclk; | ||
23 | |||
24 | printk("arch_reset: attempting watchdog reset\n"); | 23 | printk("arch_reset: attempting watchdog reset\n"); |
25 | 24 | ||
26 | __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */ | 25 | __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */ |
27 | 26 | ||
28 | wdtclk = clk_get(NULL, "watchdog"); | 27 | if (s3c2410_wdtclk) |
29 | if (!IS_ERR(wdtclk)) { | 28 | clk_enable(s3c2410_wdtclk); |
30 | clk_enable(wdtclk); | ||
31 | } else | ||
32 | printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__); | ||
33 | 29 | ||
34 | /* put initial values into count and data */ | 30 | /* put initial values into count and data */ |
35 | __raw_writel(0x80, S3C2410_WTCNT); | 31 | __raw_writel(0x80, S3C2410_WTCNT); |
diff --git a/arch/arm/plat-samsung/irq-vic-timer.c b/arch/arm/plat-samsung/irq-vic-timer.c index f714d060370d..51583cd30164 100644 --- a/arch/arm/plat-samsung/irq-vic-timer.c +++ b/arch/arm/plat-samsung/irq-vic-timer.c | |||
@@ -22,9 +22,14 @@ | |||
22 | #include <plat/irq-vic-timer.h> | 22 | #include <plat/irq-vic-timer.h> |
23 | #include <plat/regs-timer.h> | 23 | #include <plat/regs-timer.h> |
24 | 24 | ||
25 | #include <asm/mach/irq.h> | ||
26 | |||
25 | static void s3c_irq_demux_vic_timer(unsigned int irq, struct irq_desc *desc) | 27 | static void s3c_irq_demux_vic_timer(unsigned int irq, struct irq_desc *desc) |
26 | { | 28 | { |
29 | struct irq_chip *chip = irq_get_chip(irq); | ||
30 | chained_irq_enter(chip, desc); | ||
27 | generic_handle_irq((int)desc->irq_data.handler_data); | 31 | generic_handle_irq((int)desc->irq_data.handler_data); |
32 | chained_irq_exit(chip, desc); | ||
28 | } | 33 | } |
29 | 34 | ||
30 | /* We assume the IRQ_TIMER0..IRQ_TIMER4 range is continuous. */ | 35 | /* We assume the IRQ_TIMER0..IRQ_TIMER4 range is continuous. */ |
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types index fff68d0d521b..62cc8f981171 100644 --- a/arch/arm/tools/mach-types +++ b/arch/arm/tools/mach-types | |||
@@ -351,7 +351,7 @@ centro MACH_CENTRO CENTRO 1944 | |||
351 | nokia_rx51 MACH_NOKIA_RX51 NOKIA_RX51 1955 | 351 | nokia_rx51 MACH_NOKIA_RX51 NOKIA_RX51 1955 |
352 | omap_zoom2 MACH_OMAP_ZOOM2 OMAP_ZOOM2 1967 | 352 | omap_zoom2 MACH_OMAP_ZOOM2 OMAP_ZOOM2 1967 |
353 | cpuat9260 MACH_CPUAT9260 CPUAT9260 1973 | 353 | cpuat9260 MACH_CPUAT9260 CPUAT9260 1973 |
354 | eukrea_cpuimx27 MACH_CPUIMX27 CPUIMX27 1975 | 354 | eukrea_cpuimx27 MACH_EUKREA_CPUIMX27 EUKREA_CPUIMX27 1975 |
355 | acs5k MACH_ACS5K ACS5K 1982 | 355 | acs5k MACH_ACS5K ACS5K 1982 |
356 | snapper_9260 MACH_SNAPPER_9260 SNAPPER_9260 1987 | 356 | snapper_9260 MACH_SNAPPER_9260 SNAPPER_9260 1987 |
357 | dsm320 MACH_DSM320 DSM320 1988 | 357 | dsm320 MACH_DSM320 DSM320 1988 |
@@ -476,8 +476,8 @@ cns3420vb MACH_CNS3420VB CNS3420VB 2776 | |||
476 | omap4_panda MACH_OMAP4_PANDA OMAP4_PANDA 2791 | 476 | omap4_panda MACH_OMAP4_PANDA OMAP4_PANDA 2791 |
477 | ti8168evm MACH_TI8168EVM TI8168EVM 2800 | 477 | ti8168evm MACH_TI8168EVM TI8168EVM 2800 |
478 | teton_bga MACH_TETON_BGA TETON_BGA 2816 | 478 | teton_bga MACH_TETON_BGA TETON_BGA 2816 |
479 | eukrea_cpuimx25sd MACH_EUKREA_CPUIMX25 EUKREA_CPUIMX25 2820 | 479 | eukrea_cpuimx25sd MACH_EUKREA_CPUIMX25SD EUKREA_CPUIMX25SD 2820 |
480 | eukrea_cpuimx35sd MACH_EUKREA_CPUIMX35 EUKREA_CPUIMX35 2821 | 480 | eukrea_cpuimx35sd MACH_EUKREA_CPUIMX35SD EUKREA_CPUIMX35SD 2821 |
481 | eukrea_cpuimx51sd MACH_EUKREA_CPUIMX51SD EUKREA_CPUIMX51SD 2822 | 481 | eukrea_cpuimx51sd MACH_EUKREA_CPUIMX51SD EUKREA_CPUIMX51SD 2822 |
482 | eukrea_cpuimx51 MACH_EUKREA_CPUIMX51 EUKREA_CPUIMX51 2823 | 482 | eukrea_cpuimx51 MACH_EUKREA_CPUIMX51 EUKREA_CPUIMX51 2823 |
483 | smdkc210 MACH_SMDKC210 SMDKC210 2838 | 483 | smdkc210 MACH_SMDKC210 SMDKC210 2838 |
diff --git a/arch/avr32/kernel/syscall_table.S b/arch/avr32/kernel/syscall_table.S index c7fd394d28a4..6eba53530d1c 100644 --- a/arch/avr32/kernel/syscall_table.S +++ b/arch/avr32/kernel/syscall_table.S | |||
@@ -158,7 +158,7 @@ sys_call_table: | |||
158 | .long sys_sched_rr_get_interval | 158 | .long sys_sched_rr_get_interval |
159 | .long sys_nanosleep | 159 | .long sys_nanosleep |
160 | .long sys_poll | 160 | .long sys_poll |
161 | .long sys_nfsservctl /* 145 */ | 161 | .long sys_ni_syscall /* 145 was nfsservctl */ |
162 | .long sys_setresgid | 162 | .long sys_setresgid |
163 | .long sys_getresgid | 163 | .long sys_getresgid |
164 | .long sys_prctl | 164 | .long sys_prctl |
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S index 225d311c9701..e4137297b790 100644 --- a/arch/blackfin/mach-common/entry.S +++ b/arch/blackfin/mach-common/entry.S | |||
@@ -1543,7 +1543,7 @@ ENTRY(_sys_call_table) | |||
1543 | .long _sys_ni_syscall /* for vm86 */ | 1543 | .long _sys_ni_syscall /* for vm86 */ |
1544 | .long _sys_ni_syscall /* old "query_module" */ | 1544 | .long _sys_ni_syscall /* old "query_module" */ |
1545 | .long _sys_ni_syscall /* sys_poll */ | 1545 | .long _sys_ni_syscall /* sys_poll */ |
1546 | .long _sys_nfsservctl | 1546 | .long _sys_ni_syscall /* old nfsservctl */ |
1547 | .long _sys_setresgid /* setresgid16 */ /* 170 */ | 1547 | .long _sys_setresgid /* setresgid16 */ /* 170 */ |
1548 | .long _sys_getresgid /* getresgid16 */ | 1548 | .long _sys_getresgid /* getresgid16 */ |
1549 | .long _sys_prctl | 1549 | .long _sys_prctl |
diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S index 1161883eb582..592fbe9dfb62 100644 --- a/arch/cris/arch-v10/kernel/entry.S +++ b/arch/cris/arch-v10/kernel/entry.S | |||
@@ -771,7 +771,7 @@ sys_call_table: | |||
771 | .long sys_ni_syscall /* sys_vm86 */ | 771 | .long sys_ni_syscall /* sys_vm86 */ |
772 | .long sys_ni_syscall /* Old sys_query_module */ | 772 | .long sys_ni_syscall /* Old sys_query_module */ |
773 | .long sys_poll | 773 | .long sys_poll |
774 | .long sys_nfsservctl | 774 | .long sys_ni_syscall /* old nfsservctl */ |
775 | .long sys_setresgid16 /* 170 */ | 775 | .long sys_setresgid16 /* 170 */ |
776 | .long sys_getresgid16 | 776 | .long sys_getresgid16 |
777 | .long sys_prctl | 777 | .long sys_prctl |
diff --git a/arch/cris/arch-v32/kernel/entry.S b/arch/cris/arch-v32/kernel/entry.S index 84fed7e91ada..c3ea4694fbaf 100644 --- a/arch/cris/arch-v32/kernel/entry.S +++ b/arch/cris/arch-v32/kernel/entry.S | |||
@@ -714,7 +714,7 @@ sys_call_table: | |||
714 | .long sys_ni_syscall /* sys_vm86 */ | 714 | .long sys_ni_syscall /* sys_vm86 */ |
715 | .long sys_ni_syscall /* Old sys_query_module */ | 715 | .long sys_ni_syscall /* Old sys_query_module */ |
716 | .long sys_poll | 716 | .long sys_poll |
717 | .long sys_nfsservctl | 717 | .long sys_ni_syscall /* Old nfsservctl */ |
718 | .long sys_setresgid16 /* 170 */ | 718 | .long sys_setresgid16 /* 170 */ |
719 | .long sys_getresgid16 | 719 | .long sys_getresgid16 |
720 | .long sys_prctl | 720 | .long sys_prctl |
diff --git a/arch/cris/include/asm/serial.h b/arch/cris/include/asm/serial.h new file mode 100644 index 000000000000..af7535a955fb --- /dev/null +++ b/arch/cris/include/asm/serial.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef _ASM_SERIAL_H | ||
2 | #define _ASM_SERIAL_H | ||
3 | |||
4 | /* | ||
5 | * This assumes you have a 1.8432 MHz clock for your UART. | ||
6 | */ | ||
7 | #define BASE_BAUD (1843200 / 16) | ||
8 | |||
9 | #endif /* _ASM_SERIAL_H */ | ||
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S index 017d6d7b784f..5ba23f715ea5 100644 --- a/arch/frv/kernel/entry.S +++ b/arch/frv/kernel/entry.S | |||
@@ -1358,7 +1358,7 @@ sys_call_table: | |||
1358 | .long sys_ni_syscall /* for vm86 */ | 1358 | .long sys_ni_syscall /* for vm86 */ |
1359 | .long sys_ni_syscall /* Old sys_query_module */ | 1359 | .long sys_ni_syscall /* Old sys_query_module */ |
1360 | .long sys_poll | 1360 | .long sys_poll |
1361 | .long sys_nfsservctl | 1361 | .long sys_ni_syscall /* Old nfsservctl */ |
1362 | .long sys_setresgid16 /* 170 */ | 1362 | .long sys_setresgid16 /* 170 */ |
1363 | .long sys_getresgid16 | 1363 | .long sys_getresgid16 |
1364 | .long sys_prctl | 1364 | .long sys_prctl |
diff --git a/arch/h8300/kernel/syscalls.S b/arch/h8300/kernel/syscalls.S index f4b2e67bcc34..4be2ea2fbe26 100644 --- a/arch/h8300/kernel/syscalls.S +++ b/arch/h8300/kernel/syscalls.S | |||
@@ -183,7 +183,7 @@ SYMBOL_NAME_LABEL(sys_call_table) | |||
183 | .long SYMBOL_NAME(sys_ni_syscall) /* for vm86 */ | 183 | .long SYMBOL_NAME(sys_ni_syscall) /* for vm86 */ |
184 | .long SYMBOL_NAME(sys_ni_syscall) /* sys_query_module */ | 184 | .long SYMBOL_NAME(sys_ni_syscall) /* sys_query_module */ |
185 | .long SYMBOL_NAME(sys_poll) | 185 | .long SYMBOL_NAME(sys_poll) |
186 | .long SYMBOL_NAME(sys_nfsservctl) | 186 | .long SYMBOL_NAME(sys_ni_syscall) /* old nfsservctl */ |
187 | .long SYMBOL_NAME(sys_setresgid16) /* 170 */ | 187 | .long SYMBOL_NAME(sys_setresgid16) /* 170 */ |
188 | .long SYMBOL_NAME(sys_getresgid16) | 188 | .long SYMBOL_NAME(sys_getresgid16) |
189 | .long SYMBOL_NAME(sys_prctl) | 189 | .long SYMBOL_NAME(sys_prctl) |
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 124854714958..3ff7785b3beb 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -162,7 +162,6 @@ config IA64_GENERIC | |||
162 | select ACPI_NUMA | 162 | select ACPI_NUMA |
163 | select SWIOTLB | 163 | select SWIOTLB |
164 | select PCI_MSI | 164 | select PCI_MSI |
165 | select DMAR | ||
166 | help | 165 | help |
167 | This selects the system type of your hardware. A "generic" kernel | 166 | This selects the system type of your hardware. A "generic" kernel |
168 | will run on any supported IA-64 system. However, if you configure | 167 | will run on any supported IA-64 system. However, if you configure |
diff --git a/arch/ia64/configs/generic_defconfig b/arch/ia64/configs/generic_defconfig index 1d7bca0a396d..0e5cd1405e0e 100644 --- a/arch/ia64/configs/generic_defconfig +++ b/arch/ia64/configs/generic_defconfig | |||
@@ -234,3 +234,4 @@ CONFIG_CRYPTO_MD5=y | |||
234 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | 234 | # CONFIG_CRYPTO_ANSI_CPRNG is not set |
235 | CONFIG_CRC_T10DIF=y | 235 | CONFIG_CRC_T10DIF=y |
236 | CONFIG_MISC_DEVICES=y | 236 | CONFIG_MISC_DEVICES=y |
237 | CONFIG_DMAR=y | ||
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index 97dd2abdeb1a..198c753d1006 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
@@ -1614,7 +1614,7 @@ sys_call_table: | |||
1614 | data8 sys_sched_get_priority_min | 1614 | data8 sys_sched_get_priority_min |
1615 | data8 sys_sched_rr_get_interval | 1615 | data8 sys_sched_rr_get_interval |
1616 | data8 sys_nanosleep | 1616 | data8 sys_nanosleep |
1617 | data8 sys_nfsservctl | 1617 | data8 sys_ni_syscall // old nfsservctl |
1618 | data8 sys_prctl // 1170 | 1618 | data8 sys_prctl // 1170 |
1619 | data8 sys_getpagesize | 1619 | data8 sys_getpagesize |
1620 | data8 sys_mmap2 | 1620 | data8 sys_mmap2 |
diff --git a/arch/m32r/kernel/syscall_table.S b/arch/m32r/kernel/syscall_table.S index 528f2e6ad064..f365c19795ef 100644 --- a/arch/m32r/kernel/syscall_table.S +++ b/arch/m32r/kernel/syscall_table.S | |||
@@ -168,7 +168,7 @@ ENTRY(sys_call_table) | |||
168 | .long sys_tas /* vm86 syscall holder */ | 168 | .long sys_tas /* vm86 syscall holder */ |
169 | .long sys_ni_syscall /* query_module syscall holder */ | 169 | .long sys_ni_syscall /* query_module syscall holder */ |
170 | .long sys_poll | 170 | .long sys_poll |
171 | .long sys_nfsservctl | 171 | .long sys_ni_syscall /* was nfsservctl */ |
172 | .long sys_setresgid /* 170 */ | 172 | .long sys_setresgid /* 170 */ |
173 | .long sys_getresgid | 173 | .long sys_getresgid |
174 | .long sys_prctl | 174 | .long sys_prctl |
diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h index 31d5570d6567..89f201434b5a 100644 --- a/arch/m68k/include/asm/page_mm.h +++ b/arch/m68k/include/asm/page_mm.h | |||
@@ -162,7 +162,7 @@ static inline __attribute_const__ int __virt_to_node_shift(void) | |||
162 | pgdat->node_mem_map + (__pfn - pgdat->node_start_pfn); \ | 162 | pgdat->node_mem_map + (__pfn - pgdat->node_start_pfn); \ |
163 | }) | 163 | }) |
164 | #define page_to_pfn(_page) ({ \ | 164 | #define page_to_pfn(_page) ({ \ |
165 | struct page *__p = (_page); \ | 165 | const struct page *__p = (_page); \ |
166 | struct pglist_data *pgdat; \ | 166 | struct pglist_data *pgdat; \ |
167 | pgdat = &pg_data_map[page_to_nid(__p)]; \ | 167 | pgdat = &pg_data_map[page_to_nid(__p)]; \ |
168 | ((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn; \ | 168 | ((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn; \ |
diff --git a/arch/m68k/kernel/syscalltable.S b/arch/m68k/kernel/syscalltable.S index 00d1452f9571..c468f2edaa85 100644 --- a/arch/m68k/kernel/syscalltable.S +++ b/arch/m68k/kernel/syscalltable.S | |||
@@ -189,7 +189,7 @@ ENTRY(sys_call_table) | |||
189 | .long sys_getpagesize | 189 | .long sys_getpagesize |
190 | .long sys_ni_syscall /* old "query_module" */ | 190 | .long sys_ni_syscall /* old "query_module" */ |
191 | .long sys_poll | 191 | .long sys_poll |
192 | .long sys_nfsservctl | 192 | .long sys_ni_syscall /* old nfsservctl */ |
193 | .long sys_setresgid16 /* 170 */ | 193 | .long sys_setresgid16 /* 170 */ |
194 | .long sys_getresgid16 | 194 | .long sys_getresgid16 |
195 | .long sys_prctl | 195 | .long sys_prctl |
diff --git a/arch/microblaze/kernel/syscall_table.S b/arch/microblaze/kernel/syscall_table.S index d915a122c865..8789daa2a346 100644 --- a/arch/microblaze/kernel/syscall_table.S +++ b/arch/microblaze/kernel/syscall_table.S | |||
@@ -173,7 +173,7 @@ ENTRY(sys_call_table) | |||
173 | .long sys_ni_syscall /* sys_vm86 */ | 173 | .long sys_ni_syscall /* sys_vm86 */ |
174 | .long sys_ni_syscall /* Old sys_query_module */ | 174 | .long sys_ni_syscall /* Old sys_query_module */ |
175 | .long sys_poll | 175 | .long sys_poll |
176 | .long sys_nfsservctl | 176 | .long sys_ni_syscall /* old nfsservctl */ |
177 | .long sys_setresgid /* 170 */ | 177 | .long sys_setresgid /* 170 */ |
178 | .long sys_getresgid | 178 | .long sys_getresgid |
179 | .long sys_prctl | 179 | .long sys_prctl |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index e521420a45a5..865bc7a6f5a1 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -424,7 +424,7 @@ einval: li v0, -ENOSYS | |||
424 | sys sys_getresuid 3 | 424 | sys sys_getresuid 3 |
425 | sys sys_ni_syscall 0 /* was sys_query_module */ | 425 | sys sys_ni_syscall 0 /* was sys_query_module */ |
426 | sys sys_poll 3 | 426 | sys sys_poll 3 |
427 | sys sys_nfsservctl 3 | 427 | sys sys_ni_syscall 0 /* was nfsservctl */ |
428 | sys sys_setresgid 3 /* 4190 */ | 428 | sys sys_setresgid 3 /* 4190 */ |
429 | sys sys_getresgid 3 | 429 | sys sys_getresgid 3 |
430 | sys sys_prctl 5 | 430 | sys sys_prctl 5 |
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index 85874d6a8a70..fb7334bea731 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
@@ -299,7 +299,7 @@ sys_call_table: | |||
299 | PTR sys_ni_syscall /* 5170, was get_kernel_syms */ | 299 | PTR sys_ni_syscall /* 5170, was get_kernel_syms */ |
300 | PTR sys_ni_syscall /* was query_module */ | 300 | PTR sys_ni_syscall /* was query_module */ |
301 | PTR sys_quotactl | 301 | PTR sys_quotactl |
302 | PTR sys_nfsservctl | 302 | PTR sys_ni_syscall /* was nfsservctl */ |
303 | PTR sys_ni_syscall /* res. for getpmsg */ | 303 | PTR sys_ni_syscall /* res. for getpmsg */ |
304 | PTR sys_ni_syscall /* 5175 for putpmsg */ | 304 | PTR sys_ni_syscall /* 5175 for putpmsg */ |
305 | PTR sys_ni_syscall /* res. for afs_syscall */ | 305 | PTR sys_ni_syscall /* res. for afs_syscall */ |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index b85842fc87ae..f9296e894e46 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -294,7 +294,7 @@ EXPORT(sysn32_call_table) | |||
294 | PTR sys_ni_syscall /* 6170, was get_kernel_syms */ | 294 | PTR sys_ni_syscall /* 6170, was get_kernel_syms */ |
295 | PTR sys_ni_syscall /* was query_module */ | 295 | PTR sys_ni_syscall /* was query_module */ |
296 | PTR sys_quotactl | 296 | PTR sys_quotactl |
297 | PTR compat_sys_nfsservctl | 297 | PTR sys_ni_syscall /* was nfsservctl */ |
298 | PTR sys_ni_syscall /* res. for getpmsg */ | 298 | PTR sys_ni_syscall /* res. for getpmsg */ |
299 | PTR sys_ni_syscall /* 6175 for putpmsg */ | 299 | PTR sys_ni_syscall /* 6175 for putpmsg */ |
300 | PTR sys_ni_syscall /* res. for afs_syscall */ | 300 | PTR sys_ni_syscall /* res. for afs_syscall */ |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 46c4763edf21..4d7c9827706f 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -392,7 +392,7 @@ sys_call_table: | |||
392 | PTR sys_getresuid | 392 | PTR sys_getresuid |
393 | PTR sys_ni_syscall /* was query_module */ | 393 | PTR sys_ni_syscall /* was query_module */ |
394 | PTR sys_poll | 394 | PTR sys_poll |
395 | PTR compat_sys_nfsservctl | 395 | PTR sys_ni_syscall /* was nfsservctl */ |
396 | PTR sys_setresgid /* 4190 */ | 396 | PTR sys_setresgid /* 4190 */ |
397 | PTR sys_getresgid | 397 | PTR sys_getresgid |
398 | PTR sys_prctl | 398 | PTR sys_prctl |
diff --git a/arch/mn10300/kernel/entry.S b/arch/mn10300/kernel/entry.S index ae435e1d5669..3e3620d9fc45 100644 --- a/arch/mn10300/kernel/entry.S +++ b/arch/mn10300/kernel/entry.S | |||
@@ -589,7 +589,7 @@ ENTRY(sys_call_table) | |||
589 | .long sys_ni_syscall /* vm86 */ | 589 | .long sys_ni_syscall /* vm86 */ |
590 | .long sys_ni_syscall /* Old sys_query_module */ | 590 | .long sys_ni_syscall /* Old sys_query_module */ |
591 | .long sys_poll | 591 | .long sys_poll |
592 | .long sys_nfsservctl | 592 | .long sys_ni_syscall /* was nfsservctl */ |
593 | .long sys_setresgid16 /* 170 */ | 593 | .long sys_setresgid16 /* 170 */ |
594 | .long sys_getresgid16 | 594 | .long sys_getresgid16 |
595 | .long sys_prctl | 595 | .long sys_prctl |
diff --git a/arch/openrisc/include/asm/dma-mapping.h b/arch/openrisc/include/asm/dma-mapping.h index 052f877b52a5..60b472233900 100644 --- a/arch/openrisc/include/asm/dma-mapping.h +++ b/arch/openrisc/include/asm/dma-mapping.h | |||
@@ -31,7 +31,6 @@ | |||
31 | 31 | ||
32 | #define DMA_ERROR_CODE (~(dma_addr_t)0x0) | 32 | #define DMA_ERROR_CODE (~(dma_addr_t)0x0) |
33 | 33 | ||
34 | int dma_mapping_error(struct device *dev, dma_addr_t dma_addr); | ||
35 | 34 | ||
36 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 35 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
37 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | 36 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
@@ -47,6 +46,12 @@ dma_addr_t or1k_map_page(struct device *dev, struct page *page, | |||
47 | void or1k_unmap_page(struct device *dev, dma_addr_t dma_handle, | 46 | void or1k_unmap_page(struct device *dev, dma_addr_t dma_handle, |
48 | size_t size, enum dma_data_direction dir, | 47 | size_t size, enum dma_data_direction dir, |
49 | struct dma_attrs *attrs); | 48 | struct dma_attrs *attrs); |
49 | int or1k_map_sg(struct device *dev, struct scatterlist *sg, | ||
50 | int nents, enum dma_data_direction dir, | ||
51 | struct dma_attrs *attrs); | ||
52 | void or1k_unmap_sg(struct device *dev, struct scatterlist *sg, | ||
53 | int nents, enum dma_data_direction dir, | ||
54 | struct dma_attrs *attrs); | ||
50 | void or1k_sync_single_for_cpu(struct device *dev, | 55 | void or1k_sync_single_for_cpu(struct device *dev, |
51 | dma_addr_t dma_handle, size_t size, | 56 | dma_addr_t dma_handle, size_t size, |
52 | enum dma_data_direction dir); | 57 | enum dma_data_direction dir); |
@@ -98,6 +103,51 @@ static inline void dma_unmap_single(struct device *dev, dma_addr_t addr, | |||
98 | debug_dma_unmap_page(dev, addr, size, dir, true); | 103 | debug_dma_unmap_page(dev, addr, size, dir, true); |
99 | } | 104 | } |
100 | 105 | ||
106 | static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, | ||
107 | int nents, enum dma_data_direction dir) | ||
108 | { | ||
109 | int i, ents; | ||
110 | struct scatterlist *s; | ||
111 | |||
112 | for_each_sg(sg, s, nents, i) | ||
113 | kmemcheck_mark_initialized(sg_virt(s), s->length); | ||
114 | BUG_ON(!valid_dma_direction(dir)); | ||
115 | ents = or1k_map_sg(dev, sg, nents, dir, NULL); | ||
116 | debug_dma_map_sg(dev, sg, nents, ents, dir); | ||
117 | |||
118 | return ents; | ||
119 | } | ||
120 | |||
121 | static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg, | ||
122 | int nents, enum dma_data_direction dir) | ||
123 | { | ||
124 | BUG_ON(!valid_dma_direction(dir)); | ||
125 | debug_dma_unmap_sg(dev, sg, nents, dir); | ||
126 | or1k_unmap_sg(dev, sg, nents, dir, NULL); | ||
127 | } | ||
128 | |||
129 | static inline dma_addr_t dma_map_page(struct device *dev, struct page *page, | ||
130 | size_t offset, size_t size, | ||
131 | enum dma_data_direction dir) | ||
132 | { | ||
133 | dma_addr_t addr; | ||
134 | |||
135 | kmemcheck_mark_initialized(page_address(page) + offset, size); | ||
136 | BUG_ON(!valid_dma_direction(dir)); | ||
137 | addr = or1k_map_page(dev, page, offset, size, dir, NULL); | ||
138 | debug_dma_map_page(dev, page, offset, size, dir, addr, false); | ||
139 | |||
140 | return addr; | ||
141 | } | ||
142 | |||
143 | static inline void dma_unmap_page(struct device *dev, dma_addr_t addr, | ||
144 | size_t size, enum dma_data_direction dir) | ||
145 | { | ||
146 | BUG_ON(!valid_dma_direction(dir)); | ||
147 | or1k_unmap_page(dev, addr, size, dir, NULL); | ||
148 | debug_dma_unmap_page(dev, addr, size, dir, true); | ||
149 | } | ||
150 | |||
101 | static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t addr, | 151 | static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t addr, |
102 | size_t size, | 152 | size_t size, |
103 | enum dma_data_direction dir) | 153 | enum dma_data_direction dir) |
@@ -119,7 +169,12 @@ static inline void dma_sync_single_for_device(struct device *dev, | |||
119 | static inline int dma_supported(struct device *dev, u64 dma_mask) | 169 | static inline int dma_supported(struct device *dev, u64 dma_mask) |
120 | { | 170 | { |
121 | /* Support 32 bit DMA mask exclusively */ | 171 | /* Support 32 bit DMA mask exclusively */ |
122 | return dma_mask == 0xffffffffULL; | 172 | return dma_mask == DMA_BIT_MASK(32); |
173 | } | ||
174 | |||
175 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
176 | { | ||
177 | return 0; | ||
123 | } | 178 | } |
124 | 179 | ||
125 | static inline int dma_set_mask(struct device *dev, u64 dma_mask) | 180 | static inline int dma_set_mask(struct device *dev, u64 dma_mask) |
diff --git a/arch/openrisc/include/asm/sigcontext.h b/arch/openrisc/include/asm/sigcontext.h index 54a5c50132e3..b79c2b19afbe 100644 --- a/arch/openrisc/include/asm/sigcontext.h +++ b/arch/openrisc/include/asm/sigcontext.h | |||
@@ -23,16 +23,11 @@ | |||
23 | 23 | ||
24 | /* This struct is saved by setup_frame in signal.c, to keep the current | 24 | /* This struct is saved by setup_frame in signal.c, to keep the current |
25 | context while a signal handler is executed. It's restored by sys_sigreturn. | 25 | context while a signal handler is executed. It's restored by sys_sigreturn. |
26 | |||
27 | To keep things simple, we use pt_regs here even though normally you just | ||
28 | specify the list of regs to save. Then we can use copy_from_user on the | ||
29 | entire regs instead of a bunch of get_user's as well... | ||
30 | */ | 26 | */ |
31 | 27 | ||
32 | struct sigcontext { | 28 | struct sigcontext { |
33 | struct pt_regs regs; /* needs to be first */ | 29 | struct user_regs_struct regs; /* needs to be first */ |
34 | unsigned long oldmask; | 30 | unsigned long oldmask; |
35 | unsigned long usp; /* usp before stacking this gunk on it */ | ||
36 | }; | 31 | }; |
37 | 32 | ||
38 | #endif /* __ASM_OPENRISC_SIGCONTEXT_H */ | 33 | #endif /* __ASM_OPENRISC_SIGCONTEXT_H */ |
diff --git a/arch/openrisc/kernel/dma.c b/arch/openrisc/kernel/dma.c index 968d3ee477e3..f1c8ee2895d0 100644 --- a/arch/openrisc/kernel/dma.c +++ b/arch/openrisc/kernel/dma.c | |||
@@ -154,6 +154,33 @@ void or1k_unmap_page(struct device *dev, dma_addr_t dma_handle, | |||
154 | /* Nothing special to do here... */ | 154 | /* Nothing special to do here... */ |
155 | } | 155 | } |
156 | 156 | ||
157 | int or1k_map_sg(struct device *dev, struct scatterlist *sg, | ||
158 | int nents, enum dma_data_direction dir, | ||
159 | struct dma_attrs *attrs) | ||
160 | { | ||
161 | struct scatterlist *s; | ||
162 | int i; | ||
163 | |||
164 | for_each_sg(sg, s, nents, i) { | ||
165 | s->dma_address = or1k_map_page(dev, sg_page(s), s->offset, | ||
166 | s->length, dir, NULL); | ||
167 | } | ||
168 | |||
169 | return nents; | ||
170 | } | ||
171 | |||
172 | void or1k_unmap_sg(struct device *dev, struct scatterlist *sg, | ||
173 | int nents, enum dma_data_direction dir, | ||
174 | struct dma_attrs *attrs) | ||
175 | { | ||
176 | struct scatterlist *s; | ||
177 | int i; | ||
178 | |||
179 | for_each_sg(sg, s, nents, i) { | ||
180 | or1k_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir, NULL); | ||
181 | } | ||
182 | } | ||
183 | |||
157 | void or1k_sync_single_for_cpu(struct device *dev, | 184 | void or1k_sync_single_for_cpu(struct device *dev, |
158 | dma_addr_t dma_handle, size_t size, | 185 | dma_addr_t dma_handle, size_t size, |
159 | enum dma_data_direction dir) | 186 | enum dma_data_direction dir) |
@@ -187,5 +214,4 @@ static int __init dma_init(void) | |||
187 | 214 | ||
188 | return 0; | 215 | return 0; |
189 | } | 216 | } |
190 | |||
191 | fs_initcall(dma_init); | 217 | fs_initcall(dma_init); |
diff --git a/arch/openrisc/kernel/signal.c b/arch/openrisc/kernel/signal.c index 5f759c76834e..95207ab0c99e 100644 --- a/arch/openrisc/kernel/signal.c +++ b/arch/openrisc/kernel/signal.c | |||
@@ -52,31 +52,25 @@ struct rt_sigframe { | |||
52 | static int restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc) | 52 | static int restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc) |
53 | { | 53 | { |
54 | unsigned int err = 0; | 54 | unsigned int err = 0; |
55 | unsigned long old_usp; | ||
56 | 55 | ||
57 | /* Alwys make any pending restarted system call return -EINTR */ | 56 | /* Alwys make any pending restarted system call return -EINTR */ |
58 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | 57 | current_thread_info()->restart_block.fn = do_no_restart_syscall; |
59 | 58 | ||
60 | /* restore the regs from &sc->regs (same as sc, since regs is first) | 59 | /* |
60 | * Restore the regs from &sc->regs. | ||
61 | * (sc is already checked for VERIFY_READ since the sigframe was | 61 | * (sc is already checked for VERIFY_READ since the sigframe was |
62 | * checked in sys_sigreturn previously) | 62 | * checked in sys_sigreturn previously) |
63 | */ | 63 | */ |
64 | 64 | if (__copy_from_user(regs, sc->regs.gpr, 32 * sizeof(unsigned long))) | |
65 | if (__copy_from_user(regs, sc, sizeof(struct pt_regs))) | 65 | goto badframe; |
66 | if (__copy_from_user(®s->pc, &sc->regs.pc, sizeof(unsigned long))) | ||
67 | goto badframe; | ||
68 | if (__copy_from_user(®s->sr, &sc->regs.sr, sizeof(unsigned long))) | ||
66 | goto badframe; | 69 | goto badframe; |
67 | 70 | ||
68 | /* make sure the SM-bit is cleared so user-mode cannot fool us */ | 71 | /* make sure the SM-bit is cleared so user-mode cannot fool us */ |
69 | regs->sr &= ~SPR_SR_SM; | 72 | regs->sr &= ~SPR_SR_SM; |
70 | 73 | ||
71 | /* restore the old USP as it was before we stacked the sc etc. | ||
72 | * (we cannot just pop the sigcontext since we aligned the sp and | ||
73 | * stuff after pushing it) | ||
74 | */ | ||
75 | |||
76 | err |= __get_user(old_usp, &sc->usp); | ||
77 | |||
78 | regs->sp = old_usp; | ||
79 | |||
80 | /* TODO: the other ports use regs->orig_XX to disable syscall checks | 74 | /* TODO: the other ports use regs->orig_XX to disable syscall checks |
81 | * after this completes, but we don't use that mechanism. maybe we can | 75 | * after this completes, but we don't use that mechanism. maybe we can |
82 | * use it now ? | 76 | * use it now ? |
@@ -137,18 +131,17 @@ static int setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs, | |||
137 | unsigned long mask) | 131 | unsigned long mask) |
138 | { | 132 | { |
139 | int err = 0; | 133 | int err = 0; |
140 | unsigned long usp = regs->sp; | ||
141 | 134 | ||
142 | /* copy the regs. they are first in sc so we can use sc directly */ | 135 | /* copy the regs */ |
143 | 136 | ||
144 | err |= __copy_to_user(sc, regs, sizeof(struct pt_regs)); | 137 | err |= __copy_to_user(sc->regs.gpr, regs, 32 * sizeof(unsigned long)); |
138 | err |= __copy_to_user(&sc->regs.pc, ®s->pc, sizeof(unsigned long)); | ||
139 | err |= __copy_to_user(&sc->regs.sr, ®s->sr, sizeof(unsigned long)); | ||
145 | 140 | ||
146 | /* then some other stuff */ | 141 | /* then some other stuff */ |
147 | 142 | ||
148 | err |= __put_user(mask, &sc->oldmask); | 143 | err |= __put_user(mask, &sc->oldmask); |
149 | 144 | ||
150 | err |= __put_user(usp, &sc->usp); | ||
151 | |||
152 | return err; | 145 | return err; |
153 | } | 146 | } |
154 | 147 | ||
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index e66366fd2abc..3735abd7f8f6 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S | |||
@@ -259,7 +259,7 @@ | |||
259 | ENTRY_SAME(ni_syscall) /* query_module */ | 259 | ENTRY_SAME(ni_syscall) /* query_module */ |
260 | ENTRY_SAME(poll) | 260 | ENTRY_SAME(poll) |
261 | /* structs contain pointers and an in_addr... */ | 261 | /* structs contain pointers and an in_addr... */ |
262 | ENTRY_COMP(nfsservctl) | 262 | ENTRY_SAME(ni_syscall) /* was nfsservctl */ |
263 | ENTRY_SAME(setresgid) /* 170 */ | 263 | ENTRY_SAME(setresgid) /* 170 */ |
264 | ENTRY_SAME(getresgid) | 264 | ENTRY_SAME(getresgid) |
265 | ENTRY_SAME(prctl) | 265 | ENTRY_SAME(prctl) |
diff --git a/arch/powerpc/boot/dts/p1023rds.dts b/arch/powerpc/boot/dts/p1023rds.dts index bfa96aa8f2ca..d9b776740a67 100644 --- a/arch/powerpc/boot/dts/p1023rds.dts +++ b/arch/powerpc/boot/dts/p1023rds.dts | |||
@@ -387,7 +387,7 @@ | |||
387 | #size-cells = <1>; | 387 | #size-cells = <1>; |
388 | compatible = "cfi-flash"; | 388 | compatible = "cfi-flash"; |
389 | reg = <0x0 0x0 0x02000000>; | 389 | reg = <0x0 0x0 0x02000000>; |
390 | bank-width = <1>; | 390 | bank-width = <2>; |
391 | device-width = <1>; | 391 | device-width = <1>; |
392 | partition@0 { | 392 | partition@0 { |
393 | label = "ramdisk"; | 393 | label = "ramdisk"; |
diff --git a/arch/powerpc/configs/85xx/p1023rds_defconfig b/arch/powerpc/configs/85xx/p1023rds_defconfig index 980ff8f61fd4..3ff5a81c709f 100644 --- a/arch/powerpc/configs/85xx/p1023rds_defconfig +++ b/arch/powerpc/configs/85xx/p1023rds_defconfig | |||
@@ -171,3 +171,4 @@ CONFIG_CRYPTO_SHA256=y | |||
171 | CONFIG_CRYPTO_SHA512=y | 171 | CONFIG_CRYPTO_SHA512=y |
172 | CONFIG_CRYPTO_AES=y | 172 | CONFIG_CRYPTO_AES=y |
173 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | 173 | # CONFIG_CRYPTO_ANSI_CPRNG is not set |
174 | CONFIG_CRYPTO_DEV_FSL_CAAM=y | ||
diff --git a/arch/powerpc/configs/corenet32_smp_defconfig b/arch/powerpc/configs/corenet32_smp_defconfig index 10562a5c65b9..4311d02a3bfd 100644 --- a/arch/powerpc/configs/corenet32_smp_defconfig +++ b/arch/powerpc/configs/corenet32_smp_defconfig | |||
@@ -185,3 +185,4 @@ CONFIG_CRYPTO_SHA256=y | |||
185 | CONFIG_CRYPTO_SHA512=y | 185 | CONFIG_CRYPTO_SHA512=y |
186 | CONFIG_CRYPTO_AES=y | 186 | CONFIG_CRYPTO_AES=y |
187 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | 187 | # CONFIG_CRYPTO_ANSI_CPRNG is not set |
188 | CONFIG_CRYPTO_DEV_FSL_CAAM=y | ||
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig b/arch/powerpc/configs/corenet64_smp_defconfig index d32283555b53..c92c204a204b 100644 --- a/arch/powerpc/configs/corenet64_smp_defconfig +++ b/arch/powerpc/configs/corenet64_smp_defconfig | |||
@@ -100,5 +100,8 @@ CONFIG_DEBUG_INFO=y | |||
100 | CONFIG_SYSCTL_SYSCALL_CHECK=y | 100 | CONFIG_SYSCTL_SYSCALL_CHECK=y |
101 | CONFIG_VIRQ_DEBUG=y | 101 | CONFIG_VIRQ_DEBUG=y |
102 | CONFIG_CRYPTO_PCBC=m | 102 | CONFIG_CRYPTO_PCBC=m |
103 | CONFIG_CRYPTO_SHA256=y | ||
104 | CONFIG_CRYPTO_SHA512=y | ||
105 | CONFIG_CRYPTO_AES=y | ||
103 | # CONFIG_CRYPTO_ANSI_CPRNG is not set | 106 | # CONFIG_CRYPTO_ANSI_CPRNG is not set |
104 | CONFIG_CRYPTO_DEV_TALITOS=y | 107 | CONFIG_CRYPTO_DEV_FSL_CAAM=y |
diff --git a/arch/powerpc/configs/mpc85xx_defconfig b/arch/powerpc/configs/mpc85xx_defconfig index fcd85d2c72dc..a3467bfb7671 100644 --- a/arch/powerpc/configs/mpc85xx_defconfig +++ b/arch/powerpc/configs/mpc85xx_defconfig | |||
@@ -139,6 +139,7 @@ CONFIG_SND=y | |||
139 | CONFIG_SND_INTEL8X0=y | 139 | CONFIG_SND_INTEL8X0=y |
140 | # CONFIG_SND_PPC is not set | 140 | # CONFIG_SND_PPC is not set |
141 | # CONFIG_SND_USB is not set | 141 | # CONFIG_SND_USB is not set |
142 | CONFIG_SND_SOC=y | ||
142 | CONFIG_HID_A4TECH=y | 143 | CONFIG_HID_A4TECH=y |
143 | CONFIG_HID_APPLE=y | 144 | CONFIG_HID_APPLE=y |
144 | CONFIG_HID_BELKIN=y | 145 | CONFIG_HID_BELKIN=y |
diff --git a/arch/powerpc/configs/mpc85xx_smp_defconfig b/arch/powerpc/configs/mpc85xx_smp_defconfig index 908c941fc24c..9693f6ed3da0 100644 --- a/arch/powerpc/configs/mpc85xx_smp_defconfig +++ b/arch/powerpc/configs/mpc85xx_smp_defconfig | |||
@@ -140,6 +140,7 @@ CONFIG_SND=y | |||
140 | CONFIG_SND_INTEL8X0=y | 140 | CONFIG_SND_INTEL8X0=y |
141 | # CONFIG_SND_PPC is not set | 141 | # CONFIG_SND_PPC is not set |
142 | # CONFIG_SND_USB is not set | 142 | # CONFIG_SND_USB is not set |
143 | CONFIG_SND_SOC=y | ||
143 | CONFIG_HID_A4TECH=y | 144 | CONFIG_HID_A4TECH=y |
144 | CONFIG_HID_APPLE=y | 145 | CONFIG_HID_APPLE=y |
145 | CONFIG_HID_BELKIN=y | 146 | CONFIG_HID_BELKIN=y |
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index f6736b7da463..fa0d27a400de 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
@@ -171,7 +171,7 @@ SYSCALL_SPU(setresuid) | |||
171 | SYSCALL_SPU(getresuid) | 171 | SYSCALL_SPU(getresuid) |
172 | SYSCALL(ni_syscall) | 172 | SYSCALL(ni_syscall) |
173 | SYSCALL_SPU(poll) | 173 | SYSCALL_SPU(poll) |
174 | COMPAT_SYS(nfsservctl) | 174 | SYSCALL(ni_syscall) |
175 | SYSCALL_SPU(setresgid) | 175 | SYSCALL_SPU(setresgid) |
176 | SYSCALL_SPU(getresgid) | 176 | SYSCALL_SPU(getresgid) |
177 | COMPAT_SYS_SPU(prctl) | 177 | COMPAT_SYS_SPU(prctl) |
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c index 2de8551df40f..c65f75aa7ff7 100644 --- a/arch/powerpc/sysdev/fsl_rio.c +++ b/arch/powerpc/sysdev/fsl_rio.c | |||
@@ -54,6 +54,7 @@ | |||
54 | #define ODSR_CLEAR 0x1c00 | 54 | #define ODSR_CLEAR 0x1c00 |
55 | #define LTLEECSR_ENABLE_ALL 0xFFC000FC | 55 | #define LTLEECSR_ENABLE_ALL 0xFFC000FC |
56 | #define ESCSR_CLEAR 0x07120204 | 56 | #define ESCSR_CLEAR 0x07120204 |
57 | #define IECSR_CLEAR 0x80000000 | ||
57 | 58 | ||
58 | #define RIO_PORT1_EDCSR 0x0640 | 59 | #define RIO_PORT1_EDCSR 0x0640 |
59 | #define RIO_PORT2_EDCSR 0x0680 | 60 | #define RIO_PORT2_EDCSR 0x0680 |
@@ -1089,11 +1090,11 @@ static void port_error_handler(struct rio_mport *port, int offset) | |||
1089 | 1090 | ||
1090 | if (offset == 0) { | 1091 | if (offset == 0) { |
1091 | out_be32((u32 *)(rio_regs_win + RIO_PORT1_EDCSR), 0); | 1092 | out_be32((u32 *)(rio_regs_win + RIO_PORT1_EDCSR), 0); |
1092 | out_be32((u32 *)(rio_regs_win + RIO_PORT1_IECSR), 0); | 1093 | out_be32((u32 *)(rio_regs_win + RIO_PORT1_IECSR), IECSR_CLEAR); |
1093 | out_be32((u32 *)(rio_regs_win + RIO_ESCSR), ESCSR_CLEAR); | 1094 | out_be32((u32 *)(rio_regs_win + RIO_ESCSR), ESCSR_CLEAR); |
1094 | } else { | 1095 | } else { |
1095 | out_be32((u32 *)(rio_regs_win + RIO_PORT2_EDCSR), 0); | 1096 | out_be32((u32 *)(rio_regs_win + RIO_PORT2_EDCSR), 0); |
1096 | out_be32((u32 *)(rio_regs_win + RIO_PORT2_IECSR), 0); | 1097 | out_be32((u32 *)(rio_regs_win + RIO_PORT2_IECSR), IECSR_CLEAR); |
1097 | out_be32((u32 *)(rio_regs_win + RIO_PORT2_ESCSR), ESCSR_CLEAR); | 1098 | out_be32((u32 *)(rio_regs_win + RIO_PORT2_ESCSR), ESCSR_CLEAR); |
1098 | } | 1099 | } |
1099 | } | 1100 | } |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index 08ab9aa6a0d5..7526db6bf501 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -665,12 +665,6 @@ ENTRY(sys32_poll_wrapper) | |||
665 | lgfr %r4,%r4 # long | 665 | lgfr %r4,%r4 # long |
666 | jg sys_poll # branch to system call | 666 | jg sys_poll # branch to system call |
667 | 667 | ||
668 | ENTRY(compat_sys_nfsservctl_wrapper) | ||
669 | lgfr %r2,%r2 # int | ||
670 | llgtr %r3,%r3 # struct compat_nfsctl_arg* | ||
671 | llgtr %r4,%r4 # union compat_nfsctl_res* | ||
672 | jg compat_sys_nfsservctl # branch to system call | ||
673 | |||
674 | ENTRY(sys32_setresgid16_wrapper) | 668 | ENTRY(sys32_setresgid16_wrapper) |
675 | llgfr %r2,%r2 # __kernel_old_gid_emu31_t | 669 | llgfr %r2,%r2 # __kernel_old_gid_emu31_t |
676 | llgfr %r3,%r3 # __kernel_old_gid_emu31_t | 670 | llgfr %r3,%r3 # __kernel_old_gid_emu31_t |
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index 068f8465c4ee..f297456dba7a 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c | |||
@@ -396,17 +396,19 @@ static __init void detect_machine_facilities(void) | |||
396 | static __init void rescue_initrd(void) | 396 | static __init void rescue_initrd(void) |
397 | { | 397 | { |
398 | #ifdef CONFIG_BLK_DEV_INITRD | 398 | #ifdef CONFIG_BLK_DEV_INITRD |
399 | unsigned long min_initrd_addr = (unsigned long) _end + (4UL << 20); | ||
399 | /* | 400 | /* |
400 | * Move the initrd right behind the bss section in case it starts | 401 | * Just like in case of IPL from VM reader we make sure there is a |
401 | * within the bss section. So we don't overwrite it when the bss | 402 | * gap of 4MB between end of kernel and start of initrd. |
402 | * section gets cleared. | 403 | * That way we can also be sure that saving an NSS will succeed, |
404 | * which however only requires different segments. | ||
403 | */ | 405 | */ |
404 | if (!INITRD_START || !INITRD_SIZE) | 406 | if (!INITRD_START || !INITRD_SIZE) |
405 | return; | 407 | return; |
406 | if (INITRD_START >= (unsigned long) __bss_stop) | 408 | if (INITRD_START >= min_initrd_addr) |
407 | return; | 409 | return; |
408 | memmove(__bss_stop, (void *) INITRD_START, INITRD_SIZE); | 410 | memmove((void *) min_initrd_addr, (void *) INITRD_START, INITRD_SIZE); |
409 | INITRD_START = (unsigned long) __bss_stop; | 411 | INITRD_START = min_initrd_addr; |
410 | #endif | 412 | #endif |
411 | } | 413 | } |
412 | 414 | ||
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index 04361d5a4279..48c710206366 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c | |||
@@ -1220,7 +1220,7 @@ static int __init reipl_fcp_init(void) | |||
1220 | /* sysfs: create fcp kset for mixing attr group and bin attrs */ | 1220 | /* sysfs: create fcp kset for mixing attr group and bin attrs */ |
1221 | reipl_fcp_kset = kset_create_and_add(IPL_FCP_STR, NULL, | 1221 | reipl_fcp_kset = kset_create_and_add(IPL_FCP_STR, NULL, |
1222 | &reipl_kset->kobj); | 1222 | &reipl_kset->kobj); |
1223 | if (!reipl_kset) { | 1223 | if (!reipl_fcp_kset) { |
1224 | free_page((unsigned long) reipl_block_fcp); | 1224 | free_page((unsigned long) reipl_block_fcp); |
1225 | return -ENOMEM; | 1225 | return -ENOMEM; |
1226 | } | 1226 | } |
@@ -1618,7 +1618,8 @@ static struct shutdown_action vmcmd_action = {SHUTDOWN_ACTION_VMCMD_STR, | |||
1618 | 1618 | ||
1619 | static void stop_run(struct shutdown_trigger *trigger) | 1619 | static void stop_run(struct shutdown_trigger *trigger) |
1620 | { | 1620 | { |
1621 | if (strcmp(trigger->name, ON_PANIC_STR) == 0) | 1621 | if (strcmp(trigger->name, ON_PANIC_STR) == 0 || |
1622 | strcmp(trigger->name, ON_RESTART_STR) == 0) | ||
1622 | disabled_wait((unsigned long) __builtin_return_address(0)); | 1623 | disabled_wait((unsigned long) __builtin_return_address(0)); |
1623 | while (sigp(smp_processor_id(), sigp_stop) == sigp_busy) | 1624 | while (sigp(smp_processor_id(), sigp_stop) == sigp_busy) |
1624 | cpu_relax(); | 1625 | cpu_relax(); |
@@ -1717,7 +1718,7 @@ static void do_panic(void) | |||
1717 | /* on restart */ | 1718 | /* on restart */ |
1718 | 1719 | ||
1719 | static struct shutdown_trigger on_restart_trigger = {ON_RESTART_STR, | 1720 | static struct shutdown_trigger on_restart_trigger = {ON_RESTART_STR, |
1720 | &reipl_action}; | 1721 | &stop_action}; |
1721 | 1722 | ||
1722 | static ssize_t on_restart_show(struct kobject *kobj, | 1723 | static ssize_t on_restart_show(struct kobject *kobj, |
1723 | struct kobj_attribute *attr, char *page) | 1724 | struct kobj_attribute *attr, char *page) |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 6ee39ef8fe4a..73eb08c874fb 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -177,7 +177,7 @@ SYSCALL(sys_getresuid16,sys_ni_syscall,sys32_getresuid16_wrapper) /* 165 old get | |||
177 | NI_SYSCALL /* for vm86 */ | 177 | NI_SYSCALL /* for vm86 */ |
178 | NI_SYSCALL /* old sys_query_module */ | 178 | NI_SYSCALL /* old sys_query_module */ |
179 | SYSCALL(sys_poll,sys_poll,sys32_poll_wrapper) | 179 | SYSCALL(sys_poll,sys_poll,sys32_poll_wrapper) |
180 | SYSCALL(sys_nfsservctl,sys_nfsservctl,compat_sys_nfsservctl_wrapper) | 180 | NI_SYSCALL /* old nfsservctl */ |
181 | SYSCALL(sys_setresgid16,sys_ni_syscall,sys32_setresgid16_wrapper) /* 170 old setresgid16 syscall */ | 181 | SYSCALL(sys_setresgid16,sys_ni_syscall,sys32_setresgid16_wrapper) /* 170 old setresgid16 syscall */ |
182 | SYSCALL(sys_getresgid16,sys_ni_syscall,sys32_getresgid16_wrapper) /* old getresgid16 syscall */ | 182 | SYSCALL(sys_getresgid16,sys_ni_syscall,sys32_getresgid16_wrapper) /* old getresgid16 syscall */ |
183 | SYSCALL(sys_prctl,sys_prctl,sys32_prctl_wrapper) | 183 | SYSCALL(sys_prctl,sys_prctl,sys32_prctl_wrapper) |
diff --git a/arch/sh/include/asm/ptrace.h b/arch/sh/include/asm/ptrace.h index b97baf81a87b..2d3679b2447f 100644 --- a/arch/sh/include/asm/ptrace.h +++ b/arch/sh/include/asm/ptrace.h | |||
@@ -123,7 +123,7 @@ static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, | |||
123 | struct perf_event; | 123 | struct perf_event; |
124 | struct perf_sample_data; | 124 | struct perf_sample_data; |
125 | 125 | ||
126 | extern void ptrace_triggered(struct perf_event *bp, int nmi, | 126 | extern void ptrace_triggered(struct perf_event *bp, |
127 | struct perf_sample_data *data, struct pt_regs *regs); | 127 | struct perf_sample_data *data, struct pt_regs *regs); |
128 | 128 | ||
129 | #define task_pt_regs(task) \ | 129 | #define task_pt_regs(task) \ |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c index e915deafac89..05559295d2ca 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/serial_sci.h> | 15 | #include <linux/serial_sci.h> |
16 | #include <linux/io.h> | 16 | #include <linux/io.h> |
17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
18 | #include <linux/dma-mapping.h> | ||
18 | #include <linux/sh_timer.h> | 19 | #include <linux/sh_timer.h> |
19 | #include <linux/sh_dma.h> | 20 | #include <linux/sh_dma.h> |
20 | 21 | ||
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c index 32114e0941ae..db4ecd731a00 100644 --- a/arch/sh/kernel/idle.c +++ b/arch/sh/kernel/idle.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/atomic.h> | 22 | #include <linux/atomic.h> |
23 | #include <asm/smp.h> | 23 | #include <asm/smp.h> |
24 | 24 | ||
25 | static void (*pm_idle)(void); | 25 | void (*pm_idle)(void); |
26 | 26 | ||
27 | static int hlt_counter; | 27 | static int hlt_counter; |
28 | 28 | ||
diff --git a/arch/sh/kernel/syscalls_32.S b/arch/sh/kernel/syscalls_32.S index 39b051de4c7c..293e39c59c00 100644 --- a/arch/sh/kernel/syscalls_32.S +++ b/arch/sh/kernel/syscalls_32.S | |||
@@ -185,7 +185,7 @@ ENTRY(sys_call_table) | |||
185 | .long sys_ni_syscall /* vm86 */ | 185 | .long sys_ni_syscall /* vm86 */ |
186 | .long sys_ni_syscall /* old "query_module" */ | 186 | .long sys_ni_syscall /* old "query_module" */ |
187 | .long sys_poll | 187 | .long sys_poll |
188 | .long sys_nfsservctl | 188 | .long sys_ni_syscall /* was nfsservctl */ |
189 | .long sys_setresgid16 /* 170 */ | 189 | .long sys_setresgid16 /* 170 */ |
190 | .long sys_getresgid16 | 190 | .long sys_getresgid16 |
191 | .long sys_prctl | 191 | .long sys_prctl |
diff --git a/arch/sh/kernel/syscalls_64.S b/arch/sh/kernel/syscalls_64.S index 089c4d825d08..ceb34b94afa9 100644 --- a/arch/sh/kernel/syscalls_64.S +++ b/arch/sh/kernel/syscalls_64.S | |||
@@ -189,7 +189,7 @@ sys_call_table: | |||
189 | .long sys_ni_syscall /* vm86 */ | 189 | .long sys_ni_syscall /* vm86 */ |
190 | .long sys_ni_syscall /* old "query_module" */ | 190 | .long sys_ni_syscall /* old "query_module" */ |
191 | .long sys_poll | 191 | .long sys_poll |
192 | .long sys_nfsservctl | 192 | .long sys_ni_syscall /* was nfsservctl */ |
193 | .long sys_setresgid16 /* 170 */ | 193 | .long sys_setresgid16 /* 170 */ |
194 | .long sys_getresgid16 | 194 | .long sys_getresgid16 |
195 | .long sys_prctl | 195 | .long sys_prctl |
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c index d9006f8ffc14..7bbef95c9d1b 100644 --- a/arch/sh/kernel/traps_32.c +++ b/arch/sh/kernel/traps_32.c | |||
@@ -316,6 +316,35 @@ static int handle_unaligned_ins(insn_size_t instruction, struct pt_regs *regs, | |||
316 | break; | 316 | break; |
317 | } | 317 | } |
318 | break; | 318 | break; |
319 | |||
320 | case 9: /* mov.w @(disp,PC),Rn */ | ||
321 | srcu = (unsigned char __user *)regs->pc; | ||
322 | srcu += 4; | ||
323 | srcu += (instruction & 0x00FF) << 1; | ||
324 | dst = (unsigned char *)rn; | ||
325 | *(unsigned long *)dst = 0; | ||
326 | |||
327 | #if !defined(__LITTLE_ENDIAN__) | ||
328 | dst += 2; | ||
329 | #endif | ||
330 | |||
331 | if (ma->from(dst, srcu, 2)) | ||
332 | goto fetch_fault; | ||
333 | sign_extend(2, dst); | ||
334 | ret = 0; | ||
335 | break; | ||
336 | |||
337 | case 0xd: /* mov.l @(disp,PC),Rn */ | ||
338 | srcu = (unsigned char __user *)(regs->pc & ~0x3); | ||
339 | srcu += 4; | ||
340 | srcu += (instruction & 0x00FF) << 2; | ||
341 | dst = (unsigned char *)rn; | ||
342 | *(unsigned long *)dst = 0; | ||
343 | |||
344 | if (ma->from(dst, srcu, 4)) | ||
345 | goto fetch_fault; | ||
346 | ret = 0; | ||
347 | break; | ||
319 | } | 348 | } |
320 | return ret; | 349 | return ret; |
321 | 350 | ||
@@ -466,6 +495,7 @@ int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, | |||
466 | case 0x0500: /* mov.w @(disp,Rm),R0 */ | 495 | case 0x0500: /* mov.w @(disp,Rm),R0 */ |
467 | goto simple; | 496 | goto simple; |
468 | case 0x0B00: /* bf lab - no delayslot*/ | 497 | case 0x0B00: /* bf lab - no delayslot*/ |
498 | ret = 0; | ||
469 | break; | 499 | break; |
470 | case 0x0F00: /* bf/s lab */ | 500 | case 0x0F00: /* bf/s lab */ |
471 | ret = handle_delayslot(regs, instruction, ma); | 501 | ret = handle_delayslot(regs, instruction, ma); |
@@ -479,6 +509,7 @@ int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, | |||
479 | } | 509 | } |
480 | break; | 510 | break; |
481 | case 0x0900: /* bt lab - no delayslot */ | 511 | case 0x0900: /* bt lab - no delayslot */ |
512 | ret = 0; | ||
482 | break; | 513 | break; |
483 | case 0x0D00: /* bt/s lab */ | 514 | case 0x0D00: /* bt/s lab */ |
484 | ret = handle_delayslot(regs, instruction, ma); | 515 | ret = handle_delayslot(regs, instruction, ma); |
@@ -494,6 +525,9 @@ int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, | |||
494 | } | 525 | } |
495 | break; | 526 | break; |
496 | 527 | ||
528 | case 0x9000: /* mov.w @(disp,Rm),Rn */ | ||
529 | goto simple; | ||
530 | |||
497 | case 0xA000: /* bra label */ | 531 | case 0xA000: /* bra label */ |
498 | ret = handle_delayslot(regs, instruction, ma); | 532 | ret = handle_delayslot(regs, instruction, ma); |
499 | if (ret==0) | 533 | if (ret==0) |
@@ -507,6 +541,9 @@ int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, | |||
507 | regs->pc += SH_PC_12BIT_OFFSET(instruction); | 541 | regs->pc += SH_PC_12BIT_OFFSET(instruction); |
508 | } | 542 | } |
509 | break; | 543 | break; |
544 | |||
545 | case 0xD000: /* mov.l @(disp,Rm),Rn */ | ||
546 | goto simple; | ||
510 | } | 547 | } |
511 | return ret; | 548 | return ret; |
512 | 549 | ||
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 42c67beadcae..1a6f20d4e7e6 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -55,6 +55,7 @@ config SPARC64 | |||
55 | select PERF_USE_VMALLOC | 55 | select PERF_USE_VMALLOC |
56 | select IRQ_PREFLOW_FASTEOI | 56 | select IRQ_PREFLOW_FASTEOI |
57 | select ARCH_HAVE_NMI_SAFE_CMPXCHG | 57 | select ARCH_HAVE_NMI_SAFE_CMPXCHG |
58 | select HAVE_C_RECORDMCOUNT | ||
58 | 59 | ||
59 | config ARCH_DEFCONFIG | 60 | config ARCH_DEFCONFIG |
60 | string | 61 | string |
diff --git a/arch/sparc/include/asm/sigcontext.h b/arch/sparc/include/asm/sigcontext.h index a1607d180354..69914d748130 100644 --- a/arch/sparc/include/asm/sigcontext.h +++ b/arch/sparc/include/asm/sigcontext.h | |||
@@ -45,6 +45,19 @@ typedef struct { | |||
45 | int si_mask; | 45 | int si_mask; |
46 | } __siginfo32_t; | 46 | } __siginfo32_t; |
47 | 47 | ||
48 | #define __SIGC_MAXWIN 7 | ||
49 | |||
50 | typedef struct { | ||
51 | unsigned long locals[8]; | ||
52 | unsigned long ins[8]; | ||
53 | } __siginfo_reg_window; | ||
54 | |||
55 | typedef struct { | ||
56 | int wsaved; | ||
57 | __siginfo_reg_window reg_window[__SIGC_MAXWIN]; | ||
58 | unsigned long rwbuf_stkptrs[__SIGC_MAXWIN]; | ||
59 | } __siginfo_rwin_t; | ||
60 | |||
48 | #ifdef CONFIG_SPARC64 | 61 | #ifdef CONFIG_SPARC64 |
49 | typedef struct { | 62 | typedef struct { |
50 | unsigned int si_float_regs [64]; | 63 | unsigned int si_float_regs [64]; |
@@ -73,6 +86,7 @@ struct sigcontext { | |||
73 | unsigned long ss_size; | 86 | unsigned long ss_size; |
74 | } sigc_stack; | 87 | } sigc_stack; |
75 | unsigned long sigc_mask; | 88 | unsigned long sigc_mask; |
89 | __siginfo_rwin_t * sigc_rwin_save; | ||
76 | }; | 90 | }; |
77 | 91 | ||
78 | #else | 92 | #else |
diff --git a/arch/sparc/include/asm/spinlock_32.h b/arch/sparc/include/asm/spinlock_32.h index 5f5b8bf3f50d..bcc98fc35281 100644 --- a/arch/sparc/include/asm/spinlock_32.h +++ b/arch/sparc/include/asm/spinlock_32.h | |||
@@ -131,6 +131,15 @@ static inline void arch_write_lock(arch_rwlock_t *rw) | |||
131 | *(volatile __u32 *)&lp->lock = ~0U; | 131 | *(volatile __u32 *)&lp->lock = ~0U; |
132 | } | 132 | } |
133 | 133 | ||
134 | static void inline arch_write_unlock(arch_rwlock_t *lock) | ||
135 | { | ||
136 | __asm__ __volatile__( | ||
137 | " st %%g0, [%0]" | ||
138 | : /* no outputs */ | ||
139 | : "r" (lock) | ||
140 | : "memory"); | ||
141 | } | ||
142 | |||
134 | static inline int arch_write_trylock(arch_rwlock_t *rw) | 143 | static inline int arch_write_trylock(arch_rwlock_t *rw) |
135 | { | 144 | { |
136 | unsigned int val; | 145 | unsigned int val; |
@@ -175,8 +184,6 @@ static inline int __arch_read_trylock(arch_rwlock_t *rw) | |||
175 | res; \ | 184 | res; \ |
176 | }) | 185 | }) |
177 | 186 | ||
178 | #define arch_write_unlock(rw) do { (rw)->lock = 0; } while(0) | ||
179 | |||
180 | #define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock) | 187 | #define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock) |
181 | #define arch_read_lock_flags(rw, flags) arch_read_lock(rw) | 188 | #define arch_read_lock_flags(rw, flags) arch_read_lock(rw) |
182 | #define arch_write_lock_flags(rw, flags) arch_write_lock(rw) | 189 | #define arch_write_lock_flags(rw, flags) arch_write_lock(rw) |
diff --git a/arch/sparc/include/asm/spinlock_64.h b/arch/sparc/include/asm/spinlock_64.h index 073936a8b275..968917694978 100644 --- a/arch/sparc/include/asm/spinlock_64.h +++ b/arch/sparc/include/asm/spinlock_64.h | |||
@@ -210,14 +210,8 @@ static int inline arch_write_trylock(arch_rwlock_t *lock) | |||
210 | return result; | 210 | return result; |
211 | } | 211 | } |
212 | 212 | ||
213 | #define arch_read_lock(p) arch_read_lock(p) | ||
214 | #define arch_read_lock_flags(p, f) arch_read_lock(p) | 213 | #define arch_read_lock_flags(p, f) arch_read_lock(p) |
215 | #define arch_read_trylock(p) arch_read_trylock(p) | ||
216 | #define arch_read_unlock(p) arch_read_unlock(p) | ||
217 | #define arch_write_lock(p) arch_write_lock(p) | ||
218 | #define arch_write_lock_flags(p, f) arch_write_lock(p) | 214 | #define arch_write_lock_flags(p, f) arch_write_lock(p) |
219 | #define arch_write_unlock(p) arch_write_unlock(p) | ||
220 | #define arch_write_trylock(p) arch_write_trylock(p) | ||
221 | 215 | ||
222 | #define arch_read_can_lock(rw) (!((rw)->lock & 0x80000000UL)) | 216 | #define arch_read_can_lock(rw) (!((rw)->lock & 0x80000000UL)) |
223 | #define arch_write_can_lock(rw) (!(rw)->lock) | 217 | #define arch_write_can_lock(rw) (!(rw)->lock) |
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile index b90b4a1d070a..cb85458f89d2 100644 --- a/arch/sparc/kernel/Makefile +++ b/arch/sparc/kernel/Makefile | |||
@@ -32,6 +32,7 @@ obj-$(CONFIG_SPARC32) += sun4m_irq.o sun4c_irq.o sun4d_irq.o | |||
32 | 32 | ||
33 | obj-y += process_$(BITS).o | 33 | obj-y += process_$(BITS).o |
34 | obj-y += signal_$(BITS).o | 34 | obj-y += signal_$(BITS).o |
35 | obj-y += sigutil_$(BITS).o | ||
35 | obj-$(CONFIG_SPARC32) += ioport.o | 36 | obj-$(CONFIG_SPARC32) += ioport.o |
36 | obj-y += setup_$(BITS).o | 37 | obj-y += setup_$(BITS).o |
37 | obj-y += idprom.o | 38 | obj-y += idprom.o |
diff --git a/arch/sparc/kernel/irq.h b/arch/sparc/kernel/irq.h index 100b9c204e78..42851122bbd9 100644 --- a/arch/sparc/kernel/irq.h +++ b/arch/sparc/kernel/irq.h | |||
@@ -88,7 +88,7 @@ BTFIXUPDEF_CALL(void, set_irq_udt, int) | |||
88 | #define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu) | 88 | #define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu) |
89 | 89 | ||
90 | /* All SUN4D IPIs are sent on this IRQ, may be shared with hard IRQs */ | 90 | /* All SUN4D IPIs are sent on this IRQ, may be shared with hard IRQs */ |
91 | #define SUN4D_IPI_IRQ 14 | 91 | #define SUN4D_IPI_IRQ 13 |
92 | 92 | ||
93 | extern void sun4d_ipi_interrupt(void); | 93 | extern void sun4d_ipi_interrupt(void); |
94 | 94 | ||
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index a19f04195478..1aaf8c180be5 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c | |||
@@ -352,8 +352,8 @@ int __init pcic_probe(void) | |||
352 | strcpy(pbm->prom_name, namebuf); | 352 | strcpy(pbm->prom_name, namebuf); |
353 | 353 | ||
354 | { | 354 | { |
355 | extern volatile int t_nmi[1]; | 355 | extern volatile int t_nmi[4]; |
356 | extern int pcic_nmi_trap_patch[1]; | 356 | extern int pcic_nmi_trap_patch[4]; |
357 | 357 | ||
358 | t_nmi[0] = pcic_nmi_trap_patch[0]; | 358 | t_nmi[0] = pcic_nmi_trap_patch[0]; |
359 | t_nmi[1] = pcic_nmi_trap_patch[1]; | 359 | t_nmi[1] = pcic_nmi_trap_patch[1]; |
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c index 3e9daea1653d..3c5bb784214f 100644 --- a/arch/sparc/kernel/setup_64.c +++ b/arch/sparc/kernel/setup_64.c | |||
@@ -440,8 +440,14 @@ static void __init init_sparc64_elf_hwcap(void) | |||
440 | cap |= AV_SPARC_VIS; | 440 | cap |= AV_SPARC_VIS; |
441 | if (tlb_type == cheetah || tlb_type == cheetah_plus) | 441 | if (tlb_type == cheetah || tlb_type == cheetah_plus) |
442 | cap |= AV_SPARC_VIS | AV_SPARC_VIS2; | 442 | cap |= AV_SPARC_VIS | AV_SPARC_VIS2; |
443 | if (tlb_type == cheetah_plus) | 443 | if (tlb_type == cheetah_plus) { |
444 | cap |= AV_SPARC_POPC; | 444 | unsigned long impl, ver; |
445 | |||
446 | __asm__ __volatile__("rdpr %%ver, %0" : "=r" (ver)); | ||
447 | impl = ((ver >> 32) & 0xffff); | ||
448 | if (impl == PANTHER_IMPL) | ||
449 | cap |= AV_SPARC_POPC; | ||
450 | } | ||
445 | if (tlb_type == hypervisor) { | 451 | if (tlb_type == hypervisor) { |
446 | if (sun4v_chip_type == SUN4V_CHIP_NIAGARA1) | 452 | if (sun4v_chip_type == SUN4V_CHIP_NIAGARA1) |
447 | cap |= AV_SPARC_ASI_BLK_INIT; | 453 | cap |= AV_SPARC_ASI_BLK_INIT; |
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c index 75fad425e249..1ba95aff5d59 100644 --- a/arch/sparc/kernel/signal32.c +++ b/arch/sparc/kernel/signal32.c | |||
@@ -29,6 +29,8 @@ | |||
29 | #include <asm/visasm.h> | 29 | #include <asm/visasm.h> |
30 | #include <asm/compat_signal.h> | 30 | #include <asm/compat_signal.h> |
31 | 31 | ||
32 | #include "sigutil.h" | ||
33 | |||
32 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | 34 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) |
33 | 35 | ||
34 | /* This magic should be in g_upper[0] for all upper parts | 36 | /* This magic should be in g_upper[0] for all upper parts |
@@ -44,14 +46,14 @@ typedef struct { | |||
44 | struct signal_frame32 { | 46 | struct signal_frame32 { |
45 | struct sparc_stackf32 ss; | 47 | struct sparc_stackf32 ss; |
46 | __siginfo32_t info; | 48 | __siginfo32_t info; |
47 | /* __siginfo_fpu32_t * */ u32 fpu_save; | 49 | /* __siginfo_fpu_t * */ u32 fpu_save; |
48 | unsigned int insns[2]; | 50 | unsigned int insns[2]; |
49 | unsigned int extramask[_COMPAT_NSIG_WORDS - 1]; | 51 | unsigned int extramask[_COMPAT_NSIG_WORDS - 1]; |
50 | unsigned int extra_size; /* Should be sizeof(siginfo_extra_v8plus_t) */ | 52 | unsigned int extra_size; /* Should be sizeof(siginfo_extra_v8plus_t) */ |
51 | /* Only valid if (info.si_regs.psr & (PSR_VERS|PSR_IMPL)) == PSR_V8PLUS */ | 53 | /* Only valid if (info.si_regs.psr & (PSR_VERS|PSR_IMPL)) == PSR_V8PLUS */ |
52 | siginfo_extra_v8plus_t v8plus; | 54 | siginfo_extra_v8plus_t v8plus; |
53 | __siginfo_fpu_t fpu_state; | 55 | /* __siginfo_rwin_t * */u32 rwin_save; |
54 | }; | 56 | } __attribute__((aligned(8))); |
55 | 57 | ||
56 | typedef struct compat_siginfo{ | 58 | typedef struct compat_siginfo{ |
57 | int si_signo; | 59 | int si_signo; |
@@ -110,18 +112,14 @@ struct rt_signal_frame32 { | |||
110 | compat_siginfo_t info; | 112 | compat_siginfo_t info; |
111 | struct pt_regs32 regs; | 113 | struct pt_regs32 regs; |
112 | compat_sigset_t mask; | 114 | compat_sigset_t mask; |
113 | /* __siginfo_fpu32_t * */ u32 fpu_save; | 115 | /* __siginfo_fpu_t * */ u32 fpu_save; |
114 | unsigned int insns[2]; | 116 | unsigned int insns[2]; |
115 | stack_t32 stack; | 117 | stack_t32 stack; |
116 | unsigned int extra_size; /* Should be sizeof(siginfo_extra_v8plus_t) */ | 118 | unsigned int extra_size; /* Should be sizeof(siginfo_extra_v8plus_t) */ |
117 | /* Only valid if (regs.psr & (PSR_VERS|PSR_IMPL)) == PSR_V8PLUS */ | 119 | /* Only valid if (regs.psr & (PSR_VERS|PSR_IMPL)) == PSR_V8PLUS */ |
118 | siginfo_extra_v8plus_t v8plus; | 120 | siginfo_extra_v8plus_t v8plus; |
119 | __siginfo_fpu_t fpu_state; | 121 | /* __siginfo_rwin_t * */u32 rwin_save; |
120 | }; | 122 | } __attribute__((aligned(8))); |
121 | |||
122 | /* Align macros */ | ||
123 | #define SF_ALIGNEDSZ (((sizeof(struct signal_frame32) + 15) & (~15))) | ||
124 | #define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 15) & (~15))) | ||
125 | 123 | ||
126 | int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) | 124 | int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) |
127 | { | 125 | { |
@@ -192,30 +190,13 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) | |||
192 | return 0; | 190 | return 0; |
193 | } | 191 | } |
194 | 192 | ||
195 | static int restore_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | ||
196 | { | ||
197 | unsigned long *fpregs = current_thread_info()->fpregs; | ||
198 | unsigned long fprs; | ||
199 | int err; | ||
200 | |||
201 | err = __get_user(fprs, &fpu->si_fprs); | ||
202 | fprs_write(0); | ||
203 | regs->tstate &= ~TSTATE_PEF; | ||
204 | if (fprs & FPRS_DL) | ||
205 | err |= copy_from_user(fpregs, &fpu->si_float_regs[0], (sizeof(unsigned int) * 32)); | ||
206 | if (fprs & FPRS_DU) | ||
207 | err |= copy_from_user(fpregs+16, &fpu->si_float_regs[32], (sizeof(unsigned int) * 32)); | ||
208 | err |= __get_user(current_thread_info()->xfsr[0], &fpu->si_fsr); | ||
209 | err |= __get_user(current_thread_info()->gsr[0], &fpu->si_gsr); | ||
210 | current_thread_info()->fpsaved[0] |= fprs; | ||
211 | return err; | ||
212 | } | ||
213 | |||
214 | void do_sigreturn32(struct pt_regs *regs) | 193 | void do_sigreturn32(struct pt_regs *regs) |
215 | { | 194 | { |
216 | struct signal_frame32 __user *sf; | 195 | struct signal_frame32 __user *sf; |
196 | compat_uptr_t fpu_save; | ||
197 | compat_uptr_t rwin_save; | ||
217 | unsigned int psr; | 198 | unsigned int psr; |
218 | unsigned pc, npc, fpu_save; | 199 | unsigned pc, npc; |
219 | sigset_t set; | 200 | sigset_t set; |
220 | unsigned seta[_COMPAT_NSIG_WORDS]; | 201 | unsigned seta[_COMPAT_NSIG_WORDS]; |
221 | int err, i; | 202 | int err, i; |
@@ -273,8 +254,13 @@ void do_sigreturn32(struct pt_regs *regs) | |||
273 | pt_regs_clear_syscall(regs); | 254 | pt_regs_clear_syscall(regs); |
274 | 255 | ||
275 | err |= __get_user(fpu_save, &sf->fpu_save); | 256 | err |= __get_user(fpu_save, &sf->fpu_save); |
276 | if (fpu_save) | 257 | if (!err && fpu_save) |
277 | err |= restore_fpu_state32(regs, &sf->fpu_state); | 258 | err |= restore_fpu_state(regs, compat_ptr(fpu_save)); |
259 | err |= __get_user(rwin_save, &sf->rwin_save); | ||
260 | if (!err && rwin_save) { | ||
261 | if (restore_rwin_state(compat_ptr(rwin_save))) | ||
262 | goto segv; | ||
263 | } | ||
278 | err |= __get_user(seta[0], &sf->info.si_mask); | 264 | err |= __get_user(seta[0], &sf->info.si_mask); |
279 | err |= copy_from_user(seta+1, &sf->extramask, | 265 | err |= copy_from_user(seta+1, &sf->extramask, |
280 | (_COMPAT_NSIG_WORDS - 1) * sizeof(unsigned int)); | 266 | (_COMPAT_NSIG_WORDS - 1) * sizeof(unsigned int)); |
@@ -300,7 +286,9 @@ segv: | |||
300 | asmlinkage void do_rt_sigreturn32(struct pt_regs *regs) | 286 | asmlinkage void do_rt_sigreturn32(struct pt_regs *regs) |
301 | { | 287 | { |
302 | struct rt_signal_frame32 __user *sf; | 288 | struct rt_signal_frame32 __user *sf; |
303 | unsigned int psr, pc, npc, fpu_save, u_ss_sp; | 289 | unsigned int psr, pc, npc, u_ss_sp; |
290 | compat_uptr_t fpu_save; | ||
291 | compat_uptr_t rwin_save; | ||
304 | mm_segment_t old_fs; | 292 | mm_segment_t old_fs; |
305 | sigset_t set; | 293 | sigset_t set; |
306 | compat_sigset_t seta; | 294 | compat_sigset_t seta; |
@@ -359,8 +347,8 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs) | |||
359 | pt_regs_clear_syscall(regs); | 347 | pt_regs_clear_syscall(regs); |
360 | 348 | ||
361 | err |= __get_user(fpu_save, &sf->fpu_save); | 349 | err |= __get_user(fpu_save, &sf->fpu_save); |
362 | if (fpu_save) | 350 | if (!err && fpu_save) |
363 | err |= restore_fpu_state32(regs, &sf->fpu_state); | 351 | err |= restore_fpu_state(regs, compat_ptr(fpu_save)); |
364 | err |= copy_from_user(&seta, &sf->mask, sizeof(compat_sigset_t)); | 352 | err |= copy_from_user(&seta, &sf->mask, sizeof(compat_sigset_t)); |
365 | err |= __get_user(u_ss_sp, &sf->stack.ss_sp); | 353 | err |= __get_user(u_ss_sp, &sf->stack.ss_sp); |
366 | st.ss_sp = compat_ptr(u_ss_sp); | 354 | st.ss_sp = compat_ptr(u_ss_sp); |
@@ -376,6 +364,12 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs) | |||
376 | do_sigaltstack((stack_t __user *) &st, NULL, (unsigned long)sf); | 364 | do_sigaltstack((stack_t __user *) &st, NULL, (unsigned long)sf); |
377 | set_fs(old_fs); | 365 | set_fs(old_fs); |
378 | 366 | ||
367 | err |= __get_user(rwin_save, &sf->rwin_save); | ||
368 | if (!err && rwin_save) { | ||
369 | if (restore_rwin_state(compat_ptr(rwin_save))) | ||
370 | goto segv; | ||
371 | } | ||
372 | |||
379 | switch (_NSIG_WORDS) { | 373 | switch (_NSIG_WORDS) { |
380 | case 4: set.sig[3] = seta.sig[6] + (((long)seta.sig[7]) << 32); | 374 | case 4: set.sig[3] = seta.sig[6] + (((long)seta.sig[7]) << 32); |
381 | case 3: set.sig[2] = seta.sig[4] + (((long)seta.sig[5]) << 32); | 375 | case 3: set.sig[2] = seta.sig[4] + (((long)seta.sig[5]) << 32); |
@@ -433,26 +427,6 @@ static void __user *get_sigframe(struct sigaction *sa, struct pt_regs *regs, uns | |||
433 | return (void __user *) sp; | 427 | return (void __user *) sp; |
434 | } | 428 | } |
435 | 429 | ||
436 | static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | ||
437 | { | ||
438 | unsigned long *fpregs = current_thread_info()->fpregs; | ||
439 | unsigned long fprs; | ||
440 | int err = 0; | ||
441 | |||
442 | fprs = current_thread_info()->fpsaved[0]; | ||
443 | if (fprs & FPRS_DL) | ||
444 | err |= copy_to_user(&fpu->si_float_regs[0], fpregs, | ||
445 | (sizeof(unsigned int) * 32)); | ||
446 | if (fprs & FPRS_DU) | ||
447 | err |= copy_to_user(&fpu->si_float_regs[32], fpregs+16, | ||
448 | (sizeof(unsigned int) * 32)); | ||
449 | err |= __put_user(current_thread_info()->xfsr[0], &fpu->si_fsr); | ||
450 | err |= __put_user(current_thread_info()->gsr[0], &fpu->si_gsr); | ||
451 | err |= __put_user(fprs, &fpu->si_fprs); | ||
452 | |||
453 | return err; | ||
454 | } | ||
455 | |||
456 | /* The I-cache flush instruction only works in the primary ASI, which | 430 | /* The I-cache flush instruction only works in the primary ASI, which |
457 | * right now is the nucleus, aka. kernel space. | 431 | * right now is the nucleus, aka. kernel space. |
458 | * | 432 | * |
@@ -515,18 +489,23 @@ static int setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
515 | int signo, sigset_t *oldset) | 489 | int signo, sigset_t *oldset) |
516 | { | 490 | { |
517 | struct signal_frame32 __user *sf; | 491 | struct signal_frame32 __user *sf; |
492 | int i, err, wsaved; | ||
493 | void __user *tail; | ||
518 | int sigframe_size; | 494 | int sigframe_size; |
519 | u32 psr; | 495 | u32 psr; |
520 | int i, err; | ||
521 | unsigned int seta[_COMPAT_NSIG_WORDS]; | 496 | unsigned int seta[_COMPAT_NSIG_WORDS]; |
522 | 497 | ||
523 | /* 1. Make sure everything is clean */ | 498 | /* 1. Make sure everything is clean */ |
524 | synchronize_user_stack(); | 499 | synchronize_user_stack(); |
525 | save_and_clear_fpu(); | 500 | save_and_clear_fpu(); |
526 | 501 | ||
527 | sigframe_size = SF_ALIGNEDSZ; | 502 | wsaved = get_thread_wsaved(); |
528 | if (!(current_thread_info()->fpsaved[0] & FPRS_FEF)) | 503 | |
529 | sigframe_size -= sizeof(__siginfo_fpu_t); | 504 | sigframe_size = sizeof(*sf); |
505 | if (current_thread_info()->fpsaved[0] & FPRS_FEF) | ||
506 | sigframe_size += sizeof(__siginfo_fpu_t); | ||
507 | if (wsaved) | ||
508 | sigframe_size += sizeof(__siginfo_rwin_t); | ||
530 | 509 | ||
531 | sf = (struct signal_frame32 __user *) | 510 | sf = (struct signal_frame32 __user *) |
532 | get_sigframe(&ka->sa, regs, sigframe_size); | 511 | get_sigframe(&ka->sa, regs, sigframe_size); |
@@ -534,8 +513,7 @@ static int setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
534 | if (invalid_frame_pointer(sf, sigframe_size)) | 513 | if (invalid_frame_pointer(sf, sigframe_size)) |
535 | goto sigill; | 514 | goto sigill; |
536 | 515 | ||
537 | if (get_thread_wsaved() != 0) | 516 | tail = (sf + 1); |
538 | goto sigill; | ||
539 | 517 | ||
540 | /* 2. Save the current process state */ | 518 | /* 2. Save the current process state */ |
541 | if (test_thread_flag(TIF_32BIT)) { | 519 | if (test_thread_flag(TIF_32BIT)) { |
@@ -560,11 +538,22 @@ static int setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
560 | &sf->v8plus.asi); | 538 | &sf->v8plus.asi); |
561 | 539 | ||
562 | if (psr & PSR_EF) { | 540 | if (psr & PSR_EF) { |
563 | err |= save_fpu_state32(regs, &sf->fpu_state); | 541 | __siginfo_fpu_t __user *fp = tail; |
564 | err |= __put_user((u64)&sf->fpu_state, &sf->fpu_save); | 542 | tail += sizeof(*fp); |
543 | err |= save_fpu_state(regs, fp); | ||
544 | err |= __put_user((u64)fp, &sf->fpu_save); | ||
565 | } else { | 545 | } else { |
566 | err |= __put_user(0, &sf->fpu_save); | 546 | err |= __put_user(0, &sf->fpu_save); |
567 | } | 547 | } |
548 | if (wsaved) { | ||
549 | __siginfo_rwin_t __user *rwp = tail; | ||
550 | tail += sizeof(*rwp); | ||
551 | err |= save_rwin_state(wsaved, rwp); | ||
552 | err |= __put_user((u64)rwp, &sf->rwin_save); | ||
553 | set_thread_wsaved(0); | ||
554 | } else { | ||
555 | err |= __put_user(0, &sf->rwin_save); | ||
556 | } | ||
568 | 557 | ||
569 | switch (_NSIG_WORDS) { | 558 | switch (_NSIG_WORDS) { |
570 | case 4: seta[7] = (oldset->sig[3] >> 32); | 559 | case 4: seta[7] = (oldset->sig[3] >> 32); |
@@ -580,10 +569,21 @@ static int setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
580 | err |= __copy_to_user(sf->extramask, seta + 1, | 569 | err |= __copy_to_user(sf->extramask, seta + 1, |
581 | (_COMPAT_NSIG_WORDS - 1) * sizeof(unsigned int)); | 570 | (_COMPAT_NSIG_WORDS - 1) * sizeof(unsigned int)); |
582 | 571 | ||
583 | err |= copy_in_user((u32 __user *)sf, | 572 | if (!wsaved) { |
584 | (u32 __user *)(regs->u_regs[UREG_FP]), | 573 | err |= copy_in_user((u32 __user *)sf, |
585 | sizeof(struct reg_window32)); | 574 | (u32 __user *)(regs->u_regs[UREG_FP]), |
586 | 575 | sizeof(struct reg_window32)); | |
576 | } else { | ||
577 | struct reg_window *rp; | ||
578 | |||
579 | rp = ¤t_thread_info()->reg_window[wsaved - 1]; | ||
580 | for (i = 0; i < 8; i++) | ||
581 | err |= __put_user(rp->locals[i], &sf->ss.locals[i]); | ||
582 | for (i = 0; i < 6; i++) | ||
583 | err |= __put_user(rp->ins[i], &sf->ss.ins[i]); | ||
584 | err |= __put_user(rp->ins[6], &sf->ss.fp); | ||
585 | err |= __put_user(rp->ins[7], &sf->ss.callers_pc); | ||
586 | } | ||
587 | if (err) | 587 | if (err) |
588 | goto sigsegv; | 588 | goto sigsegv; |
589 | 589 | ||
@@ -613,7 +613,6 @@ static int setup_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
613 | err |= __put_user(0x91d02010, &sf->insns[1]); /*t 0x10*/ | 613 | err |= __put_user(0x91d02010, &sf->insns[1]); /*t 0x10*/ |
614 | if (err) | 614 | if (err) |
615 | goto sigsegv; | 615 | goto sigsegv; |
616 | |||
617 | flush_signal_insns(address); | 616 | flush_signal_insns(address); |
618 | } | 617 | } |
619 | return 0; | 618 | return 0; |
@@ -632,18 +631,23 @@ static int setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
632 | siginfo_t *info) | 631 | siginfo_t *info) |
633 | { | 632 | { |
634 | struct rt_signal_frame32 __user *sf; | 633 | struct rt_signal_frame32 __user *sf; |
634 | int i, err, wsaved; | ||
635 | void __user *tail; | ||
635 | int sigframe_size; | 636 | int sigframe_size; |
636 | u32 psr; | 637 | u32 psr; |
637 | int i, err; | ||
638 | compat_sigset_t seta; | 638 | compat_sigset_t seta; |
639 | 639 | ||
640 | /* 1. Make sure everything is clean */ | 640 | /* 1. Make sure everything is clean */ |
641 | synchronize_user_stack(); | 641 | synchronize_user_stack(); |
642 | save_and_clear_fpu(); | 642 | save_and_clear_fpu(); |
643 | 643 | ||
644 | sigframe_size = RT_ALIGNEDSZ; | 644 | wsaved = get_thread_wsaved(); |
645 | if (!(current_thread_info()->fpsaved[0] & FPRS_FEF)) | 645 | |
646 | sigframe_size -= sizeof(__siginfo_fpu_t); | 646 | sigframe_size = sizeof(*sf); |
647 | if (current_thread_info()->fpsaved[0] & FPRS_FEF) | ||
648 | sigframe_size += sizeof(__siginfo_fpu_t); | ||
649 | if (wsaved) | ||
650 | sigframe_size += sizeof(__siginfo_rwin_t); | ||
647 | 651 | ||
648 | sf = (struct rt_signal_frame32 __user *) | 652 | sf = (struct rt_signal_frame32 __user *) |
649 | get_sigframe(&ka->sa, regs, sigframe_size); | 653 | get_sigframe(&ka->sa, regs, sigframe_size); |
@@ -651,8 +655,7 @@ static int setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
651 | if (invalid_frame_pointer(sf, sigframe_size)) | 655 | if (invalid_frame_pointer(sf, sigframe_size)) |
652 | goto sigill; | 656 | goto sigill; |
653 | 657 | ||
654 | if (get_thread_wsaved() != 0) | 658 | tail = (sf + 1); |
655 | goto sigill; | ||
656 | 659 | ||
657 | /* 2. Save the current process state */ | 660 | /* 2. Save the current process state */ |
658 | if (test_thread_flag(TIF_32BIT)) { | 661 | if (test_thread_flag(TIF_32BIT)) { |
@@ -677,11 +680,22 @@ static int setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
677 | &sf->v8plus.asi); | 680 | &sf->v8plus.asi); |
678 | 681 | ||
679 | if (psr & PSR_EF) { | 682 | if (psr & PSR_EF) { |
680 | err |= save_fpu_state32(regs, &sf->fpu_state); | 683 | __siginfo_fpu_t __user *fp = tail; |
681 | err |= __put_user((u64)&sf->fpu_state, &sf->fpu_save); | 684 | tail += sizeof(*fp); |
685 | err |= save_fpu_state(regs, fp); | ||
686 | err |= __put_user((u64)fp, &sf->fpu_save); | ||
682 | } else { | 687 | } else { |
683 | err |= __put_user(0, &sf->fpu_save); | 688 | err |= __put_user(0, &sf->fpu_save); |
684 | } | 689 | } |
690 | if (wsaved) { | ||
691 | __siginfo_rwin_t __user *rwp = tail; | ||
692 | tail += sizeof(*rwp); | ||
693 | err |= save_rwin_state(wsaved, rwp); | ||
694 | err |= __put_user((u64)rwp, &sf->rwin_save); | ||
695 | set_thread_wsaved(0); | ||
696 | } else { | ||
697 | err |= __put_user(0, &sf->rwin_save); | ||
698 | } | ||
685 | 699 | ||
686 | /* Update the siginfo structure. */ | 700 | /* Update the siginfo structure. */ |
687 | err |= copy_siginfo_to_user32(&sf->info, info); | 701 | err |= copy_siginfo_to_user32(&sf->info, info); |
@@ -703,9 +717,21 @@ static int setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs, | |||
703 | } | 717 | } |
704 | err |= __copy_to_user(&sf->mask, &seta, sizeof(compat_sigset_t)); | 718 | err |= __copy_to_user(&sf->mask, &seta, sizeof(compat_sigset_t)); |
705 | 719 | ||
706 | err |= copy_in_user((u32 __user *)sf, | 720 | if (!wsaved) { |
707 | (u32 __user *)(regs->u_regs[UREG_FP]), | 721 | err |= copy_in_user((u32 __user *)sf, |
708 | sizeof(struct reg_window32)); | 722 | (u32 __user *)(regs->u_regs[UREG_FP]), |
723 | sizeof(struct reg_window32)); | ||
724 | } else { | ||
725 | struct reg_window *rp; | ||
726 | |||
727 | rp = ¤t_thread_info()->reg_window[wsaved - 1]; | ||
728 | for (i = 0; i < 8; i++) | ||
729 | err |= __put_user(rp->locals[i], &sf->ss.locals[i]); | ||
730 | for (i = 0; i < 6; i++) | ||
731 | err |= __put_user(rp->ins[i], &sf->ss.ins[i]); | ||
732 | err |= __put_user(rp->ins[6], &sf->ss.fp); | ||
733 | err |= __put_user(rp->ins[7], &sf->ss.callers_pc); | ||
734 | } | ||
709 | if (err) | 735 | if (err) |
710 | goto sigsegv; | 736 | goto sigsegv; |
711 | 737 | ||
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c index 5e5c5fd03783..04ede8f04add 100644 --- a/arch/sparc/kernel/signal_32.c +++ b/arch/sparc/kernel/signal_32.c | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <asm/pgtable.h> | 26 | #include <asm/pgtable.h> |
27 | #include <asm/cacheflush.h> /* flush_sig_insns */ | 27 | #include <asm/cacheflush.h> /* flush_sig_insns */ |
28 | 28 | ||
29 | #include "sigutil.h" | ||
30 | |||
29 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | 31 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) |
30 | 32 | ||
31 | extern void fpsave(unsigned long *fpregs, unsigned long *fsr, | 33 | extern void fpsave(unsigned long *fpregs, unsigned long *fsr, |
@@ -39,8 +41,8 @@ struct signal_frame { | |||
39 | unsigned long insns[2] __attribute__ ((aligned (8))); | 41 | unsigned long insns[2] __attribute__ ((aligned (8))); |
40 | unsigned int extramask[_NSIG_WORDS - 1]; | 42 | unsigned int extramask[_NSIG_WORDS - 1]; |
41 | unsigned int extra_size; /* Should be 0 */ | 43 | unsigned int extra_size; /* Should be 0 */ |
42 | __siginfo_fpu_t fpu_state; | 44 | __siginfo_rwin_t __user *rwin_save; |
43 | }; | 45 | } __attribute__((aligned(8))); |
44 | 46 | ||
45 | struct rt_signal_frame { | 47 | struct rt_signal_frame { |
46 | struct sparc_stackf ss; | 48 | struct sparc_stackf ss; |
@@ -51,8 +53,8 @@ struct rt_signal_frame { | |||
51 | unsigned int insns[2]; | 53 | unsigned int insns[2]; |
52 | stack_t stack; | 54 | stack_t stack; |
53 | unsigned int extra_size; /* Should be 0 */ | 55 | unsigned int extra_size; /* Should be 0 */ |
54 | __siginfo_fpu_t fpu_state; | 56 | __siginfo_rwin_t __user *rwin_save; |
55 | }; | 57 | } __attribute__((aligned(8))); |
56 | 58 | ||
57 | /* Align macros */ | 59 | /* Align macros */ |
58 | #define SF_ALIGNEDSZ (((sizeof(struct signal_frame) + 7) & (~7))) | 60 | #define SF_ALIGNEDSZ (((sizeof(struct signal_frame) + 7) & (~7))) |
@@ -79,43 +81,13 @@ asmlinkage int sys_sigsuspend(old_sigset_t set) | |||
79 | return _sigpause_common(set); | 81 | return _sigpause_common(set); |
80 | } | 82 | } |
81 | 83 | ||
82 | static inline int | ||
83 | restore_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | ||
84 | { | ||
85 | int err; | ||
86 | #ifdef CONFIG_SMP | ||
87 | if (test_tsk_thread_flag(current, TIF_USEDFPU)) | ||
88 | regs->psr &= ~PSR_EF; | ||
89 | #else | ||
90 | if (current == last_task_used_math) { | ||
91 | last_task_used_math = NULL; | ||
92 | regs->psr &= ~PSR_EF; | ||
93 | } | ||
94 | #endif | ||
95 | set_used_math(); | ||
96 | clear_tsk_thread_flag(current, TIF_USEDFPU); | ||
97 | |||
98 | if (!access_ok(VERIFY_READ, fpu, sizeof(*fpu))) | ||
99 | return -EFAULT; | ||
100 | |||
101 | err = __copy_from_user(¤t->thread.float_regs[0], &fpu->si_float_regs[0], | ||
102 | (sizeof(unsigned long) * 32)); | ||
103 | err |= __get_user(current->thread.fsr, &fpu->si_fsr); | ||
104 | err |= __get_user(current->thread.fpqdepth, &fpu->si_fpqdepth); | ||
105 | if (current->thread.fpqdepth != 0) | ||
106 | err |= __copy_from_user(¤t->thread.fpqueue[0], | ||
107 | &fpu->si_fpqueue[0], | ||
108 | ((sizeof(unsigned long) + | ||
109 | (sizeof(unsigned long *)))*16)); | ||
110 | return err; | ||
111 | } | ||
112 | |||
113 | asmlinkage void do_sigreturn(struct pt_regs *regs) | 84 | asmlinkage void do_sigreturn(struct pt_regs *regs) |
114 | { | 85 | { |
115 | struct signal_frame __user *sf; | 86 | struct signal_frame __user *sf; |
116 | unsigned long up_psr, pc, npc; | 87 | unsigned long up_psr, pc, npc; |
117 | sigset_t set; | 88 | sigset_t set; |
118 | __siginfo_fpu_t __user *fpu_save; | 89 | __siginfo_fpu_t __user *fpu_save; |
90 | __siginfo_rwin_t __user *rwin_save; | ||
119 | int err; | 91 | int err; |
120 | 92 | ||
121 | /* Always make any pending restarted system calls return -EINTR */ | 93 | /* Always make any pending restarted system calls return -EINTR */ |
@@ -150,9 +122,11 @@ asmlinkage void do_sigreturn(struct pt_regs *regs) | |||
150 | pt_regs_clear_syscall(regs); | 122 | pt_regs_clear_syscall(regs); |
151 | 123 | ||
152 | err |= __get_user(fpu_save, &sf->fpu_save); | 124 | err |= __get_user(fpu_save, &sf->fpu_save); |
153 | |||
154 | if (fpu_save) | 125 | if (fpu_save) |
155 | err |= restore_fpu_state(regs, fpu_save); | 126 | err |= restore_fpu_state(regs, fpu_save); |
127 | err |= __get_user(rwin_save, &sf->rwin_save); | ||
128 | if (rwin_save) | ||
129 | err |= restore_rwin_state(rwin_save); | ||
156 | 130 | ||
157 | /* This is pretty much atomic, no amount locking would prevent | 131 | /* This is pretty much atomic, no amount locking would prevent |
158 | * the races which exist anyways. | 132 | * the races which exist anyways. |
@@ -180,6 +154,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs) | |||
180 | struct rt_signal_frame __user *sf; | 154 | struct rt_signal_frame __user *sf; |
181 | unsigned int psr, pc, npc; | 155 | unsigned int psr, pc, npc; |
182 | __siginfo_fpu_t __user *fpu_save; | 156 | __siginfo_fpu_t __user *fpu_save; |
157 | __siginfo_rwin_t __user *rwin_save; | ||
183 | mm_segment_t old_fs; | 158 | mm_segment_t old_fs; |
184 | sigset_t set; | 159 | sigset_t set; |
185 | stack_t st; | 160 | stack_t st; |
@@ -207,8 +182,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs) | |||
207 | pt_regs_clear_syscall(regs); | 182 | pt_regs_clear_syscall(regs); |
208 | 183 | ||
209 | err |= __get_user(fpu_save, &sf->fpu_save); | 184 | err |= __get_user(fpu_save, &sf->fpu_save); |
210 | 185 | if (!err && fpu_save) | |
211 | if (fpu_save) | ||
212 | err |= restore_fpu_state(regs, fpu_save); | 186 | err |= restore_fpu_state(regs, fpu_save); |
213 | err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t)); | 187 | err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t)); |
214 | 188 | ||
@@ -228,6 +202,12 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs) | |||
228 | do_sigaltstack((const stack_t __user *) &st, NULL, (unsigned long)sf); | 202 | do_sigaltstack((const stack_t __user *) &st, NULL, (unsigned long)sf); |
229 | set_fs(old_fs); | 203 | set_fs(old_fs); |
230 | 204 | ||
205 | err |= __get_user(rwin_save, &sf->rwin_save); | ||
206 | if (!err && rwin_save) { | ||
207 | if (restore_rwin_state(rwin_save)) | ||
208 | goto segv; | ||
209 | } | ||
210 | |||
231 | sigdelsetmask(&set, ~_BLOCKABLE); | 211 | sigdelsetmask(&set, ~_BLOCKABLE); |
232 | spin_lock_irq(¤t->sighand->siglock); | 212 | spin_lock_irq(¤t->sighand->siglock); |
233 | current->blocked = set; | 213 | current->blocked = set; |
@@ -280,53 +260,23 @@ static inline void __user *get_sigframe(struct sigaction *sa, struct pt_regs *re | |||
280 | return (void __user *) sp; | 260 | return (void __user *) sp; |
281 | } | 261 | } |
282 | 262 | ||
283 | static inline int | ||
284 | save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | ||
285 | { | ||
286 | int err = 0; | ||
287 | #ifdef CONFIG_SMP | ||
288 | if (test_tsk_thread_flag(current, TIF_USEDFPU)) { | ||
289 | put_psr(get_psr() | PSR_EF); | ||
290 | fpsave(¤t->thread.float_regs[0], ¤t->thread.fsr, | ||
291 | ¤t->thread.fpqueue[0], ¤t->thread.fpqdepth); | ||
292 | regs->psr &= ~(PSR_EF); | ||
293 | clear_tsk_thread_flag(current, TIF_USEDFPU); | ||
294 | } | ||
295 | #else | ||
296 | if (current == last_task_used_math) { | ||
297 | put_psr(get_psr() | PSR_EF); | ||
298 | fpsave(¤t->thread.float_regs[0], ¤t->thread.fsr, | ||
299 | ¤t->thread.fpqueue[0], ¤t->thread.fpqdepth); | ||
300 | last_task_used_math = NULL; | ||
301 | regs->psr &= ~(PSR_EF); | ||
302 | } | ||
303 | #endif | ||
304 | err |= __copy_to_user(&fpu->si_float_regs[0], | ||
305 | ¤t->thread.float_regs[0], | ||
306 | (sizeof(unsigned long) * 32)); | ||
307 | err |= __put_user(current->thread.fsr, &fpu->si_fsr); | ||
308 | err |= __put_user(current->thread.fpqdepth, &fpu->si_fpqdepth); | ||
309 | if (current->thread.fpqdepth != 0) | ||
310 | err |= __copy_to_user(&fpu->si_fpqueue[0], | ||
311 | ¤t->thread.fpqueue[0], | ||
312 | ((sizeof(unsigned long) + | ||
313 | (sizeof(unsigned long *)))*16)); | ||
314 | clear_used_math(); | ||
315 | return err; | ||
316 | } | ||
317 | |||
318 | static int setup_frame(struct k_sigaction *ka, struct pt_regs *regs, | 263 | static int setup_frame(struct k_sigaction *ka, struct pt_regs *regs, |
319 | int signo, sigset_t *oldset) | 264 | int signo, sigset_t *oldset) |
320 | { | 265 | { |
321 | struct signal_frame __user *sf; | 266 | struct signal_frame __user *sf; |
322 | int sigframe_size, err; | 267 | int sigframe_size, err, wsaved; |
268 | void __user *tail; | ||
323 | 269 | ||
324 | /* 1. Make sure everything is clean */ | 270 | /* 1. Make sure everything is clean */ |
325 | synchronize_user_stack(); | 271 | synchronize_user_stack(); |
326 | 272 | ||
327 | sigframe_size = SF_ALIGNEDSZ; | 273 | wsaved = current_thread_info()->w_saved; |
328 | if (!used_math()) | 274 | |
329 | sigframe_size -= sizeof(__siginfo_fpu_t); | 275 | sigframe_size = sizeof(*sf); |
276 | if (used_math()) | ||
277 | sigframe_size += sizeof(__siginfo_fpu_t); | ||
278 | if (wsaved) | ||
279 | sigframe_size += sizeof(__siginfo_rwin_t); | ||
330 | 280 | ||
331 | sf = (struct signal_frame __user *) | 281 | sf = (struct signal_frame __user *) |
332 | get_sigframe(&ka->sa, regs, sigframe_size); | 282 | get_sigframe(&ka->sa, regs, sigframe_size); |
@@ -334,8 +284,7 @@ static int setup_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
334 | if (invalid_frame_pointer(sf, sigframe_size)) | 284 | if (invalid_frame_pointer(sf, sigframe_size)) |
335 | goto sigill_and_return; | 285 | goto sigill_and_return; |
336 | 286 | ||
337 | if (current_thread_info()->w_saved != 0) | 287 | tail = sf + 1; |
338 | goto sigill_and_return; | ||
339 | 288 | ||
340 | /* 2. Save the current process state */ | 289 | /* 2. Save the current process state */ |
341 | err = __copy_to_user(&sf->info.si_regs, regs, sizeof(struct pt_regs)); | 290 | err = __copy_to_user(&sf->info.si_regs, regs, sizeof(struct pt_regs)); |
@@ -343,17 +292,34 @@ static int setup_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
343 | err |= __put_user(0, &sf->extra_size); | 292 | err |= __put_user(0, &sf->extra_size); |
344 | 293 | ||
345 | if (used_math()) { | 294 | if (used_math()) { |
346 | err |= save_fpu_state(regs, &sf->fpu_state); | 295 | __siginfo_fpu_t __user *fp = tail; |
347 | err |= __put_user(&sf->fpu_state, &sf->fpu_save); | 296 | tail += sizeof(*fp); |
297 | err |= save_fpu_state(regs, fp); | ||
298 | err |= __put_user(fp, &sf->fpu_save); | ||
348 | } else { | 299 | } else { |
349 | err |= __put_user(0, &sf->fpu_save); | 300 | err |= __put_user(0, &sf->fpu_save); |
350 | } | 301 | } |
302 | if (wsaved) { | ||
303 | __siginfo_rwin_t __user *rwp = tail; | ||
304 | tail += sizeof(*rwp); | ||
305 | err |= save_rwin_state(wsaved, rwp); | ||
306 | err |= __put_user(rwp, &sf->rwin_save); | ||
307 | } else { | ||
308 | err |= __put_user(0, &sf->rwin_save); | ||
309 | } | ||
351 | 310 | ||
352 | err |= __put_user(oldset->sig[0], &sf->info.si_mask); | 311 | err |= __put_user(oldset->sig[0], &sf->info.si_mask); |
353 | err |= __copy_to_user(sf->extramask, &oldset->sig[1], | 312 | err |= __copy_to_user(sf->extramask, &oldset->sig[1], |
354 | (_NSIG_WORDS - 1) * sizeof(unsigned int)); | 313 | (_NSIG_WORDS - 1) * sizeof(unsigned int)); |
355 | err |= __copy_to_user(sf, (char *) regs->u_regs[UREG_FP], | 314 | if (!wsaved) { |
356 | sizeof(struct reg_window32)); | 315 | err |= __copy_to_user(sf, (char *) regs->u_regs[UREG_FP], |
316 | sizeof(struct reg_window32)); | ||
317 | } else { | ||
318 | struct reg_window32 *rp; | ||
319 | |||
320 | rp = ¤t_thread_info()->reg_window[wsaved - 1]; | ||
321 | err |= __copy_to_user(sf, rp, sizeof(struct reg_window32)); | ||
322 | } | ||
357 | if (err) | 323 | if (err) |
358 | goto sigsegv; | 324 | goto sigsegv; |
359 | 325 | ||
@@ -399,21 +365,24 @@ static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
399 | int signo, sigset_t *oldset, siginfo_t *info) | 365 | int signo, sigset_t *oldset, siginfo_t *info) |
400 | { | 366 | { |
401 | struct rt_signal_frame __user *sf; | 367 | struct rt_signal_frame __user *sf; |
402 | int sigframe_size; | 368 | int sigframe_size, wsaved; |
369 | void __user *tail; | ||
403 | unsigned int psr; | 370 | unsigned int psr; |
404 | int err; | 371 | int err; |
405 | 372 | ||
406 | synchronize_user_stack(); | 373 | synchronize_user_stack(); |
407 | sigframe_size = RT_ALIGNEDSZ; | 374 | wsaved = current_thread_info()->w_saved; |
408 | if (!used_math()) | 375 | sigframe_size = sizeof(*sf); |
409 | sigframe_size -= sizeof(__siginfo_fpu_t); | 376 | if (used_math()) |
377 | sigframe_size += sizeof(__siginfo_fpu_t); | ||
378 | if (wsaved) | ||
379 | sigframe_size += sizeof(__siginfo_rwin_t); | ||
410 | sf = (struct rt_signal_frame __user *) | 380 | sf = (struct rt_signal_frame __user *) |
411 | get_sigframe(&ka->sa, regs, sigframe_size); | 381 | get_sigframe(&ka->sa, regs, sigframe_size); |
412 | if (invalid_frame_pointer(sf, sigframe_size)) | 382 | if (invalid_frame_pointer(sf, sigframe_size)) |
413 | goto sigill; | 383 | goto sigill; |
414 | if (current_thread_info()->w_saved != 0) | ||
415 | goto sigill; | ||
416 | 384 | ||
385 | tail = sf + 1; | ||
417 | err = __put_user(regs->pc, &sf->regs.pc); | 386 | err = __put_user(regs->pc, &sf->regs.pc); |
418 | err |= __put_user(regs->npc, &sf->regs.npc); | 387 | err |= __put_user(regs->npc, &sf->regs.npc); |
419 | err |= __put_user(regs->y, &sf->regs.y); | 388 | err |= __put_user(regs->y, &sf->regs.y); |
@@ -425,11 +394,21 @@ static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
425 | err |= __put_user(0, &sf->extra_size); | 394 | err |= __put_user(0, &sf->extra_size); |
426 | 395 | ||
427 | if (psr & PSR_EF) { | 396 | if (psr & PSR_EF) { |
428 | err |= save_fpu_state(regs, &sf->fpu_state); | 397 | __siginfo_fpu_t *fp = tail; |
429 | err |= __put_user(&sf->fpu_state, &sf->fpu_save); | 398 | tail += sizeof(*fp); |
399 | err |= save_fpu_state(regs, fp); | ||
400 | err |= __put_user(fp, &sf->fpu_save); | ||
430 | } else { | 401 | } else { |
431 | err |= __put_user(0, &sf->fpu_save); | 402 | err |= __put_user(0, &sf->fpu_save); |
432 | } | 403 | } |
404 | if (wsaved) { | ||
405 | __siginfo_rwin_t *rwp = tail; | ||
406 | tail += sizeof(*rwp); | ||
407 | err |= save_rwin_state(wsaved, rwp); | ||
408 | err |= __put_user(rwp, &sf->rwin_save); | ||
409 | } else { | ||
410 | err |= __put_user(0, &sf->rwin_save); | ||
411 | } | ||
433 | err |= __copy_to_user(&sf->mask, &oldset->sig[0], sizeof(sigset_t)); | 412 | err |= __copy_to_user(&sf->mask, &oldset->sig[0], sizeof(sigset_t)); |
434 | 413 | ||
435 | /* Setup sigaltstack */ | 414 | /* Setup sigaltstack */ |
@@ -437,8 +416,15 @@ static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
437 | err |= __put_user(sas_ss_flags(regs->u_regs[UREG_FP]), &sf->stack.ss_flags); | 416 | err |= __put_user(sas_ss_flags(regs->u_regs[UREG_FP]), &sf->stack.ss_flags); |
438 | err |= __put_user(current->sas_ss_size, &sf->stack.ss_size); | 417 | err |= __put_user(current->sas_ss_size, &sf->stack.ss_size); |
439 | 418 | ||
440 | err |= __copy_to_user(sf, (char *) regs->u_regs[UREG_FP], | 419 | if (!wsaved) { |
441 | sizeof(struct reg_window32)); | 420 | err |= __copy_to_user(sf, (char *) regs->u_regs[UREG_FP], |
421 | sizeof(struct reg_window32)); | ||
422 | } else { | ||
423 | struct reg_window32 *rp; | ||
424 | |||
425 | rp = ¤t_thread_info()->reg_window[wsaved - 1]; | ||
426 | err |= __copy_to_user(sf, rp, sizeof(struct reg_window32)); | ||
427 | } | ||
442 | 428 | ||
443 | err |= copy_siginfo_to_user(&sf->info, info); | 429 | err |= copy_siginfo_to_user(&sf->info, info); |
444 | 430 | ||
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c index 006fe4515886..47509df3b893 100644 --- a/arch/sparc/kernel/signal_64.c +++ b/arch/sparc/kernel/signal_64.c | |||
@@ -34,6 +34,7 @@ | |||
34 | 34 | ||
35 | #include "entry.h" | 35 | #include "entry.h" |
36 | #include "systbls.h" | 36 | #include "systbls.h" |
37 | #include "sigutil.h" | ||
37 | 38 | ||
38 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | 39 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) |
39 | 40 | ||
@@ -236,7 +237,7 @@ struct rt_signal_frame { | |||
236 | __siginfo_fpu_t __user *fpu_save; | 237 | __siginfo_fpu_t __user *fpu_save; |
237 | stack_t stack; | 238 | stack_t stack; |
238 | sigset_t mask; | 239 | sigset_t mask; |
239 | __siginfo_fpu_t fpu_state; | 240 | __siginfo_rwin_t *rwin_save; |
240 | }; | 241 | }; |
241 | 242 | ||
242 | static long _sigpause_common(old_sigset_t set) | 243 | static long _sigpause_common(old_sigset_t set) |
@@ -266,33 +267,12 @@ asmlinkage long sys_sigsuspend(old_sigset_t set) | |||
266 | return _sigpause_common(set); | 267 | return _sigpause_common(set); |
267 | } | 268 | } |
268 | 269 | ||
269 | static inline int | ||
270 | restore_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | ||
271 | { | ||
272 | unsigned long *fpregs = current_thread_info()->fpregs; | ||
273 | unsigned long fprs; | ||
274 | int err; | ||
275 | |||
276 | err = __get_user(fprs, &fpu->si_fprs); | ||
277 | fprs_write(0); | ||
278 | regs->tstate &= ~TSTATE_PEF; | ||
279 | if (fprs & FPRS_DL) | ||
280 | err |= copy_from_user(fpregs, &fpu->si_float_regs[0], | ||
281 | (sizeof(unsigned int) * 32)); | ||
282 | if (fprs & FPRS_DU) | ||
283 | err |= copy_from_user(fpregs+16, &fpu->si_float_regs[32], | ||
284 | (sizeof(unsigned int) * 32)); | ||
285 | err |= __get_user(current_thread_info()->xfsr[0], &fpu->si_fsr); | ||
286 | err |= __get_user(current_thread_info()->gsr[0], &fpu->si_gsr); | ||
287 | current_thread_info()->fpsaved[0] |= fprs; | ||
288 | return err; | ||
289 | } | ||
290 | |||
291 | void do_rt_sigreturn(struct pt_regs *regs) | 270 | void do_rt_sigreturn(struct pt_regs *regs) |
292 | { | 271 | { |
293 | struct rt_signal_frame __user *sf; | 272 | struct rt_signal_frame __user *sf; |
294 | unsigned long tpc, tnpc, tstate; | 273 | unsigned long tpc, tnpc, tstate; |
295 | __siginfo_fpu_t __user *fpu_save; | 274 | __siginfo_fpu_t __user *fpu_save; |
275 | __siginfo_rwin_t __user *rwin_save; | ||
296 | sigset_t set; | 276 | sigset_t set; |
297 | int err; | 277 | int err; |
298 | 278 | ||
@@ -325,8 +305,8 @@ void do_rt_sigreturn(struct pt_regs *regs) | |||
325 | regs->tstate |= (tstate & (TSTATE_ASI | TSTATE_ICC | TSTATE_XCC)); | 305 | regs->tstate |= (tstate & (TSTATE_ASI | TSTATE_ICC | TSTATE_XCC)); |
326 | 306 | ||
327 | err |= __get_user(fpu_save, &sf->fpu_save); | 307 | err |= __get_user(fpu_save, &sf->fpu_save); |
328 | if (fpu_save) | 308 | if (!err && fpu_save) |
329 | err |= restore_fpu_state(regs, &sf->fpu_state); | 309 | err |= restore_fpu_state(regs, fpu_save); |
330 | 310 | ||
331 | err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t)); | 311 | err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t)); |
332 | err |= do_sigaltstack(&sf->stack, NULL, (unsigned long)sf); | 312 | err |= do_sigaltstack(&sf->stack, NULL, (unsigned long)sf); |
@@ -334,6 +314,12 @@ void do_rt_sigreturn(struct pt_regs *regs) | |||
334 | if (err) | 314 | if (err) |
335 | goto segv; | 315 | goto segv; |
336 | 316 | ||
317 | err |= __get_user(rwin_save, &sf->rwin_save); | ||
318 | if (!err && rwin_save) { | ||
319 | if (restore_rwin_state(rwin_save)) | ||
320 | goto segv; | ||
321 | } | ||
322 | |||
337 | regs->tpc = tpc; | 323 | regs->tpc = tpc; |
338 | regs->tnpc = tnpc; | 324 | regs->tnpc = tnpc; |
339 | 325 | ||
@@ -351,34 +337,13 @@ segv: | |||
351 | } | 337 | } |
352 | 338 | ||
353 | /* Checks if the fp is valid */ | 339 | /* Checks if the fp is valid */ |
354 | static int invalid_frame_pointer(void __user *fp, int fplen) | 340 | static int invalid_frame_pointer(void __user *fp) |
355 | { | 341 | { |
356 | if (((unsigned long) fp) & 15) | 342 | if (((unsigned long) fp) & 15) |
357 | return 1; | 343 | return 1; |
358 | return 0; | 344 | return 0; |
359 | } | 345 | } |
360 | 346 | ||
361 | static inline int | ||
362 | save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | ||
363 | { | ||
364 | unsigned long *fpregs = current_thread_info()->fpregs; | ||
365 | unsigned long fprs; | ||
366 | int err = 0; | ||
367 | |||
368 | fprs = current_thread_info()->fpsaved[0]; | ||
369 | if (fprs & FPRS_DL) | ||
370 | err |= copy_to_user(&fpu->si_float_regs[0], fpregs, | ||
371 | (sizeof(unsigned int) * 32)); | ||
372 | if (fprs & FPRS_DU) | ||
373 | err |= copy_to_user(&fpu->si_float_regs[32], fpregs+16, | ||
374 | (sizeof(unsigned int) * 32)); | ||
375 | err |= __put_user(current_thread_info()->xfsr[0], &fpu->si_fsr); | ||
376 | err |= __put_user(current_thread_info()->gsr[0], &fpu->si_gsr); | ||
377 | err |= __put_user(fprs, &fpu->si_fprs); | ||
378 | |||
379 | return err; | ||
380 | } | ||
381 | |||
382 | static inline void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, unsigned long framesize) | 347 | static inline void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, unsigned long framesize) |
383 | { | 348 | { |
384 | unsigned long sp = regs->u_regs[UREG_FP] + STACK_BIAS; | 349 | unsigned long sp = regs->u_regs[UREG_FP] + STACK_BIAS; |
@@ -414,34 +379,48 @@ setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
414 | int signo, sigset_t *oldset, siginfo_t *info) | 379 | int signo, sigset_t *oldset, siginfo_t *info) |
415 | { | 380 | { |
416 | struct rt_signal_frame __user *sf; | 381 | struct rt_signal_frame __user *sf; |
417 | int sigframe_size, err; | 382 | int wsaved, err, sf_size; |
383 | void __user *tail; | ||
418 | 384 | ||
419 | /* 1. Make sure everything is clean */ | 385 | /* 1. Make sure everything is clean */ |
420 | synchronize_user_stack(); | 386 | synchronize_user_stack(); |
421 | save_and_clear_fpu(); | 387 | save_and_clear_fpu(); |
422 | 388 | ||
423 | sigframe_size = sizeof(struct rt_signal_frame); | 389 | wsaved = get_thread_wsaved(); |
424 | if (!(current_thread_info()->fpsaved[0] & FPRS_FEF)) | ||
425 | sigframe_size -= sizeof(__siginfo_fpu_t); | ||
426 | 390 | ||
391 | sf_size = sizeof(struct rt_signal_frame); | ||
392 | if (current_thread_info()->fpsaved[0] & FPRS_FEF) | ||
393 | sf_size += sizeof(__siginfo_fpu_t); | ||
394 | if (wsaved) | ||
395 | sf_size += sizeof(__siginfo_rwin_t); | ||
427 | sf = (struct rt_signal_frame __user *) | 396 | sf = (struct rt_signal_frame __user *) |
428 | get_sigframe(ka, regs, sigframe_size); | 397 | get_sigframe(ka, regs, sf_size); |
429 | |||
430 | if (invalid_frame_pointer (sf, sigframe_size)) | ||
431 | goto sigill; | ||
432 | 398 | ||
433 | if (get_thread_wsaved() != 0) | 399 | if (invalid_frame_pointer (sf)) |
434 | goto sigill; | 400 | goto sigill; |
435 | 401 | ||
402 | tail = (sf + 1); | ||
403 | |||
436 | /* 2. Save the current process state */ | 404 | /* 2. Save the current process state */ |
437 | err = copy_to_user(&sf->regs, regs, sizeof (*regs)); | 405 | err = copy_to_user(&sf->regs, regs, sizeof (*regs)); |
438 | 406 | ||
439 | if (current_thread_info()->fpsaved[0] & FPRS_FEF) { | 407 | if (current_thread_info()->fpsaved[0] & FPRS_FEF) { |
440 | err |= save_fpu_state(regs, &sf->fpu_state); | 408 | __siginfo_fpu_t __user *fpu_save = tail; |
441 | err |= __put_user((u64)&sf->fpu_state, &sf->fpu_save); | 409 | tail += sizeof(__siginfo_fpu_t); |
410 | err |= save_fpu_state(regs, fpu_save); | ||
411 | err |= __put_user((u64)fpu_save, &sf->fpu_save); | ||
442 | } else { | 412 | } else { |
443 | err |= __put_user(0, &sf->fpu_save); | 413 | err |= __put_user(0, &sf->fpu_save); |
444 | } | 414 | } |
415 | if (wsaved) { | ||
416 | __siginfo_rwin_t __user *rwin_save = tail; | ||
417 | tail += sizeof(__siginfo_rwin_t); | ||
418 | err |= save_rwin_state(wsaved, rwin_save); | ||
419 | err |= __put_user((u64)rwin_save, &sf->rwin_save); | ||
420 | set_thread_wsaved(0); | ||
421 | } else { | ||
422 | err |= __put_user(0, &sf->rwin_save); | ||
423 | } | ||
445 | 424 | ||
446 | /* Setup sigaltstack */ | 425 | /* Setup sigaltstack */ |
447 | err |= __put_user(current->sas_ss_sp, &sf->stack.ss_sp); | 426 | err |= __put_user(current->sas_ss_sp, &sf->stack.ss_sp); |
@@ -450,10 +429,17 @@ setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
450 | 429 | ||
451 | err |= copy_to_user(&sf->mask, oldset, sizeof(sigset_t)); | 430 | err |= copy_to_user(&sf->mask, oldset, sizeof(sigset_t)); |
452 | 431 | ||
453 | err |= copy_in_user((u64 __user *)sf, | 432 | if (!wsaved) { |
454 | (u64 __user *)(regs->u_regs[UREG_FP]+STACK_BIAS), | 433 | err |= copy_in_user((u64 __user *)sf, |
455 | sizeof(struct reg_window)); | 434 | (u64 __user *)(regs->u_regs[UREG_FP] + |
435 | STACK_BIAS), | ||
436 | sizeof(struct reg_window)); | ||
437 | } else { | ||
438 | struct reg_window *rp; | ||
456 | 439 | ||
440 | rp = ¤t_thread_info()->reg_window[wsaved - 1]; | ||
441 | err |= copy_to_user(sf, rp, sizeof(struct reg_window)); | ||
442 | } | ||
457 | if (info) | 443 | if (info) |
458 | err |= copy_siginfo_to_user(&sf->info, info); | 444 | err |= copy_siginfo_to_user(&sf->info, info); |
459 | else { | 445 | else { |
diff --git a/arch/sparc/kernel/sigutil.h b/arch/sparc/kernel/sigutil.h new file mode 100644 index 000000000000..d223aa432bb6 --- /dev/null +++ b/arch/sparc/kernel/sigutil.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef _SIGUTIL_H | ||
2 | #define _SIGUTIL_H | ||
3 | |||
4 | int save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu); | ||
5 | int restore_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu); | ||
6 | int save_rwin_state(int wsaved, __siginfo_rwin_t __user *rwin); | ||
7 | int restore_rwin_state(__siginfo_rwin_t __user *rp); | ||
8 | |||
9 | #endif /* _SIGUTIL_H */ | ||
diff --git a/arch/sparc/kernel/sigutil_32.c b/arch/sparc/kernel/sigutil_32.c new file mode 100644 index 000000000000..35c7897b009a --- /dev/null +++ b/arch/sparc/kernel/sigutil_32.c | |||
@@ -0,0 +1,120 @@ | |||
1 | #include <linux/kernel.h> | ||
2 | #include <linux/types.h> | ||
3 | #include <linux/thread_info.h> | ||
4 | #include <linux/uaccess.h> | ||
5 | #include <linux/sched.h> | ||
6 | |||
7 | #include <asm/sigcontext.h> | ||
8 | #include <asm/fpumacro.h> | ||
9 | #include <asm/ptrace.h> | ||
10 | |||
11 | #include "sigutil.h" | ||
12 | |||
13 | int save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | ||
14 | { | ||
15 | int err = 0; | ||
16 | #ifdef CONFIG_SMP | ||
17 | if (test_tsk_thread_flag(current, TIF_USEDFPU)) { | ||
18 | put_psr(get_psr() | PSR_EF); | ||
19 | fpsave(¤t->thread.float_regs[0], ¤t->thread.fsr, | ||
20 | ¤t->thread.fpqueue[0], ¤t->thread.fpqdepth); | ||
21 | regs->psr &= ~(PSR_EF); | ||
22 | clear_tsk_thread_flag(current, TIF_USEDFPU); | ||
23 | } | ||
24 | #else | ||
25 | if (current == last_task_used_math) { | ||
26 | put_psr(get_psr() | PSR_EF); | ||
27 | fpsave(¤t->thread.float_regs[0], ¤t->thread.fsr, | ||
28 | ¤t->thread.fpqueue[0], ¤t->thread.fpqdepth); | ||
29 | last_task_used_math = NULL; | ||
30 | regs->psr &= ~(PSR_EF); | ||
31 | } | ||
32 | #endif | ||
33 | err |= __copy_to_user(&fpu->si_float_regs[0], | ||
34 | ¤t->thread.float_regs[0], | ||
35 | (sizeof(unsigned long) * 32)); | ||
36 | err |= __put_user(current->thread.fsr, &fpu->si_fsr); | ||
37 | err |= __put_user(current->thread.fpqdepth, &fpu->si_fpqdepth); | ||
38 | if (current->thread.fpqdepth != 0) | ||
39 | err |= __copy_to_user(&fpu->si_fpqueue[0], | ||
40 | ¤t->thread.fpqueue[0], | ||
41 | ((sizeof(unsigned long) + | ||
42 | (sizeof(unsigned long *)))*16)); | ||
43 | clear_used_math(); | ||
44 | return err; | ||
45 | } | ||
46 | |||
47 | int restore_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | ||
48 | { | ||
49 | int err; | ||
50 | #ifdef CONFIG_SMP | ||
51 | if (test_tsk_thread_flag(current, TIF_USEDFPU)) | ||
52 | regs->psr &= ~PSR_EF; | ||
53 | #else | ||
54 | if (current == last_task_used_math) { | ||
55 | last_task_used_math = NULL; | ||
56 | regs->psr &= ~PSR_EF; | ||
57 | } | ||
58 | #endif | ||
59 | set_used_math(); | ||
60 | clear_tsk_thread_flag(current, TIF_USEDFPU); | ||
61 | |||
62 | if (!access_ok(VERIFY_READ, fpu, sizeof(*fpu))) | ||
63 | return -EFAULT; | ||
64 | |||
65 | err = __copy_from_user(¤t->thread.float_regs[0], &fpu->si_float_regs[0], | ||
66 | (sizeof(unsigned long) * 32)); | ||
67 | err |= __get_user(current->thread.fsr, &fpu->si_fsr); | ||
68 | err |= __get_user(current->thread.fpqdepth, &fpu->si_fpqdepth); | ||
69 | if (current->thread.fpqdepth != 0) | ||
70 | err |= __copy_from_user(¤t->thread.fpqueue[0], | ||
71 | &fpu->si_fpqueue[0], | ||
72 | ((sizeof(unsigned long) + | ||
73 | (sizeof(unsigned long *)))*16)); | ||
74 | return err; | ||
75 | } | ||
76 | |||
77 | int save_rwin_state(int wsaved, __siginfo_rwin_t __user *rwin) | ||
78 | { | ||
79 | int i, err = __put_user(wsaved, &rwin->wsaved); | ||
80 | |||
81 | for (i = 0; i < wsaved; i++) { | ||
82 | struct reg_window32 *rp; | ||
83 | unsigned long fp; | ||
84 | |||
85 | rp = ¤t_thread_info()->reg_window[i]; | ||
86 | fp = current_thread_info()->rwbuf_stkptrs[i]; | ||
87 | err |= copy_to_user(&rwin->reg_window[i], rp, | ||
88 | sizeof(struct reg_window32)); | ||
89 | err |= __put_user(fp, &rwin->rwbuf_stkptrs[i]); | ||
90 | } | ||
91 | return err; | ||
92 | } | ||
93 | |||
94 | int restore_rwin_state(__siginfo_rwin_t __user *rp) | ||
95 | { | ||
96 | struct thread_info *t = current_thread_info(); | ||
97 | int i, wsaved, err; | ||
98 | |||
99 | __get_user(wsaved, &rp->wsaved); | ||
100 | if (wsaved > NSWINS) | ||
101 | return -EFAULT; | ||
102 | |||
103 | err = 0; | ||
104 | for (i = 0; i < wsaved; i++) { | ||
105 | err |= copy_from_user(&t->reg_window[i], | ||
106 | &rp->reg_window[i], | ||
107 | sizeof(struct reg_window32)); | ||
108 | err |= __get_user(t->rwbuf_stkptrs[i], | ||
109 | &rp->rwbuf_stkptrs[i]); | ||
110 | } | ||
111 | if (err) | ||
112 | return err; | ||
113 | |||
114 | t->w_saved = wsaved; | ||
115 | synchronize_user_stack(); | ||
116 | if (t->w_saved) | ||
117 | return -EFAULT; | ||
118 | return 0; | ||
119 | |||
120 | } | ||
diff --git a/arch/sparc/kernel/sigutil_64.c b/arch/sparc/kernel/sigutil_64.c new file mode 100644 index 000000000000..e7dc508c38eb --- /dev/null +++ b/arch/sparc/kernel/sigutil_64.c | |||
@@ -0,0 +1,93 @@ | |||
1 | #include <linux/kernel.h> | ||
2 | #include <linux/types.h> | ||
3 | #include <linux/thread_info.h> | ||
4 | #include <linux/uaccess.h> | ||
5 | |||
6 | #include <asm/sigcontext.h> | ||
7 | #include <asm/fpumacro.h> | ||
8 | #include <asm/ptrace.h> | ||
9 | |||
10 | #include "sigutil.h" | ||
11 | |||
12 | int save_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | ||
13 | { | ||
14 | unsigned long *fpregs = current_thread_info()->fpregs; | ||
15 | unsigned long fprs; | ||
16 | int err = 0; | ||
17 | |||
18 | fprs = current_thread_info()->fpsaved[0]; | ||
19 | if (fprs & FPRS_DL) | ||
20 | err |= copy_to_user(&fpu->si_float_regs[0], fpregs, | ||
21 | (sizeof(unsigned int) * 32)); | ||
22 | if (fprs & FPRS_DU) | ||
23 | err |= copy_to_user(&fpu->si_float_regs[32], fpregs+16, | ||
24 | (sizeof(unsigned int) * 32)); | ||
25 | err |= __put_user(current_thread_info()->xfsr[0], &fpu->si_fsr); | ||
26 | err |= __put_user(current_thread_info()->gsr[0], &fpu->si_gsr); | ||
27 | err |= __put_user(fprs, &fpu->si_fprs); | ||
28 | |||
29 | return err; | ||
30 | } | ||
31 | |||
32 | int restore_fpu_state(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | ||
33 | { | ||
34 | unsigned long *fpregs = current_thread_info()->fpregs; | ||
35 | unsigned long fprs; | ||
36 | int err; | ||
37 | |||
38 | err = __get_user(fprs, &fpu->si_fprs); | ||
39 | fprs_write(0); | ||
40 | regs->tstate &= ~TSTATE_PEF; | ||
41 | if (fprs & FPRS_DL) | ||
42 | err |= copy_from_user(fpregs, &fpu->si_float_regs[0], | ||
43 | (sizeof(unsigned int) * 32)); | ||
44 | if (fprs & FPRS_DU) | ||
45 | err |= copy_from_user(fpregs+16, &fpu->si_float_regs[32], | ||
46 | (sizeof(unsigned int) * 32)); | ||
47 | err |= __get_user(current_thread_info()->xfsr[0], &fpu->si_fsr); | ||
48 | err |= __get_user(current_thread_info()->gsr[0], &fpu->si_gsr); | ||
49 | current_thread_info()->fpsaved[0] |= fprs; | ||
50 | return err; | ||
51 | } | ||
52 | |||
53 | int save_rwin_state(int wsaved, __siginfo_rwin_t __user *rwin) | ||
54 | { | ||
55 | int i, err = __put_user(wsaved, &rwin->wsaved); | ||
56 | |||
57 | for (i = 0; i < wsaved; i++) { | ||
58 | struct reg_window *rp = ¤t_thread_info()->reg_window[i]; | ||
59 | unsigned long fp = current_thread_info()->rwbuf_stkptrs[i]; | ||
60 | |||
61 | err |= copy_to_user(&rwin->reg_window[i], rp, | ||
62 | sizeof(struct reg_window)); | ||
63 | err |= __put_user(fp, &rwin->rwbuf_stkptrs[i]); | ||
64 | } | ||
65 | return err; | ||
66 | } | ||
67 | |||
68 | int restore_rwin_state(__siginfo_rwin_t __user *rp) | ||
69 | { | ||
70 | struct thread_info *t = current_thread_info(); | ||
71 | int i, wsaved, err; | ||
72 | |||
73 | __get_user(wsaved, &rp->wsaved); | ||
74 | if (wsaved > NSWINS) | ||
75 | return -EFAULT; | ||
76 | |||
77 | err = 0; | ||
78 | for (i = 0; i < wsaved; i++) { | ||
79 | err |= copy_from_user(&t->reg_window[i], | ||
80 | &rp->reg_window[i], | ||
81 | sizeof(struct reg_window)); | ||
82 | err |= __get_user(t->rwbuf_stkptrs[i], | ||
83 | &rp->rwbuf_stkptrs[i]); | ||
84 | } | ||
85 | if (err) | ||
86 | return err; | ||
87 | |||
88 | set_thread_wsaved(wsaved); | ||
89 | synchronize_user_stack(); | ||
90 | if (get_thread_wsaved()) | ||
91 | return -EFAULT; | ||
92 | return 0; | ||
93 | } | ||
diff --git a/arch/sparc/kernel/sys32.S b/arch/sparc/kernel/sys32.S index 44e5faf1ad5f..d97f3eb72e06 100644 --- a/arch/sparc/kernel/sys32.S +++ b/arch/sparc/kernel/sys32.S | |||
@@ -81,7 +81,6 @@ SIGN2(sys32_fadvise64, compat_sys_fadvise64, %o0, %o4) | |||
81 | SIGN2(sys32_fadvise64_64, compat_sys_fadvise64_64, %o0, %o5) | 81 | SIGN2(sys32_fadvise64_64, compat_sys_fadvise64_64, %o0, %o5) |
82 | SIGN2(sys32_bdflush, sys_bdflush, %o0, %o1) | 82 | SIGN2(sys32_bdflush, sys_bdflush, %o0, %o1) |
83 | SIGN1(sys32_mlockall, sys_mlockall, %o0) | 83 | SIGN1(sys32_mlockall, sys_mlockall, %o0) |
84 | SIGN1(sys32_nfsservctl, compat_sys_nfsservctl, %o0) | ||
85 | SIGN1(sys32_clock_nanosleep, compat_sys_clock_nanosleep, %o1) | 84 | SIGN1(sys32_clock_nanosleep, compat_sys_clock_nanosleep, %o1) |
86 | SIGN1(sys32_timer_settime, compat_sys_timer_settime, %o1) | 85 | SIGN1(sys32_timer_settime, compat_sys_timer_settime, %o1) |
87 | SIGN1(sys32_io_submit, compat_sys_io_submit, %o1) | 86 | SIGN1(sys32_io_submit, compat_sys_io_submit, %o1) |
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S index 6e492d59f6b1..09d8ec454450 100644 --- a/arch/sparc/kernel/systbls_32.S +++ b/arch/sparc/kernel/systbls_32.S | |||
@@ -67,7 +67,7 @@ sys_call_table: | |||
67 | /*235*/ .long sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys_mlockall | 67 | /*235*/ .long sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys_mlockall |
68 | /*240*/ .long sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler | 68 | /*240*/ .long sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler |
69 | /*245*/ .long sys_sched_yield, sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, sys_nanosleep | 69 | /*245*/ .long sys_sched_yield, sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, sys_nanosleep |
70 | /*250*/ .long sys_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl | 70 | /*250*/ .long sys_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_ni_syscall |
71 | /*255*/ .long sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep | 71 | /*255*/ .long sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep |
72 | /*260*/ .long sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun | 72 | /*260*/ .long sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun |
73 | /*265*/ .long sys_timer_delete, sys_timer_create, sys_nis_syscall, sys_io_setup, sys_io_destroy | 73 | /*265*/ .long sys_timer_delete, sys_timer_create, sys_nis_syscall, sys_io_setup, sys_io_destroy |
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S index f566518483b5..edbec45d4688 100644 --- a/arch/sparc/kernel/systbls_64.S +++ b/arch/sparc/kernel/systbls_64.S | |||
@@ -68,7 +68,7 @@ sys_call_table32: | |||
68 | .word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall | 68 | .word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall |
69 | /*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler | 69 | /*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler |
70 | .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep | 70 | .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep |
71 | /*250*/ .word sys_mremap, compat_sys_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl | 71 | /*250*/ .word sys_mremap, compat_sys_sysctl, sys32_getsid, sys_fdatasync, sys_nis_syscall |
72 | .word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep | 72 | .word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep |
73 | /*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun | 73 | /*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun |
74 | .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy | 74 | .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy |
@@ -145,7 +145,7 @@ sys_call_table: | |||
145 | .word sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys_mlockall | 145 | .word sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys_mlockall |
146 | /*240*/ .word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler | 146 | /*240*/ .word sys_munlockall, sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler |
147 | .word sys_sched_yield, sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, sys_nanosleep | 147 | .word sys_sched_yield, sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, sys_nanosleep |
148 | /*250*/ .word sys_64_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nfsservctl | 148 | /*250*/ .word sys_64_mremap, sys_sysctl, sys_getsid, sys_fdatasync, sys_nis_syscall |
149 | .word sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep | 149 | .word sys_sync_file_range, sys_clock_settime, sys_clock_gettime, sys_clock_getres, sys_clock_nanosleep |
150 | /*260*/ .word sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun | 150 | /*260*/ .word sys_sched_getaffinity, sys_sched_setaffinity, sys_timer_settime, sys_timer_gettime, sys_timer_getoverrun |
151 | .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy | 151 | .word sys_timer_delete, sys_timer_create, sys_ni_syscall, sys_io_setup, sys_io_destroy |
diff --git a/arch/um/Kconfig.x86 b/arch/um/Kconfig.x86 index d31ecf346b4e..21bebe63df66 100644 --- a/arch/um/Kconfig.x86 +++ b/arch/um/Kconfig.x86 | |||
@@ -10,6 +10,10 @@ config CMPXCHG_LOCAL | |||
10 | bool | 10 | bool |
11 | default n | 11 | default n |
12 | 12 | ||
13 | config CMPXCHG_DOUBLE | ||
14 | bool | ||
15 | default n | ||
16 | |||
13 | source "arch/x86/Kconfig.cpu" | 17 | source "arch/x86/Kconfig.cpu" |
14 | 18 | ||
15 | endmenu | 19 | endmenu |
diff --git a/arch/um/Makefile b/arch/um/Makefile index fab8121d2b32..c0f712cc7c5f 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile | |||
@@ -41,7 +41,7 @@ KBUILD_CPPFLAGS += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH) | |||
41 | KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ | 41 | KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ |
42 | $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \ | 42 | $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \ |
43 | -Din6addr_loopback=kernel_in6addr_loopback \ | 43 | -Din6addr_loopback=kernel_in6addr_loopback \ |
44 | -Din6addr_any=kernel_in6addr_any | 44 | -Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr |
45 | 45 | ||
46 | KBUILD_AFLAGS += $(ARCH_INCLUDE) | 46 | KBUILD_AFLAGS += $(ARCH_INCLUDE) |
47 | 47 | ||
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index d51c404239a8..364c8a15c4c3 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c | |||
@@ -399,8 +399,8 @@ int line_setup_irq(int fd, int input, int output, struct line *line, void *data) | |||
399 | * is done under a spinlock. Checking whether the device is in use is | 399 | * is done under a spinlock. Checking whether the device is in use is |
400 | * line->tty->count > 1, also under the spinlock. | 400 | * line->tty->count > 1, also under the spinlock. |
401 | * | 401 | * |
402 | * tty->count serves to decide whether the device should be enabled or | 402 | * line->count serves to decide whether the device should be enabled or |
403 | * disabled on the host. If it's equal to 1, then we are doing the | 403 | * disabled on the host. If it's equal to 0, then we are doing the |
404 | * first open or last close. Otherwise, open and close just return. | 404 | * first open or last close. Otherwise, open and close just return. |
405 | */ | 405 | */ |
406 | 406 | ||
@@ -414,16 +414,16 @@ int line_open(struct line *lines, struct tty_struct *tty) | |||
414 | goto out_unlock; | 414 | goto out_unlock; |
415 | 415 | ||
416 | err = 0; | 416 | err = 0; |
417 | if (tty->count > 1) | 417 | if (line->count++) |
418 | goto out_unlock; | 418 | goto out_unlock; |
419 | 419 | ||
420 | spin_unlock(&line->count_lock); | 420 | BUG_ON(tty->driver_data); |
421 | |||
422 | tty->driver_data = line; | 421 | tty->driver_data = line; |
423 | line->tty = tty; | 422 | line->tty = tty; |
424 | 423 | ||
424 | spin_unlock(&line->count_lock); | ||
425 | err = enable_chan(line); | 425 | err = enable_chan(line); |
426 | if (err) | 426 | if (err) /* line_close() will be called by our caller */ |
427 | return err; | 427 | return err; |
428 | 428 | ||
429 | INIT_DELAYED_WORK(&line->task, line_timer_cb); | 429 | INIT_DELAYED_WORK(&line->task, line_timer_cb); |
@@ -436,7 +436,7 @@ int line_open(struct line *lines, struct tty_struct *tty) | |||
436 | chan_window_size(&line->chan_list, &tty->winsize.ws_row, | 436 | chan_window_size(&line->chan_list, &tty->winsize.ws_row, |
437 | &tty->winsize.ws_col); | 437 | &tty->winsize.ws_col); |
438 | 438 | ||
439 | return err; | 439 | return 0; |
440 | 440 | ||
441 | out_unlock: | 441 | out_unlock: |
442 | spin_unlock(&line->count_lock); | 442 | spin_unlock(&line->count_lock); |
@@ -460,17 +460,16 @@ void line_close(struct tty_struct *tty, struct file * filp) | |||
460 | flush_buffer(line); | 460 | flush_buffer(line); |
461 | 461 | ||
462 | spin_lock(&line->count_lock); | 462 | spin_lock(&line->count_lock); |
463 | if (!line->valid) | 463 | BUG_ON(!line->valid); |
464 | goto out_unlock; | ||
465 | 464 | ||
466 | if (tty->count > 1) | 465 | if (--line->count) |
467 | goto out_unlock; | 466 | goto out_unlock; |
468 | 467 | ||
469 | spin_unlock(&line->count_lock); | ||
470 | |||
471 | line->tty = NULL; | 468 | line->tty = NULL; |
472 | tty->driver_data = NULL; | 469 | tty->driver_data = NULL; |
473 | 470 | ||
471 | spin_unlock(&line->count_lock); | ||
472 | |||
474 | if (line->sigio) { | 473 | if (line->sigio) { |
475 | unregister_winch(tty); | 474 | unregister_winch(tty); |
476 | line->sigio = 0; | 475 | line->sigio = 0; |
@@ -498,7 +497,7 @@ static int setup_one_line(struct line *lines, int n, char *init, int init_prio, | |||
498 | 497 | ||
499 | spin_lock(&line->count_lock); | 498 | spin_lock(&line->count_lock); |
500 | 499 | ||
501 | if (line->tty != NULL) { | 500 | if (line->count) { |
502 | *error_out = "Device is already open"; | 501 | *error_out = "Device is already open"; |
503 | goto out; | 502 | goto out; |
504 | } | 503 | } |
@@ -722,41 +721,53 @@ struct winch { | |||
722 | int pid; | 721 | int pid; |
723 | struct tty_struct *tty; | 722 | struct tty_struct *tty; |
724 | unsigned long stack; | 723 | unsigned long stack; |
724 | struct work_struct work; | ||
725 | }; | 725 | }; |
726 | 726 | ||
727 | static void free_winch(struct winch *winch, int free_irq_ok) | 727 | static void __free_winch(struct work_struct *work) |
728 | { | 728 | { |
729 | if (free_irq_ok) | 729 | struct winch *winch = container_of(work, struct winch, work); |
730 | free_irq(WINCH_IRQ, winch); | 730 | free_irq(WINCH_IRQ, winch); |
731 | |||
732 | list_del(&winch->list); | ||
733 | 731 | ||
734 | if (winch->pid != -1) | 732 | if (winch->pid != -1) |
735 | os_kill_process(winch->pid, 1); | 733 | os_kill_process(winch->pid, 1); |
736 | if (winch->fd != -1) | ||
737 | os_close_file(winch->fd); | ||
738 | if (winch->stack != 0) | 734 | if (winch->stack != 0) |
739 | free_stack(winch->stack, 0); | 735 | free_stack(winch->stack, 0); |
740 | kfree(winch); | 736 | kfree(winch); |
741 | } | 737 | } |
742 | 738 | ||
739 | static void free_winch(struct winch *winch) | ||
740 | { | ||
741 | int fd = winch->fd; | ||
742 | winch->fd = -1; | ||
743 | if (fd != -1) | ||
744 | os_close_file(fd); | ||
745 | list_del(&winch->list); | ||
746 | __free_winch(&winch->work); | ||
747 | } | ||
748 | |||
743 | static irqreturn_t winch_interrupt(int irq, void *data) | 749 | static irqreturn_t winch_interrupt(int irq, void *data) |
744 | { | 750 | { |
745 | struct winch *winch = data; | 751 | struct winch *winch = data; |
746 | struct tty_struct *tty; | 752 | struct tty_struct *tty; |
747 | struct line *line; | 753 | struct line *line; |
754 | int fd = winch->fd; | ||
748 | int err; | 755 | int err; |
749 | char c; | 756 | char c; |
750 | 757 | ||
751 | if (winch->fd != -1) { | 758 | if (fd != -1) { |
752 | err = generic_read(winch->fd, &c, NULL); | 759 | err = generic_read(fd, &c, NULL); |
753 | if (err < 0) { | 760 | if (err < 0) { |
754 | if (err != -EAGAIN) { | 761 | if (err != -EAGAIN) { |
762 | winch->fd = -1; | ||
763 | list_del(&winch->list); | ||
764 | os_close_file(fd); | ||
755 | printk(KERN_ERR "winch_interrupt : " | 765 | printk(KERN_ERR "winch_interrupt : " |
756 | "read failed, errno = %d\n", -err); | 766 | "read failed, errno = %d\n", -err); |
757 | printk(KERN_ERR "fd %d is losing SIGWINCH " | 767 | printk(KERN_ERR "fd %d is losing SIGWINCH " |
758 | "support\n", winch->tty_fd); | 768 | "support\n", winch->tty_fd); |
759 | free_winch(winch, 0); | 769 | INIT_WORK(&winch->work, __free_winch); |
770 | schedule_work(&winch->work); | ||
760 | return IRQ_HANDLED; | 771 | return IRQ_HANDLED; |
761 | } | 772 | } |
762 | goto out; | 773 | goto out; |
@@ -828,7 +839,7 @@ static void unregister_winch(struct tty_struct *tty) | |||
828 | list_for_each_safe(ele, next, &winch_handlers) { | 839 | list_for_each_safe(ele, next, &winch_handlers) { |
829 | winch = list_entry(ele, struct winch, list); | 840 | winch = list_entry(ele, struct winch, list); |
830 | if (winch->tty == tty) { | 841 | if (winch->tty == tty) { |
831 | free_winch(winch, 1); | 842 | free_winch(winch); |
832 | break; | 843 | break; |
833 | } | 844 | } |
834 | } | 845 | } |
@@ -844,7 +855,7 @@ static void winch_cleanup(void) | |||
844 | 855 | ||
845 | list_for_each_safe(ele, next, &winch_handlers) { | 856 | list_for_each_safe(ele, next, &winch_handlers) { |
846 | winch = list_entry(ele, struct winch, list); | 857 | winch = list_entry(ele, struct winch, list); |
847 | free_winch(winch, 1); | 858 | free_winch(winch); |
848 | } | 859 | } |
849 | 860 | ||
850 | spin_unlock(&winch_handler_lock); | 861 | spin_unlock(&winch_handler_lock); |
diff --git a/arch/um/drivers/xterm.c b/arch/um/drivers/xterm.c index 8ac7146c237f..2e1de5728604 100644 --- a/arch/um/drivers/xterm.c +++ b/arch/um/drivers/xterm.c | |||
@@ -123,6 +123,7 @@ static int xterm_open(int input, int output, int primary, void *d, | |||
123 | err = -errno; | 123 | err = -errno; |
124 | printk(UM_KERN_ERR "xterm_open : unlink failed, errno = %d\n", | 124 | printk(UM_KERN_ERR "xterm_open : unlink failed, errno = %d\n", |
125 | errno); | 125 | errno); |
126 | close(fd); | ||
126 | return err; | 127 | return err; |
127 | } | 128 | } |
128 | close(fd); | 129 | close(fd); |
diff --git a/arch/um/include/asm/ptrace-generic.h b/arch/um/include/asm/ptrace-generic.h index ae084ad1a3a0..1a7d2757fe05 100644 --- a/arch/um/include/asm/ptrace-generic.h +++ b/arch/um/include/asm/ptrace-generic.h | |||
@@ -42,10 +42,6 @@ extern long subarch_ptrace(struct task_struct *child, long request, | |||
42 | unsigned long addr, unsigned long data); | 42 | unsigned long addr, unsigned long data); |
43 | extern unsigned long getreg(struct task_struct *child, int regno); | 43 | extern unsigned long getreg(struct task_struct *child, int regno); |
44 | extern int putreg(struct task_struct *child, int regno, unsigned long value); | 44 | extern int putreg(struct task_struct *child, int regno, unsigned long value); |
45 | extern int get_fpregs(struct user_i387_struct __user *buf, | ||
46 | struct task_struct *child); | ||
47 | extern int set_fpregs(struct user_i387_struct __user *buf, | ||
48 | struct task_struct *child); | ||
49 | 45 | ||
50 | extern int arch_copy_tls(struct task_struct *new); | 46 | extern int arch_copy_tls(struct task_struct *new); |
51 | extern void clear_flushed_tls(struct task_struct *task); | 47 | extern void clear_flushed_tls(struct task_struct *task); |
diff --git a/arch/um/include/shared/line.h b/arch/um/include/shared/line.h index 72f4f25af247..63df3ca02ac2 100644 --- a/arch/um/include/shared/line.h +++ b/arch/um/include/shared/line.h | |||
@@ -33,6 +33,7 @@ struct line_driver { | |||
33 | struct line { | 33 | struct line { |
34 | struct tty_struct *tty; | 34 | struct tty_struct *tty; |
35 | spinlock_t count_lock; | 35 | spinlock_t count_lock; |
36 | unsigned long count; | ||
36 | int valid; | 37 | int valid; |
37 | 38 | ||
38 | char *init_str; | 39 | char *init_str; |
diff --git a/arch/um/include/shared/registers.h b/arch/um/include/shared/registers.h index b0b4589e0ebc..f1e0aa56c52a 100644 --- a/arch/um/include/shared/registers.h +++ b/arch/um/include/shared/registers.h | |||
@@ -16,7 +16,7 @@ extern int restore_fpx_registers(int pid, unsigned long *fp_regs); | |||
16 | extern int save_registers(int pid, struct uml_pt_regs *regs); | 16 | extern int save_registers(int pid, struct uml_pt_regs *regs); |
17 | extern int restore_registers(int pid, struct uml_pt_regs *regs); | 17 | extern int restore_registers(int pid, struct uml_pt_regs *regs); |
18 | extern int init_registers(int pid); | 18 | extern int init_registers(int pid); |
19 | extern void get_safe_registers(unsigned long *regs); | 19 | extern void get_safe_registers(unsigned long *regs, unsigned long *fp_regs); |
20 | extern unsigned long get_thread_reg(int reg, jmp_buf *buf); | 20 | extern unsigned long get_thread_reg(int reg, jmp_buf *buf); |
21 | extern int get_fp_registers(int pid, unsigned long *regs); | 21 | extern int get_fp_registers(int pid, unsigned long *regs); |
22 | extern int put_fp_registers(int pid, unsigned long *regs); | 22 | extern int put_fp_registers(int pid, unsigned long *regs); |
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index fab4371184f6..21c1ae7c3d75 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c | |||
@@ -202,7 +202,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
202 | arch_copy_thread(¤t->thread.arch, &p->thread.arch); | 202 | arch_copy_thread(¤t->thread.arch, &p->thread.arch); |
203 | } | 203 | } |
204 | else { | 204 | else { |
205 | get_safe_registers(p->thread.regs.regs.gp); | 205 | get_safe_registers(p->thread.regs.regs.gp, p->thread.regs.regs.fp); |
206 | p->thread.request.u.thread = current->thread.request.u.thread; | 206 | p->thread.request.u.thread = current->thread.request.u.thread; |
207 | handler = new_thread_handler; | 207 | handler = new_thread_handler; |
208 | } | 208 | } |
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c index 701b672c1122..c9da32b0c707 100644 --- a/arch/um/kernel/ptrace.c +++ b/arch/um/kernel/ptrace.c | |||
@@ -50,23 +50,11 @@ long arch_ptrace(struct task_struct *child, long request, | |||
50 | void __user *vp = p; | 50 | void __user *vp = p; |
51 | 51 | ||
52 | switch (request) { | 52 | switch (request) { |
53 | /* read word at location addr. */ | ||
54 | case PTRACE_PEEKTEXT: | ||
55 | case PTRACE_PEEKDATA: | ||
56 | ret = generic_ptrace_peekdata(child, addr, data); | ||
57 | break; | ||
58 | |||
59 | /* read the word at location addr in the USER area. */ | 53 | /* read the word at location addr in the USER area. */ |
60 | case PTRACE_PEEKUSR: | 54 | case PTRACE_PEEKUSR: |
61 | ret = peek_user(child, addr, data); | 55 | ret = peek_user(child, addr, data); |
62 | break; | 56 | break; |
63 | 57 | ||
64 | /* write the word at location addr. */ | ||
65 | case PTRACE_POKETEXT: | ||
66 | case PTRACE_POKEDATA: | ||
67 | ret = generic_ptrace_pokedata(child, addr, data); | ||
68 | break; | ||
69 | |||
70 | /* write the word at location addr in the USER area */ | 58 | /* write the word at location addr in the USER area */ |
71 | case PTRACE_POKEUSR: | 59 | case PTRACE_POKEUSR: |
72 | ret = poke_user(child, addr, data); | 60 | ret = poke_user(child, addr, data); |
@@ -107,16 +95,6 @@ long arch_ptrace(struct task_struct *child, long request, | |||
107 | break; | 95 | break; |
108 | } | 96 | } |
109 | #endif | 97 | #endif |
110 | #ifdef PTRACE_GETFPREGS | ||
111 | case PTRACE_GETFPREGS: /* Get the child FPU state. */ | ||
112 | ret = get_fpregs(vp, child); | ||
113 | break; | ||
114 | #endif | ||
115 | #ifdef PTRACE_SETFPREGS | ||
116 | case PTRACE_SETFPREGS: /* Set the child FPU state. */ | ||
117 | ret = set_fpregs(vp, child); | ||
118 | break; | ||
119 | #endif | ||
120 | case PTRACE_GET_THREAD_AREA: | 98 | case PTRACE_GET_THREAD_AREA: |
121 | ret = ptrace_get_thread_area(child, addr, vp); | 99 | ret = ptrace_get_thread_area(child, addr, vp); |
122 | break; | 100 | break; |
@@ -154,12 +132,6 @@ long arch_ptrace(struct task_struct *child, long request, | |||
154 | break; | 132 | break; |
155 | } | 133 | } |
156 | #endif | 134 | #endif |
157 | #ifdef PTRACE_ARCH_PRCTL | ||
158 | case PTRACE_ARCH_PRCTL: | ||
159 | /* XXX Calls ptrace on the host - needs some SMP thinking */ | ||
160 | ret = arch_prctl(child, data, (void __user *) addr); | ||
161 | break; | ||
162 | #endif | ||
163 | default: | 135 | default: |
164 | ret = ptrace_request(child, request, addr, data); | 136 | ret = ptrace_request(child, request, addr, data); |
165 | if (ret == -EIO) | 137 | if (ret == -EIO) |
diff --git a/arch/um/os-Linux/registers.c b/arch/um/os-Linux/registers.c index 830fe6a1518a..b866b9e3bef9 100644 --- a/arch/um/os-Linux/registers.c +++ b/arch/um/os-Linux/registers.c | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <string.h> | 8 | #include <string.h> |
9 | #include <sys/ptrace.h> | 9 | #include <sys/ptrace.h> |
10 | #include "sysdep/ptrace.h" | 10 | #include "sysdep/ptrace.h" |
11 | #include "sysdep/ptrace_user.h" | ||
12 | #include "registers.h" | ||
11 | 13 | ||
12 | int save_registers(int pid, struct uml_pt_regs *regs) | 14 | int save_registers(int pid, struct uml_pt_regs *regs) |
13 | { | 15 | { |
@@ -32,6 +34,7 @@ int restore_registers(int pid, struct uml_pt_regs *regs) | |||
32 | /* This is set once at boot time and not changed thereafter */ | 34 | /* This is set once at boot time and not changed thereafter */ |
33 | 35 | ||
34 | static unsigned long exec_regs[MAX_REG_NR]; | 36 | static unsigned long exec_regs[MAX_REG_NR]; |
37 | static unsigned long exec_fp_regs[FP_SIZE]; | ||
35 | 38 | ||
36 | int init_registers(int pid) | 39 | int init_registers(int pid) |
37 | { | 40 | { |
@@ -42,10 +45,14 @@ int init_registers(int pid) | |||
42 | return -errno; | 45 | return -errno; |
43 | 46 | ||
44 | arch_init_registers(pid); | 47 | arch_init_registers(pid); |
48 | get_fp_registers(pid, exec_fp_regs); | ||
45 | return 0; | 49 | return 0; |
46 | } | 50 | } |
47 | 51 | ||
48 | void get_safe_registers(unsigned long *regs) | 52 | void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) |
49 | { | 53 | { |
50 | memcpy(regs, exec_regs, sizeof(exec_regs)); | 54 | memcpy(regs, exec_regs, sizeof(exec_regs)); |
55 | |||
56 | if (fp_regs) | ||
57 | memcpy(fp_regs, exec_fp_regs, sizeof(exec_fp_regs)); | ||
51 | } | 58 | } |
diff --git a/arch/um/os-Linux/skas/mem.c b/arch/um/os-Linux/skas/mem.c index d261f170d120..e771398be5f3 100644 --- a/arch/um/os-Linux/skas/mem.c +++ b/arch/um/os-Linux/skas/mem.c | |||
@@ -39,7 +39,7 @@ static unsigned long syscall_regs[MAX_REG_NR]; | |||
39 | 39 | ||
40 | static int __init init_syscall_regs(void) | 40 | static int __init init_syscall_regs(void) |
41 | { | 41 | { |
42 | get_safe_registers(syscall_regs); | 42 | get_safe_registers(syscall_regs, NULL); |
43 | syscall_regs[REGS_IP_INDEX] = STUB_CODE + | 43 | syscall_regs[REGS_IP_INDEX] = STUB_CODE + |
44 | ((unsigned long) &batch_syscall_stub - | 44 | ((unsigned long) &batch_syscall_stub - |
45 | (unsigned long) &__syscall_stub_start); | 45 | (unsigned long) &__syscall_stub_start); |
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index d6e0a2234b86..dee0e8cf8ad0 100644 --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c | |||
@@ -373,6 +373,9 @@ void userspace(struct uml_pt_regs *regs) | |||
373 | if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) | 373 | if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) |
374 | fatal_sigsegv(); | 374 | fatal_sigsegv(); |
375 | 375 | ||
376 | if (put_fp_registers(pid, regs->fp)) | ||
377 | fatal_sigsegv(); | ||
378 | |||
376 | /* Now we set local_using_sysemu to be used for one loop */ | 379 | /* Now we set local_using_sysemu to be used for one loop */ |
377 | local_using_sysemu = get_using_sysemu(); | 380 | local_using_sysemu = get_using_sysemu(); |
378 | 381 | ||
@@ -399,6 +402,12 @@ void userspace(struct uml_pt_regs *regs) | |||
399 | fatal_sigsegv(); | 402 | fatal_sigsegv(); |
400 | } | 403 | } |
401 | 404 | ||
405 | if (get_fp_registers(pid, regs->fp)) { | ||
406 | printk(UM_KERN_ERR "userspace - get_fp_registers failed, " | ||
407 | "errno = %d\n", errno); | ||
408 | fatal_sigsegv(); | ||
409 | } | ||
410 | |||
402 | UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */ | 411 | UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */ |
403 | 412 | ||
404 | if (WIFSTOPPED(status)) { | 413 | if (WIFSTOPPED(status)) { |
@@ -457,10 +466,11 @@ void userspace(struct uml_pt_regs *regs) | |||
457 | } | 466 | } |
458 | 467 | ||
459 | static unsigned long thread_regs[MAX_REG_NR]; | 468 | static unsigned long thread_regs[MAX_REG_NR]; |
469 | static unsigned long thread_fp_regs[FP_SIZE]; | ||
460 | 470 | ||
461 | static int __init init_thread_regs(void) | 471 | static int __init init_thread_regs(void) |
462 | { | 472 | { |
463 | get_safe_registers(thread_regs); | 473 | get_safe_registers(thread_regs, thread_fp_regs); |
464 | /* Set parent's instruction pointer to start of clone-stub */ | 474 | /* Set parent's instruction pointer to start of clone-stub */ |
465 | thread_regs[REGS_IP_INDEX] = STUB_CODE + | 475 | thread_regs[REGS_IP_INDEX] = STUB_CODE + |
466 | (unsigned long) stub_clone_handler - | 476 | (unsigned long) stub_clone_handler - |
@@ -503,6 +513,13 @@ int copy_context_skas0(unsigned long new_stack, int pid) | |||
503 | return err; | 513 | return err; |
504 | } | 514 | } |
505 | 515 | ||
516 | err = put_fp_registers(pid, thread_fp_regs); | ||
517 | if (err < 0) { | ||
518 | printk(UM_KERN_ERR "copy_context_skas0 : put_fp_registers " | ||
519 | "failed, pid = %d, err = %d\n", pid, err); | ||
520 | return err; | ||
521 | } | ||
522 | |||
506 | /* set a well known return code for detection of child write failure */ | 523 | /* set a well known return code for detection of child write failure */ |
507 | child_data->err = 12345678; | 524 | child_data->err = 12345678; |
508 | 525 | ||
diff --git a/arch/um/sys-i386/asm/ptrace.h b/arch/um/sys-i386/asm/ptrace.h index 0273e4d09af7..5d2a59112537 100644 --- a/arch/um/sys-i386/asm/ptrace.h +++ b/arch/um/sys-i386/asm/ptrace.h | |||
@@ -42,11 +42,6 @@ | |||
42 | */ | 42 | */ |
43 | struct user_desc; | 43 | struct user_desc; |
44 | 44 | ||
45 | extern int get_fpxregs(struct user_fxsr_struct __user *buf, | ||
46 | struct task_struct *child); | ||
47 | extern int set_fpxregs(struct user_fxsr_struct __user *buf, | ||
48 | struct task_struct *tsk); | ||
49 | |||
50 | extern int ptrace_get_thread_area(struct task_struct *child, int idx, | 45 | extern int ptrace_get_thread_area(struct task_struct *child, int idx, |
51 | struct user_desc __user *user_desc); | 46 | struct user_desc __user *user_desc); |
52 | 47 | ||
diff --git a/arch/um/sys-i386/ptrace.c b/arch/um/sys-i386/ptrace.c index d23b2d3ea384..3375c2717851 100644 --- a/arch/um/sys-i386/ptrace.c +++ b/arch/um/sys-i386/ptrace.c | |||
@@ -145,7 +145,7 @@ int peek_user(struct task_struct *child, long addr, long data) | |||
145 | return put_user(tmp, (unsigned long __user *) data); | 145 | return put_user(tmp, (unsigned long __user *) data); |
146 | } | 146 | } |
147 | 147 | ||
148 | int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | 148 | static int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) |
149 | { | 149 | { |
150 | int err, n, cpu = ((struct thread_info *) child->stack)->cpu; | 150 | int err, n, cpu = ((struct thread_info *) child->stack)->cpu; |
151 | struct user_i387_struct fpregs; | 151 | struct user_i387_struct fpregs; |
@@ -161,7 +161,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | |||
161 | return n; | 161 | return n; |
162 | } | 162 | } |
163 | 163 | ||
164 | int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | 164 | static int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) |
165 | { | 165 | { |
166 | int n, cpu = ((struct thread_info *) child->stack)->cpu; | 166 | int n, cpu = ((struct thread_info *) child->stack)->cpu; |
167 | struct user_i387_struct fpregs; | 167 | struct user_i387_struct fpregs; |
@@ -174,7 +174,7 @@ int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | |||
174 | (unsigned long *) &fpregs); | 174 | (unsigned long *) &fpregs); |
175 | } | 175 | } |
176 | 176 | ||
177 | int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) | 177 | static int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) |
178 | { | 178 | { |
179 | int err, n, cpu = ((struct thread_info *) child->stack)->cpu; | 179 | int err, n, cpu = ((struct thread_info *) child->stack)->cpu; |
180 | struct user_fxsr_struct fpregs; | 180 | struct user_fxsr_struct fpregs; |
@@ -190,7 +190,7 @@ int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) | |||
190 | return n; | 190 | return n; |
191 | } | 191 | } |
192 | 192 | ||
193 | int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) | 193 | static int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) |
194 | { | 194 | { |
195 | int n, cpu = ((struct thread_info *) child->stack)->cpu; | 195 | int n, cpu = ((struct thread_info *) child->stack)->cpu; |
196 | struct user_fxsr_struct fpregs; | 196 | struct user_fxsr_struct fpregs; |
@@ -206,5 +206,23 @@ int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) | |||
206 | long subarch_ptrace(struct task_struct *child, long request, | 206 | long subarch_ptrace(struct task_struct *child, long request, |
207 | unsigned long addr, unsigned long data) | 207 | unsigned long addr, unsigned long data) |
208 | { | 208 | { |
209 | return -EIO; | 209 | int ret = -EIO; |
210 | void __user *datap = (void __user *) data; | ||
211 | switch (request) { | ||
212 | case PTRACE_GETFPREGS: /* Get the child FPU state. */ | ||
213 | ret = get_fpregs(datap, child); | ||
214 | break; | ||
215 | case PTRACE_SETFPREGS: /* Set the child FPU state. */ | ||
216 | ret = set_fpregs(datap, child); | ||
217 | break; | ||
218 | case PTRACE_GETFPXREGS: /* Get the child FPU state. */ | ||
219 | ret = get_fpxregs(datap, child); | ||
220 | break; | ||
221 | case PTRACE_SETFPXREGS: /* Set the child FPU state. */ | ||
222 | ret = set_fpxregs(datap, child); | ||
223 | break; | ||
224 | default: | ||
225 | ret = -EIO; | ||
226 | } | ||
227 | return ret; | ||
210 | } | 228 | } |
diff --git a/arch/um/sys-i386/shared/sysdep/ptrace.h b/arch/um/sys-i386/shared/sysdep/ptrace.h index d50e62e07070..c398a5076111 100644 --- a/arch/um/sys-i386/shared/sysdep/ptrace.h +++ b/arch/um/sys-i386/shared/sysdep/ptrace.h | |||
@@ -53,6 +53,7 @@ extern int sysemu_supported; | |||
53 | 53 | ||
54 | struct uml_pt_regs { | 54 | struct uml_pt_regs { |
55 | unsigned long gp[MAX_REG_NR]; | 55 | unsigned long gp[MAX_REG_NR]; |
56 | unsigned long fp[HOST_FPX_SIZE]; | ||
56 | struct faultinfo faultinfo; | 57 | struct faultinfo faultinfo; |
57 | long syscall; | 58 | long syscall; |
58 | int is_user; | 59 | int is_user; |
diff --git a/arch/um/sys-x86_64/ptrace.c b/arch/um/sys-x86_64/ptrace.c index f43613643cdb..4005506834fd 100644 --- a/arch/um/sys-x86_64/ptrace.c +++ b/arch/um/sys-x86_64/ptrace.c | |||
@@ -145,7 +145,7 @@ int is_syscall(unsigned long addr) | |||
145 | return instr == 0x050f; | 145 | return instr == 0x050f; |
146 | } | 146 | } |
147 | 147 | ||
148 | int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | 148 | static int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) |
149 | { | 149 | { |
150 | int err, n, cpu = ((struct thread_info *) child->stack)->cpu; | 150 | int err, n, cpu = ((struct thread_info *) child->stack)->cpu; |
151 | long fpregs[HOST_FP_SIZE]; | 151 | long fpregs[HOST_FP_SIZE]; |
@@ -162,7 +162,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | |||
162 | return n; | 162 | return n; |
163 | } | 163 | } |
164 | 164 | ||
165 | int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) | 165 | static int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) |
166 | { | 166 | { |
167 | int n, cpu = ((struct thread_info *) child->stack)->cpu; | 167 | int n, cpu = ((struct thread_info *) child->stack)->cpu; |
168 | long fpregs[HOST_FP_SIZE]; | 168 | long fpregs[HOST_FP_SIZE]; |
@@ -182,12 +182,16 @@ long subarch_ptrace(struct task_struct *child, long request, | |||
182 | void __user *datap = (void __user *) data; | 182 | void __user *datap = (void __user *) data; |
183 | 183 | ||
184 | switch (request) { | 184 | switch (request) { |
185 | case PTRACE_GETFPXREGS: /* Get the child FPU state. */ | 185 | case PTRACE_GETFPREGS: /* Get the child FPU state. */ |
186 | ret = get_fpregs(datap, child); | 186 | ret = get_fpregs(datap, child); |
187 | break; | 187 | break; |
188 | case PTRACE_SETFPXREGS: /* Set the child FPU state. */ | 188 | case PTRACE_SETFPREGS: /* Set the child FPU state. */ |
189 | ret = set_fpregs(datap, child); | 189 | ret = set_fpregs(datap, child); |
190 | break; | 190 | break; |
191 | case PTRACE_ARCH_PRCTL: | ||
192 | /* XXX Calls ptrace on the host - needs some SMP thinking */ | ||
193 | ret = arch_prctl(child, data, (void __user *) addr); | ||
194 | break; | ||
191 | } | 195 | } |
192 | 196 | ||
193 | return ret; | 197 | return ret; |
diff --git a/arch/um/sys-x86_64/shared/sysdep/ptrace.h b/arch/um/sys-x86_64/shared/sysdep/ptrace.h index fdba5457947a..8ee8f8e12af1 100644 --- a/arch/um/sys-x86_64/shared/sysdep/ptrace.h +++ b/arch/um/sys-x86_64/shared/sysdep/ptrace.h | |||
@@ -85,6 +85,7 @@ | |||
85 | 85 | ||
86 | struct uml_pt_regs { | 86 | struct uml_pt_regs { |
87 | unsigned long gp[MAX_REG_NR]; | 87 | unsigned long gp[MAX_REG_NR]; |
88 | unsigned long fp[HOST_FP_SIZE]; | ||
88 | struct faultinfo faultinfo; | 89 | struct faultinfo faultinfo; |
89 | long syscall; | 90 | long syscall; |
90 | int is_user; | 91 | int is_user; |
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index a0e866d233ee..54edb207ff3a 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S | |||
@@ -672,7 +672,7 @@ ia32_sys_call_table: | |||
672 | .quad sys32_vm86_warning /* vm86 */ | 672 | .quad sys32_vm86_warning /* vm86 */ |
673 | .quad quiet_ni_syscall /* query_module */ | 673 | .quad quiet_ni_syscall /* query_module */ |
674 | .quad sys_poll | 674 | .quad sys_poll |
675 | .quad compat_sys_nfsservctl | 675 | .quad quiet_ni_syscall /* old nfsservctl */ |
676 | .quad sys_setresgid16 /* 170 */ | 676 | .quad sys_setresgid16 /* 170 */ |
677 | .quad sys_getresgid16 | 677 | .quad sys_getresgid16 |
678 | .quad sys_prctl | 678 | .quad sys_prctl |
diff --git a/arch/x86/include/asm/alternative-asm.h b/arch/x86/include/asm/alternative-asm.h index 4554cc6fb96a..091508b533b4 100644 --- a/arch/x86/include/asm/alternative-asm.h +++ b/arch/x86/include/asm/alternative-asm.h | |||
@@ -16,7 +16,6 @@ | |||
16 | #endif | 16 | #endif |
17 | 17 | ||
18 | .macro altinstruction_entry orig alt feature orig_len alt_len | 18 | .macro altinstruction_entry orig alt feature orig_len alt_len |
19 | .align 8 | ||
20 | .long \orig - . | 19 | .long \orig - . |
21 | .long \alt - . | 20 | .long \alt - . |
22 | .word \feature | 21 | .word \feature |
diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h index 23fb6d79f209..37ad100a2210 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h | |||
@@ -48,9 +48,6 @@ struct alt_instr { | |||
48 | u16 cpuid; /* cpuid bit set for replacement */ | 48 | u16 cpuid; /* cpuid bit set for replacement */ |
49 | u8 instrlen; /* length of original instruction */ | 49 | u8 instrlen; /* length of original instruction */ |
50 | u8 replacementlen; /* length of new instruction, <= instrlen */ | 50 | u8 replacementlen; /* length of new instruction, <= instrlen */ |
51 | #ifdef CONFIG_X86_64 | ||
52 | u32 pad2; | ||
53 | #endif | ||
54 | }; | 51 | }; |
55 | 52 | ||
56 | extern void alternative_instructions(void); | 53 | extern void alternative_instructions(void); |
@@ -83,7 +80,6 @@ static inline int alternatives_text_reserved(void *start, void *end) | |||
83 | \ | 80 | \ |
84 | "661:\n\t" oldinstr "\n662:\n" \ | 81 | "661:\n\t" oldinstr "\n662:\n" \ |
85 | ".section .altinstructions,\"a\"\n" \ | 82 | ".section .altinstructions,\"a\"\n" \ |
86 | _ASM_ALIGN "\n" \ | ||
87 | " .long 661b - .\n" /* label */ \ | 83 | " .long 661b - .\n" /* label */ \ |
88 | " .long 663f - .\n" /* new instruction */ \ | 84 | " .long 663f - .\n" /* new instruction */ \ |
89 | " .word " __stringify(feature) "\n" /* feature bit */ \ | 85 | " .word " __stringify(feature) "\n" /* feature bit */ \ |
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index 4258aac99a6e..88b23a43f340 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
@@ -332,7 +332,6 @@ static __always_inline __pure bool __static_cpu_has(u16 bit) | |||
332 | asm goto("1: jmp %l[t_no]\n" | 332 | asm goto("1: jmp %l[t_no]\n" |
333 | "2:\n" | 333 | "2:\n" |
334 | ".section .altinstructions,\"a\"\n" | 334 | ".section .altinstructions,\"a\"\n" |
335 | _ASM_ALIGN "\n" | ||
336 | " .long 1b - .\n" | 335 | " .long 1b - .\n" |
337 | " .long 0\n" /* no replacement */ | 336 | " .long 0\n" /* no replacement */ |
338 | " .word %P0\n" /* feature bit */ | 337 | " .word %P0\n" /* feature bit */ |
@@ -350,7 +349,6 @@ static __always_inline __pure bool __static_cpu_has(u16 bit) | |||
350 | asm volatile("1: movb $0,%0\n" | 349 | asm volatile("1: movb $0,%0\n" |
351 | "2:\n" | 350 | "2:\n" |
352 | ".section .altinstructions,\"a\"\n" | 351 | ".section .altinstructions,\"a\"\n" |
353 | _ASM_ALIGN "\n" | ||
354 | " .long 1b - .\n" | 352 | " .long 1b - .\n" |
355 | " .long 3f - .\n" | 353 | " .long 3f - .\n" |
356 | " .word %P1\n" /* feature bit */ | 354 | " .word %P1\n" /* feature bit */ |
diff --git a/arch/x86/include/asm/pvclock.h b/arch/x86/include/asm/pvclock.h index a518c0a45044..c59cc97fe6c1 100644 --- a/arch/x86/include/asm/pvclock.h +++ b/arch/x86/include/asm/pvclock.h | |||
@@ -44,7 +44,7 @@ static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift) | |||
44 | : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) ); | 44 | : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) ); |
45 | #elif defined(__x86_64__) | 45 | #elif defined(__x86_64__) |
46 | __asm__ ( | 46 | __asm__ ( |
47 | "mul %[mul_frac] ; shrd $32, %[hi], %[lo]" | 47 | "mulq %[mul_frac] ; shrd $32, %[hi], %[lo]" |
48 | : [lo]"=a"(product), | 48 | : [lo]"=a"(product), |
49 | [hi]"=d"(tmp) | 49 | [hi]"=d"(tmp) |
50 | : "0"(delta), | 50 | : "0"(delta), |
diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h index d92641cc7acc..201040573444 100644 --- a/arch/x86/include/asm/unistd_64.h +++ b/arch/x86/include/asm/unistd_64.h | |||
@@ -414,7 +414,7 @@ __SYSCALL(__NR_query_module, sys_ni_syscall) | |||
414 | __SYSCALL(__NR_quotactl, sys_quotactl) | 414 | __SYSCALL(__NR_quotactl, sys_quotactl) |
415 | 415 | ||
416 | #define __NR_nfsservctl 180 | 416 | #define __NR_nfsservctl 180 |
417 | __SYSCALL(__NR_nfsservctl, sys_nfsservctl) | 417 | __SYSCALL(__NR_nfsservctl, sys_ni_syscall) |
418 | 418 | ||
419 | /* reserved for LiS/STREAMS */ | 419 | /* reserved for LiS/STREAMS */ |
420 | #define __NR_getpmsg 181 | 420 | #define __NR_getpmsg 181 |
diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h index 64a619d47d34..7ff4669580cf 100644 --- a/arch/x86/include/asm/xen/page.h +++ b/arch/x86/include/asm/xen/page.h | |||
@@ -39,7 +39,7 @@ typedef struct xpaddr { | |||
39 | ((unsigned long)((u64)CONFIG_XEN_MAX_DOMAIN_MEMORY * 1024 * 1024 * 1024 / PAGE_SIZE)) | 39 | ((unsigned long)((u64)CONFIG_XEN_MAX_DOMAIN_MEMORY * 1024 * 1024 * 1024 / PAGE_SIZE)) |
40 | 40 | ||
41 | extern unsigned long *machine_to_phys_mapping; | 41 | extern unsigned long *machine_to_phys_mapping; |
42 | extern unsigned int machine_to_phys_order; | 42 | extern unsigned long machine_to_phys_nr; |
43 | 43 | ||
44 | extern unsigned long get_phys_to_machine(unsigned long pfn); | 44 | extern unsigned long get_phys_to_machine(unsigned long pfn); |
45 | extern bool set_phys_to_machine(unsigned long pfn, unsigned long mfn); | 45 | extern bool set_phys_to_machine(unsigned long pfn, unsigned long mfn); |
@@ -87,7 +87,7 @@ static inline unsigned long mfn_to_pfn(unsigned long mfn) | |||
87 | if (xen_feature(XENFEAT_auto_translated_physmap)) | 87 | if (xen_feature(XENFEAT_auto_translated_physmap)) |
88 | return mfn; | 88 | return mfn; |
89 | 89 | ||
90 | if (unlikely((mfn >> machine_to_phys_order) != 0)) { | 90 | if (unlikely(mfn >= machine_to_phys_nr)) { |
91 | pfn = ~0; | 91 | pfn = ~0; |
92 | goto try_override; | 92 | goto try_override; |
93 | } | 93 | } |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index adc66c3a1fef..34b18594e724 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -207,7 +207,6 @@ static int __cpuinit uv_wakeup_secondary(int phys_apicid, unsigned long start_ri | |||
207 | ((start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) | | 207 | ((start_rip << UVH_IPI_INT_VECTOR_SHFT) >> 12) | |
208 | APIC_DM_INIT; | 208 | APIC_DM_INIT; |
209 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); | 209 | uv_write_global_mmr64(pnode, UVH_IPI_INT, val); |
210 | mdelay(10); | ||
211 | 210 | ||
212 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | | 211 | val = (1UL << UVH_IPI_INT_SEND_SHFT) | |
213 | (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) | | 212 | (phys_apicid << UVH_IPI_INT_APIC_ID_SHFT) | |
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c index 08119a37e53c..6b96110bb0c3 100644 --- a/arch/x86/kernel/cpu/mtrr/main.c +++ b/arch/x86/kernel/cpu/mtrr/main.c | |||
@@ -149,7 +149,6 @@ struct set_mtrr_data { | |||
149 | */ | 149 | */ |
150 | static int mtrr_rendezvous_handler(void *info) | 150 | static int mtrr_rendezvous_handler(void *info) |
151 | { | 151 | { |
152 | #ifdef CONFIG_SMP | ||
153 | struct set_mtrr_data *data = info; | 152 | struct set_mtrr_data *data = info; |
154 | 153 | ||
155 | /* | 154 | /* |
@@ -171,7 +170,6 @@ static int mtrr_rendezvous_handler(void *info) | |||
171 | } else if (mtrr_aps_delayed_init || !cpu_online(smp_processor_id())) { | 170 | } else if (mtrr_aps_delayed_init || !cpu_online(smp_processor_id())) { |
172 | mtrr_if->set_all(); | 171 | mtrr_if->set_all(); |
173 | } | 172 | } |
174 | #endif | ||
175 | return 0; | 173 | return 0; |
176 | } | 174 | } |
177 | 175 | ||
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 4ee3abf20ed6..cfa62ec090ec 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -1900,6 +1900,9 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) | |||
1900 | 1900 | ||
1901 | perf_callchain_store(entry, regs->ip); | 1901 | perf_callchain_store(entry, regs->ip); |
1902 | 1902 | ||
1903 | if (!current->mm) | ||
1904 | return; | ||
1905 | |||
1903 | if (perf_callchain_user32(regs, entry)) | 1906 | if (perf_callchain_user32(regs, entry)) |
1904 | return; | 1907 | return; |
1905 | 1908 | ||
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index 5c1a91974918..f3f6f5344001 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -54,6 +54,7 @@ | |||
54 | #include <asm/ftrace.h> | 54 | #include <asm/ftrace.h> |
55 | #include <asm/irq_vectors.h> | 55 | #include <asm/irq_vectors.h> |
56 | #include <asm/cpufeature.h> | 56 | #include <asm/cpufeature.h> |
57 | #include <asm/alternative-asm.h> | ||
57 | 58 | ||
58 | /* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this. */ | 59 | /* Avoid __ASSEMBLER__'ifying <linux/audit.h> just for this. */ |
59 | #include <linux/elf-em.h> | 60 | #include <linux/elf-em.h> |
@@ -873,12 +874,7 @@ ENTRY(simd_coprocessor_error) | |||
873 | 661: pushl_cfi $do_general_protection | 874 | 661: pushl_cfi $do_general_protection |
874 | 662: | 875 | 662: |
875 | .section .altinstructions,"a" | 876 | .section .altinstructions,"a" |
876 | .balign 4 | 877 | altinstruction_entry 661b, 663f, X86_FEATURE_XMM, 662b-661b, 664f-663f |
877 | .long 661b | ||
878 | .long 663f | ||
879 | .word X86_FEATURE_XMM | ||
880 | .byte 662b-661b | ||
881 | .byte 664f-663f | ||
882 | .previous | 878 | .previous |
883 | .section .altinstr_replacement,"ax" | 879 | .section .altinstr_replacement,"ax" |
884 | 663: pushl $do_simd_coprocessor_error | 880 | 663: pushl $do_simd_coprocessor_error |
diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S index fbb0a045a1a2..bc19be332bc9 100644 --- a/arch/x86/kernel/syscall_table_32.S +++ b/arch/x86/kernel/syscall_table_32.S | |||
@@ -168,7 +168,7 @@ ENTRY(sys_call_table) | |||
168 | .long ptregs_vm86 | 168 | .long ptregs_vm86 |
169 | .long sys_ni_syscall /* Old sys_query_module */ | 169 | .long sys_ni_syscall /* Old sys_query_module */ |
170 | .long sys_poll | 170 | .long sys_poll |
171 | .long sys_nfsservctl | 171 | .long sys_ni_syscall /* Old nfsservctl */ |
172 | .long sys_setresgid16 /* 170 */ | 172 | .long sys_setresgid16 /* 170 */ |
173 | .long sys_getresgid16 | 173 | .long sys_getresgid16 |
174 | .long sys_prctl | 174 | .long sys_prctl |
diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 988724b236b6..ff5790d8e990 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig | |||
@@ -22,6 +22,8 @@ config KVM | |||
22 | depends on HAVE_KVM | 22 | depends on HAVE_KVM |
23 | # for device assignment: | 23 | # for device assignment: |
24 | depends on PCI | 24 | depends on PCI |
25 | # for TASKSTATS/TASK_DELAY_ACCT: | ||
26 | depends on NET | ||
25 | select PREEMPT_NOTIFIERS | 27 | select PREEMPT_NOTIFIERS |
26 | select MMU_NOTIFIER | 28 | select MMU_NOTIFIER |
27 | select ANON_INODES | 29 | select ANON_INODES |
@@ -31,6 +33,7 @@ config KVM | |||
31 | select KVM_ASYNC_PF | 33 | select KVM_ASYNC_PF |
32 | select USER_RETURN_NOTIFIER | 34 | select USER_RETURN_NOTIFIER |
33 | select KVM_MMIO | 35 | select KVM_MMIO |
36 | select TASKSTATS | ||
34 | select TASK_DELAY_ACCT | 37 | select TASK_DELAY_ACCT |
35 | ---help--- | 38 | ---help--- |
36 | Support hosting fully virtualized guest machines using hardware | 39 | Support hosting fully virtualized guest machines using hardware |
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 247aae3dc008..0d17c8c50acd 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/traps.h> /* dotraplinkage, ... */ | 17 | #include <asm/traps.h> /* dotraplinkage, ... */ |
18 | #include <asm/pgalloc.h> /* pgd_*(), ... */ | 18 | #include <asm/pgalloc.h> /* pgd_*(), ... */ |
19 | #include <asm/kmemcheck.h> /* kmemcheck_*(), ... */ | 19 | #include <asm/kmemcheck.h> /* kmemcheck_*(), ... */ |
20 | #include <asm/vsyscall.h> | ||
20 | 21 | ||
21 | /* | 22 | /* |
22 | * Page fault error code bits: | 23 | * Page fault error code bits: |
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index ae3cb23cd89b..039d91315bc5 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
@@ -360,6 +360,20 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root) | |||
360 | } | 360 | } |
361 | } | 361 | } |
362 | 362 | ||
363 | /* After the PCI-E bus has been walked and all devices discovered, | ||
364 | * configure any settings of the fabric that might be necessary. | ||
365 | */ | ||
366 | if (bus) { | ||
367 | struct pci_bus *child; | ||
368 | list_for_each_entry(child, &bus->children, node) { | ||
369 | struct pci_dev *self = child->self; | ||
370 | if (!self) | ||
371 | continue; | ||
372 | |||
373 | pcie_bus_configure_settings(child, self->pcie_mpss); | ||
374 | } | ||
375 | } | ||
376 | |||
363 | if (!bus) | 377 | if (!bus) |
364 | kfree(sd); | 378 | kfree(sd); |
365 | 379 | ||
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c index 7000e74b3087..58425adc22c6 100644 --- a/arch/x86/platform/mrst/mrst.c +++ b/arch/x86/platform/mrst/mrst.c | |||
@@ -689,7 +689,9 @@ static int __init sfi_parse_devs(struct sfi_table_header *table) | |||
689 | irq_attr.trigger = 1; | 689 | irq_attr.trigger = 1; |
690 | irq_attr.polarity = 1; | 690 | irq_attr.polarity = 1; |
691 | io_apic_set_pci_routing(NULL, pentry->irq, &irq_attr); | 691 | io_apic_set_pci_routing(NULL, pentry->irq, &irq_attr); |
692 | } | 692 | } else |
693 | pentry->irq = 0; /* No irq */ | ||
694 | |||
693 | switch (pentry->type) { | 695 | switch (pentry->type) { |
694 | case SFI_DEV_TYPE_IPC: | 696 | case SFI_DEV_TYPE_IPC: |
695 | /* ID as IRQ is a hack that will go away */ | 697 | /* ID as IRQ is a hack that will go away */ |
diff --git a/arch/x86/platform/olpc/olpc.c b/arch/x86/platform/olpc/olpc.c index 8b9940e78e2f..7cce722667b8 100644 --- a/arch/x86/platform/olpc/olpc.c +++ b/arch/x86/platform/olpc/olpc.c | |||
@@ -161,13 +161,13 @@ restart: | |||
161 | if (inbuf && inlen) { | 161 | if (inbuf && inlen) { |
162 | /* write data to EC */ | 162 | /* write data to EC */ |
163 | for (i = 0; i < inlen; i++) { | 163 | for (i = 0; i < inlen; i++) { |
164 | pr_devel("olpc-ec: sending cmd arg 0x%x\n", inbuf[i]); | ||
165 | outb(inbuf[i], 0x68); | ||
164 | if (wait_on_ibf(0x6c, 0)) { | 166 | if (wait_on_ibf(0x6c, 0)) { |
165 | printk(KERN_ERR "olpc-ec: timeout waiting for" | 167 | printk(KERN_ERR "olpc-ec: timeout waiting for" |
166 | " EC accept data!\n"); | 168 | " EC accept data!\n"); |
167 | goto err; | 169 | goto err; |
168 | } | 170 | } |
169 | pr_devel("olpc-ec: sending cmd arg 0x%x\n", inbuf[i]); | ||
170 | outb(inbuf[i], 0x68); | ||
171 | } | 171 | } |
172 | } | 172 | } |
173 | if (outbuf && outlen) { | 173 | if (outbuf && outlen) { |
diff --git a/arch/x86/vdso/vdso32/sysenter.S b/arch/x86/vdso/vdso32/sysenter.S index e2800affa754..e354bceee0e0 100644 --- a/arch/x86/vdso/vdso32/sysenter.S +++ b/arch/x86/vdso/vdso32/sysenter.S | |||
@@ -43,7 +43,7 @@ __kernel_vsyscall: | |||
43 | .space 7,0x90 | 43 | .space 7,0x90 |
44 | 44 | ||
45 | /* 14: System call restart point is here! (SYSENTER_RETURN-2) */ | 45 | /* 14: System call restart point is here! (SYSENTER_RETURN-2) */ |
46 | jmp .Lenter_kernel | 46 | int $0x80 |
47 | /* 16: System call normal return point is here! */ | 47 | /* 16: System call normal return point is here! */ |
48 | VDSO32_SYSENTER_RETURN: /* Symbol used by sysenter.c via vdso32-syms.h */ | 48 | VDSO32_SYSENTER_RETURN: /* Symbol used by sysenter.c via vdso32-syms.h */ |
49 | pop %ebp | 49 | pop %ebp |
diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile index 3326204e251f..add2c2d729ce 100644 --- a/arch/x86/xen/Makefile +++ b/arch/x86/xen/Makefile | |||
@@ -15,7 +15,7 @@ obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ | |||
15 | grant-table.o suspend.o platform-pci-unplug.o \ | 15 | grant-table.o suspend.o platform-pci-unplug.o \ |
16 | p2m.o | 16 | p2m.o |
17 | 17 | ||
18 | obj-$(CONFIG_FTRACE) += trace.o | 18 | obj-$(CONFIG_EVENT_TRACING) += trace.o |
19 | 19 | ||
20 | obj-$(CONFIG_SMP) += smp.o | 20 | obj-$(CONFIG_SMP) += smp.o |
21 | obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o | 21 | obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index e2345af01af0..2d69617950f7 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -77,8 +77,8 @@ EXPORT_SYMBOL_GPL(xen_domain_type); | |||
77 | 77 | ||
78 | unsigned long *machine_to_phys_mapping = (void *)MACH2PHYS_VIRT_START; | 78 | unsigned long *machine_to_phys_mapping = (void *)MACH2PHYS_VIRT_START; |
79 | EXPORT_SYMBOL(machine_to_phys_mapping); | 79 | EXPORT_SYMBOL(machine_to_phys_mapping); |
80 | unsigned int machine_to_phys_order; | 80 | unsigned long machine_to_phys_nr; |
81 | EXPORT_SYMBOL(machine_to_phys_order); | 81 | EXPORT_SYMBOL(machine_to_phys_nr); |
82 | 82 | ||
83 | struct start_info *xen_start_info; | 83 | struct start_info *xen_start_info; |
84 | EXPORT_SYMBOL_GPL(xen_start_info); | 84 | EXPORT_SYMBOL_GPL(xen_start_info); |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 8cce339db5e7..3dd53f997b11 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1713,15 +1713,17 @@ static void __init xen_map_identity_early(pmd_t *pmd, unsigned long max_pfn) | |||
1713 | void __init xen_setup_machphys_mapping(void) | 1713 | void __init xen_setup_machphys_mapping(void) |
1714 | { | 1714 | { |
1715 | struct xen_machphys_mapping mapping; | 1715 | struct xen_machphys_mapping mapping; |
1716 | unsigned long machine_to_phys_nr_ents; | ||
1717 | 1716 | ||
1718 | if (HYPERVISOR_memory_op(XENMEM_machphys_mapping, &mapping) == 0) { | 1717 | if (HYPERVISOR_memory_op(XENMEM_machphys_mapping, &mapping) == 0) { |
1719 | machine_to_phys_mapping = (unsigned long *)mapping.v_start; | 1718 | machine_to_phys_mapping = (unsigned long *)mapping.v_start; |
1720 | machine_to_phys_nr_ents = mapping.max_mfn + 1; | 1719 | machine_to_phys_nr = mapping.max_mfn + 1; |
1721 | } else { | 1720 | } else { |
1722 | machine_to_phys_nr_ents = MACH2PHYS_NR_ENTRIES; | 1721 | machine_to_phys_nr = MACH2PHYS_NR_ENTRIES; |
1723 | } | 1722 | } |
1724 | machine_to_phys_order = fls(machine_to_phys_nr_ents - 1); | 1723 | #ifdef CONFIG_X86_32 |
1724 | WARN_ON((machine_to_phys_mapping + (machine_to_phys_nr - 1)) | ||
1725 | < machine_to_phys_mapping); | ||
1726 | #endif | ||
1725 | } | 1727 | } |
1726 | 1728 | ||
1727 | #ifdef CONFIG_X86_64 | 1729 | #ifdef CONFIG_X86_64 |
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index df118a825f39..46d6d21dbdbe 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
@@ -184,6 +184,19 @@ static unsigned long __init xen_set_identity(const struct e820entry *list, | |||
184 | PFN_UP(start_pci), PFN_DOWN(last)); | 184 | PFN_UP(start_pci), PFN_DOWN(last)); |
185 | return identity; | 185 | return identity; |
186 | } | 186 | } |
187 | |||
188 | static unsigned long __init xen_get_max_pages(void) | ||
189 | { | ||
190 | unsigned long max_pages = MAX_DOMAIN_PAGES; | ||
191 | domid_t domid = DOMID_SELF; | ||
192 | int ret; | ||
193 | |||
194 | ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid); | ||
195 | if (ret > 0) | ||
196 | max_pages = ret; | ||
197 | return min(max_pages, MAX_DOMAIN_PAGES); | ||
198 | } | ||
199 | |||
187 | /** | 200 | /** |
188 | * machine_specific_memory_setup - Hook for machine specific memory setup. | 201 | * machine_specific_memory_setup - Hook for machine specific memory setup. |
189 | **/ | 202 | **/ |
@@ -292,6 +305,14 @@ char * __init xen_memory_setup(void) | |||
292 | 305 | ||
293 | sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); | 306 | sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); |
294 | 307 | ||
308 | extra_limit = xen_get_max_pages(); | ||
309 | if (max_pfn + extra_pages > extra_limit) { | ||
310 | if (extra_limit > max_pfn) | ||
311 | extra_pages = extra_limit - max_pfn; | ||
312 | else | ||
313 | extra_pages = 0; | ||
314 | } | ||
315 | |||
295 | extra_pages += xen_return_unused_memory(xen_start_info->nr_pages, &e820); | 316 | extra_pages += xen_return_unused_memory(xen_start_info->nr_pages, &e820); |
296 | 317 | ||
297 | /* | 318 | /* |
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index b4533a86d7e4..041d4fe9dfe4 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <xen/page.h> | 32 | #include <xen/page.h> |
33 | #include <xen/events.h> | 33 | #include <xen/events.h> |
34 | 34 | ||
35 | #include <xen/hvc-console.h> | ||
35 | #include "xen-ops.h" | 36 | #include "xen-ops.h" |
36 | #include "mmu.h" | 37 | #include "mmu.h" |
37 | 38 | ||
@@ -207,6 +208,15 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus) | |||
207 | unsigned cpu; | 208 | unsigned cpu; |
208 | unsigned int i; | 209 | unsigned int i; |
209 | 210 | ||
211 | if (skip_ioapic_setup) { | ||
212 | char *m = (max_cpus == 0) ? | ||
213 | "The nosmp parameter is incompatible with Xen; " \ | ||
214 | "use Xen dom0_max_vcpus=1 parameter" : | ||
215 | "The noapic parameter is incompatible with Xen"; | ||
216 | |||
217 | xen_raw_printk(m); | ||
218 | panic(m); | ||
219 | } | ||
210 | xen_init_lock_cpu(0); | 220 | xen_init_lock_cpu(0); |
211 | 221 | ||
212 | smp_store_cpu_info(0); | 222 | smp_store_cpu_info(0); |
@@ -521,10 +531,7 @@ static void __init xen_hvm_smp_prepare_cpus(unsigned int max_cpus) | |||
521 | native_smp_prepare_cpus(max_cpus); | 531 | native_smp_prepare_cpus(max_cpus); |
522 | WARN_ON(xen_smp_intr_init(0)); | 532 | WARN_ON(xen_smp_intr_init(0)); |
523 | 533 | ||
524 | if (!xen_have_vector_callback) | ||
525 | return; | ||
526 | xen_init_lock_cpu(0); | 534 | xen_init_lock_cpu(0); |
527 | xen_init_spinlocks(); | ||
528 | } | 535 | } |
529 | 536 | ||
530 | static int __cpuinit xen_hvm_cpu_up(unsigned int cpu) | 537 | static int __cpuinit xen_hvm_cpu_up(unsigned int cpu) |
@@ -546,6 +553,8 @@ static void xen_hvm_cpu_die(unsigned int cpu) | |||
546 | 553 | ||
547 | void __init xen_hvm_smp_init(void) | 554 | void __init xen_hvm_smp_init(void) |
548 | { | 555 | { |
556 | if (!xen_have_vector_callback) | ||
557 | return; | ||
549 | smp_ops.smp_prepare_cpus = xen_hvm_smp_prepare_cpus; | 558 | smp_ops.smp_prepare_cpus = xen_hvm_smp_prepare_cpus; |
550 | smp_ops.smp_send_reschedule = xen_smp_send_reschedule; | 559 | smp_ops.smp_send_reschedule = xen_smp_send_reschedule; |
551 | smp_ops.cpu_up = xen_hvm_cpu_up; | 560 | smp_ops.cpu_up = xen_hvm_cpu_up; |
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 5158c505bef9..163b4679556e 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c | |||
@@ -168,9 +168,10 @@ cycle_t xen_clocksource_read(void) | |||
168 | struct pvclock_vcpu_time_info *src; | 168 | struct pvclock_vcpu_time_info *src; |
169 | cycle_t ret; | 169 | cycle_t ret; |
170 | 170 | ||
171 | src = &get_cpu_var(xen_vcpu)->time; | 171 | preempt_disable_notrace(); |
172 | src = &__get_cpu_var(xen_vcpu)->time; | ||
172 | ret = pvclock_clocksource_read(src); | 173 | ret = pvclock_clocksource_read(src); |
173 | put_cpu_var(xen_vcpu); | 174 | preempt_enable_notrace(); |
174 | return ret; | 175 | return ret; |
175 | } | 176 | } |
176 | 177 | ||
diff --git a/arch/x86/xen/xen-asm_32.S b/arch/x86/xen/xen-asm_32.S index 22a2093b5862..b040b0e518ca 100644 --- a/arch/x86/xen/xen-asm_32.S +++ b/arch/x86/xen/xen-asm_32.S | |||
@@ -113,11 +113,13 @@ xen_iret_start_crit: | |||
113 | 113 | ||
114 | /* | 114 | /* |
115 | * If there's something pending, mask events again so we can | 115 | * If there's something pending, mask events again so we can |
116 | * jump back into xen_hypervisor_callback | 116 | * jump back into xen_hypervisor_callback. Otherwise do not |
117 | * touch XEN_vcpu_info_mask. | ||
117 | */ | 118 | */ |
118 | sete XEN_vcpu_info_mask(%eax) | 119 | jne 1f |
120 | movb $1, XEN_vcpu_info_mask(%eax) | ||
119 | 121 | ||
120 | popl %eax | 122 | 1: popl %eax |
121 | 123 | ||
122 | /* | 124 | /* |
123 | * From this point on the registers are restored and the stack | 125 | * From this point on the registers are restored and the stack |
diff --git a/arch/xtensa/include/asm/unistd.h b/arch/xtensa/include/asm/unistd.h index a6f934f37f1a..798ee6d285a1 100644 --- a/arch/xtensa/include/asm/unistd.h +++ b/arch/xtensa/include/asm/unistd.h | |||
@@ -455,7 +455,7 @@ __SYSCALL(203, sys_reboot, 3) | |||
455 | #define __NR_quotactl 204 | 455 | #define __NR_quotactl 204 |
456 | __SYSCALL(204, sys_quotactl, 4) | 456 | __SYSCALL(204, sys_quotactl, 4) |
457 | #define __NR_nfsservctl 205 | 457 | #define __NR_nfsservctl 205 |
458 | __SYSCALL(205, sys_nfsservctl, 3) | 458 | __SYSCALL(205, sys_ni_syscall, 0) |
459 | #define __NR__sysctl 206 | 459 | #define __NR__sysctl 206 |
460 | __SYSCALL(206, sys_sysctl, 1) | 460 | __SYSCALL(206, sys_sysctl, 1) |
461 | #define __NR_bdflush 207 | 461 | #define __NR_bdflush 207 |