diff mbox series

[v2,3/3] hw/isa/i82378.c: use 1900 as a base year

Message ID 1557003754-26473-4-git-send-email-atar4qemu@gmail.com (mailing list archive)
State New, archived
Headers show
Series Improve 40p, make AIX 5.1 boot | expand

Commit Message

Artyom Tarasenko May 4, 2019, 9:02 p.m. UTC
AIX 5.1 expects the base year to be 1900. Adjust accordingly.

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
---
 hw/isa/i82378.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Mark Cave-Ayland May 5, 2019, 10:46 a.m. UTC | #1
On 04/05/2019 22:02, Artyom Tarasenko wrote:

> AIX 5.1 expects the base year to be 1900. Adjust accordingly.
> 
> Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
> Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
> ---
>  hw/isa/i82378.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
> index a5d67bc..546c928 100644
> --- a/hw/isa/i82378.c
> +++ b/hw/isa/i82378.c
> @@ -107,7 +107,9 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
>      isa = isa_create_simple(isabus, "i82374");
>  
>      /* timer */
> -    isa_create_simple(isabus, TYPE_MC146818_RTC);
> +    isa = isa_create(isabus, TYPE_MC146818_RTC);
> +    qdev_prop_set_int32(DEVICE(isa), "base_year", 1900);
> +    qdev_init_nofail(DEVICE(isa));
>  }
>  
>  static void i82378_init(Object *obj)

Is this true for the 82378 in general, or is it a particular quirk of the 40p
machine/PReP specification?


ATB,

Mark.
Philippe Mathieu-Daudé May 5, 2019, 3:19 p.m. UTC | #2
Hi Mark, Artyom.

On 5/5/19 12:46 PM, Mark Cave-Ayland wrote:
> On 04/05/2019 22:02, Artyom Tarasenko wrote:
> 
>> AIX 5.1 expects the base year to be 1900. Adjust accordingly.
>>
>> Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
>> Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
>> ---
>>  hw/isa/i82378.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
>> index a5d67bc..546c928 100644
>> --- a/hw/isa/i82378.c
>> +++ b/hw/isa/i82378.c
>> @@ -107,7 +107,9 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
>>      isa = isa_create_simple(isabus, "i82374");
>>  
>>      /* timer */
>> -    isa_create_simple(isabus, TYPE_MC146818_RTC);
>> +    isa = isa_create(isabus, TYPE_MC146818_RTC);
>> +    qdev_prop_set_int32(DEVICE(isa), "base_year", 1900);
>> +    qdev_init_nofail(DEVICE(isa));
>>  }
>>  
>>  static void i82378_init(Object *obj)
> 
> Is this true for the 82378 in general, or is it a particular quirk of the 40p
> machine/PReP specification?

This is indeed incorrect (see
https://lists.gnu.org/archive/html/qemu-devel/2019-04/msg02452.html) so:
Nack

Artyom: I did wrote the patch and included it in another series based on
top of Joel Stanley's
https://lists.gnu.org/archive/html/qemu-devel/2019-05/msg00657.html
which is also depending of another from Cédric, so I'll just extract it
and send directly, sorry for the delay.

Regards,

Phil.
Artyom Tarasenko May 6, 2019, 8:44 a.m. UTC | #3
On Sun, May 5, 2019 at 5:19 PM Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
>
> Hi Mark, Artyom.
>
> On 5/5/19 12:46 PM, Mark Cave-Ayland wrote:
> > On 04/05/2019 22:02, Artyom Tarasenko wrote:
> >
> >> AIX 5.1 expects the base year to be 1900. Adjust accordingly.
> >>
> >> Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
> >> Reviewed-by: Hervé Poussineau <hpoussin@reactos.org>
> >> ---
> >>  hw/isa/i82378.c | 4 +++-
> >>  1 file changed, 3 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
> >> index a5d67bc..546c928 100644
> >> --- a/hw/isa/i82378.c
> >> +++ b/hw/isa/i82378.c
> >> @@ -107,7 +107,9 @@ static void i82378_realize(PCIDevice *pci, Error **errp)
> >>      isa = isa_create_simple(isabus, "i82374");
> >>
> >>      /* timer */
> >> -    isa_create_simple(isabus, TYPE_MC146818_RTC);
> >> +    isa = isa_create(isabus, TYPE_MC146818_RTC);
> >> +    qdev_prop_set_int32(DEVICE(isa), "base_year", 1900);
> >> +    qdev_init_nofail(DEVICE(isa));
> >>  }
> >>
> >>  static void i82378_init(Object *obj)
> >
> > Is this true for the 82378 in general, or is it a particular quirk of the 40p
> > machine/PReP specification?
>
> This is indeed incorrect (see
> https://lists.gnu.org/archive/html/qemu-devel/2019-04/msg02452.html) so:
> Nack
>
> Artyom: I did wrote the patch and included it in another series based on
> top of Joel Stanley's
> https://lists.gnu.org/archive/html/qemu-devel/2019-05/msg00657.html
> which is also depending of another from Cédric, so I'll just extract it
> and send directly, sorry for the delay.

Thanks, it works for me.
diff mbox series

Patch

diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
index a5d67bc..546c928 100644
--- a/hw/isa/i82378.c
+++ b/hw/isa/i82378.c
@@ -107,7 +107,9 @@  static void i82378_realize(PCIDevice *pci, Error **errp)
     isa = isa_create_simple(isabus, "i82374");
 
     /* timer */
-    isa_create_simple(isabus, TYPE_MC146818_RTC);
+    isa = isa_create(isabus, TYPE_MC146818_RTC);
+    qdev_prop_set_int32(DEVICE(isa), "base_year", 1900);
+    qdev_init_nofail(DEVICE(isa));
 }
 
 static void i82378_init(Object *obj)