diff mbox

[Qemu-ppc,v6,3/5] Add one new file vga-pci.h

Message ID 1344081957-4717-4-git-send-email-zhlcindy@linux.vnet.ibm.com
State New
Headers show

Commit Message

Li Zhang Aug. 4, 2012, 12:05 p.m. UTC
Functions pci_vga_init() and pci_cirrus_vga_init() are declared
in pc.h. That prevents other platforms (e.g. sPAPR) to use them.

This patch is to create one new file vga-pci.h and move the
declarations to vga-pci.h, so that they can be shared by
all the platforms.

Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
---
 hw/cirrus_vga.c |    2 +-
 hw/pc.h         |    4 ----
 hw/vga-pci.c    |    2 +-
 hw/vga-pci.h    |   12 ++++++++++++
 4 files changed, 14 insertions(+), 6 deletions(-)
 create mode 100644 hw/vga-pci.h

Comments

Blue Swirl Aug. 4, 2012, 12:43 p.m. UTC | #1
On Sat, Aug 4, 2012 at 12:05 PM, Li Zhang <zhlcindy@gmail.com> wrote:
> Functions pci_vga_init() and pci_cirrus_vga_init() are declared
> in pc.h. That prevents other platforms (e.g. sPAPR) to use them.
>
> This patch is to create one new file vga-pci.h and move the
> declarations to vga-pci.h, so that they can be shared by
> all the platforms.
>
> Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
> ---
>  hw/cirrus_vga.c |    2 +-
>  hw/pc.h         |    4 ----
>  hw/vga-pci.c    |    2 +-
>  hw/vga-pci.h    |   12 ++++++++++++
>  4 files changed, 14 insertions(+), 6 deletions(-)
>  create mode 100644 hw/vga-pci.h
>
> diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
> index 623dd68..e8dcc6b 100644
> --- a/hw/cirrus_vga.c
> +++ b/hw/cirrus_vga.c
> @@ -27,8 +27,8 @@
>   *   available at http://home.worldonline.dk/~finth/
>   */
>  #include "hw.h"
> -#include "pc.h"
>  #include "pci.h"
> +#include "vga-pci.h"
>  #include "console.h"
>  #include "vga_int.h"
>  #include "loader.h"
> diff --git a/hw/pc.h b/hw/pc.h
> index 31ccb6f..e4db071 100644
> --- a/hw/pc.h
> +++ b/hw/pc.h
> @@ -189,14 +189,10 @@ static inline DeviceState *isa_vga_init(ISABus *bus)
>      return &dev->qdev;
>  }
>
> -DeviceState *pci_vga_init(PCIBus *bus);
>  int isa_vga_mm_init(target_phys_addr_t vram_base,
>                      target_phys_addr_t ctrl_base, int it_shift,
>                      MemoryRegion *address_space);
>
> -/* cirrus_vga.c */
> -DeviceState *pci_cirrus_vga_init(PCIBus *bus);
> -

This would break build, hurting future bisections. Please merge with 4/5.

>  /* ne2000.c */
>  static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
>  {
> diff --git a/hw/vga-pci.c b/hw/vga-pci.c
> index 37dc019..9abbada 100644
> --- a/hw/vga-pci.c
> +++ b/hw/vga-pci.c
> @@ -23,8 +23,8 @@
>   */
>  #include "hw.h"
>  #include "console.h"
> -#include "pc.h"
>  #include "pci.h"
> +#include "vga-pci.h"
>  #include "vga_int.h"
>  #include "pixel_ops.h"
>  #include "qemu-timer.h"
> diff --git a/hw/vga-pci.h b/hw/vga-pci.h
> new file mode 100644
> index 0000000..49abf13
> --- /dev/null
> +++ b/hw/vga-pci.h
> @@ -0,0 +1,12 @@
> +#ifndef VGA_PCI_H
> +#define VGA_PCI_H
> +
> +#include "qemu-common.h"
> +
> +/* vga-pci.c */
> +DeviceState *pci_vga_init(PCIBus *bus);
> +
> +/* cirrus_vga.c */
> +DeviceState *pci_cirrus_vga_init(PCIBus *bus);
> +
> +#endif
> --
> 1.7.7.6
>
>
Li Zhang Aug. 4, 2012, 12:49 p.m. UTC | #2
On Sat, Aug 4, 2012 at 8:43 PM, Blue Swirl <blauwirbel@gmail.com> wrote:
> On Sat, Aug 4, 2012 at 12:05 PM, Li Zhang <zhlcindy@gmail.com> wrote:
>> Functions pci_vga_init() and pci_cirrus_vga_init() are declared
>> in pc.h. That prevents other platforms (e.g. sPAPR) to use them.
>>
>> This patch is to create one new file vga-pci.h and move the
>> declarations to vga-pci.h, so that they can be shared by
>> all the platforms.
>>
>> Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
>> ---
>>  hw/cirrus_vga.c |    2 +-
>>  hw/pc.h         |    4 ----
>>  hw/vga-pci.c    |    2 +-
>>  hw/vga-pci.h    |   12 ++++++++++++
>>  4 files changed, 14 insertions(+), 6 deletions(-)
>>  create mode 100644 hw/vga-pci.h
>>
>> diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
>> index 623dd68..e8dcc6b 100644
>> --- a/hw/cirrus_vga.c
>> +++ b/hw/cirrus_vga.c
>> @@ -27,8 +27,8 @@
>>   *   available at http://home.worldonline.dk/~finth/
>>   */
>>  #include "hw.h"
>> -#include "pc.h"
>>  #include "pci.h"
>> +#include "vga-pci.h"
>>  #include "console.h"
>>  #include "vga_int.h"
>>  #include "loader.h"
>> diff --git a/hw/pc.h b/hw/pc.h
>> index 31ccb6f..e4db071 100644
>> --- a/hw/pc.h
>> +++ b/hw/pc.h
>> @@ -189,14 +189,10 @@ static inline DeviceState *isa_vga_init(ISABus *bus)
>>      return &dev->qdev;
>>  }
>>
>> -DeviceState *pci_vga_init(PCIBus *bus);
>>  int isa_vga_mm_init(target_phys_addr_t vram_base,
>>                      target_phys_addr_t ctrl_base, int it_shift,
>>                      MemoryRegion *address_space);
>>
>> -/* cirrus_vga.c */
>> -DeviceState *pci_cirrus_vga_init(PCIBus *bus);
>> -
>
> This would break build, hurting future bisections. Please merge with 4/5.
Oh, got it, thanks. I will do that later.
It seems that 1/5 and 2/5 also should be merged together. -:)

>
>>  /* ne2000.c */
>>  static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
>>  {
>> diff --git a/hw/vga-pci.c b/hw/vga-pci.c
>> index 37dc019..9abbada 100644
>> --- a/hw/vga-pci.c
>> +++ b/hw/vga-pci.c
>> @@ -23,8 +23,8 @@
>>   */
>>  #include "hw.h"
>>  #include "console.h"
>> -#include "pc.h"
>>  #include "pci.h"
>> +#include "vga-pci.h"
>>  #include "vga_int.h"
>>  #include "pixel_ops.h"
>>  #include "qemu-timer.h"
>> diff --git a/hw/vga-pci.h b/hw/vga-pci.h
>> new file mode 100644
>> index 0000000..49abf13
>> --- /dev/null
>> +++ b/hw/vga-pci.h
>> @@ -0,0 +1,12 @@
>> +#ifndef VGA_PCI_H
>> +#define VGA_PCI_H
>> +
>> +#include "qemu-common.h"
>> +
>> +/* vga-pci.c */
>> +DeviceState *pci_vga_init(PCIBus *bus);
>> +
>> +/* cirrus_vga.c */
>> +DeviceState *pci_cirrus_vga_init(PCIBus *bus);
>> +
>> +#endif
>> --
>> 1.7.7.6
>>
>>
Blue Swirl Aug. 4, 2012, 12:56 p.m. UTC | #3
On Sat, Aug 4, 2012 at 12:49 PM, Li Zhang <zhlcindy@gmail.com> wrote:
> On Sat, Aug 4, 2012 at 8:43 PM, Blue Swirl <blauwirbel@gmail.com> wrote:
>> On Sat, Aug 4, 2012 at 12:05 PM, Li Zhang <zhlcindy@gmail.com> wrote:
>>> Functions pci_vga_init() and pci_cirrus_vga_init() are declared
>>> in pc.h. That prevents other platforms (e.g. sPAPR) to use them.
>>>
>>> This patch is to create one new file vga-pci.h and move the
>>> declarations to vga-pci.h, so that they can be shared by
>>> all the platforms.
>>>
>>> Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
>>> ---
>>>  hw/cirrus_vga.c |    2 +-
>>>  hw/pc.h         |    4 ----
>>>  hw/vga-pci.c    |    2 +-
>>>  hw/vga-pci.h    |   12 ++++++++++++
>>>  4 files changed, 14 insertions(+), 6 deletions(-)
>>>  create mode 100644 hw/vga-pci.h
>>>
>>> diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
>>> index 623dd68..e8dcc6b 100644
>>> --- a/hw/cirrus_vga.c
>>> +++ b/hw/cirrus_vga.c
>>> @@ -27,8 +27,8 @@
>>>   *   available at http://home.worldonline.dk/~finth/
>>>   */
>>>  #include "hw.h"
>>> -#include "pc.h"
>>>  #include "pci.h"
>>> +#include "vga-pci.h"
>>>  #include "console.h"
>>>  #include "vga_int.h"
>>>  #include "loader.h"
>>> diff --git a/hw/pc.h b/hw/pc.h
>>> index 31ccb6f..e4db071 100644
>>> --- a/hw/pc.h
>>> +++ b/hw/pc.h
>>> @@ -189,14 +189,10 @@ static inline DeviceState *isa_vga_init(ISABus *bus)
>>>      return &dev->qdev;
>>>  }
>>>
>>> -DeviceState *pci_vga_init(PCIBus *bus);
>>>  int isa_vga_mm_init(target_phys_addr_t vram_base,
>>>                      target_phys_addr_t ctrl_base, int it_shift,
>>>                      MemoryRegion *address_space);
>>>
>>> -/* cirrus_vga.c */
>>> -DeviceState *pci_cirrus_vga_init(PCIBus *bus);
>>> -
>>
>> This would break build, hurting future bisections. Please merge with 4/5.
> Oh, got it, thanks. I will do that later.
> It seems that 1/5 and 2/5 also should be merged together. -:)

Because of global usb_enabled removal, yes.

>
>>
>>>  /* ne2000.c */
>>>  static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
>>>  {
>>> diff --git a/hw/vga-pci.c b/hw/vga-pci.c
>>> index 37dc019..9abbada 100644
>>> --- a/hw/vga-pci.c
>>> +++ b/hw/vga-pci.c
>>> @@ -23,8 +23,8 @@
>>>   */
>>>  #include "hw.h"
>>>  #include "console.h"
>>> -#include "pc.h"
>>>  #include "pci.h"
>>> +#include "vga-pci.h"
>>>  #include "vga_int.h"
>>>  #include "pixel_ops.h"
>>>  #include "qemu-timer.h"
>>> diff --git a/hw/vga-pci.h b/hw/vga-pci.h
>>> new file mode 100644
>>> index 0000000..49abf13
>>> --- /dev/null
>>> +++ b/hw/vga-pci.h
>>> @@ -0,0 +1,12 @@
>>> +#ifndef VGA_PCI_H
>>> +#define VGA_PCI_H
>>> +
>>> +#include "qemu-common.h"
>>> +
>>> +/* vga-pci.c */
>>> +DeviceState *pci_vga_init(PCIBus *bus);
>>> +
>>> +/* cirrus_vga.c */
>>> +DeviceState *pci_cirrus_vga_init(PCIBus *bus);
>>> +
>>> +#endif
>>> --
>>> 1.7.7.6
>>>
>>>
>
> --
>
> Best Regards
> -Li
diff mbox

Patch

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index 623dd68..e8dcc6b 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -27,8 +27,8 @@ 
  *   available at http://home.worldonline.dk/~finth/
  */
 #include "hw.h"
-#include "pc.h"
 #include "pci.h"
+#include "vga-pci.h"
 #include "console.h"
 #include "vga_int.h"
 #include "loader.h"
diff --git a/hw/pc.h b/hw/pc.h
index 31ccb6f..e4db071 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -189,14 +189,10 @@  static inline DeviceState *isa_vga_init(ISABus *bus)
     return &dev->qdev;
 }
 
-DeviceState *pci_vga_init(PCIBus *bus);
 int isa_vga_mm_init(target_phys_addr_t vram_base,
                     target_phys_addr_t ctrl_base, int it_shift,
                     MemoryRegion *address_space);
 
-/* cirrus_vga.c */
-DeviceState *pci_cirrus_vga_init(PCIBus *bus);
-
 /* ne2000.c */
 static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd)
 {
diff --git a/hw/vga-pci.c b/hw/vga-pci.c
index 37dc019..9abbada 100644
--- a/hw/vga-pci.c
+++ b/hw/vga-pci.c
@@ -23,8 +23,8 @@ 
  */
 #include "hw.h"
 #include "console.h"
-#include "pc.h"
 #include "pci.h"
+#include "vga-pci.h"
 #include "vga_int.h"
 #include "pixel_ops.h"
 #include "qemu-timer.h"
diff --git a/hw/vga-pci.h b/hw/vga-pci.h
new file mode 100644
index 0000000..49abf13
--- /dev/null
+++ b/hw/vga-pci.h
@@ -0,0 +1,12 @@ 
+#ifndef VGA_PCI_H
+#define VGA_PCI_H
+
+#include "qemu-common.h"
+
+/* vga-pci.c */
+DeviceState *pci_vga_init(PCIBus *bus);
+
+/* cirrus_vga.c */
+DeviceState *pci_cirrus_vga_init(PCIBus *bus);
+
+#endif