EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

UnixPkg/UnixConsoleDxe/Console.h

Go to the documentation of this file.
00001 /*++
00002 
00003 Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
00004 This program and the accompanying materials                          
00005 are licensed and made available under the terms and conditions of the BSD License         
00006 which accompanies this distribution.  The full text of the license may be found at        
00007 http://opensource.org/licenses/bsd-license.php                                            
00008                                                                                           
00009 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
00010 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
00011 
00012 Module Name:
00013 
00014   Console.h
00015 
00016 Abstract:
00017 
00018   Console based on Posix APIs.
00019 
00020   This file attaches a SimpleTextIn protocol to a previously open window.
00021   
00022   The constructor for this protocol depends on an open window. Currently
00023   the SimpleTextOut protocol creates a window when it's constructor is called.
00024   Thus this code must run after the constructor for the SimpleTextOut 
00025   protocol
00026   
00027 --*/
00028 
00029 #ifndef _CONSOLE_H_
00030 #define _CONSOLE_H_
00031 
00032 #include "PiDxe.h"
00033 #include "UnixDxe.h"
00034 #include <Protocol/UnixIo.h>
00035 #include <Protocol/SimpleTextIn.h>
00036 #include <Protocol/SimpleTextOut.h>
00037 
00038 #include <Library/DebugLib.h>
00039 #include <Library/BaseLib.h>
00040 #include <Library/UefiDriverEntryPoint.h>
00041 #include <Library/UefiLib.h>
00042 #include <Library/BaseMemoryLib.h>
00043 #include <Library/MemoryAllocationLib.h>
00044 #include <Library/UefiBootServicesTableLib.h>
00045 
00046 extern EFI_DRIVER_BINDING_PROTOCOL gUnixConsoleDriverBinding;
00047 extern EFI_COMPONENT_NAME_PROTOCOL gUnixConsoleComponentName;
00048 
00049 #define UNIX_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE \
00050           SIGNATURE_32('U','X','s','c')
00051 
00052 typedef struct {
00053   UINT64                        Signature;
00054 
00055   EFI_HANDLE                    Handle;
00056 
00057   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  SimpleTextOut;
00058   EFI_SIMPLE_TEXT_OUTPUT_MODE   SimpleTextOutMode;
00059 
00060   EFI_UNIX_IO_PROTOCOL        *UnixIo;
00061   EFI_UNIX_THUNK_PROTOCOL     *UnixThunk;
00062 
00063   //
00064   // SimpleTextOut Private Data including Posix types.
00065   //
00066   //  HANDLE                        NtOutHandle;
00067   //  HANDLE                        NtInHandle;
00068 
00069   //COORD                         MaxScreenSize;
00070   //COORD                         Position;
00071   //WORD                          Attribute;
00072   BOOLEAN                       CursorEnable;
00073 
00074   EFI_SIMPLE_TEXT_INPUT_PROTOCOL   SimpleTextIn;
00075 
00076   EFI_UNICODE_STRING_TABLE      *ControllerNameTable;
00077 
00078 } UNIX_SIMPLE_TEXT_PRIVATE_DATA;
00079 
00080 #define UNIX_SIMPLE_TEXT_OUT_PRIVATE_DATA_FROM_THIS(a) \
00081          CR(a, UNIX_SIMPLE_TEXT_PRIVATE_DATA, SimpleTextOut, UNIX_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE)
00082 
00083 #define UNIX_SIMPLE_TEXT_IN_PRIVATE_DATA_FROM_THIS(a) \
00084          CR(a, UNIX_SIMPLE_TEXT_PRIVATE_DATA, SimpleTextIn, UNIX_SIMPLE_TEXT_PRIVATE_DATA_SIGNATURE)
00085 
00086 //
00087 // Console Globale Variables
00088 //
00089 extern EFI_DRIVER_BINDING_PROTOCOL  gUnixConsoleDriverBinding;
00090 extern EFI_COMPONENT_NAME_PROTOCOL  gUnixConsoleComponentName;
00091 
00092 typedef struct {
00093   UINTN ColumnsX;
00094   UINTN RowsY;
00095 } UNIX_SIMPLE_TEXT_OUT_MODE;
00096 
00097 #if 0
00098 //
00099 // Simple Text Out protocol member functions
00100 //
00101 
00102 EFI_STATUS
00103 EFIAPI
00104 UnixSimpleTextOutReset (
00105   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL     *This,
00106   IN BOOLEAN                          ExtendedVerification
00107   )
00108 /*++
00109 
00110 Routine Description:
00111 
00112   TODO: Add function description
00113 
00114 Arguments:
00115 
00116   This                  - TODO: add argument description
00117   ExtendedVerification  - TODO: add argument description
00118 
00119 Returns:
00120 
00121   TODO: add return values
00122 
00123 --*/
00124 ;
00125 
00126 EFI_STATUS
00127 EFIAPI
00128 UnixSimpleTextOutOutputString (
00129   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,
00130   IN CHAR16                         *String
00131   )
00132 /*++
00133 
00134 Routine Description:
00135 
00136   TODO: Add function description
00137 
00138 Arguments:
00139 
00140   This    - TODO: add argument description
00141   String  - TODO: add argument description
00142 
00143 Returns:
00144 
00145   TODO: add return values
00146 
00147 --*/
00148 ;
00149 
00150 EFI_STATUS
00151 EFIAPI
00152 UnixSimpleTextOutTestString (
00153   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,
00154   IN CHAR16                         *String
00155   )
00156 /*++
00157 
00158 Routine Description:
00159 
00160   TODO: Add function description
00161 
00162 Arguments:
00163 
00164   This    - TODO: add argument description
00165   String  - TODO: add argument description
00166 
00167 Returns:
00168 
00169   TODO: add return values
00170 
00171 --*/
00172 ;
00173 
00174 EFI_STATUS
00175 EFIAPI
00176 UnixSimpleTextOutQueryMode (
00177   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,
00178   IN UINTN                          ModeNumber,
00179   OUT UINTN                         *Columns,
00180   OUT UINTN                         *Rows
00181   )
00182 /*++
00183 
00184 Routine Description:
00185 
00186   TODO: Add function description
00187 
00188 Arguments:
00189 
00190   This        - TODO: add argument description
00191   ModeNumber  - TODO: add argument description
00192   Columns     - TODO: add argument description
00193   Rows        - TODO: add argument description
00194 
00195 Returns:
00196 
00197   TODO: add return values
00198 
00199 --*/
00200 ;
00201 
00202 EFI_STATUS
00203 EFIAPI
00204 UnixSimpleTextOutSetMode (
00205   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,
00206   IN UINTN                          ModeNumber
00207   )
00208 /*++
00209 
00210 Routine Description:
00211 
00212   TODO: Add function description
00213 
00214 Arguments:
00215 
00216   This        - TODO: add argument description
00217   ModeNumber  - TODO: add argument description
00218 
00219 Returns:
00220 
00221   TODO: add return values
00222 
00223 --*/
00224 ;
00225 
00226 EFI_STATUS
00227 EFIAPI
00228 UnixSimpleTextOutSetAttribute (
00229   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,
00230   IN UINTN                          Attribute
00231   )
00232 /*++
00233 
00234 Routine Description:
00235 
00236   TODO: Add function description
00237 
00238 Arguments:
00239 
00240   This      - TODO: add argument description
00241   Attribute - TODO: add argument description
00242 
00243 Returns:
00244 
00245   TODO: add return values
00246 
00247 --*/
00248 ;
00249 
00250 EFI_STATUS
00251 EFIAPI
00252 UnixSimpleTextOutClearScreen (
00253   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This
00254   )
00255 /*++
00256 
00257 Routine Description:
00258 
00259   TODO: Add function description
00260 
00261 Arguments:
00262 
00263   This  - TODO: add argument description
00264 
00265 Returns:
00266 
00267   TODO: add return values
00268 
00269 --*/
00270 ;
00271 
00272 EFI_STATUS
00273 EFIAPI
00274 UnixSimpleTextOutSetCursorPosition (
00275   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,
00276   IN UINTN                          Column,
00277   IN UINTN                          Row
00278   )
00279 /*++
00280 
00281 Routine Description:
00282 
00283   TODO: Add function description
00284 
00285 Arguments:
00286 
00287   This    - TODO: add argument description
00288   Column  - TODO: add argument description
00289   Row     - TODO: add argument description
00290 
00291 Returns:
00292 
00293   TODO: add return values
00294 
00295 --*/
00296 ;
00297 
00298 EFI_STATUS
00299 EFIAPI
00300 UnixSimpleTextOutEnableCursor (
00301   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This,
00302   IN BOOLEAN                        Enable
00303   )
00304 /*++
00305 
00306 Routine Description:
00307 
00308   TODO: Add function description
00309 
00310 Arguments:
00311 
00312   This    - TODO: add argument description
00313   Enable  - TODO: add argument description
00314 
00315 Returns:
00316 
00317   TODO: add return values
00318 
00319 --*/
00320 ;
00321 
00322 #endif
00323 //
00324 // Simple Text Out constructor and destructor.
00325 //
00326 EFI_STATUS
00327 UnixSimpleTextOutOpenWindow (
00328   IN OUT  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private
00329   )
00330 /*++
00331 
00332 Routine Description:
00333 
00334   TODO: Add function description
00335 
00336 Arguments:
00337 
00338   Private - TODO: add argument description
00339 
00340 Returns:
00341 
00342   TODO: add return values
00343 
00344 --*/
00345 ;
00346 
00347 EFI_STATUS
00348 UnixSimpleTextOutCloseWindow (
00349   IN OUT  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Console
00350   )
00351 /*++
00352 
00353 Routine Description:
00354 
00355   TODO: Add function description
00356 
00357 Arguments:
00358 
00359   Console - TODO: add argument description
00360 
00361 Returns:
00362 
00363   TODO: add return values
00364 
00365 --*/
00366 ;
00367 
00368 #if 0
00369 //
00370 // Simple Text In protocol member functions.
00371 //
00372 EFI_STATUS
00373 EFIAPI
00374 UnixSimpleTextInReset (
00375   IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL          *This,
00376   IN BOOLEAN                              ExtendedVerification
00377   )
00378 /*++
00379 
00380 Routine Description:
00381 
00382   TODO: Add function description
00383 
00384 Arguments:
00385 
00386   This                  - TODO: add argument description
00387   ExtendedVerification  - TODO: add argument description
00388 
00389 Returns:
00390 
00391   TODO: add return values
00392 
00393 --*/
00394 ;
00395 
00396 EFI_STATUS
00397 EFIAPI
00398 UnixSimpleTextInReadKeyStroke (
00399   IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL          *This,
00400   OUT EFI_INPUT_KEY                       *Key
00401   )
00402 /*++
00403 
00404 Routine Description:
00405 
00406   TODO: Add function description
00407 
00408 Arguments:
00409 
00410   This  - TODO: add argument description
00411   Key   - TODO: add argument description
00412 
00413 Returns:
00414 
00415   TODO: add return values
00416 
00417 --*/
00418 ;
00419 
00420 VOID
00421 EFIAPI
00422 UnixSimpleTextInWaitForKey (
00423   IN EFI_EVENT          Event,
00424   IN VOID               *Context
00425   )
00426 /*++
00427 
00428 Routine Description:
00429 
00430   TODO: Add function description
00431 
00432 Arguments:
00433 
00434   Event   - TODO: add argument description
00435   Context - TODO: add argument description
00436 
00437 Returns:
00438 
00439   TODO: add return values
00440 
00441 --*/
00442 ;
00443 
00444 #endif
00445 //
00446 // Simple Text In constructor
00447 //
00448 EFI_STATUS
00449 UnixSimpleTextInAttachToWindow (
00450   IN  UNIX_SIMPLE_TEXT_PRIVATE_DATA *Private
00451   )
00452 /*++
00453 
00454 Routine Description:
00455 
00456   TODO: Add function description
00457 
00458 Arguments:
00459 
00460   Private - TODO: add argument description
00461 
00462 Returns:
00463 
00464   TODO: add return values
00465 
00466 --*/
00467 ;
00468 
00469 //
00470 // Main Entry Point
00471 //
00472 EFI_STATUS
00473 EFIAPI
00474 InitializeUnixConsole (
00475   IN EFI_HANDLE           ImageHandle,
00476   IN EFI_SYSTEM_TABLE     *SystemTable
00477   )
00478 /*++
00479 
00480 Routine Description:
00481 
00482   TODO: Add function description
00483 
00484 Arguments:
00485 
00486   ImageHandle - TODO: add argument description
00487   SystemTable - TODO: add argument description
00488 
00489 Returns:
00490 
00491   TODO: add return values
00492 
00493 --*/
00494 ;
00495 
00496 EFI_STATUS
00497 AppendDevicePathInstanceToVar (
00498   IN  CHAR16                    *VariableName,
00499   IN  EFI_DEVICE_PATH_PROTOCOL  *DevicePathInstance
00500   )
00501 /*++
00502 
00503 Routine Description:
00504 
00505   TODO: Add function description
00506 
00507 Arguments:
00508 
00509   VariableName        - TODO: add argument description
00510   DevicePathInstance  - TODO: add argument description
00511 
00512 Returns:
00513 
00514   TODO: add return values
00515 
00516 --*/
00517 ;
00518 
00519 #endif
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines