aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc_prep.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-07-02 18:11:44 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-07-02 18:11:44 +0000
commit3de388f676e936097f99fb58e8a58c5461eb696e (patch)
treeab63f67817bf6bb17c1245bbc2e08cae7fe8d2de /hw/ppc_prep.c
parent73133662c6db9e58d02716d9517b3947c853de68 (diff)
downloadqemu-3de388f676e936097f99fb58e8a58c5461eb696e.zip
qemu-3de388f676e936097f99fb58e8a58c5461eb696e.tar.gz
qemu-3de388f676e936097f99fb58e8a58c5461eb696e.tar.bz2
more generic i8259 support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1487 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/ppc_prep.c')
-rw-r--r--hw/ppc_prep.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 849635f..b287c6f 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -96,6 +96,14 @@ static uint32_t speaker_ioport_read(void *opaque, uint32_t addr)
return 0;
}
+static void pic_irq_request(void *opaque, int level)
+{
+ if (level)
+ cpu_interrupt(cpu_single_env, CPU_INTERRUPT_HARD);
+ else
+ cpu_reset_interrupt(cpu_single_env, CPU_INTERRUPT_HARD);
+}
+
/* PCI intack register */
/* Read-only register (?) */
static void _PPC_intack_write (void *opaque, target_phys_addr_t addr, uint32_t value)
@@ -108,7 +116,7 @@ static inline uint32_t _PPC_intack_read (target_phys_addr_t addr)
uint32_t retval = 0;
if (addr == 0xBFFFFFF0)
- retval = pic_intack_read(NULL);
+ retval = pic_intack_read(isa_pic);
// printf("%s: 0x%08x <= %d\n", __func__, addr, retval);
return retval;
@@ -505,8 +513,6 @@ CPUReadMemoryFunc *PPC_prep_io_read[] = {
&PPC_prep_io_readl,
};
-extern CPUPPCState *global_env;
-
#define NVRAM_SIZE 0x2000
/* PowerPC PREP hardware initialisation */
@@ -593,8 +599,7 @@ static void ppc_prep_init(int ram_size, int vga_ram_size, int boot_device,
vga_ram_size);
rtc_init(0x70, 8);
// openpic = openpic_init(0x00000000, 0xF0000000, 1);
- // pic_init(openpic);
- pic_init();
+ isa_pic = pic_init(pic_irq_request, cpu_single_env);
// pit = pit_init(0x40, 0);
serial_init(0x3f8, 4, serial_hds[0]);