1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * String handling functions for PowerPC.
5 * Copyright (C) 1996 Paul Mackerras.
7 #include <linux/export.h>
8 #include <asm/ppc_asm.h>
13 /* This clears out any unused part of the destination buffer,
14 just as the libc version does. -- paulus */
21 .balign IFETCH_ALIGN_BYTES
25 bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */
26 bnelr /* if we didn't hit a null char, we're done */
28 PPC_LCMPI 0,r5,0 /* any space left in destination buffer? */
29 beqlr /* we know r0 == 0 here */
30 2: stbu r0,1(r6) /* clear it out if so */
33 EXPORT_SYMBOL(strncpy)
41 .balign IFETCH_ALIGN_BYTES
51 EXPORT_SYMBOL(strncmp)
58 .balign IFETCH_ALIGN_BYTES