summaryrefslogtreecommitdiffstats
path: root/efi_memtest
diff options
context:
space:
mode:
authorRegina König2021-03-16 11:30:44 +0100
committerRegina König2021-03-16 11:30:44 +0100
commit33b7fda6b6d2d844dd645f51f7e6497e1692c48e (patch)
tree04273062756e446245bfe2593b1fea51c3467626 /efi_memtest
parentMoved allocate pages into addr_tst2 (diff)
downloadmemtest86-33b7fda6b6d2d844dd645f51f7e6497e1692c48e.tar.gz
memtest86-33b7fda6b6d2d844dd645f51f7e6497e1692c48e.tar.xz
memtest86-33b7fda6b6d2d844dd645f51f7e6497e1692c48e.zip
pages are allocated only one time
Diffstat (limited to 'efi_memtest')
-rw-r--r--efi_memtest/memtest86+/efi/test.c4
-rw-r--r--efi_memtest/memtest86+/main.c11
2 files changed, 11 insertions, 4 deletions
diff --git a/efi_memtest/memtest86+/efi/test.c b/efi_memtest/memtest86+/efi/test.c
index 6cd3f1d..d071a75 100644
--- a/efi_memtest/memtest86+/efi/test.c
+++ b/efi_memtest/memtest86+/efi/test.c
@@ -471,10 +471,6 @@ void addr_tst2(int me)
print_log("addr_tst2(): starting addr_tst2_init_segment", 44);
}
- for (int i = 0; i < segs; i++) {
- allocate_pages((UINTN) (pe - p)>>9, (EFI_PHYSICAL_ADDRESS *) p);
- }
-
/* Write each address with its own address */
unsliced_foreach_segment(nullptr, me, addr_tst2_init_segment);
{ BAILR }
diff --git a/efi_memtest/memtest86+/main.c b/efi_memtest/memtest86+/main.c
index 62e9bcb..769a37b 100644
--- a/efi_memtest/memtest86+/main.c
+++ b/efi_memtest/memtest86+/main.c
@@ -62,6 +62,8 @@ int find_chunks(int test);
static void test_setup(void);
static int compute_segments(struct pmap map, int cpu);
int do_test(int ord);
+int pages_allocated = 0;
+
struct tseq tseq[] =
{
{1, -1, 0, 6, 0, "[Address test, walking ones, no cache] "},
@@ -1019,6 +1021,13 @@ int do_test(int my_ord)
print_log(log, length);
}
+ if (pages_allocated == 0) {
+ for (int i = 0; i < segs; i++) {
+ allocate_pages((UINTN) (pe - p)>>9, (EFI_PHYSICAL_ADDRESS *) p);
+ }
+ pages_allocated = 1;
+ }
+
switch(tseq[test].pat) {
/* do the testing according to the selected pattern */
@@ -1216,6 +1225,8 @@ int do_test(int my_ord)
break;
}
+ // TODO free pages
+
if (logflag) {
print_log("do_test() finished.\n", 20);
}