Browse Source

[bios] Do not enable interrupts when printing to the console

There seems to be no reason for the sti/cli pair used around each call
to INT 10.  Remove these instructions, so that printing debug messages
from within an ISR does not temporarily reenable interrupts.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 8 years ago
parent
commit
c22da4b8ba
1 changed files with 4 additions and 14 deletions
  1. 4
    14
      src/arch/x86/interface/pcbios/bios_console.c

+ 4
- 14
src/arch/x86/interface/pcbios/bios_console.c View File

98
 	if ( cy < 0 )
98
 	if ( cy < 0 )
99
 		cy = 0;
99
 		cy = 0;
100
 
100
 
101
-	__asm__ __volatile__ ( REAL_CODE ( "sti\n\t"
102
-					   "int $0x10\n\t"
103
-					   "cli\n\t" )
101
+	__asm__ __volatile__ ( REAL_CODE ( "int $0x10\n\t" )
104
 			       : : "a" ( 0x0200 ), "b" ( 1 ),
102
 			       : : "a" ( 0x0200 ), "b" ( 1 ),
105
 			           "d" ( ( cy << 8 ) | cx ) );
103
 			           "d" ( ( cy << 8 ) | cx ) );
106
 }
104
 }
118
 	/* We assume that we always clear the whole screen */
116
 	/* We assume that we always clear the whole screen */
119
 	assert ( params[0] == ANSIESC_ED_ALL );
117
 	assert ( params[0] == ANSIESC_ED_ALL );
120
 
118
 
121
-	__asm__ __volatile__ ( REAL_CODE ( "sti\n\t"
122
-					   "int $0x10\n\t"
123
-					   "cli\n\t" )
119
+	__asm__ __volatile__ ( REAL_CODE ( "int $0x10\n\t" )
124
 			       : : "a" ( 0x0600 ), "b" ( bios_attr << 8 ),
120
 			       : : "a" ( 0x0600 ), "b" ( bios_attr << 8 ),
125
 				   "c" ( 0 ),
121
 				   "c" ( 0 ),
126
 				   "d" ( ( ( console_height - 1 ) << 8 ) |
122
 				   "d" ( ( ( console_height - 1 ) << 8 ) |
188
 	/* Get character height */
184
 	/* Get character height */
189
 	get_real ( height, BDA_SEG, BDA_CHAR_HEIGHT );
185
 	get_real ( height, BDA_SEG, BDA_CHAR_HEIGHT );
190
 
186
 
191
-	__asm__ __volatile__ ( REAL_CODE ( "sti\n\t"
192
-					   "int $0x10\n\t"
193
-					   "cli\n\t" )
187
+	__asm__ __volatile__ ( REAL_CODE ( "int $0x10\n\t" )
194
 			       : : "a" ( 0x0100 ),
188
 			       : : "a" ( 0x0100 ),
195
 				   "c" ( ( ( height - 2 ) << 8 ) |
189
 				   "c" ( ( ( height - 2 ) << 8 ) |
196
 					 ( height - 1 ) ) );
190
 					 ( height - 1 ) ) );
207
 					unsigned int count __unused,
201
 					unsigned int count __unused,
208
 					int params[] __unused ) {
202
 					int params[] __unused ) {
209
 
203
 
210
-	__asm__ __volatile__ ( REAL_CODE ( "sti\n\t"
211
-					   "int $0x10\n\t"
212
-					   "cli\n\t" )
204
+	__asm__ __volatile__ ( REAL_CODE ( "int $0x10\n\t" )
213
 			       : : "a" ( 0x0100 ), "c" ( 0x2000 ) );
205
 			       : : "a" ( 0x0100 ), "c" ( 0x2000 ) );
214
 }
206
 }
215
 
207
 
243
 
235
 
244
 	/* Print character with attribute */
236
 	/* Print character with attribute */
245
 	__asm__ __volatile__ ( REAL_CODE ( "pushl %%ebp\n\t" /* gcc bug */
237
 	__asm__ __volatile__ ( REAL_CODE ( "pushl %%ebp\n\t" /* gcc bug */
246
-					   "sti\n\t"
247
 					   /* Skip non-printable characters */
238
 					   /* Skip non-printable characters */
248
 					   "cmpb $0x20, %%al\n\t"
239
 					   "cmpb $0x20, %%al\n\t"
249
 					   "jb 1f\n\t"
240
 					   "jb 1f\n\t"
264
 					   "xorw %%bx, %%bx\n\t"
255
 					   "xorw %%bx, %%bx\n\t"
265
 					   "movb $0x0e, %%ah\n\t"
256
 					   "movb $0x0e, %%ah\n\t"
266
 					   "int $0x10\n\t"
257
 					   "int $0x10\n\t"
267
-					   "cli\n\t"
268
 					   "popl %%ebp\n\t" /* gcc bug */ )
258
 					   "popl %%ebp\n\t" /* gcc bug */ )
269
 			       : "=a" ( discard_a ), "=b" ( discard_b ),
259
 			       : "=a" ( discard_a ), "=b" ( discard_b ),
270
 			         "=c" ( discard_c )
260
 			         "=c" ( discard_c )

Loading…
Cancel
Save