[syslinux:master] memdisk/setup: Change int15maxres to parse memory range lines

syslinux-bot for Gene Cumm gene.cumm at gmail.com
Wed Mar 2 15:12:37 PST 2011


Commit-ID:  e10b3d5c70245484868d85a18c331e410d8b1a2d
Gitweb:     http://syslinux.zytor.com/commit/e10b3d5c70245484868d85a18c331e410d8b1a2d
Author:     Gene Cumm <gene.cumm at gmail.com>
AuthorDate: Sun, 6 Feb 2011 22:59:53 -0500
Committer:  Gene Cumm <gene.cumm at gmail.com>
CommitDate: Sun, 6 Feb 2011 22:59:53 -0500

memdisk/setup: Change int15maxres to parse memory range lines

Only touch the ranges that are type 1 (available)


---
 memdisk/setup.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/memdisk/setup.c b/memdisk/setup.c
index 623c9cd..75e8475 100644
--- a/memdisk/setup.c
+++ b/memdisk/setup.c
@@ -724,16 +724,21 @@ uint32_t getramtop(void)
 void int15maxres(uint32_t restop)
 {
     uint32_t ramtop;
+    struct e820range *ep;
 
     ramtop = getramtop();
-    /* printf("  TOP RAM-%08x  RES-%08x", ramtop, restop); */
-    if (restop < ramtop) {
-	/* printf("  (A)"); */
-	insertrange(restop, (ramtop - restop), 3);
-	parse_mem();
+    for (ep = ranges; ep->type != -1U; ep++) {
+	if (ep->type == 1) {	/* Only if available */
+	    if (ep->start >= restop) {
+		printf("  %08x -> 2\n", ep->start);
+		ep->type = 2;
+	    } else if (ep[1].start > restop) {
+		printf("  +%08x =2; cut %08x\n", restop, ep->start);
+		insertrange(restop, (ep[1].start - restop), 2);
+	    }
+	}
     }
-    ramtop = getramtop();
-    /* printf("    NOW RAM-%08x\n", ramtop); */
+    parse_mem();
 }
 
 struct real_mode_args rm_args;



More information about the Syslinux-commits mailing list