diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2004-05-12 22:57:00 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2004-05-12 22:57:00 +0000 |
commit | 54d68745ce45f7d7959400b5870f6ae967b49844 (patch) | |
tree | 664f5bf8b54374e49f72de091cd3f9956c7f62f1 /sys/arch | |
parent | 0191e5f0bd4e7b423c9c03f6f427e4d374ab4904 (diff) |
support probe instructions
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/hppa/hppa/trap.c | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c index 9ca89e323c8..71cdd7c7859 100644 --- a/sys/arch/hppa/hppa/trap.c +++ b/sys/arch/hppa/hppa/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.73 2004/04/21 23:09:30 mickey Exp $ */ +/* $OpenBSD: trap.c,v 1.74 2004/05/12 22:56:59 mickey Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -87,6 +87,42 @@ int trap_types = sizeof(trap_type)/sizeof(trap_type[0]); int want_resched, astpending; +#define frame_regmap(tf,r) (((u_int *)(tf))[hppa_regmap[(r)]]) +u_char hppa_regmap[32] = { + offsetof(struct trapframe, tf_pad[0]) / 4, /* r0 XXX */ + offsetof(struct trapframe, tf_r1) / 4, + offsetof(struct trapframe, tf_rp) / 4, + offsetof(struct trapframe, tf_r3) / 4, + offsetof(struct trapframe, tf_r4) / 4, + offsetof(struct trapframe, tf_r5) / 4, + offsetof(struct trapframe, tf_r6) / 4, + offsetof(struct trapframe, tf_r7) / 4, + offsetof(struct trapframe, tf_r8) / 4, + offsetof(struct trapframe, tf_r9) / 4, + offsetof(struct trapframe, tf_r10) / 4, + offsetof(struct trapframe, tf_r11) / 4, + offsetof(struct trapframe, tf_r12) / 4, + offsetof(struct trapframe, tf_r13) / 4, + offsetof(struct trapframe, tf_r14) / 4, + offsetof(struct trapframe, tf_r15) / 4, + offsetof(struct trapframe, tf_r16) / 4, + offsetof(struct trapframe, tf_r17) / 4, + offsetof(struct trapframe, tf_r18) / 4, + offsetof(struct trapframe, tf_t4) / 4, + offsetof(struct trapframe, tf_t3) / 4, + offsetof(struct trapframe, tf_t2) / 4, + offsetof(struct trapframe, tf_t1) / 4, + offsetof(struct trapframe, tf_arg3) / 4, + offsetof(struct trapframe, tf_arg2) / 4, + offsetof(struct trapframe, tf_arg1) / 4, + offsetof(struct trapframe, tf_arg0) / 4, + offsetof(struct trapframe, tf_dp) / 4, + offsetof(struct trapframe, tf_ret0) / 4, + offsetof(struct trapframe, tf_ret1) / 4, + offsetof(struct trapframe, tf_sp) / 4, + offsetof(struct trapframe, tf_r31) / 4, +}; + void userret(struct proc *p, register_t pc, u_quad_t oticks) { @@ -372,6 +408,14 @@ trap(type, frame) ret = uvm_fault(map, hppa_trunc_page(va), fault, vftype); + /* dig probe insn */ + if (ret && trapnum == T_DTLBMISSNA && + (frame->tf_iir & 0xfc001f80) == 0x04001180) { + frame_regmap(frame, frame->tf_iir & 0x1f) = 0; + frame->tf_ipsw |= PSL_N; + break; + } + /* * If this was a stack access we keep track of the maximum * accessed stack size. Also, if uvm_fault gets a protection |