tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: (tiny) patch review: return if RTC diag fails
On Tue, 18 Feb 2025, Emile `iMil' Heitor wrote:
if ((mc146818_read(NULL, MC_REGD) & MC_REGD_VRT) == 0)
return (-1);
My bad, this test assumes the chip is replying something valid, what
we want to test is that bits 0 to 6 are set to 0, so in startrtclock()
it would be:
/* RTC is present, bits 0 to 6 are 0 */
if ((mc146818_read(NULL, MC_REGD) & 0x7f) != 0)
return;
------------------------------------------------------------------------
Emile `iMil' Heitor <imil@{home.imil.net,NetBSD.org}> | https://imil.net
Home |
Main Index |
Thread Index |
Old Index