diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-02-23 21:16:27 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-02-23 21:16:27 -0500 |
commit | 7b0386921db20add25afd8678ed34a9253e512fc (patch) | |
tree | 8c6b888b76211e38e6c1c3006553dc4b2b24c75e /arch | |
parent | c5580a7ecb859c6821dd761c95fa150ec7695ae1 (diff) | |
parent | 22fe472cb430ce45c4fb9b6d13060dd724d6dbc8 (diff) |
Merge branch 'upstream-fixes'
Diffstat (limited to 'arch')
40 files changed, 427 insertions, 400 deletions
diff --git a/arch/arm/common/rtctime.c b/arch/arm/common/rtctime.c index 48b1e19b131f..e851d86c212c 100644 --- a/arch/arm/common/rtctime.c +++ b/arch/arm/common/rtctime.c | |||
@@ -128,19 +128,27 @@ EXPORT_SYMBOL(rtc_tm_to_time); | |||
128 | /* | 128 | /* |
129 | * Calculate the next alarm time given the requested alarm time mask | 129 | * Calculate the next alarm time given the requested alarm time mask |
130 | * and the current time. | 130 | * and the current time. |
131 | * | ||
132 | * FIXME: for now, we just copy the alarm time because we're lazy (and | ||
133 | * is therefore buggy - setting a 10am alarm at 8pm will not result in | ||
134 | * the alarm triggering.) | ||
135 | */ | 131 | */ |
136 | void rtc_next_alarm_time(struct rtc_time *next, struct rtc_time *now, struct rtc_time *alrm) | 132 | void rtc_next_alarm_time(struct rtc_time *next, struct rtc_time *now, struct rtc_time *alrm) |
137 | { | 133 | { |
134 | unsigned long next_time; | ||
135 | unsigned long now_time; | ||
136 | |||
138 | next->tm_year = now->tm_year; | 137 | next->tm_year = now->tm_year; |
139 | next->tm_mon = now->tm_mon; | 138 | next->tm_mon = now->tm_mon; |
140 | next->tm_mday = now->tm_mday; | 139 | next->tm_mday = now->tm_mday; |
141 | next->tm_hour = alrm->tm_hour; | 140 | next->tm_hour = alrm->tm_hour; |
142 | next->tm_min = alrm->tm_min; | 141 | next->tm_min = alrm->tm_min; |
143 | next->tm_sec = alrm->tm_sec; | 142 | next->tm_sec = alrm->tm_sec; |
143 | |||
144 | rtc_tm_to_time(now, &now_time); | ||
145 | rtc_tm_to_time(next, &next_time); | ||
146 | |||
147 | if (next_time < now_time) { | ||
148 | /* Advance one day */ | ||
149 | next_time += 60 * 60 * 24; | ||
150 | rtc_time_to_tm(next_time, next); | ||
151 | } | ||
144 | } | 152 | } |
145 | 153 | ||
146 | static inline int rtc_read_time(struct rtc_ops *ops, struct rtc_time *tm) | 154 | static inline int rtc_read_time(struct rtc_ops *ops, struct rtc_time *tm) |
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 964cd717506b..ec48d70c6d8b 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -566,7 +566,7 @@ ENTRY(__switch_to) | |||
566 | ldr r6, [r2, #TI_CPU_DOMAIN]! | 566 | ldr r6, [r2, #TI_CPU_DOMAIN]! |
567 | #endif | 567 | #endif |
568 | #if __LINUX_ARM_ARCH__ >= 6 | 568 | #if __LINUX_ARM_ARCH__ >= 6 |
569 | #ifdef CONFIG_CPU_MPCORE | 569 | #ifdef CONFIG_CPU_32v6K |
570 | clrex | 570 | clrex |
571 | #else | 571 | #else |
572 | strex r5, r4, [ip] @ Clear exclusive monitor | 572 | strex r5, r4, [ip] @ Clear exclusive monitor |
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 10235b01582e..03924bcc6129 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/personality.h> | 19 | #include <linux/personality.h> |
20 | #include <linux/ptrace.h> | 20 | #include <linux/ptrace.h> |
21 | #include <linux/kallsyms.h> | 21 | #include <linux/kallsyms.h> |
22 | #include <linux/delay.h> | ||
22 | #include <linux/init.h> | 23 | #include <linux/init.h> |
23 | 24 | ||
24 | #include <asm/atomic.h> | 25 | #include <asm/atomic.h> |
@@ -231,6 +232,13 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err) | |||
231 | __die(str, err, thread, regs); | 232 | __die(str, err, thread, regs); |
232 | bust_spinlocks(0); | 233 | bust_spinlocks(0); |
233 | spin_unlock_irq(&die_lock); | 234 | spin_unlock_irq(&die_lock); |
235 | |||
236 | if (panic_on_oops) { | ||
237 | printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); | ||
238 | ssleep(5); | ||
239 | panic("Fatal exception"); | ||
240 | } | ||
241 | |||
234 | do_exit(SIGSEGV); | 242 | do_exit(SIGSEGV); |
235 | } | 243 | } |
236 | 244 | ||
diff --git a/arch/arm/mach-at91rm9200/devices.c b/arch/arm/mach-at91rm9200/devices.c index 8df3e5245651..57eedd5beaf6 100644 --- a/arch/arm/mach-at91rm9200/devices.c +++ b/arch/arm/mach-at91rm9200/devices.c | |||
@@ -100,8 +100,10 @@ void __init at91_add_device_udc(struct at91_udc_data *data) | |||
100 | at91_set_gpio_input(data->vbus_pin, 0); | 100 | at91_set_gpio_input(data->vbus_pin, 0); |
101 | at91_set_deglitch(data->vbus_pin, 1); | 101 | at91_set_deglitch(data->vbus_pin, 1); |
102 | } | 102 | } |
103 | if (data->pullup_pin) | 103 | if (data->pullup_pin) { |
104 | at91_set_gpio_output(data->pullup_pin, 0); | 104 | at91_set_gpio_output(data->pullup_pin, 0); |
105 | at91_set_multi_drive(data->pullup_pin, 1); | ||
106 | } | ||
105 | 107 | ||
106 | udc_data = *data; | 108 | udc_data = *data; |
107 | platform_device_register(&at91rm9200_udc_device); | 109 | platform_device_register(&at91rm9200_udc_device); |
diff --git a/arch/arm/mach-at91rm9200/gpio.c b/arch/arm/mach-at91rm9200/gpio.c index 2fd2ef583e4d..a9f718bf8ba8 100644 --- a/arch/arm/mach-at91rm9200/gpio.c +++ b/arch/arm/mach-at91rm9200/gpio.c | |||
@@ -159,6 +159,23 @@ int __init_or_module at91_set_deglitch(unsigned pin, int is_on) | |||
159 | } | 159 | } |
160 | EXPORT_SYMBOL(at91_set_deglitch); | 160 | EXPORT_SYMBOL(at91_set_deglitch); |
161 | 161 | ||
162 | /* | ||
163 | * enable/disable the multi-driver; This is only valid for output and | ||
164 | * allows the output pin to run as an open collector output. | ||
165 | */ | ||
166 | int __init_or_module at91_set_multi_drive(unsigned pin, int is_on) | ||
167 | { | ||
168 | void __iomem *pio = pin_to_controller(pin); | ||
169 | unsigned mask = pin_to_mask(pin); | ||
170 | |||
171 | if (!pio) | ||
172 | return -EINVAL; | ||
173 | |||
174 | __raw_writel(mask, pio + (is_on ? PIO_MDER : PIO_MDDR)); | ||
175 | return 0; | ||
176 | } | ||
177 | EXPORT_SYMBOL(at91_set_multi_drive); | ||
178 | |||
162 | /*--------------------------------------------------------------------------*/ | 179 | /*--------------------------------------------------------------------------*/ |
163 | 180 | ||
164 | 181 | ||
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 4bdc9d4526cd..fbadf3021b9e 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -111,24 +111,30 @@ static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type) | |||
111 | if (line < 0) | 111 | if (line < 0) |
112 | return -EINVAL; | 112 | return -EINVAL; |
113 | 113 | ||
114 | if (type & IRQT_BOTHEDGE) { | 114 | switch (type){ |
115 | case IRQT_BOTHEDGE: | ||
115 | int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL; | 116 | int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL; |
116 | irq_type = IXP4XX_IRQ_EDGE; | 117 | irq_type = IXP4XX_IRQ_EDGE; |
117 | } else if (type & IRQT_RISING) { | 118 | break; |
119 | case IRQT_RISING: | ||
118 | int_style = IXP4XX_GPIO_STYLE_RISING_EDGE; | 120 | int_style = IXP4XX_GPIO_STYLE_RISING_EDGE; |
119 | irq_type = IXP4XX_IRQ_EDGE; | 121 | irq_type = IXP4XX_IRQ_EDGE; |
120 | } else if (type & IRQT_FALLING) { | 122 | break; |
123 | case IRQT_FALLING: | ||
121 | int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE; | 124 | int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE; |
122 | irq_type = IXP4XX_IRQ_EDGE; | 125 | irq_type = IXP4XX_IRQ_EDGE; |
123 | } else if (type & IRQT_HIGH) { | 126 | break; |
127 | case IRQT_HIGH: | ||
124 | int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH; | 128 | int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH; |
125 | irq_type = IXP4XX_IRQ_LEVEL; | 129 | irq_type = IXP4XX_IRQ_LEVEL; |
126 | } else if (type & IRQT_LOW) { | 130 | break; |
131 | case IRQT_LOW: | ||
127 | int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW; | 132 | int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW; |
128 | irq_type = IXP4XX_IRQ_LEVEL; | 133 | irq_type = IXP4XX_IRQ_LEVEL; |
129 | } else | 134 | break; |
135 | default: | ||
130 | return -EINVAL; | 136 | return -EINVAL; |
131 | 137 | } | |
132 | ixp4xx_config_irq(irq, irq_type); | 138 | ixp4xx_config_irq(irq, irq_type); |
133 | 139 | ||
134 | if (line >= 8) { /* pins 8-15 */ | 140 | if (line >= 8) { /* pins 8-15 */ |
diff --git a/arch/arm/mach-ixp4xx/nslu2-power.c b/arch/arm/mach-ixp4xx/nslu2-power.c index b0ad9e901f6e..d80c362bc539 100644 --- a/arch/arm/mach-ixp4xx/nslu2-power.c +++ b/arch/arm/mach-ixp4xx/nslu2-power.c | |||
@@ -77,6 +77,9 @@ static int __init nslu2_power_init(void) | |||
77 | 77 | ||
78 | static void __exit nslu2_power_exit(void) | 78 | static void __exit nslu2_power_exit(void) |
79 | { | 79 | { |
80 | if (!(machine_is_nslu2())) | ||
81 | return; | ||
82 | |||
80 | free_irq(NSLU2_RB_IRQ, NULL); | 83 | free_irq(NSLU2_RB_IRQ, NULL); |
81 | free_irq(NSLU2_PB_IRQ, NULL); | 84 | free_irq(NSLU2_PB_IRQ, NULL); |
82 | } | 85 | } |
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c index f260a9d34f70..55411f21d838 100644 --- a/arch/arm/mach-ixp4xx/nslu2-setup.c +++ b/arch/arm/mach-ixp4xx/nslu2-setup.c | |||
@@ -50,6 +50,12 @@ static struct platform_device nslu2_i2c_controller = { | |||
50 | .num_resources = 0, | 50 | .num_resources = 0, |
51 | }; | 51 | }; |
52 | 52 | ||
53 | static struct platform_device nslu2_beeper = { | ||
54 | .name = "ixp4xx-beeper", | ||
55 | .id = NSLU2_GPIO_BUZZ, | ||
56 | .num_resources = 0, | ||
57 | }; | ||
58 | |||
53 | static struct resource nslu2_uart_resources[] = { | 59 | static struct resource nslu2_uart_resources[] = { |
54 | { | 60 | { |
55 | .start = IXP4XX_UART1_BASE_PHYS, | 61 | .start = IXP4XX_UART1_BASE_PHYS, |
@@ -97,6 +103,7 @@ static struct platform_device *nslu2_devices[] __initdata = { | |||
97 | &nslu2_i2c_controller, | 103 | &nslu2_i2c_controller, |
98 | &nslu2_flash, | 104 | &nslu2_flash, |
99 | &nslu2_uart, | 105 | &nslu2_uart, |
106 | &nslu2_beeper, | ||
100 | }; | 107 | }; |
101 | 108 | ||
102 | static void nslu2_power_off(void) | 109 | static void nslu2_power_off(void) |
diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c index b80d57d51699..722fbabc9cfb 100644 --- a/arch/arm/mach-versatile/pci.c +++ b/arch/arm/mach-versatile/pci.c | |||
@@ -240,6 +240,14 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys) | |||
240 | int i; | 240 | int i; |
241 | int myslot = -1; | 241 | int myslot = -1; |
242 | unsigned long val; | 242 | unsigned long val; |
243 | void __iomem *local_pci_cfg_base; | ||
244 | |||
245 | val = __raw_readl(SYS_PCICTL); | ||
246 | if (!(val & 1)) { | ||
247 | printk("Not plugged into PCI backplane!\n"); | ||
248 | ret = -EIO; | ||
249 | goto out; | ||
250 | } | ||
243 | 251 | ||
244 | if (nr == 0) { | 252 | if (nr == 0) { |
245 | sys->mem_offset = 0; | 253 | sys->mem_offset = 0; |
@@ -253,48 +261,45 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys) | |||
253 | goto out; | 261 | goto out; |
254 | } | 262 | } |
255 | 263 | ||
256 | __raw_writel(VERSATILE_PCI_MEM_BASE0 >> 28,PCI_IMAP0); | ||
257 | __raw_writel(VERSATILE_PCI_MEM_BASE1 >> 28,PCI_IMAP1); | ||
258 | __raw_writel(VERSATILE_PCI_MEM_BASE2 >> 28,PCI_IMAP2); | ||
259 | |||
260 | __raw_writel(1, SYS_PCICTL); | ||
261 | |||
262 | val = __raw_readl(SYS_PCICTL); | ||
263 | if (!(val & 1)) { | ||
264 | printk("Not plugged into PCI backplane!\n"); | ||
265 | ret = -EIO; | ||
266 | goto out; | ||
267 | } | ||
268 | |||
269 | /* | 264 | /* |
270 | * We need to discover the PCI core first to configure itself | 265 | * We need to discover the PCI core first to configure itself |
271 | * before the main PCI probing is performed | 266 | * before the main PCI probing is performed |
272 | */ | 267 | */ |
273 | for (i=0; i<32; i++) { | 268 | for (i=0; i<32; i++) |
274 | if ((__raw_readl(VERSATILE_PCI_VIRT_BASE+(i<<11)+DEVICE_ID_OFFSET) == VP_PCI_DEVICE_ID) && | 269 | if ((__raw_readl(VERSATILE_PCI_VIRT_BASE+(i<<11)+DEVICE_ID_OFFSET) == VP_PCI_DEVICE_ID) && |
275 | (__raw_readl(VERSATILE_PCI_VIRT_BASE+(i<<11)+CLASS_ID_OFFSET) == VP_PCI_CLASS_ID)) { | 270 | (__raw_readl(VERSATILE_PCI_VIRT_BASE+(i<<11)+CLASS_ID_OFFSET) == VP_PCI_CLASS_ID)) { |
276 | myslot = i; | 271 | myslot = i; |
277 | |||
278 | __raw_writel(myslot, PCI_SELFID); | ||
279 | val = __raw_readl(VERSATILE_PCI_CFG_VIRT_BASE+(myslot<<11)+CSR_OFFSET); | ||
280 | val |= (1<<2); | ||
281 | __raw_writel(val, VERSATILE_PCI_CFG_VIRT_BASE+(myslot<<11)+CSR_OFFSET); | ||
282 | break; | 272 | break; |
283 | } | 273 | } |
284 | } | ||
285 | 274 | ||
286 | if (myslot == -1) { | 275 | if (myslot == -1) { |
287 | printk("Cannot find PCI core!\n"); | 276 | printk("Cannot find PCI core!\n"); |
288 | ret = -EIO; | 277 | ret = -EIO; |
289 | } else { | 278 | goto out; |
290 | printk("PCI core found (slot %d)\n",myslot); | ||
291 | /* Do not to map Versatile FPGA PCI device | ||
292 | into memory space as we are short of | ||
293 | mappable memory */ | ||
294 | pci_slot_ignore |= (1 << myslot); | ||
295 | ret = 1; | ||
296 | } | 279 | } |
297 | 280 | ||
281 | printk("PCI core found (slot %d)\n",myslot); | ||
282 | |||
283 | __raw_writel(myslot, PCI_SELFID); | ||
284 | local_pci_cfg_base = (void *) VERSATILE_PCI_CFG_VIRT_BASE + (myslot << 11); | ||
285 | |||
286 | val = __raw_readl(local_pci_cfg_base + CSR_OFFSET); | ||
287 | val |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE; | ||
288 | __raw_writel(val, local_pci_cfg_base + CSR_OFFSET); | ||
289 | |||
290 | /* | ||
291 | * Configure the PCI inbound memory windows to be 1:1 mapped to SDRAM | ||
292 | */ | ||
293 | __raw_writel(PHYS_OFFSET, local_pci_cfg_base + PCI_BASE_ADDRESS_0); | ||
294 | __raw_writel(PHYS_OFFSET, local_pci_cfg_base + PCI_BASE_ADDRESS_1); | ||
295 | __raw_writel(PHYS_OFFSET, local_pci_cfg_base + PCI_BASE_ADDRESS_2); | ||
296 | |||
297 | /* | ||
298 | * Do not to map Versatile FPGA PCI device into memory space | ||
299 | */ | ||
300 | pci_slot_ignore |= (1 << myslot); | ||
301 | ret = 1; | ||
302 | |||
298 | out: | 303 | out: |
299 | return ret; | 304 | return ret; |
300 | } | 305 | } |
@@ -305,18 +310,18 @@ struct pci_bus *pci_versatile_scan_bus(int nr, struct pci_sys_data *sys) | |||
305 | return pci_scan_bus(sys->busnr, &pci_versatile_ops, sys); | 310 | return pci_scan_bus(sys->busnr, &pci_versatile_ops, sys); |
306 | } | 311 | } |
307 | 312 | ||
308 | /* | ||
309 | * V3_LB_BASE? - local bus address | ||
310 | * V3_LB_MAP? - pci bus address | ||
311 | */ | ||
312 | void __init pci_versatile_preinit(void) | 313 | void __init pci_versatile_preinit(void) |
313 | { | 314 | { |
314 | } | 315 | __raw_writel(VERSATILE_PCI_MEM_BASE0 >> 28, PCI_IMAP0); |
316 | __raw_writel(VERSATILE_PCI_MEM_BASE1 >> 28, PCI_IMAP1); | ||
317 | __raw_writel(VERSATILE_PCI_MEM_BASE2 >> 28, PCI_IMAP2); | ||
315 | 318 | ||
316 | void __init pci_versatile_postinit(void) | 319 | __raw_writel(PHYS_OFFSET >> 28, PCI_SMAP0); |
317 | { | 320 | __raw_writel(PHYS_OFFSET >> 28, PCI_SMAP1); |
318 | } | 321 | __raw_writel(PHYS_OFFSET >> 28, PCI_SMAP2); |
319 | 322 | ||
323 | __raw_writel(1, SYS_PCICTL); | ||
324 | } | ||
320 | 325 | ||
321 | /* | 326 | /* |
322 | * map the specified device/slot/pin to an IRQ. Different backplanes may need to modify this. | 327 | * map the specified device/slot/pin to an IRQ. Different backplanes may need to modify this. |
@@ -326,16 +331,15 @@ static int __init versatile_map_irq(struct pci_dev *dev, u8 slot, u8 pin) | |||
326 | int irq; | 331 | int irq; |
327 | int devslot = PCI_SLOT(dev->devfn); | 332 | int devslot = PCI_SLOT(dev->devfn); |
328 | 333 | ||
329 | /* slot, pin, irq | 334 | /* slot, pin, irq |
330 | 24 1 27 | 335 | * 24 1 27 |
331 | 25 1 28 untested | 336 | * 25 1 28 |
332 | 26 1 29 | 337 | * 26 1 29 |
333 | 27 1 30 untested | 338 | * 27 1 30 |
334 | */ | 339 | */ |
335 | 340 | irq = 27 + ((slot + pin - 1) & 3); | |
336 | irq = 27 + ((slot + pin + 2) % 3); /* Fudged */ | ||
337 | 341 | ||
338 | printk("map irq: slot %d, pin %d, devslot %d, irq: %d\n",slot,pin,devslot,irq); | 342 | printk("PCI map irq: slot %d, pin %d, devslot %d, irq: %d\n",slot,pin,devslot,irq); |
339 | 343 | ||
340 | return irq; | 344 | return irq; |
341 | } | 345 | } |
@@ -347,7 +351,6 @@ static struct hw_pci versatile_pci __initdata = { | |||
347 | .setup = pci_versatile_setup, | 351 | .setup = pci_versatile_setup, |
348 | .scan = pci_versatile_scan_bus, | 352 | .scan = pci_versatile_scan_bus, |
349 | .preinit = pci_versatile_preinit, | 353 | .preinit = pci_versatile_preinit, |
350 | .postinit = pci_versatile_postinit, | ||
351 | }; | 354 | }; |
352 | 355 | ||
353 | static int __init versatile_pci_init(void) | 356 | static int __init versatile_pci_init(void) |
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S index dbd346033122..8a7f65ba14b7 100644 --- a/arch/arm/mm/abort-ev6.S +++ b/arch/arm/mm/abort-ev6.S | |||
@@ -20,7 +20,7 @@ | |||
20 | */ | 20 | */ |
21 | .align 5 | 21 | .align 5 |
22 | ENTRY(v6_early_abort) | 22 | ENTRY(v6_early_abort) |
23 | #ifdef CONFIG_CPU_MPCORE | 23 | #ifdef CONFIG_CPU_32v6K |
24 | clrex | 24 | clrex |
25 | #else | 25 | #else |
26 | strex r0, r1, [sp] @ Clear the exclusive monitor | 26 | strex r0, r1, [sp] @ Clear the exclusive monitor |
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types index d0f9bb5e9023..8ab5300dcb94 100644 --- a/arch/arm/tools/mach-types +++ b/arch/arm/tools/mach-types | |||
@@ -12,7 +12,7 @@ | |||
12 | # | 12 | # |
13 | # http://www.arm.linux.org.uk/developer/machines/?action=new | 13 | # http://www.arm.linux.org.uk/developer/machines/?action=new |
14 | # | 14 | # |
15 | # Last update: Mon Jan 9 12:56:42 2006 | 15 | # Last update: Mon Feb 20 10:18:02 2006 |
16 | # | 16 | # |
17 | # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number | 17 | # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number |
18 | # | 18 | # |
@@ -904,7 +904,7 @@ wg302v2 MACH_WG302V2 WG302V2 890 | |||
904 | eb42x MACH_EB42X EB42X 891 | 904 | eb42x MACH_EB42X EB42X 891 |
905 | iq331es MACH_IQ331ES IQ331ES 892 | 905 | iq331es MACH_IQ331ES IQ331ES 892 |
906 | cosydsp MACH_COSYDSP COSYDSP 893 | 906 | cosydsp MACH_COSYDSP COSYDSP 893 |
907 | uplat7d MACH_UPLAT7D UPLAT7D 894 | 907 | uplat7d_proto MACH_UPLAT7D UPLAT7D 894 |
908 | ptdavinci MACH_PTDAVINCI PTDAVINCI 895 | 908 | ptdavinci MACH_PTDAVINCI PTDAVINCI 895 |
909 | mbus MACH_MBUS MBUS 896 | 909 | mbus MACH_MBUS MBUS 896 |
910 | nadia2vb MACH_NADIA2VB NADIA2VB 897 | 910 | nadia2vb MACH_NADIA2VB NADIA2VB 897 |
@@ -938,3 +938,34 @@ auckland MACH_AUCKLAND AUCKLAND 924 | |||
938 | ak3220m MACH_AK3320M AK3320M 925 | 938 | ak3220m MACH_AK3320M AK3320M 925 |
939 | duramax MACH_DURAMAX DURAMAX 926 | 939 | duramax MACH_DURAMAX DURAMAX 926 |
940 | n35 MACH_N35 N35 927 | 940 | n35 MACH_N35 N35 927 |
941 | pronghorn MACH_PRONGHORN PRONGHORN 928 | ||
942 | fundy MACH_FUNDY FUNDY 929 | ||
943 | logicpd_pxa270 MACH_LOGICPD_PXA270 LOGICPD_PXA270 930 | ||
944 | cpu777 MACH_CPU777 CPU777 931 | ||
945 | simicon9201 MACH_SIMICON9201 SIMICON9201 932 | ||
946 | leap2_hpm MACH_LEAP2_HPM LEAP2_HPM 933 | ||
947 | cm922txa10 MACH_CM922TXA10 CM922TXA10 934 | ||
948 | sandgate MACH_PXA PXA 935 | ||
949 | sandgate2 MACH_SANDGATE2 SANDGATE2 936 | ||
950 | sandgate2g MACH_SANDGATE2G SANDGATE2G 937 | ||
951 | sandgate2p MACH_SANDGATE2P SANDGATE2P 938 | ||
952 | fred_jack MACH_FRED_JACK FRED_JACK 939 | ||
953 | ttg_color1 MACH_TTG_COLOR1 TTG_COLOR1 940 | ||
954 | nxeb500hmi MACH_NXEB500HMI NXEB500HMI 941 | ||
955 | netdcu8 MACH_NETDCU8 NETDCU8 942 | ||
956 | ml675050_cpu_boa MACH_ML675050_CPU_BOA ML675050_CPU_BOA 943 | ||
957 | ng_fvx538 MACH_NG_FVX538 NG_FVX538 944 | ||
958 | ng_fvs338 MACH_NG_FVS338 NG_FVS338 945 | ||
959 | pnx4103 MACH_PNX4103 PNX4103 946 | ||
960 | hesdb MACH_HESDB HESDB 947 | ||
961 | xsilo MACH_XSILO XSILO 948 | ||
962 | espresso MACH_ESPRESSO ESPRESSO 949 | ||
963 | emlc MACH_EMLC EMLC 950 | ||
964 | sisteron MACH_SISTERON SISTERON 951 | ||
965 | rx1950 MACH_RX1950 RX1950 952 | ||
966 | tsc_venus MACH_TSC_VENUS TSC_VENUS 953 | ||
967 | ds101j MACH_DS101J DS101J 954 | ||
968 | mxc300_30ads MACH_MXC30030ADS MXC30030ADS 955 | ||
969 | fujitsu_wimaxsoc MACH_FUJITSU_WIMAXSOC FUJITSU_WIMAXSOC 956 | ||
970 | dualpcmodem MACH_DUALPCMODEM DUALPCMODEM 957 | ||
971 | gesbc9312 MACH_GESBC9312 GESBC9312 958 | ||
diff --git a/arch/h8300/Kconfig.debug b/arch/h8300/Kconfig.debug index 55034d08abff..e0e9bcb015a9 100644 --- a/arch/h8300/Kconfig.debug +++ b/arch/h8300/Kconfig.debug | |||
@@ -34,7 +34,7 @@ config GDB_DEBUG | |||
34 | help | 34 | help |
35 | gdb stub exception support | 35 | gdb stub exception support |
36 | 36 | ||
37 | config CONFIG_SH_STANDARD_BIOS | 37 | config SH_STANDARD_BIOS |
38 | bool "Use gdb protocol serial console" | 38 | bool "Use gdb protocol serial console" |
39 | depends on (!H8300H_SIM && !H8S_SIM) | 39 | depends on (!H8300H_SIM && !H8S_SIM) |
40 | help | 40 | help |
diff --git a/arch/h8300/defconfig b/arch/h8300/defconfig index 9d9b491cfc2c..8f1ec3297150 100644 --- a/arch/h8300/defconfig +++ b/arch/h8300/defconfig | |||
@@ -328,7 +328,7 @@ CONFIG_FULLDEBUG=y | |||
328 | CONFIG_NO_KERNEL_MSG=y | 328 | CONFIG_NO_KERNEL_MSG=y |
329 | # CONFIG_SYSCALL_PRINT is not set | 329 | # CONFIG_SYSCALL_PRINT is not set |
330 | # CONFIG_GDB_DEBUG is not set | 330 | # CONFIG_GDB_DEBUG is not set |
331 | # CONFIG_CONFIG_SH_STANDARD_BIOS is not set | 331 | # CONFIG_SH_STANDARD_BIOS is not set |
332 | # CONFIG_DEFAULT_CMDLINE is not set | 332 | # CONFIG_DEFAULT_CMDLINE is not set |
333 | # CONFIG_BLKDEV_RESERVE is not set | 333 | # CONFIG_BLKDEV_RESERVE is not set |
334 | 334 | ||
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c index 0102f3d50e57..e7609abf3796 100644 --- a/arch/i386/kernel/mpparse.c +++ b/arch/i386/kernel/mpparse.c | |||
@@ -710,7 +710,7 @@ void __init get_smp_config (void) | |||
710 | * Read the physical hardware table. Anything here will | 710 | * Read the physical hardware table. Anything here will |
711 | * override the defaults. | 711 | * override the defaults. |
712 | */ | 712 | */ |
713 | if (!smp_read_mpc((void *)mpf->mpf_physptr)) { | 713 | if (!smp_read_mpc(phys_to_virt(mpf->mpf_physptr))) { |
714 | smp_found_config = 0; | 714 | smp_found_config = 0; |
715 | printk(KERN_ERR "BIOS bug, MP table errors detected!...\n"); | 715 | printk(KERN_ERR "BIOS bug, MP table errors detected!...\n"); |
716 | printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n"); | 716 | printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n"); |
diff --git a/arch/m32r/kernel/sys_m32r.c b/arch/m32r/kernel/sys_m32r.c index fe55b28d3725..670cb49210af 100644 --- a/arch/m32r/kernel/sys_m32r.c +++ b/arch/m32r/kernel/sys_m32r.c | |||
@@ -29,28 +29,7 @@ | |||
29 | 29 | ||
30 | /* | 30 | /* |
31 | * sys_tas() - test-and-set | 31 | * sys_tas() - test-and-set |
32 | * linuxthreads testing version | ||
33 | */ | 32 | */ |
34 | #ifndef CONFIG_SMP | ||
35 | asmlinkage int sys_tas(int *addr) | ||
36 | { | ||
37 | int oldval; | ||
38 | unsigned long flags; | ||
39 | |||
40 | if (!access_ok(VERIFY_WRITE, addr, sizeof (int))) | ||
41 | return -EFAULT; | ||
42 | local_irq_save(flags); | ||
43 | oldval = *addr; | ||
44 | if (!oldval) | ||
45 | *addr = 1; | ||
46 | local_irq_restore(flags); | ||
47 | return oldval; | ||
48 | } | ||
49 | #else /* CONFIG_SMP */ | ||
50 | #include <linux/spinlock.h> | ||
51 | |||
52 | static DEFINE_SPINLOCK(tas_lock); | ||
53 | |||
54 | asmlinkage int sys_tas(int *addr) | 33 | asmlinkage int sys_tas(int *addr) |
55 | { | 34 | { |
56 | int oldval; | 35 | int oldval; |
@@ -58,15 +37,43 @@ asmlinkage int sys_tas(int *addr) | |||
58 | if (!access_ok(VERIFY_WRITE, addr, sizeof (int))) | 37 | if (!access_ok(VERIFY_WRITE, addr, sizeof (int))) |
59 | return -EFAULT; | 38 | return -EFAULT; |
60 | 39 | ||
61 | _raw_spin_lock(&tas_lock); | 40 | /* atomic operation: |
62 | oldval = *addr; | 41 | * oldval = *addr; *addr = 1; |
63 | if (!oldval) | 42 | */ |
64 | *addr = 1; | 43 | __asm__ __volatile__ ( |
65 | _raw_spin_unlock(&tas_lock); | 44 | DCACHE_CLEAR("%0", "r4", "%1") |
45 | " .fillinsn\n" | ||
46 | "1:\n" | ||
47 | " lock %0, @%1 -> unlock %2, @%1\n" | ||
48 | "2:\n" | ||
49 | /* NOTE: | ||
50 | * The m32r processor can accept interrupts only | ||
51 | * at the 32-bit instruction boundary. | ||
52 | * So, in the above code, the "unlock" instruction | ||
53 | * can be executed continuously after the "lock" | ||
54 | * instruction execution without any interruptions. | ||
55 | */ | ||
56 | ".section .fixup,\"ax\"\n" | ||
57 | " .balign 4\n" | ||
58 | "3: ldi %0, #%3\n" | ||
59 | " seth r14, #high(2b)\n" | ||
60 | " or3 r14, r14, #low(2b)\n" | ||
61 | " jmp r14\n" | ||
62 | ".previous\n" | ||
63 | ".section __ex_table,\"a\"\n" | ||
64 | " .balign 4\n" | ||
65 | " .long 1b,3b\n" | ||
66 | ".previous\n" | ||
67 | : "=&r" (oldval) | ||
68 | : "r" (addr), "r" (1), "i"(-EFAULT) | ||
69 | : "r14", "memory" | ||
70 | #ifdef CONFIG_CHIP_M32700_TS1 | ||
71 | , "r4" | ||
72 | #endif /* CONFIG_CHIP_M32700_TS1 */ | ||
73 | ); | ||
66 | 74 | ||
67 | return oldval; | 75 | return oldval; |
68 | } | 76 | } |
69 | #endif /* CONFIG_SMP */ | ||
70 | 77 | ||
71 | /* | 78 | /* |
72 | * sys_pipe() is the normal C calling standard for creating | 79 | * sys_pipe() is the normal C calling standard for creating |
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index 3f9cb55d0356..2d8ad0727b6b 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c | |||
@@ -129,6 +129,9 @@ void machine_power_off(void) | |||
129 | for (;;); | 129 | for (;;); |
130 | } | 130 | } |
131 | 131 | ||
132 | void (*pm_power_off)(void) = machine_power_off; | ||
133 | EXPORT_SYMBOL(pm_power_off); | ||
134 | |||
132 | void show_regs(struct pt_regs * regs) | 135 | void show_regs(struct pt_regs * regs) |
133 | { | 136 | { |
134 | printk("\n"); | 137 | printk("\n"); |
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig index e17d3adff021..58c22cd344d3 100644 --- a/arch/mips/configs/ip27_defconfig +++ b/arch/mips/configs/ip27_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.15-rc2 | 3 | # Linux kernel version: 2.6.16-rc4 |
4 | # Thu Nov 24 01:06:21 2005 | 4 | # Tue Feb 21 13:44:31 2006 |
5 | # | 5 | # |
6 | CONFIG_MIPS=y | 6 | CONFIG_MIPS=y |
7 | 7 | ||
@@ -144,7 +144,6 @@ CONFIG_PREEMPT_BKL=y | |||
144 | # Code maturity level options | 144 | # Code maturity level options |
145 | # | 145 | # |
146 | CONFIG_EXPERIMENTAL=y | 146 | CONFIG_EXPERIMENTAL=y |
147 | CONFIG_CLEAN_COMPILE=y | ||
148 | CONFIG_LOCK_KERNEL=y | 147 | CONFIG_LOCK_KERNEL=y |
149 | CONFIG_INIT_ENV_ARG_LIMIT=32 | 148 | CONFIG_INIT_ENV_ARG_LIMIT=32 |
150 | 149 | ||
@@ -250,6 +249,7 @@ CONFIG_NET=y | |||
250 | # | 249 | # |
251 | # Networking options | 250 | # Networking options |
252 | # | 251 | # |
252 | # CONFIG_NETDEBUG is not set | ||
253 | CONFIG_PACKET=y | 253 | CONFIG_PACKET=y |
254 | CONFIG_PACKET_MMAP=y | 254 | CONFIG_PACKET_MMAP=y |
255 | CONFIG_UNIX=y | 255 | CONFIG_UNIX=y |
@@ -289,6 +289,7 @@ CONFIG_TCP_CONG_BIC=y | |||
289 | # SCTP Configuration (EXPERIMENTAL) | 289 | # SCTP Configuration (EXPERIMENTAL) |
290 | # | 290 | # |
291 | # CONFIG_IP_SCTP is not set | 291 | # CONFIG_IP_SCTP is not set |
292 | |||
292 | # CONFIG_ATM is not set | 293 | # CONFIG_ATM is not set |
293 | # CONFIG_BRIDGE is not set | 294 | # CONFIG_BRIDGE is not set |
294 | # CONFIG_VLAN_8021Q is not set | 295 | # CONFIG_VLAN_8021Q is not set |
@@ -448,7 +449,7 @@ CONFIG_SCSI_SAS_ATTRS=m | |||
448 | # | 449 | # |
449 | # SCSI low-level drivers | 450 | # SCSI low-level drivers |
450 | # | 451 | # |
451 | CONFIG_ISCSI_TCP=m | 452 | # CONFIG_ISCSI_TCP is not set |
452 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set | 453 | # CONFIG_BLK_DEV_3W_XXXX_RAID is not set |
453 | # CONFIG_SCSI_3W_9XXX is not set | 454 | # CONFIG_SCSI_3W_9XXX is not set |
454 | # CONFIG_SCSI_ACARD is not set | 455 | # CONFIG_SCSI_ACARD is not set |
@@ -774,6 +775,10 @@ CONFIG_USB_ARCH_HAS_OHCI=y | |||
774 | # | 775 | # |
775 | 776 | ||
776 | # | 777 | # |
778 | # EDAC - error detection and reporting (RAS) | ||
779 | # | ||
780 | |||
781 | # | ||
777 | # File systems | 782 | # File systems |
778 | # | 783 | # |
779 | CONFIG_EXT2_FS=y | 784 | CONFIG_EXT2_FS=y |
diff --git a/arch/mips/kernel/binfmt_elfn32.c b/arch/mips/kernel/binfmt_elfn32.c index d8e2674a1543..4a9f1ecefaf2 100644 --- a/arch/mips/kernel/binfmt_elfn32.c +++ b/arch/mips/kernel/binfmt_elfn32.c | |||
@@ -103,8 +103,9 @@ jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value) | |||
103 | * one divide. | 103 | * one divide. |
104 | */ | 104 | */ |
105 | u64 nsec = (u64)jiffies * TICK_NSEC; | 105 | u64 nsec = (u64)jiffies * TICK_NSEC; |
106 | value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec); | 106 | long rem; |
107 | value->tv_usec /= NSEC_PER_USEC; | 107 | value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &rem); |
108 | value->tv_usec = rem / NSEC_PER_USEC; | ||
108 | } | 109 | } |
109 | 110 | ||
110 | #define ELF_CORE_EFLAGS EF_MIPS_ABI2 | 111 | #define ELF_CORE_EFLAGS EF_MIPS_ABI2 |
diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c index cec5f327e360..e31813779895 100644 --- a/arch/mips/kernel/binfmt_elfo32.c +++ b/arch/mips/kernel/binfmt_elfo32.c | |||
@@ -105,8 +105,9 @@ jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value) | |||
105 | * one divide. | 105 | * one divide. |
106 | */ | 106 | */ |
107 | u64 nsec = (u64)jiffies * TICK_NSEC; | 107 | u64 nsec = (u64)jiffies * TICK_NSEC; |
108 | value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &value->tv_usec); | 108 | long rem; |
109 | value->tv_usec /= NSEC_PER_USEC; | 109 | value->tv_sec = div_long_long_rem(nsec, NSEC_PER_SEC, &rem); |
110 | value->tv_usec = rem / NSEC_PER_USEC; | ||
110 | } | 111 | } |
111 | 112 | ||
112 | #undef ELF_CORE_COPY_REGS | 113 | #undef ELF_CORE_COPY_REGS |
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index 60353f5acc48..5f68b220c26d 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
@@ -230,6 +230,9 @@ sysn32_waitid(int which, compat_pid_t pid, | |||
230 | long ret; | 230 | long ret; |
231 | mm_segment_t old_fs = get_fs(); | 231 | mm_segment_t old_fs = get_fs(); |
232 | 232 | ||
233 | if (!access_ok(VERIFY_WRITE, uinfo, sizeof(*uinfo))) | ||
234 | return -EFAULT; | ||
235 | |||
233 | set_fs (KERNEL_DS); | 236 | set_fs (KERNEL_DS); |
234 | ret = sys_waitid(which, pid, uinfo, options, | 237 | ret = sys_waitid(which, pid, uinfo, options, |
235 | uru ? (struct rusage __user *) &ru : NULL); | 238 | uru ? (struct rusage __user *) &ru : NULL); |
@@ -1450,25 +1453,6 @@ sys32_timer_create(u32 clock, struct sigevent32 __user *se32, timer_t __user *ti | |||
1450 | return sys_timer_create(clock, p, timer_id); | 1453 | return sys_timer_create(clock, p, timer_id); |
1451 | } | 1454 | } |
1452 | 1455 | ||
1453 | asmlinkage long | ||
1454 | sysn32_rt_sigtimedwait(const sigset_t __user *uthese, | ||
1455 | siginfo_t __user *uinfo, | ||
1456 | const struct compat_timespec __user *uts32, | ||
1457 | size_t sigsetsize) | ||
1458 | { | ||
1459 | struct timespec __user *uts = NULL; | ||
1460 | |||
1461 | if (uts32) { | ||
1462 | struct timespec ts; | ||
1463 | uts = compat_alloc_user_space(sizeof(struct timespec)); | ||
1464 | if (get_user(ts.tv_sec, &uts32->tv_sec) || | ||
1465 | get_user(ts.tv_nsec, &uts32->tv_nsec) || | ||
1466 | copy_to_user (uts, &ts, sizeof (ts))) | ||
1467 | return -EFAULT; | ||
1468 | } | ||
1469 | return sys_rt_sigtimedwait(uthese, uinfo, uts, sigsetsize); | ||
1470 | } | ||
1471 | |||
1472 | save_static_function(sys32_clone); | 1456 | save_static_function(sys32_clone); |
1473 | __attribute_used__ noinline static int | 1457 | __attribute_used__ noinline static int |
1474 | _sys32_clone(nabi_no_regargs struct pt_regs regs) | 1458 | _sys32_clone(nabi_no_regargs struct pt_regs regs) |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index bc4980cefc8b..d87b5446fa13 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -245,9 +245,9 @@ EXPORT(sysn32_call_table) | |||
245 | PTR sys_capget | 245 | PTR sys_capget |
246 | PTR sys_capset | 246 | PTR sys_capset |
247 | PTR sys32_rt_sigpending /* 6125 */ | 247 | PTR sys32_rt_sigpending /* 6125 */ |
248 | PTR sysn32_rt_sigtimedwait | 248 | PTR compat_sys_rt_sigtimedwait |
249 | PTR sys_rt_sigqueueinfo | 249 | PTR sys_rt_sigqueueinfo |
250 | PTR sys32_rt_sigsuspend | 250 | PTR sysn32_rt_sigsuspend |
251 | PTR sys32_sigaltstack | 251 | PTR sys32_sigaltstack |
252 | PTR compat_sys_utime /* 6130 */ | 252 | PTR compat_sys_utime /* 6130 */ |
253 | PTR sys_mknod | 253 | PTR sys_mknod |
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index 8a8b8dd90417..237cd8a2cd32 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (C) 1991, 1992 Linus Torvalds | 6 | * Copyright (C) 1991, 1992 Linus Torvalds |
7 | * Copyright (C) 1994 - 2000 Ralf Baechle | 7 | * Copyright (C) 1994 - 2000, 2006 Ralf Baechle |
8 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | 8 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. |
9 | */ | 9 | */ |
10 | #include <linux/cache.h> | 10 | #include <linux/cache.h> |
@@ -106,8 +106,6 @@ typedef struct compat_siginfo { | |||
106 | 106 | ||
107 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | 107 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) |
108 | 108 | ||
109 | extern int do_signal32(sigset_t *oldset, struct pt_regs *regs); | ||
110 | |||
111 | /* 32-bit compatibility types */ | 109 | /* 32-bit compatibility types */ |
112 | 110 | ||
113 | #define _NSIG_BPW32 32 | 111 | #define _NSIG_BPW32 32 |
@@ -198,7 +196,7 @@ __attribute_used__ noinline static int | |||
198 | _sys32_sigsuspend(nabi_no_regargs struct pt_regs regs) | 196 | _sys32_sigsuspend(nabi_no_regargs struct pt_regs regs) |
199 | { | 197 | { |
200 | compat_sigset_t *uset; | 198 | compat_sigset_t *uset; |
201 | sigset_t newset, saveset; | 199 | sigset_t newset; |
202 | 200 | ||
203 | uset = (compat_sigset_t *) regs.regs[4]; | 201 | uset = (compat_sigset_t *) regs.regs[4]; |
204 | if (get_sigset(&newset, uset)) | 202 | if (get_sigset(&newset, uset)) |
@@ -206,19 +204,15 @@ _sys32_sigsuspend(nabi_no_regargs struct pt_regs regs) | |||
206 | sigdelsetmask(&newset, ~_BLOCKABLE); | 204 | sigdelsetmask(&newset, ~_BLOCKABLE); |
207 | 205 | ||
208 | spin_lock_irq(¤t->sighand->siglock); | 206 | spin_lock_irq(¤t->sighand->siglock); |
209 | saveset = current->blocked; | 207 | current->saved_sigmask = current->blocked; |
210 | current->blocked = newset; | 208 | current->blocked = newset; |
211 | recalc_sigpending(); | 209 | recalc_sigpending(); |
212 | spin_unlock_irq(¤t->sighand->siglock); | 210 | spin_unlock_irq(¤t->sighand->siglock); |
213 | 211 | ||
214 | regs.regs[2] = EINTR; | 212 | current->state = TASK_INTERRUPTIBLE; |
215 | regs.regs[7] = 1; | 213 | schedule(); |
216 | while (1) { | 214 | set_thread_flag(TIF_RESTORE_SIGMASK); |
217 | current->state = TASK_INTERRUPTIBLE; | 215 | return -ERESTARTNOHAND; |
218 | schedule(); | ||
219 | if (do_signal32(&saveset, ®s)) | ||
220 | return -EINTR; | ||
221 | } | ||
222 | } | 216 | } |
223 | 217 | ||
224 | save_static_function(sys32_rt_sigsuspend); | 218 | save_static_function(sys32_rt_sigsuspend); |
@@ -226,8 +220,8 @@ __attribute_used__ noinline static int | |||
226 | _sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | 220 | _sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) |
227 | { | 221 | { |
228 | compat_sigset_t *uset; | 222 | compat_sigset_t *uset; |
229 | sigset_t newset, saveset; | 223 | sigset_t newset; |
230 | size_t sigsetsize; | 224 | size_t sigsetsize; |
231 | 225 | ||
232 | /* XXX Don't preclude handling different sized sigset_t's. */ | 226 | /* XXX Don't preclude handling different sized sigset_t's. */ |
233 | sigsetsize = regs.regs[5]; | 227 | sigsetsize = regs.regs[5]; |
@@ -240,19 +234,15 @@ _sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | |||
240 | sigdelsetmask(&newset, ~_BLOCKABLE); | 234 | sigdelsetmask(&newset, ~_BLOCKABLE); |
241 | 235 | ||
242 | spin_lock_irq(¤t->sighand->siglock); | 236 | spin_lock_irq(¤t->sighand->siglock); |
243 | saveset = current->blocked; | 237 | current->saved_sigmask = current->blocked; |
244 | current->blocked = newset; | 238 | current->blocked = newset; |
245 | recalc_sigpending(); | 239 | recalc_sigpending(); |
246 | spin_unlock_irq(¤t->sighand->siglock); | 240 | spin_unlock_irq(¤t->sighand->siglock); |
247 | 241 | ||
248 | regs.regs[2] = EINTR; | 242 | current->state = TASK_INTERRUPTIBLE; |
249 | regs.regs[7] = 1; | 243 | schedule(); |
250 | while (1) { | 244 | set_thread_flag(TIF_RESTORE_SIGMASK); |
251 | current->state = TASK_INTERRUPTIBLE; | 245 | return -ERESTARTNOHAND; |
252 | schedule(); | ||
253 | if (do_signal32(&saveset, ®s)) | ||
254 | return -EINTR; | ||
255 | } | ||
256 | } | 246 | } |
257 | 247 | ||
258 | asmlinkage int sys32_sigaction(int sig, const struct sigaction32 *act, | 248 | asmlinkage int sys32_sigaction(int sig, const struct sigaction32 *act, |
@@ -783,7 +773,7 @@ static inline int handle_signal(unsigned long sig, siginfo_t *info, | |||
783 | regs->regs[2] = EINTR; | 773 | regs->regs[2] = EINTR; |
784 | break; | 774 | break; |
785 | case ERESTARTSYS: | 775 | case ERESTARTSYS: |
786 | if(!(ka->sa.sa_flags & SA_RESTART)) { | 776 | if (!(ka->sa.sa_flags & SA_RESTART)) { |
787 | regs->regs[2] = EINTR; | 777 | regs->regs[2] = EINTR; |
788 | break; | 778 | break; |
789 | } | 779 | } |
@@ -810,9 +800,10 @@ static inline int handle_signal(unsigned long sig, siginfo_t *info, | |||
810 | return ret; | 800 | return ret; |
811 | } | 801 | } |
812 | 802 | ||
813 | int do_signal32(sigset_t *oldset, struct pt_regs *regs) | 803 | void do_signal32(struct pt_regs *regs) |
814 | { | 804 | { |
815 | struct k_sigaction ka; | 805 | struct k_sigaction ka; |
806 | sigset_t *oldset; | ||
816 | siginfo_t info; | 807 | siginfo_t info; |
817 | int signr; | 808 | int signr; |
818 | 809 | ||
@@ -822,17 +813,30 @@ int do_signal32(sigset_t *oldset, struct pt_regs *regs) | |||
822 | * if so. | 813 | * if so. |
823 | */ | 814 | */ |
824 | if (!user_mode(regs)) | 815 | if (!user_mode(regs)) |
825 | return 1; | 816 | return; |
826 | 817 | ||
827 | if (try_to_freeze()) | 818 | if (try_to_freeze()) |
828 | goto no_signal; | 819 | goto no_signal; |
829 | 820 | ||
830 | if (!oldset) | 821 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) |
822 | oldset = ¤t->saved_sigmask; | ||
823 | else | ||
831 | oldset = ¤t->blocked; | 824 | oldset = ¤t->blocked; |
832 | 825 | ||
833 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 826 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
834 | if (signr > 0) | 827 | if (signr > 0) { |
835 | return handle_signal(signr, &info, &ka, oldset, regs); | 828 | /* Whee! Actually deliver the signal. */ |
829 | if (handle_signal(signr, &info, &ka, oldset, regs) == 0) { | ||
830 | /* | ||
831 | * A signal was successfully delivered; the saved | ||
832 | * sigmask will have been stored in the signal frame, | ||
833 | * and will be restored by sigreturn, so we can simply | ||
834 | * clear the TIF_RESTORE_SIGMASK flag. | ||
835 | */ | ||
836 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | ||
837 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
838 | } | ||
839 | } | ||
836 | 840 | ||
837 | no_signal: | 841 | no_signal: |
838 | /* | 842 | /* |
@@ -853,7 +857,15 @@ no_signal: | |||
853 | regs->cp0_epc -= 4; | 857 | regs->cp0_epc -= 4; |
854 | } | 858 | } |
855 | } | 859 | } |
856 | return 0; | 860 | |
861 | /* | ||
862 | * If there's no signal to deliver, we just put the saved sigmask | ||
863 | * back | ||
864 | */ | ||
865 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) { | ||
866 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
867 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | ||
868 | } | ||
857 | } | 869 | } |
858 | 870 | ||
859 | asmlinkage int sys32_rt_sigaction(int sig, const struct sigaction32 *act, | 871 | asmlinkage int sys32_rt_sigaction(int sig, const struct sigaction32 *act, |
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c index 5a3776096f07..3e168c08a3a8 100644 --- a/arch/mips/kernel/signal_n32.c +++ b/arch/mips/kernel/signal_n32.c | |||
@@ -81,6 +81,39 @@ struct rt_sigframe_n32 { | |||
81 | #endif | 81 | #endif |
82 | }; | 82 | }; |
83 | 83 | ||
84 | extern void sigset_from_compat (sigset_t *set, compat_sigset_t *compat); | ||
85 | |||
86 | save_static_function(sysn32_rt_sigsuspend); | ||
87 | __attribute_used__ noinline static int | ||
88 | _sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | ||
89 | { | ||
90 | compat_sigset_t __user *unewset, uset; | ||
91 | size_t sigsetsize; | ||
92 | sigset_t newset; | ||
93 | |||
94 | /* XXX Don't preclude handling different sized sigset_t's. */ | ||
95 | sigsetsize = regs.regs[5]; | ||
96 | if (sigsetsize != sizeof(sigset_t)) | ||
97 | return -EINVAL; | ||
98 | |||
99 | unewset = (compat_sigset_t __user *) regs.regs[4]; | ||
100 | if (copy_from_user(&uset, unewset, sizeof(uset))) | ||
101 | return -EFAULT; | ||
102 | sigset_from_compat (&newset, &uset); | ||
103 | sigdelsetmask(&newset, ~_BLOCKABLE); | ||
104 | |||
105 | spin_lock_irq(¤t->sighand->siglock); | ||
106 | current->saved_sigmask = current->blocked; | ||
107 | current->blocked = newset; | ||
108 | recalc_sigpending(); | ||
109 | spin_unlock_irq(¤t->sighand->siglock); | ||
110 | |||
111 | current->state = TASK_INTERRUPTIBLE; | ||
112 | schedule(); | ||
113 | set_thread_flag(TIF_RESTORE_SIGMASK); | ||
114 | return -ERESTARTNOHAND; | ||
115 | } | ||
116 | |||
84 | save_static_function(sysn32_rt_sigreturn); | 117 | save_static_function(sysn32_rt_sigreturn); |
85 | __attribute_used__ noinline static void | 118 | __attribute_used__ noinline static void |
86 | _sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | 119 | _sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) |
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 25472fcaf715..5e189862e523 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/timex.h> | 29 | #include <linux/timex.h> |
30 | #include <linux/sched.h> | 30 | #include <linux/sched.h> |
31 | #include <linux/cpumask.h> | 31 | #include <linux/cpumask.h> |
32 | #include <linux/cpu.h> | ||
32 | 33 | ||
33 | #include <asm/atomic.h> | 34 | #include <asm/atomic.h> |
34 | #include <asm/cpu.h> | 35 | #include <asm/cpu.h> |
@@ -424,6 +425,25 @@ void flush_tlb_one(unsigned long vaddr) | |||
424 | local_flush_tlb_one(vaddr); | 425 | local_flush_tlb_one(vaddr); |
425 | } | 426 | } |
426 | 427 | ||
428 | static DEFINE_PER_CPU(struct cpu, cpu_devices); | ||
429 | |||
430 | static int __init topology_init(void) | ||
431 | { | ||
432 | int cpu; | ||
433 | int ret; | ||
434 | |||
435 | for_each_cpu(cpu) { | ||
436 | ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu, NULL); | ||
437 | if (ret) | ||
438 | printk(KERN_WARNING "topology_init: register_cpu %d " | ||
439 | "failed (%d)\n", cpu, ret); | ||
440 | } | ||
441 | |||
442 | return 0; | ||
443 | } | ||
444 | |||
445 | subsys_initcall(topology_init); | ||
446 | |||
427 | EXPORT_SYMBOL(flush_tlb_page); | 447 | EXPORT_SYMBOL(flush_tlb_page); |
428 | EXPORT_SYMBOL(flush_tlb_one); | 448 | EXPORT_SYMBOL(flush_tlb_one); |
429 | EXPORT_SYMBOL(cpu_data); | 449 | EXPORT_SYMBOL(cpu_data); |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index c9d2b5147ca3..005debbfbe84 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * License. See the file "COPYING" in the main directory of this archive | 3 | * License. See the file "COPYING" in the main directory of this archive |
4 | * for more details. | 4 | * for more details. |
5 | * | 5 | * |
6 | * Copyright (C) 1994 - 1999, 2000, 01 Ralf Baechle | 6 | * Copyright (C) 1994 - 1999, 2000, 01, 06 Ralf Baechle |
7 | * Copyright (C) 1995, 1996 Paul M. Antoine | 7 | * Copyright (C) 1995, 1996 Paul M. Antoine |
8 | * Copyright (C) 1998 Ulf Carlsson | 8 | * Copyright (C) 1998 Ulf Carlsson |
9 | * Copyright (C) 1999 Silicon Graphics, Inc. | 9 | * Copyright (C) 1999 Silicon Graphics, Inc. |
@@ -548,6 +548,8 @@ asmlinkage void do_ov(struct pt_regs *regs) | |||
548 | { | 548 | { |
549 | siginfo_t info; | 549 | siginfo_t info; |
550 | 550 | ||
551 | die_if_kernel("Integer overflow", regs); | ||
552 | |||
551 | info.si_code = FPE_INTOVF; | 553 | info.si_code = FPE_INTOVF; |
552 | info.si_signo = SIGFPE; | 554 | info.si_signo = SIGFPE; |
553 | info.si_errno = 0; | 555 | info.si_errno = 0; |
diff --git a/arch/mips/mm/cex-sb1.S b/arch/mips/mm/cex-sb1.S index 0e71580774ff..e54a62f2807c 100644 --- a/arch/mips/mm/cex-sb1.S +++ b/arch/mips/mm/cex-sb1.S | |||
@@ -64,7 +64,7 @@ LEAF(except_vec2_sb1) | |||
64 | sd k0,0x170($0) | 64 | sd k0,0x170($0) |
65 | sd k1,0x178($0) | 65 | sd k1,0x178($0) |
66 | 66 | ||
67 | #if CONFIG_SB1_CEX_ALWAYS_FATAL | 67 | #ifdef CONFIG_SB1_CEX_ALWAYS_FATAL |
68 | j handle_vec2_sb1 | 68 | j handle_vec2_sb1 |
69 | nop | 69 | nop |
70 | #else | 70 | #else |
diff --git a/arch/mips/pmc-sierra/yosemite/smp.c b/arch/mips/pmc-sierra/yosemite/smp.c index f17f575f58f0..7f8fda962190 100644 --- a/arch/mips/pmc-sierra/yosemite/smp.c +++ b/arch/mips/pmc-sierra/yosemite/smp.c | |||
@@ -94,7 +94,7 @@ void __init prom_prepare_cpus(unsigned int max_cpus) | |||
94 | void prom_boot_secondary(int cpu, struct task_struct *idle) | 94 | void prom_boot_secondary(int cpu, struct task_struct *idle) |
95 | { | 95 | { |
96 | unsigned long gp = (unsigned long) task_thread_info(idle); | 96 | unsigned long gp = (unsigned long) task_thread_info(idle); |
97 | unsigned long sp = __KSTK_TOP(idle); | 97 | unsigned long sp = __KSTK_TOS(idle); |
98 | 98 | ||
99 | secondary_sp = sp; | 99 | secondary_sp = sp; |
100 | secondary_gp = gp; | 100 | secondary_gp = gp; |
diff --git a/arch/mips/sibyte/Kconfig b/arch/mips/sibyte/Kconfig index de46f62ac462..816aee7fcd25 100644 --- a/arch/mips/sibyte/Kconfig +++ b/arch/mips/sibyte/Kconfig | |||
@@ -102,11 +102,11 @@ config SIMULATION | |||
102 | Build a kernel suitable for running under the GDB simulator. | 102 | Build a kernel suitable for running under the GDB simulator. |
103 | Primarily adjusts the kernel's notion of time. | 103 | Primarily adjusts the kernel's notion of time. |
104 | 104 | ||
105 | config CONFIG_SB1_CEX_ALWAYS_FATAL | 105 | config SB1_CEX_ALWAYS_FATAL |
106 | bool "All cache exceptions considered fatal (no recovery attempted)" | 106 | bool "All cache exceptions considered fatal (no recovery attempted)" |
107 | depends on SIBYTE_SB1xxx_SOC | 107 | depends on SIBYTE_SB1xxx_SOC |
108 | 108 | ||
109 | config CONFIG_SB1_CERR_STALL | 109 | config SB1_CERR_STALL |
110 | bool "Stall (rather than panic) on fatal cache error" | 110 | bool "Stall (rather than panic) on fatal cache error" |
111 | depends on SIBYTE_SB1xxx_SOC | 111 | depends on SIBYTE_SB1xxx_SOC |
112 | 112 | ||
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c index b2a1ba5d23df..9cf7d713b13c 100644 --- a/arch/mips/sibyte/bcm1480/irq.c +++ b/arch/mips/sibyte/bcm1480/irq.c | |||
@@ -139,7 +139,7 @@ void bcm1480_unmask_irq(int cpu, int irq) | |||
139 | #ifdef CONFIG_SMP | 139 | #ifdef CONFIG_SMP |
140 | static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask) | 140 | static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask) |
141 | { | 141 | { |
142 | int i = 0, old_cpu, cpu, int_on; | 142 | int i = 0, old_cpu, cpu, int_on, k; |
143 | u64 cur_ints; | 143 | u64 cur_ints; |
144 | irq_desc_t *desc = irq_desc + irq; | 144 | irq_desc_t *desc = irq_desc + irq; |
145 | unsigned long flags; | 145 | unsigned long flags; |
@@ -165,7 +165,6 @@ static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask) | |||
165 | irq_dirty -= BCM1480_NR_IRQS_HALF; | 165 | irq_dirty -= BCM1480_NR_IRQS_HALF; |
166 | } | 166 | } |
167 | 167 | ||
168 | int k; | ||
169 | for (k=0; k<2; k++) { /* Loop through high and low interrupt mask register */ | 168 | for (k=0; k<2; k++) { /* Loop through high and low interrupt mask register */ |
170 | cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(old_cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING))); | 169 | cur_ints = ____raw_readq(IOADDR(A_BCM1480_IMR_MAPPER(old_cpu) + R_BCM1480_IMR_INTERRUPT_MASK_H + (k*BCM1480_IMR_HL_SPACING))); |
171 | int_on = !(cur_ints & (((u64) 1) << irq_dirty)); | 170 | int_on = !(cur_ints & (((u64) 1) << irq_dirty)); |
@@ -216,6 +215,7 @@ static void ack_bcm1480_irq(unsigned int irq) | |||
216 | { | 215 | { |
217 | u64 pending; | 216 | u64 pending; |
218 | unsigned int irq_dirty; | 217 | unsigned int irq_dirty; |
218 | int k; | ||
219 | 219 | ||
220 | /* | 220 | /* |
221 | * If the interrupt was an HT interrupt, now is the time to | 221 | * If the interrupt was an HT interrupt, now is the time to |
@@ -227,7 +227,6 @@ static void ack_bcm1480_irq(unsigned int irq) | |||
227 | if ((irq_dirty >= BCM1480_NR_IRQS_HALF) && (irq_dirty <= BCM1480_NR_IRQS)) { | 227 | if ((irq_dirty >= BCM1480_NR_IRQS_HALF) && (irq_dirty <= BCM1480_NR_IRQS)) { |
228 | irq_dirty -= BCM1480_NR_IRQS_HALF; | 228 | irq_dirty -= BCM1480_NR_IRQS_HALF; |
229 | } | 229 | } |
230 | int k; | ||
231 | for (k=0; k<2; k++) { /* Loop through high and low LDT interrupts */ | 230 | for (k=0; k<2; k++) { /* Loop through high and low LDT interrupts */ |
232 | pending = __raw_readq(IOADDR(A_BCM1480_IMR_REGISTER(bcm1480_irq_owner[irq], | 231 | pending = __raw_readq(IOADDR(A_BCM1480_IMR_REGISTER(bcm1480_irq_owner[irq], |
233 | R_BCM1480_IMR_LDT_INTERRUPT_H + (k*BCM1480_IMR_HL_SPACING)))); | 232 | R_BCM1480_IMR_LDT_INTERRUPT_H + (k*BCM1480_IMR_HL_SPACING)))); |
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 415659629394..2b03a09fe5e9 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -157,8 +157,7 @@ _GLOBAL(__secondary_hold) | |||
157 | SET_REG_IMMEDIATE(r4, .hmt_init) | 157 | SET_REG_IMMEDIATE(r4, .hmt_init) |
158 | mtctr r4 | 158 | mtctr r4 |
159 | bctr | 159 | bctr |
160 | #else | 160 | #elif defined(CONFIG_SMP) || defined(CONFIG_KEXEC) |
161 | #ifdef CONFIG_SMP | ||
162 | LOAD_REG_IMMEDIATE(r4, .pSeries_secondary_smp_init) | 161 | LOAD_REG_IMMEDIATE(r4, .pSeries_secondary_smp_init) |
163 | mtctr r4 | 162 | mtctr r4 |
164 | mr r3,r24 | 163 | mr r3,r24 |
@@ -166,7 +165,6 @@ _GLOBAL(__secondary_hold) | |||
166 | #else | 165 | #else |
167 | BUG_OPCODE | 166 | BUG_OPCODE |
168 | #endif | 167 | #endif |
169 | #endif | ||
170 | 168 | ||
171 | /* This value is used to mark exception frames on the stack. */ | 169 | /* This value is used to mark exception frames on the stack. */ |
172 | .section ".toc","aw" | 170 | .section ".toc","aw" |
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index 1ae96a8ed7e2..e789fef4eb8a 100644 --- a/arch/powerpc/kernel/lparcfg.c +++ b/arch/powerpc/kernel/lparcfg.c | |||
@@ -341,7 +341,7 @@ static int lparcfg_data(struct seq_file *m, void *v) | |||
341 | const char *system_id = ""; | 341 | const char *system_id = ""; |
342 | unsigned int *lp_index_ptr, lp_index = 0; | 342 | unsigned int *lp_index_ptr, lp_index = 0; |
343 | struct device_node *rtas_node; | 343 | struct device_node *rtas_node; |
344 | int *lrdrp; | 344 | int *lrdrp = NULL; |
345 | 345 | ||
346 | rootdn = find_path_device("/"); | 346 | rootdn = find_path_device("/"); |
347 | if (rootdn) { | 347 | if (rootdn) { |
@@ -362,7 +362,9 @@ static int lparcfg_data(struct seq_file *m, void *v) | |||
362 | seq_printf(m, "partition_id=%d\n", (int)lp_index); | 362 | seq_printf(m, "partition_id=%d\n", (int)lp_index); |
363 | 363 | ||
364 | rtas_node = find_path_device("/rtas"); | 364 | rtas_node = find_path_device("/rtas"); |
365 | lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity", NULL); | 365 | if (rtas_node) |
366 | lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity", | ||
367 | NULL); | ||
366 | 368 | ||
367 | if (lrdrp == NULL) { | 369 | if (lrdrp == NULL) { |
368 | partition_potential_processors = vdso_data->processorCount; | 370 | partition_potential_processors = vdso_data->processorCount; |
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c index d9a459c144d8..8a731ea877b7 100644 --- a/arch/powerpc/kernel/ppc_ksyms.c +++ b/arch/powerpc/kernel/ppc_ksyms.c | |||
@@ -79,15 +79,8 @@ EXPORT_SYMBOL(sys_sigreturn); | |||
79 | EXPORT_SYMBOL(strcpy); | 79 | EXPORT_SYMBOL(strcpy); |
80 | EXPORT_SYMBOL(strncpy); | 80 | EXPORT_SYMBOL(strncpy); |
81 | EXPORT_SYMBOL(strcat); | 81 | EXPORT_SYMBOL(strcat); |
82 | EXPORT_SYMBOL(strncat); | ||
83 | EXPORT_SYMBOL(strchr); | ||
84 | EXPORT_SYMBOL(strrchr); | ||
85 | EXPORT_SYMBOL(strpbrk); | ||
86 | EXPORT_SYMBOL(strstr); | ||
87 | EXPORT_SYMBOL(strlen); | 82 | EXPORT_SYMBOL(strlen); |
88 | EXPORT_SYMBOL(strnlen); | ||
89 | EXPORT_SYMBOL(strcmp); | 83 | EXPORT_SYMBOL(strcmp); |
90 | EXPORT_SYMBOL(strncmp); | ||
91 | EXPORT_SYMBOL(strcasecmp); | 84 | EXPORT_SYMBOL(strcasecmp); |
92 | 85 | ||
93 | EXPORT_SYMBOL(csum_partial); | 86 | EXPORT_SYMBOL(csum_partial); |
@@ -185,9 +178,6 @@ EXPORT_SYMBOL(adb_try_handler_change); | |||
185 | EXPORT_SYMBOL(cuda_request); | 178 | EXPORT_SYMBOL(cuda_request); |
186 | EXPORT_SYMBOL(cuda_poll); | 179 | EXPORT_SYMBOL(cuda_poll); |
187 | #endif /* CONFIG_ADB_CUDA */ | 180 | #endif /* CONFIG_ADB_CUDA */ |
188 | #ifdef CONFIG_PPC_PMAC | ||
189 | EXPORT_SYMBOL(sys_ctrler); | ||
190 | #endif | ||
191 | #ifdef CONFIG_VT | 181 | #ifdef CONFIG_VT |
192 | EXPORT_SYMBOL(kd_mksound); | 182 | EXPORT_SYMBOL(kd_mksound); |
193 | #endif | 183 | #endif |
@@ -205,7 +195,6 @@ EXPORT_SYMBOL(__lshrdi3); | |||
205 | EXPORT_SYMBOL(memcpy); | 195 | EXPORT_SYMBOL(memcpy); |
206 | EXPORT_SYMBOL(memset); | 196 | EXPORT_SYMBOL(memset); |
207 | EXPORT_SYMBOL(memmove); | 197 | EXPORT_SYMBOL(memmove); |
208 | EXPORT_SYMBOL(memscan); | ||
209 | EXPORT_SYMBOL(memcmp); | 198 | EXPORT_SYMBOL(memcmp); |
210 | EXPORT_SYMBOL(memchr); | 199 | EXPORT_SYMBOL(memchr); |
211 | 200 | ||
@@ -214,7 +203,6 @@ EXPORT_SYMBOL(screen_info); | |||
214 | #endif | 203 | #endif |
215 | 204 | ||
216 | #ifdef CONFIG_PPC32 | 205 | #ifdef CONFIG_PPC32 |
217 | EXPORT_SYMBOL(__delay); | ||
218 | EXPORT_SYMBOL(timer_interrupt); | 206 | EXPORT_SYMBOL(timer_interrupt); |
219 | EXPORT_SYMBOL(irq_desc); | 207 | EXPORT_SYMBOL(irq_desc); |
220 | EXPORT_SYMBOL(tb_ticks_per_jiffy); | 208 | EXPORT_SYMBOL(tb_ticks_per_jiffy); |
@@ -222,10 +210,6 @@ EXPORT_SYMBOL(console_drivers); | |||
222 | EXPORT_SYMBOL(cacheable_memcpy); | 210 | EXPORT_SYMBOL(cacheable_memcpy); |
223 | #endif | 211 | #endif |
224 | 212 | ||
225 | EXPORT_SYMBOL(__up); | ||
226 | EXPORT_SYMBOL(__down); | ||
227 | EXPORT_SYMBOL(__down_interruptible); | ||
228 | |||
229 | #ifdef CONFIG_8xx | 213 | #ifdef CONFIG_8xx |
230 | EXPORT_SYMBOL(cpm_install_handler); | 214 | EXPORT_SYMBOL(cpm_install_handler); |
231 | EXPORT_SYMBOL(cpm_free_handler); | 215 | EXPORT_SYMBOL(cpm_free_handler); |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index a717dff695ef..f96c49b03ba0 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -311,8 +311,6 @@ void smp_release_cpus(void) | |||
311 | 311 | ||
312 | DBG(" <- smp_release_cpus()\n"); | 312 | DBG(" <- smp_release_cpus()\n"); |
313 | } | 313 | } |
314 | #else | ||
315 | #define smp_release_cpus() | ||
316 | #endif /* CONFIG_SMP || CONFIG_KEXEC */ | 314 | #endif /* CONFIG_SMP || CONFIG_KEXEC */ |
317 | 315 | ||
318 | /* | 316 | /* |
@@ -473,10 +471,12 @@ void __init setup_system(void) | |||
473 | check_smt_enabled(); | 471 | check_smt_enabled(); |
474 | smp_setup_cpu_maps(); | 472 | smp_setup_cpu_maps(); |
475 | 473 | ||
474 | #ifdef CONFIG_SMP | ||
476 | /* Release secondary cpus out of their spinloops at 0x60 now that | 475 | /* Release secondary cpus out of their spinloops at 0x60 now that |
477 | * we can map physical -> logical CPU ids | 476 | * we can map physical -> logical CPU ids |
478 | */ | 477 | */ |
479 | smp_release_cpus(); | 478 | smp_release_cpus(); |
479 | #endif | ||
480 | 480 | ||
481 | printk("Starting Linux PPC64 %s\n", system_utsname.version); | 481 | printk("Starting Linux PPC64 %s\n", system_utsname.version); |
482 | 482 | ||
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c index 475249dc2350..cd75ab2908fa 100644 --- a/arch/powerpc/kernel/sys_ppc32.c +++ b/arch/powerpc/kernel/sys_ppc32.c | |||
@@ -176,7 +176,6 @@ struct timex32 { | |||
176 | }; | 176 | }; |
177 | 177 | ||
178 | extern int do_adjtimex(struct timex *); | 178 | extern int do_adjtimex(struct timex *); |
179 | extern void ppc_adjtimex(void); | ||
180 | 179 | ||
181 | asmlinkage long compat_sys_adjtimex(struct timex32 __user *utp) | 180 | asmlinkage long compat_sys_adjtimex(struct timex32 __user *utp) |
182 | { | 181 | { |
@@ -209,9 +208,6 @@ asmlinkage long compat_sys_adjtimex(struct timex32 __user *utp) | |||
209 | 208 | ||
210 | ret = do_adjtimex(&txc); | 209 | ret = do_adjtimex(&txc); |
211 | 210 | ||
212 | /* adjust the conversion of TB to time of day to track adjtimex */ | ||
213 | ppc_adjtimex(); | ||
214 | |||
215 | if(put_user(txc.modes, &utp->modes) || | 211 | if(put_user(txc.modes, &utp->modes) || |
216 | __put_user(txc.offset, &utp->offset) || | 212 | __put_user(txc.offset, &utp->offset) || |
217 | __put_user(txc.freq, &utp->freq) || | 213 | __put_user(txc.freq, &utp->freq) || |
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 1886045a2fd8..2a7ddc579379 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <linux/security.h> | 50 | #include <linux/security.h> |
51 | #include <linux/percpu.h> | 51 | #include <linux/percpu.h> |
52 | #include <linux/rtc.h> | 52 | #include <linux/rtc.h> |
53 | #include <linux/jiffies.h> | ||
53 | 54 | ||
54 | #include <asm/io.h> | 55 | #include <asm/io.h> |
55 | #include <asm/processor.h> | 56 | #include <asm/processor.h> |
@@ -99,7 +100,15 @@ EXPORT_SYMBOL(tb_ticks_per_usec); | |||
99 | unsigned long tb_ticks_per_sec; | 100 | unsigned long tb_ticks_per_sec; |
100 | u64 tb_to_xs; | 101 | u64 tb_to_xs; |
101 | unsigned tb_to_us; | 102 | unsigned tb_to_us; |
102 | unsigned long processor_freq; | 103 | |
104 | #define TICKLEN_SCALE (SHIFT_SCALE - 10) | ||
105 | u64 last_tick_len; /* units are ns / 2^TICKLEN_SCALE */ | ||
106 | u64 ticklen_to_xs; /* 0.64 fraction */ | ||
107 | |||
108 | /* If last_tick_len corresponds to about 1/HZ seconds, then | ||
109 | last_tick_len << TICKLEN_SHIFT will be about 2^63. */ | ||
110 | #define TICKLEN_SHIFT (63 - 30 - TICKLEN_SCALE + SHIFT_HZ) | ||
111 | |||
103 | DEFINE_SPINLOCK(rtc_lock); | 112 | DEFINE_SPINLOCK(rtc_lock); |
104 | EXPORT_SYMBOL_GPL(rtc_lock); | 113 | EXPORT_SYMBOL_GPL(rtc_lock); |
105 | 114 | ||
@@ -113,10 +122,6 @@ extern unsigned long wall_jiffies; | |||
113 | extern struct timezone sys_tz; | 122 | extern struct timezone sys_tz; |
114 | static long timezone_offset; | 123 | static long timezone_offset; |
115 | 124 | ||
116 | void ppc_adjtimex(void); | ||
117 | |||
118 | static unsigned adjusting_time = 0; | ||
119 | |||
120 | unsigned long ppc_proc_freq; | 125 | unsigned long ppc_proc_freq; |
121 | unsigned long ppc_tb_freq; | 126 | unsigned long ppc_tb_freq; |
122 | 127 | ||
@@ -178,8 +183,7 @@ static __inline__ void timer_check_rtc(void) | |||
178 | */ | 183 | */ |
179 | if (ppc_md.set_rtc_time && ntp_synced() && | 184 | if (ppc_md.set_rtc_time && ntp_synced() && |
180 | xtime.tv_sec - last_rtc_update >= 659 && | 185 | xtime.tv_sec - last_rtc_update >= 659 && |
181 | abs((xtime.tv_nsec/1000) - (1000000-1000000/HZ)) < 500000/HZ && | 186 | abs((xtime.tv_nsec/1000) - (1000000-1000000/HZ)) < 500000/HZ) { |
182 | jiffies - wall_jiffies == 1) { | ||
183 | struct rtc_time tm; | 187 | struct rtc_time tm; |
184 | to_tm(xtime.tv_sec + 1 + timezone_offset, &tm); | 188 | to_tm(xtime.tv_sec + 1 + timezone_offset, &tm); |
185 | tm.tm_year -= 1900; | 189 | tm.tm_year -= 1900; |
@@ -226,15 +230,14 @@ void do_gettimeofday(struct timeval *tv) | |||
226 | if (__USE_RTC()) { | 230 | if (__USE_RTC()) { |
227 | /* do this the old way */ | 231 | /* do this the old way */ |
228 | unsigned long flags, seq; | 232 | unsigned long flags, seq; |
229 | unsigned int sec, nsec, usec, lost; | 233 | unsigned int sec, nsec, usec; |
230 | 234 | ||
231 | do { | 235 | do { |
232 | seq = read_seqbegin_irqsave(&xtime_lock, flags); | 236 | seq = read_seqbegin_irqsave(&xtime_lock, flags); |
233 | sec = xtime.tv_sec; | 237 | sec = xtime.tv_sec; |
234 | nsec = xtime.tv_nsec + tb_ticks_since(tb_last_stamp); | 238 | nsec = xtime.tv_nsec + tb_ticks_since(tb_last_stamp); |
235 | lost = jiffies - wall_jiffies; | ||
236 | } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); | 239 | } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); |
237 | usec = nsec / 1000 + lost * (1000000 / HZ); | 240 | usec = nsec / 1000; |
238 | while (usec >= 1000000) { | 241 | while (usec >= 1000000) { |
239 | usec -= 1000000; | 242 | usec -= 1000000; |
240 | ++sec; | 243 | ++sec; |
@@ -248,23 +251,6 @@ void do_gettimeofday(struct timeval *tv) | |||
248 | 251 | ||
249 | EXPORT_SYMBOL(do_gettimeofday); | 252 | EXPORT_SYMBOL(do_gettimeofday); |
250 | 253 | ||
251 | /* Synchronize xtime with do_gettimeofday */ | ||
252 | |||
253 | static inline void timer_sync_xtime(unsigned long cur_tb) | ||
254 | { | ||
255 | #ifdef CONFIG_PPC64 | ||
256 | /* why do we do this? */ | ||
257 | struct timeval my_tv; | ||
258 | |||
259 | __do_gettimeofday(&my_tv, cur_tb); | ||
260 | |||
261 | if (xtime.tv_sec <= my_tv.tv_sec) { | ||
262 | xtime.tv_sec = my_tv.tv_sec; | ||
263 | xtime.tv_nsec = my_tv.tv_usec * 1000; | ||
264 | } | ||
265 | #endif | ||
266 | } | ||
267 | |||
268 | /* | 254 | /* |
269 | * There are two copies of tb_to_xs and stamp_xsec so that no | 255 | * There are two copies of tb_to_xs and stamp_xsec so that no |
270 | * lock is needed to access and use these values in | 256 | * lock is needed to access and use these values in |
@@ -323,15 +309,30 @@ static __inline__ void timer_recalc_offset(u64 cur_tb) | |||
323 | { | 309 | { |
324 | unsigned long offset; | 310 | unsigned long offset; |
325 | u64 new_stamp_xsec; | 311 | u64 new_stamp_xsec; |
312 | u64 tlen, t2x; | ||
326 | 313 | ||
327 | if (__USE_RTC()) | 314 | if (__USE_RTC()) |
328 | return; | 315 | return; |
316 | tlen = current_tick_length(); | ||
329 | offset = cur_tb - do_gtod.varp->tb_orig_stamp; | 317 | offset = cur_tb - do_gtod.varp->tb_orig_stamp; |
330 | if ((offset & 0x80000000u) == 0) | 318 | if (tlen == last_tick_len && offset < 0x80000000u) { |
331 | return; | 319 | /* check that we're still in sync; if not, resync */ |
332 | new_stamp_xsec = do_gtod.varp->stamp_xsec | 320 | struct timeval tv; |
333 | + mulhdu(offset, do_gtod.varp->tb_to_xs); | 321 | __do_gettimeofday(&tv, cur_tb); |
334 | update_gtod(cur_tb, new_stamp_xsec, do_gtod.varp->tb_to_xs); | 322 | if (tv.tv_sec <= xtime.tv_sec && |
323 | (tv.tv_sec < xtime.tv_sec || | ||
324 | tv.tv_usec * 1000 <= xtime.tv_nsec)) | ||
325 | return; | ||
326 | } | ||
327 | if (tlen != last_tick_len) { | ||
328 | t2x = mulhdu(tlen << TICKLEN_SHIFT, ticklen_to_xs); | ||
329 | last_tick_len = tlen; | ||
330 | } else | ||
331 | t2x = do_gtod.varp->tb_to_xs; | ||
332 | new_stamp_xsec = (u64) xtime.tv_nsec * XSEC_PER_SEC; | ||
333 | do_div(new_stamp_xsec, 1000000000); | ||
334 | new_stamp_xsec += (u64) xtime.tv_sec * XSEC_PER_SEC; | ||
335 | update_gtod(cur_tb, new_stamp_xsec, t2x); | ||
335 | } | 336 | } |
336 | 337 | ||
337 | #ifdef CONFIG_SMP | 338 | #ifdef CONFIG_SMP |
@@ -462,13 +463,10 @@ void timer_interrupt(struct pt_regs * regs) | |||
462 | write_seqlock(&xtime_lock); | 463 | write_seqlock(&xtime_lock); |
463 | tb_last_jiffy += tb_ticks_per_jiffy; | 464 | tb_last_jiffy += tb_ticks_per_jiffy; |
464 | tb_last_stamp = per_cpu(last_jiffy, cpu); | 465 | tb_last_stamp = per_cpu(last_jiffy, cpu); |
465 | timer_recalc_offset(tb_last_jiffy); | ||
466 | do_timer(regs); | 466 | do_timer(regs); |
467 | timer_sync_xtime(tb_last_jiffy); | 467 | timer_recalc_offset(tb_last_jiffy); |
468 | timer_check_rtc(); | 468 | timer_check_rtc(); |
469 | write_sequnlock(&xtime_lock); | 469 | write_sequnlock(&xtime_lock); |
470 | if (adjusting_time && (time_adjust == 0)) | ||
471 | ppc_adjtimex(); | ||
472 | } | 470 | } |
473 | 471 | ||
474 | next_dec = tb_ticks_per_jiffy - ticks; | 472 | next_dec = tb_ticks_per_jiffy - ticks; |
@@ -492,16 +490,18 @@ void timer_interrupt(struct pt_regs * regs) | |||
492 | 490 | ||
493 | void wakeup_decrementer(void) | 491 | void wakeup_decrementer(void) |
494 | { | 492 | { |
495 | int i; | 493 | unsigned long ticks; |
496 | 494 | ||
497 | set_dec(tb_ticks_per_jiffy); | ||
498 | /* | 495 | /* |
499 | * We don't expect this to be called on a machine with a 601, | 496 | * The timebase gets saved on sleep and restored on wakeup, |
500 | * so using get_tbl is fine. | 497 | * so all we need to do is to reset the decrementer. |
501 | */ | 498 | */ |
502 | tb_last_stamp = tb_last_jiffy = get_tb(); | 499 | ticks = tb_ticks_since(__get_cpu_var(last_jiffy)); |
503 | for_each_cpu(i) | 500 | if (ticks < tb_ticks_per_jiffy) |
504 | per_cpu(last_jiffy, i) = tb_last_stamp; | 501 | ticks = tb_ticks_per_jiffy - ticks; |
502 | else | ||
503 | ticks = 1; | ||
504 | set_dec(ticks); | ||
505 | } | 505 | } |
506 | 506 | ||
507 | #ifdef CONFIG_SMP | 507 | #ifdef CONFIG_SMP |
@@ -541,8 +541,8 @@ int do_settimeofday(struct timespec *tv) | |||
541 | time_t wtm_sec, new_sec = tv->tv_sec; | 541 | time_t wtm_sec, new_sec = tv->tv_sec; |
542 | long wtm_nsec, new_nsec = tv->tv_nsec; | 542 | long wtm_nsec, new_nsec = tv->tv_nsec; |
543 | unsigned long flags; | 543 | unsigned long flags; |
544 | long int tb_delta; | 544 | u64 new_xsec; |
545 | u64 new_xsec, tb_delta_xs; | 545 | unsigned long tb_delta; |
546 | 546 | ||
547 | if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) | 547 | if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) |
548 | return -EINVAL; | 548 | return -EINVAL; |
@@ -563,9 +563,19 @@ int do_settimeofday(struct timespec *tv) | |||
563 | first_settimeofday = 0; | 563 | first_settimeofday = 0; |
564 | } | 564 | } |
565 | #endif | 565 | #endif |
566 | |||
567 | /* | ||
568 | * Subtract off the number of nanoseconds since the | ||
569 | * beginning of the last tick. | ||
570 | * Note that since we don't increment jiffies_64 anywhere other | ||
571 | * than in do_timer (since we don't have a lost tick problem), | ||
572 | * wall_jiffies will always be the same as jiffies, | ||
573 | * and therefore the (jiffies - wall_jiffies) computation | ||
574 | * has been removed. | ||
575 | */ | ||
566 | tb_delta = tb_ticks_since(tb_last_stamp); | 576 | tb_delta = tb_ticks_since(tb_last_stamp); |
567 | tb_delta += (jiffies - wall_jiffies) * tb_ticks_per_jiffy; | 577 | tb_delta = mulhdu(tb_delta, do_gtod.varp->tb_to_xs); /* in xsec */ |
568 | tb_delta_xs = mulhdu(tb_delta, do_gtod.varp->tb_to_xs); | 578 | new_nsec -= SCALE_XSEC(tb_delta, 1000000000); |
569 | 579 | ||
570 | wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - new_sec); | 580 | wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - new_sec); |
571 | wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - new_nsec); | 581 | wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - new_nsec); |
@@ -580,12 +590,12 @@ int do_settimeofday(struct timespec *tv) | |||
580 | 590 | ||
581 | ntp_clear(); | 591 | ntp_clear(); |
582 | 592 | ||
583 | new_xsec = 0; | 593 | new_xsec = xtime.tv_nsec; |
584 | if (new_nsec != 0) { | 594 | if (new_xsec != 0) { |
585 | new_xsec = (u64)new_nsec * XSEC_PER_SEC; | 595 | new_xsec *= XSEC_PER_SEC; |
586 | do_div(new_xsec, NSEC_PER_SEC); | 596 | do_div(new_xsec, NSEC_PER_SEC); |
587 | } | 597 | } |
588 | new_xsec += (u64)new_sec * XSEC_PER_SEC - tb_delta_xs; | 598 | new_xsec += (u64)xtime.tv_sec * XSEC_PER_SEC; |
589 | update_gtod(tb_last_jiffy, new_xsec, do_gtod.varp->tb_to_xs); | 599 | update_gtod(tb_last_jiffy, new_xsec, do_gtod.varp->tb_to_xs); |
590 | 600 | ||
591 | vdso_data->tz_minuteswest = sys_tz.tz_minuteswest; | 601 | vdso_data->tz_minuteswest = sys_tz.tz_minuteswest; |
@@ -671,7 +681,7 @@ void __init time_init(void) | |||
671 | unsigned long flags; | 681 | unsigned long flags; |
672 | unsigned long tm = 0; | 682 | unsigned long tm = 0; |
673 | struct div_result res; | 683 | struct div_result res; |
674 | u64 scale; | 684 | u64 scale, x; |
675 | unsigned shift; | 685 | unsigned shift; |
676 | 686 | ||
677 | if (ppc_md.time_init != NULL) | 687 | if (ppc_md.time_init != NULL) |
@@ -693,11 +703,36 @@ void __init time_init(void) | |||
693 | } | 703 | } |
694 | 704 | ||
695 | tb_ticks_per_jiffy = ppc_tb_freq / HZ; | 705 | tb_ticks_per_jiffy = ppc_tb_freq / HZ; |
696 | tb_ticks_per_sec = tb_ticks_per_jiffy * HZ; | 706 | tb_ticks_per_sec = ppc_tb_freq; |
697 | tb_ticks_per_usec = ppc_tb_freq / 1000000; | 707 | tb_ticks_per_usec = ppc_tb_freq / 1000000; |
698 | tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000); | 708 | tb_to_us = mulhwu_scale_factor(ppc_tb_freq, 1000000); |
699 | div128_by_32(1024*1024, 0, tb_ticks_per_sec, &res); | 709 | |
700 | tb_to_xs = res.result_low; | 710 | /* |
711 | * Calculate the length of each tick in ns. It will not be | ||
712 | * exactly 1e9/HZ unless ppc_tb_freq is divisible by HZ. | ||
713 | * We compute 1e9 * tb_ticks_per_jiffy / ppc_tb_freq, | ||
714 | * rounded up. | ||
715 | */ | ||
716 | x = (u64) NSEC_PER_SEC * tb_ticks_per_jiffy + ppc_tb_freq - 1; | ||
717 | do_div(x, ppc_tb_freq); | ||
718 | tick_nsec = x; | ||
719 | last_tick_len = x << TICKLEN_SCALE; | ||
720 | |||
721 | /* | ||
722 | * Compute ticklen_to_xs, which is a factor which gets multiplied | ||
723 | * by (last_tick_len << TICKLEN_SHIFT) to get a tb_to_xs value. | ||
724 | * It is computed as: | ||
725 | * ticklen_to_xs = 2^N / (tb_ticks_per_jiffy * 1e9) | ||
726 | * where N = 64 + 20 - TICKLEN_SCALE - TICKLEN_SHIFT | ||
727 | * so as to give the result as a 0.64 fixed-point fraction. | ||
728 | */ | ||
729 | div128_by_32(1ULL << (64 + 20 - TICKLEN_SCALE - TICKLEN_SHIFT), 0, | ||
730 | tb_ticks_per_jiffy, &res); | ||
731 | div128_by_32(res.result_high, res.result_low, NSEC_PER_SEC, &res); | ||
732 | ticklen_to_xs = res.result_low; | ||
733 | |||
734 | /* Compute tb_to_xs from tick_nsec */ | ||
735 | tb_to_xs = mulhdu(last_tick_len << TICKLEN_SHIFT, ticklen_to_xs); | ||
701 | 736 | ||
702 | /* | 737 | /* |
703 | * Compute scale factor for sched_clock. | 738 | * Compute scale factor for sched_clock. |
@@ -724,6 +759,14 @@ void __init time_init(void) | |||
724 | tm = get_boot_time(); | 759 | tm = get_boot_time(); |
725 | 760 | ||
726 | write_seqlock_irqsave(&xtime_lock, flags); | 761 | write_seqlock_irqsave(&xtime_lock, flags); |
762 | |||
763 | /* If platform provided a timezone (pmac), we correct the time */ | ||
764 | if (timezone_offset) { | ||
765 | sys_tz.tz_minuteswest = -timezone_offset / 60; | ||
766 | sys_tz.tz_dsttime = 0; | ||
767 | tm -= timezone_offset; | ||
768 | } | ||
769 | |||
727 | xtime.tv_sec = tm; | 770 | xtime.tv_sec = tm; |
728 | xtime.tv_nsec = 0; | 771 | xtime.tv_nsec = 0; |
729 | do_gtod.varp = &do_gtod.vars[0]; | 772 | do_gtod.varp = &do_gtod.vars[0]; |
@@ -738,18 +781,11 @@ void __init time_init(void) | |||
738 | vdso_data->tb_orig_stamp = tb_last_jiffy; | 781 | vdso_data->tb_orig_stamp = tb_last_jiffy; |
739 | vdso_data->tb_update_count = 0; | 782 | vdso_data->tb_update_count = 0; |
740 | vdso_data->tb_ticks_per_sec = tb_ticks_per_sec; | 783 | vdso_data->tb_ticks_per_sec = tb_ticks_per_sec; |
741 | vdso_data->stamp_xsec = xtime.tv_sec * XSEC_PER_SEC; | 784 | vdso_data->stamp_xsec = (u64) xtime.tv_sec * XSEC_PER_SEC; |
742 | vdso_data->tb_to_xs = tb_to_xs; | 785 | vdso_data->tb_to_xs = tb_to_xs; |
743 | 786 | ||
744 | time_freq = 0; | 787 | time_freq = 0; |
745 | 788 | ||
746 | /* If platform provided a timezone (pmac), we correct the time */ | ||
747 | if (timezone_offset) { | ||
748 | sys_tz.tz_minuteswest = -timezone_offset / 60; | ||
749 | sys_tz.tz_dsttime = 0; | ||
750 | xtime.tv_sec -= timezone_offset; | ||
751 | } | ||
752 | |||
753 | last_rtc_update = xtime.tv_sec; | 789 | last_rtc_update = xtime.tv_sec; |
754 | set_normalized_timespec(&wall_to_monotonic, | 790 | set_normalized_timespec(&wall_to_monotonic, |
755 | -xtime.tv_sec, -xtime.tv_nsec); | 791 | -xtime.tv_sec, -xtime.tv_nsec); |
@@ -759,126 +795,6 @@ void __init time_init(void) | |||
759 | set_dec(tb_ticks_per_jiffy); | 795 | set_dec(tb_ticks_per_jiffy); |
760 | } | 796 | } |
761 | 797 | ||
762 | /* | ||
763 | * After adjtimex is called, adjust the conversion of tb ticks | ||
764 | * to microseconds to keep do_gettimeofday synchronized | ||
765 | * with ntpd. | ||
766 | * | ||
767 | * Use the time_adjust, time_freq and time_offset computed by adjtimex to | ||
768 | * adjust the frequency. | ||
769 | */ | ||
770 | |||
771 | /* #define DEBUG_PPC_ADJTIMEX 1 */ | ||
772 | |||
773 | void ppc_adjtimex(void) | ||
774 | { | ||
775 | #ifdef CONFIG_PPC64 | ||
776 | unsigned long den, new_tb_ticks_per_sec, tb_ticks, old_xsec, | ||
777 | new_tb_to_xs, new_xsec, new_stamp_xsec; | ||
778 | unsigned long tb_ticks_per_sec_delta; | ||
779 | long delta_freq, ltemp; | ||
780 | struct div_result divres; | ||
781 | unsigned long flags; | ||
782 | long singleshot_ppm = 0; | ||
783 | |||
784 | /* | ||
785 | * Compute parts per million frequency adjustment to | ||
786 | * accomplish the time adjustment implied by time_offset to be | ||
787 | * applied over the elapsed time indicated by time_constant. | ||
788 | * Use SHIFT_USEC to get it into the same units as | ||
789 | * time_freq. | ||
790 | */ | ||
791 | if ( time_offset < 0 ) { | ||
792 | ltemp = -time_offset; | ||
793 | ltemp <<= SHIFT_USEC - SHIFT_UPDATE; | ||
794 | ltemp >>= SHIFT_KG + time_constant; | ||
795 | ltemp = -ltemp; | ||
796 | } else { | ||
797 | ltemp = time_offset; | ||
798 | ltemp <<= SHIFT_USEC - SHIFT_UPDATE; | ||
799 | ltemp >>= SHIFT_KG + time_constant; | ||
800 | } | ||
801 | |||
802 | /* If there is a single shot time adjustment in progress */ | ||
803 | if ( time_adjust ) { | ||
804 | #ifdef DEBUG_PPC_ADJTIMEX | ||
805 | printk("ppc_adjtimex: "); | ||
806 | if ( adjusting_time == 0 ) | ||
807 | printk("starting "); | ||
808 | printk("single shot time_adjust = %ld\n", time_adjust); | ||
809 | #endif | ||
810 | |||
811 | adjusting_time = 1; | ||
812 | |||
813 | /* | ||
814 | * Compute parts per million frequency adjustment | ||
815 | * to match time_adjust | ||
816 | */ | ||
817 | singleshot_ppm = tickadj * HZ; | ||
818 | /* | ||
819 | * The adjustment should be tickadj*HZ to match the code in | ||
820 | * linux/kernel/timer.c, but experiments show that this is too | ||
821 | * large. 3/4 of tickadj*HZ seems about right | ||
822 | */ | ||
823 | singleshot_ppm -= singleshot_ppm / 4; | ||
824 | /* Use SHIFT_USEC to get it into the same units as time_freq */ | ||
825 | singleshot_ppm <<= SHIFT_USEC; | ||
826 | if ( time_adjust < 0 ) | ||
827 | singleshot_ppm = -singleshot_ppm; | ||
828 | } | ||
829 | else { | ||
830 | #ifdef DEBUG_PPC_ADJTIMEX | ||
831 | if ( adjusting_time ) | ||
832 | printk("ppc_adjtimex: ending single shot time_adjust\n"); | ||
833 | #endif | ||
834 | adjusting_time = 0; | ||
835 | } | ||
836 | |||
837 | /* Add up all of the frequency adjustments */ | ||
838 | delta_freq = time_freq + ltemp + singleshot_ppm; | ||
839 | |||
840 | /* | ||
841 | * Compute a new value for tb_ticks_per_sec based on | ||
842 | * the frequency adjustment | ||
843 | */ | ||
844 | den = 1000000 * (1 << (SHIFT_USEC - 8)); | ||
845 | if ( delta_freq < 0 ) { | ||
846 | tb_ticks_per_sec_delta = ( tb_ticks_per_sec * ( (-delta_freq) >> (SHIFT_USEC - 8))) / den; | ||
847 | new_tb_ticks_per_sec = tb_ticks_per_sec + tb_ticks_per_sec_delta; | ||
848 | } | ||
849 | else { | ||
850 | tb_ticks_per_sec_delta = ( tb_ticks_per_sec * ( delta_freq >> (SHIFT_USEC - 8))) / den; | ||
851 | new_tb_ticks_per_sec = tb_ticks_per_sec - tb_ticks_per_sec_delta; | ||
852 | } | ||
853 | |||
854 | #ifdef DEBUG_PPC_ADJTIMEX | ||
855 | printk("ppc_adjtimex: ltemp = %ld, time_freq = %ld, singleshot_ppm = %ld\n", ltemp, time_freq, singleshot_ppm); | ||
856 | printk("ppc_adjtimex: tb_ticks_per_sec - base = %ld new = %ld\n", tb_ticks_per_sec, new_tb_ticks_per_sec); | ||
857 | #endif | ||
858 | |||
859 | /* | ||
860 | * Compute a new value of tb_to_xs (used to convert tb to | ||
861 | * microseconds) and a new value of stamp_xsec which is the | ||
862 | * time (in 1/2^20 second units) corresponding to | ||
863 | * tb_orig_stamp. This new value of stamp_xsec compensates | ||
864 | * for the change in frequency (implied by the new tb_to_xs) | ||
865 | * which guarantees that the current time remains the same. | ||
866 | */ | ||
867 | write_seqlock_irqsave( &xtime_lock, flags ); | ||
868 | tb_ticks = get_tb() - do_gtod.varp->tb_orig_stamp; | ||
869 | div128_by_32(1024*1024, 0, new_tb_ticks_per_sec, &divres); | ||
870 | new_tb_to_xs = divres.result_low; | ||
871 | new_xsec = mulhdu(tb_ticks, new_tb_to_xs); | ||
872 | |||
873 | old_xsec = mulhdu(tb_ticks, do_gtod.varp->tb_to_xs); | ||
874 | new_stamp_xsec = do_gtod.varp->stamp_xsec + old_xsec - new_xsec; | ||
875 | |||
876 | update_gtod(do_gtod.varp->tb_orig_stamp, new_stamp_xsec, new_tb_to_xs); | ||
877 | |||
878 | write_sequnlock_irqrestore( &xtime_lock, flags ); | ||
879 | #endif /* CONFIG_PPC64 */ | ||
880 | } | ||
881 | |||
882 | 798 | ||
883 | #define FEBRUARY 2 | 799 | #define FEBRUARY 2 |
884 | #define STARTOFTIME 1970 | 800 | #define STARTOFTIME 1970 |
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c index 558dd0692092..34714d3ea69a 100644 --- a/arch/powerpc/platforms/powermac/feature.c +++ b/arch/powerpc/platforms/powermac/feature.c | |||
@@ -1646,10 +1646,10 @@ static void intrepid_shutdown(struct macio_chip *macio, int sleep_mode) | |||
1646 | KL0_SCC_CELL_ENABLE); | 1646 | KL0_SCC_CELL_ENABLE); |
1647 | 1647 | ||
1648 | MACIO_BIC(KEYLARGO_FCR1, | 1648 | MACIO_BIC(KEYLARGO_FCR1, |
1649 | /*KL1_USB2_CELL_ENABLE |*/ | ||
1650 | KL1_I2S0_CELL_ENABLE | KL1_I2S0_CLK_ENABLE_BIT | | 1649 | KL1_I2S0_CELL_ENABLE | KL1_I2S0_CLK_ENABLE_BIT | |
1651 | KL1_I2S0_ENABLE | KL1_I2S1_CELL_ENABLE | | 1650 | KL1_I2S0_ENABLE | KL1_I2S1_CELL_ENABLE | |
1652 | KL1_I2S1_CLK_ENABLE_BIT | KL1_I2S1_ENABLE); | 1651 | KL1_I2S1_CLK_ENABLE_BIT | KL1_I2S1_ENABLE | |
1652 | KL1_EIDE0_ENABLE); | ||
1653 | if (pmac_mb.board_flags & PMAC_MB_MOBILE) | 1653 | if (pmac_mb.board_flags & PMAC_MB_MOBILE) |
1654 | MACIO_BIC(KEYLARGO_FCR1, KL1_UIDE_RESET_N); | 1654 | MACIO_BIC(KEYLARGO_FCR1, KL1_UIDE_RESET_N); |
1655 | 1655 | ||
@@ -2183,7 +2183,7 @@ static struct pmac_mb_def pmac_mb_defs[] = { | |||
2183 | }, | 2183 | }, |
2184 | { "PowerMac10,1", "Mac mini", | 2184 | { "PowerMac10,1", "Mac mini", |
2185 | PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, | 2185 | PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, |
2186 | PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER, | 2186 | PMAC_MB_MAY_SLEEP, |
2187 | }, | 2187 | }, |
2188 | { "iMac,1", "iMac (first generation)", | 2188 | { "iMac,1", "iMac (first generation)", |
2189 | PMAC_TYPE_ORIG_IMAC, paddington_features, | 2189 | PMAC_TYPE_ORIG_IMAC, paddington_features, |
@@ -2295,11 +2295,11 @@ static struct pmac_mb_def pmac_mb_defs[] = { | |||
2295 | }, | 2295 | }, |
2296 | { "PowerBook5,8", "PowerBook G4 15\"", | 2296 | { "PowerBook5,8", "PowerBook G4 15\"", |
2297 | PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, | 2297 | PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, |
2298 | PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, | 2298 | PMAC_MB_MAY_SLEEP | PMAC_MB_MOBILE, |
2299 | }, | 2299 | }, |
2300 | { "PowerBook5,9", "PowerBook G4 17\"", | 2300 | { "PowerBook5,9", "PowerBook G4 17\"", |
2301 | PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, | 2301 | PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, |
2302 | PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE, | 2302 | PMAC_MB_MAY_SLEEP | PMAC_MB_MOBILE, |
2303 | }, | 2303 | }, |
2304 | { "PowerBook6,1", "PowerBook G4 12\"", | 2304 | { "PowerBook6,1", "PowerBook G4 12\"", |
2305 | PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, | 2305 | PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features, |
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index 8e6b1ed1396e..8d710af50756 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c | |||
@@ -292,7 +292,7 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu) | |||
292 | if (start_cpu == RTAS_UNKNOWN_SERVICE) | 292 | if (start_cpu == RTAS_UNKNOWN_SERVICE) |
293 | return 1; | 293 | return 1; |
294 | 294 | ||
295 | status = rtas_call(start_cpu, 3, 1, NULL, pcpu, start_here, lcpu); | 295 | status = rtas_call(start_cpu, 3, 1, NULL, pcpu, start_here, pcpu); |
296 | if (status != 0) { | 296 | if (status != 0) { |
297 | printk(KERN_ERR "start-cpu failed: %i\n", status); | 297 | printk(KERN_ERR "start-cpu failed: %i\n", status); |
298 | return 0; | 298 | return 0; |
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c index 15bd9b448a48..82adb4601348 100644 --- a/arch/ppc/kernel/ppc_ksyms.c +++ b/arch/ppc/kernel/ppc_ksyms.c | |||
@@ -93,15 +93,8 @@ EXPORT_SYMBOL(test_and_change_bit); | |||
93 | EXPORT_SYMBOL(strcpy); | 93 | EXPORT_SYMBOL(strcpy); |
94 | EXPORT_SYMBOL(strncpy); | 94 | EXPORT_SYMBOL(strncpy); |
95 | EXPORT_SYMBOL(strcat); | 95 | EXPORT_SYMBOL(strcat); |
96 | EXPORT_SYMBOL(strncat); | ||
97 | EXPORT_SYMBOL(strchr); | ||
98 | EXPORT_SYMBOL(strrchr); | ||
99 | EXPORT_SYMBOL(strpbrk); | ||
100 | EXPORT_SYMBOL(strstr); | ||
101 | EXPORT_SYMBOL(strlen); | 96 | EXPORT_SYMBOL(strlen); |
102 | EXPORT_SYMBOL(strnlen); | ||
103 | EXPORT_SYMBOL(strcmp); | 97 | EXPORT_SYMBOL(strcmp); |
104 | EXPORT_SYMBOL(strncmp); | ||
105 | EXPORT_SYMBOL(strcasecmp); | 98 | EXPORT_SYMBOL(strcasecmp); |
106 | EXPORT_SYMBOL(__div64_32); | 99 | EXPORT_SYMBOL(__div64_32); |
107 | 100 | ||
@@ -253,7 +246,6 @@ EXPORT_SYMBOL(memcpy); | |||
253 | EXPORT_SYMBOL(cacheable_memcpy); | 246 | EXPORT_SYMBOL(cacheable_memcpy); |
254 | EXPORT_SYMBOL(memset); | 247 | EXPORT_SYMBOL(memset); |
255 | EXPORT_SYMBOL(memmove); | 248 | EXPORT_SYMBOL(memmove); |
256 | EXPORT_SYMBOL(memscan); | ||
257 | EXPORT_SYMBOL(memcmp); | 249 | EXPORT_SYMBOL(memcmp); |
258 | EXPORT_SYMBOL(memchr); | 250 | EXPORT_SYMBOL(memchr); |
259 | 251 | ||
diff --git a/arch/ppc/xmon/start.c b/arch/ppc/xmon/start.c index 4344cbe9b5c5..484f5bb1aa3e 100644 --- a/arch/ppc/xmon/start.c +++ b/arch/ppc/xmon/start.c | |||
@@ -146,19 +146,6 @@ xmon_map_scc(void) | |||
146 | static int scc_initialized = 0; | 146 | static int scc_initialized = 0; |
147 | 147 | ||
148 | void xmon_init_scc(void); | 148 | void xmon_init_scc(void); |
149 | extern void cuda_poll(void); | ||
150 | |||
151 | static inline void do_poll_adb(void) | ||
152 | { | ||
153 | #ifdef CONFIG_ADB_PMU | ||
154 | if (sys_ctrler == SYS_CTRLER_PMU) | ||
155 | pmu_poll_adb(); | ||
156 | #endif /* CONFIG_ADB_PMU */ | ||
157 | #ifdef CONFIG_ADB_CUDA | ||
158 | if (sys_ctrler == SYS_CTRLER_CUDA) | ||
159 | cuda_poll(); | ||
160 | #endif /* CONFIG_ADB_CUDA */ | ||
161 | } | ||
162 | 149 | ||
163 | int | 150 | int |
164 | xmon_write(void *handle, void *ptr, int nb) | 151 | xmon_write(void *handle, void *ptr, int nb) |
@@ -189,7 +176,7 @@ xmon_write(void *handle, void *ptr, int nb) | |||
189 | ct = 0; | 176 | ct = 0; |
190 | for (i = 0; i < nb; ++i) { | 177 | for (i = 0; i < nb; ++i) { |
191 | while ((*sccc & TXRDY) == 0) | 178 | while ((*sccc & TXRDY) == 0) |
192 | do_poll_adb(); | 179 | ; |
193 | c = p[i]; | 180 | c = p[i]; |
194 | if (c == '\n' && !ct) { | 181 | if (c == '\n' && !ct) { |
195 | c = '\r'; | 182 | c = '\r'; |
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig index b337136f28b6..ce4de61ed85d 100644 --- a/arch/x86_64/defconfig +++ b/arch/x86_64/defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.16-rc3 | 3 | # Linux kernel version: 2.6.16-rc3-git9 |
4 | # Mon Feb 13 22:31:24 2006 | 4 | # Sat Feb 18 00:27:03 2006 |
5 | # | 5 | # |
6 | CONFIG_X86_64=y | 6 | CONFIG_X86_64=y |
7 | CONFIG_64BIT=y | 7 | CONFIG_64BIT=y |
@@ -1317,7 +1317,7 @@ CONFIG_DETECT_SOFTLOCKUP=y | |||
1317 | # CONFIG_DEBUG_SPINLOCK is not set | 1317 | # CONFIG_DEBUG_SPINLOCK is not set |
1318 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set | 1318 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set |
1319 | # CONFIG_DEBUG_KOBJECT is not set | 1319 | # CONFIG_DEBUG_KOBJECT is not set |
1320 | CONFIG_DEBUG_INFO=y | 1320 | # CONFIG_DEBUG_INFO is not set |
1321 | CONFIG_DEBUG_FS=y | 1321 | CONFIG_DEBUG_FS=y |
1322 | # CONFIG_DEBUG_VM is not set | 1322 | # CONFIG_DEBUG_VM is not set |
1323 | # CONFIG_FRAME_POINTER is not set | 1323 | # CONFIG_FRAME_POINTER is not set |