From 304d300a342105b838fdc1984181b64c8f803913 Mon Sep 17 00:00:00 2001 From: miod Date: Wed, 14 Feb 2024 06:16:53 +0000 Subject: [PATCH] Make sure pmap_unmap_direct flushes dirty cache lines. --- sys/arch/m88k/include/pmap.h | 4 ++-- sys/arch/m88k/m88k/pmap.c | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/arch/m88k/include/pmap.h b/sys/arch/m88k/include/pmap.h index 735945313f9..a08f357981d 100644 --- a/sys/arch/m88k/include/pmap.h +++ b/sys/arch/m88k/include/pmap.h @@ -1,4 +1,4 @@ -/* $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 @@ -77,7 +77,7 @@ int pmap_translation_info(pmap_t, vaddr_t, paddr_t *, uint32_t *); #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 diff --git a/sys/arch/m88k/m88k/pmap.c b/sys/arch/m88k/m88k/pmap.c index a5bdebdbf2e..e9f3c390986 100644 --- a/sys/arch/m88k/m88k/pmap.c +++ b/sys/arch/m88k/m88k/pmap.c @@ -1,4 +1,4 @@ -/* $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. @@ -2002,3 +2002,18 @@ pmap_page_uncache(paddr_t pa) 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; +} -- 2.20.1