2 * String handling functions for PowerPC.
4 * Copyright (C) 1996 Paul Mackerras.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
11 #include <asm/processor.h>
12 #include <asm/errno.h>
13 #include <asm/ppc_asm.h>
14 #include <asm/export.h>
15 #include <asm/cache.h>
19 /* This clears out any unused part of the destination buffer,
20 just as the libc version does. -- paulus */
27 .balign IFETCH_ALIGN_BYTES
31 bdnzf 2,1b /* dec ctr, branch if ctr != 0 && !cr0.eq */
32 bnelr /* if we didn't hit a null char, we're done */
34 PPC_LCMPI 0,r5,0 /* any space left in destination buffer? */
35 beqlr /* we know r0 == 0 here */
36 2: stbu r0,1(r6) /* clear it out if so */
39 EXPORT_SYMBOL(strncpy)
47 .balign IFETCH_ALIGN_BYTES
57 EXPORT_SYMBOL(strncmp)
81 .balign IFETCH_ALIGN_BYTES
91 _GLOBAL(__arch_clear_user)
97 /* clear a single word */
100 /* clear word sized chunks */
110 /* clear byte sized chunks */
131 EXPORT_SYMBOL(__arch_clear_user)