diff options
author | Gene Cumm <gene.cumm@gmail.com> | 2011-02-06 22:03:55 -0500 |
---|---|---|
committer | Gene Cumm <gene.cumm@gmail.com> | 2011-02-06 22:03:55 -0500 |
commit | 8bfabb61d921d429b2b3caa151779ced276316d9 (patch) | |
tree | db95c1a7d78ad92f1915f12b3ef5657f0ba4701c | |
parent | a188ebe576e274deee693903cbac77778b6d1f2a (diff) | |
download | syslinux-8bfabb61d921d429b2b3caa151779ced276316d9.tar.gz syslinux-8bfabb61d921d429b2b3caa151779ced276316d9.tar.xz syslinux-8bfabb61d921d429b2b3caa151779ced276316d9.zip |
memdisk/setup: Move duplicate code in int15maxres to new function
-rw-r--r-- | memdisk/setup.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/memdisk/setup.c b/memdisk/setup.c index bf3d5d63..de1433a2 100644 --- a/memdisk/setup.c +++ b/memdisk/setup.c @@ -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 @@ -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); */ } |