aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-28 12:24:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-28 12:24:14 -0400
commite430426654c6a99fb1977bae71d4844e876c4a52 (patch)
tree65a22a59321b6bed5579c2e58371eeb373e1db61 /arch/parisc
parente732ff707743e5ceba6ae2bfc7e799a0bac30ffa (diff)
parent650a35f868f809aade56ef960d8a465f57ac74e2 (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6: parisc: add tty driver to PDC console drivers/parisc/iosapic.c: Remove unnecessary kzalloc cast parisc: remove homegrown L1_CACHE_ALIGN macro arch/parisc: Removing undead ifdef CONFIG_PA20 parisc: unwind - optimise linked-list searches for modules parisc: change to new flag variable drivers/char/agp/parisc-agp.c: eliminate memory leak parisc: kill __do_IRQ parisc: convert eisa interrupts to flow handlers parisc: convert gsc and dino pci interrupts to flow handlers parisc: convert suckyio interrupts to flow handlers parisc: convert iosapic interrupts to proper flow handlers parisc: convert cpu interrupts to proper flow handlers parisc: lay groundwork for killing __do_IRQ parisc: add prlimit64 syscall parisc: squelch warning when using dev_get_stats
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/Kconfig4
-rw-r--r--arch/parisc/include/asm/cache.h2
-rw-r--r--arch/parisc/include/asm/irq.h2
-rw-r--r--arch/parisc/include/asm/unistd.h3
-rw-r--r--arch/parisc/kernel/irq.c41
-rw-r--r--arch/parisc/kernel/pdc_cons.c141
-rw-r--r--arch/parisc/kernel/syscall_table.S1
-rw-r--r--arch/parisc/kernel/unaligned.c3
-rw-r--r--arch/parisc/kernel/unwind.c5
-rw-r--r--arch/parisc/math-emu/Makefile2
10 files changed, 165 insertions, 39 deletions
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 79a04a9394d5..abde955b1c21 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -19,6 +19,7 @@ config PARISC
19 select HAVE_IRQ_WORK 19 select HAVE_IRQ_WORK
20 select HAVE_PERF_EVENTS 20 select HAVE_PERF_EVENTS
21 select GENERIC_ATOMIC64 if !64BIT 21 select GENERIC_ATOMIC64 if !64BIT
22 select GENERIC_HARDIRQS_NO__DO_IRQ
22 help 23 help
23 The PA-RISC microprocessor is designed by Hewlett-Packard and used 24 The PA-RISC microprocessor is designed by Hewlett-Packard and used
24 in many of their workstations & servers (HP9000 700 and 800 series, 25 in many of their workstations & servers (HP9000 700 and 800 series,
@@ -85,6 +86,9 @@ config IRQ_PER_CPU
85 bool 86 bool
86 default y 87 default y
87 88
89config GENERIC_HARDIRQS_NO__DO_IRQ
90 def_bool y
91
88# unless you want to implement ACPI on PA-RISC ... ;-) 92# unless you want to implement ACPI on PA-RISC ... ;-)
89config PM 93config PM
90 bool 94 bool
diff --git a/arch/parisc/include/asm/cache.h b/arch/parisc/include/asm/cache.h
index 039880e7d2c9..47f11c707b65 100644
--- a/arch/parisc/include/asm/cache.h
+++ b/arch/parisc/include/asm/cache.h
@@ -24,8 +24,6 @@
24 24
25#ifndef __ASSEMBLY__ 25#ifndef __ASSEMBLY__
26 26
27#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
28
29#define SMP_CACHE_BYTES L1_CACHE_BYTES 27#define SMP_CACHE_BYTES L1_CACHE_BYTES
30 28
31#define ARCH_DMA_MINALIGN L1_CACHE_BYTES 29#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
diff --git a/arch/parisc/include/asm/irq.h b/arch/parisc/include/asm/irq.h
index dfa26b67f919..c67dccf2e31f 100644
--- a/arch/parisc/include/asm/irq.h
+++ b/arch/parisc/include/asm/irq.h
@@ -40,7 +40,7 @@ struct irq_chip;
40void no_ack_irq(unsigned int irq); 40void no_ack_irq(unsigned int irq);
41void no_end_irq(unsigned int irq); 41void no_end_irq(unsigned int irq);
42void cpu_ack_irq(unsigned int irq); 42void cpu_ack_irq(unsigned int irq);
43void cpu_end_irq(unsigned int irq); 43void cpu_eoi_irq(unsigned int irq);
44 44
45extern int txn_alloc_irq(unsigned int nbits); 45extern int txn_alloc_irq(unsigned int nbits);
46extern int txn_claim_irq(int); 46extern int txn_claim_irq(int);
diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h
index 1ce7d2851d90..3eb82c2a5ec3 100644
--- a/arch/parisc/include/asm/unistd.h
+++ b/arch/parisc/include/asm/unistd.h
@@ -813,8 +813,9 @@
813#define __NR_perf_event_open (__NR_Linux + 318) 813#define __NR_perf_event_open (__NR_Linux + 318)
814#define __NR_recvmmsg (__NR_Linux + 319) 814#define __NR_recvmmsg (__NR_Linux + 319)
815#define __NR_accept4 (__NR_Linux + 320) 815#define __NR_accept4 (__NR_Linux + 320)
816#define __NR_prlimit64 (__NR_Linux + 321)
816 817
817#define __NR_Linux_syscalls (__NR_accept4 + 1) 818#define __NR_Linux_syscalls (__NR_prlimit64 + 1)
818 819
819 820
820#define __IGNORE_select /* newselect */ 821#define __IGNORE_select /* newselect */
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index efbcee5d2220..5024f643b3b1 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -52,7 +52,7 @@ static volatile unsigned long cpu_eiem = 0;
52*/ 52*/
53static DEFINE_PER_CPU(unsigned long, local_ack_eiem) = ~0UL; 53static DEFINE_PER_CPU(unsigned long, local_ack_eiem) = ~0UL;
54 54
55static void cpu_disable_irq(unsigned int irq) 55static void cpu_mask_irq(unsigned int irq)
56{ 56{
57 unsigned long eirr_bit = EIEM_MASK(irq); 57 unsigned long eirr_bit = EIEM_MASK(irq);
58 58
@@ -63,7 +63,7 @@ static void cpu_disable_irq(unsigned int irq)
63 * then gets disabled */ 63 * then gets disabled */
64} 64}
65 65
66static void cpu_enable_irq(unsigned int irq) 66static void cpu_unmask_irq(unsigned int irq)
67{ 67{
68 unsigned long eirr_bit = EIEM_MASK(irq); 68 unsigned long eirr_bit = EIEM_MASK(irq);
69 69
@@ -75,12 +75,6 @@ static void cpu_enable_irq(unsigned int irq)
75 smp_send_all_nop(); 75 smp_send_all_nop();
76} 76}
77 77
78static unsigned int cpu_startup_irq(unsigned int irq)
79{
80 cpu_enable_irq(irq);
81 return 0;
82}
83
84void no_ack_irq(unsigned int irq) { } 78void no_ack_irq(unsigned int irq) { }
85void no_end_irq(unsigned int irq) { } 79void no_end_irq(unsigned int irq) { }
86 80
@@ -99,7 +93,7 @@ void cpu_ack_irq(unsigned int irq)
99 mtctl(mask, 23); 93 mtctl(mask, 23);
100} 94}
101 95
102void cpu_end_irq(unsigned int irq) 96void cpu_eoi_irq(unsigned int irq)
103{ 97{
104 unsigned long mask = EIEM_MASK(irq); 98 unsigned long mask = EIEM_MASK(irq);
105 int cpu = smp_processor_id(); 99 int cpu = smp_processor_id();
@@ -146,12 +140,10 @@ static int cpu_set_affinity_irq(unsigned int irq, const struct cpumask *dest)
146 140
147static struct irq_chip cpu_interrupt_type = { 141static struct irq_chip cpu_interrupt_type = {
148 .name = "CPU", 142 .name = "CPU",
149 .startup = cpu_startup_irq, 143 .mask = cpu_mask_irq,
150 .shutdown = cpu_disable_irq, 144 .unmask = cpu_unmask_irq,
151 .enable = cpu_enable_irq,
152 .disable = cpu_disable_irq,
153 .ack = cpu_ack_irq, 145 .ack = cpu_ack_irq,
154 .end = cpu_end_irq, 146 .eoi = cpu_eoi_irq,
155#ifdef CONFIG_SMP 147#ifdef CONFIG_SMP
156 .set_affinity = cpu_set_affinity_irq, 148 .set_affinity = cpu_set_affinity_irq,
157#endif 149#endif
@@ -247,10 +239,11 @@ int cpu_claim_irq(unsigned int irq, struct irq_chip *type, void *data)
247 if (irq_desc[irq].chip != &cpu_interrupt_type) 239 if (irq_desc[irq].chip != &cpu_interrupt_type)
248 return -EBUSY; 240 return -EBUSY;
249 241
242 /* for iosapic interrupts */
250 if (type) { 243 if (type) {
251 irq_desc[irq].chip = type; 244 set_irq_chip_and_handler(irq, type, handle_level_irq);
252 irq_desc[irq].chip_data = data; 245 set_irq_chip_data(irq, data);
253 cpu_interrupt_type.enable(irq); 246 cpu_unmask_irq(irq);
254 } 247 }
255 return 0; 248 return 0;
256} 249}
@@ -368,7 +361,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)
368 goto set_out; 361 goto set_out;
369 } 362 }
370#endif 363#endif
371 __do_IRQ(irq); 364 generic_handle_irq(irq);
372 365
373 out: 366 out:
374 irq_exit(); 367 irq_exit();
@@ -398,14 +391,15 @@ static void claim_cpu_irqs(void)
398{ 391{
399 int i; 392 int i;
400 for (i = CPU_IRQ_BASE; i <= CPU_IRQ_MAX; i++) { 393 for (i = CPU_IRQ_BASE; i <= CPU_IRQ_MAX; i++) {
401 irq_desc[i].chip = &cpu_interrupt_type; 394 set_irq_chip_and_handler(i, &cpu_interrupt_type,
395 handle_level_irq);
402 } 396 }
403 397
404 irq_desc[TIMER_IRQ].action = &timer_action; 398 set_irq_handler(TIMER_IRQ, handle_percpu_irq);
405 irq_desc[TIMER_IRQ].status = IRQ_PER_CPU; 399 setup_irq(TIMER_IRQ, &timer_action);
406#ifdef CONFIG_SMP 400#ifdef CONFIG_SMP
407 irq_desc[IPI_IRQ].action = &ipi_action; 401 set_irq_handler(IPI_IRQ, handle_percpu_irq);
408 irq_desc[IPI_IRQ].status = IRQ_PER_CPU; 402 setup_irq(IPI_IRQ, &ipi_action);
409#endif 403#endif
410} 404}
411 405
@@ -423,3 +417,4 @@ void __init init_IRQ(void)
423 set_eiem(cpu_eiem); /* EIEM : enable all external intr */ 417 set_eiem(cpu_eiem); /* EIEM : enable all external intr */
424 418
425} 419}
420
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
index 1ff366cb9685..66d1f17fdb94 100644
--- a/arch/parisc/kernel/pdc_cons.c
+++ b/arch/parisc/kernel/pdc_cons.c
@@ -12,6 +12,7 @@
12 * Copyright (C) 2001 Helge Deller <deller at parisc-linux.org> 12 * Copyright (C) 2001 Helge Deller <deller at parisc-linux.org>
13 * Copyright (C) 2001 Thomas Bogendoerfer <tsbogend at parisc-linux.org> 13 * Copyright (C) 2001 Thomas Bogendoerfer <tsbogend at parisc-linux.org>
14 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org> 14 * Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
15 * Copyright (C) 2010 Guy Martin <gmsoft at tuxicoman.be>
15 * 16 *
16 * 17 *
17 * This program is free software; you can redistribute it and/or modify 18 * This program is free software; you can redistribute it and/or modify
@@ -31,12 +32,11 @@
31 32
32/* 33/*
33 * The PDC console is a simple console, which can be used for debugging 34 * The PDC console is a simple console, which can be used for debugging
34 * boot related problems on HP PA-RISC machines. 35 * boot related problems on HP PA-RISC machines. It is also useful when no
36 * other console works.
35 * 37 *
36 * This code uses the ROM (=PDC) based functions to read and write characters 38 * This code uses the ROM (=PDC) based functions to read and write characters
37 * from and to PDC's boot path. 39 * from and to PDC's boot path.
38 * Since all character read from that path must be polled, this code never
39 * can or will be a fully functional linux console.
40 */ 40 */
41 41
42/* Define EARLY_BOOTUP_DEBUG to debug kernel related boot problems. 42/* Define EARLY_BOOTUP_DEBUG to debug kernel related boot problems.
@@ -53,6 +53,7 @@
53#include <asm/pdc.h> /* for iodc_call() proto and friends */ 53#include <asm/pdc.h> /* for iodc_call() proto and friends */
54 54
55static DEFINE_SPINLOCK(pdc_console_lock); 55static DEFINE_SPINLOCK(pdc_console_lock);
56static struct console pdc_cons;
56 57
57static void pdc_console_write(struct console *co, const char *s, unsigned count) 58static void pdc_console_write(struct console *co, const char *s, unsigned count)
58{ 59{
@@ -85,12 +86,138 @@ static int pdc_console_setup(struct console *co, char *options)
85 86
86#if defined(CONFIG_PDC_CONSOLE) 87#if defined(CONFIG_PDC_CONSOLE)
87#include <linux/vt_kern.h> 88#include <linux/vt_kern.h>
89#include <linux/tty_flip.h>
90
91#define PDC_CONS_POLL_DELAY (30 * HZ / 1000)
92
93static struct timer_list pdc_console_timer;
94
95extern struct console * console_drivers;
96
97static int pdc_console_tty_open(struct tty_struct *tty, struct file *filp)
98{
99
100 mod_timer(&pdc_console_timer, jiffies + PDC_CONS_POLL_DELAY);
101
102 return 0;
103}
104
105static void pdc_console_tty_close(struct tty_struct *tty, struct file *filp)
106{
107 if (!tty->count)
108 del_timer(&pdc_console_timer);
109}
110
111static int pdc_console_tty_write(struct tty_struct *tty, const unsigned char *buf, int count)
112{
113 pdc_console_write(NULL, buf, count);
114 return count;
115}
116
117static int pdc_console_tty_write_room(struct tty_struct *tty)
118{
119 return 32768; /* no limit, no buffer used */
120}
121
122static int pdc_console_tty_chars_in_buffer(struct tty_struct *tty)
123{
124 return 0; /* no buffer */
125}
126
127static struct tty_driver *pdc_console_tty_driver;
128
129static const struct tty_operations pdc_console_tty_ops = {
130 .open = pdc_console_tty_open,
131 .close = pdc_console_tty_close,
132 .write = pdc_console_tty_write,
133 .write_room = pdc_console_tty_write_room,
134 .chars_in_buffer = pdc_console_tty_chars_in_buffer,
135};
136
137static void pdc_console_poll(unsigned long unused)
138{
139
140 int data, count = 0;
141
142 struct tty_struct *tty = pdc_console_tty_driver->ttys[0];
143
144 if (!tty)
145 return;
146
147 while (1) {
148 data = pdc_console_poll_key(NULL);
149 if (data == -1)
150 break;
151 tty_insert_flip_char(tty, data & 0xFF, TTY_NORMAL);
152 count ++;
153 }
154
155 if (count)
156 tty_flip_buffer_push(tty);
157
158 if (tty->count && (pdc_cons.flags & CON_ENABLED))
159 mod_timer(&pdc_console_timer, jiffies + PDC_CONS_POLL_DELAY);
160}
161
162static int __init pdc_console_tty_driver_init(void)
163{
164
165 int err;
166 struct tty_driver *drv;
167
168 /* Check if the console driver is still registered.
169 * It is unregistered if the pdc console was not selected as the
170 * primary console. */
171
172 struct console *tmp = console_drivers;
173
174 for (tmp = console_drivers; tmp; tmp = tmp->next)
175 if (tmp == &pdc_cons)
176 break;
177
178 if (!tmp) {
179 printk(KERN_INFO "PDC console driver not registered anymore, not creating %s\n", pdc_cons.name);
180 return -ENODEV;
181 }
182
183 printk(KERN_INFO "The PDC console driver is still registered, removing CON_BOOT flag\n");
184 pdc_cons.flags &= ~CON_BOOT;
185
186 drv = alloc_tty_driver(1);
187
188 if (!drv)
189 return -ENOMEM;
190
191 drv->driver_name = "pdc_cons";
192 drv->name = "ttyB";
193 drv->major = MUX_MAJOR;
194 drv->minor_start = 0;
195 drv->type = TTY_DRIVER_TYPE_SYSTEM;
196 drv->init_termios = tty_std_termios;
197 drv->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
198 tty_set_operations(drv, &pdc_console_tty_ops);
199
200 err = tty_register_driver(drv);
201 if (err) {
202 printk(KERN_ERR "Unable to register the PDC console TTY driver\n");
203 return err;
204 }
205
206 pdc_console_tty_driver = drv;
207
208 /* No need to initialize the pdc_console_timer if tty isn't allocated */
209 init_timer(&pdc_console_timer);
210 pdc_console_timer.function = pdc_console_poll;
211
212 return 0;
213}
214
215module_init(pdc_console_tty_driver_init);
88 216
89static struct tty_driver * pdc_console_device (struct console *c, int *index) 217static struct tty_driver * pdc_console_device (struct console *c, int *index)
90{ 218{
91 extern struct tty_driver console_driver; 219 *index = c->index;
92 *index = c->index ? c->index-1 : fg_console; 220 return pdc_console_tty_driver;
93 return &console_driver;
94} 221}
95#else 222#else
96#define pdc_console_device NULL 223#define pdc_console_device NULL
@@ -101,7 +228,7 @@ static struct console pdc_cons = {
101 .write = pdc_console_write, 228 .write = pdc_console_write,
102 .device = pdc_console_device, 229 .device = pdc_console_device,
103 .setup = pdc_console_setup, 230 .setup = pdc_console_setup,
104 .flags = CON_BOOT | CON_PRINTBUFFER | CON_ENABLED, 231 .flags = CON_BOOT | CON_PRINTBUFFER,
105 .index = -1, 232 .index = -1,
106}; 233};
107 234
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 3d52c978738f..74867dfdabe5 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -419,6 +419,7 @@
419 ENTRY_SAME(perf_event_open) 419 ENTRY_SAME(perf_event_open)
420 ENTRY_COMP(recvmmsg) 420 ENTRY_COMP(recvmmsg)
421 ENTRY_SAME(accept4) /* 320 */ 421 ENTRY_SAME(accept4) /* 320 */
422 ENTRY_SAME(prlimit64)
422 423
423 /* Nothing yet */ 424 /* Nothing yet */
424 425
diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c
index 92d977bb5ea8..234e3682cf09 100644
--- a/arch/parisc/kernel/unaligned.c
+++ b/arch/parisc/kernel/unaligned.c
@@ -619,15 +619,12 @@ void handle_unaligned(struct pt_regs *regs)
619 flop=1; 619 flop=1;
620 ret = emulate_std(regs, R2(regs->iir),1); 620 ret = emulate_std(regs, R2(regs->iir),1);
621 break; 621 break;
622
623#ifdef CONFIG_PA20
624 case OPCODE_LDD_L: 622 case OPCODE_LDD_L:
625 ret = emulate_ldd(regs, R2(regs->iir),0); 623 ret = emulate_ldd(regs, R2(regs->iir),0);
626 break; 624 break;
627 case OPCODE_STD_L: 625 case OPCODE_STD_L:
628 ret = emulate_std(regs, R2(regs->iir),0); 626 ret = emulate_std(regs, R2(regs->iir),0);
629 break; 627 break;
630#endif
631 } 628 }
632#endif 629#endif
633 switch (regs->iir & OPCODE3_MASK) 630 switch (regs->iir & OPCODE3_MASK)
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c
index d58eac1a8288..76ed62ed785b 100644
--- a/arch/parisc/kernel/unwind.c
+++ b/arch/parisc/kernel/unwind.c
@@ -80,8 +80,11 @@ find_unwind_entry(unsigned long addr)
80 if (addr >= table->start && 80 if (addr >= table->start &&
81 addr <= table->end) 81 addr <= table->end)
82 e = find_unwind_entry_in_table(table, addr); 82 e = find_unwind_entry_in_table(table, addr);
83 if (e) 83 if (e) {
84 /* Move-to-front to exploit common traces */
85 list_move(&table->list, &unwind_tables);
84 break; 86 break;
87 }
85 } 88 }
86 89
87 return e; 90 return e;
diff --git a/arch/parisc/math-emu/Makefile b/arch/parisc/math-emu/Makefile
index 1f3f225897f5..0bd63b08a79a 100644
--- a/arch/parisc/math-emu/Makefile
+++ b/arch/parisc/math-emu/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5# See arch/parisc/math-emu/README 5# See arch/parisc/math-emu/README
6EXTRA_CFLAGS += -Wno-parentheses -Wno-implicit-function-declaration \ 6ccflags-y := -Wno-parentheses -Wno-implicit-function-declaration \
7 -Wno-uninitialized -Wno-strict-prototypes -Wno-return-type \ 7 -Wno-uninitialized -Wno-strict-prototypes -Wno-return-type \
8 -Wno-implicit-int 8 -Wno-implicit-int
9 9