Re: 2.2.11pre5 compile error in hfmodem

Alan Modra (alan@SPRI.Levels.UniSA.Edu.Au)
Sun, 8 Aug 1999 21:50:26 +0930 (CST)


On Sat, 7 Aug 1999, Alan Cox wrote:

> > refclock.c:136: fixed or forbidden register 0 (ax) was spilled for class AREG.
> > refclock.c:137: Invalid `asm' statement:
> > refclock.c:137: fixed or forbidden register 0 (ax) was spilled for class AREG.
> > make[4]: *** [refclock.o] Error 1
> >
> > $ gcc -v
> > Reading specs from /usr/lib/gcc-lib/i386-linux/2.95/specs
> > gcc version 2.95 19990728 (release)
>
> Use an older compiler I guess. It does build with egcs-1.1.2

Fix the bogus asm, and in the 2.3 tree too. Something like the following
should do.

I haven't tested this as I don't have one of these gizmos, but the
following compiles with both gcc-2.7.2.3 and gcc-2.96, and the assembly
looks at least half reasonable.

--- linux-2.2.10/drivers/char/hfmodem/refclock.c~ Tue Jul 21 21:26:04 1998
+++ linux-2.2.10/drivers/char/hfmodem/refclock.c Sun Aug 8 21:37:14 1999
@@ -133,8 +133,8 @@
__asm__("rdtsc;\n\t"
"subl %2,%%eax\n\t"
"sbbl %3,%%edx\n\t" : "=&a" (tmp0), "=&d" (tmp1)
- : "m" (dev->clk.starttime_lo), "m" (dev->clk.starttime_hi) : "ax", "dx");
- __asm__("mull %1" : "=d" (tmp2) : "m" (scale_rdtsc), "a" (tmp0) : "ax");
+ : "m" (dev->clk.starttime_lo), "m" (dev->clk.starttime_hi));
+ __asm__("mull %1" : "=d" (tmp2) : "m" (scale_rdtsc), "a" (tmp0));
__asm__("mull %1" : "=a" (tmp3) : "m" (scale_rdtsc), "a" (tmp1) : "dx");
curtime = tmp2 + tmp3;
goto time_known;

-
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/