|
@@ -20,9 +20,9 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
20
|
20
|
|
21
|
21
|
#include <stdio.h>
|
22
|
22
|
#include <console.h>
|
23
|
|
-#include <unistd.h>
|
24
|
23
|
#include <config/general.h>
|
25
|
24
|
#include <ipxe/keys.h>
|
|
25
|
+#include <ipxe/timer.h>
|
26
|
26
|
#include <ipxe/shell_banner.h>
|
27
|
27
|
|
28
|
28
|
/** @file
|
|
@@ -37,8 +37,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
37
|
37
|
* @ret enter_shell User wants to enter shell
|
38
|
38
|
*/
|
39
|
39
|
int shell_banner ( void ) {
|
40
|
|
- int enter_shell = 0;
|
41
|
|
- int wait_count;
|
42
|
40
|
int key;
|
43
|
41
|
|
44
|
42
|
/* Skip prompt if timeout is zero */
|
|
@@ -49,18 +47,10 @@ int shell_banner ( void ) {
|
49
|
47
|
printf ( "\nPress Ctrl-B for the iPXE command line..." );
|
50
|
48
|
|
51
|
49
|
/* Wait for key */
|
52
|
|
- for ( wait_count = 0 ; wait_count < BANNER_TIMEOUT ; wait_count++ ) {
|
53
|
|
- if ( iskey() ) {
|
54
|
|
- key = getchar();
|
55
|
|
- if ( key == CTRL_B )
|
56
|
|
- enter_shell = 1;
|
57
|
|
- break;
|
58
|
|
- }
|
59
|
|
- mdelay(100);
|
60
|
|
- }
|
|
50
|
+ key = getchar_timeout ( ( BANNER_TIMEOUT * TICKS_PER_SEC ) / 10 );
|
61
|
51
|
|
62
|
52
|
/* Clear the "Press Ctrl-B" line */
|
63
|
53
|
printf ( "\r \r" );
|
64
|
54
|
|
65
|
|
- return enter_shell;
|
|
55
|
+ return ( key == CTRL_B );
|
66
|
56
|
}
|