xref: /illumos-gate/usr/src/boot/efi/include/eficonsctl.h (revision dd72704bd9e794056c558153663c739e2012d721)
1 /*-
2  * Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
18  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
24  * THE POSSIBILITY OF SUCH DAMAGE.
25  */
26 
27 /*
28  * Original Module Name: ConsoleControl.h
29  * Abstract: Abstraction of a Text mode or GOP/UGA screen
30  */
31 
32 /* $FreeBSD$ */
33 
34 #ifndef _EFI_CONS_CTL_H
35 #define _EFI_CONS_CTL_H
36 
37 #define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \
38     { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21} }
39 
40 typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL   EFI_CONSOLE_CONTROL_PROTOCOL;
41 
42 
43 typedef enum {
44   EfiConsoleControlScreenText,
45   EfiConsoleControlScreenGraphics,
46   EfiConsoleControlScreenMaxValue
47 } EFI_CONSOLE_CONTROL_SCREEN_MODE;
48 
49 
50 typedef
51 EFI_STATUS
52 (EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE) (
53   IN  EFI_CONSOLE_CONTROL_PROTOCOL      *This,
54   OUT EFI_CONSOLE_CONTROL_SCREEN_MODE   *Mode,
55   OUT BOOLEAN                           *GopUgaExists,  OPTIONAL
56   OUT BOOLEAN                           *StdInLocked    OPTIONAL
57   )
58 /*++
59 
60   Routine Description:
61     Return the current video mode information. Also returns info about existence
62     of Graphics Output devices or UGA Draw devices in system, and if the Std In
63     device is locked. All the arguments are optional and only returned if a non
64     NULL pointer is passed in.
65 
66   Arguments:
67     This         - Protocol instance pointer.
68     Mode         - Are we in text of grahics mode.
69     GopUgaExists - TRUE if Console Spliter has found a GOP or UGA device
70     StdInLocked  - TRUE if StdIn device is keyboard locked
71 
72   Returns:
73     EFI_SUCCESS     - Mode information returned.
74 
75 --*/
76 ;
77 
78 
79 typedef
80 EFI_STATUS
81 (EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE) (
82   IN  EFI_CONSOLE_CONTROL_PROTOCOL      *This,
83   IN  EFI_CONSOLE_CONTROL_SCREEN_MODE   Mode
84   )
85 /*++
86 
87   Routine Description:
88     Set the current mode to either text or graphics. Graphics is
89     for Quiet Boot.
90 
91   Arguments:
92     This  - Protocol instance pointer.
93     Mode  - Mode to set the
94 
95   Returns:
96     EFI_SUCCESS     - Mode information returned.
97 
98 --*/
99 ;
100 
101 
102 typedef
103 EFI_STATUS
104 (EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN) (
105   IN  EFI_CONSOLE_CONTROL_PROTOCOL      *This,
106   IN CHAR16                             *Password
107   )
108 /*++
109 
110   Routine Description:
111     Lock Std In devices until Password is typed.
112 
113   Arguments:
114     This     - Protocol instance pointer.
115     Password - Password needed to unlock screen. NULL means unlock keyboard
116 
117   Returns:
118     EFI_SUCCESS      - Mode information returned.
119     EFI_DEVICE_ERROR - Std In not locked
120 
121 --*/
122 ;
123 
124 
125 
126 struct _EFI_CONSOLE_CONTROL_PROTOCOL {
127   EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE           GetMode;
128   EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE           SetMode;
129   EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN        LockStdIn;
130 };
131 
132 extern EFI_GUID gEfiConsoleControlProtocolGuid;
133 
134 #endif
135