X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=hw%2Fheathrow_pic.c;h=96eb6565fdd091c5029a5bec8f534bab53a6ea0a;hb=cd346349b45ef056f138a184f660b8c34c3213cc;hp=4980cef46706e4136b68dde054dc4c1875bc7f5f;hpb=c68ea7043f2ed4c631d1e3a4f35afe247d5ca063;p=qemu diff --git a/hw/heathrow_pic.c b/hw/heathrow_pic.c index 4980cef..96eb656 100644 --- a/hw/heathrow_pic.c +++ b/hw/heathrow_pic.c @@ -1,8 +1,8 @@ /* * Heathrow PIC support (standard PowerMac PIC) - * + * * Copyright (c) 2005 Fabrice Bellard - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -32,9 +32,9 @@ typedef struct HeathrowPIC { uint32_t level_triggered; } HeathrowPIC; -struct HeathrowPICS { +typedef struct HeathrowPICS { HeathrowPIC pics[2]; -}; +} HeathrowPICS; static inline int check_irq(HeathrowPIC *pic) { @@ -88,7 +88,7 @@ static uint32_t pic_readl (void *opaque, target_phys_addr_t addr) HeathrowPIC *pic; unsigned int n; uint32_t value; - + n = ((addr & 0xfff) - 0x10) >> 4; if (n >= 2) { value = 0; @@ -130,7 +130,7 @@ static CPUReadMemoryFunc *pic_read[] = { }; -void heathrow_pic_set_irq(void *opaque, int num, int level) +static void heathrow_pic_set_irq(void *opaque, int num, int level) { HeathrowPICS *s = opaque; HeathrowPIC *pic; @@ -156,13 +156,13 @@ void heathrow_pic_set_irq(void *opaque, int num, int level) heathrow_pic_update(s); } -HeathrowPICS *heathrow_pic_init(int *pmem_index) +qemu_irq *heathrow_pic_init(int *pmem_index) { HeathrowPICS *s; - + s = qemu_mallocz(sizeof(HeathrowPICS)); s->pics[0].level_triggered = 0; s->pics[1].level_triggered = 0x1ff00000; *pmem_index = cpu_register_io_memory(0, pic_read, pic_write, s); - return s; + return qemu_allocate_irqs(heathrow_pic_set_irq, s, 64); }