mbox series

[PATCH-for-6.1,0/3] hw/sparc/sun4m: Introduce Sun4mMachineClass to access sun4m_hwdefs

Message ID 20210407175305.1771069-1-f4bug@amsat.org (mailing list archive)
Headers show
Series hw/sparc/sun4m: Introduce Sun4mMachineClass to access sun4m_hwdefs | expand

Message

Philippe Mathieu-Daudé April 7, 2021, 5:53 p.m. UTC
Hi Mark,

This series QOM'ify a bit more the sun4m machines.
I need it for a further memory maxsize check.
It is mostly code movement (and the diff-stat is good).

Philippe Mathieu-Daudé (3):
  hw/sparc/sun4m: Introduce TYPE_SUN4M_MACHINE and Sun4mMachineClass
  hw/sparc/sun4m: Factor out sun4m_machine_class_common_init()
  hw/sparc/sun4m: Make sun4m_hwdefs a Sun4mMachineClass field

 hw/sparc/sun4m.c | 178 ++++++++++++++++++-----------------------------
 1 file changed, 69 insertions(+), 109 deletions(-)

Comments

Mark Cave-Ayland May 2, 2021, 11:20 a.m. UTC | #1
On 07/04/2021 18:53, Philippe Mathieu-Daudé wrote:

> Hi Mark,
> 
> This series QOM'ify a bit more the sun4m machines.
> I need it for a further memory maxsize check.
> It is mostly code movement (and the diff-stat is good).
> 
> Philippe Mathieu-Daudé (3):
>    hw/sparc/sun4m: Introduce TYPE_SUN4M_MACHINE and Sun4mMachineClass
>    hw/sparc/sun4m: Factor out sun4m_machine_class_common_init()
>    hw/sparc/sun4m: Make sun4m_hwdefs a Sun4mMachineClass field
> 
>   hw/sparc/sun4m.c | 178 ++++++++++++++++++-----------------------------
>   1 file changed, 69 insertions(+), 109 deletions(-)

Hi Phil,

Possibly it might be worth having an abstract TYPE_SUN4M_MACHINE and then for each 
sun4m machine to have that as a parent type? This would allow you to move 
sun4m_machine_class_common_init() directly into the abstract 
sun4m_machine_class_init() rather than having to call a function from within each 
individual class init function.

No objection to the cleanup though :)


ATB,

Mark.
Philippe Mathieu-Daudé May 2, 2021, 5:40 p.m. UTC | #2
On 5/2/21 1:20 PM, Mark Cave-Ayland wrote:
> On 07/04/2021 18:53, Philippe Mathieu-Daudé wrote:
> 
>> Hi Mark,
>>
>> This series QOM'ify a bit more the sun4m machines.
>> I need it for a further memory maxsize check.
>> It is mostly code movement (and the diff-stat is good).
>>
>> Philippe Mathieu-Daudé (3):
>>    hw/sparc/sun4m: Introduce TYPE_SUN4M_MACHINE and Sun4mMachineClass
>>    hw/sparc/sun4m: Factor out sun4m_machine_class_common_init()
>>    hw/sparc/sun4m: Make sun4m_hwdefs a Sun4mMachineClass field
>>
>>   hw/sparc/sun4m.c | 178 ++++++++++++++++++-----------------------------
>>   1 file changed, 69 insertions(+), 109 deletions(-)
> 
> Hi Phil,
> 
> Possibly it might be worth having an abstract TYPE_SUN4M_MACHINE and
> then for each sun4m machine to have that as a parent type?

This is what this series does...

> This would
> allow you to move sun4m_machine_class_common_init() directly into the
> abstract sun4m_machine_class_init() rather than having to call a
> function from within each individual class init function.

OK, can do that.

Regards,

Phil.