diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-10-18 18:21:39 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-10-18 18:21:39 +0000 |
commit | 7e57dab91f6b49d82ca7b2e4b9f8a188aafff02b (patch) | |
tree | 1028254e3934136dbe30c99ada8e47e4e30bf327 /sys/arch | |
parent | 2d261149a3ea34328dc843245eb9b5d5ef39ce16 (diff) |
use pmap functions instead of getpte/setpte hacks
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc/sparc/db_interface.c | 16 |
1 files changed, 4 insertions, 12 deletions
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); } |