efi_console.c (78327) | efi_console.c (107682) |
---|---|
1/*- 2 * Copyright (c) 2000 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#ifndef lint 28static const char rcsid[] = | 1/*- 2 * Copyright (c) 2000 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#ifndef lint 28static const char rcsid[] = |
29 "$FreeBSD: head/sys/boot/efi/libefi/efi_console.c 78327 2001-06-16 05:56:13Z obrien $"; | 29 "$FreeBSD: head/sys/boot/efi/libefi/efi_console.c 107682 2002-12-08 19:46:11Z marcel $"; |
30#endif /* not lint */ 31 32#include <efi.h> 33#include <efilib.h> 34 35#include "bootstrap.h" 36 37static SIMPLE_TEXT_OUTPUT_INTERFACE *conout; --- 26 unchanged lines hidden (view full) --- 64 65 conout->OutputString(conout, buf); 66} 67 68int 69efi_cons_getchar() 70{ 71 EFI_INPUT_KEY key; | 30#endif /* not lint */ 31 32#include <efi.h> 33#include <efilib.h> 34 35#include "bootstrap.h" 36 37static SIMPLE_TEXT_OUTPUT_INTERFACE *conout; --- 26 unchanged lines hidden (view full) --- 64 65 conout->OutputString(conout, buf); 66} 67 68int 69efi_cons_getchar() 70{ 71 EFI_INPUT_KEY key; |
72 EFI_STATUS status; |
|
72 UINTN junk; 73 | 73 UINTN junk; 74 |
74 BS->WaitForEvent(1, &conin->WaitForKey, &junk); 75 conin->ReadKeyStroke(conin, &key); 76 return key.UnicodeChar; | 75 /* Try to read a key stroke. We wait for one if none is pending. */ 76 status = conin->ReadKeyStroke(conin, &key); 77 if (status == EFI_NOT_READY) { 78 BS->WaitForEvent(1, &conin->WaitForKey, &junk); 79 status = conin->ReadKeyStroke(conin, &key); 80 } 81 return (key.UnicodeChar); |
77} 78 79int 80efi_cons_poll() 81{ | 82} 83 84int 85efi_cons_poll() 86{ |
82 return BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS; | 87 /* This can clear the signaled state. */ 88 return (BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS); |
83} 84 85struct console efi_console = { 86 "efi", 87 "EFI console", 88 0, 89 efi_cons_probe, 90 efi_cons_init, 91 efi_cons_putchar, 92 efi_cons_getchar, 93 efi_cons_poll 94}; | 89} 90 91struct console efi_console = { 92 "efi", 93 "EFI console", 94 0, 95 efi_cons_probe, 96 efi_cons_init, 97 efi_cons_putchar, 98 efi_cons_getchar, 99 efi_cons_poll 100}; |