diff options
author | Regia König | 2021-08-05 16:59:12 +0200 |
---|---|---|
committer | Regia König | 2021-08-05 16:59:12 +0200 |
commit | 7d6ac620426a516b7c4dd3d33e3141e59ff27a74 (patch) | |
tree | 13f101d721954bf14653fd7af6039be61ccd3993 | |
parent | Add new parts in README (diff) | |
download | memtest86-7d6ac620426a516b7c4dd3d33e3141e59ff27a74.tar.gz memtest86-7d6ac620426a516b7c4dd3d33e3141e59ff27a74.tar.xz memtest86-7d6ac620426a516b7c4dd3d33e3141e59ff27a74.zip |
Mark all parts which belong to boottrace
-rw-r--r-- | efi_memtest/memtest86+/display.h | 5 | ||||
-rw-r--r-- | efi_memtest/memtest86+/efi/display.c | 49 | ||||
-rw-r--r-- | efi_memtest/memtest86+/main.c | 150 |
3 files changed, 153 insertions, 51 deletions
diff --git a/efi_memtest/memtest86+/display.h b/efi_memtest/memtest86+/display.h index 8b35b3f..e4999ff 100644 --- a/efi_memtest/memtest86+/display.h +++ b/efi_memtest/memtest86+/display.h @@ -1,6 +1,9 @@ void clear_screen(void); -void btrace(int me, int line, char *msg, int wait, long v1, long v2); +/********************** + * TODO_BOOTTRACE + *********************/ +//void btrace(int me, int line, char *msg, int wait, long v1, long v2); void trace_init(const char *text); diff --git a/efi_memtest/memtest86+/efi/display.c b/efi_memtest/memtest86+/efi/display.c index ee2879f..10a6b6f 100644 --- a/efi_memtest/memtest86+/efi/display.c +++ b/efi_memtest/memtest86+/efi/display.c @@ -6,7 +6,11 @@ #include "smp.h" #include "cpuid.h" -extern volatile short btflag; +/********************** + * TODO_BOOTTRACE + *********************/ +//extern volatile short btflag; + extern EFI_SYSTEM_TABLE *gST; extern struct barrier_s *barr; @@ -26,7 +30,10 @@ void clear_screen() { Console->SetAttribute(Console, EFI_TEXT_ATTR(EFI_BLACK, EFI_CYAN)); Console->ClearScreen(Console); - if (btflag) { +/********************** + * TODO_BOOTTRACE + *********************/ +/* if (btflag) { Console->SetCursorPosition(Console, 0, 1); Console->OutputString(Console, L"Boot Trace Enabled"); @@ -37,7 +44,7 @@ void clear_screen() { Console->OutputString(Console, L"CPU Line Message Param #1 Param #2 CPU Line Message Param #1 Param #2\n"); Console->SetCursorPosition(Console, 1, 10); Console->OutputString(Console, L"--- ---- ----------- -------- -------- --- ---- ----------- -------- --------\n"); - } + }*/ Console->SetCursorPosition(Console, 0, 0); @@ -193,7 +200,10 @@ int print_mainscreen() { return 0; } -// TODO UEFI functions +/********************** + * TODO_BOOTTRACE + *********************/ +/*// TODO UEFI functions void getChar16FromInt(CHAR16* buffer, int num) { int length = 0; @@ -204,17 +214,20 @@ void getChar16FromInt(CHAR16* buffer, int num) { Print(L"HJK %d", 6); length++; } -} +}*/ -/* Boot trace function */ -short tidx = 25; +/********************** + * TODO_BOOTTRACE + *********************/ +/*Boot trace function */ +/*short tidx = 25; void btrace(int me, int line, char *msg, int wait, long v1, long v2) {// TODO EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Console = gST->ConOut; - int y, x; + //int y, x; - /* Is tracing turned on? */ + Is tracing turned on? if (btflag == 0) return; spin_lock(&barr->mutex); @@ -231,24 +244,24 @@ void btrace(int me, int line, char *msg, int wait, long v1, long v2) {// TODO Console->SetCursorPosition(Console, 1, 11); Console->OutputString(Console, L">\n"); - CHAR16 *buff; - getChar16FromInt(buff, me); - /* TODO Console->SetCursorPosition(Console, 2, 11); + //CHAR16 *buff; + //getChar16FromInt(buff, me); + TODO Console->SetCursorPosition(Console, 2, 11); CHAR16 num[8]; itoa(num, me); - Console->OutputString(Console, num);*/ + Console->OutputString(Console, num); //dprint(y+11, x+2, me, 2, 0); //dprint(y+11, x+5, line, 4, 0); - /* Console->SetCursorPosition(Console, 10, 11); + Console->SetCursorPosition(Console, 10, 11); Console->OutputString(Console, msg); - cprint(y+11, x+10, msg);*/ + cprint(y+11, x+10, msg); //hprint(y+11, x+22, v1); //hprint(y+11, x+31, v2); - /*if (wait) { + if (wait) { wait_keyup(); - }*/ + } //spin_unlock(&barr->mutex); -} +}*/ void add_scroll_line(int x, int y, const char *text) { diff --git a/efi_memtest/memtest86+/main.c b/efi_memtest/memtest86+/main.c index 437bfb3..c7678bd 100644 --- a/efi_memtest/memtest86+/main.c +++ b/efi_memtest/memtest86+/main.c @@ -88,7 +88,12 @@ volatile short cpu_mode; char cpu_mask[MAX_CPUS]; long bin_mask=0xffffffff; //short onepass; //TODO -volatile short btflag = 0; + +/********************** + * TODO_BOOTTRACE + *********************/ +//volatile short btflag = 0; + volatile int test; short restart_flag; uint8_t volatile stacks[MAX_CPUS][STACKSIZE_BYTES]; @@ -310,13 +315,20 @@ static void parse_command_line(void) /* skip leading spaces */ /*while (*cp == ' ') { cp++; - } + }*/ - while (*cp) { +/********************** + * TODO_BOOTTRACE + *********************/ +/* while (*cp) { if (!mt86_strncmp(cp, "console=", 8)) { cp += 8; serial_console_setup(cp); }*/ + +/********************** + * TODO_BOOTTRACE + *********************/ /* Enable boot trace? */ /*if (!mt86_strncmp(cp, "btrace", 6)) { cp += 6; @@ -439,7 +451,10 @@ void test_start(void) * Will get redone later when we know how many CPUs we have */ barrier_init(1); - btrace(my_cpu_num, __LINE__, "Begin ", 1, 0, 0); +/********************** + * TODO_BOOTTRACE + *********************/ + //btrace(my_cpu_num, __LINE__, "Begin ", 1, 0, 0); if(0) { char log[23] = "pllm_upper = "; @@ -467,7 +482,11 @@ void test_start(void) start_seq = 1; //initialise_cpus(); todo smp - btrace(my_cpu_num, __LINE__, "BeforeInit", 1, 0, 0); + +/********************** + * TODO_BOOTTRACE + *********************/ + //btrace(my_cpu_num, __LINE__, "BeforeInit", 1, 0, 0); /* Draw the screen and get system information */ /* @@ -530,16 +549,26 @@ void test_start(void) find_ticks_for_pass(); } else { /* APs only, Register the APs */ - btrace(my_cpu_num, __LINE__, "AP_Start ", 0, my_cpu_num, - cpu_ord); + + +/********************** + * TODO_BOOTTRACE + *********************/ + //btrace(my_cpu_num, __LINE__, "AP_Start ", 0, my_cpu_num, cpu_ord); + + smp_ap_booted(my_cpu_num); /* Asign a sequential CPU ordinal to each active cpu */ spin_lock(&barr->mutex); my_cpu_ord = cpu_ord++; smp_set_ordinal(my_cpu_num, my_cpu_ord); spin_unlock(&barr->mutex); - btrace(my_cpu_num, __LINE__, "AP_Done ", 0, my_cpu_num, - my_cpu_ord); + + +/********************** + * TODO_BOOTTRACE + *********************/ + //btrace(my_cpu_num, __LINE__, "AP_Done ", 0, my_cpu_num, my_cpu_ord); } } else { @@ -547,12 +576,20 @@ void test_start(void) spin_unlock(&barr->mutex); /* Get the CPU ordinal since it is lost during relocation */ my_cpu_ord = smp_my_ord_num(my_cpu_num); - btrace(my_cpu_num, __LINE__, "Reloc_Done",0,my_cpu_num,my_cpu_ord); + +/********************** + * TODO_BOOTTRACE + *********************/ + //btrace(my_cpu_num, __LINE__, "Reloc_Done",0,my_cpu_num,my_cpu_ord); } /* A barrier to insure that all of the CPUs are done with startup */ barrier(); - btrace(my_cpu_num, __LINE__, "1st Barr ", 1, my_cpu_num, my_cpu_ord); + +/********************** + * TODO_BOOTTRACE + *********************/ + //btrace(my_cpu_num, __LINE__, "1st Barr ", 1, my_cpu_num, my_cpu_ord); /* Setup Memory Management and measure memory speed, we do it here @@ -581,9 +618,10 @@ void test_start(void) } //enable_fp_processing(); - - btrace(my_cpu_num, __LINE__, "Mem Mgmnt ", - 1, cpu_id.fid.bits.pae, cpu_id.fid.bits.lm); +/********************** + * TODO_BOOTTRACE + *********************/ + //btrace(my_cpu_num, __LINE__, "Mem Mgmnt ", 1, cpu_id.fid.bits.pae, cpu_id.fid.bits.lm); /* Setup memory management modes */ if (logflag) { @@ -609,7 +647,12 @@ void test_start(void) /* Set the initialized flag only after all of the CPU's have * Reached the barrier. This insures that relocation has * been completed for each CPU. */ - btrace(my_cpu_num, __LINE__, "Start Done", 1, 0, 0); + +/********************** + * TODO_BOOTTRACE + *********************/ + //btrace(my_cpu_num, __LINE__, "Start Done", 1, 0, 0); + start_seq = 2; /* Loop through all tests */ @@ -633,7 +676,13 @@ void test_start(void) /* Main scheduling barrier */ cprint(8, my_cpu_num+7, "W"); - btrace(my_cpu_num, __LINE__, "Sched_Barr", 1,window,win_next); + +/********************** + * TODO_BOOTTRACE + *********************/ + //btrace(my_cpu_num, __LINE__, "Sched_Barr", 1,window,win_next); + + barrier(); /* Don't go over the 8TB PAE limit */ @@ -661,8 +710,13 @@ void test_start(void) }*/ /* Decide which CPU(s) to use */ - btrace(my_cpu_num, __LINE__, "Sched_CPU0",1,cpu_sel, - tseq[test].cpu_sel); + +/********************** + * TODO_BOOTTRACE + *********************/ + // btrace(my_cpu_num, __LINE__, "Sched_CPU0",1,cpu_sel, tseq[test].cpu_sel); + + run = 1; /*if (logflag && log_fine) { @@ -721,7 +775,11 @@ void test_start(void) break; } - btrace(my_cpu_num, __LINE__, "Sched_CPU1",1,run_cpus,run); +/********************** + * TODO_BOOTTRACE + *********************/ + //btrace(my_cpu_num, __LINE__, "Sched_CPU1",1,run_cpus,run); + barrier(); dprint(9, 7, run_cpus, 2, 0); @@ -744,7 +802,11 @@ void test_start(void) continue; } cprint(8, my_cpu_num+7, "-"); - btrace(my_cpu_num, __LINE__, "Sched_Win0",1,window,win_next); + +/********************** + * TODO_BOOTTRACE + *********************/ + //btrace(my_cpu_num, __LINE__, "Sched_Win0",1,window,win_next); if (logflag) { @@ -790,8 +852,10 @@ void test_start(void) winx.end = win_next; } - btrace(my_cpu_num,__LINE__,"Sched_Win1",1,winx.start, - winx.end); +/********************** + * TODO_BOOTTRACE + *********************/ + //btrace(my_cpu_num,__LINE__,"Sched_Win1",1,winx.start, winx.end); /* Find the memory areas to test */ segs = compute_segments(winx, my_cpu_num); @@ -805,8 +869,11 @@ void test_start(void) } s_barrier(); - btrace(my_cpu_num,__LINE__,"Sched_Win2",1,segs, - vv->map[0].pbase_addr); + +/********************** + * TODO_BOOTTRACE + *********************/ + // btrace(my_cpu_num,__LINE__,"Sched_Win2",1,segs, vv->map[0].pbase_addr); if (logflag && log_fine) { char log[31] = "test_start(): segs = "; @@ -825,12 +892,17 @@ void test_start(void) /* break; }*/ - btrace(my_cpu_num, __LINE__, "Strt_Test ",1,my_cpu_num, - my_cpu_ord); +/********************** + * TODO_BOOTTRACE + *********************/ + // btrace(my_cpu_num, __LINE__, "Strt_Test ",1,my_cpu_num, my_cpu_ord); do_test(my_cpu_ord); - btrace(my_cpu_num, __LINE__, "End_Test ",1,my_cpu_num, - my_cpu_ord); + +/********************** + * TODO_BOOTTRACE + *********************/ + //btrace(my_cpu_num, __LINE__, "End_Test ",1,my_cpu_num, my_cpu_ord); /* paging_off(); TODO */ @@ -841,7 +913,11 @@ void test_start(void) } s_barrier(); - btrace(my_cpu_num, __LINE__, "End_Win ",1,test, window); + +/********************** + * TODO_BOOTTRACE + *********************/ + // btrace(my_cpu_num, __LINE__, "End_Win ",1,test, window); /* Setup for the next set of windows */ win_next = 0; @@ -893,7 +969,10 @@ void test_start(void) break; } - btrace(my_cpu_num, __LINE__, "Next_CPU ",1,cpu_sel,test); +/********************** + * TODO_BOOTTRACE + *********************/ + //btrace(my_cpu_num, __LINE__, "Next_CPU ",1,cpu_sel,test); /* If this was the last test then we finished a pass */ if (pass_flag) @@ -942,9 +1021,16 @@ void test_start(void) while(1); // TODO remove and set reboot //reboot(); } - if (!btflag) + + +/********************** + * TODO_BOOTTRACE + *********************/ +/* if (!btflag) cprint(LINE_MSG, COL_MSG-8, - "** Pass complete, no errors, press Esc to exit **"); + "** Pass complete, no errors, press Esc to exit **");*/ + + if(BEEP_END_NO_ERROR) { /*beep(1000); |