![]() ![]() RTC_UIE_ON, RTC_UIE_OFF Enable or disable the interrupt on every clock update, for RTCs that support this once-per-second interrupt. RTC_AIE_ON, RTC_AIE_OFF Enable or disable the alarm interrupt, for RTCs that support alarms. (This file contains the value 64 by default.) ![]() Privileged process (i.e., one having the CAP_SYS_RESOURCE capability) can set frequencies above the value specified in The set of allowable frequencies is the multiples of two in the range 2 to 8192. The value is the frequency in interrupts per second. The third ioctl(2) argument is an unsigned long * or an unsigned long, Using the RTC_PIE_ON, RTC_PIE_OFF requests. The periodic interrupt must be separately enabled or disabled RTC_IRQP_READ, RTC_IRQP_SET Read and set the frequency for periodic interrupts, for RTCs that support periodic interrupts. Tm_hour fields of this structure are used. The third ioctl(2) argument is a pointer to an rtc_time structure. The alarm interrupt must be separately enabled or disabled using the RTC_AIE_ON, RTC_ALM_READ, RTC_ALM_SET Read and set the alarm time, for RTCs that support alarms. Process must be privileged (i.e., have the CAP_SYS_TIME capability). ![]() RTC_SET_TIME Sets this RTC's time to the time specified by the rtc_time structure pointed to by the third ioctl(2) argument. Should be passed as the third ioctl(2) argument. } The fields in this structure have the same meaning and ranges as for the tm structure described in gmtime(3). RTC_RD_TIME Returns this RTC's time in the following structure: Ioctl(2) interface The following ioctl(2) requests are defined on file descriptors connected to RTC devices: Integer, of which the least significant byte contains a bit mask encoding the types of interrupt that occurred, while the remaining 3 bytes contain the number Following the interrupt, the process can read a long On read(2)Īnd select(2) the calling process is blocked until the next interrupt from that RTC is received. The /dev/rtc (or /dev/rtc0, /dev/rtc1, etc.) device can be opened only once (until it is closed) and it is read-only. On some systems, the battery backed RTC can't issue interrupts, but another one can. Which can resume the system from a low power state such as Suspend-to-RAM (STR, called S3 in ACPI systems), Hibernation (called S4 in ACPI systems), or even On many systems, the alarm interrupt can be configured as a system wakeup event, On reaching a previously specified alarm time.Įach of those interrupt sources can be enabled or disabled separately. On every clock update (i.e., once per second) Īt periodic intervals with a frequency that can be set to any power-of-2 multiple in the range 2 Hz to 8192 Hz RTC functionality RTCs can be read and written with hwclock(8), or directly with the ioctl requests listed below.īesides tracking the date and time, many RTCs can also generate interrupts Using another clock, maybe across the network or by entering that data manually. Systems without an RTC need to set the system clock So at boot time, and after resuming fromĪ system low power state, the system clock will often be set to the current wall clock time using an RTC. Until it is initialized, the system clock can only report time since system boot. It is supposed to report wall clock time, which RTCs also do.Ī key difference between an RTC and the system clock is that RTCs run even when the system is in a low power state (including "off"), and the system clockĬan't. (One common implementation counts timer interrupts, once per "jiffy", at a frequency of 100, 250, or 1000 Hz.) That is, The system clock reports seconds and microseconds since a start point, defined to be the POSIXĮpoch: 00:00:00 +0000 (UTC). Time(2), as well as setting timestamps on files, etc. RTC vs system clock RTCs should not be confused with the system clock, which is a software clock maintained by the kernel and used to implement gettimeofday(2) and They usually won't offer the same functionality Non-PC systems, such as embedded systems built around system-on-chip processors, use other implementations. Integrated into the mainboard's chipset (south bridge), and uses a replaceable coin-sized backup battery. RTCs often provide alarms and other interrupts.Īll i386 PCs, and ACPI-based systems, have an RTC that is compatible with the Motorola MC146818 chip on the original PC/AT. Has battery backup power so that it tracks the time even while the computer is turned off. These are called "Real Time Clocks" (RTCs). Most computers have one or more hardware clocks which record the current "wall clock" time. This is the interface to drivers for real-time clocks (RTCs). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |