RTC stuff in 2.1.x

Alex Buell (alex.buell@tahallah.demon.co.uk)
Sat, 17 Oct 1998 14:30:02 -0400 (EDT)


Hi guys,

Now that I've got some time, I've been looking into the rtc stuff. The
current status in 2.1.x is that the i386 implementation of the rtc
mechanism requires one to include sys/ioctl.h and linux/mc146818rtc.h,
whilst the Sparc implementation has just asm-sparc[64]/rtc.h, the Alpha
implementation has asm-alpha/io.h.

I believe this is confusing, as there is no high level interface to the
rtc component of the system, instead each architecture has its own low
level implementation.

In the interest for portability of programs that utilises the rtc, it's
clearly necessary that there be an high level ioctl() interface to the
native implementation of the rtc stuff.

Proposal:

Create an architecture independent rtc.h file to go into linux which can
be used by all architectures that can use the rtc device in their system
to provide a high level ioctl() interface using the RTC_SET_TIME /
RTC_GET_TIME macros. (I appreciate that some architectures may not have a
rtc, in these cases it could just return something like -ENOTUSED?)

For i386 implementations, move the mc146818rtc.h to asm-i386 as it's
obviously in the wrong place (someone correct me if this is not true and
that different architectures actually uses this), and create a new rtc.h
to live in asm-i386.

For Alpha, create a rtc.h, and use RTC_SET_TIME/RTC_GET_TIME macros
etcetera.

For Sparc, modify the definitions in rtc.h to comply with the i386
conventions (RTC_xxx etc) - it still uses the old 2.0.x RTCSET/RTCGET
ioctl macros.

Thus, we get an universal rtc ioctl() interface that will enable a rtc
using program to be portable across these platforms, and then for each new
platform that Linux is ported to, it is a simple matter to implement the
ioctl() interface.

Comments, anyone?

Cheers,
Alex

--
 /\_/\  Legalise cannabis now! 
( o.o ) Grow some cannabis today!
 > ^ <  Peace, Love, Unity and Respect to all.

http://www.tahallah.demon.co.uk - *new* - rewritten for text browser users!

Linux tahallah 2.1.125 #49 SMP Fri Oct 9 07:18:02 EDT 1998 Two Intel Pentium Pro processors, 331.78 total bogomips, 32M RAM System library 2.0.98

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/