-/* $OpenBSD: pmap.h,v 1.30 2023/12/11 22:12:53 kettenis Exp $ */
+/* $OpenBSD: pmap.h,v 1.31 2024/02/14 06:16:53 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1991 Carnegie Mellon University
#define PTI_BATC 2
#define pmap_map_direct(pg) ((vaddr_t)VM_PAGE_TO_PHYS(pg))
-#define pmap_unmap_direct(va) PHYS_TO_VM_PAGE((paddr_t)va)
+vm_page_t pmap_unmap_direct(vaddr_t);
#define PMAP_CHECK_COPYIN 1
-/* $OpenBSD: pmap.c,v 1.87 2024/02/07 20:54:53 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.88 2024/02/14 06:16:53 miod Exp $ */
/*
* Copyright (c) 2001-2004, 2010, Miodrag Vallat.
splx(s);
pmap_cache_ctrl(pa, pa + PAGE_SIZE, CACHE_INH);
}
+
+/*
+ * [MI]
+ * Marks a "direct" page as unused.
+ */
+vm_page_t
+pmap_unmap_direct(vaddr_t va)
+{
+ paddr_t pa = (paddr_t)va;
+ vm_page_t pg = PHYS_TO_VM_PAGE(pa);
+
+ pmap_clean_page(pa);
+
+ return pg;
+}