mirror of
https://github.com/xcat2/xNBA.git
synced 2024-11-22 17:41:55 +00:00
[pcbios] Do not switch to real mode to check for timer interrupt
The currticks() function is called at least once per TCP packet, and so is performance-critical. Switching to real mode just to allow the timer interrupt to fire is expensive when running inside a virtual machine, and imposes a significant performance cost. Fix by enabling interrupts without switching to real mode. This results in an approximately 100% increase in download speed when running under KVM. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
aaf276ccd4
commit
e4593909a8
@ -44,10 +44,10 @@ static unsigned long bios_currticks ( void ) {
|
||||
uint8_t midnight;
|
||||
|
||||
/* Re-enable interrupts so that the timer interrupt can occur */
|
||||
__asm__ __volatile__ ( REAL_CODE ( "sti\n\t"
|
||||
"nop\n\t"
|
||||
"nop\n\t"
|
||||
"cli\n\t" ) : : );
|
||||
__asm__ __volatile__ ( "sti\n\t"
|
||||
"nop\n\t"
|
||||
"nop\n\t"
|
||||
"cli\n\t" );
|
||||
|
||||
get_real ( ticks, BDA_SEG, 0x006c );
|
||||
get_real ( midnight, BDA_SEG, 0x0070 );
|
||||
|
Loading…
Reference in New Issue
Block a user