2003-10-01 04:36:07 +08:00
|
|
|
#ifndef EXEC_SPARC_H
|
|
|
|
#define EXEC_SPARC_H 1
|
2005-07-02 22:31:34 +08:00
|
|
|
#include "config.h"
|
2007-03-19 22:47:40 +08:00
|
|
|
#include "dyngen-exec.h"
|
2003-10-01 04:36:07 +08:00
|
|
|
|
|
|
|
register struct CPUSPARCState *env asm(AREG0);
|
2005-07-02 22:31:34 +08:00
|
|
|
|
2004-10-01 05:55:55 +08:00
|
|
|
#define DT0 (env->dt0)
|
|
|
|
#define DT1 (env->dt1)
|
2007-11-26 02:40:20 +08:00
|
|
|
#define QT0 (env->qt0)
|
|
|
|
#define QT1 (env->qt1)
|
2003-10-01 04:36:07 +08:00
|
|
|
|
|
|
|
#include "cpu.h"
|
|
|
|
#include "exec-all.h"
|
|
|
|
|
2004-10-13 06:01:28 +08:00
|
|
|
static inline void env_to_regs(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void regs_to_env(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-08-30 04:50:21 +08:00
|
|
|
/* op_helper.c */
|
2008-05-28 01:35:30 +08:00
|
|
|
void do_interrupt(CPUState *env);
|
2005-02-08 07:10:53 +08:00
|
|
|
|
2009-07-12 16:35:31 +08:00
|
|
|
static inline int cpu_interrupts_enabled(CPUState *env1)
|
|
|
|
{
|
|
|
|
#if !defined (TARGET_SPARC64)
|
|
|
|
if (env1->psret != 0)
|
|
|
|
return 1;
|
|
|
|
#else
|
|
|
|
if (env1->pstate & PS_IE)
|
|
|
|
return 1;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-04-25 02:03:20 +08:00
|
|
|
static inline int cpu_has_work(CPUState *env1)
|
|
|
|
{
|
|
|
|
return (env1->interrupt_request & CPU_INTERRUPT_HARD) &&
|
2009-07-12 16:35:31 +08:00
|
|
|
cpu_interrupts_enabled(env1);
|
2009-04-25 02:03:20 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-05-10 18:12:00 +08:00
|
|
|
static inline int cpu_halted(CPUState *env1) {
|
|
|
|
if (!env1->halted)
|
2007-06-04 01:44:37 +08:00
|
|
|
return 0;
|
2009-04-25 02:03:20 +08:00
|
|
|
if (cpu_has_work(env1)) {
|
2008-05-10 18:12:00 +08:00
|
|
|
env1->halted = 0;
|
2007-06-04 01:44:37 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return EXCP_HALTED;
|
|
|
|
}
|
|
|
|
|
2003-10-01 04:36:07 +08:00
|
|
|
#endif
|