RDFU  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
EfiScannerLib.c File Reference

Framework initialization procedures. More...

Include dependency graph for EfiScannerLib.c:

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI EfiScannerInitialize (EFI_HANDLE ImageHandle, BOOLEAN OpUsePrint, BOOLEAN OpUseLog, BOOLEAN OpUseComPort)
 

Variables

policy gEfiScannerPolicy
 
EFI_HANDLE gImageHandle
 
ULONG gLogLock
 
EFI_LOADED_IMAGE * gSelfLoadedImage
 

Detailed Description

Framework initialization procedures.

Author
Piotr Bania
Date
Feb 2013 Framework initialization procedures

Definition in file EfiScannerLib.c.

Function Documentation

EFI_STATUS EFIAPI EfiScannerInitialize ( EFI_HANDLE  ImageHandle,
BOOLEAN  OpUsePrint,
BOOLEAN  OpUseLog,
BOOLEAN  OpUseComPort 
)

Initializes the gEfiScannerPolicy. This function must be executed before any other function of RDFU framework.

Parameters
ImageHandleImage handle
OpUsePrintPrint output to screen
OpUseLogPrint output to log file (log.txt)
OpUseComPortPrint output to com port (COM1 by default)
Return values
EFI_SUCCESSOn success
EFI_ERROR*On error

Definition at line 42 of file EfiScannerLib.c.

References ASMInitLock(), EFI_STATUS(), gLogLock, gSelfLoadedImage, InitializeLogFile(), LogFullAscii(), _policy::NumOfBadAddrs, _policy::OpUseComPort, _policy::OpUseLog, _policy::OpUsePrint, and PRINT_FUNC.

Referenced by EfiScannerEntryPoint().

47 {
48  EFI_STATUS Status;
49 
50  // disable watchdog time (for apple)
51  gBS->SetWatchdogTimer(0, 0, 0, 0);
52 
54 
56  gEfiScannerPolicy.OpUseLog = OpUseLog;
57  gEfiScannerPolicy.OpUsePrint = OpUsePrint;
58  gEfiScannerPolicy.OpUseComPort = OpUseComPort;
59 
60  Status = gBS->HandleProtocol(ImageHandle,
61  &gEfiLoadedImageProtocolGuid,
62  (VOID*)&gSelfLoadedImage);
63 
64  if (EFI_ERROR(Status))
65  {
66 #if DEBUG_ON == 1
67  PRINT_FUNC(L"EfiScannerInitialize: Error unable to locate protocol! \r\n");
68 #endif
69  return Status;
70  }
71 
72  Status = InitializeLogFile();
73 
74  if (EFI_ERROR(Status))
75  {
76 #if DEBUG_ON == 1
77  PRINT_FUNC(L"EfiScannerInitialize: InitializeLogFile returned %08x\r\n", Status);
78 #endif
79 
80  return Status;
81  }
82 
83 
84  LogFullAscii("EfiScannerInitialize: Scanner initialized (UseLog=%d | UsePrint=%d | UseComPort=%d)\r\n",
85  OpUseLog,
86  OpUsePrint,
87  OpUseComPort);
88 
89  return EFI_SUCCESS;
90 }

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

EFI_HANDLE gImageHandle
ULONG gLogLock

lock used for the "logging functions" synchronization

Definition at line 24 of file Logs.c.

Referenced by EfiScannerInitialize(), LogFileAscii(), LogFullAscii(), and LogFullUnicode().

EFI_LOADED_IMAGE* gSelfLoadedImage

Definition at line 24 of file FileSystemWrap.c.

Referenced by EfiScannerInitialize(), InitializeLogFile(), and OpenVolume().