static bool emulate_arm_fpa11(CPUARMState *env, uint32_t opcode)
{
TaskState *ts = get_task_state(env_cpu(env));
- int rc = EmulateAll(opcode, &ts->fpa, env);
+ int rc = EmulateAll(opcode, &ts->fpa);
int raise, enabled;
if (rc == 0) {
FPA11* qemufpa = NULL;
-CPUARMState* user_registers;
/* Reset the FPA11 chip. Called to initialize and reset the emulator. */
void resetFPA11(void)
/* Emulate the instruction in the opcode. */
/* ??? This is not thread safe. */
-unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, CPUARMState* qregs)
+unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa)
{
unsigned int nRc = 0;
// unsigned long flags;
}
qemufpa=qfpa;
- user_registers=qregs;
-
-#if 0
- fprintf(stderr,"emulating FP insn 0x%08x, PC=0x%08x\n",
- opcode, qregs[ARM_REG_PC]);
-#endif
fpa11 = GET_FPA11();
if (fpa11->initflag == 0) /* good place for __builtin_expect */
#define GET_FPA11() (qemufpa)
-/*
- * The processes registers are always at the very top of the 8K
- * stack+task struct. Use the same method as 'current' uses to
- * reach them.
- */
-extern CPUARMState *user_registers;
-
-#define GET_USERREG() (user_registers)
-
/* Need task_struct */
//#include <linux/sched.h>
static inline unsigned int readRegister(unsigned int reg)
{
- return (user_registers->regs[(reg)]);
+ CPUARMState *env = cpu_env(current_cpu);
+ return env->regs[reg];
}
static inline void writeRegister(unsigned int x, unsigned int y)
{
-#if 0
- printf("writing %d to r%d\n",y,x);
-#endif
- user_registers->regs[(x)]=(y);
+ CPUARMState *env = cpu_env(current_cpu);
+ env->regs[x] = y;
}
static inline void writeConditionCodes(unsigned int x)
{
- cpsr_write(user_registers, x, CPSR_NZCV, CPSRWriteByInstr);
+ CPUARMState *env = cpu_env(current_cpu);
+ cpsr_write(env, x, CPSR_NZCV, CPSRWriteByInstr);
}
#define ARM_REG_PC 15
-unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, CPUARMState* qregs);
+unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa);
unsigned int EmulateCPDO(const unsigned int);
unsigned int EmulateCPDT(const unsigned int);