1 /* SPDX-License-Identifier: GPL-2.0 */
4 * Copyright (c) 2021, Microsoft Corporation.
5 * Pasha Tatashin <pasha.tatashin@soleen.com>
8 #ifndef _ASM_TRANS_TABLE_H
9 #define _ASM_TRANS_TABLE_H
11 #include <linux/bits.h>
12 #include <linux/types.h>
13 #include <asm/pgtable-types.h>
17 * - Allocator that should return exactly one zeroed page, if this
18 * allocator fails, trans_pgd_create_copy() and trans_pgd_idmap_page()
19 * return -ENOMEM error.
22 * - Passed to trans_alloc_page as an argument
25 struct trans_pgd_info
{
26 void * (*trans_alloc_page
)(void *arg
);
27 void *trans_alloc_arg
;
30 int trans_pgd_create_copy(struct trans_pgd_info
*info
, pgd_t
**trans_pgd
,
31 unsigned long start
, unsigned long end
);
33 int trans_pgd_idmap_page(struct trans_pgd_info
*info
, phys_addr_t
*trans_ttbr0
,
34 unsigned long *t0sz
, void *page
);
36 int trans_pgd_copy_el2_vectors(struct trans_pgd_info
*info
,
37 phys_addr_t
*el2_vectors
);
39 extern char trans_pgd_stub_vectors
[];
41 #endif /* _ASM_TRANS_TABLE_H */