aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh5
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-06-04 02:46:05 -0400
committerPaul Mundt <lethal@linux-sh.org>2012-06-12 21:28:37 -0400
commitcba8df4be3bdf10c86a26c458c5fc2ca978eeb2c (patch)
tree5dd9f6c93efc0588b813febe7d24178fa43d3d8b /arch/sh/kernel/cpu/sh5
parent0e100e11bd73be4e28e457cf5ad49a6892d5d1fe (diff)
sh: use the new generic strnlen_user() function
This discards both the _32 and _64 versions in favour of the consolidated generic one. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh5')
-rw-r--r--arch/sh/kernel/cpu/sh5/entry.S41
1 files changed, 0 insertions, 41 deletions
diff --git a/arch/sh/kernel/cpu/sh5/entry.S b/arch/sh/kernel/cpu/sh5/entry.S
index b7b3f63299b0..b7cf6a547f11 100644
--- a/arch/sh/kernel/cpu/sh5/entry.S
+++ b/arch/sh/kernel/cpu/sh5/entry.S
@@ -1569,46 +1569,6 @@ ___clear_user_exit:
1569#endif /* CONFIG_MMU */ 1569#endif /* CONFIG_MMU */
1570 1570
1571/* 1571/*
1572 * extern long __strnlen_user(const char *__s, long __n)
1573 *
1574 * Inputs:
1575 * (r2) source address
1576 * (r3) source size in bytes
1577 *
1578 * Ouputs:
1579 * (r2) -EFAULT (in case of faulting)
1580 * string length (otherwise)
1581 */
1582 .global __strnlen_user
1583__strnlen_user:
1584 pta ___strnlen_user_set_reply, tr0
1585 pta ___strnlen_user1, tr1
1586 or ZERO, ZERO, r5 /* r5 = counter */
1587 movi -(EFAULT), r6 /* r6 = reply, no real fixup */
1588 or ZERO, ZERO, r7 /* r7 = data, clear top byte of data */
1589 beq r3, ZERO, tr0
1590
1591___strnlen_user1:
1592 ldx.b r2, r5, r7 /* Fault address: only in reading */
1593 addi r3, -1, r3 /* No real fixup */
1594 addi r5, 1, r5
1595 beq r3, ZERO, tr0
1596 bne r7, ZERO, tr1
1597! The line below used to be active. This meant led to a junk byte lying between each pair
1598! of entries in the argv & envp structures in memory. Whilst the program saw the right data
1599! via the argv and envp arguments to main, it meant the 'flat' representation visible through
1600! /proc/$pid/cmdline was corrupt, causing trouble with ps, for example.
1601! addi r5, 1, r5 /* Include '\0' */
1602
1603___strnlen_user_set_reply:
1604 or r5, ZERO, r6 /* If done, return counter */
1605
1606___strnlen_user_exit:
1607 or r6, ZERO, r2
1608 ptabs LINK, tr0
1609 blink tr0, ZERO
1610
1611/*
1612 * extern long __get_user_asm_?(void *val, long addr) 1572 * extern long __get_user_asm_?(void *val, long addr)
1613 * 1573 *
1614 * Inputs: 1574 * Inputs:
@@ -1942,7 +1902,6 @@ asm_uaccess_start:
1942 .long ___copy_user2, ___copy_user_exit 1902 .long ___copy_user2, ___copy_user_exit
1943 .long ___clear_user1, ___clear_user_exit 1903 .long ___clear_user1, ___clear_user_exit
1944#endif 1904#endif
1945 .long ___strnlen_user1, ___strnlen_user_exit
1946 .long ___get_user_asm_b1, ___get_user_asm_b_exit 1905 .long ___get_user_asm_b1, ___get_user_asm_b_exit
1947 .long ___get_user_asm_w1, ___get_user_asm_w_exit 1906 .long ___get_user_asm_w1, ___get_user_asm_w_exit
1948 .long ___get_user_asm_l1, ___get_user_asm_l_exit 1907 .long ___get_user_asm_l1, ___get_user_asm_l_exit