Commit ec30ae09 authored by Adrian Bunk's avatar Adrian Bunk Committed by Stephen Hemminger

[PATCH] fix sbni.c compile with gcc 3.3

sbni.c in 2.6.0-test5 fails to compile with gcc 3.3 with the following
error:

<--  snip  -->

...
  CC      drivers/net/wan/sbni.o
...
drivers/net/wan/sbni.c: In function `calc_crc32':
drivers/net/wan/sbni.c:1568: error: asm-specifier for variable `_crc'
conflicts with asm clobber list
make[3]: *** [drivers/net/wan/sbni.o] Error 1

<--  snip  -->

Below is the patch by Margit Schubert-White to fix this issue (it is
already in 2.4).

cu
Adrian
parent 8784b4e0
...@@ -1562,13 +1562,13 @@ __setup( "sbni=", sbni_setup ); ...@@ -1562,13 +1562,13 @@ __setup( "sbni=", sbni_setup );
static u32 static u32
calc_crc32( u32 crc, u8 *p, u32 len ) calc_crc32( u32 crc, u8 *p, u32 len )
{ {
register u32 _crc __asm ( "ax" ); register u32 _crc;
_crc = crc; _crc = crc;
__asm __volatile ( __asm __volatile (
"xorl %%ebx, %%ebx\n" "xorl %%ebx, %%ebx\n"
"movl %1, %%esi\n" "movl %2, %%esi\n"
"movl %2, %%ecx\n" "movl %3, %%ecx\n"
"movl $crc32tab, %%edi\n" "movl $crc32tab, %%edi\n"
"shrl $2, %%ecx\n" "shrl $2, %%ecx\n"
"jz 1f\n" "jz 1f\n"
...@@ -1604,7 +1604,7 @@ calc_crc32( u32 crc, u8 *p, u32 len ) ...@@ -1604,7 +1604,7 @@ calc_crc32( u32 crc, u8 *p, u32 len )
"jnz 0b\n" "jnz 0b\n"
"1:\n" "1:\n"
"movl %2, %%ecx\n" "movl %3, %%ecx\n"
"andl $3, %%ecx\n" "andl $3, %%ecx\n"
"jz 2f\n" "jz 2f\n"
...@@ -1629,9 +1629,9 @@ calc_crc32( u32 crc, u8 *p, u32 len ) ...@@ -1629,9 +1629,9 @@ calc_crc32( u32 crc, u8 *p, u32 len )
"xorb 2(%%esi), %%bl\n" "xorb 2(%%esi), %%bl\n"
"xorl (%%edi,%%ebx,4), %%eax\n" "xorl (%%edi,%%ebx,4), %%eax\n"
"2:\n" "2:\n"
: : "=a" (_crc)
: "a" (_crc), "g" (p), "g" (len) : "0" (_crc), "g" (p), "g" (len)
: "ax", "bx", "cx", "dx", "si", "di" : "bx", "cx", "dx", "si", "di"
); );
return _crc; return _crc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment