1 /* SPDX-License-Identifier: GPL-2.0 */
4 * String handling functions for PowerPC32
6 * Copyright (C) 1996 Paul Mackerras.
10 #include <asm/ppc_asm.h>
11 #include <asm/export.h>
12 #include <asm/cache.h>
16 CACHELINE_BYTES = L1_CACHE_BYTES
17 LG_CACHELINE_BYTES = L1_CACHE_SHIFT
18 CACHELINE_MASK = (L1_CACHE_BYTES-1)
20 _GLOBAL(__arch_clear_user)
22 * Use dcbz on the complete cache lines in the destination
23 * to set them to zero. This requires that the destination
37 clrlwi r7, r6, 32 - LG_CACHELINE_BYTES
39 srwi r9, r8, LG_CACHELINE_BYTES
40 addic. r9, r9, -1 /* total number of complete cachelines */
42 xori r0, r7, CACHELINE_MASK & ~3
51 addi r6, r6, CACHELINE_BYTES
53 clrlwi r11, r8, 32 - LG_CACHELINE_BYTES
90 EXPORT_SYMBOL(__arch_clear_user)