summaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorHarald Koerfgen <hkoerfg@web.de>2001-01-13 18:17:58 +0000
committerHarald Koerfgen <hkoerfg@web.de>2001-01-13 18:17:58 +0000
commit38950408e12ec8aa6e94dda61aedb56b9b283c3c (patch)
treeaf17bb5e062a773d098d2837d7476764fd10656d /arch/mips
parenteaa46cff6b2fcc3fff83b35d296dd337f1f98fea (diff)
Further include beautifications
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/math-emu/cp1emu.c18
-rw-r--r--arch/mips/math-emu/ieee754d.c68
-rw-r--r--arch/mips/math-emu/ieee754xcpt.c16
-rw-r--r--arch/mips/math-emu/kernel_linkage.c8
4 files changed, 48 insertions, 62 deletions
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index e26bacd24..4be4633c6 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -69,9 +69,6 @@
#include "ieee754.h"
-#ifdef __KERNEL__
-#define _mon_printf printk
-#endif
/* Strap kernel emulator for full MIPS IV emulation */
#ifdef __mips
@@ -290,7 +287,7 @@ cop1Emulate(int xcptno, struct pt_regs *xcp,
if (__compute_return_epc(xcp)) {
#ifdef CP1DBG
- _mon_printf("failed to emulate branch at %p\n",
+ printk("failed to emulate branch at %p\n",
REG_TO_VA(xcp->cp0_epc));
#endif
return SIGILL;;
@@ -600,7 +597,7 @@ cop1Emulate(int xcptno, struct pt_regs *xcp,
if (MIPSInst_RD(ir) == FPCREG_CSR) {
value = ctx->sr;
#ifdef CSRTRACE
- _mon_printf
+ printk
("%p gpr[%d]<-csr=%08x\n",
REG_TO_VA(xcp->cp0_epc),
MIPSInst_RT(ir), value);
@@ -628,7 +625,7 @@ cop1Emulate(int xcptno, struct pt_regs *xcp,
*/
if (MIPSInst_RD(ir) == FPCREG_CSR) {
#ifdef CSRTRACE
- _mon_printf
+ printk
("%p gpr[%d]->csr=%08x\n",
REG_TO_VA(xcp->cp0_epc),
MIPSInst_RT(ir), value);
@@ -787,7 +784,7 @@ cop1Emulate(int xcptno, struct pt_regs *xcp,
int do_dsemulret(struct pt_regs *xcp)
{
#ifdef DSEMUL_TRACE
- _mon_printf("desemulret\n");
+ printk("desemulret\n");
#endif
/* Set EPC to return to post-branch instruction */
xcp->cp0_epc = current->thread.dsemul_epc;
@@ -814,7 +811,7 @@ mips_dsemul(struct pt_regs *xcp, mips_instruction ir, vaddr_t cpc)
return 0;
}
#ifdef DSEMUL_TRACE
- _mon_printf("desemul %p %p\n", REG_TO_VA(xcp->cp0_epc), cpc);
+ printk("desemul %p %p\n", REG_TO_VA(xcp->cp0_epc), cpc);
#endif
/*
@@ -1120,7 +1117,7 @@ fpux_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
(ctx->sr & ~FPU_CSR_ALL_X) | rcsr;
if ((ctx->sr >> 5) & ctx->
sr & FPU_CSR_ALL_E) {
- /*_mon_printf ("SIGFPE: fpu csr = %08x\n",ctx->sr); */
+ /*printk ("SIGFPE: fpu csr = %08x\n",ctx->sr); */
return SIGFPE;
}
@@ -1656,7 +1653,7 @@ dcopuop:
*/
ctx->sr = (ctx->sr & ~FPU_CSR_ALL_X) | rcsr;
if ((ctx->sr >> 5) & ctx->sr & FPU_CSR_ALL_E) {
- /*_mon_printf ("SIGFPE: fpu csr = %08x\n",ctx->sr); */
+ /*printk ("SIGFPE: fpu csr = %08x\n",ctx->sr); */
return SIGFPE;
}
@@ -1812,3 +1809,4 @@ void _cop1_init(int emulate)
}
}
#endif
+
diff --git a/arch/mips/math-emu/ieee754d.c b/arch/mips/math-emu/ieee754d.c
index f2b85915d..b25c8c03d 100644
--- a/arch/mips/math-emu/ieee754d.c
+++ b/arch/mips/math-emu/ieee754d.c
@@ -31,13 +31,6 @@
* Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
*************************************************************************/
-#ifdef __KERNEL__
-#define printf printk
-#else
-#include <stdio.h>
-#include <stdarg.h>
-#endif
-
#include "ieee754.h"
#define DP_EBIAS 1023
@@ -72,39 +65,39 @@ ieee754dp ieee754dp_dump(char *m, ieee754dp x)
{
int i;
- printf("%s", m);
- printf("<%08x,%08x>\n", (unsigned) (x.bits >> 32),
+ printk("%s", m);
+ printk("<%08x,%08x>\n", (unsigned) (x.bits >> 32),
(unsigned) x.bits);
- printf("\t=");
+ printk("\t=");
switch (ieee754dp_class(x)) {
case IEEE754_CLASS_QNAN:
case IEEE754_CLASS_SNAN:
- printf("Nan %c", DPSIGN(x) ? '-' : '+');
+ printk("Nan %c", DPSIGN(x) ? '-' : '+');
for (i = DP_FBITS - 1; i >= 0; i--)
- printf("%c", DPMANT(x) & DP_MBIT(i) ? '1' : '0');
+ printk("%c", DPMANT(x) & DP_MBIT(i) ? '1' : '0');
break;
case IEEE754_CLASS_INF:
- printf("%cInfinity", DPSIGN(x) ? '-' : '+');
+ printk("%cInfinity", DPSIGN(x) ? '-' : '+');
break;
case IEEE754_CLASS_ZERO:
- printf("%cZero", DPSIGN(x) ? '-' : '+');
+ printk("%cZero", DPSIGN(x) ? '-' : '+');
break;
case IEEE754_CLASS_DNORM:
- printf("%c0.", DPSIGN(x) ? '-' : '+');
+ printk("%c0.", DPSIGN(x) ? '-' : '+');
for (i = DP_FBITS - 1; i >= 0; i--)
- printf("%c", DPMANT(x) & DP_MBIT(i) ? '1' : '0');
- printf("e%d", DPBEXP(x) - DP_EBIAS);
+ printk("%c", DPMANT(x) & DP_MBIT(i) ? '1' : '0');
+ printk("e%d", DPBEXP(x) - DP_EBIAS);
break;
case IEEE754_CLASS_NORM:
- printf("%c1.", DPSIGN(x) ? '-' : '+');
+ printk("%c1.", DPSIGN(x) ? '-' : '+');
for (i = DP_FBITS - 1; i >= 0; i--)
- printf("%c", DPMANT(x) & DP_MBIT(i) ? '1' : '0');
- printf("e%d", DPBEXP(x) - DP_EBIAS);
+ printk("%c", DPMANT(x) & DP_MBIT(i) ? '1' : '0');
+ printk("e%d", DPBEXP(x) - DP_EBIAS);
break;
default:
- printf("Illegal/Unknown IEEE754 value class");
+ printk("Illegal/Unknown IEEE754 value class");
}
- printf("\n");
+ printk("\n");
return x;
}
@@ -112,37 +105,38 @@ ieee754sp ieee754sp_dump(char *m, ieee754sp x)
{
int i;
- printf("%s=", m);
- printf("<%08x>\n", (unsigned) x.bits);
- printf("\t=");
+ printk("%s=", m);
+ printk("<%08x>\n", (unsigned) x.bits);
+ printk("\t=");
switch (ieee754sp_class(x)) {
case IEEE754_CLASS_QNAN:
case IEEE754_CLASS_SNAN:
- printf("Nan %c", SPSIGN(x) ? '-' : '+');
+ printk("Nan %c", SPSIGN(x) ? '-' : '+');
for (i = SP_FBITS - 1; i >= 0; i--)
- printf("%c", SPMANT(x) & SP_MBIT(i) ? '1' : '0');
+ printk("%c", SPMANT(x) & SP_MBIT(i) ? '1' : '0');
break;
case IEEE754_CLASS_INF:
- printf("%cInfinity", SPSIGN(x) ? '-' : '+');
+ printk("%cInfinity", SPSIGN(x) ? '-' : '+');
break;
case IEEE754_CLASS_ZERO:
- printf("%cZero", SPSIGN(x) ? '-' : '+');
+ printk("%cZero", SPSIGN(x) ? '-' : '+');
break;
case IEEE754_CLASS_DNORM:
- printf("%c0.", SPSIGN(x) ? '-' : '+');
+ printk("%c0.", SPSIGN(x) ? '-' : '+');
for (i = SP_FBITS - 1; i >= 0; i--)
- printf("%c", SPMANT(x) & SP_MBIT(i) ? '1' : '0');
- printf("e%d", SPBEXP(x) - SP_EBIAS);
+ printk("%c", SPMANT(x) & SP_MBIT(i) ? '1' : '0');
+ printk("e%d", SPBEXP(x) - SP_EBIAS);
break;
case IEEE754_CLASS_NORM:
- printf("%c1.", SPSIGN(x) ? '-' : '+');
+ printk("%c1.", SPSIGN(x) ? '-' : '+');
for (i = SP_FBITS - 1; i >= 0; i--)
- printf("%c", SPMANT(x) & SP_MBIT(i) ? '1' : '0');
- printf("e%d", SPBEXP(x) - SP_EBIAS);
+ printk("%c", SPMANT(x) & SP_MBIT(i) ? '1' : '0');
+ printk("e%d", SPBEXP(x) - SP_EBIAS);
break;
default:
- printf("Illegal/Unknown IEEE754 value class");
+ printk("Illegal/Unknown IEEE754 value class");
}
- printf("\n");
+ printk("\n");
return x;
}
+
diff --git a/arch/mips/math-emu/ieee754xcpt.c b/arch/mips/math-emu/ieee754xcpt.c
index 5a80c29cf..7a4d94860 100644
--- a/arch/mips/math-emu/ieee754xcpt.c
+++ b/arch/mips/math-emu/ieee754xcpt.c
@@ -29,14 +29,6 @@
* Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
*************************************************************************/
-#if !#system(sde) && !defined(__KERNEL__)
-#include <stdio.h>
-#endif
-
-#ifdef __KERNEL__
-#define _mon_printf printk
-#endif
-
#include "ieee754.h"
/*
@@ -50,11 +42,7 @@ static const char *const rtnames[] = {
void ieee754_xcpt(struct ieee754xctx *xcp)
{
-#if #system(sde) || defined(__KERNEL__)
- _mon_printf("floating point exception in \"%s\", type=%s\n",
- xcp->op, rtnames[xcp->rt]);
-#else
- fprintf(stderr, "floating point exception in \"%s\", type=%s\n",
+ printk("floating point exception in \"%s\", type=%s\n",
xcp->op, rtnames[xcp->rt]);
-#endif
}
+
diff --git a/arch/mips/math-emu/kernel_linkage.c b/arch/mips/math-emu/kernel_linkage.c
index 93c84f8b0..c73c42c17 100644
--- a/arch/mips/math-emu/kernel_linkage.c
+++ b/arch/mips/math-emu/kernel_linkage.c
@@ -40,9 +40,14 @@ extern struct mips_fpu_emulator_private fpuemuprivate;
void fpu_emulator_init_fpu(void)
{
+ static int first = 1;
int i;
+
+ if (first) {
+ first = 0;
+ printk("Algorithmics/MIPS FPU Emulator v1.4\n");
+ }
-/* printk("Algorithmics/MIPS FPU Emulator v1.4\n");*/
current->thread.fpu.soft.sr = 0;
for (i = 0; i < 32; i++) {
current->thread.fpu.soft.regs[i] = SIGNALLING_NAN;
@@ -87,3 +92,4 @@ int fpu_emulator_restore_context(struct sigcontext *sc)
return err;
}
+