1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_INIT_H
3 #define _ASM_X86_INIT_H
4 
5 #define __head	__section(".head.text")
6 
7 struct x86_mapping_info {
8 	void *(*alloc_pgt_page)(void *); /* allocate buf for page table */
9 	void (*free_pgt_page)(void *, void *); /* free buf for page table */
10 	void *context;			 /* context for alloc_pgt_page */
11 	unsigned long page_flag;	 /* page flag for PMD or PUD entry */
12 	unsigned long offset;		 /* ident mapping offset */
13 	bool direct_gbpages;		 /* PUD level 1GB page support */
14 	unsigned long kernpg_flag;	 /* kernel pagetable flag override */
15 };
16 
17 int kernel_ident_mapping_init(struct x86_mapping_info *info, pgd_t *pgd_page,
18 				unsigned long pstart, unsigned long pend);
19 
20 void kernel_ident_mapping_free(struct x86_mapping_info *info, pgd_t *pgd);
21 
22 #endif /* _ASM_X86_INIT_H */
23