From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199605231521.IAA30373@koala.azstarnet.com> Date: Thu, 23 May 1996 08:20:46 -0701 From: David Mosberger-Tang Subject: Re: `/sbin/clock' for the Jensen OK, I integrated your changes. There will be other changes to util-linux so it is able to accomodate glibc, so I thought it would be best if I have an uptodate source tree. Could you verify that this patch still works on the Jensen? --david -- --- clock.8~ Wed Jan 17 21:43:09 1996 +++ clock.8 Thu May 23 08:13:27 1996 @@ -22,7 +22,10 @@ Indicates that the CMOS clock is set to Universal Time. .TP .B \-A -Indicates that the clock is in the ARC Console's time +Indicates that the clock is in the ARC Console's time. +.TP +.B \-J +Indicates that the system is a Jensen (DEC Alpha) machine. .TP .B \-r Read CMOS clock and print the result to stdout. --- clock.c~ Wed Jan 17 21:42:55 1996 +++ clock.c Thu May 23 08:17:11 1996 @@ -133,9 +133,13 @@ * V1.4.2axp: jestabro@amt.tay1.dec.com (Jay Estabrook) * Wed Jan 10 1996, modified to use /dev/port, not inb/outb. * Reason: LIBC support for inb/outb is hardwired to Alpha EV4 CPU. + * + * V1.4.3axp: ost@coments.rwth-aachen.de (Martin Ostermann) + * Wed May 22 1996, modified to support J option for the Jensen + * Reason: on a Jensen the RTC is at 0x170 instead of 0x70 */ -#define VERSION "1.4.2axp" +#define VERSION "1.4.3axp" #define USE_DEV_PORT @@ -165,6 +169,7 @@ int universal = 0; int debug = 0; int arcit = 0; +int clockport = 0x70; const char *pgm_name; #ifdef USE_DEV_PORT @@ -182,6 +187,7 @@ " a: get system time and adjust CMOS clock\n" " u: CMOS clock is in universal time\n" " A: CMOS clock is in Alpha ARC console time\n" + " J: we are running on an Alpha Jensen\n" " v: print version (" VERSION ") and exit\n", pgm_name ); exit (1); @@ -221,14 +227,14 @@ #ifdef USE_DEV_PORT v = reg | 0x80; - lseek(dev_port_fd, 0x70, 0); + lseek(dev_port_fd, clockport, 0); write(dev_port_fd, &v, 1); - lseek(dev_port_fd, 0x71, 0); + lseek(dev_port_fd, clockport + 1, 0); read(dev_port_fd, &v, 1); return v; #else - outb (reg | 0x80, 0x70); - return inb (0x71); + outb (reg | 0x80, clockport); + return inb (clockport + 1); #endif } @@ -238,14 +244,14 @@ #ifdef USE_DEV_PORT v = reg | 0x80; - lseek(dev_port_fd, 0x70, 0); + lseek(dev_port_fd, clockport, 0); write(dev_port_fd, &v, 1); v = val & 0xff; - lseek(dev_port_fd, 0x71, 0); + lseek(dev_port_fd, clockport + 1, 0); write(dev_port_fd, &v, 1); #else - outb (reg | 0x80, 0x70); - outb (val, 0x71); + outb (reg | 0x80, clockport); + outb (val, clockport + 1); #endif return 0; } @@ -303,7 +309,7 @@ int adjustment = 0; pgm_name = argv[0]; - while ((arg = getopt (argc, argv, "rwsuaADv")) != -1) + while ((arg = getopt (argc, argv, "rwsuaAJDv")) != -1) { switch (arg) { @@ -324,6 +330,9 @@ break; case 'A': arcit = 1; + break; + case 'J': + clockport = 0x170; break; case 'D': debug = 1;