From 312b5687c905a7614cdd1e5080a69bd12cbc95b4 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 2 Jun 2024 21:42:28 -0400 Subject: kernel/amd64: pmap: Add helper to set cache policy Signed-off-by: Ian Moffett --- sys/include/vm/pmap.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sys/include') diff --git a/sys/include/vm/pmap.h b/sys/include/vm/pmap.h index 8c69372..cb18885 100644 --- a/sys/include/vm/pmap.h +++ b/sys/include/vm/pmap.h @@ -54,6 +54,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 */ + #define is_vas_valid(vas) (vas.top_level != 0) /* @@ -66,6 +70,12 @@ struct vm_ctx { struct spinlock dynalloc_lock; }; +/* + * Mark a virtual address with a specific caching + * type. + */ +int pmap_set_cache(struct vm_ctx *, struct vas, vaddr_t, int); + /* * Create a virtual address space * and return the descriptor. -- cgit v1.2.3