Browse Source

Updated to REAL_CODE().

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
6631f46999
1 changed files with 36 additions and 41 deletions
  1. 36
    41
      src/arch/i386/core/pcibios.c

+ 36
- 41
src/arch/i386/core/pcibios.c View File

@@ -33,20 +33,20 @@
33 33
  * @ret max_bus		Maximum bus number
34 34
  */
35 35
 int pcibios_max_bus ( void ) {
36
-	int discard_a;
36
+	int discard_a, discard_D;
37 37
 	uint8_t max_bus;
38 38
 
39
-	REAL_EXEC ( rm_pcibios_check,
40
-		    "stc\n\t"
41
-		    "int $0x1a\n\t"
42
-		    "jnc 1f\n\t"
43
-		    "xorw %%cx, %%cx\n\t"
44
-		    "\n1:\n\t",
45
-		    2,
46
-		    OUT_CONSTRAINTS ( "=a" ( discard_a ), "=c" ( max_bus ) ),
47
-		    IN_CONSTRAINTS ( "a" ( PCIBIOS_INSTALLATION_CHECK >> 16 )),
48
-		    CLOBBER ( "ebx", "edx", "edi" ) );
49
-	
39
+	__asm__ __volatile__ ( REAL_CODE ( "stc\n\t"
40
+					   "int $0x1a\n\t"
41
+					   "jnc 1f\n\t"
42
+					   "xorw %%cx, %%cx\n\t"
43
+					   "\n1:\n\t" )
44
+			       : "=c" ( max_bus ), "=a" ( discard_a ),
45
+				 "=D" ( discard_D )
46
+			       : "a" ( PCIBIOS_INSTALLATION_CHECK >> 16 ),
47
+				 "D" ( 0 )
48
+			       : "ebx", "edx" );
49
+
50 50
 	return max_bus;
51 51
 }
52 52
 
@@ -62,22 +62,19 @@ int pcibios_read ( struct pci_device *pci, uint32_t command, uint32_t *value ){
62 62
 	int discard_b, discard_D;
63 63
 	int status;
64 64
 
65
-	REAL_EXEC ( rm_pcibios_read,
66
-		    "stc\n\t"
67
-		    "int $0x1a\n\t"
68
-		    "jnc 1f\n\t"
69
-		    "xorl %%eax, %%eax\n\t"
70
-		    "decl %%eax\n\t"
71
-		    "movl %%eax, %%ecx\n\t"
72
-		    "\n1:\n\t",
73
-		    4,
74
-		    OUT_CONSTRAINTS ( "=a" ( status ), "=b" ( discard_b ),
75
-				      "=c" ( *value ), "=D" ( discard_D ) ),
76
-		    IN_CONSTRAINTS ( "a" ( command >> 16 ),
77
-				     "b" ( ( pci->bus << 8 ) | pci->devfn ),
78
-				     "D" ( command ) ),
79
-		    CLOBBER ( "edx" ) );
80
-	
65
+	__asm__ __volatile__ ( REAL_CODE ( "stc\n\t"
66
+					   "int $0x1a\n\t"
67
+					   "jnc 1f\n\t"
68
+					   "xorl %%eax, %%eax\n\t"
69
+					   "decl %%eax\n\t"
70
+					   "movl %%eax, %%ecx\n\t"
71
+					   "\n1:\n\t" )
72
+			       : "=a" ( status ), "=b" ( discard_b ),
73
+				 "=c" ( *value ), "=D" ( discard_D )
74
+			       : "a" ( command >> 16 ), "D" ( command ),
75
+				 "b" ( ( pci->bus << 8 ) | pci->devfn )
76
+			       : "edx" );
77
+
81 78
 	return ( ( status >> 8 ) & 0xff );
82 79
 }
83 80
 
@@ -93,19 +90,17 @@ int pcibios_write ( struct pci_device *pci, uint32_t command, uint32_t value ){
93 90
 	int discard_b, discard_c, discard_D;
94 91
 	int status;
95 92
 
96
-	REAL_EXEC ( rm_pcibios_write,
97
-		    "stc\n\t"
98
-		    "int $0x1a\n\t"
99
-		    "jnc 1f\n\t"
100
-		    "movb $0xff, %%ah\n\t"
101
-		    "\n1:\n\t",
102
-		    4,
103
-		    OUT_CONSTRAINTS ( "=a" ( status ), "=b" ( discard_b ),
104
-				      "=c" ( discard_c ), "=D" ( discard_D ) ),
105
-		    IN_CONSTRAINTS ( "a" ( command >> 16 ),
106
-				     "b" ( ( pci->bus << 8 ) | pci->devfn ),
107
-				     "c" ( value ), "D" ( command ) ),
108
-		    CLOBBER ( "edx" ) );
93
+	__asm__ __volatile__ ( REAL_CODE ( "stc\n\t"
94
+					   "int $0x1a\n\t"
95
+					   "jnc 1f\n\t"
96
+					   "movb $0xff, %%ah\n\t"
97
+					   "\n1:\n\t" )
98
+			       : "=a" ( status ), "=b" ( discard_b ),
99
+				 "=c" ( discard_c ), "=D" ( discard_D )
100
+			       : "a" ( command >> 16 ),	"D" ( command ),
101
+				 "b" ( ( pci->bus << 8 ) | pci->devfn ),
102
+				 "c" ( value )
103
+			       : "edx" );
109 104
 	
110 105
 	return ( ( status >> 8 ) & 0xff );
111 106
 }

Loading…
Cancel
Save