File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ void invept(struct vcpu *vcpu)
190
190
_invept (INVEPT_TYPE_ALL_CONTEXTS , desc );
191
191
}
192
192
193
- bool check_mmu_1gb_support (int page_table_type )
193
+ bool check_mmu_1gb_support (enum _page_table_type page_table_type )
194
194
{
195
195
bool status = false;
196
196
@@ -201,7 +201,8 @@ bool check_mmu_1gb_support(int page_table_type)
201
201
return status ;
202
202
}
203
203
204
- static inline uint32_t check_page_table_present (int page_table_type ,
204
+ static inline uint32_t
205
+ check_page_table_present (enum _page_table_type page_table_type ,
205
206
uint64_t table_entry )
206
207
{
207
208
if (page_table_type == PTT_EPT ) {
@@ -227,7 +228,8 @@ static inline uint32_t check_page_table_present(int page_table_type,
227
228
228
229
static uint32_t map_mem_region (void * vaddr , void * paddr ,
229
230
void * table_base , uint64_t attr , uint32_t table_level ,
230
- int table_type , enum mem_map_request_type request_type )
231
+ enum _page_table_type table_type ,
232
+ enum mem_map_request_type request_type )
231
233
{
232
234
uint64_t table_entry ;
233
235
uint32_t table_offset ;
Original file line number Diff line number Diff line change 213
213
#define ROUND_PAGE_UP (addr ) (((addr) + CPU_PAGE_SIZE - 1) & CPU_PAGE_MASK)
214
214
#define ROUND_PAGE_DOWN (addr ) ((addr) & CPU_PAGE_MASK)
215
215
216
+ enum _page_table_type {
217
+ PTT_HOST = 0 , /* Mapping for hypervisor */
218
+ PTT_EPT = 1 ,
219
+ PAGETABLE_TYPE_UNKNOWN ,
220
+ };
221
+
216
222
struct map_params {
217
223
/* enum _page_table_type: HOST or EPT*/
218
- int page_table_type ;
224
+ enum _page_table_type page_table_type ;
219
225
/* used HVA->HPA for HOST, used GPA->HPA for EPT */
220
226
void * pml4_base ;
221
227
/* used HPA->HVA for HOST, used HPA->GPA for EPT */
@@ -230,12 +236,6 @@ struct entry_params {
230
236
uint64_t page_size ;
231
237
};
232
238
233
- enum _page_table_type {
234
- PTT_HOST = 0 , /* Mapping for hypervisor */
235
- PTT_EPT = 1 ,
236
- PAGETABLE_TYPE_UNKNOWN ,
237
- };
238
-
239
239
/* Represent the 4 levels of translation tables in IA-32e paging mode */
240
240
enum _page_table_level {
241
241
IA32E_PML4 = 0 ,
@@ -284,7 +284,7 @@ struct mem_io_node {
284
284
};
285
285
286
286
uint64_t get_paging_pml4 (void );
287
- bool check_mmu_1gb_support (int page_table_type );
287
+ bool check_mmu_1gb_support (enum _page_table_type page_table_type );
288
288
void * alloc_paging_struct (void );
289
289
void free_paging_struct (void * ptr );
290
290
void enable_paging (uint64_t pml4_base_addr );
You can’t perform that action at this time.
0 commit comments