[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch to avoid bad i386 assembly code



The development version of gas rejects this i386 code:
    call %edi
It insists on
    call *%edi
instead.  The latter form should work with any version of gas.

This simple patch fixes
    c/src/lib/libbsp/i386/pc386/pc386dev/pcibios.c
accordingly.

Ian

Index: pcibios.c
===================================================================
RCS file: /zembu/cvsfiles/devo/rtems/c/src/lib/libbsp/i386/pc386/pc386dev/pcibios.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- pcibios.c	1998/09/02 17:51:29	1.1.1.2
+++ pcibios.c	1998/09/29 22:11:32	1.2
@@ -89,7 +89,7 @@
   asm ("    movl $0x49435024, %eax"); /* Move signature to eax */
   asm ("    xorl %ebx, %ebx");        /* Zero ebx */
   asm ("    pushl %cs");
-  asm ("    call %edi");              /* Call entry */
+  asm ("    call *%edi");             /* Call entry */
   asm ("    movl %eax, pcibExchg");
   asm ("    movl %ebx, pcibExchg+4");
   asm ("    movl %ecx, pcibExchg+8");
@@ -114,7 +114,7 @@
   asm("    movb $0xb1, %ah");
   asm("    movb $0x01, %al");
   asm ("   pushl %cs");
-  asm("    call %edi");
+  asm("    call *%edi");
   asm("    movl %eax, pcibExchg");
   asm("    movl %ebx, pcibExchg+4");
   asm("    movl %ecx, pcibExchg+8");
@@ -167,7 +167,7 @@
   asm("    movl pcibExchg+8, %ecx");
   asm("    movl pcibExchg+12, %esi");
   asm("    pushl %cs");
-  asm("    call %edi");
+  asm("    call *%edi");
   asm("    movl %eax, pcibExchg");
   asm("    movl %ebx, pcibExchg+4");
   asm("    popa");
@@ -201,7 +201,7 @@
   asm("    movl pcibExchg+4, %ecx");
   asm("    movl pcibExchg+8, %esi");
   asm("    pushl %cs");
-  asm("    call %edi");
+  asm("    call *%edi");
   asm("    movl %eax, pcibExchg");
   asm("    movl %ebx, pcibExchg+4");
   asm("    popa");
@@ -241,7 +241,7 @@
   asm("    movl pcibExchg+4, %ebx");
   asm("    movl pcibExchg+8, %edx");
   asm("    pushl %cs");
-  asm("    call %edi");
+  asm("    call *%edi");
   asm("    movl %eax, pcibExchg");
   asm("    movl %ebx, pcibExchg+4");
   asm("    popa");
@@ -273,7 +273,7 @@
   asm("    movl pcibExchg+4, %ebx");
   asm("    movl pcibExchg+8, %edi");
   asm("    pushl %cs");
-  asm("    call %esi");
+  asm("    call *%esi");
   asm("    movl %eax, pcibExchg");
   asm("    movl %ecx, pcibExchg+4");
   asm("    popa");
@@ -312,7 +312,7 @@
   asm("    movl pcibExchg+4, %ebx");
   asm("    movl pcibExchg+8, %edi");
   asm("    pushl %cs");
-  asm("    call %esi");
+  asm("    call *%esi");
   asm("    movl %eax, pcibExchg");
   asm("    movl %ecx, pcibExchg+4");
   asm("    popa");
@@ -351,7 +351,7 @@
   asm("    movl pcibExchg+4, %ebx");
   asm("    movl pcibExchg+8, %edi");
   asm("    pushl %cs");
-  asm("    call %esi");
+  asm("    call *%esi");
   asm("    movl %eax, pcibExchg");
   asm("    movl %ecx, pcibExchg+4");
   asm("    popa");
@@ -392,7 +392,7 @@
   asm("    movl pcibExchg+8, %edi");
   asm("    movl pcibExchg+12, %ecx");
   asm("    pushl %cs");
-  asm("    call %esi");
+  asm("    call *%esi");
   asm("    movl %eax, pcibExchg");
   asm("    popa");
 
@@ -424,7 +424,7 @@
   asm("    movl pcibExchg+8, %edi");
   asm("    movl pcibExchg+12, %ecx");
   asm("    pushl %cs");
-  asm("    call %esi");
+  asm("    call *%esi");
   asm("    movl %eax, pcibExchg");
   asm("    popa");
 
@@ -458,7 +458,7 @@
   asm("    movl pcibExchg+8, %edi");
   asm("    movl pcibExchg+12, %ecx");
   asm("    pushl %cs");
-  asm("    call %esi");
+  asm("    call *%esi");
   asm("    movl %eax, pcibExchg");
   asm("    popa");