Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 
0003 /*
0004  * Copyright (c) 2021, Microsoft Corporation.
0005  * Pasha Tatashin <pasha.tatashin@soleen.com>
0006  */
0007 
0008 #ifndef _ASM_TRANS_TABLE_H
0009 #define _ASM_TRANS_TABLE_H
0010 
0011 #include <linux/bits.h>
0012 #include <linux/types.h>
0013 #include <asm/pgtable-types.h>
0014 
0015 /*
0016  * trans_alloc_page
0017  *  - Allocator that should return exactly one zeroed page, if this
0018  *    allocator fails, trans_pgd_create_copy() and trans_pgd_idmap_page()
0019  *    return -ENOMEM error.
0020  *
0021  * trans_alloc_arg
0022  *  - Passed to trans_alloc_page as an argument
0023  */
0024 
0025 struct trans_pgd_info {
0026     void * (*trans_alloc_page)(void *arg);
0027     void *trans_alloc_arg;
0028 };
0029 
0030 int trans_pgd_create_copy(struct trans_pgd_info *info, pgd_t **trans_pgd,
0031               unsigned long start, unsigned long end);
0032 
0033 int trans_pgd_idmap_page(struct trans_pgd_info *info, phys_addr_t *trans_ttbr0,
0034              unsigned long *t0sz, void *page);
0035 
0036 int trans_pgd_copy_el2_vectors(struct trans_pgd_info *info,
0037                    phys_addr_t *el2_vectors);
0038 
0039 extern char trans_pgd_stub_vectors[];
0040 
0041 #endif /* _ASM_TRANS_TABLE_H */