diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-09-10 18:29:45 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-09-10 18:29:45 +0000 |
commit | dc9f06d0330e3e7e4470e3ea0dc68bebaef4bff9 (patch) | |
tree | 1503c1f1af5126456f6dc9827abc9b960308687f /sys/arch/vax | |
parent | 7730c554bf1c303d60002833793768dbd9a6a681 (diff) |
Change the pmap_zero_page and pmap_copy_page API to take the struct vm_page *
instead of the pa. Most callers already had it handy and those who didn't
only called it for managed pages and were outside time-critical code.
This will allow us to make those functions clean and fast on sparc and
sparc64 letting us to avoid unnecessary cache flushes.
deraadt@ miod@ drahn@ ok.
Diffstat (limited to 'sys/arch/vax')
-rw-r--r-- | sys/arch/vax/include/pmap.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/sys/arch/vax/include/pmap.h b/sys/arch/vax/include/pmap.h index 84b4a37ca3b..cf0b83594ff 100644 --- a/sys/arch/vax/include/pmap.h +++ b/sys/arch/vax/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.16 2002/03/14 01:26:48 millert Exp $ */ +/* $OpenBSD: pmap.h,v 1.17 2002/09/10 18:29:44 art Exp $ */ /* $NetBSD: pmap.h,v 1.37 1999/08/01 13:48:07 ragge Exp $ */ /* @@ -132,14 +132,19 @@ extern struct pmap kernel_pmap_store; #define pmap_reference(pmap) (pmap)->ref_count++ /* These can be done as efficient inline macros */ -#define pmap_copy_page(src, dst) \ +#define pmap_copy_page(srcpg, dstpg) do { \ + paddr_t __src = VM_PAGE_TO_PHYS(srcpg); \ + paddr_t __dst = VM_PAGE_TO_PHYS(dstpg); \ __asm__("addl3 $0x80000000,%0,r0;addl3 $0x80000000,%1,r1; \ - movc3 $4096,(r0),(r1)" \ - :: "r"(src),"r"(dst):"r0","r1","r2","r3","r4","r5"); - -#define pmap_zero_page(phys) \ - __asm__("addl3 $0x80000000,%0,r0;movc5 $0,(r0),$0,$4096,(r0)" \ - :: "r"(phys): "r0","r1","r2","r3","r4","r5"); + movc3 $4096,(r0),(r1)" \ + :: "r"(__src),"r"(__dst):"r0","r1","r2","r3","r4","r5"); \ +} while (0) + +#define pmap_zero_page(pg) do { \ + paddr_t __pa = VM_PAGE_TO_PHYS(pg); \ + __asm__("addl3 $0x80000000,%0,r0;movc5 $0,(r0),$0,$4096,(r0)" \ + :: "r"(__pa): "r0","r1","r2","r3","r4","r5"); \ +} while (0) /* Prototypes */ void pmap_bootstrap(void); |