From 7e57dab91f6b49d82ca7b2e4b9f8a188aafff02b Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 18 Oct 1995 18:21:39 +0000 Subject: use pmap functions instead of getpte/setpte hacks --- sys/arch/sparc/sparc/db_interface.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'sys/arch/sparc') diff --git a/sys/arch/sparc/sparc/db_interface.c b/sys/arch/sparc/sparc/db_interface.c index a0ce1c03455..ebee65ddae2 100644 --- a/sys/arch/sparc/sparc/db_interface.c +++ b/sys/arch/sparc/sparc/db_interface.c @@ -163,11 +163,6 @@ db_read_bytes(addr, size, data) } -/* - * XXX - stolen from pmap.c - */ -#define getpte(va) lda(va, ASI_PTE) -#define setpte(va, pte) sta(va, ASI_PTE, pte) #define splpmap() splimp() static void @@ -175,25 +170,22 @@ db_write_text(dst, ch) unsigned char *dst; int ch; { - int s, pte0, pte; vm_offset_t va; + int s; s = splpmap(); va = (unsigned long)dst & (~PGOFSET); - pte0 = getpte(va); - if ((pte0 & PG_V) == 0) { + if (pmap_extract(pmap_kernel(), va) == 0) { db_printf(" address 0x%x not a valid page\n", dst); splx(s); return; } - pte = pte0 | PG_W; - setpte(va, pte); - + pmap_changeprot(pmap_kernel(), va, VM_PROT_ALL, 0); *dst = (unsigned char)ch; + pmap_protect(pmap_kernel(), va, va, VM_PROT_READ|VM_PROT_EXECUTE); - setpte(va, pte0); splx(s); } -- cgit v1.2.3