summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-11-03 08:04:04 +0000
committermarcel <marcel@FreeBSD.org>2003-11-03 08:04:04 +0000
commitf3021513b4a13988bf03f1dadeb8b5a5e96d63a9 (patch)
treee0a03de0757b002c7e48dbacbf7a99781b8e42a2
parentc02d4797e2c0aea5646b40e37ee65ba00e22334e (diff)
downloadFreeBSD-src-f3021513b4a13988bf03f1dadeb8b5a5e96d63a9.zip
FreeBSD-src-f3021513b4a13988bf03f1dadeb8b5a5e96d63a9.tar.gz
Handle unaligned 4-byte loads. While in the neighborhood, remove the
cr.isr sanity check. We actually encounter insanities, which very likely means that the insanity check itself is insane. Remove an empty comment while I'm at it.
-rw-r--r--sys/ia64/ia64/unaligned.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/sys/ia64/ia64/unaligned.c b/sys/ia64/ia64/unaligned.c
index 04ec2d4..bcbb638 100644
--- a/sys/ia64/ia64/unaligned.c
+++ b/sys/ia64/ia64/unaligned.c
@@ -134,6 +134,13 @@ fixup(struct asm_inst *i, mcontext_t *mc, uint64_t va)
uint64_t postinc;
switch (i->i_op) {
+ case ASM_OP_LD4:
+ copyin((void*)va, (void*)&buf.i, 4);
+ reg = greg_ptr(mc, (int)i->i_oper[1].o_value);
+ if (reg == NULL)
+ return (EINVAL);
+ wrreg(reg, buf.i & 0xffffffffU);
+ break;
case ASM_OP_LD8:
copyin((void*)va, (void*)&buf.i, 8);
reg = greg_ptr(mc, (int)i->i_oper[1].o_value);
@@ -178,19 +185,9 @@ unaligned_fixup(struct trapframe *tf, struct thread *td)
struct asm_bundle bundle;
int error, slot;
- /* Sanity checks. */
- if (!(tf->tf_special.isr & IA64_ISR_R) ||
- (tf->tf_special.isr & (IA64_ISR_W|IA64_ISR_X|IA64_ISR_NA))) {
- printf("%s: unexpected cr.isr value\n", __func__);
- return (SIGILL);
- }
-
slot = ((tf->tf_special.psr & IA64_PSR_RI) == IA64_PSR_RI_0) ? 0 :
((tf->tf_special.psr & IA64_PSR_RI) == IA64_PSR_RI_1) ? 1 : 2;
- /*
- *
- */
if (ia64_unaligned_print) {
uprintf("pid %d (%s): unaligned access: va=0x%lx, pc=0x%lx\n",
td->td_proc->p_pid, td->td_proc->p_comm,
OpenPOWER on IntegriCloud