David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2012 ARM Ltd. |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 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 | */ |
| 17 | ENTRY(clear_page) |
| 18 | mrs x1, dczid_el0 |
| 19 | and w1, w1, #0xf |
| 20 | mov x2, #4 |
| 21 | lsl x1, x2, x1 |
| 22 | |
| 23 | 1: dc zva, x0 |
| 24 | add x0, x0, x1 |
| 25 | tst x0, #(PAGE_SIZE - 1) |
| 26 | b.ne 1b |
| 27 | ret |
| 28 | ENDPROC(clear_page) |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 29 | EXPORT_SYMBOL(clear_page) |