1072e3d96SPavel Tatashin /* SPDX-License-Identifier: GPL-2.0 */ 2072e3d96SPavel Tatashin 3072e3d96SPavel Tatashin /* 4788bfdd9SPasha Tatashin * Copyright (c) 2021, Microsoft Corporation. 5788bfdd9SPasha Tatashin * Pasha 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 18*6091dd9eSPasha Tatashin * allocator fails, trans_pgd_create_copy() and trans_pgd_idmap_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 3089d1410fSPavel Tatashin int trans_pgd_create_copy(struct trans_pgd_info *info, pgd_t **trans_pgd, 3189d1410fSPavel Tatashin unsigned long start, unsigned long end); 32072e3d96SPavel Tatashin 337018d467SJames Morse int trans_pgd_idmap_page(struct trans_pgd_info *info, phys_addr_t *trans_ttbr0, 347018d467SJames Morse unsigned long *t0sz, void *page); 357018d467SJames Morse 36788bfdd9SPasha Tatashin int trans_pgd_copy_el2_vectors(struct trans_pgd_info *info, 37788bfdd9SPasha Tatashin phys_addr_t *el2_vectors); 38788bfdd9SPasha Tatashin 39788bfdd9SPasha Tatashin extern char trans_pgd_stub_vectors[]; 40788bfdd9SPasha Tatashin 41072e3d96SPavel Tatashin #endif /* _ASM_TRANS_TABLE_H */ 42