diff options
Diffstat (limited to 'arch/parisc')
43 files changed, 230 insertions, 299 deletions
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 524d9352f17e..9c4da3d63bfb 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig | |||
@@ -18,7 +18,6 @@ config PARISC | |||
18 | select BUG | 18 | select BUG |
19 | select HAVE_PERF_EVENTS | 19 | select HAVE_PERF_EVENTS |
20 | select GENERIC_ATOMIC64 if !64BIT | 20 | select GENERIC_ATOMIC64 if !64BIT |
21 | select HAVE_ARCH_TRACEHOOK | ||
22 | help | 21 | help |
23 | The PA-RISC microprocessor is designed by Hewlett-Packard and used | 22 | The PA-RISC microprocessor is designed by Hewlett-Packard and used |
24 | in many of their workstations & servers (HP9000 700 and 800 series, | 23 | in many of their workstations & servers (HP9000 700 and 800 series, |
@@ -96,6 +95,9 @@ config PM | |||
96 | config STACKTRACE_SUPPORT | 95 | config STACKTRACE_SUPPORT |
97 | def_bool y | 96 | def_bool y |
98 | 97 | ||
98 | config NEED_DMA_MAP_STATE | ||
99 | def_bool y | ||
100 | |||
99 | config ISA_DMA_API | 101 | config ISA_DMA_API |
100 | bool | 102 | bool |
101 | 103 | ||
diff --git a/arch/parisc/Kconfig.debug b/arch/parisc/Kconfig.debug index bc989e522a04..7305ac8f7f5b 100644 --- a/arch/parisc/Kconfig.debug +++ b/arch/parisc/Kconfig.debug | |||
@@ -12,4 +12,18 @@ config DEBUG_RODATA | |||
12 | portion of the kernel code won't be covered by a TLB anymore. | 12 | portion of the kernel code won't be covered by a TLB anymore. |
13 | If in doubt, say "N". | 13 | If in doubt, say "N". |
14 | 14 | ||
15 | config DEBUG_STRICT_USER_COPY_CHECKS | ||
16 | bool "Strict copy size checks" | ||
17 | depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING | ||
18 | ---help--- | ||
19 | Enabling this option turns a certain set of sanity checks for user | ||
20 | copy operations into compile time failures. | ||
21 | |||
22 | The copy_from_user() etc checks are there to help test if there | ||
23 | are sufficient security checks on the length argument of | ||
24 | the copy operation, by having gcc prove that the argument is | ||
25 | within bounds. | ||
26 | |||
27 | If unsure, or if you run an older (pre 4.4) gcc, say N. | ||
28 | |||
15 | endmenu | 29 | endmenu |
diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c index 54075360a8fd..6935123178eb 100644 --- a/arch/parisc/hpux/fs.c +++ b/arch/parisc/hpux/fs.c | |||
@@ -26,8 +26,8 @@ | |||
26 | #include <linux/fs.h> | 26 | #include <linux/fs.h> |
27 | #include <linux/sched.h> | 27 | #include <linux/sched.h> |
28 | #include <linux/file.h> | 28 | #include <linux/file.h> |
29 | #include <linux/slab.h> | ||
30 | #include <linux/ptrace.h> | 29 | #include <linux/ptrace.h> |
30 | #include <linux/slab.h> | ||
31 | #include <asm/errno.h> | 31 | #include <asm/errno.h> |
32 | #include <asm/uaccess.h> | 32 | #include <asm/uaccess.h> |
33 | 33 | ||
diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c index 18072e03a019..92343bd35fa3 100644 --- a/arch/parisc/hpux/sys_hpux.c +++ b/arch/parisc/hpux/sys_hpux.c | |||
@@ -445,12 +445,7 @@ done: | |||
445 | 445 | ||
446 | int hpux_pipe(int *kstack_fildes) | 446 | int hpux_pipe(int *kstack_fildes) |
447 | { | 447 | { |
448 | int error; | 448 | return do_pipe_flags(kstack_fildes, 0); |
449 | |||
450 | lock_kernel(); | ||
451 | error = do_pipe_flags(kstack_fildes, 0); | ||
452 | unlock_kernel(); | ||
453 | return error; | ||
454 | } | 449 | } |
455 | 450 | ||
456 | /* lies - says it works, but it really didn't lock anything */ | 451 | /* lies - says it works, but it really didn't lock anything */ |
diff --git a/arch/parisc/include/asm/asm-offsets.h b/arch/parisc/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/parisc/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h index 8bc9e96699b2..716634d1f546 100644 --- a/arch/parisc/include/asm/atomic.h +++ b/arch/parisc/include/asm/atomic.h | |||
@@ -27,19 +27,19 @@ | |||
27 | # define ATOMIC_HASH_SIZE 4 | 27 | # define ATOMIC_HASH_SIZE 4 |
28 | # define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) (a))/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ])) | 28 | # define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) (a))/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ])) |
29 | 29 | ||
30 | extern raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned; | 30 | extern arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned; |
31 | 31 | ||
32 | /* Can't use raw_spin_lock_irq because of #include problems, so | 32 | /* Can't use raw_spin_lock_irq because of #include problems, so |
33 | * this is the substitute */ | 33 | * this is the substitute */ |
34 | #define _atomic_spin_lock_irqsave(l,f) do { \ | 34 | #define _atomic_spin_lock_irqsave(l,f) do { \ |
35 | raw_spinlock_t *s = ATOMIC_HASH(l); \ | 35 | arch_spinlock_t *s = ATOMIC_HASH(l); \ |
36 | local_irq_save(f); \ | 36 | local_irq_save(f); \ |
37 | __raw_spin_lock(s); \ | 37 | arch_spin_lock(s); \ |
38 | } while(0) | 38 | } while(0) |
39 | 39 | ||
40 | #define _atomic_spin_unlock_irqrestore(l,f) do { \ | 40 | #define _atomic_spin_unlock_irqrestore(l,f) do { \ |
41 | raw_spinlock_t *s = ATOMIC_HASH(l); \ | 41 | arch_spinlock_t *s = ATOMIC_HASH(l); \ |
42 | __raw_spin_unlock(s); \ | 42 | arch_spin_unlock(s); \ |
43 | local_irq_restore(f); \ | 43 | local_irq_restore(f); \ |
44 | } while(0) | 44 | } while(0) |
45 | 45 | ||
diff --git a/arch/parisc/include/asm/bug.h b/arch/parisc/include/asm/bug.h index 8cfc553fc837..75e46c557a16 100644 --- a/arch/parisc/include/asm/bug.h +++ b/arch/parisc/include/asm/bug.h | |||
@@ -32,14 +32,14 @@ | |||
32 | "\t.popsection" \ | 32 | "\t.popsection" \ |
33 | : : "i" (__FILE__), "i" (__LINE__), \ | 33 | : : "i" (__FILE__), "i" (__LINE__), \ |
34 | "i" (0), "i" (sizeof(struct bug_entry)) ); \ | 34 | "i" (0), "i" (sizeof(struct bug_entry)) ); \ |
35 | for(;;) ; \ | 35 | unreachable(); \ |
36 | } while(0) | 36 | } while(0) |
37 | 37 | ||
38 | #else | 38 | #else |
39 | #define BUG() \ | 39 | #define BUG() \ |
40 | do { \ | 40 | do { \ |
41 | asm volatile(PARISC_BUG_BREAK_ASM : : ); \ | 41 | asm volatile(PARISC_BUG_BREAK_ASM : : ); \ |
42 | for(;;) ; \ | 42 | unreachable(); \ |
43 | } while(0) | 43 | } while(0) |
44 | #endif | 44 | #endif |
45 | 45 | ||
diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h index 724395143f26..477277739da5 100644 --- a/arch/parisc/include/asm/cacheflush.h +++ b/arch/parisc/include/asm/cacheflush.h | |||
@@ -38,10 +38,23 @@ void flush_cache_mm(struct mm_struct *mm); | |||
38 | 38 | ||
39 | #define flush_kernel_dcache_range(start,size) \ | 39 | #define flush_kernel_dcache_range(start,size) \ |
40 | flush_kernel_dcache_range_asm((start), (start)+(size)); | 40 | flush_kernel_dcache_range_asm((start), (start)+(size)); |
41 | /* vmap range flushes and invalidates. Architecturally, we don't need | ||
42 | * the invalidate, because the CPU should refuse to speculate once an | ||
43 | * area has been flushed, so invalidate is left empty */ | ||
44 | static inline void flush_kernel_vmap_range(void *vaddr, int size) | ||
45 | { | ||
46 | unsigned long start = (unsigned long)vaddr; | ||
47 | |||
48 | flush_kernel_dcache_range_asm(start, start + size); | ||
49 | } | ||
50 | static inline void invalidate_kernel_vmap_range(void *vaddr, int size) | ||
51 | { | ||
52 | } | ||
41 | 53 | ||
42 | #define flush_cache_vmap(start, end) flush_cache_all() | 54 | #define flush_cache_vmap(start, end) flush_cache_all() |
43 | #define flush_cache_vunmap(start, end) flush_cache_all() | 55 | #define flush_cache_vunmap(start, end) flush_cache_all() |
44 | 56 | ||
57 | #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1 | ||
45 | extern void flush_dcache_page(struct page *page); | 58 | extern void flush_dcache_page(struct page *page); |
46 | 59 | ||
47 | #define flush_dcache_mmap_lock(mapping) \ | 60 | #define flush_dcache_mmap_lock(mapping) \ |
diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h index 7f32611a7a5e..02b77baa5da6 100644 --- a/arch/parisc/include/asm/compat.h +++ b/arch/parisc/include/asm/compat.h | |||
@@ -7,7 +7,8 @@ | |||
7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
8 | #include <linux/thread_info.h> | 8 | #include <linux/thread_info.h> |
9 | 9 | ||
10 | #define COMPAT_USER_HZ 100 | 10 | #define COMPAT_USER_HZ 100 |
11 | #define COMPAT_UTS_MACHINE "parisc\0\0" | ||
11 | 12 | ||
12 | typedef u32 compat_size_t; | 13 | typedef u32 compat_size_t; |
13 | typedef s32 compat_ssize_t; | 14 | typedef s32 compat_ssize_t; |
diff --git a/arch/parisc/include/asm/elf.h b/arch/parisc/include/asm/elf.h index 9c802eb4be84..19f6cb1a4a1c 100644 --- a/arch/parisc/include/asm/elf.h +++ b/arch/parisc/include/asm/elf.h | |||
@@ -328,7 +328,6 @@ struct pt_regs; /* forward declaration... */ | |||
328 | such function. */ | 328 | such function. */ |
329 | #define ELF_PLAT_INIT(_r, load_addr) _r->gr[23] = 0 | 329 | #define ELF_PLAT_INIT(_r, load_addr) _r->gr[23] = 0 |
330 | 330 | ||
331 | #define USE_ELF_CORE_DUMP | ||
332 | #define ELF_EXEC_PAGESIZE 4096 | 331 | #define ELF_EXEC_PAGESIZE 4096 |
333 | 332 | ||
334 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical | 333 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical |
diff --git a/arch/parisc/include/asm/fcntl.h b/arch/parisc/include/asm/fcntl.h index 1e1c824764ee..f357fc693c89 100644 --- a/arch/parisc/include/asm/fcntl.h +++ b/arch/parisc/include/asm/fcntl.h | |||
@@ -1,14 +1,13 @@ | |||
1 | #ifndef _PARISC_FCNTL_H | 1 | #ifndef _PARISC_FCNTL_H |
2 | #define _PARISC_FCNTL_H | 2 | #define _PARISC_FCNTL_H |
3 | 3 | ||
4 | /* open/fcntl - O_SYNC is only implemented on blocks devices and on files | ||
5 | located on an ext2 file system */ | ||
6 | #define O_APPEND 000000010 | 4 | #define O_APPEND 000000010 |
7 | #define O_BLKSEEK 000000100 /* HPUX only */ | 5 | #define O_BLKSEEK 000000100 /* HPUX only */ |
8 | #define O_CREAT 000000400 /* not fcntl */ | 6 | #define O_CREAT 000000400 /* not fcntl */ |
9 | #define O_EXCL 000002000 /* not fcntl */ | 7 | #define O_EXCL 000002000 /* not fcntl */ |
10 | #define O_LARGEFILE 000004000 | 8 | #define O_LARGEFILE 000004000 |
11 | #define O_SYNC 000100000 | 9 | #define __O_SYNC 000100000 |
10 | #define O_SYNC (__O_SYNC|O_DSYNC) | ||
12 | #define O_NONBLOCK 000200004 /* HPUX has separate NDELAY & NONBLOCK */ | 11 | #define O_NONBLOCK 000200004 /* HPUX has separate NDELAY & NONBLOCK */ |
13 | #define O_NOCTTY 000400000 /* not fcntl */ | 12 | #define O_NOCTTY 000400000 /* not fcntl */ |
14 | #define O_DSYNC 001000000 /* HPUX only */ | 13 | #define O_DSYNC 001000000 /* HPUX only */ |
diff --git a/arch/parisc/include/asm/ftrace.h b/arch/parisc/include/asm/ftrace.h index 2fa05dd6aeee..72c0fafaa039 100644 --- a/arch/parisc/include/asm/ftrace.h +++ b/arch/parisc/include/asm/ftrace.h | |||
@@ -20,6 +20,20 @@ struct ftrace_ret_stack { | |||
20 | * Defined in entry.S | 20 | * Defined in entry.S |
21 | */ | 21 | */ |
22 | extern void return_to_handler(void); | 22 | extern void return_to_handler(void); |
23 | |||
24 | |||
25 | extern unsigned long return_address(unsigned int); | ||
26 | |||
27 | #define HAVE_ARCH_CALLER_ADDR | ||
28 | |||
29 | #define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0)) | ||
30 | #define CALLER_ADDR1 return_address(1) | ||
31 | #define CALLER_ADDR2 return_address(2) | ||
32 | #define CALLER_ADDR3 return_address(3) | ||
33 | #define CALLER_ADDR4 return_address(4) | ||
34 | #define CALLER_ADDR5 return_address(5) | ||
35 | #define CALLER_ADDR6 return_address(6) | ||
36 | |||
23 | #endif /* __ASSEMBLY__ */ | 37 | #endif /* __ASSEMBLY__ */ |
24 | 38 | ||
25 | #endif /* _ASM_PARISC_FTRACE_H */ | 39 | #endif /* _ASM_PARISC_FTRACE_H */ |
diff --git a/arch/parisc/include/asm/param.h b/arch/parisc/include/asm/param.h index 32e03d877858..965d45427975 100644 --- a/arch/parisc/include/asm/param.h +++ b/arch/parisc/include/asm/param.h | |||
@@ -1,22 +1 @@ | |||
1 | #ifndef _ASMPARISC_PARAM_H | #include <asm-generic/param.h> | |
2 | #define _ASMPARISC_PARAM_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | #define HZ CONFIG_HZ | ||
6 | #define USER_HZ 100 /* some user API use "ticks" */ | ||
7 | #define CLOCKS_PER_SEC (USER_HZ) /* like times() */ | ||
8 | #endif | ||
9 | |||
10 | #ifndef HZ | ||
11 | #define HZ 100 | ||
12 | #endif | ||
13 | |||
14 | #define EXEC_PAGESIZE 4096 | ||
15 | |||
16 | #ifndef NOGROUP | ||
17 | #define NOGROUP (-1) | ||
18 | #endif | ||
19 | |||
20 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | ||
21 | |||
22 | #endif | ||
diff --git a/arch/parisc/include/asm/pci.h b/arch/parisc/include/asm/pci.h index 64c7aa590ae5..2242a5c636c2 100644 --- a/arch/parisc/include/asm/pci.h +++ b/arch/parisc/include/asm/pci.h | |||
@@ -183,20 +183,6 @@ struct pci_bios_ops { | |||
183 | void (*fixup_bus)(struct pci_bus *bus); | 183 | void (*fixup_bus)(struct pci_bus *bus); |
184 | }; | 184 | }; |
185 | 185 | ||
186 | /* pci_unmap_{single,page} is not a nop, thus... */ | ||
187 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ | ||
188 | dma_addr_t ADDR_NAME; | ||
189 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \ | ||
190 | __u32 LEN_NAME; | ||
191 | #define pci_unmap_addr(PTR, ADDR_NAME) \ | ||
192 | ((PTR)->ADDR_NAME) | ||
193 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \ | ||
194 | (((PTR)->ADDR_NAME) = (VAL)) | ||
195 | #define pci_unmap_len(PTR, LEN_NAME) \ | ||
196 | ((PTR)->LEN_NAME) | ||
197 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ | ||
198 | (((PTR)->LEN_NAME) = (VAL)) | ||
199 | |||
200 | /* | 186 | /* |
201 | ** Stuff declared in arch/parisc/kernel/pci.c | 187 | ** Stuff declared in arch/parisc/kernel/pci.c |
202 | */ | 188 | */ |
diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h index a27d2e200fb2..01c15035e783 100644 --- a/arch/parisc/include/asm/pgtable.h +++ b/arch/parisc/include/asm/pgtable.h | |||
@@ -410,7 +410,7 @@ extern void paging_init (void); | |||
410 | 410 | ||
411 | #define PG_dcache_dirty PG_arch_1 | 411 | #define PG_dcache_dirty PG_arch_1 |
412 | 412 | ||
413 | extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t); | 413 | extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *); |
414 | 414 | ||
415 | /* Encode and de-code a swap entry */ | 415 | /* Encode and de-code a swap entry */ |
416 | 416 | ||
diff --git a/arch/parisc/include/asm/ptrace.h b/arch/parisc/include/asm/ptrace.h index aead40b16dd8..7f09533da771 100644 --- a/arch/parisc/include/asm/ptrace.h +++ b/arch/parisc/include/asm/ptrace.h | |||
@@ -47,13 +47,8 @@ struct pt_regs { | |||
47 | 47 | ||
48 | #define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS)) | 48 | #define task_regs(task) ((struct pt_regs *) ((char *)(task) + TASK_REGS)) |
49 | 49 | ||
50 | struct task_struct; | ||
51 | #define arch_has_single_step() 1 | 50 | #define arch_has_single_step() 1 |
52 | void user_disable_single_step(struct task_struct *task); | ||
53 | void user_enable_single_step(struct task_struct *task); | ||
54 | |||
55 | #define arch_has_block_step() 1 | 51 | #define arch_has_block_step() 1 |
56 | void user_enable_block_step(struct task_struct *task); | ||
57 | 52 | ||
58 | /* XXX should we use iaoq[1] or iaoq[0] ? */ | 53 | /* XXX should we use iaoq[1] or iaoq[0] ? */ |
59 | #define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) | 54 | #define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) |
diff --git a/arch/parisc/include/asm/socket.h b/arch/parisc/include/asm/socket.h index 960b1e5d8e16..225b7d6a1a0a 100644 --- a/arch/parisc/include/asm/socket.h +++ b/arch/parisc/include/asm/socket.h | |||
@@ -59,6 +59,8 @@ | |||
59 | #define SO_TIMESTAMPING 0x4020 | 59 | #define SO_TIMESTAMPING 0x4020 |
60 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 60 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
61 | 61 | ||
62 | #define SO_RXQ_OVFL 0x4021 | ||
63 | |||
62 | /* O_NONBLOCK clashes with the bits used for socket types. Therefore we | 64 | /* O_NONBLOCK clashes with the bits used for socket types. Therefore we |
63 | * have to define SOCK_NONBLOCK to a different value here. | 65 | * have to define SOCK_NONBLOCK to a different value here. |
64 | */ | 66 | */ |
diff --git a/arch/parisc/include/asm/spinlock.h b/arch/parisc/include/asm/spinlock.h index fae03e136fa8..74036f436a3b 100644 --- a/arch/parisc/include/asm/spinlock.h +++ b/arch/parisc/include/asm/spinlock.h | |||
@@ -5,17 +5,17 @@ | |||
5 | #include <asm/processor.h> | 5 | #include <asm/processor.h> |
6 | #include <asm/spinlock_types.h> | 6 | #include <asm/spinlock_types.h> |
7 | 7 | ||
8 | static inline int __raw_spin_is_locked(raw_spinlock_t *x) | 8 | static inline int arch_spin_is_locked(arch_spinlock_t *x) |
9 | { | 9 | { |
10 | volatile unsigned int *a = __ldcw_align(x); | 10 | volatile unsigned int *a = __ldcw_align(x); |
11 | return *a == 0; | 11 | return *a == 0; |
12 | } | 12 | } |
13 | 13 | ||
14 | #define __raw_spin_lock(lock) __raw_spin_lock_flags(lock, 0) | 14 | #define arch_spin_lock(lock) arch_spin_lock_flags(lock, 0) |
15 | #define __raw_spin_unlock_wait(x) \ | 15 | #define arch_spin_unlock_wait(x) \ |
16 | do { cpu_relax(); } while (__raw_spin_is_locked(x)) | 16 | do { cpu_relax(); } while (arch_spin_is_locked(x)) |
17 | 17 | ||
18 | static inline void __raw_spin_lock_flags(raw_spinlock_t *x, | 18 | static inline void arch_spin_lock_flags(arch_spinlock_t *x, |
19 | unsigned long flags) | 19 | unsigned long flags) |
20 | { | 20 | { |
21 | volatile unsigned int *a; | 21 | volatile unsigned int *a; |
@@ -33,7 +33,7 @@ static inline void __raw_spin_lock_flags(raw_spinlock_t *x, | |||
33 | mb(); | 33 | mb(); |
34 | } | 34 | } |
35 | 35 | ||
36 | static inline void __raw_spin_unlock(raw_spinlock_t *x) | 36 | static inline void arch_spin_unlock(arch_spinlock_t *x) |
37 | { | 37 | { |
38 | volatile unsigned int *a; | 38 | volatile unsigned int *a; |
39 | mb(); | 39 | mb(); |
@@ -42,7 +42,7 @@ static inline void __raw_spin_unlock(raw_spinlock_t *x) | |||
42 | mb(); | 42 | mb(); |
43 | } | 43 | } |
44 | 44 | ||
45 | static inline int __raw_spin_trylock(raw_spinlock_t *x) | 45 | static inline int arch_spin_trylock(arch_spinlock_t *x) |
46 | { | 46 | { |
47 | volatile unsigned int *a; | 47 | volatile unsigned int *a; |
48 | int ret; | 48 | int ret; |
@@ -69,38 +69,38 @@ static inline int __raw_spin_trylock(raw_spinlock_t *x) | |||
69 | 69 | ||
70 | /* Note that we have to ensure interrupts are disabled in case we're | 70 | /* Note that we have to ensure interrupts are disabled in case we're |
71 | * interrupted by some other code that wants to grab the same read lock */ | 71 | * interrupted by some other code that wants to grab the same read lock */ |
72 | static __inline__ void __raw_read_lock(raw_rwlock_t *rw) | 72 | static __inline__ void arch_read_lock(arch_rwlock_t *rw) |
73 | { | 73 | { |
74 | unsigned long flags; | 74 | unsigned long flags; |
75 | local_irq_save(flags); | 75 | local_irq_save(flags); |
76 | __raw_spin_lock_flags(&rw->lock, flags); | 76 | arch_spin_lock_flags(&rw->lock, flags); |
77 | rw->counter++; | 77 | rw->counter++; |
78 | __raw_spin_unlock(&rw->lock); | 78 | arch_spin_unlock(&rw->lock); |
79 | local_irq_restore(flags); | 79 | local_irq_restore(flags); |
80 | } | 80 | } |
81 | 81 | ||
82 | /* Note that we have to ensure interrupts are disabled in case we're | 82 | /* Note that we have to ensure interrupts are disabled in case we're |
83 | * interrupted by some other code that wants to grab the same read lock */ | 83 | * interrupted by some other code that wants to grab the same read lock */ |
84 | static __inline__ void __raw_read_unlock(raw_rwlock_t *rw) | 84 | static __inline__ void arch_read_unlock(arch_rwlock_t *rw) |
85 | { | 85 | { |
86 | unsigned long flags; | 86 | unsigned long flags; |
87 | local_irq_save(flags); | 87 | local_irq_save(flags); |
88 | __raw_spin_lock_flags(&rw->lock, flags); | 88 | arch_spin_lock_flags(&rw->lock, flags); |
89 | rw->counter--; | 89 | rw->counter--; |
90 | __raw_spin_unlock(&rw->lock); | 90 | arch_spin_unlock(&rw->lock); |
91 | local_irq_restore(flags); | 91 | local_irq_restore(flags); |
92 | } | 92 | } |
93 | 93 | ||
94 | /* Note that we have to ensure interrupts are disabled in case we're | 94 | /* Note that we have to ensure interrupts are disabled in case we're |
95 | * interrupted by some other code that wants to grab the same read lock */ | 95 | * interrupted by some other code that wants to grab the same read lock */ |
96 | static __inline__ int __raw_read_trylock(raw_rwlock_t *rw) | 96 | static __inline__ int arch_read_trylock(arch_rwlock_t *rw) |
97 | { | 97 | { |
98 | unsigned long flags; | 98 | unsigned long flags; |
99 | retry: | 99 | retry: |
100 | local_irq_save(flags); | 100 | local_irq_save(flags); |
101 | if (__raw_spin_trylock(&rw->lock)) { | 101 | if (arch_spin_trylock(&rw->lock)) { |
102 | rw->counter++; | 102 | rw->counter++; |
103 | __raw_spin_unlock(&rw->lock); | 103 | arch_spin_unlock(&rw->lock); |
104 | local_irq_restore(flags); | 104 | local_irq_restore(flags); |
105 | return 1; | 105 | return 1; |
106 | } | 106 | } |
@@ -111,7 +111,7 @@ static __inline__ int __raw_read_trylock(raw_rwlock_t *rw) | |||
111 | return 0; | 111 | return 0; |
112 | 112 | ||
113 | /* Wait until we have a realistic chance at the lock */ | 113 | /* Wait until we have a realistic chance at the lock */ |
114 | while (__raw_spin_is_locked(&rw->lock) && rw->counter >= 0) | 114 | while (arch_spin_is_locked(&rw->lock) && rw->counter >= 0) |
115 | cpu_relax(); | 115 | cpu_relax(); |
116 | 116 | ||
117 | goto retry; | 117 | goto retry; |
@@ -119,15 +119,15 @@ static __inline__ int __raw_read_trylock(raw_rwlock_t *rw) | |||
119 | 119 | ||
120 | /* Note that we have to ensure interrupts are disabled in case we're | 120 | /* Note that we have to ensure interrupts are disabled in case we're |
121 | * interrupted by some other code that wants to read_trylock() this lock */ | 121 | * interrupted by some other code that wants to read_trylock() this lock */ |
122 | static __inline__ void __raw_write_lock(raw_rwlock_t *rw) | 122 | static __inline__ void arch_write_lock(arch_rwlock_t *rw) |
123 | { | 123 | { |
124 | unsigned long flags; | 124 | unsigned long flags; |
125 | retry: | 125 | retry: |
126 | local_irq_save(flags); | 126 | local_irq_save(flags); |
127 | __raw_spin_lock_flags(&rw->lock, flags); | 127 | arch_spin_lock_flags(&rw->lock, flags); |
128 | 128 | ||
129 | if (rw->counter != 0) { | 129 | if (rw->counter != 0) { |
130 | __raw_spin_unlock(&rw->lock); | 130 | arch_spin_unlock(&rw->lock); |
131 | local_irq_restore(flags); | 131 | local_irq_restore(flags); |
132 | 132 | ||
133 | while (rw->counter != 0) | 133 | while (rw->counter != 0) |
@@ -141,27 +141,27 @@ retry: | |||
141 | local_irq_restore(flags); | 141 | local_irq_restore(flags); |
142 | } | 142 | } |
143 | 143 | ||
144 | static __inline__ void __raw_write_unlock(raw_rwlock_t *rw) | 144 | static __inline__ void arch_write_unlock(arch_rwlock_t *rw) |
145 | { | 145 | { |
146 | rw->counter = 0; | 146 | rw->counter = 0; |
147 | __raw_spin_unlock(&rw->lock); | 147 | arch_spin_unlock(&rw->lock); |
148 | } | 148 | } |
149 | 149 | ||
150 | /* Note that we have to ensure interrupts are disabled in case we're | 150 | /* Note that we have to ensure interrupts are disabled in case we're |
151 | * interrupted by some other code that wants to read_trylock() this lock */ | 151 | * interrupted by some other code that wants to read_trylock() this lock */ |
152 | static __inline__ int __raw_write_trylock(raw_rwlock_t *rw) | 152 | static __inline__ int arch_write_trylock(arch_rwlock_t *rw) |
153 | { | 153 | { |
154 | unsigned long flags; | 154 | unsigned long flags; |
155 | int result = 0; | 155 | int result = 0; |
156 | 156 | ||
157 | local_irq_save(flags); | 157 | local_irq_save(flags); |
158 | if (__raw_spin_trylock(&rw->lock)) { | 158 | if (arch_spin_trylock(&rw->lock)) { |
159 | if (rw->counter == 0) { | 159 | if (rw->counter == 0) { |
160 | rw->counter = -1; | 160 | rw->counter = -1; |
161 | result = 1; | 161 | result = 1; |
162 | } else { | 162 | } else { |
163 | /* Read-locked. Oh well. */ | 163 | /* Read-locked. Oh well. */ |
164 | __raw_spin_unlock(&rw->lock); | 164 | arch_spin_unlock(&rw->lock); |
165 | } | 165 | } |
166 | } | 166 | } |
167 | local_irq_restore(flags); | 167 | local_irq_restore(flags); |
@@ -173,7 +173,7 @@ static __inline__ int __raw_write_trylock(raw_rwlock_t *rw) | |||
173 | * read_can_lock - would read_trylock() succeed? | 173 | * read_can_lock - would read_trylock() succeed? |
174 | * @lock: the rwlock in question. | 174 | * @lock: the rwlock in question. |
175 | */ | 175 | */ |
176 | static __inline__ int __raw_read_can_lock(raw_rwlock_t *rw) | 176 | static __inline__ int arch_read_can_lock(arch_rwlock_t *rw) |
177 | { | 177 | { |
178 | return rw->counter >= 0; | 178 | return rw->counter >= 0; |
179 | } | 179 | } |
@@ -182,16 +182,16 @@ static __inline__ int __raw_read_can_lock(raw_rwlock_t *rw) | |||
182 | * write_can_lock - would write_trylock() succeed? | 182 | * write_can_lock - would write_trylock() succeed? |
183 | * @lock: the rwlock in question. | 183 | * @lock: the rwlock in question. |
184 | */ | 184 | */ |
185 | static __inline__ int __raw_write_can_lock(raw_rwlock_t *rw) | 185 | static __inline__ int arch_write_can_lock(arch_rwlock_t *rw) |
186 | { | 186 | { |
187 | return !rw->counter; | 187 | return !rw->counter; |
188 | } | 188 | } |
189 | 189 | ||
190 | #define __raw_read_lock_flags(lock, flags) __raw_read_lock(lock) | 190 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) |
191 | #define __raw_write_lock_flags(lock, flags) __raw_write_lock(lock) | 191 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) |
192 | 192 | ||
193 | #define _raw_spin_relax(lock) cpu_relax() | 193 | #define arch_spin_relax(lock) cpu_relax() |
194 | #define _raw_read_relax(lock) cpu_relax() | 194 | #define arch_read_relax(lock) cpu_relax() |
195 | #define _raw_write_relax(lock) cpu_relax() | 195 | #define arch_write_relax(lock) cpu_relax() |
196 | 196 | ||
197 | #endif /* __ASM_SPINLOCK_H */ | 197 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/arch/parisc/include/asm/spinlock_types.h b/arch/parisc/include/asm/spinlock_types.h index 3f72f47cf4b2..8c373aa28a86 100644 --- a/arch/parisc/include/asm/spinlock_types.h +++ b/arch/parisc/include/asm/spinlock_types.h | |||
@@ -4,18 +4,18 @@ | |||
4 | typedef struct { | 4 | typedef struct { |
5 | #ifdef CONFIG_PA20 | 5 | #ifdef CONFIG_PA20 |
6 | volatile unsigned int slock; | 6 | volatile unsigned int slock; |
7 | # define __RAW_SPIN_LOCK_UNLOCKED { 1 } | 7 | # define __ARCH_SPIN_LOCK_UNLOCKED { 1 } |
8 | #else | 8 | #else |
9 | volatile unsigned int lock[4]; | 9 | volatile unsigned int lock[4]; |
10 | # define __RAW_SPIN_LOCK_UNLOCKED { { 1, 1, 1, 1 } } | 10 | # define __ARCH_SPIN_LOCK_UNLOCKED { { 1, 1, 1, 1 } } |
11 | #endif | 11 | #endif |
12 | } raw_spinlock_t; | 12 | } arch_spinlock_t; |
13 | 13 | ||
14 | typedef struct { | 14 | typedef struct { |
15 | raw_spinlock_t lock; | 15 | arch_spinlock_t lock; |
16 | volatile int counter; | 16 | volatile int counter; |
17 | } raw_rwlock_t; | 17 | } arch_rwlock_t; |
18 | 18 | ||
19 | #define __RAW_RW_LOCK_UNLOCKED { __RAW_SPIN_LOCK_UNLOCKED, 0 } | 19 | #define __ARCH_RW_LOCK_UNLOCKED { __ARCH_SPIN_LOCK_UNLOCKED, 0 } |
20 | 20 | ||
21 | #endif | 21 | #endif |
diff --git a/arch/parisc/include/asm/system.h b/arch/parisc/include/asm/system.h index d91357bca5b4..4653c77bf9d1 100644 --- a/arch/parisc/include/asm/system.h +++ b/arch/parisc/include/asm/system.h | |||
@@ -160,7 +160,7 @@ static inline void set_eiem(unsigned long val) | |||
160 | ldcd). */ | 160 | ldcd). */ |
161 | 161 | ||
162 | #define __PA_LDCW_ALIGNMENT 4 | 162 | #define __PA_LDCW_ALIGNMENT 4 |
163 | #define __ldcw_align(a) ((volatile unsigned int *)a) | 163 | #define __ldcw_align(a) (&(a)->slock) |
164 | #define __LDCW "ldcw,co" | 164 | #define __LDCW "ldcw,co" |
165 | 165 | ||
166 | #endif /*!CONFIG_PA20*/ | 166 | #endif /*!CONFIG_PA20*/ |
diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h index 7cf799d70b4c..ff4cf9dab8d2 100644 --- a/arch/parisc/include/asm/uaccess.h +++ b/arch/parisc/include/asm/uaccess.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <asm/page.h> | 7 | #include <asm/page.h> |
8 | #include <asm/system.h> | 8 | #include <asm/system.h> |
9 | #include <asm/cache.h> | 9 | #include <asm/cache.h> |
10 | #include <asm/errno.h> | ||
10 | #include <asm-generic/uaccess-unaligned.h> | 11 | #include <asm-generic/uaccess-unaligned.h> |
11 | 12 | ||
12 | #define VERIFY_READ 0 | 13 | #define VERIFY_READ 0 |
@@ -234,13 +235,35 @@ extern long lstrnlen_user(const char __user *,long); | |||
234 | 235 | ||
235 | unsigned long copy_to_user(void __user *dst, const void *src, unsigned long len); | 236 | unsigned long copy_to_user(void __user *dst, const void *src, unsigned long len); |
236 | #define __copy_to_user copy_to_user | 237 | #define __copy_to_user copy_to_user |
237 | unsigned long copy_from_user(void *dst, const void __user *src, unsigned long len); | 238 | unsigned long __copy_from_user(void *dst, const void __user *src, unsigned long len); |
238 | #define __copy_from_user copy_from_user | ||
239 | unsigned long copy_in_user(void __user *dst, const void __user *src, unsigned long len); | 239 | unsigned long copy_in_user(void __user *dst, const void __user *src, unsigned long len); |
240 | #define __copy_in_user copy_in_user | 240 | #define __copy_in_user copy_in_user |
241 | #define __copy_to_user_inatomic __copy_to_user | 241 | #define __copy_to_user_inatomic __copy_to_user |
242 | #define __copy_from_user_inatomic __copy_from_user | 242 | #define __copy_from_user_inatomic __copy_from_user |
243 | 243 | ||
244 | extern void copy_from_user_overflow(void) | ||
245 | #ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS | ||
246 | __compiletime_error("copy_from_user() buffer size is not provably correct") | ||
247 | #else | ||
248 | __compiletime_warning("copy_from_user() buffer size is not provably correct") | ||
249 | #endif | ||
250 | ; | ||
251 | |||
252 | static inline unsigned long __must_check copy_from_user(void *to, | ||
253 | const void __user *from, | ||
254 | unsigned long n) | ||
255 | { | ||
256 | int sz = __compiletime_object_size(to); | ||
257 | int ret = -EFAULT; | ||
258 | |||
259 | if (likely(sz == -1 || !__builtin_constant_p(n) || sz >= n)) | ||
260 | ret = __copy_from_user(to, from, n); | ||
261 | else | ||
262 | copy_from_user_overflow(); | ||
263 | |||
264 | return ret; | ||
265 | } | ||
266 | |||
244 | struct pt_regs; | 267 | struct pt_regs; |
245 | int fixup_exception(struct pt_regs *regs); | 268 | int fixup_exception(struct pt_regs *regs); |
246 | 269 | ||
diff --git a/arch/parisc/include/asm/unistd.h b/arch/parisc/include/asm/unistd.h index cda158318c62..1ce7d2851d90 100644 --- a/arch/parisc/include/asm/unistd.h +++ b/arch/parisc/include/asm/unistd.h | |||
@@ -811,8 +811,10 @@ | |||
811 | #define __NR_pwritev (__NR_Linux + 316) | 811 | #define __NR_pwritev (__NR_Linux + 316) |
812 | #define __NR_rt_tgsigqueueinfo (__NR_Linux + 317) | 812 | #define __NR_rt_tgsigqueueinfo (__NR_Linux + 317) |
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) | ||
815 | #define __NR_accept4 (__NR_Linux + 320) | ||
814 | 816 | ||
815 | #define __NR_Linux_syscalls (__NR_perf_event_open + 1) | 817 | #define __NR_Linux_syscalls (__NR_accept4 + 1) |
816 | 818 | ||
817 | 819 | ||
818 | #define __IGNORE_select /* newselect */ | 820 | #define __IGNORE_select /* newselect */ |
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) | |||
68 | EXPORT_SYMBOL(flush_cache_all_local); | 68 | EXPORT_SYMBOL(flush_cache_all_local); |
69 | 69 | ||
70 | void | 70 | void |
71 | update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) | 71 | update_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 | ||
147 | static struct irq_chip cpu_interrupt_type = { | 147 | static 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 | */ |
257 | void pcibios_align_resource(void *data, struct resource *res, | 259 | resource_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(¤t->sighand->siglock); | 469 | spin_unlock_irq(¤t->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 | ||
63 | DEFINE_SPINLOCK(smp_lock); | ||
64 | |||
65 | volatile struct task_struct *smp_init_current_idle_task; | 62 | volatile 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 | ||
70 | static int parisc_max_cpus __cpuinitdata = 1; | 67 | static int parisc_max_cpus __cpuinitdata = 1; |
71 | 68 | ||
72 | DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED; | 69 | static DEFINE_PER_CPU(spinlock_t, ipi_lock); |
73 | 70 | ||
74 | enum ipi_message_type { | 71 | enum ipi_message_type { |
75 | IPI_NOP=0, | 72 | IPI_NOP=0, |
@@ -438,6 +435,11 @@ void __init smp_prepare_boot_cpu(void) | |||
438 | */ | 435 | */ |
439 | void __init smp_prepare_cpus(unsigned int max_cpus) | 436 | void __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 | ||
113 | static 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(¤t->mm->mmap_sem); | ||
128 | error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); | ||
129 | up_write(¤t->mm->mmap_sem); | ||
130 | |||
131 | if (file != NULL) | ||
132 | fput(file); | ||
133 | out: | ||
134 | return error; | ||
135 | } | ||
136 | |||
137 | asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len, | 113 | asmlinkage 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 | ||
146 | asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len, | 123 | asmlinkage 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 | |||
260 | long 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 | |||
95 | struct __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 | |||
105 | asmlinkage 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 | |||
164 | asmlinkage long sys32_sched_rr_get_interval(pid_t pid, | 87 | asmlinkage 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 | } |
251 | module_init(rtc_init); | 251 | module_init(rtc_init); |
252 | 252 | ||
253 | void __init time_init(void) | 253 | void 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 | |||
266 | void __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 | ||
447 | void handle_unaligned(struct pt_regs *regs) | 448 | void 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 | ||
119 | static 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 | |||
118 | static void | 125 | static void |
119 | unwind_table_sort(struct unwind_table_entry *start, | 126 | unwind_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 | ||
138 | struct unwind_table * | 133 | struct 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 | |||
416 | unsigned 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 | } | ||
diff --git a/arch/parisc/lib/bitops.c b/arch/parisc/lib/bitops.c index e3eb739fab19..353963d42059 100644 --- a/arch/parisc/lib/bitops.c +++ b/arch/parisc/lib/bitops.c | |||
@@ -12,8 +12,8 @@ | |||
12 | #include <asm/atomic.h> | 12 | #include <asm/atomic.h> |
13 | 13 | ||
14 | #ifdef CONFIG_SMP | 14 | #ifdef CONFIG_SMP |
15 | raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = { | 15 | arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = { |
16 | [0 ... (ATOMIC_HASH_SIZE-1)] = __RAW_SPIN_LOCK_UNLOCKED | 16 | [0 ... (ATOMIC_HASH_SIZE-1)] = __ARCH_SPIN_LOCK_UNLOCKED |
17 | }; | 17 | }; |
18 | #endif | 18 | #endif |
19 | 19 | ||
diff --git a/arch/parisc/lib/fixup.S b/arch/parisc/lib/fixup.S index d172d4245cdc..f8c45cc2947d 100644 --- a/arch/parisc/lib/fixup.S +++ b/arch/parisc/lib/fixup.S | |||
@@ -36,8 +36,8 @@ | |||
36 | #endif | 36 | #endif |
37 | /* t2 = &__per_cpu_offset[smp_processor_id()]; */ | 37 | /* t2 = &__per_cpu_offset[smp_processor_id()]; */ |
38 | LDREGX \t2(\t1),\t2 | 38 | LDREGX \t2(\t1),\t2 |
39 | addil LT%per_cpu__exception_data,%r27 | 39 | addil LT%exception_data,%r27 |
40 | LDREG RT%per_cpu__exception_data(%r1),\t1 | 40 | LDREG RT%exception_data(%r1),\t1 |
41 | /* t1 = &__get_cpu_var(exception_data) */ | 41 | /* t1 = &__get_cpu_var(exception_data) */ |
42 | add,l \t1,\t2,\t1 | 42 | add,l \t1,\t2,\t1 |
43 | /* t1 = t1->fault_ip */ | 43 | /* t1 = t1->fault_ip */ |
@@ -46,8 +46,8 @@ | |||
46 | #else | 46 | #else |
47 | .macro get_fault_ip t1 t2 | 47 | .macro get_fault_ip t1 t2 |
48 | /* t1 = &__get_cpu_var(exception_data) */ | 48 | /* t1 = &__get_cpu_var(exception_data) */ |
49 | addil LT%per_cpu__exception_data,%r27 | 49 | addil LT%exception_data,%r27 |
50 | LDREG RT%per_cpu__exception_data(%r1),\t2 | 50 | LDREG RT%exception_data(%r1),\t2 |
51 | /* t1 = t2->fault_ip */ | 51 | /* t1 = t2->fault_ip */ |
52 | LDREG EXCDATA_IP(\t2), \t1 | 52 | LDREG EXCDATA_IP(\t2), \t1 |
53 | .endm | 53 | .endm |
diff --git a/arch/parisc/lib/memcpy.c b/arch/parisc/lib/memcpy.c index abf41f4632a9..1dbca5c31b3c 100644 --- a/arch/parisc/lib/memcpy.c +++ b/arch/parisc/lib/memcpy.c | |||
@@ -475,7 +475,8 @@ unsigned long copy_to_user(void __user *dst, const void *src, unsigned long len) | |||
475 | return pa_memcpy((void __force *)dst, src, len); | 475 | return pa_memcpy((void __force *)dst, src, len); |
476 | } | 476 | } |
477 | 477 | ||
478 | unsigned long copy_from_user(void *dst, const void __user *src, unsigned long len) | 478 | EXPORT_SYMBOL(__copy_from_user); |
479 | unsigned long __copy_from_user(void *dst, const void __user *src, unsigned long len) | ||
479 | { | 480 | { |
480 | mtsp(get_user_space(), 1); | 481 | mtsp(get_user_space(), 1); |
481 | mtsp(get_kernel_space(), 2); | 482 | mtsp(get_kernel_space(), 2); |
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 13b6e3e59b99..f4f4d700833a 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
16 | #include <linux/bootmem.h> | 16 | #include <linux/bootmem.h> |
17 | #include <linux/gfp.h> | ||
17 | #include <linux/delay.h> | 18 | #include <linux/delay.h> |
18 | #include <linux/init.h> | 19 | #include <linux/init.h> |
19 | #include <linux/pci.h> /* for hppa_dma_ops and pcxl_dma_ops */ | 20 | #include <linux/pci.h> /* for hppa_dma_ops and pcxl_dma_ops */ |