summaryrefslogtreecommitdiffstats
path: root/efi_memtest/MemtestEfi.c
blob: 7110698174f9c91a5318fe1a6ba99dc0a9a18a24 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

#include "Uefi.h"
#include "Library/UefiLib.h"
#include "Library/UefiApplicationEntryPoint.h"
#include "Guid/FileSystemInfo.h"

#include "main.h" // TODO move into main dir
#include "memtest86+/logger.h"
#include "memtest86+/display.h"

extern EFI_SYSTEM_TABLE *gST;

short logflag = 1;
short log_fine = 0;
short log_cpuspeed = 0;
short log_memspeed = 0;
short log_mem_tbl = 0;
short log_comp_seg = 0;
short log_print_pmap = 0;
short log_mem_ctrl = 1;

EFI_STATUS
EFIAPI
UefiMain (
  IN EFI_HANDLE        ImageHandle,
  IN EFI_SYSTEM_TABLE  *SystemTable
  )
{

  SystemTable->ConOut->ClearScreen(SystemTable->ConOut);
  SystemTable->ConOut->SetCursorPosition(SystemTable->ConOut, 0, 0);

  trace_init("Starting MemtestEfi");

  init_logger();

  //while(1);


  if (logflag) {
  char msg[] = "MemtestEfi started";
  print_log(msg, sizeof(msg) - 1);
  }

  
  test_start();

  if (logflag) {
  char msg[] = "MemtestEfi finished!\n";
  print_log(msg, sizeof(msg) - 1);
  }

  //while(1) {}

  SystemTable->ConOut->SetCursorPosition(SystemTable->ConOut, 0, 25);

  return EFI_SUCCESS;
}