Adding some new libraries to experiment with size reduction. Trying not to duplicate...
[mirror_edk2.git] / EmbeddedPkg / Include / Protocol / EblAddCommand.h
1 /** @file
2
3 Copyright (c) 2008-2009 Apple Inc. All rights reserved.<BR>
4
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 /** @file
16 Abstraction for hardware based interrupt routine
17
18 Copyright (c) 2009 Apple Inc.
19 All rights reserved. This program and the accompanying materials
20 are licensed and made available under the terms and conditions of the BSD License
21 which accompanies this distribution. The full text of the license may be found at
22 http://opensource.org/licenses/bsd-license.php
23
24 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
25 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
26
27 **/
28
29
30 #ifndef __EBL_ADD_COMMAND_H__
31 #define __EBL_ADD_COMMAND_H__
32
33
34
35 //
36 // Protocol GUID
37 //
38 // AEDA2428-9A22-4637-9B21-545E28FBB829
39
40 #define EBL_ADD_COMMAND_PROTOCOL_GUID \
41 { 0xaeda2428, 0x9a22, 0x4637, { 0x9b, 0x21, 0x54, 0x5e, 0x28, 0xfb, 0xb8, 0x29 } }
42
43
44 typedef struct _EBL_ADD_COMMAND_PROTOCOL EBL_ADD_COMMAND_PROTOCOL;
45
46 typedef
47 EFI_STATUS
48 (EFIAPI *EBL_COMMMAND) (
49 IN UINTN Argc,
50 IN CHAR8 **Argv
51 );
52
53 typedef struct {
54 CHAR8 *Name;
55 CHAR8 *HelpSummary;
56 CHAR8 *Help;
57 EBL_COMMMAND Command;
58 } EBL_COMMAND_TABLE;
59
60
61 /**
62 Add a single command table entry.
63
64 @param EntryArray Pointer EBL_COMMAND_TABLE of the command that is being added
65
66 **/
67 typedef
68 VOID
69 (EFIAPI *EBL_ADD_COMMAND) (
70 IN const EBL_COMMAND_TABLE *Entry
71 );
72
73
74 /**
75 Add a multiple command table entry.
76
77 @param EntryArray Pointer EBL_COMMAND_TABLE of the commands that are being added
78
79 @param ArrayCount Nuber of commands in the EntryArray.
80
81 **/
82 typedef
83 VOID
84 (EFIAPI *EBL_ADD_COMMANDS) (
85 IN const EBL_COMMAND_TABLE *EntryArray,
86 IN UINTN ArrayCount
87 );
88
89
90 typedef
91 VOID
92 (EFIAPI *EBL_GET_CHAR_CALL_BACK) (
93 IN UINTN ElapsedTime
94 );
95
96 /**
97 Return a keypress or optionally timeout if a timeout value was passed in.
98 An optional callback funciton is called evey second when waiting for a
99 timeout.
100
101 @param Key EFI Key information returned
102 @param TimeoutInSec Number of seconds to wait to timeout
103 @param CallBack Callback called every second during the timeout wait
104
105 @return EFI_SUCCESS Key was returned
106 @return EFI_TIMEOUT If the TimoutInSec expired
107
108 **/
109 typedef
110 EFI_STATUS
111 (EFIAPI *EBL_GET_CHAR_KEY) (
112 IN OUT EFI_INPUT_KEY *Key,
113 IN UINTN TimeoutInSec,
114 IN EBL_GET_CHAR_CALL_BACK CallBack OPTIONAL
115 );
116
117
118 /**
119 This routine is used prevent command output data from scrolling off the end
120 of the screen. The global gPageBreak is used to turn on or off this feature.
121 If the CurrentRow is near the end of the screen pause and print out a prompt
122 If the use hits Q to quit return TRUE else for any other key return FALSE.
123 PrefixNewline is used to figure out if a newline is needed before the prompt
124 string. This depends on the last print done before calling this function.
125 CurrentRow is updated by one on a call or set back to zero if a prompt is
126 needed.
127
128 @param CurrentRow Used to figure out if its the end of the page and updated
129 @param PrefixNewline Did previous print issue a newline
130
131 @return TRUE if Q was hit to quit, FALSE in all other cases.
132
133 **/
134 typedef
135 BOOLEAN
136 (EFIAPI *EBL_ANY_KEY_CONTINUE_Q_QUIT) (
137 IN UINTN *CurrentRow,
138 IN BOOLEAN PrefixNewline
139 );
140
141
142
143 struct _EBL_ADD_COMMAND_PROTOCOL {
144 EBL_ADD_COMMAND AddCommand;
145 EBL_ADD_COMMANDS AddCommands;
146
147 // Commands to reuse EBL infrastructure
148 EBL_GET_CHAR_KEY EblGetCharKey;
149 EBL_ANY_KEY_CONTINUE_Q_QUIT EblAnyKeyToContinueQtoQuit;
150 };
151
152 extern EFI_GUID gEfiEblAddCommandProtocolGuid;
153
154 #endif
155
156