diff options
Diffstat (limited to 'sys/arch/m68k/fpe/fpu_calcea.c')
-rw-r--r-- | sys/arch/m68k/fpe/fpu_calcea.c | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/sys/arch/m68k/fpe/fpu_calcea.c b/sys/arch/m68k/fpe/fpu_calcea.c index e97d4dbecbe..b8a29000959 100644 --- a/sys/arch/m68k/fpe/fpu_calcea.c +++ b/sys/arch/m68k/fpe/fpu_calcea.c @@ -1,5 +1,5 @@ -/* $OpenBSD: fpu_calcea.c,v 1.2 1996/02/27 11:03:17 niklas Exp $ */ -/* $NetBSD: fpu_calcea.c,v 1.3 1996/02/04 02:17:38 briggs Exp $ */ +/* $OpenBSD: fpu_calcea.c,v 1.3 1996/05/09 22:20:43 niklas Exp $ */ +/* $NetBSD: fpu_calcea.c,v 1.4 1996/04/30 11:52:11 briggs Exp $ */ /* * Copyright (c) 1995 Gordon W. Ross @@ -34,6 +34,7 @@ #include <sys/param.h> #include <sys/signal.h> +#include <sys/systm.h> #include <machine/frame.h> #include "fpu_emulate.h" @@ -49,6 +50,8 @@ static int fetch_disp __P((struct frame *frame, struct instruction *insn, int size, int *res)); static int calc_ea __P((struct insn_ea *ea, char *ptr, char **eaddr)); +int fusword __P((void *)); + /* * Helper routines for dealing with "effective address" values. */ @@ -64,7 +67,7 @@ fpu_decode_ea(frame, insn, ea, modreg) struct insn_ea *ea; int modreg; { - int data, sig; + int sig; #ifdef DEBUG if (insn->is_datasize < 0) { @@ -189,12 +192,12 @@ decode_ea6(frame, insn, ea, modreg) struct insn_ea *ea; int modreg; { - int word, extword, idx; + int extword, idx; int basedisp, outerdisp; int bd_size, od_size; int sig; - extword = fusword(frame->f_pc + insn->is_advance); + extword = fusword((void *) (frame->f_pc + insn->is_advance)); if (extword < 0) { return SIGSEGV; } @@ -292,7 +295,7 @@ fpu_load_ea(frame, insn, ea, dst) int *reg; char *src; int len, step; - int data, word, sig; + int sig; #ifdef DIAGNOSTIC if (ea->ea_regnum & ~0xF) { @@ -301,7 +304,7 @@ fpu_load_ea(frame, insn, ea, dst) #endif if (fpu_debug_level & DL_LOADEA) { - printf(" load_ea: frame at %08x\n", frame); + printf(" load_ea: frame at %p\n", frame); } /* The dst is always int or larger. */ len = insn->is_datasize; @@ -332,7 +335,7 @@ fpu_load_ea(frame, insn, ea, dst) } } if (fpu_debug_level & DL_LOADEA) { - printf(" load_ea: src 0x%08x\n", src); + printf(" load_ea: src %p\n", src); } bcopy(src, dst, len); } else if (ea->ea_flags & EA_IMMED) { @@ -364,7 +367,7 @@ fpu_load_ea(frame, insn, ea, dst) extention word from the opcode */ src = (char *)frame->f_pc + 4; if (fpu_debug_level & DL_LOADEA) { - printf(" load_ea: pc relative pc+4 = 0x%08x\n", src); + printf(" load_ea: pc relative pc+4 = %p\n", src); } } else /* not PC relative */ { if (fpu_debug_level & DL_LOADEA) { @@ -385,7 +388,7 @@ fpu_load_ea(frame, insn, ea, dst) /* Grab the register contents. */ src = (char *)*reg; if (fpu_debug_level & DL_LOADEA) { - printf(" load_ea: reg indirect reg = 0x%08x\n", src); + printf(" load_ea: reg indirect reg = %p\n", src); } } @@ -430,7 +433,7 @@ fpu_store_ea(frame, insn, ea, src) int *reg; char *dst; int len, step; - int data, word, sig; + int sig; #ifdef DIAGNOSTIC if (ea->ea_regnum & ~0xF) { @@ -447,7 +450,7 @@ fpu_store_ea(frame, insn, ea, src) } if (fpu_debug_level & DL_STOREEA) { - printf(" store_ea: frame at %08x\n", frame); + printf(" store_ea: frame at %p\n", frame); } /* The src is always int or larger. */ len = insn->is_datasize; @@ -485,7 +488,7 @@ fpu_store_ea(frame, insn, ea, src) } } if (fpu_debug_level & DL_STOREEA) { - printf(" store_ea: dst 0x%08x\n", dst); + printf(" store_ea: dst %p\n", dst); } bcopy(src, dst, len); } else /* One of MANY indirect forms... */ { @@ -511,7 +514,7 @@ fpu_store_ea(frame, insn, ea, src) return sig; if (fpu_debug_level & DL_STOREEA) { - printf(" store_ea: dst addr=0x%08x+%d\n", dst, ea->ea_tdisp); + printf(" store_ea: dst addr=%p+%d\n", dst, ea->ea_tdisp); } copyout(src, dst + ea->ea_tdisp, len); @@ -544,7 +547,7 @@ fetch_immed(frame, insn, dst) ext_bytes = insn->is_datasize; if (0 < ext_bytes) { - data = fusword(frame->f_pc + insn->is_advance); + data = fusword((void *) (frame->f_pc + insn->is_advance)); if (data < 0) { return SIGSEGV; } @@ -565,7 +568,7 @@ fetch_immed(frame, insn, dst) dst[0] = data; } if (2 < ext_bytes) { - data = fusword(frame->f_pc + insn->is_advance); + data = fusword((void *) (frame->f_pc + insn->is_advance)); if (data < 0) { return SIGSEGV; } @@ -574,12 +577,12 @@ fetch_immed(frame, insn, dst) dst[0] |= data; } if (4 < ext_bytes) { - data = fusword(frame->f_pc + insn->is_advance); + data = fusword((void *) (frame->f_pc + insn->is_advance)); if (data < 0) { return SIGSEGV; } dst[1] = data << 16; - data = fusword(frame->f_pc + insn->is_advance + 2); + data = fusword((void *) (frame->f_pc + insn->is_advance + 2)); if (data < 0) { return SIGSEGV; } @@ -587,12 +590,12 @@ fetch_immed(frame, insn, dst) dst[1] |= data; } if (8 < ext_bytes) { - data = fusword(frame->f_pc + insn->is_advance); + data = fusword((void *) (frame->f_pc + insn->is_advance)); if (data < 0) { return SIGSEGV; } dst[2] = data << 16; - data = fusword(frame->f_pc + insn->is_advance + 2); + data = fusword((void *) (frame->f_pc + insn->is_advance + 2)); if (data < 0) { return SIGSEGV; } @@ -615,7 +618,7 @@ fetch_disp(frame, insn, size, res) int disp, word; if (size == 1) { - word = fusword(frame->f_pc + insn->is_advance); + word = fusword((void *) (frame->f_pc + insn->is_advance)); if (word < 0) { return SIGSEGV; } @@ -626,12 +629,12 @@ fetch_disp(frame, insn, size, res) } insn->is_advance += 2; } else if (size == 2) { - word = fusword(frame->f_pc + insn->is_advance); + word = fusword((void *) (frame->f_pc + insn->is_advance)); if (word < 0) { return SIGSEGV; } disp = word << 16; - word = fusword(frame->f_pc + insn->is_advance + 2); + word = fusword((void *) (frame->f_pc + insn->is_advance + 2)); if (word < 0) { return SIGSEGV; } @@ -656,10 +659,10 @@ calc_ea(ea, ptr, eaddr) char *ptr; /* base address (usually a register content) */ char **eaddr; /* pointer to result pointer */ { - int data, word, sig; + int data, word; if (fpu_debug_level & DL_EA) { - printf(" calc_ea: reg indirect (reg) = 0x%08x\n", ptr); + printf(" calc_ea: reg indirect (reg) = %p\n", ptr); } if (ea->ea_flags & EA_OFFSET) { @@ -684,7 +687,7 @@ calc_ea(ea, ptr, eaddr) if (fpu_debug_level & DL_EA) { printf(" calc_ea: mem indir mode: basedisp=%08x, outerdisp=%08x\n", ea->ea_basedisp, ea->ea_outerdisp); - printf(" calc_ea: addr fetched from 0x%08x\n", ptr); + printf(" calc_ea: addr fetched from %p\n", ptr); } /* memory indirect modes */ word = fusword(ptr); |