Enabling and disabling the EPR capability (mpic_proxy) is a system
wide operation. As such, it belongs into the ppc.c file, since that's
where PPC specific machine wide logic happens.
Signed-off-by: Alexander Graf <agraf@suse.de>
#include "sysbus.h"
#include "pci/msi.h"
#include "qemu/bitops.h"
+#include "ppc.h"
//#define DEBUG_OPENPIC
static void openpic_gcr_write(OpenPICState *opp, uint64_t val)
{
- CPUArchState *env;
- int mpic_proxy = 0;
+ bool mpic_proxy = false;
if (val & GCR_RESET) {
openpic_reset(&opp->busdev.qdev);
/* Set external proxy mode */
if ((val & opp->mpic_mode_mask) == GCR_MODE_PROXY) {
- mpic_proxy = 1;
- }
- for (env = first_cpu; env != NULL; env = env->next_cpu) {
- env->mpic_proxy = mpic_proxy;
+ mpic_proxy = true;
}
+
+ ppce500_set_mpic_proxy(mpic_proxy);
}
static void openpic_gbl_write(void *opaque, hwaddr addr, uint64_t val,
env->irq_inputs = (void **)qemu_allocate_irqs(&ppce500_set_irq,
cpu, PPCE500_INPUT_NB);
}
+
+/* Enable or Disable the E500 EPR capability */
+void ppce500_set_mpic_proxy(bool enabled)
+{
+ CPUPPCState *env;
+
+ for (env = first_cpu; env != NULL; env = env->next_cpu) {
+ env->mpic_proxy = enabled;
+ }
+}
+
/*****************************************************************************/
/* PowerPC time base and decrementer emulation */
void ppc970_irq_init (CPUPPCState *env);
void ppcPOWER7_irq_init (CPUPPCState *env);
+void ppce500_set_mpic_proxy(bool enabled);
+
/* PPC machines for OpenBIOS */
enum {
ARCH_PREP = 0,