1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Avoid an infinite loop in empty_both_buffers() by adding a timeout.

This helps systems that don't actually have atkbd controllers, such as the Intel
SBX82 blade, boot without device.hints hacks.

Hardware for this fix provided by iXsystems.

PR:		94822
Submitted by:	Devon H. O'Dell <devon.odell@coyotepoint.com>
MFC After:	3 days
This commit is contained in:
Doug White 2006-09-04 00:19:31 +00:00
parent e1cb7bc081
commit 9aeef36608
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=161969

View File

@ -857,6 +857,7 @@ empty_both_buffers(KBDC p, int wait)
{
int t;
int f;
int waited = 0;
#if KBDIO_DEBUG >= 2
int c1 = 0;
int c2 = 0;
@ -877,6 +878,16 @@ empty_both_buffers(KBDC p, int wait)
} else {
t -= delta;
}
/*
* Some systems (Intel/IBM blades) do not have keyboard devices and
* will thus hang in this procedure. Time out after delta seconds to
* avoid this hang -- the keyboard attach will fail later on.
*/
waited += (delta * 1000);
if (waited == (delta * 1000000))
return;
DELAY(delta*1000);
}
#if KBDIO_DEBUG >= 2