xref: /linux/arch/arm64/lib/clear_page.S (revision 37744feebc086908fd89760650f458ab19071750)
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (C) 2012 ARM Ltd.
4 */
5
6#include <linux/linkage.h>
7#include <linux/const.h>
8#include <asm/assembler.h>
9#include <asm/page.h>
10
11/*
12 * Clear page @dest
13 *
14 * Parameters:
15 *	x0 - dest
16 */
17SYM_FUNC_START(clear_page)
18	mrs	x1, dczid_el0
19	and	w1, w1, #0xf
20	mov	x2, #4
21	lsl	x1, x2, x1
22
231:	dc	zva, x0
24	add	x0, x0, x1
25	tst	x0, #(PAGE_SIZE - 1)
26	b.ne	1b
27	ret
28SYM_FUNC_END(clear_page)
29EXPORT_SYMBOL(clear_page)
30