Skip to content

Commit

Permalink
use bool
Browse files Browse the repository at this point in the history
  • Loading branch information
laffer1 committed Dec 1, 2024
1 parent b060917 commit d53bcfd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
19 changes: 10 additions & 9 deletions sys/amd64/amd64/machdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,10 +988,11 @@ getmemsize(caddr_t kmdp, u_int64_t first)
if (physmap[i + 1] < end)
end = trunc_page(physmap[i + 1]);
for (pa = round_page(physmap[i]); pa < end; pa += PAGE_SIZE) {
int tmp, page_bad, full;
int *ptr = (int *)CADDR1;
int tmp;
bool full, page_bad;

full = FALSE;
full = false;
/*
* block out kernel memory as not available.
*/
Expand All @@ -1006,7 +1007,7 @@ getmemsize(caddr_t kmdp, u_int64_t first)
&& pa < dcons_addr + dcons_size)
goto do_dump_avail;

page_bad = FALSE;
page_bad = false;
if (memtest == 0)
goto skip_memtest;

Expand All @@ -1030,25 +1031,25 @@ getmemsize(caddr_t kmdp, u_int64_t first)
*/
*(volatile int *)ptr = 0xaaaaaaaa;
if (*(volatile int *)ptr != 0xaaaaaaaa)
page_bad = TRUE;
page_bad = true;
/*
* Test for alternating 0's and 1's
*/
*(volatile int *)ptr = 0x55555555;
if (*(volatile int *)ptr != 0x55555555)
page_bad = TRUE;
page_bad = true;
/*
* Test for all 1's
*/
*(volatile int *)ptr = 0xffffffff;
if (*(volatile int *)ptr != 0xffffffff)
page_bad = TRUE;
page_bad = true;
/*
* Test for all 0's
*/
*(volatile int *)ptr = 0x0;
if (*(volatile int *)ptr != 0x0)
page_bad = TRUE;
page_bad = true;
/*
* Restore original value.
*/
Expand All @@ -1058,7 +1059,7 @@ getmemsize(caddr_t kmdp, u_int64_t first)
/*
* Adjust array of valid/good pages.
*/
if (page_bad == TRUE)
if (page_bad == true)
continue;
/*
* If this good page is a continuation of the
Expand All @@ -1079,7 +1080,7 @@ getmemsize(caddr_t kmdp, u_int64_t first)
printf(
"Too many holes in the physical address space, giving up\n");
pa_indx--;
full = TRUE;
full = true;
goto do_dump_avail;
}
phys_avail[pa_indx++] = pa; /* start */
Expand Down
19 changes: 10 additions & 9 deletions sys/i386/i386/machdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,10 +1139,11 @@ getmemsize(int first)
if (physmap[i + 1] < end)
end = trunc_page(physmap[i + 1]);
for (pa = round_page(physmap[i]); pa < end; pa += PAGE_SIZE) {
int tmp, page_bad, full;
int *ptr;
int tmp;
bool full, page_bad;

full = FALSE;
full = false;
/*
* block out kernel memory as not available.
*/
Expand All @@ -1157,7 +1158,7 @@ getmemsize(int first)
&& pa < dcons_addr + dcons_size)
goto do_dump_avail;

page_bad = FALSE;
page_bad = false;
if (memtest == 0)
goto skip_memtest;

Expand All @@ -1172,25 +1173,25 @@ getmemsize(int first)
*/
*(volatile int *)ptr = 0xaaaaaaaa;
if (*(volatile int *)ptr != 0xaaaaaaaa)
page_bad = TRUE;
page_bad = true;
/*
* Test for alternating 0's and 1's
*/
*(volatile int *)ptr = 0x55555555;
if (*(volatile int *)ptr != 0x55555555)
page_bad = TRUE;
page_bad = true;
/*
* Test for all 1's
*/
*(volatile int *)ptr = 0xffffffff;
if (*(volatile int *)ptr != 0xffffffff)
page_bad = TRUE;
page_bad = true;
/*
* Test for all 0's
*/
*(volatile int *)ptr = 0x0;
if (*(volatile int *)ptr != 0x0)
page_bad = TRUE;
page_bad = true;
/*
* Restore original value.
*/
Expand All @@ -1200,7 +1201,7 @@ getmemsize(int first)
/*
* Adjust array of valid/good pages.
*/
if (page_bad == TRUE)
if (page_bad == true)
continue;
/*
* If this good page is a continuation of the
Expand All @@ -1221,7 +1222,7 @@ getmemsize(int first)
printf(
"Too many holes in the physical address space, giving up\n");
pa_indx--;
full = TRUE;
full = true;
goto do_dump_avail;
}
phys_avail[pa_indx++] = pa; /* start */
Expand Down

0 comments on commit d53bcfd

Please sign in to comment.