Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11085
b: refs/heads/master
c: 4a99d1e
h: refs/heads/master
i:
  11083: 07c0476
v: v3
  • Loading branch information
Ralf Baechle committed Oct 29, 2005
1 parent 9e78700 commit c33571e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 37 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: baee502ce2048aad5ec56acd24c950083a4697e7
refs/heads/master: 4a99d1e25b98c239d6e746af6f79679c413fb712
48 changes: 24 additions & 24 deletions trunk/arch/mips/math-emu/cp1emu.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static int fpux_emu(struct pt_regs *,

/* Further private data for which no space exists in mips_fpu_soft_struct */

struct mips_fpu_emulator_private fpuemuprivate;
struct mips_fpu_emulator_stats fpuemustats;

/* Control registers */

Expand Down Expand Up @@ -210,7 +210,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
unsigned int cond;

if (get_user(ir, (mips_instruction *) xcp->cp0_epc)) {
fpuemuprivate.stats.errors++;
fpuemustats.errors++;
return SIGBUS;
}

Expand Down Expand Up @@ -241,7 +241,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
return SIGILL;
}
if (get_user(ir, (mips_instruction *) emulpc)) {
fpuemuprivate.stats.errors++;
fpuemustats.errors++;
return SIGBUS;
}
/* __compute_return_epc() will have updated cp0_epc */
Expand All @@ -254,17 +254,17 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
}

emul:
fpuemuprivate.stats.emulated++;
fpuemustats.emulated++;
switch (MIPSInst_OPCODE(ir)) {
#ifndef SINGLE_ONLY_FPU
case ldc1_op:{
u64 *va = (void *) (xcp->regs[MIPSInst_RS(ir)] +
MIPSInst_SIMM(ir));
u64 val;

fpuemuprivate.stats.loads++;
fpuemustats.loads++;
if (get_user(val, va)) {
fpuemuprivate.stats.errors++;
fpuemustats.errors++;
return SIGBUS;
}
DITOREG(val, MIPSInst_RT(ir));
Expand All @@ -276,10 +276,10 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
MIPSInst_SIMM(ir));
u64 val;

fpuemuprivate.stats.stores++;
fpuemustats.stores++;
DIFROMREG(val, MIPSInst_RT(ir));
if (put_user(val, va)) {
fpuemuprivate.stats.errors++;
fpuemustats.errors++;
return SIGBUS;
}
break;
Expand All @@ -291,9 +291,9 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
MIPSInst_SIMM(ir));
u32 val;

fpuemuprivate.stats.loads++;
fpuemustats.loads++;
if (get_user(val, va)) {
fpuemuprivate.stats.errors++;
fpuemustats.errors++;
return SIGBUS;
}
#ifdef SINGLE_ONLY_FPU
Expand All @@ -311,7 +311,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
MIPSInst_SIMM(ir));
u32 val;

fpuemuprivate.stats.stores++;
fpuemustats.stores++;
#ifdef SINGLE_ONLY_FPU
if (MIPSInst_RT(ir) & 1) {
/* illegal register in single-float mode */
Expand All @@ -320,7 +320,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)
#endif
SIFROMREG(val, MIPSInst_RT(ir));
if (put_user(val, va)) {
fpuemuprivate.stats.errors++;
fpuemustats.errors++;
return SIGBUS;
}
break;
Expand Down Expand Up @@ -460,7 +460,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx)

if (get_user(ir, (mips_instruction *)
(void *) xcp->cp0_epc)) {
fpuemuprivate.stats.errors++;
fpuemustats.errors++;
return SIGBUS;
}

Expand Down Expand Up @@ -626,7 +626,7 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
{
unsigned rcsr = 0; /* resulting csr */

fpuemuprivate.stats.cp1xops++;
fpuemustats.cp1xops++;

switch (MIPSInst_FMA_FFMT(ir)) {
case s_fmt:{ /* 0 */
Expand All @@ -641,9 +641,9 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
va = (void *) (xcp->regs[MIPSInst_FR(ir)] +
xcp->regs[MIPSInst_FT(ir)]);

fpuemuprivate.stats.loads++;
fpuemustats.loads++;
if (get_user(val, va)) {
fpuemuprivate.stats.errors++;
fpuemustats.errors++;
return SIGBUS;
}
#ifdef SINGLE_ONLY_FPU
Expand All @@ -661,7 +661,7 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
va = (void *) (xcp->regs[MIPSInst_FR(ir)] +
xcp->regs[MIPSInst_FT(ir)]);

fpuemuprivate.stats.stores++;
fpuemustats.stores++;
#ifdef SINGLE_ONLY_FPU
if (MIPSInst_FS(ir) & 1) {
/* illegal register in single-float
Expand All @@ -673,7 +673,7 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,

SIFROMREG(val, MIPSInst_FS(ir));
if (put_user(val, va)) {
fpuemuprivate.stats.errors++;
fpuemustats.errors++;
return SIGBUS;
}
break;
Expand Down Expand Up @@ -735,9 +735,9 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
va = (void *) (xcp->regs[MIPSInst_FR(ir)] +
xcp->regs[MIPSInst_FT(ir)]);

fpuemuprivate.stats.loads++;
fpuemustats.loads++;
if (get_user(val, va)) {
fpuemuprivate.stats.errors++;
fpuemustats.errors++;
return SIGBUS;
}
DITOREG(val, MIPSInst_FD(ir));
Expand All @@ -747,10 +747,10 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
va = (void *) (xcp->regs[MIPSInst_FR(ir)] +
xcp->regs[MIPSInst_FT(ir)]);

fpuemuprivate.stats.stores++;
fpuemustats.stores++;
DIFROMREG(val, MIPSInst_FS(ir));
if (put_user(val, va)) {
fpuemuprivate.stats.errors++;
fpuemustats.errors++;
return SIGBUS;
}
break;
Expand Down Expand Up @@ -818,7 +818,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_soft_struct *ctx,
#endif
} rv; /* resulting value */

fpuemuprivate.stats.cp1ops++;
fpuemustats.cp1ops++;
switch (rfmt = (MIPSInst_FFMT(ir) & 0xf)) {
case s_fmt:{ /* 0 */
union {
Expand Down Expand Up @@ -1299,7 +1299,7 @@ int fpu_emulator_cop1Handler(int xcptno, struct pt_regs *xcp,
prevepc = xcp->cp0_epc;

if (get_user(insn, (mips_instruction *) xcp->cp0_epc)) {
fpuemuprivate.stats.errors++;
fpuemustats.errors++;
return SIGBUS;
}
if (insn == 0)
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/mips/math-emu/dsemul.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ int mips_dsemul(struct pt_regs *regs, mips_instruction ir, unsigned long cpc)
err |= __put_user(cpc, &fr->epc);

if (unlikely(err)) {
fpuemuprivate.stats.errors++;
fpuemustats.errors++;
return SIGBUS;
}

Expand Down Expand Up @@ -138,7 +138,7 @@ int do_dsemulret(struct pt_regs *xcp)
err |= __get_user(cookie, &fr->cookie);

if (unlikely(err || (insn != BADINST) || (cookie != BD_COOKIE))) {
fpuemuprivate.stats.errors++;
fpuemustats.errors++;
return 0;
}

Expand Down
18 changes: 8 additions & 10 deletions trunk/include/asm-mips/fpu_emulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@
#ifndef _ASM_FPU_EMULATOR_H
#define _ASM_FPU_EMULATOR_H

struct mips_fpu_emulator_private {
struct {
unsigned int emulated;
unsigned int loads;
unsigned int stores;
unsigned int cp1ops;
unsigned int cp1xops;
unsigned int errors;
} stats;
struct mips_fpu_emulator_stats {
unsigned int emulated;
unsigned int loads;
unsigned int stores;
unsigned int cp1ops;
unsigned int cp1xops;
unsigned int errors;
};

extern struct mips_fpu_emulator_private fpuemuprivate;
extern struct mips_fpu_emulator_stats fpuemustats;

#endif /* _ASM_FPU_EMULATOR_H */

0 comments on commit c33571e

Please sign in to comment.