xref: /openbmc/linux/arch/arm64/lib/clear_page.S (revision 50fdecb2)
1f27bb139SMarc Zyngier/*
2f27bb139SMarc Zyngier * Copyright (C) 2012 ARM Ltd.
3f27bb139SMarc Zyngier *
4f27bb139SMarc Zyngier * This program is free software; you can redistribute it and/or modify
5f27bb139SMarc Zyngier * it under the terms of the GNU General Public License version 2 as
6f27bb139SMarc Zyngier * published by the Free Software Foundation.
7f27bb139SMarc Zyngier *
8f27bb139SMarc Zyngier * This program is distributed in the hope that it will be useful,
9f27bb139SMarc Zyngier * but WITHOUT ANY WARRANTY; without even the implied warranty of
10f27bb139SMarc Zyngier * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11f27bb139SMarc Zyngier * GNU General Public License for more details.
12f27bb139SMarc Zyngier *
13f27bb139SMarc Zyngier * You should have received a copy of the GNU General Public License
14f27bb139SMarc Zyngier * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15f27bb139SMarc Zyngier */
16f27bb139SMarc Zyngier
17f27bb139SMarc Zyngier#include <linux/linkage.h>
18f27bb139SMarc Zyngier#include <linux/const.h>
19f27bb139SMarc Zyngier#include <asm/assembler.h>
20f27bb139SMarc Zyngier#include <asm/page.h>
21f27bb139SMarc Zyngier
22f27bb139SMarc Zyngier/*
23f27bb139SMarc Zyngier * Clear page @dest
24f27bb139SMarc Zyngier *
25f27bb139SMarc Zyngier * Parameters:
26f27bb139SMarc Zyngier *	x0 - dest
27f27bb139SMarc Zyngier */
28f27bb139SMarc ZyngierENTRY(clear_page)
29f27bb139SMarc Zyngier	mrs	x1, dczid_el0
30f27bb139SMarc Zyngier	and	w1, w1, #0xf
31f27bb139SMarc Zyngier	mov	x2, #4
32f27bb139SMarc Zyngier	lsl	x1, x2, x1
33f27bb139SMarc Zyngier
34f27bb139SMarc Zyngier1:	dc	zva, x0
35f27bb139SMarc Zyngier	add	x0, x0, x1
36f27bb139SMarc Zyngier	tst	x0, #(PAGE_SIZE - 1)
37f27bb139SMarc Zyngier	b.ne	1b
38f27bb139SMarc Zyngier	ret
39f27bb139SMarc ZyngierENDPROC(clear_page)
4050fdecb2SMark RutlandEXPORT_SYMBOL(clear_page)
41