aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/Kconfig5
-rw-r--r--arch/parisc/hpux/fs.c6
-rw-r--r--arch/parisc/include/asm/cache.h2
-rw-r--r--arch/parisc/include/asm/cacheflush.h8
-rw-r--r--arch/parisc/include/asm/compat.h2
-rw-r--r--arch/parisc/include/asm/irq.h2
-rw-r--r--arch/parisc/include/asm/irqflags.h46
-rw-r--r--arch/parisc/include/asm/perf_event.h3
-rw-r--r--arch/parisc/include/asm/pgtable.h2
-rw-r--r--arch/parisc/include/asm/system.h19
-rw-r--r--arch/parisc/include/asm/unistd.h3
-rw-r--r--arch/parisc/kernel/irq.c41
-rw-r--r--arch/parisc/kernel/module.c3
-rw-r--r--arch/parisc/kernel/pdc_cons.c141
-rw-r--r--arch/parisc/kernel/perf.c4
-rw-r--r--arch/parisc/kernel/process.c15
-rw-r--r--arch/parisc/kernel/ptrace.c13
-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
21 files changed, 241 insertions, 85 deletions
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 33c02143828..0888675c98d 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -9,8 +9,10 @@ config PARISC
9 select RTC_DRV_GENERIC 9 select RTC_DRV_GENERIC
10 select INIT_ALL_POSSIBLE 10 select INIT_ALL_POSSIBLE
11 select BUG 11 select BUG
12 select HAVE_IRQ_WORK
12 select HAVE_PERF_EVENTS 13 select HAVE_PERF_EVENTS
13 select GENERIC_ATOMIC64 if !64BIT 14 select GENERIC_ATOMIC64 if !64BIT
15 select GENERIC_HARDIRQS_NO__DO_IRQ
14 help 16 help
15 The PA-RISC microprocessor is designed by Hewlett-Packard and used 17 The PA-RISC microprocessor is designed by Hewlett-Packard and used
16 in many of their workstations & servers (HP9000 700 and 800 series, 18 in many of their workstations & servers (HP9000 700 and 800 series,
@@ -77,6 +79,9 @@ config IRQ_PER_CPU
77 bool 79 bool
78 default y 80 default y
79 81
82config GENERIC_HARDIRQS_NO__DO_IRQ
83 def_bool y
84
80# unless you want to implement ACPI on PA-RISC ... ;-) 85# unless you want to implement ACPI on PA-RISC ... ;-)
81config PM 86config PM
82 bool 87 bool
diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c
index 1444875a761..0dc8543acb4 100644
--- a/arch/parisc/hpux/fs.c
+++ b/arch/parisc/hpux/fs.c
@@ -41,8 +41,10 @@ int hpux_execve(struct pt_regs *regs)
41 if (IS_ERR(filename)) 41 if (IS_ERR(filename))
42 goto out; 42 goto out;
43 43
44 error = do_execve(filename, (char __user * __user *) regs->gr[25], 44 error = do_execve(filename,
45 (char __user * __user *) regs->gr[24], regs); 45 (const char __user *const __user *) regs->gr[25],
46 (const char __user *const __user *) regs->gr[24],
47 regs);
46 48
47 putname(filename); 49 putname(filename);
48 50
diff --git a/arch/parisc/include/asm/cache.h b/arch/parisc/include/asm/cache.h
index 039880e7d2c..47f11c707b6 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/cacheflush.h b/arch/parisc/include/asm/cacheflush.h
index dba11aedce1..f388a85bba1 100644
--- a/arch/parisc/include/asm/cacheflush.h
+++ b/arch/parisc/include/asm/cacheflush.h
@@ -126,20 +126,20 @@ static inline void *kmap(struct page *page)
126 126
127#define kunmap(page) kunmap_parisc(page_address(page)) 127#define kunmap(page) kunmap_parisc(page_address(page))
128 128
129static inline void *kmap_atomic(struct page *page, enum km_type idx) 129static inline void *__kmap_atomic(struct page *page)
130{ 130{
131 pagefault_disable(); 131 pagefault_disable();
132 return page_address(page); 132 return page_address(page);
133} 133}
134 134
135static inline void kunmap_atomic_notypecheck(void *addr, enum km_type idx) 135static inline void __kunmap_atomic(void *addr)
136{ 136{
137 kunmap_parisc(addr); 137 kunmap_parisc(addr);
138 pagefault_enable(); 138 pagefault_enable();
139} 139}
140 140
141#define kmap_atomic_prot(page, idx, prot) kmap_atomic(page, idx) 141#define kmap_atomic_prot(page, prot) kmap_atomic(page)
142#define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx)) 142#define kmap_atomic_pfn(pfn) kmap_atomic(pfn_to_page(pfn))
143#define kmap_atomic_to_page(ptr) virt_to_page(ptr) 143#define kmap_atomic_to_page(ptr) virt_to_page(ptr)
144#endif 144#endif
145 145
diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h
index 02b77baa5da..efa0b60c63f 100644
--- a/arch/parisc/include/asm/compat.h
+++ b/arch/parisc/include/asm/compat.h
@@ -147,7 +147,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
147 return (u32)(unsigned long)uptr; 147 return (u32)(unsigned long)uptr;
148} 148}
149 149
150static __inline__ void __user *compat_alloc_user_space(long len) 150static __inline__ void __user *arch_compat_alloc_user_space(long len)
151{ 151{
152 struct pt_regs *regs = &current->thread.regs; 152 struct pt_regs *regs = &current->thread.regs;
153 return (void __user *)regs->gr[30]; 153 return (void __user *)regs->gr[30];
diff --git a/arch/parisc/include/asm/irq.h b/arch/parisc/include/asm/irq.h
index dfa26b67f91..c67dccf2e31 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/irqflags.h b/arch/parisc/include/asm/irqflags.h
new file mode 100644
index 00000000000..34f9cb9b475
--- /dev/null
+++ b/arch/parisc/include/asm/irqflags.h
@@ -0,0 +1,46 @@
1#ifndef __PARISC_IRQFLAGS_H
2#define __PARISC_IRQFLAGS_H
3
4#include <linux/types.h>
5#include <asm/psw.h>
6
7static inline unsigned long arch_local_save_flags(void)
8{
9 unsigned long flags;
10 asm volatile("ssm 0, %0" : "=r" (flags) : : "memory");
11 return flags;
12}
13
14static inline void arch_local_irq_disable(void)
15{
16 asm volatile("rsm %0,%%r0\n" : : "i" (PSW_I) : "memory");
17}
18
19static inline void arch_local_irq_enable(void)
20{
21 asm volatile("ssm %0,%%r0\n" : : "i" (PSW_I) : "memory");
22}
23
24static inline unsigned long arch_local_irq_save(void)
25{
26 unsigned long flags;
27 asm volatile("rsm %1,%0" : "=r" (flags) : "i" (PSW_I) : "memory");
28 return flags;
29}
30
31static inline void arch_local_irq_restore(unsigned long flags)
32{
33 asm volatile("mtsm %0" : : "r" (flags) : "memory");
34}
35
36static inline bool arch_irqs_disabled_flags(unsigned long flags)
37{
38 return (flags & PSW_I) == 0;
39}
40
41static inline bool arch_irqs_disabled(void)
42{
43 return arch_irqs_disabled_flags(arch_local_save_flags());
44}
45
46#endif /* __PARISC_IRQFLAGS_H */
diff --git a/arch/parisc/include/asm/perf_event.h b/arch/parisc/include/asm/perf_event.h
index cc146427d8f..1e0fd8ba6c0 100644
--- a/arch/parisc/include/asm/perf_event.h
+++ b/arch/parisc/include/asm/perf_event.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_PARISC_PERF_EVENT_H 1#ifndef __ASM_PARISC_PERF_EVENT_H
2#define __ASM_PARISC_PERF_EVENT_H 2#define __ASM_PARISC_PERF_EVENT_H
3 3
4/* parisc only supports software events through this interface. */ 4/* Empty, just to avoid compiling error */
5static inline void set_perf_event_pending(void) { }
6 5
7#endif /* __ASM_PARISC_PERF_EVENT_H */ 6#endif /* __ASM_PARISC_PERF_EVENT_H */
diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h
index 01c15035e78..865f37a8a88 100644
--- a/arch/parisc/include/asm/pgtable.h
+++ b/arch/parisc/include/asm/pgtable.h
@@ -397,9 +397,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
397#define pte_offset_kernel(pmd, address) \ 397#define pte_offset_kernel(pmd, address) \
398 ((pte_t *) pmd_page_vaddr(*(pmd)) + pte_index(address)) 398 ((pte_t *) pmd_page_vaddr(*(pmd)) + pte_index(address))
399#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address) 399#define pte_offset_map(pmd, address) pte_offset_kernel(pmd, address)
400#define pte_offset_map_nested(pmd, address) pte_offset_kernel(pmd, address)
401#define pte_unmap(pte) do { } while (0) 400#define pte_unmap(pte) do { } while (0)
402#define pte_unmap_nested(pte) do { } while (0)
403 401
404#define pte_unmap(pte) do { } while (0) 402#define pte_unmap(pte) do { } while (0)
405#define pte_unmap_nested(pte) do { } while (0) 403#define pte_unmap_nested(pte) do { } while (0)
diff --git a/arch/parisc/include/asm/system.h b/arch/parisc/include/asm/system.h
index 2ab4af58ecb..b19e63a8e84 100644
--- a/arch/parisc/include/asm/system.h
+++ b/arch/parisc/include/asm/system.h
@@ -1,7 +1,7 @@
1#ifndef __PARISC_SYSTEM_H 1#ifndef __PARISC_SYSTEM_H
2#define __PARISC_SYSTEM_H 2#define __PARISC_SYSTEM_H
3 3
4#include <asm/psw.h> 4#include <linux/irqflags.h>
5 5
6/* The program status word as bitfields. */ 6/* The program status word as bitfields. */
7struct pa_psw { 7struct pa_psw {
@@ -48,23 +48,6 @@ extern struct task_struct *_switch_to(struct task_struct *, struct task_struct *
48 (last) = _switch_to(prev, next); \ 48 (last) = _switch_to(prev, next); \
49} while(0) 49} while(0)
50 50
51/* interrupt control */
52#define local_save_flags(x) __asm__ __volatile__("ssm 0, %0" : "=r" (x) : : "memory")
53#define local_irq_disable() __asm__ __volatile__("rsm %0,%%r0\n" : : "i" (PSW_I) : "memory" )
54#define local_irq_enable() __asm__ __volatile__("ssm %0,%%r0\n" : : "i" (PSW_I) : "memory" )
55
56#define local_irq_save(x) \
57 __asm__ __volatile__("rsm %1,%0" : "=r" (x) :"i" (PSW_I) : "memory" )
58#define local_irq_restore(x) \
59 __asm__ __volatile__("mtsm %0" : : "r" (x) : "memory" )
60
61#define irqs_disabled() \
62({ \
63 unsigned long flags; \
64 local_save_flags(flags); \
65 (flags & PSW_I) == 0; \
66})
67
68#define mfctl(reg) ({ \ 51#define mfctl(reg) ({ \
69 unsigned long cr; \ 52 unsigned long cr; \
70 __asm__ __volatile__( \ 53 __asm__ __volatile__( \
diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h
index 1ce7d2851d9..3eb82c2a5ec 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 efbcee5d222..5024f643b3b 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/module.c b/arch/parisc/kernel/module.c
index 159a2b81e90..6e81bb596e5 100644
--- a/arch/parisc/kernel/module.c
+++ b/arch/parisc/kernel/module.c
@@ -941,11 +941,10 @@ int module_finalize(const Elf_Ehdr *hdr,
941 nsyms = newptr - (Elf_Sym *)symhdr->sh_addr; 941 nsyms = newptr - (Elf_Sym *)symhdr->sh_addr;
942 DEBUGP("NEW num_symtab %lu\n", nsyms); 942 DEBUGP("NEW num_symtab %lu\n", nsyms);
943 symhdr->sh_size = nsyms * sizeof(Elf_Sym); 943 symhdr->sh_size = nsyms * sizeof(Elf_Sym);
944 return module_bug_finalize(hdr, sechdrs, me); 944 return 0;
945} 945}
946 946
947void module_arch_cleanup(struct module *mod) 947void module_arch_cleanup(struct module *mod)
948{ 948{
949 deregister_unwind_table(mod); 949 deregister_unwind_table(mod);
950 module_bug_cleanup(mod);
951} 950}
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
index 1ff366cb968..66d1f17fdb9 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/perf.c b/arch/parisc/kernel/perf.c
index f9f6783e4bd..ba0c053e25a 100644
--- a/arch/parisc/kernel/perf.c
+++ b/arch/parisc/kernel/perf.c
@@ -46,7 +46,6 @@
46#include <linux/init.h> 46#include <linux/init.h>
47#include <linux/proc_fs.h> 47#include <linux/proc_fs.h>
48#include <linux/miscdevice.h> 48#include <linux/miscdevice.h>
49#include <linux/smp_lock.h>
50#include <linux/spinlock.h> 49#include <linux/spinlock.h>
51 50
52#include <asm/uaccess.h> 51#include <asm/uaccess.h>
@@ -261,16 +260,13 @@ printk("Preparing to start counters\n");
261 */ 260 */
262static int perf_open(struct inode *inode, struct file *file) 261static int perf_open(struct inode *inode, struct file *file)
263{ 262{
264 lock_kernel();
265 spin_lock(&perf_lock); 263 spin_lock(&perf_lock);
266 if (perf_enabled) { 264 if (perf_enabled) {
267 spin_unlock(&perf_lock); 265 spin_unlock(&perf_lock);
268 unlock_kernel();
269 return -EBUSY; 266 return -EBUSY;
270 } 267 }
271 perf_enabled = 1; 268 perf_enabled = 1;
272 spin_unlock(&perf_lock); 269 spin_unlock(&perf_lock);
273 unlock_kernel();
274 270
275 return 0; 271 return 0;
276} 272}
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 76332dadc6e..4b4b9181a1a 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -348,17 +348,22 @@ asmlinkage int sys_execve(struct pt_regs *regs)
348 error = PTR_ERR(filename); 348 error = PTR_ERR(filename);
349 if (IS_ERR(filename)) 349 if (IS_ERR(filename))
350 goto out; 350 goto out;
351 error = do_execve(filename, (char __user * __user *) regs->gr[25], 351 error = do_execve(filename,
352 (char __user * __user *) regs->gr[24], regs); 352 (const char __user *const __user *) regs->gr[25],
353 (const char __user *const __user *) regs->gr[24],
354 regs);
353 putname(filename); 355 putname(filename);
354out: 356out:
355 357
356 return error; 358 return error;
357} 359}
358 360
359extern int __execve(const char *filename, char *const argv[], 361extern int __execve(const char *filename,
360 char *const envp[], struct task_struct *task); 362 const char *const argv[],
361int kernel_execve(const char *filename, char *const argv[], char *const envp[]) 363 const char *const envp[], struct task_struct *task);
364int kernel_execve(const char *filename,
365 const char *const argv[],
366 const char *const envp[])
362{ 367{
363 return __execve(filename, argv, envp, current); 368 return __execve(filename, argv, envp, current);
364} 369}
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c
index c4f49e45129..2905b1f52d3 100644
--- a/arch/parisc/kernel/ptrace.c
+++ b/arch/parisc/kernel/ptrace.c
@@ -110,7 +110,8 @@ void user_enable_block_step(struct task_struct *task)
110 pa_psw(task)->l = 0; 110 pa_psw(task)->l = 0;
111} 111}
112 112
113long arch_ptrace(struct task_struct *child, long request, long addr, long data) 113long arch_ptrace(struct task_struct *child, long request,
114 unsigned long addr, unsigned long data)
114{ 115{
115 unsigned long tmp; 116 unsigned long tmp;
116 long ret = -EIO; 117 long ret = -EIO;
@@ -120,11 +121,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
120 /* Read the word at location addr in the USER area. For ptraced 121 /* Read the word at location addr in the USER area. For ptraced
121 processes, the kernel saves all regs on a syscall. */ 122 processes, the kernel saves all regs on a syscall. */
122 case PTRACE_PEEKUSR: 123 case PTRACE_PEEKUSR:
123 if ((addr & (sizeof(long)-1)) || 124 if ((addr & (sizeof(unsigned long)-1)) ||
124 (unsigned long) addr >= sizeof(struct pt_regs)) 125 addr >= sizeof(struct pt_regs))
125 break; 126 break;
126 tmp = *(unsigned long *) ((char *) task_regs(child) + addr); 127 tmp = *(unsigned long *) ((char *) task_regs(child) + addr);
127 ret = put_user(tmp, (unsigned long *) data); 128 ret = put_user(tmp, (unsigned long __user *) data);
128 break; 129 break;
129 130
130 /* Write the word at location addr in the USER area. This will need 131 /* Write the word at location addr in the USER area. This will need
@@ -151,8 +152,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
151 break; 152 break;
152 } 153 }
153 154
154 if ((addr & (sizeof(long)-1)) || 155 if ((addr & (sizeof(unsigned long)-1)) ||
155 (unsigned long) addr >= sizeof(struct pt_regs)) 156 addr >= sizeof(struct pt_regs))
156 break; 157 break;
157 if ((addr >= PT_GR1 && addr <= PT_GR31) || 158 if ((addr >= PT_GR1 && addr <= PT_GR31) ||
158 addr == PT_IAOQ0 || addr == PT_IAOQ1 || 159 addr == PT_IAOQ0 || addr == PT_IAOQ1 ||
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 3d52c978738..74867dfdabe 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 92d977bb5ea..234e3682cf0 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 d58eac1a828..76ed62ed785 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 1f3f225897f..0bd63b08a79 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