aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/kernel')
-rw-r--r--arch/parisc/kernel/asm-offsets.c3
-rw-r--r--arch/parisc/kernel/cache.c8
-rw-r--r--arch/parisc/kernel/irq.c8
-rw-r--r--arch/parisc/kernel/module.c1
-rw-r--r--arch/parisc/kernel/pci-dma.c2
-rw-r--r--arch/parisc/kernel/pci.c18
-rw-r--r--arch/parisc/kernel/perf.c2
-rw-r--r--arch/parisc/kernel/process.c1
-rw-r--r--arch/parisc/kernel/signal.c5
-rw-r--r--arch/parisc/kernel/signal32.c1
-rw-r--r--arch/parisc/kernel/smp.c10
-rw-r--r--arch/parisc/kernel/sys_parisc.c45
-rw-r--r--arch/parisc/kernel/sys_parisc32.c77
-rw-r--r--arch/parisc/kernel/syscall_table.S6
-rw-r--r--arch/parisc/kernel/time.c29
-rw-r--r--arch/parisc/kernel/unaligned.c14
-rw-r--r--arch/parisc/kernel/unwind.c50
17 files changed, 92 insertions, 188 deletions
diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c
index fcd3c707bf12..ec787b411e9a 100644
--- a/arch/parisc/kernel/asm-offsets.c
+++ b/arch/parisc/kernel/asm-offsets.c
@@ -244,9 +244,6 @@ int main(void)
244 DEFINE(THREAD_SZ, sizeof(struct thread_info)); 244 DEFINE(THREAD_SZ, sizeof(struct thread_info));
245 DEFINE(THREAD_SZ_ALGN, align(sizeof(struct thread_info), 64)); 245 DEFINE(THREAD_SZ_ALGN, align(sizeof(struct thread_info), 64));
246 BLANK(); 246 BLANK();
247 DEFINE(IRQSTAT_SIRQ_PEND, offsetof(irq_cpustat_t, __softirq_pending));
248 DEFINE(IRQSTAT_SZ, sizeof(irq_cpustat_t));
249 BLANK();
250 DEFINE(ICACHE_BASE, offsetof(struct pdc_cache_info, ic_base)); 247 DEFINE(ICACHE_BASE, offsetof(struct pdc_cache_info, ic_base));
251 DEFINE(ICACHE_STRIDE, offsetof(struct pdc_cache_info, ic_stride)); 248 DEFINE(ICACHE_STRIDE, offsetof(struct pdc_cache_info, ic_stride));
252 DEFINE(ICACHE_COUNT, offsetof(struct pdc_cache_info, ic_count)); 249 DEFINE(ICACHE_COUNT, offsetof(struct pdc_cache_info, ic_count));
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c
index b6ed34de14e1..d054f3da3ff5 100644
--- a/arch/parisc/kernel/cache.c
+++ b/arch/parisc/kernel/cache.c
@@ -68,9 +68,9 @@ flush_cache_all_local(void)
68EXPORT_SYMBOL(flush_cache_all_local); 68EXPORT_SYMBOL(flush_cache_all_local);
69 69
70void 70void
71update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) 71update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
72{ 72{
73 struct page *page = pte_page(pte); 73 struct page *page = pte_page(*ptep);
74 74
75 if (pfn_valid(page_to_pfn(page)) && page_mapping(page) && 75 if (pfn_valid(page_to_pfn(page)) && page_mapping(page) &&
76 test_bit(PG_dcache_dirty, &page->flags)) { 76 test_bit(PG_dcache_dirty, &page->flags)) {
@@ -171,14 +171,14 @@ parisc_cache_init(void)
171 cache_info.ic_conf.cc_cst, 171 cache_info.ic_conf.cc_cst,
172 cache_info.ic_conf.cc_hv); 172 cache_info.ic_conf.cc_hv);
173 173
174 printk("D-TLB conf: sh %d page %d cst %d aid %d pad1 %d \n", 174 printk("D-TLB conf: sh %d page %d cst %d aid %d pad1 %d\n",
175 cache_info.dt_conf.tc_sh, 175 cache_info.dt_conf.tc_sh,
176 cache_info.dt_conf.tc_page, 176 cache_info.dt_conf.tc_page,
177 cache_info.dt_conf.tc_cst, 177 cache_info.dt_conf.tc_cst,
178 cache_info.dt_conf.tc_aid, 178 cache_info.dt_conf.tc_aid,
179 cache_info.dt_conf.tc_pad1); 179 cache_info.dt_conf.tc_pad1);
180 180
181 printk("I-TLB conf: sh %d page %d cst %d aid %d pad1 %d \n", 181 printk("I-TLB conf: sh %d page %d cst %d aid %d pad1 %d\n",
182 cache_info.it_conf.tc_sh, 182 cache_info.it_conf.tc_sh,
183 cache_info.it_conf.tc_page, 183 cache_info.it_conf.tc_page,
184 cache_info.it_conf.tc_cst, 184 cache_info.it_conf.tc_cst,
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index 2e7610cb33d5..efbcee5d2220 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -145,7 +145,7 @@ static int cpu_set_affinity_irq(unsigned int irq, const struct cpumask *dest)
145#endif 145#endif
146 146
147static struct irq_chip cpu_interrupt_type = { 147static struct irq_chip cpu_interrupt_type = {
148 .typename = "CPU", 148 .name = "CPU",
149 .startup = cpu_startup_irq, 149 .startup = cpu_startup_irq,
150 .shutdown = cpu_disable_irq, 150 .shutdown = cpu_disable_irq,
151 .enable = cpu_enable_irq, 151 .enable = cpu_enable_irq,
@@ -180,7 +180,7 @@ int show_interrupts(struct seq_file *p, void *v)
180 if (i < NR_IRQS) { 180 if (i < NR_IRQS) {
181 struct irqaction *action; 181 struct irqaction *action;
182 182
183 spin_lock_irqsave(&irq_desc[i].lock, flags); 183 raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
184 action = irq_desc[i].action; 184 action = irq_desc[i].action;
185 if (!action) 185 if (!action)
186 goto skip; 186 goto skip;
@@ -192,7 +192,7 @@ int show_interrupts(struct seq_file *p, void *v)
192 seq_printf(p, "%10u ", kstat_irqs(i)); 192 seq_printf(p, "%10u ", kstat_irqs(i));
193#endif 193#endif
194 194
195 seq_printf(p, " %14s", irq_desc[i].chip->typename); 195 seq_printf(p, " %14s", irq_desc[i].chip->name);
196#ifndef PARISC_IRQ_CR16_COUNTS 196#ifndef PARISC_IRQ_CR16_COUNTS
197 seq_printf(p, " %s", action->name); 197 seq_printf(p, " %s", action->name);
198 198
@@ -224,7 +224,7 @@ int show_interrupts(struct seq_file *p, void *v)
224 224
225 seq_putc(p, '\n'); 225 seq_putc(p, '\n');
226 skip: 226 skip:
227 spin_unlock_irqrestore(&irq_desc[i].lock, flags); 227 raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
228 } 228 }
229 229
230 return 0; 230 return 0;
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c
index 212074653df7..159a2b81e90c 100644
--- a/arch/parisc/kernel/module.c
+++ b/arch/parisc/kernel/module.c
@@ -61,6 +61,7 @@
61#include <linux/string.h> 61#include <linux/string.h>
62#include <linux/kernel.h> 62#include <linux/kernel.h>
63#include <linux/bug.h> 63#include <linux/bug.h>
64#include <linux/slab.h>
64 65
65#include <asm/unwind.h> 66#include <asm/unwind.h>
66 67
diff --git a/arch/parisc/kernel/pci-dma.c b/arch/parisc/kernel/pci-dma.c
index c07f618ff7da..a029f74a3c5c 100644
--- a/arch/parisc/kernel/pci-dma.c
+++ b/arch/parisc/kernel/pci-dma.c
@@ -18,11 +18,11 @@
18*/ 18*/
19 19
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/gfp.h>
21#include <linux/mm.h> 22#include <linux/mm.h>
22#include <linux/pci.h> 23#include <linux/pci.h>
23#include <linux/proc_fs.h> 24#include <linux/proc_fs.h>
24#include <linux/seq_file.h> 25#include <linux/seq_file.h>
25#include <linux/slab.h>
26#include <linux/string.h> 26#include <linux/string.h>
27#include <linux/types.h> 27#include <linux/types.h>
28#include <linux/scatterlist.h> 28#include <linux/scatterlist.h>
diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c
index f7064abc3bb6..9efd97405317 100644
--- a/arch/parisc/kernel/pci.c
+++ b/arch/parisc/kernel/pci.c
@@ -13,12 +13,10 @@
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/pci.h> 15#include <linux/pci.h>
16#include <linux/slab.h>
17#include <linux/types.h> 16#include <linux/types.h>
18 17
19#include <asm/io.h> 18#include <asm/io.h>
20#include <asm/system.h> 19#include <asm/system.h>
21#include <asm/cache.h> /* for L1_CACHE_BYTES */
22#include <asm/superio.h> 20#include <asm/superio.h>
23 21
24#define DEBUG_RESOURCES 0 22#define DEBUG_RESOURCES 0
@@ -123,6 +121,10 @@ static int __init pcibios_init(void)
123 } else { 121 } else {
124 printk(KERN_WARNING "pci_bios != NULL but init() is!\n"); 122 printk(KERN_WARNING "pci_bios != NULL but init() is!\n");
125 } 123 }
124
125 /* Set the CLS for PCI as early as possible. */
126 pci_cache_line_size = pci_dfl_cache_line_size;
127
126 return 0; 128 return 0;
127} 129}
128 130
@@ -171,7 +173,7 @@ void pcibios_set_master(struct pci_dev *dev)
171 ** upper byte is PCI_LATENCY_TIMER. 173 ** upper byte is PCI_LATENCY_TIMER.
172 */ 174 */
173 pci_write_config_word(dev, PCI_CACHE_LINE_SIZE, 175 pci_write_config_word(dev, PCI_CACHE_LINE_SIZE,
174 (0x80 << 8) | (L1_CACHE_BYTES / sizeof(u32))); 176 (0x80 << 8) | pci_cache_line_size);
175} 177}
176 178
177 179
@@ -254,10 +256,10 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
254 * Since we are just checking candidates, don't use any fields other 256 * Since we are just checking candidates, don't use any fields other
255 * than res->start. 257 * than res->start.
256 */ 258 */
257void pcibios_align_resource(void *data, struct resource *res, 259resource_size_t pcibios_align_resource(void *data, const struct resource *res,
258 resource_size_t size, resource_size_t alignment) 260 resource_size_t size, resource_size_t alignment)
259{ 261{
260 resource_size_t mask, align; 262 resource_size_t mask, align, start = res->start;
261 263
262 DBG_RES("pcibios_align_resource(%s, (%p) [%lx,%lx]/%x, 0x%lx, 0x%lx)\n", 264 DBG_RES("pcibios_align_resource(%s, (%p) [%lx,%lx]/%x, 0x%lx, 0x%lx)\n",
263 pci_name(((struct pci_dev *) data)), 265 pci_name(((struct pci_dev *) data)),
@@ -269,10 +271,10 @@ void pcibios_align_resource(void *data, struct resource *res,
269 271
270 /* Align to largest of MIN or input size */ 272 /* Align to largest of MIN or input size */
271 mask = max(alignment, align) - 1; 273 mask = max(alignment, align) - 1;
272 res->start += mask; 274 start += mask;
273 res->start &= ~mask; 275 start &= ~mask;
274 276
275 /* The caller updates the end field, we don't. */ 277 return start;
276} 278}
277 279
278 280
diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c
index 75099efb3bf3..f9f6783e4bdd 100644
--- a/arch/parisc/kernel/perf.c
+++ b/arch/parisc/kernel/perf.c
@@ -24,7 +24,7 @@
24 * 24 *
25 * This driver programs the PCX-U/PCX-W performance counters 25 * This driver programs the PCX-U/PCX-W performance counters
26 * on the PA-RISC 2.0 chips. The driver keeps all images now 26 * on the PA-RISC 2.0 chips. The driver keeps all images now
27 * internally to the kernel to hopefully eliminate the possiblity 27 * internally to the kernel to hopefully eliminate the possibility
28 * of a bad image halting the CPU. Also, there are different 28 * of a bad image halting the CPU. Also, there are different
29 * images for the PCX-W and later chips vs the PCX-U chips. 29 * images for the PCX-W and later chips vs the PCX-U chips.
30 * 30 *
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 1f3aa8db0203..76332dadc6e9 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -43,6 +43,7 @@
43#include <linux/personality.h> 43#include <linux/personality.h>
44#include <linux/ptrace.h> 44#include <linux/ptrace.h>
45#include <linux/sched.h> 45#include <linux/sched.h>
46#include <linux/slab.h>
46#include <linux/stddef.h> 47#include <linux/stddef.h>
47#include <linux/unistd.h> 48#include <linux/unistd.h>
48#include <linux/kallsyms.h> 49#include <linux/kallsyms.h>
diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c
index e8467e4aa8d1..35c827e94e31 100644
--- a/arch/parisc/kernel/signal.c
+++ b/arch/parisc/kernel/signal.c
@@ -26,7 +26,6 @@
26#include <linux/stddef.h> 26#include <linux/stddef.h>
27#include <linux/compat.h> 27#include <linux/compat.h>
28#include <linux/elf.h> 28#include <linux/elf.h>
29#include <linux/tracehook.h>
30#include <asm/ucontext.h> 29#include <asm/ucontext.h>
31#include <asm/rt_sigframe.h> 30#include <asm/rt_sigframe.h>
32#include <asm/uaccess.h> 31#include <asm/uaccess.h>
@@ -469,7 +468,9 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
469 recalc_sigpending(); 468 recalc_sigpending();
470 spin_unlock_irq(&current->sighand->siglock); 469 spin_unlock_irq(&current->sighand->siglock);
471 470
472 tracehook_signal_handler(sig, info, ka, regs, 0); 471 tracehook_signal_handler(sig, info, ka, regs,
472 test_thread_flag(TIF_SINGLESTEP) ||
473 test_thread_flag(TIF_BLOCKSTEP));
473 474
474 return 1; 475 return 1;
475} 476}
diff --git a/arch/parisc/kernel/signal32.c b/arch/parisc/kernel/signal32.c
index fb59852006de..e14132430762 100644
--- a/arch/parisc/kernel/signal32.c
+++ b/arch/parisc/kernel/signal32.c
@@ -23,7 +23,6 @@
23 */ 23 */
24 24
25#include <linux/compat.h> 25#include <linux/compat.h>
26#include <linux/slab.h>
27#include <linux/module.h> 26#include <linux/module.h>
28#include <linux/unistd.h> 27#include <linux/unistd.h>
29#include <linux/init.h> 28#include <linux/init.h>
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 1fd0f0cec037..69d63d354ef0 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -18,7 +18,6 @@
18*/ 18*/
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <linux/slab.h>
22 21
23#include <linux/kernel.h> 22#include <linux/kernel.h>
24#include <linux/module.h> 23#include <linux/module.h>
@@ -60,8 +59,6 @@ static int smp_debug_lvl = 0;
60#define smp_debug(lvl, ...) do { } while(0) 59#define smp_debug(lvl, ...) do { } while(0)
61#endif /* DEBUG_SMP */ 60#endif /* DEBUG_SMP */
62 61
63DEFINE_SPINLOCK(smp_lock);
64
65volatile struct task_struct *smp_init_current_idle_task; 62volatile struct task_struct *smp_init_current_idle_task;
66 63
67/* track which CPU is booting */ 64/* track which CPU is booting */
@@ -69,7 +66,7 @@ static volatile int cpu_now_booting __cpuinitdata;
69 66
70static int parisc_max_cpus __cpuinitdata = 1; 67static int parisc_max_cpus __cpuinitdata = 1;
71 68
72DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED; 69static DEFINE_PER_CPU(spinlock_t, ipi_lock);
73 70
74enum ipi_message_type { 71enum ipi_message_type {
75 IPI_NOP=0, 72 IPI_NOP=0,
@@ -438,6 +435,11 @@ void __init smp_prepare_boot_cpu(void)
438*/ 435*/
439void __init smp_prepare_cpus(unsigned int max_cpus) 436void __init smp_prepare_cpus(unsigned int max_cpus)
440{ 437{
438 int cpu;
439
440 for_each_possible_cpu(cpu)
441 spin_lock_init(&per_cpu(ipi_lock, cpu));
442
441 init_cpu_present(cpumask_of(0)); 443 init_cpu_present(cpumask_of(0));
442 444
443 parisc_max_cpus = max_cpus; 445 parisc_max_cpus = max_cpus;
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
index 71b31957c8f1..c9b932260f47 100644
--- a/arch/parisc/kernel/sys_parisc.c
+++ b/arch/parisc/kernel/sys_parisc.c
@@ -110,37 +110,14 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr,
110 return addr; 110 return addr;
111} 111}
112 112
113static unsigned long do_mmap2(unsigned long addr, unsigned long len,
114 unsigned long prot, unsigned long flags, unsigned long fd,
115 unsigned long pgoff)
116{
117 struct file * file = NULL;
118 unsigned long error = -EBADF;
119 if (!(flags & MAP_ANONYMOUS)) {
120 file = fget(fd);
121 if (!file)
122 goto out;
123 }
124
125 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
126
127 down_write(&current->mm->mmap_sem);
128 error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff);
129 up_write(&current->mm->mmap_sem);
130
131 if (file != NULL)
132 fput(file);
133out:
134 return error;
135}
136
137asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len, 113asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len,
138 unsigned long prot, unsigned long flags, unsigned long fd, 114 unsigned long prot, unsigned long flags, unsigned long fd,
139 unsigned long pgoff) 115 unsigned long pgoff)
140{ 116{
141 /* Make sure the shift for mmap2 is constant (12), no matter what PAGE_SIZE 117 /* Make sure the shift for mmap2 is constant (12), no matter what PAGE_SIZE
142 we have. */ 118 we have. */
143 return do_mmap2(addr, len, prot, flags, fd, pgoff >> (PAGE_SHIFT - 12)); 119 return sys_mmap_pgoff(addr, len, prot, flags, fd,
120 pgoff >> (PAGE_SHIFT - 12));
144} 121}
145 122
146asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len, 123asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
@@ -148,7 +125,8 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
148 unsigned long offset) 125 unsigned long offset)
149{ 126{
150 if (!(offset & ~PAGE_MASK)) { 127 if (!(offset & ~PAGE_MASK)) {
151 return do_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); 128 return sys_mmap_pgoff(addr, len, prot, flags, fd,
129 offset >> PAGE_SHIFT);
152 } else { 130 } else {
153 return -EINVAL; 131 return -EINVAL;
154 } 132 }
@@ -256,18 +234,3 @@ long parisc_personality(unsigned long personality)
256 234
257 return err; 235 return err;
258} 236}
259
260long parisc_newuname(struct new_utsname __user *name)
261{
262 int err = sys_newuname(name);
263
264#ifdef CONFIG_COMPAT
265 if (!err && personality(current->personality) == PER_LINUX32) {
266 if (__put_user(0, name->machine + 6) ||
267 __put_user(0, name->machine + 7))
268 err = -EFAULT;
269 }
270#endif
271
272 return err;
273}
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index 561388b17c91..9779ece2b070 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -26,13 +26,7 @@
26#include <linux/shm.h> 26#include <linux/shm.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/uio.h> 28#include <linux/uio.h>
29#include <linux/nfs_fs.h>
30#include <linux/ncp_fs.h> 29#include <linux/ncp_fs.h>
31#include <linux/sunrpc/svc.h>
32#include <linux/nfsd/nfsd.h>
33#include <linux/nfsd/cache.h>
34#include <linux/nfsd/xdr.h>
35#include <linux/nfsd/syscall.h>
36#include <linux/poll.h> 30#include <linux/poll.h>
37#include <linux/personality.h> 31#include <linux/personality.h>
38#include <linux/stat.h> 32#include <linux/stat.h>
@@ -90,77 +84,6 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23,
90 return -ENOSYS; 84 return -ENOSYS;
91} 85}
92 86
93#ifdef CONFIG_SYSCTL
94
95struct __sysctl_args32 {
96 u32 name;
97 int nlen;
98 u32 oldval;
99 u32 oldlenp;
100 u32 newval;
101 u32 newlen;
102 u32 __unused[4];
103};
104
105asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
106{
107#ifndef CONFIG_SYSCTL_SYSCALL
108 return -ENOSYS;
109#else
110 struct __sysctl_args32 tmp;
111 int error;
112 unsigned int oldlen32;
113 size_t oldlen, __user *oldlenp = NULL;
114 unsigned long addr = (((long __force)&args->__unused[0]) + 7) & ~7;
115
116 DBG(("sysctl32(%p)\n", args));
117
118 if (copy_from_user(&tmp, args, sizeof(tmp)))
119 return -EFAULT;
120
121 if (tmp.oldval && tmp.oldlenp) {
122 /* Duh, this is ugly and might not work if sysctl_args
123 is in read-only memory, but do_sysctl does indirectly
124 a lot of uaccess in both directions and we'd have to
125 basically copy the whole sysctl.c here, and
126 glibc's __sysctl uses rw memory for the structure
127 anyway. */
128 /* a possibly better hack than this, which will avoid the
129 * problem if the struct is read only, is to push the
130 * 'oldlen' value out to the user's stack instead. -PB
131 */
132 if (get_user(oldlen32, (u32 *)(u64)tmp.oldlenp))
133 return -EFAULT;
134 oldlen = oldlen32;
135 if (put_user(oldlen, (size_t *)addr))
136 return -EFAULT;
137 oldlenp = (size_t *)addr;
138 }
139
140 lock_kernel();
141 error = do_sysctl((int __user *)(u64)tmp.name, tmp.nlen,
142 (void __user *)(u64)tmp.oldval, oldlenp,
143 (void __user *)(u64)tmp.newval, tmp.newlen);
144 unlock_kernel();
145 if (oldlenp) {
146 if (!error) {
147 if (get_user(oldlen, (size_t *)addr)) {
148 error = -EFAULT;
149 } else {
150 oldlen32 = oldlen;
151 if (put_user(oldlen32, (u32 *)(u64)tmp.oldlenp))
152 error = -EFAULT;
153 }
154 }
155 if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
156 error = -EFAULT;
157 }
158 return error;
159#endif
160}
161
162#endif /* CONFIG_SYSCTL */
163
164asmlinkage long sys32_sched_rr_get_interval(pid_t pid, 87asmlinkage long sys32_sched_rr_get_interval(pid_t pid,
165 struct compat_timespec __user *interval) 88 struct compat_timespec __user *interval)
166{ 89{
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 843f423dec67..3d52c978738f 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -127,7 +127,7 @@
127 ENTRY_SAME(socketpair) 127 ENTRY_SAME(socketpair)
128 ENTRY_SAME(setpgid) 128 ENTRY_SAME(setpgid)
129 ENTRY_SAME(send) 129 ENTRY_SAME(send)
130 ENTRY_OURS(newuname) 130 ENTRY_SAME(newuname)
131 ENTRY_SAME(umask) /* 60 */ 131 ENTRY_SAME(umask) /* 60 */
132 ENTRY_SAME(chroot) 132 ENTRY_SAME(chroot)
133 ENTRY_COMP(ustat) 133 ENTRY_COMP(ustat)
@@ -234,7 +234,7 @@
234 ENTRY_SAME(getsid) 234 ENTRY_SAME(getsid)
235 ENTRY_SAME(fdatasync) 235 ENTRY_SAME(fdatasync)
236 /* struct __sysctl_args is a mess */ 236 /* struct __sysctl_args is a mess */
237 ENTRY_DIFF(sysctl) 237 ENTRY_COMP(sysctl)
238 ENTRY_SAME(mlock) /* 150 */ 238 ENTRY_SAME(mlock) /* 150 */
239 ENTRY_SAME(munlock) 239 ENTRY_SAME(munlock)
240 ENTRY_SAME(mlockall) 240 ENTRY_SAME(mlockall)
@@ -417,6 +417,8 @@
417 ENTRY_COMP(pwritev) 417 ENTRY_COMP(pwritev)
418 ENTRY_COMP(rt_tgsigqueueinfo) 418 ENTRY_COMP(rt_tgsigqueueinfo)
419 ENTRY_SAME(perf_event_open) 419 ENTRY_SAME(perf_event_open)
420 ENTRY_COMP(recvmmsg)
421 ENTRY_SAME(accept4) /* 320 */
420 422
421 /* Nothing yet */ 423 /* Nothing yet */
422 424
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index a79c6f9e7e2c..05511ccb61d2 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -250,9 +250,21 @@ static int __init rtc_init(void)
250} 250}
251module_init(rtc_init); 251module_init(rtc_init);
252 252
253void __init time_init(void) 253void read_persistent_clock(struct timespec *ts)
254{ 254{
255 static struct pdc_tod tod_data; 255 static struct pdc_tod tod_data;
256 if (pdc_tod_read(&tod_data) == 0) {
257 ts->tv_sec = tod_data.tod_sec;
258 ts->tv_nsec = tod_data.tod_usec * 1000;
259 } else {
260 printk(KERN_ERR "Error reading tod clock\n");
261 ts->tv_sec = 0;
262 ts->tv_nsec = 0;
263 }
264}
265
266void __init time_init(void)
267{
256 unsigned long current_cr16_khz; 268 unsigned long current_cr16_khz;
257 269
258 clocktick = (100 * PAGE0->mem_10msec) / HZ; 270 clocktick = (100 * PAGE0->mem_10msec) / HZ;
@@ -264,19 +276,4 @@ void __init time_init(void)
264 clocksource_cr16.mult = clocksource_khz2mult(current_cr16_khz, 276 clocksource_cr16.mult = clocksource_khz2mult(current_cr16_khz,
265 clocksource_cr16.shift); 277 clocksource_cr16.shift);
266 clocksource_register(&clocksource_cr16); 278 clocksource_register(&clocksource_cr16);
267
268 if (pdc_tod_read(&tod_data) == 0) {
269 unsigned long flags;
270
271 write_seqlock_irqsave(&xtime_lock, flags);
272 xtime.tv_sec = tod_data.tod_sec;
273 xtime.tv_nsec = tod_data.tod_usec * 1000;
274 set_normalized_timespec(&wall_to_monotonic,
275 -xtime.tv_sec, -xtime.tv_nsec);
276 write_sequnlock_irqrestore(&xtime_lock, flags);
277 } else {
278 printk(KERN_ERR "Error reading tod clock\n");
279 xtime.tv_sec = 0;
280 xtime.tv_nsec = 0;
281 }
282} 279}
diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c
index e6f4b7a4b7e3..92d977bb5ea8 100644
--- a/arch/parisc/kernel/unaligned.c
+++ b/arch/parisc/kernel/unaligned.c
@@ -25,6 +25,7 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/sched.h> 26#include <linux/sched.h>
27#include <linux/signal.h> 27#include <linux/signal.h>
28#include <linux/ratelimit.h>
28#include <asm/uaccess.h> 29#include <asm/uaccess.h>
29 30
30/* #define DEBUG_UNALIGNED 1 */ 31/* #define DEBUG_UNALIGNED 1 */
@@ -446,8 +447,7 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop)
446 447
447void handle_unaligned(struct pt_regs *regs) 448void handle_unaligned(struct pt_regs *regs)
448{ 449{
449 static unsigned long unaligned_count = 0; 450 static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5);
450 static unsigned long last_time = 0;
451 unsigned long newbase = R1(regs->iir)?regs->gr[R1(regs->iir)]:0; 451 unsigned long newbase = R1(regs->iir)?regs->gr[R1(regs->iir)]:0;
452 int modify = 0; 452 int modify = 0;
453 int ret = ERR_NOTHANDLED; 453 int ret = ERR_NOTHANDLED;
@@ -460,14 +460,8 @@ void handle_unaligned(struct pt_regs *regs)
460 goto force_sigbus; 460 goto force_sigbus;
461 } 461 }
462 462
463 if (unaligned_count > 5 && 463 if (!(current->thread.flags & PARISC_UAC_NOPRINT) &&
464 time_after(jiffies, last_time + 5 * HZ)) { 464 __ratelimit(&ratelimit)) {
465 unaligned_count = 0;
466 last_time = jiffies;
467 }
468
469 if (!(current->thread.flags & PARISC_UAC_NOPRINT)
470 && ++unaligned_count < 5) {
471 char buf[256]; 465 char buf[256];
472 sprintf(buf, "%s(%d): unaligned access to 0x" RFMT " at ip=0x" RFMT "\n", 466 sprintf(buf, "%s(%d): unaligned access to 0x" RFMT " at ip=0x" RFMT "\n",
473 current->comm, task_pid_nr(current), regs->ior, regs->iaoq[0]); 467 current->comm, task_pid_nr(current), regs->ior, regs->iaoq[0]);
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c
index a36799e85693..d58eac1a8288 100644
--- a/arch/parisc/kernel/unwind.c
+++ b/arch/parisc/kernel/unwind.c
@@ -13,6 +13,7 @@
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <linux/kallsyms.h> 15#include <linux/kallsyms.h>
16#include <linux/sort.h>
16 17
17#include <asm/uaccess.h> 18#include <asm/uaccess.h>
18#include <asm/assembly.h> 19#include <asm/assembly.h>
@@ -115,24 +116,18 @@ unwind_table_init(struct unwind_table *table, const char *name,
115 } 116 }
116} 117}
117 118
119static int cmp_unwind_table_entry(const void *a, const void *b)
120{
121 return ((const struct unwind_table_entry *)a)->region_start
122 - ((const struct unwind_table_entry *)b)->region_start;
123}
124
118static void 125static void
119unwind_table_sort(struct unwind_table_entry *start, 126unwind_table_sort(struct unwind_table_entry *start,
120 struct unwind_table_entry *finish) 127 struct unwind_table_entry *finish)
121{ 128{
122 struct unwind_table_entry el, *p, *q; 129 sort(start, finish - start, sizeof(struct unwind_table_entry),
123 130 cmp_unwind_table_entry, NULL);
124 for (p = start + 1; p < finish; ++p) {
125 if (p[0].region_start < p[-1].region_start) {
126 el = *p;
127 q = p;
128 do {
129 q[0] = q[-1];
130 --q;
131 } while (q > start &&
132 el.region_start < q[-1].region_start);
133 *q = el;
134 }
135 }
136} 131}
137 132
138struct unwind_table * 133struct unwind_table *
@@ -417,3 +412,30 @@ int unwind_to_user(struct unwind_frame_info *info)
417 412
418 return ret; 413 return ret;
419} 414}
415
416unsigned long return_address(unsigned int level)
417{
418 struct unwind_frame_info info;
419 struct pt_regs r;
420 unsigned long sp;
421
422 /* initialize unwind info */
423 asm volatile ("copy %%r30, %0" : "=r"(sp));
424 memset(&r, 0, sizeof(struct pt_regs));
425 r.iaoq[0] = (unsigned long) current_text_addr();
426 r.gr[2] = (unsigned long) __builtin_return_address(0);
427 r.gr[30] = sp;
428 unwind_frame_init(&info, current, &r);
429
430 /* unwind stack */
431 ++level;
432 do {
433 if (unwind_once(&info) < 0 || info.ip == 0)
434 return 0;
435 if (!__kernel_text_address(info.ip)) {
436 return 0;
437 }
438 } while (info.ip && level--);
439
440 return info.ip;
441}