xref: /linux/arch/arm64/include/asm/trans_pgd.h (revision 89d1410f4af55c621395548355f3520415d2bcff)
1072e3d96SPavel Tatashin /* SPDX-License-Identifier: GPL-2.0 */
2072e3d96SPavel Tatashin 
3072e3d96SPavel Tatashin /*
4072e3d96SPavel Tatashin  * Copyright (c) 2020, Microsoft Corporation.
5072e3d96SPavel Tatashin  * Pavel Tatashin <pasha.tatashin@soleen.com>
6072e3d96SPavel Tatashin  */
7072e3d96SPavel Tatashin 
8072e3d96SPavel Tatashin #ifndef _ASM_TRANS_TABLE_H
9072e3d96SPavel Tatashin #define _ASM_TRANS_TABLE_H
10072e3d96SPavel Tatashin 
11072e3d96SPavel Tatashin #include <linux/bits.h>
12072e3d96SPavel Tatashin #include <linux/types.h>
13072e3d96SPavel Tatashin #include <asm/pgtable-types.h>
14072e3d96SPavel Tatashin 
1550f53fb7SPavel Tatashin /*
1650f53fb7SPavel Tatashin  * trans_alloc_page
1750f53fb7SPavel Tatashin  *	- Allocator that should return exactly one zeroed page, if this
1850f53fb7SPavel Tatashin  *	  allocator fails, trans_pgd_create_copy() and trans_pgd_map_page()
1950f53fb7SPavel Tatashin  *	  return -ENOMEM error.
2050f53fb7SPavel Tatashin  *
2150f53fb7SPavel Tatashin  * trans_alloc_arg
2250f53fb7SPavel Tatashin  *	- Passed to trans_alloc_page as an argument
2350f53fb7SPavel Tatashin  */
2450f53fb7SPavel Tatashin 
2550f53fb7SPavel Tatashin struct trans_pgd_info {
2650f53fb7SPavel Tatashin 	void * (*trans_alloc_page)(void *arg);
2750f53fb7SPavel Tatashin 	void *trans_alloc_arg;
2850f53fb7SPavel Tatashin };
2950f53fb7SPavel Tatashin 
30*89d1410fSPavel Tatashin int trans_pgd_create_copy(struct trans_pgd_info *info, pgd_t **trans_pgd,
31*89d1410fSPavel Tatashin 			  unsigned long start, unsigned long end);
32072e3d96SPavel Tatashin 
3350f53fb7SPavel Tatashin int trans_pgd_map_page(struct trans_pgd_info *info, pgd_t *trans_pgd,
3450f53fb7SPavel Tatashin 		       void *page, unsigned long dst_addr, pgprot_t pgprot);
35072e3d96SPavel Tatashin 
36072e3d96SPavel Tatashin #endif /* _ASM_TRANS_TABLE_H */
37