qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/4] rtc-test: introduce more update tests


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 2/4] rtc-test: introduce more update tests
Date: Wed, 26 Jul 2017 11:19:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 26/07/2017 03:28, Philippe Mathieu-Daudé wrote:
> On 07/25/2017 10:48 AM, Paolo Bonzini wrote:
>> Test divider reset and UIP behavior.
>>
>> Signed-off-by: Paolo Bonzini <address@hidden>
>> ---
>>   tests/rtc-test.c | 82
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>>   1 file changed, 81 insertions(+), 1 deletion(-)
>>
>> diff --git a/tests/rtc-test.c b/tests/rtc-test.c
>> index 798cf5e..d7a96cb 100644
>> --- a/tests/rtc-test.c
>> +++ b/tests/rtc-test.c
>> @@ -325,6 +325,30 @@ static void set_datetime_bcd(int h, int min, int
>> s, int d, int m, int y)
>>       cmos_write(RTC_DAY_OF_MONTH, d);
>>   }
>>   
> 
> I'm not sure why this function is in tests/ ...

Not sure I understand?

>> +static void set_datetime_dec(int h, int min, int s, int d, int m, int y)
>> +{
> 
> Following is set_time_regs()
> 
>> +    cmos_write(RTC_HOURS, h);
>> +    cmos_write(RTC_MINUTES, min);
>> +    cmos_write(RTC_SECONDS, s);
> 
> Maybe we can use here:
> 
> if (mode & REG_B_DM /* dec */) {
> 
>> +    cmos_write(RTC_YEAR, y % 100);
>> +    cmos_write(RTC_CENTURY, y / 100);
> 
> } else /* bcd */ {
> ...
> }
> 
> instead of having 2 set_datetime()

Because this function does not have a "mode" argument.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]