From c47a61894b35c51bb86a69ddfa638b617452b531 Mon Sep 17 00:00:00 2001 From: J William Piggott Date: Sat, 25 Mar 2017 14:29:24 -0400 Subject: hwclock: remove alpha cmos Remove alpha direct I/O access, use RTC instead: http://marc.info/?l=util-linux-ng&m=141682406902804 Resolves the alpha 2020 issue for util-linux: http://marc.info/?l=util-linux-ng&m=148387021519787 Now it is only the kernel's RTC problem. * sys-utils/hwclock.c: remove alpha cmos * sys-utils/hwclock-cmos.c: same * sys-utils/hwclock.h: same * sys-utils/hwclock.8.in: same Signed-off-by: J William Piggott --- sys-utils/hwclock.8.in | 110 +++++++++++++++---------------------------------- 1 file changed, 33 insertions(+), 77 deletions(-) (limited to 'sys-utils/hwclock.8.in') diff --git a/sys-utils/hwclock.8.in b/sys-utils/hwclock.8.in index d1e80272a..80a579f9e 100644 --- a/sys-utils/hwclock.8.in +++ b/sys-utils/hwclock.8.in @@ -44,22 +44,30 @@ discussion below, under .B \-\-getepoch .TQ .B \-\-setepoch -These functions are for Alpha machines only. +These functions are for Alpha machines only, and are only available +through the Linux kernel RTC driver. .sp -Read and set the kernel's Hardware Clock epoch value. +They are used to read and set the kernel's Hardware Clock epoch value. Epoch is the number of years into AD to which a zero year value in the -Hardware Clock refers. For example, if you are using the convention -that the year counter in your Hardware Clock contains the number of -full years since 1952, then the kernel's Hardware Clock epoch value -must be 1952. +Hardware Clock refers. For example, if the machine's BIOS sets the year +counter in the Hardware Clock to contain the number of full years since +1952, then the kernel's Hardware Clock epoch value must be 1952. .sp The \fB\%\-\-setepoch\fR function requires using the .B \%\-\-epoch -option to specify the year. -.sp +option to specify the year. For example: +.RS +.IP "" 4 +.B hwclock\ \-\-setepoch\ \-\-epoch=1952 +.PP +The RTC driver attempts to guess the correct epoch value, so setting it +may not be required. +.PP This epoch value is used whenever .B \%hwclock -reads or sets the Hardware Clock. +reads or sets the Hardware Clock on an Alpha machine. For ISA machines +the kernel uses the fixed Hardware Clock epoch of 1900. +.RE . .TP .B \-\-predict @@ -278,23 +286,27 @@ can help you understand how the program works. . .TP .B \-\-directisa -This option is meaningful for: ISA compatible machines including x86, and -x86_64; and Alpha (which has a similar Hardware Clock interface). For other -machines, it has no effect. This option tells +This option is meaningful for ISA compatible machines in the x86 and +x86_64 family. For other machines, it has no effect. This option tells .B \%hwclock to use explicit I/O instructions to access the Hardware Clock. Without this option, .B \%hwclock -will use the rtc device, which it assumes to be driven by the RTC device -driver. As of v2.26 it will no longer automatically use directisa when -the rtc driver is unavailable; this was causing an unsafe condition that -could allow two processes to access the Hardware Clock at the same time. -Direct hardware access from userspace should only be used for testing, -troubleshooting, and as a last resort when all other methods fail. See -the +will use the rtc device file, which it assumes to be driven by the Linux +RTC device driver. As of v2.26 it will no longer automatically use +directisa when the rtc driver is unavailable; this was causing an unsafe +condition that could allow two processes to access the Hardware Clock at +the same time. Direct hardware access from userspace should only be +used for testing, troubleshooting, and as a last resort when all other +methods fail. See the .BR \-\-rtc " option." . .TP +.BI \-\-epoch= year +This option is required when using the +.BR \%\-\-setepoch \ function. +. +.TP .BR \-f , \ \-\-rtc=\fIfilename\fR .RB "Override " \%hwclock 's default rtc device file name. Otherwise it will @@ -402,55 +414,6 @@ option to be used. See the discussion below, under .BR "The Adjust Function" . .RE . -.SH OPTIONS FOR ALPHA MACHINES ONLY -. -.TP -.B \-\-arc -This option is equivalent to -.B \%\-\-epoch=1980 -and is used to specify the most common epoch on Alphas -with an ARC console (although Ruffians have an epoch of 1900). -. -.TP -.BI \-\-epoch= year -Specifies the year which is the beginning of the Hardware Clock's epoch, -that is the number of years into AD to which a zero value in the -Hardware Clock's year counter refers. It is used together with the -.B \%\-\-setepoch -option to set the kernel's idea of the epoch of the Hardware Clock. -.sp -For example, on a Digital Unix machine: -.RS -.IP "" 4 -.B hwclock\ \-\-setepoch\ \-\-epoch=1952 -.RE -. -.TP -.B \-\-funky\-toy -.TQ -.B \-\-jensen -These two options specify what kind of Alpha machine you have. They -are invalid if you do not have an Alpha and are usually unnecessary -if you do; -.B \%hwclock -should be able to determine what it is running on when -.I \%/proc -is mounted. -.sp -.RB "The " \%\-\-jensen -option is used for Jensen models; -.B \%\-\-funky\-toy -means that the machine requires the UF bit instead of the UIP bit in -the Hardware Clock to detect a time transition. The "toy" in the option -name refers to the Time Of Year facility of the machine. -. -.TP -.B \-\-srm -This option is equivalent to -.B \%\-\-epoch=1900 -and is used to specify the most common epoch on Alphas -with an SRM console. -. .SH NOTES . .SS Clocks in a Linux System @@ -566,15 +529,8 @@ reasons that userspace programs are generally not supposed to do direct I/O and disable interrupts. .B \%hwclock provides it for testing, troubleshooting, and because it may be the -only method available on ISA compatible and Alpha systems which do not -have a working rtc device driver. -.PP -In the case of a Jensen Alpha, there is no way for -.B \%hwclock -to execute those I/O instructions, and so it uses instead the -.I \%/dev/port -device special file, which provides almost as low-level an interface to -the I/O subsystem. +only method available on ISA systems which do not have a working rtc +device driver. .PP On an m68k system, .B \%hwclock -- cgit v1.2.3-55-g7522