#include "qemu/error-report.h"
#include "qapi/visitor.h"
#include "hw/qdev-properties.h"
+#include "hw/ppc/ppc.h"
//#define PPC_DUMP_CPU
//#define PPC_DEBUG_SPR
//#define PPC_DUMP_SPR_ACCESSES
/* #define USE_APPLE_GDB */
-/* For user-mode emulation, we don't emulate any IRQ controller */
-#if defined(CONFIG_USER_ONLY)
-#define PPC_IRQ_INIT_FN(name) \
-static inline void glue(glue(ppc, name),_irq_init) (CPUPPCState *env) \
-{ \
-}
-#else
-#define PPC_IRQ_INIT_FN(name) \
-void glue(glue(ppc, name),_irq_init) (CPUPPCState *env);
-#endif
-
-PPC_IRQ_INIT_FN(40x);
-PPC_IRQ_INIT_FN(6xx);
-PPC_IRQ_INIT_FN(970);
-PPC_IRQ_INIT_FN(POWER7);
-PPC_IRQ_INIT_FN(e500);
-
/* Generic callbacks:
* do nothing but store/retrieve spr value
*/
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc40x_irq_init(env);
+ ppc40x_irq_init(ppc_env_get_cpu(env));
SET_FIT_PERIOD(12, 16, 20, 24);
SET_WDT_PERIOD(16, 20, 24, 28);
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc40x_irq_init(env);
+ ppc40x_irq_init(ppc_env_get_cpu(env));
SET_FIT_PERIOD(12, 16, 20, 24);
SET_WDT_PERIOD(16, 20, 24, 28);
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc40x_irq_init(env);
+ ppc40x_irq_init(ppc_env_get_cpu(env));
SET_FIT_PERIOD(12, 16, 20, 24);
SET_WDT_PERIOD(16, 20, 24, 28);
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc40x_irq_init(env);
+ ppc40x_irq_init(ppc_env_get_cpu(env));
SET_FIT_PERIOD(8, 12, 16, 20);
SET_WDT_PERIOD(16, 20, 24, 28);
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc40x_irq_init(env);
+ ppc40x_irq_init(ppc_env_get_cpu(env));
SET_FIT_PERIOD(8, 12, 16, 20);
SET_WDT_PERIOD(16, 20, 24, 28);
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc40x_irq_init(env);
+ ppc40x_irq_init(ppc_env_get_cpu(env));
SET_FIT_PERIOD(8, 12, 16, 20);
SET_WDT_PERIOD(16, 20, 24, 28);
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc40x_irq_init(env);
+ ppc40x_irq_init(ppc_env_get_cpu(env));
SET_FIT_PERIOD(8, 12, 16, 20);
SET_WDT_PERIOD(16, 20, 24, 28);
init_excp_BookE(env);
env->dcache_line_size = 32;
env->icache_line_size = 32;
- ppc40x_irq_init(env);
+ ppc40x_irq_init(ppc_env_get_cpu(env));
SET_FIT_PERIOD(12, 16, 20, 24);
SET_WDT_PERIOD(20, 24, 28, 32);
init_excp_BookE(env);
env->dcache_line_size = 32;
env->icache_line_size = 32;
- ppc40x_irq_init(env);
+ ppc40x_irq_init(ppc_env_get_cpu(env));
SET_FIT_PERIOD(12, 16, 20, 24);
SET_WDT_PERIOD(20, 24, 28, 32);
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(G2)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(G2LE)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(e300)(ObjectClass *oc, void *data)
init_excp_e200(env, ivpr_mask);
/* Allocate hardware IRQ controller */
- ppce500_irq_init(env);
+ ppce500_irq_init(ppc_env_get_cpu(env));
}
static void init_proc_e500v1(CPUPPCState *env)
env->dcache_line_size = 32;
env->icache_line_size = 64;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(601)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(602)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(603)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(603E)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(604)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(604E)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(740)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(750)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(750cl)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(750cx)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(750fx)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(750gx)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(745)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(755)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(7400)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(7410)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(7440)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(7450)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(7445)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(7455)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(7457)(ObjectClass *oc, void *data)
env->dcache_line_size = 32;
env->icache_line_size = 32;
/* Allocate hardware IRQ controller */
- ppc6xx_irq_init(env);
+ ppc6xx_irq_init(ppc_env_get_cpu(env));
}
POWERPC_FAMILY(e600)(ObjectClass *oc, void *data)
case BOOK3S_CPU_970:
case BOOK3S_CPU_POWER5PLUS:
init_excp_970(env);
- ppc970_irq_init(env);
+ ppc970_irq_init(ppc_env_get_cpu(env));
break;
case BOOK3S_CPU_POWER7:
case BOOK3S_CPU_POWER8:
init_excp_POWER7(env);
- ppcPOWER7_irq_init(env);
+ ppcPOWER7_irq_init(ppc_env_get_cpu(env));
break;
default:
g_assert_not_reached();