Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102742065
D38325.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
833 B
Referenced Files
None
Subscribers
None
D38325.diff
View Options
diff --git a/sys/x86/isa/atrtc.c b/sys/x86/isa/atrtc.c
--- a/sys/x86/isa/atrtc.c
+++ b/sys/x86/isa/atrtc.c
@@ -62,6 +62,11 @@
#include <machine/md_var.h>
#endif
+/* tunable to detect a power loss of the rtc */
+static bool atrtc_power_lost = false;
+SYSCTL_BOOL(_machdep, OID_AUTO, atrtc_power_lost, CTLFLAG_RD, &atrtc_power_lost,
+ false, "RTC lost power on last power cycle (probably caused by an emtpy cmos battery)");
+
/*
* atrtc_lock protects low-level access to individual hardware registers.
* atrtc_time_lock protects the entire sequence of accessing multiple registers
@@ -600,6 +605,7 @@
/* Look if we have a RTC present and the time is valid */
if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) {
+ atrtc_power_lost = true;
device_printf(dev, "WARNING: Battery failure indication\n");
return (EINVAL);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 2:30 PM (21 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14680128
Default Alt Text
D38325.diff (833 B)
Attached To
Mode
D38325: atrtc: expose power loss as sysctl
Attached
Detach File
Event Timeline
Log In to Comment