Page MenuHomeFreeBSD

Convert the x86 RTC driver to use new validated BCD<->timespec conversions

Authored by ian on Jan 1 2018, 11:52 PM.



New common routines were added to kern/subr_clock.c for converting between calendrical time expressed in BCD and struct timespec. The new functions return EINVAL on error, as expected when the clock hardware does not provide valid time.

Test Plan

This code compiles, but has not been tested yet on any x86 hardware (or emulation).

Code has now been run-tested (see PR 224813).

Diff Detail

rS FreeBSD src repository
Lint Skipped
Unit Tests Skipped
Build Status
Buildable 14249

Event Timeline

ian created this revision.Jan 1 2018, 11:52 PM
ian updated this revision to Diff 37730.Jan 10 2018, 4:21 PM

Follow changes in D13730... the conversion routines now take a bool flag to indicate whether AM/PM mode conversions need to be done. atrtc always operates in 24-hour mode.

ian edited the test plan for this revision. (Show Details)Jan 15 2018, 4:39 PM
ian abandoned this revision.Jan 16 2018, 4:57 AM

Committed as r328005