diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-10-07 17:07:41 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-10-07 17:07:41 -0400 |
commit | 8efc59ad6764ade520012cb192cd484e5191cd9c (patch) | |
tree | d2465d91ebb2652e35cd08f715fc202b3f9e042a /arch | |
parent | 6f6184a9d01880a3e21349544f73b3720ce5e152 (diff) | |
parent | 492c4a0df11573e141a2decc6012b3bddd14a11e (diff) |
Merge branch 'sirf/cleanup' into next/cleanup
Diffstat (limited to 'arch')
41 files changed, 174 insertions, 166 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/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/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-exynos4/clock.c b/arch/arm/mach-exynos4/clock.c index 1561b036a9bf..79d6cd0c8e7b 100644 --- a/arch/arm/mach-exynos4/clock.c +++ b/arch/arm/mach-exynos4/clock.c | |||
@@ -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/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-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c index fcf0ae95651f..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 |
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-prima2/clock.c b/arch/arm/mach-prima2/clock.c index 615a4e75ceab..aebad7e565cf 100644 --- a/arch/arm/mach-prima2/clock.c +++ b/arch/arm/mach-prima2/clock.c | |||
@@ -350,10 +350,10 @@ static struct clk_lookup onchip_clks[] = { | |||
350 | .clk = &clk_mem, | 350 | .clk = &clk_mem, |
351 | }, { | 351 | }, { |
352 | .dev_id = "sys", | 352 | .dev_id = "sys", |
353 | .clk = &clk_sys, | 353 | .clk = &clk_sys, |
354 | }, { | 354 | }, { |
355 | .dev_id = "io", | 355 | .dev_id = "io", |
356 | .clk = &clk_io, | 356 | .clk = &clk_io, |
357 | }, | 357 | }, |
358 | }; | 358 | }; |
359 | 359 | ||
diff --git a/arch/arm/mach-prima2/prima2.c b/arch/arm/mach-prima2/prima2.c index f57124bdd143..0ddf44698ec5 100644 --- a/arch/arm/mach-prima2/prima2.c +++ b/arch/arm/mach-prima2/prima2.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Defines machines for CSR SiRFprimaII | 2 | * Defines machines for CSR SiRFprimaII |
3 | * | 3 | * |
4 | * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. | 4 | * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. |
5 | * | 5 | * |
diff --git a/arch/arm/mach-prima2/timer.c b/arch/arm/mach-prima2/timer.c index ed7ec48d11da..26ab6fee5619 100644 --- a/arch/arm/mach-prima2/timer.c +++ b/arch/arm/mach-prima2/timer.c | |||
@@ -133,14 +133,14 @@ static struct irqaction sirfsoc_timer_irq = { | |||
133 | /* Overwrite weak default sched_clock with more precise one */ | 133 | /* Overwrite weak default sched_clock with more precise one */ |
134 | unsigned long long notrace sched_clock(void) | 134 | unsigned long long notrace sched_clock(void) |
135 | { | 135 | { |
136 | static int is_mapped = 0; | 136 | static int is_mapped; |
137 | 137 | ||
138 | /* | 138 | /* |
139 | * sched_clock is called earlier than .init of sys_timer | 139 | * sched_clock is called earlier than .init of sys_timer |
140 | * if we map timer memory in .init of sys_timer, system | 140 | * if we map timer memory in .init of sys_timer, system |
141 | * will panic due to illegal memory access | 141 | * will panic due to illegal memory access |
142 | */ | 142 | */ |
143 | if(!is_mapped) { | 143 | if (!is_mapped) { |
144 | sirfsoc_of_timer_map(); | 144 | sirfsoc_of_timer_map(); |
145 | is_mapped = 1; | 145 | is_mapped = 1; |
146 | } | 146 | } |
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c index c5190a50f0d9..d831c97833ba 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/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/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/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/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/xen/mmu.c b/arch/x86/xen/mmu.c index 20a614275064..3dd53f997b11 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1721,10 +1721,8 @@ void __init xen_setup_machphys_mapping(void) | |||
1721 | machine_to_phys_nr = MACH2PHYS_NR_ENTRIES; | 1721 | machine_to_phys_nr = MACH2PHYS_NR_ENTRIES; |
1722 | } | 1722 | } |
1723 | #ifdef CONFIG_X86_32 | 1723 | #ifdef CONFIG_X86_32 |
1724 | if ((machine_to_phys_mapping + machine_to_phys_nr) | 1724 | WARN_ON((machine_to_phys_mapping + (machine_to_phys_nr - 1)) |
1725 | < machine_to_phys_mapping) | 1725 | < machine_to_phys_mapping); |
1726 | machine_to_phys_nr = (unsigned long *)NULL | ||
1727 | - machine_to_phys_mapping; | ||
1728 | #endif | 1726 | #endif |
1729 | } | 1727 | } |
1730 | 1728 | ||
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index c3b8d440873c..46d6d21dbdbe 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
@@ -306,10 +306,12 @@ char * __init xen_memory_setup(void) | |||
306 | 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); |
307 | 307 | ||
308 | extra_limit = xen_get_max_pages(); | 308 | extra_limit = xen_get_max_pages(); |
309 | if (extra_limit >= max_pfn) | 309 | if (max_pfn + extra_pages > extra_limit) { |
310 | extra_pages = extra_limit - max_pfn; | 310 | if (extra_limit > max_pfn) |
311 | else | 311 | extra_pages = extra_limit - max_pfn; |
312 | extra_pages = 0; | 312 | else |
313 | extra_pages = 0; | ||
314 | } | ||
313 | 315 | ||
314 | 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); |
315 | 317 | ||
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index d4fc6d454f8d..041d4fe9dfe4 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c | |||
@@ -532,7 +532,6 @@ static void __init xen_hvm_smp_prepare_cpus(unsigned int max_cpus) | |||
532 | WARN_ON(xen_smp_intr_init(0)); | 532 | WARN_ON(xen_smp_intr_init(0)); |
533 | 533 | ||
534 | xen_init_lock_cpu(0); | 534 | xen_init_lock_cpu(0); |
535 | xen_init_spinlocks(); | ||
536 | } | 535 | } |
537 | 536 | ||
538 | static int __cpuinit xen_hvm_cpu_up(unsigned int cpu) | 537 | static int __cpuinit xen_hvm_cpu_up(unsigned int cpu) |
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 | ||