RDFU  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
EfiScannerLib.c
Go to the documentation of this file.
1 
12 #include "EfiScannerHeaders.h"
13 
14 //
15 // gloabls
16 //
17 
19 EFI_HANDLE gImageHandle;
20 
21 extern ULONG gLogLock;
22 extern EFI_LOADED_IMAGE *gSelfLoadedImage;
23 
24 
25 
26 
43  EFI_HANDLE ImageHandle,
44  BOOLEAN OpUsePrint,
45  BOOLEAN OpUseLog,
46  BOOLEAN OpUseComPort)
47 {
48  EFI_STATUS Status;
49 
50  // disable watchdog time (for apple)
51  gBS->SetWatchdogTimer(0, 0, 0, 0);
52 
54 
55  gEfiScannerPolicy.NumOfBadAddrs = 0;
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 }