From ad127e14fe07f29700ffbe85e2bc0f7ec53d64b8 Mon Sep 17 00:00:00 2001 From: Daniel Weber Date: Tue, 6 Feb 2024 04:33:26 +0100 Subject: [PATCH] update demo to new API --- demos/clear_bits.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/demos/clear_bits.c b/demos/clear_bits.c index aa73fa9..49eccb8 100644 --- a/demos/clear_bits.c +++ b/demos/clear_bits.c @@ -21,20 +21,20 @@ int main(int argc, char** argv) memset(addr,0x42,2*1024*1024); ptedit_entry_t entry = ptedit_resolve(addr, 0); - ptedit_clear_bit(addr, 0, PTEDIT_PAGE_BIT_ACCESSED,PTEDIT_VALID_MASK_PUD|PTEDIT_VALID_MASK_PMD|PTEDIT_VALID_MASK_PTE); + ptedit_pte_clear_bit(addr, 0, PTEDIT_PAGE_BIT_ACCESSED); entry = ptedit_resolve(addr, 0); ptedit_print_entry(entry.pte); ptedit_print_entry(entry.pmd); ptedit_print_entry(entry.pud); - ptedit_set_bit(addr, 0, PTEDIT_PAGE_BIT_ACCESSED,PTEDIT_VALID_MASK_PUD|PTEDIT_VALID_MASK_PMD|PTEDIT_VALID_MASK_PTE); + ptedit_pte_set_bit(addr, 0, PTEDIT_PAGE_BIT_ACCESSED); entry = ptedit_resolve(addr, 0); ptedit_print_entry(entry.pte); ptedit_print_entry(entry.pmd); ptedit_print_entry(entry.pud); - //clear accessed bit of pd entry + //set accessed bit of pd entry size_t address_pfn = ptedit_get_pfn(entry.pd); - ptedit_set_bit(addr, 0, PTEDIT_PAGE_BIT_ACCESSED,PTEDIT_VALID_MASK_PMD); + ptedit_pte_set_bit(addr, 0, PTEDIT_PAGE_BIT_ACCESSED); munmap(addr,4096); ptedit_cleanup();