summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1999-12-17 23:46:54 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1999-12-17 23:46:54 +0000
commit611dced05a227fd059fd2257c82dbd8caf8862ae (patch)
tree193fcfc530bc951c90fb320e1d3792839a92a5d3 /sys/arch
parent315f1c20f4c1bb68b2914337820367098d3f7747 (diff)
Use pmap_writetext instead of manually fiddling with pmap_changeprot when
filling in the fastint vectors.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/sparc/intr.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/sys/arch/sparc/sparc/intr.c b/sys/arch/sparc/sparc/intr.c
index 2ba1aab69c0..1596300fce8 100644
--- a/sys/arch/sparc/sparc/intr.c
+++ b/sys/arch/sparc/sparc/intr.c
@@ -273,7 +273,10 @@ intr_fasttrap(level, vec)
#ifdef DIAGNOSTIC
int displ; /* suspenders, belt, and buttons too */
#endif
- int s;
+ int s, i;
+ int instr[3];
+ char *instrp;
+ char *tvp;
tv = &trapbase[T_L1INT - 1 + level];
hi22 = ((u_long)vec) >> 10;
@@ -296,13 +299,13 @@ intr_fasttrap(level, vec)
tv->tv_instr[0], tv->tv_instr[1], tv->tv_instr[2],
I_MOVi(I_L3, level), I_BA(0, displ), I_RDPSR(I_L0));
#endif
- /* kernel text is write protected -- let us in for a moment */
- pmap_changeprot(pmap_kernel(), (vaddr_t)tv,
- VM_PROT_READ|VM_PROT_WRITE, 1);
- tv->tv_instr[0] = I_SETHI(I_L3, hi22); /* sethi %hi(vec),%l3 */
- tv->tv_instr[1] = I_JMPLri(I_G0, I_L3, lo10);/* jmpl %l3+%lo(vec),%g0 */
- tv->tv_instr[2] = I_RDPSR(I_L0); /* mov %psr, %l0 */
- pmap_changeprot(pmap_kernel(), (vaddr_t)tv, VM_PROT_READ, 1);
- fastvec |= 1 << level;
- splx(s);
+
+ instr[0] = I_SETHI(I_L3, hi22); /* sethi %hi(vec),%l3 */
+ instr[1] = I_JMPLri(I_G0, I_L3, lo10); /* jmpl %l3+%lo(vec),%g0 */
+ instr[2] = I_RDPSR(I_L0); /* mov %psr, %l0 */
+
+ tvp = (char *)tv->tv_instr;
+ instrp = (char *)instr;
+ for (i = 0; i < sizeof(int) * 3; i++, instrp++, tvp++)
+ pmap_writetext(tvp, *instrp);
}