summaryrefslogtreecommitdiff
path: root/memdisk
diff options
context:
space:
mode:
authorGene Cumm <gene.cumm@gmail.com>2011-02-07 20:53:13 -0500
committerGene Cumm <gene.cumm@gmail.com>2011-02-07 20:53:13 -0500
commit79c5db6df34806d082fbf7d7c40e249f6a10d823 (patch)
tree4fe90a5c1b46cccf047fe697ad0630144538248f /memdisk
parentd3c03fe651a932f058aca7596311ada76b80ba81 (diff)
downloadsyslinux-79c5db6df34806d082fbf7d7c40e249f6a10d823.tar.gz
memdisk/setup: Allow suffix processing on mem= parameter
Diffstat (limited to 'memdisk')
-rw-r--r--memdisk/Makefile4
-rw-r--r--memdisk/setup.c12
-rw-r--r--memdisk/suffix_number.c1
3 files changed, 13 insertions, 4 deletions
diff --git a/memdisk/Makefile b/memdisk/Makefile
index 0f519b20..73305d5e 100644
--- a/memdisk/Makefile
+++ b/memdisk/Makefile
@@ -15,7 +15,7 @@ topdir = ..
include $(topdir)/MCONFIG.embedded
-include $(topdir)/version.mk
-INCLUDES = -I$(topdir)/com32/include
+INCLUDES = -I$(topdir)/com32/include -I$(topdir)/com32/libutil/include
CFLAGS += -D__MEMDISK__ -DDATE='"$(DATE)"'
LDFLAGS = $(GCCOPT) -g
NASM = nasm
@@ -39,7 +39,7 @@ endif
OBJS16 = init.o16 init32.o
OBJS32 = start32.o setup.o msetup.o e820func.o conio.o memcpy.o memset.o \
memmove.o unzip.o dskprobe.o eltorito.o \
- ctypes.o strntoumax.o strtoull.o \
+ ctypes.o strntoumax.o strtoull.o suffix_number.o \
memdisk_chs_512.o memdisk_edd_512.o \
memdisk_iso_512.o memdisk_iso_2048.o
diff --git a/memdisk/setup.c b/memdisk/setup.c
index 7286210e..8317971e 100644
--- a/memdisk/setup.c
+++ b/memdisk/setup.c
@@ -14,6 +14,8 @@
* ----------------------------------------------------------------------- */
#include <stdint.h>
+#include <minmax.h>
+#include <suffix_number.h>
#include "bda.h"
#include "dskprobe.h"
#include "e820.h"
@@ -710,11 +712,17 @@ static int stack_needed(void)
* Adds a reservation to data in INT15h to prevent access to the top of RAM
* if there's any above the point specified.
*/
-void int15maxres(uint32_t restop)
+void int15maxres(unsigned long long restop_ull)
{
+ uint32_t restop;
struct e820range *ep;
const int int15restype = 2;
+ /* insertrange() works on uint32_t */
+ restop = min(restop_ull, UINT32_MAX);
+ /* printf(" int15maxres '%08x%08x' => %08x\n",
+ (unsigned int)(restop_ull>>32), (unsigned int)restop_ull, restop); */
+
for (ep = ranges; ep->type != -1U; ep++) {
if (ep->type == 1) { /* Only if available */
if (ep->start >= restop) {
@@ -968,7 +976,7 @@ void setup(const struct real_mode_args *rm_args_ptr)
}
if ((p = getcmditem("mem")) != CMD_NOTFOUND) {
- int15maxres(atou(p));
+ int15maxres(suffix_number(p));
}
/* The size is given by hptr->total_size plus the size of the E820
diff --git a/memdisk/suffix_number.c b/memdisk/suffix_number.c
new file mode 100644
index 00000000..dd266426
--- /dev/null
+++ b/memdisk/suffix_number.c
@@ -0,0 +1 @@
+#include "../com32/libutil/suffix_number.c"