Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
memdisk/setup: Move duplicate code in int15maxres to new function
  • Loading branch information
geneC committed Feb 7, 2011
1 parent a188ebe commit 8bfabb6
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions memdisk/setup.c
Expand Up @@ -705,6 +705,17 @@ static int stack_needed(void)
return v;
}

uint32_t getramtop(void)
{
if (high_mem) {
return high_mem + (1<<24);
} else if (low_mem) {
return low_mem + (1<<20);
} else {
return 0;
}
}

/*
* Specify max RAM by reservation
* Adds a reservation to data in INT15h to prevent access to the top of RAM
Expand All @@ -714,27 +725,14 @@ void int15maxres(uint32_t restop)
{
uint32_t ramtop;

if (high_mem) {
ramtop = high_mem + (1<<24);
} else if (low_mem) {
ramtop = low_mem + (1<<20);
} else {
ramtop = 0;
}

ramtop = getramtop();
/* printf(" TOP RAM-%08x RES-%08x", ramtop, restop); */
if (restop < ramtop) {
/* printf(" (A)"); */
insertrange(restop, (ramtop - restop), 3);
parse_mem();
}
if (high_mem) {
ramtop = high_mem + (1<<24);
} else if (low_mem) {
ramtop = low_mem + (1<<20);
} else {
ramtop = 0;
}
ramtop = getramtop();
/* printf(" NOW RAM-%08x\n", ramtop); */
}

Expand Down

0 comments on commit 8bfabb6

Please sign in to comment.