]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Protocol/ConsoleControl.h
bf662f2b799a34244205aa80c252ea0025680256
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / ConsoleControl.h
1 /** @file
2
3 This protocol provides the interfaces to Get/Set the current video mode for GOP/UGA screen
4
5 Copyright (c) 2006 - 2008, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef __CONSOLE_CONTROL_H__
17 #define __CONSOLE_CONTROL_H__
18
19 #define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \
20 { 0xf42f7782, 0x12e, 0x4c12, {0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21 } }
21
22 typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL EFI_CONSOLE_CONTROL_PROTOCOL;
23
24
25 typedef enum {
26 EfiConsoleControlScreenText, /// Text Mode
27 EfiConsoleControlScreenGraphics, /// Graphics Mode
28 EfiConsoleControlScreenMaxValue
29 } EFI_CONSOLE_CONTROL_SCREEN_MODE;
30
31 /**
32 Return the current video mode information. Also returns info about existence
33 of Graphics Output devices or UGA Draw devices in system, and whether the Std
34 In device is locked. GopUgaExists and StdInLocked parameters are optional, and
35 only returned if a non NULL pointer is passed in.
36
37 @param This Protocol instance pointer.
38 @param Mode Current video mode.
39 @param GopUgaExists TRUE if GOP Spliter has found a GOP/UGA device
40 @param StdInLocked TRUE if StdIn device is keyboard locked
41
42 @retval EFI_SUCCESS Video mode information is returned.
43 @retval EFI_INVALID_PARAMETER Invalid parameters if Mode == NULL.
44
45 **/
46 typedef
47 EFI_STATUS
48 (EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE)(
49 IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
50 OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode,
51 OUT BOOLEAN *GopUgaExists, OPTIONAL
52 OUT BOOLEAN *StdInLocked OPTIONAL
53 );
54
55 /**
56 Set the current video mode to either text or graphics. Graphics is
57 for Quiet Boot.
58
59 @param This Protocol instance pointer.
60 @param Mode Video mode is to be set.
61
62 @retval EFI_SUCCESS Mode is set successfully.
63 @retval EFI_INVALID_PARAMETER Mode is not the valid mode value.
64 @retval EFI_UNSUPPORTED Mode is unsupported by console device.
65
66 **/
67 typedef
68 EFI_STATUS
69 (EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE)(
70 IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
71 OUT EFI_CONSOLE_CONTROL_SCREEN_MODE Mode
72 );
73
74 /**
75 If Password is NULL or the Password is too big, then return an error. If the
76 Password is valid, then store the password, lock StdIn and arm the periodic timer.
77
78 @param This Protocol instance pointer.
79 @param Password The password input.
80
81 @retval EFI_SUCCESS Lock the StdIn device.
82 @retval EFI_INVALID_PARAMETER Password is NULL.
83 @retval EFI_OUT_OF_RESOURCES Buffer allocation to store the password fails.
84
85 **/
86 typedef
87 EFI_STATUS
88 (EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN)(
89 IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
90 IN CHAR16 *Password
91 );
92
93 struct _EFI_CONSOLE_CONTROL_PROTOCOL {
94 EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE GetMode;
95 EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE SetMode;
96 EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN LockStdIn;
97 };
98
99 extern EFI_GUID gEfiConsoleControlProtocolGuid;
100
101 #endif