Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sh-for-linus' of git://github.com/pmundt/linux-sh

Pull SuperH fixes from Paul Mundt.

* tag 'sh-for-linus' of git://github.com/pmundt/linux-sh:
sh: Kill off additional asm-generic wrappers.
sh: Setup CROSS_COMPILE at the top
sh: Fix up link time defsym warnings.
sh: use the new generic strnlen_user() function
sh: switch to generic strncpy_from_user().
sh: Kill off last dead UBC header
serial: sh-sci: Make probe fail for ports that exceed the maximum count
serial: sh-sci: Fix probe error paths
clocksource: sh_tmu: Use clockevents_config_and_register().
clocksource: sh_tmu: Convert timer lock to raw spinlock.
clocksource: sh_mtu2: Convert timer lock to raw spinlock.
clocksource: sh_cmt: Convert timer lock to raw spinlock.
bug.h: need linux/kernel.h for TAINT_WARN.
sh: convert to kbuild asm-generic support.
sh64: Fix up fallout from generic init_task conversion.
sh: arch/sh/kernel/process.c needs asm/fpu.h for unlazy_fpu().

+153 -386
+2
arch/sh/Kconfig
··· 32 32 select GENERIC_SMP_IDLE_THREAD 33 33 select GENERIC_CLOCKEVENTS 34 34 select GENERIC_CMOS_UPDATE if SH_SH03 || SH_DREAMCAST 35 + select GENERIC_STRNCPY_FROM_USER 36 + select GENERIC_STRNLEN_USER 35 37 help 36 38 The SuperH is a RISC processor targeted for use in embedded systems 37 39 and consumer electronics; it was also used in the Sega Dreamcast
+8 -8
arch/sh/Makefile
··· 9 9 # License. See the file "COPYING" in the main directory of this archive 10 10 # for more details. 11 11 # 12 + ifneq ($(SUBARCH),$(ARCH)) 13 + ifeq ($(CROSS_COMPILE),) 14 + CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux- $(UTS_MACHINE)-linux-gnu- $(UTS_MACHINE)-unknown-linux-gnu-) 15 + endif 16 + endif 17 + 12 18 isa-y := any 13 19 isa-$(CONFIG_SH_DSP) := sh 14 20 isa-$(CONFIG_CPU_SH2) := sh2 ··· 112 106 KBUILD_DEFCONFIG := cayman_defconfig 113 107 endif 114 108 115 - ifneq ($(SUBARCH),$(ARCH)) 116 - ifeq ($(CROSS_COMPILE),) 117 - CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux- $(UTS_MACHINE)-linux-gnu- $(UTS_MACHINE)-unknown-linux-gnu-) 118 - endif 119 - endif 120 - 121 109 ifdef CONFIG_CPU_LITTLE_ENDIAN 122 110 ld-bfd := elf32-$(UTS_MACHINE)-linux 123 - LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' --oformat $(ld-bfd) 111 + LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd) 124 112 LDFLAGS += -EL 125 113 else 126 114 ld-bfd := elf32-$(UTS_MACHINE)big-linux 127 - LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' --oformat $(ld-bfd) 115 + LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd) 128 116 LDFLAGS += -EB 129 117 endif 130 118
+34
arch/sh/include/asm/Kbuild
··· 1 1 include include/asm-generic/Kbuild.asm 2 2 3 + generic-y += bitsperlong.h 4 + generic-y += cputime.h 5 + generic-y += current.h 6 + generic-y += delay.h 7 + generic-y += div64.h 8 + generic-y += emergency-restart.h 9 + generic-y += errno.h 10 + generic-y += fcntl.h 11 + generic-y += ioctl.h 12 + generic-y += ipcbuf.h 13 + generic-y += irq_regs.h 14 + generic-y += kvm_para.h 15 + generic-y += local.h 16 + generic-y += local64.h 17 + generic-y += param.h 18 + generic-y += parport.h 19 + generic-y += percpu.h 20 + generic-y += poll.h 21 + generic-y += mman.h 22 + generic-y += msgbuf.h 23 + generic-y += resource.h 24 + generic-y += scatterlist.h 25 + generic-y += sembuf.h 26 + generic-y += serial.h 27 + generic-y += shmbuf.h 28 + generic-y += siginfo.h 29 + generic-y += sizes.h 30 + generic-y += socket.h 31 + generic-y += statfs.h 32 + generic-y += termbits.h 33 + generic-y += termios.h 34 + generic-y += ucontext.h 35 + generic-y += xor.h 36 + 3 37 header-y += cachectl.h 4 38 header-y += cpu-features.h 5 39 header-y += hw_breakpoint.h
-1
arch/sh/include/asm/bitsperlong.h
··· 1 - #include <asm-generic/bitsperlong.h>
-6
arch/sh/include/asm/cputime.h
··· 1 - #ifndef __SH_CPUTIME_H 2 - #define __SH_CPUTIME_H 3 - 4 - #include <asm-generic/cputime.h> 5 - 6 - #endif /* __SH_CPUTIME_H */
-1
arch/sh/include/asm/current.h
··· 1 - #include <asm-generic/current.h>
-1
arch/sh/include/asm/delay.h
··· 1 - #include <asm-generic/delay.h>
-1
arch/sh/include/asm/div64.h
··· 1 - #include <asm-generic/div64.h>
-6
arch/sh/include/asm/emergency-restart.h
··· 1 - #ifndef _ASM_EMERGENCY_RESTART_H 2 - #define _ASM_EMERGENCY_RESTART_H 3 - 4 - #include <asm-generic/emergency-restart.h> 5 - 6 - #endif /* _ASM_EMERGENCY_RESTART_H */
-6
arch/sh/include/asm/errno.h
··· 1 - #ifndef __ASM_SH_ERRNO_H 2 - #define __ASM_SH_ERRNO_H 3 - 4 - #include <asm-generic/errno.h> 5 - 6 - #endif /* __ASM_SH_ERRNO_H */
-1
arch/sh/include/asm/fcntl.h
··· 1 - #include <asm-generic/fcntl.h>
-1
arch/sh/include/asm/ioctl.h
··· 1 - #include <asm-generic/ioctl.h>
-1
arch/sh/include/asm/ipcbuf.h
··· 1 - #include <asm-generic/ipcbuf.h>
-1
arch/sh/include/asm/irq_regs.h
··· 1 - #include <asm-generic/irq_regs.h>
-1
arch/sh/include/asm/kvm_para.h
··· 1 - #include <asm-generic/kvm_para.h>
-7
arch/sh/include/asm/local.h
··· 1 - #ifndef __ASM_SH_LOCAL_H 2 - #define __ASM_SH_LOCAL_H 3 - 4 - #include <asm-generic/local.h> 5 - 6 - #endif /* __ASM_SH_LOCAL_H */ 7 -
-1
arch/sh/include/asm/local64.h
··· 1 - #include <asm-generic/local64.h>
-1
arch/sh/include/asm/mman.h
··· 1 - #include <asm-generic/mman.h>
-1
arch/sh/include/asm/msgbuf.h
··· 1 - #include <asm-generic/msgbuf.h>
-1
arch/sh/include/asm/param.h
··· 1 - #include <asm-generic/param.h>
-1
arch/sh/include/asm/parport.h
··· 1 - #include <asm-generic/parport.h>
-6
arch/sh/include/asm/percpu.h
··· 1 - #ifndef __ARCH_SH_PERCPU 2 - #define __ARCH_SH_PERCPU 3 - 4 - #include <asm-generic/percpu.h> 5 - 6 - #endif /* __ARCH_SH_PERCPU */
-1
arch/sh/include/asm/poll.h
··· 1 - #include <asm-generic/poll.h>
-6
arch/sh/include/asm/resource.h
··· 1 - #ifndef __ASM_SH_RESOURCE_H 2 - #define __ASM_SH_RESOURCE_H 3 - 4 - #include <asm-generic/resource.h> 5 - 6 - #endif /* __ASM_SH_RESOURCE_H */
-6
arch/sh/include/asm/scatterlist.h
··· 1 - #ifndef __ASM_SH_SCATTERLIST_H 2 - #define __ASM_SH_SCATTERLIST_H 3 - 4 - #include <asm-generic/scatterlist.h> 5 - 6 - #endif /* __ASM_SH_SCATTERLIST_H */
-1
arch/sh/include/asm/sembuf.h
··· 1 - #include <asm-generic/sembuf.h>
-1
arch/sh/include/asm/serial.h
··· 1 - #include <asm-generic/serial.h>
-1
arch/sh/include/asm/shmbuf.h
··· 1 - #include <asm-generic/shmbuf.h>
-6
arch/sh/include/asm/siginfo.h
··· 1 - #ifndef __ASM_SH_SIGINFO_H 2 - #define __ASM_SH_SIGINFO_H 3 - 4 - #include <asm-generic/siginfo.h> 5 - 6 - #endif /* __ASM_SH_SIGINFO_H */
-1
arch/sh/include/asm/sizes.h
··· 1 - #include <asm-generic/sizes.h>
-1
arch/sh/include/asm/socket.h
··· 1 - #include <asm-generic/socket.h>
-6
arch/sh/include/asm/statfs.h
··· 1 - #ifndef __ASM_SH_STATFS_H 2 - #define __ASM_SH_STATFS_H 3 - 4 - #include <asm-generic/statfs.h> 5 - 6 - #endif /* __ASM_SH_STATFS_H */
-1
arch/sh/include/asm/termbits.h
··· 1 - #include <asm-generic/termbits.h>
-1
arch/sh/include/asm/termios.h
··· 1 - #include <asm-generic/termios.h>
+7 -68
arch/sh/include/asm/uaccess.h
··· 25 25 (__chk_user_ptr(addr), \ 26 26 __access_ok((unsigned long __force)(addr), (size))) 27 27 28 + #define user_addr_max() (current_thread_info()->addr_limit.seg) 29 + 28 30 /* 29 31 * Uh, these should become the main single-value transfer routines ... 30 32 * They automatically use the right size if we just have the right ··· 102 100 # include "uaccess_64.h" 103 101 #endif 104 102 103 + extern long strncpy_from_user(char *dest, const char __user *src, long count); 104 + 105 + extern __must_check long strlen_user(const char __user *str); 106 + extern __must_check long strnlen_user(const char __user *str, long n); 107 + 105 108 /* Generic arbitrary sized copy. */ 106 109 /* Return the number of bytes NOT copied */ 107 110 __kernel_size_t __copy_user(void *to, const void *from, __kernel_size_t n); ··· 144 137 __cl_size; \ 145 138 }) 146 139 147 - /** 148 - * strncpy_from_user: - Copy a NUL terminated string from userspace. 149 - * @dst: Destination address, in kernel space. This buffer must be at 150 - * least @count bytes long. 151 - * @src: Source address, in user space. 152 - * @count: Maximum number of bytes to copy, including the trailing NUL. 153 - * 154 - * Copies a NUL-terminated string from userspace to kernel space. 155 - * 156 - * On success, returns the length of the string (not including the trailing 157 - * NUL). 158 - * 159 - * If access to userspace fails, returns -EFAULT (some data may have been 160 - * copied). 161 - * 162 - * If @count is smaller than the length of the string, copies @count bytes 163 - * and returns @count. 164 - */ 165 - #define strncpy_from_user(dest,src,count) \ 166 - ({ \ 167 - unsigned long __sfu_src = (unsigned long)(src); \ 168 - int __sfu_count = (int)(count); \ 169 - long __sfu_res = -EFAULT; \ 170 - \ 171 - if (__access_ok(__sfu_src, __sfu_count)) \ 172 - __sfu_res = __strncpy_from_user((unsigned long)(dest), \ 173 - __sfu_src, __sfu_count); \ 174 - \ 175 - __sfu_res; \ 176 - }) 177 - 178 140 static inline unsigned long 179 141 copy_from_user(void *to, const void __user *from, unsigned long n) 180 142 { ··· 167 191 168 192 return __copy_size; 169 193 } 170 - 171 - /** 172 - * strnlen_user: - Get the size of a string in user space. 173 - * @s: The string to measure. 174 - * @n: The maximum valid length 175 - * 176 - * Context: User context only. This function may sleep. 177 - * 178 - * Get the size of a NUL-terminated string in user space. 179 - * 180 - * Returns the size of the string INCLUDING the terminating NUL. 181 - * On exception, returns 0. 182 - * If the string is too long, returns a value greater than @n. 183 - */ 184 - static inline long strnlen_user(const char __user *s, long n) 185 - { 186 - if (!__addr_ok(s)) 187 - return 0; 188 - else 189 - return __strnlen_user(s, n); 190 - } 191 - 192 - /** 193 - * strlen_user: - Get the size of a string in user space. 194 - * @str: The string to measure. 195 - * 196 - * Context: User context only. This function may sleep. 197 - * 198 - * Get the size of a NUL-terminated string in user space. 199 - * 200 - * Returns the size of the string INCLUDING the terminating NUL. 201 - * On exception, returns 0. 202 - * 203 - * If there is a limit on the length of a valid string, you may wish to 204 - * consider using strnlen_user() instead. 205 - */ 206 - #define strlen_user(str) strnlen_user(str, ~0UL >> 1) 207 194 208 195 /* 209 196 * The exception table consists of pairs of addresses: the first is the
-75
arch/sh/include/asm/uaccess_32.h
··· 170 170 171 171 extern void __put_user_unknown(void); 172 172 173 - static inline int 174 - __strncpy_from_user(unsigned long __dest, unsigned long __user __src, int __count) 175 - { 176 - __kernel_size_t res; 177 - unsigned long __dummy, _d, _s, _c; 178 - 179 - __asm__ __volatile__( 180 - "9:\n" 181 - "mov.b @%2+, %1\n\t" 182 - "cmp/eq #0, %1\n\t" 183 - "bt/s 2f\n" 184 - "1:\n" 185 - "mov.b %1, @%3\n\t" 186 - "dt %4\n\t" 187 - "bf/s 9b\n\t" 188 - " add #1, %3\n\t" 189 - "2:\n\t" 190 - "sub %4, %0\n" 191 - "3:\n" 192 - ".section .fixup,\"ax\"\n" 193 - "4:\n\t" 194 - "mov.l 5f, %1\n\t" 195 - "jmp @%1\n\t" 196 - " mov %9, %0\n\t" 197 - ".balign 4\n" 198 - "5: .long 3b\n" 199 - ".previous\n" 200 - ".section __ex_table,\"a\"\n" 201 - " .balign 4\n" 202 - " .long 9b,4b\n" 203 - ".previous" 204 - : "=r" (res), "=&z" (__dummy), "=r" (_s), "=r" (_d), "=r"(_c) 205 - : "0" (__count), "2" (__src), "3" (__dest), "4" (__count), 206 - "i" (-EFAULT) 207 - : "memory", "t"); 208 - 209 - return res; 210 - } 211 - 212 - /* 213 - * Return the size of a string (including the ending 0 even when we have 214 - * exceeded the maximum string length). 215 - */ 216 - static inline long __strnlen_user(const char __user *__s, long __n) 217 - { 218 - unsigned long res; 219 - unsigned long __dummy; 220 - 221 - __asm__ __volatile__( 222 - "1:\t" 223 - "mov.b @(%0,%3), %1\n\t" 224 - "cmp/eq %4, %0\n\t" 225 - "bt/s 2f\n\t" 226 - " add #1, %0\n\t" 227 - "tst %1, %1\n\t" 228 - "bf 1b\n\t" 229 - "2:\n" 230 - ".section .fixup,\"ax\"\n" 231 - "3:\n\t" 232 - "mov.l 4f, %1\n\t" 233 - "jmp @%1\n\t" 234 - " mov #0, %0\n" 235 - ".balign 4\n" 236 - "4: .long 2b\n" 237 - ".previous\n" 238 - ".section __ex_table,\"a\"\n" 239 - " .balign 4\n" 240 - " .long 1b,3b\n" 241 - ".previous" 242 - : "=z" (res), "=&r" (__dummy) 243 - : "0" (0), "r" (__s), "r" (__n) 244 - : "t"); 245 - return res; 246 - } 247 - 248 173 #endif /* __ASM_SH_UACCESS_32_H */
-4
arch/sh/include/asm/uaccess_64.h
··· 84 84 extern long __put_user_asm_q(void *, long); 85 85 extern void __put_user_unknown(void); 86 86 87 - extern long __strnlen_user(const char *__s, long __n); 88 - extern int __strncpy_from_user(unsigned long __dest, 89 - unsigned long __user __src, int __count); 90 - 91 87 #endif /* __ASM_SH_UACCESS_64_H */
-1
arch/sh/include/asm/ucontext.h
··· 1 - #include <asm-generic/ucontext.h>
+53
arch/sh/include/asm/word-at-a-time.h
··· 1 + #ifndef __ASM_SH_WORD_AT_A_TIME_H 2 + #define __ASM_SH_WORD_AT_A_TIME_H 3 + 4 + #ifdef CONFIG_CPU_BIG_ENDIAN 5 + # include <asm-generic/word-at-a-time.h> 6 + #else 7 + /* 8 + * Little-endian version cribbed from x86. 9 + */ 10 + struct word_at_a_time { 11 + const unsigned long one_bits, high_bits; 12 + }; 13 + 14 + #define WORD_AT_A_TIME_CONSTANTS { REPEAT_BYTE(0x01), REPEAT_BYTE(0x80) } 15 + 16 + /* Carl Chatfield / Jan Achrenius G+ version for 32-bit */ 17 + static inline long count_masked_bytes(long mask) 18 + { 19 + /* (000000 0000ff 00ffff ffffff) -> ( 1 1 2 3 ) */ 20 + long a = (0x0ff0001+mask) >> 23; 21 + /* Fix the 1 for 00 case */ 22 + return a & mask; 23 + } 24 + 25 + /* Return nonzero if it has a zero */ 26 + static inline unsigned long has_zero(unsigned long a, unsigned long *bits, const struct word_at_a_time *c) 27 + { 28 + unsigned long mask = ((a - c->one_bits) & ~a) & c->high_bits; 29 + *bits = mask; 30 + return mask; 31 + } 32 + 33 + static inline unsigned long prep_zero_mask(unsigned long a, unsigned long bits, const struct word_at_a_time *c) 34 + { 35 + return bits; 36 + } 37 + 38 + static inline unsigned long create_zero_mask(unsigned long bits) 39 + { 40 + bits = (bits - 1) & ~bits; 41 + return bits >> 7; 42 + } 43 + 44 + /* The mask we created is directly usable as a bytemask */ 45 + #define zero_bytemask(mask) (mask) 46 + 47 + static inline unsigned long find_zero(unsigned long mask) 48 + { 49 + return count_masked_bytes(mask); 50 + } 51 + #endif 52 + 53 + #endif
-1
arch/sh/include/asm/xor.h
··· 1 - #include <asm-generic/xor.h>
-28
arch/sh/include/cpu-sh2a/cpu/ubc.h
··· 1 - /* 2 - * SH-2A UBC definitions 3 - * 4 - * Copyright (C) 2008 Kieran Bingham 5 - * 6 - * This file is subject to the terms and conditions of the GNU General Public 7 - * License. See the file "COPYING" in the main directory of this archive 8 - * for more details. 9 - */ 10 - 11 - #ifndef __ASM_CPU_SH2A_UBC_H 12 - #define __ASM_CPU_SH2A_UBC_H 13 - 14 - #define UBC_BARA 0xfffc0400 15 - #define UBC_BAMRA 0xfffc0404 16 - #define UBC_BBRA 0xfffc04a0 /* 16 bit access */ 17 - #define UBC_BDRA 0xfffc0408 18 - #define UBC_BDMRA 0xfffc040c 19 - 20 - #define UBC_BARB 0xfffc0410 21 - #define UBC_BAMRB 0xfffc0414 22 - #define UBC_BBRB 0xfffc04b0 /* 16 bit access */ 23 - #define UBC_BDRB 0xfffc0418 24 - #define UBC_BDMRB 0xfffc041c 25 - 26 - #define UBC_BRCR 0xfffc04c0 27 - 28 - #endif /* __ASM_CPU_SH2A_UBC_H */
-82
arch/sh/kernel/cpu/sh5/entry.S
··· 1569 1569 #endif /* CONFIG_MMU */ 1570 1570 1571 1571 /* 1572 - * int __strncpy_from_user(unsigned long __dest, unsigned long __src, 1573 - * int __count) 1574 - * 1575 - * Inputs: 1576 - * (r2) target address 1577 - * (r3) source address 1578 - * (r4) maximum size in bytes 1579 - * 1580 - * Ouputs: 1581 - * (*r2) copied data 1582 - * (r2) -EFAULT (in case of faulting) 1583 - * copied data (otherwise) 1584 - */ 1585 - .global __strncpy_from_user 1586 - __strncpy_from_user: 1587 - pta ___strncpy_from_user1, tr0 1588 - pta ___strncpy_from_user_done, tr1 1589 - or r4, ZERO, r5 /* r5 = original count */ 1590 - beq/u r4, r63, tr1 /* early exit if r4==0 */ 1591 - movi -(EFAULT), r6 /* r6 = reply, no real fixup */ 1592 - or ZERO, ZERO, r7 /* r7 = data, clear top byte of data */ 1593 - 1594 - ___strncpy_from_user1: 1595 - ld.b r3, 0, r7 /* Fault address: only in reading */ 1596 - st.b r2, 0, r7 1597 - addi r2, 1, r2 1598 - addi r3, 1, r3 1599 - beq/u ZERO, r7, tr1 1600 - addi r4, -1, r4 /* return real number of copied bytes */ 1601 - bne/l ZERO, r4, tr0 1602 - 1603 - ___strncpy_from_user_done: 1604 - sub r5, r4, r6 /* If done, return copied */ 1605 - 1606 - ___strncpy_from_user_exit: 1607 - or r6, ZERO, r2 1608 - ptabs LINK, tr0 1609 - blink tr0, ZERO 1610 - 1611 - /* 1612 - * extern long __strnlen_user(const char *__s, long __n) 1613 - * 1614 - * Inputs: 1615 - * (r2) source address 1616 - * (r3) source size in bytes 1617 - * 1618 - * Ouputs: 1619 - * (r2) -EFAULT (in case of faulting) 1620 - * string length (otherwise) 1621 - */ 1622 - .global __strnlen_user 1623 - __strnlen_user: 1624 - pta ___strnlen_user_set_reply, tr0 1625 - pta ___strnlen_user1, tr1 1626 - or ZERO, ZERO, r5 /* r5 = counter */ 1627 - movi -(EFAULT), r6 /* r6 = reply, no real fixup */ 1628 - or ZERO, ZERO, r7 /* r7 = data, clear top byte of data */ 1629 - beq r3, ZERO, tr0 1630 - 1631 - ___strnlen_user1: 1632 - ldx.b r2, r5, r7 /* Fault address: only in reading */ 1633 - addi r3, -1, r3 /* No real fixup */ 1634 - addi r5, 1, r5 1635 - beq r3, ZERO, tr0 1636 - bne r7, ZERO, tr1 1637 - ! The line below used to be active. This meant led to a junk byte lying between each pair 1638 - ! of entries in the argv & envp structures in memory. Whilst the program saw the right data 1639 - ! via the argv and envp arguments to main, it meant the 'flat' representation visible through 1640 - ! /proc/$pid/cmdline was corrupt, causing trouble with ps, for example. 1641 - ! addi r5, 1, r5 /* Include '\0' */ 1642 - 1643 - ___strnlen_user_set_reply: 1644 - or r5, ZERO, r6 /* If done, return counter */ 1645 - 1646 - ___strnlen_user_exit: 1647 - or r6, ZERO, r2 1648 - ptabs LINK, tr0 1649 - blink tr0, ZERO 1650 - 1651 - /* 1652 1572 * extern long __get_user_asm_?(void *val, long addr) 1653 1573 * 1654 1574 * Inputs: ··· 1902 1982 .long ___copy_user2, ___copy_user_exit 1903 1983 .long ___clear_user1, ___clear_user_exit 1904 1984 #endif 1905 - .long ___strncpy_from_user1, ___strncpy_from_user_exit 1906 - .long ___strnlen_user1, ___strnlen_user_exit 1907 1985 .long ___get_user_asm_b1, ___get_user_asm_b_exit 1908 1986 .long ___get_user_asm_w1, ___get_user_asm_w_exit 1909 1987 .long ___get_user_asm_l1, ___get_user_asm_l_exit
+1
arch/sh/kernel/process.c
··· 4 4 #include <linux/sched.h> 5 5 #include <linux/export.h> 6 6 #include <linux/stackprotector.h> 7 + #include <asm/fpu.h> 7 8 8 9 struct kmem_cache *task_xstate_cachep = NULL; 9 10 unsigned int xstate_size;
+1
arch/sh/kernel/process_64.c
··· 33 33 #include <asm/switch_to.h> 34 34 35 35 struct task_struct *last_task_used_math = NULL; 36 + struct pt_regs fake_swapper_regs = { 0, }; 36 37 37 38 void show_regs(struct pt_regs *regs) 38 39 {
-2
arch/sh/kernel/sh_ksyms_64.c
··· 32 32 EXPORT_SYMBOL(__get_user_asm_w); 33 33 EXPORT_SYMBOL(__get_user_asm_l); 34 34 EXPORT_SYMBOL(__get_user_asm_q); 35 - EXPORT_SYMBOL(__strnlen_user); 36 - EXPORT_SYMBOL(__strncpy_from_user); 37 35 EXPORT_SYMBOL(__clear_user); 38 36 EXPORT_SYMBOL(copy_page); 39 37 EXPORT_SYMBOL(__copy_user);
+13 -13
drivers/clocksource/sh_cmt.c
··· 48 48 unsigned long next_match_value; 49 49 unsigned long max_match_value; 50 50 unsigned long rate; 51 - spinlock_t lock; 51 + raw_spinlock_t lock; 52 52 struct clock_event_device ced; 53 53 struct clocksource cs; 54 54 unsigned long total_cycles; 55 55 }; 56 56 57 - static DEFINE_SPINLOCK(sh_cmt_lock); 57 + static DEFINE_RAW_SPINLOCK(sh_cmt_lock); 58 58 59 59 #define CMSTR -1 /* shared register */ 60 60 #define CMCSR 0 /* channel register */ ··· 139 139 unsigned long flags, value; 140 140 141 141 /* start stop register shared by multiple timer channels */ 142 - spin_lock_irqsave(&sh_cmt_lock, flags); 142 + raw_spin_lock_irqsave(&sh_cmt_lock, flags); 143 143 value = sh_cmt_read(p, CMSTR); 144 144 145 145 if (start) ··· 148 148 value &= ~(1 << cfg->timer_bit); 149 149 150 150 sh_cmt_write(p, CMSTR, value); 151 - spin_unlock_irqrestore(&sh_cmt_lock, flags); 151 + raw_spin_unlock_irqrestore(&sh_cmt_lock, flags); 152 152 } 153 153 154 154 static int sh_cmt_enable(struct sh_cmt_priv *p, unsigned long *rate) ··· 328 328 { 329 329 unsigned long flags; 330 330 331 - spin_lock_irqsave(&p->lock, flags); 331 + raw_spin_lock_irqsave(&p->lock, flags); 332 332 __sh_cmt_set_next(p, delta); 333 - spin_unlock_irqrestore(&p->lock, flags); 333 + raw_spin_unlock_irqrestore(&p->lock, flags); 334 334 } 335 335 336 336 static irqreturn_t sh_cmt_interrupt(int irq, void *dev_id) ··· 385 385 int ret = 0; 386 386 unsigned long flags; 387 387 388 - spin_lock_irqsave(&p->lock, flags); 388 + raw_spin_lock_irqsave(&p->lock, flags); 389 389 390 390 if (!(p->flags & (FLAG_CLOCKEVENT | FLAG_CLOCKSOURCE))) 391 391 ret = sh_cmt_enable(p, &p->rate); ··· 398 398 if ((flag == FLAG_CLOCKSOURCE) && (!(p->flags & FLAG_CLOCKEVENT))) 399 399 __sh_cmt_set_next(p, p->max_match_value); 400 400 out: 401 - spin_unlock_irqrestore(&p->lock, flags); 401 + raw_spin_unlock_irqrestore(&p->lock, flags); 402 402 403 403 return ret; 404 404 } ··· 408 408 unsigned long flags; 409 409 unsigned long f; 410 410 411 - spin_lock_irqsave(&p->lock, flags); 411 + raw_spin_lock_irqsave(&p->lock, flags); 412 412 413 413 f = p->flags & (FLAG_CLOCKEVENT | FLAG_CLOCKSOURCE); 414 414 p->flags &= ~flag; ··· 420 420 if ((flag == FLAG_CLOCKEVENT) && (p->flags & FLAG_CLOCKSOURCE)) 421 421 __sh_cmt_set_next(p, p->max_match_value); 422 422 423 - spin_unlock_irqrestore(&p->lock, flags); 423 + raw_spin_unlock_irqrestore(&p->lock, flags); 424 424 } 425 425 426 426 static struct sh_cmt_priv *cs_to_sh_cmt(struct clocksource *cs) ··· 435 435 unsigned long value; 436 436 int has_wrapped; 437 437 438 - spin_lock_irqsave(&p->lock, flags); 438 + raw_spin_lock_irqsave(&p->lock, flags); 439 439 value = p->total_cycles; 440 440 raw = sh_cmt_get_counter(p, &has_wrapped); 441 441 442 442 if (unlikely(has_wrapped)) 443 443 raw += p->match_value + 1; 444 - spin_unlock_irqrestore(&p->lock, flags); 444 + raw_spin_unlock_irqrestore(&p->lock, flags); 445 445 446 446 return value + raw; 447 447 } ··· 591 591 p->max_match_value = (1 << p->width) - 1; 592 592 593 593 p->match_value = p->max_match_value; 594 - spin_lock_init(&p->lock); 594 + raw_spin_lock_init(&p->lock); 595 595 596 596 if (clockevent_rating) 597 597 sh_cmt_register_clockevent(p, name, clockevent_rating);
+3 -3
drivers/clocksource/sh_mtu2.c
··· 43 43 struct clock_event_device ced; 44 44 }; 45 45 46 - static DEFINE_SPINLOCK(sh_mtu2_lock); 46 + static DEFINE_RAW_SPINLOCK(sh_mtu2_lock); 47 47 48 48 #define TSTR -1 /* shared register */ 49 49 #define TCR 0 /* channel register */ ··· 107 107 unsigned long flags, value; 108 108 109 109 /* start stop register shared by multiple timer channels */ 110 - spin_lock_irqsave(&sh_mtu2_lock, flags); 110 + raw_spin_lock_irqsave(&sh_mtu2_lock, flags); 111 111 value = sh_mtu2_read(p, TSTR); 112 112 113 113 if (start) ··· 116 116 value &= ~(1 << cfg->timer_bit); 117 117 118 118 sh_mtu2_write(p, TSTR, value); 119 - spin_unlock_irqrestore(&sh_mtu2_lock, flags); 119 + raw_spin_unlock_irqrestore(&sh_mtu2_lock, flags); 120 120 } 121 121 122 122 static int sh_mtu2_enable(struct sh_mtu2_priv *p)
+6 -10
drivers/clocksource/sh_tmu.c
··· 45 45 struct clocksource cs; 46 46 }; 47 47 48 - static DEFINE_SPINLOCK(sh_tmu_lock); 48 + static DEFINE_RAW_SPINLOCK(sh_tmu_lock); 49 49 50 50 #define TSTR -1 /* shared register */ 51 51 #define TCOR 0 /* channel register */ ··· 95 95 unsigned long flags, value; 96 96 97 97 /* start stop register shared by multiple timer channels */ 98 - spin_lock_irqsave(&sh_tmu_lock, flags); 98 + raw_spin_lock_irqsave(&sh_tmu_lock, flags); 99 99 value = sh_tmu_read(p, TSTR); 100 100 101 101 if (start) ··· 104 104 value &= ~(1 << cfg->timer_bit); 105 105 106 106 sh_tmu_write(p, TSTR, value); 107 - spin_unlock_irqrestore(&sh_tmu_lock, flags); 107 + raw_spin_unlock_irqrestore(&sh_tmu_lock, flags); 108 108 } 109 109 110 110 static int sh_tmu_enable(struct sh_tmu_priv *p) ··· 245 245 246 246 sh_tmu_enable(p); 247 247 248 - /* TODO: calculate good shift from rate and counter bit width */ 249 - 250 - ced->shift = 32; 251 - ced->mult = div_sc(p->rate, NSEC_PER_SEC, ced->shift); 252 - ced->max_delta_ns = clockevent_delta2ns(0xffffffff, ced); 253 - ced->min_delta_ns = 5000; 248 + clockevents_config(ced, p->rate); 254 249 255 250 if (periodic) { 256 251 p->periodic = (p->rate + HZ/2) / HZ; ··· 318 323 ced->set_mode = sh_tmu_clock_event_mode; 319 324 320 325 dev_info(&p->pdev->dev, "used for clock events\n"); 321 - clockevents_register_device(ced); 326 + 327 + clockevents_config_and_register(ced, 1, 0x300, 0xffffffff); 322 328 323 329 ret = setup_irq(p->irqaction.irq, &p->irqaction); 324 330 if (ret) {
+24 -14
drivers/tty/serial/sh-sci.c
··· 2179 2179 return 0; 2180 2180 } 2181 2181 2182 + static void sci_cleanup_single(struct sci_port *port) 2183 + { 2184 + sci_free_gpios(port); 2185 + 2186 + clk_put(port->iclk); 2187 + clk_put(port->fclk); 2188 + 2189 + pm_runtime_disable(port->port.dev); 2190 + } 2191 + 2182 2192 #ifdef CONFIG_SERIAL_SH_SCI_CONSOLE 2183 2193 static void serial_console_putchar(struct uart_port *port, int ch) 2184 2194 { ··· 2370 2360 cpufreq_unregister_notifier(&port->freq_transition, 2371 2361 CPUFREQ_TRANSITION_NOTIFIER); 2372 2362 2373 - sci_free_gpios(port); 2374 - 2375 2363 uart_remove_one_port(&sci_uart_driver, &port->port); 2376 2364 2377 - clk_put(port->iclk); 2378 - clk_put(port->fclk); 2365 + sci_cleanup_single(port); 2379 2366 2380 - pm_runtime_disable(&dev->dev); 2381 2367 return 0; 2382 2368 } 2383 2369 ··· 2391 2385 index+1, SCI_NPORTS); 2392 2386 dev_notice(&dev->dev, "Consider bumping " 2393 2387 "CONFIG_SERIAL_SH_SCI_NR_UARTS!\n"); 2394 - return 0; 2388 + return -EINVAL; 2395 2389 } 2396 2390 2397 2391 ret = sci_init_single(dev, sciport, index, p); 2398 2392 if (ret) 2399 2393 return ret; 2400 2394 2401 - return uart_add_one_port(&sci_uart_driver, &sciport->port); 2395 + ret = uart_add_one_port(&sci_uart_driver, &sciport->port); 2396 + if (ret) { 2397 + sci_cleanup_single(sciport); 2398 + return ret; 2399 + } 2400 + 2401 + return 0; 2402 2402 } 2403 2403 2404 2404 static int __devinit sci_probe(struct platform_device *dev) ··· 2425 2413 2426 2414 ret = sci_probe_single(dev, dev->id, p, sp); 2427 2415 if (ret) 2428 - goto err_unreg; 2416 + return ret; 2429 2417 2430 2418 sp->freq_transition.notifier_call = sci_notifier; 2431 2419 2432 2420 ret = cpufreq_register_notifier(&sp->freq_transition, 2433 2421 CPUFREQ_TRANSITION_NOTIFIER); 2434 - if (unlikely(ret < 0)) 2435 - goto err_unreg; 2422 + if (unlikely(ret < 0)) { 2423 + sci_cleanup_single(sp); 2424 + return ret; 2425 + } 2436 2426 2437 2427 #ifdef CONFIG_SH_STANDARD_BIOS 2438 2428 sh_bios_gdb_detach(); 2439 2429 #endif 2440 2430 2441 2431 return 0; 2442 - 2443 - err_unreg: 2444 - sci_remove(dev); 2445 - return ret; 2446 2432 } 2447 2433 2448 2434 static int sci_suspend(struct device *dev)
+1
include/asm-generic/bug.h
··· 2 2 #define _ASM_GENERIC_BUG_H 3 3 4 4 #include <linux/compiler.h> 5 + #include <linux/kernel.h> 5 6 6 7 #ifdef CONFIG_BUG 7 8