Skip to content
Snippets Groups Projects
Commit d53aa04f authored by Adrian Danis's avatar Adrian Danis
Browse files

x86: Abstractions for setting up benchmarking log

parent 1a85b409
No related branches found
No related tags found
No related merge requests found
......@@ -258,4 +258,21 @@ x86_make_empty_pte(void)
);
}
static inline pde_t
x86_make_pde_mapping(word_t paddr, vm_attributes_t attr) {
return pde_pde_large_new(
paddr, /* page_base_address */
vm_attributes_get_x86PATBit(attr), /* pat */
0, /* avl_cte_depth */
1, /* global */
0, /* dirty */
0, /* accessed */
vm_attributes_get_x86PCDBit(attr), /* cache_disabled */
vm_attributes_get_x86PWTBit(attr), /* write_through */
0, /* super_user */
1, /* read_write */
1 /* present */
);
}
#endif
......@@ -163,7 +163,7 @@ init_sys_state(
create_frames_of_region_ret_t create_frames_ret;
#if CONFIG_MAX_NUM_TRACE_POINTS > 0
vm_attributes_t buffer_attr = {{ 0 }};
uint32_t paddr;
word_t paddr;
pde_t pde;
#endif /* CONFIG_MAX_NUM_TRACE_POINTS > 0 */
......@@ -195,24 +195,10 @@ init_sys_state(
/* allocate and create the log buffer */
buffer_attr.words[0] = IA32_PAT_MT_WRITE_THROUGH;
paddr = pptr_to_paddr((void *) alloc_region(pageBitsForSize(IA32_LargePage)));
paddr = pptr_to_paddr((void *) alloc_region(pageBitsForSize(X86_LargePage)));
/* allocate a large frame for logging */
pde = pde_pde_large_new(
paddr, /* page_base_address */
vm_attributes_get_ia32PATBit(buffer_attr), /* pat */
0, /* avl_cte_depth */
1, /* global */
0, /* dirty */
0, /* accessed */
vm_attributes_get_ia32PCDBit(buffer_attr), /* cache_disabled */
vm_attributes_get_ia32PWTBit(buffer_attr), /* write_through */
0, /* super_user */
1, /* read_write */
1 /* present */
);
/* TODO this shouldn't be hardcoded */
pde = x86_make_pde_mapping(paddr, buffer_attr);
ia32KSGlobalPD[IA32_KSLOG_IDX] = pde;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment