Skip to content

Commit

Permalink
lib: add invlpg() helper function
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
  • Loading branch information
wipawel committed Oct 23, 2023
1 parent ffbefa3 commit 7a82f59
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ static inline void str(unsigned int *selector) {
asm volatile("str %0" : "=m"(*selector));
}

static inline void invlpg(void *addr) {
asm volatile("invlpg (%0)" ::"r"(addr) : "memory");
}

static inline void flush_tlb(void) {
write_cr3(read_cr3());
}
Expand Down

0 comments on commit 7a82f59

Please sign in to comment.