From 2b8dbfda5913761aa0bd42de9f9adf3a2a3bd4e5 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 9 Jul 2024 14:24:02 -0400 Subject: kernel/amd64: Add function to set cache policy Signed-off-by: Ian Moffett --- sys/include/vm/pmap.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sys/include/vm/pmap.h') diff --git a/sys/include/vm/pmap.h b/sys/include/vm/pmap.h index 4cd334c..741eaf2 100644 --- a/sys/include/vm/pmap.h +++ b/sys/include/vm/pmap.h @@ -39,6 +39,10 @@ #define PROT_EXEC BIT(1) /* Executable */ #define PROT_USER BIT(2) /* User accessible */ +/* Caching types */ +#define VM_CACHE_UC 0x00000U /* Uncachable */ +#define VM_CACHE_WT 0x00001U /* Write-through */ + typedef uint32_t vm_prot_t; /* @@ -71,4 +75,10 @@ int pmap_map(struct vas vas, vaddr_t va, paddr_t pa, vm_prot_t prot); */ int pmap_unmap(struct vas vas, vaddr_t va); +/* + * Mark a virtual address with a specific + * caching type. + */ +int pmap_set_cache(struct vas vas, vaddr_t va, int type); + #endif /* !_VM_PMAP_H_ */ -- cgit v1.2.3