linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 1/1] Fix boot on efi 32 bit Machines [try #2]
@ 2006-06-24 19:18 Mikael Pettersson
  0 siblings, 0 replies; 2+ messages in thread
From: Mikael Pettersson @ 2006-06-24 19:18 UTC (permalink / raw)
  To: hostmaster, linux-kernel

On Fri, 23 Jun 2006 11:43:02 +0200, Edgar Hucek wrote:
>Fix EFI boot on 32 bit machines with pcie port.
>Efi machines does not have an e820 memory map.
>This bug makes native efi boots on Intel Mac's
>impossible.
>
>Signed-off-by: Edgar Hucek <hostmaster@ed-soft.at>
>
>--- a/arch/i386/kernel/setup.c	2006-06-19 09:12:09.000000000 +0200
>+++ b/arch/i386/kernel/setup.c	2006-06-19 09:12:24.000000000 +0200
>@@ -975,24 +975,28 @@
> 	u64 start = s;
> 	u64 end = e;
> 	int i;
>-	for (i = 0; i < e820.nr_map; i++) {
>-		struct e820entry *ei = &e820.map[i];
>-		if (type && ei->type != type)
>-			continue;
>-		/* is the region (part) in overlap with the current region ?*/
>-		if (ei->addr >= end || ei->addr + ei->size <= start)
>-			continue;
>-		/* if the region is at the beginning of <start,end> we move
>-		 * start to the end of the region since it's ok until there
>-		 */
>-		if (ei->addr <= start)
>-			start = ei->addr + ei->size;
>-		/* if start is now at or beyond end, we're done, full
>-		 * coverage */
>-		if (start >= end)
>-			return 1; /* we're done */
>+	if (!efi_enabled) {
>+		for (i = 0; i < e820.nr_map; i++) {
>+			struct e820entry *ei = &e820.map[i];
>+			if (type && ei->type != type)
>+				continue;
>+			/* is the region (part) in overlap with the current region ?*/
>+			if (ei->addr >= end || ei->addr + ei->size <= start)
>+				continue;
>+			/* if the region is at the beginning of <start,end> we move
>+			 * start to the end of the region since it's ok until there
>+			 */
>+			if (ei->addr <= start)
>+				start = ei->addr + ei->size;
>+			/* if start is now at or beyond end, we're done, full
>+			 * coverage */
>+			if (start >= end)
>+				return 1; /* we're done */
>+		}
>+		return 0;
>+	} else {
>+		return 1;
> 	}
>-	return 0;
> }

It looks like all this patch does is to put the existing
for() loop inside an "if (!efi_enabled)", changing its
indentation in the process. It would be MUCH cleaner to
just prefix the original e820 code with an

	if (efi_enabled)
		return 1;

statement. It reduces the size of the patch, and makes it
clear that none of the existing e820 code is altered.

/Mikael

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] Fix boot on efi 32 bit Machines [try #2]
@ 2006-06-23  9:43 Edgar Hucek
  0 siblings, 0 replies; 2+ messages in thread
From: Edgar Hucek @ 2006-06-23  9:43 UTC (permalink / raw)
  To: LKML

Fix EFI boot on 32 bit machines with pcie port.
Efi machines does not have an e820 memory map.
This bug makes native efi boots on Intel Mac's
impossible.

Signed-off-by: Edgar Hucek <hostmaster@ed-soft.at>

--- a/arch/i386/kernel/setup.c	2006-06-19 09:12:09.000000000 +0200
+++ b/arch/i386/kernel/setup.c	2006-06-19 09:12:24.000000000 +0200
@@ -975,24 +975,28 @@
 	u64 start = s;
 	u64 end = e;
 	int i;
-	for (i = 0; i < e820.nr_map; i++) {
-		struct e820entry *ei = &e820.map[i];
-		if (type && ei->type != type)
-			continue;
-		/* is the region (part) in overlap with the current region ?*/
-		if (ei->addr >= end || ei->addr + ei->size <= start)
-			continue;
-		/* if the region is at the beginning of <start,end> we move
-		 * start to the end of the region since it's ok until there
-		 */
-		if (ei->addr <= start)
-			start = ei->addr + ei->size;
-		/* if start is now at or beyond end, we're done, full
-		 * coverage */
-		if (start >= end)
-			return 1; /* we're done */
+	if (!efi_enabled) {
+		for (i = 0; i < e820.nr_map; i++) {
+			struct e820entry *ei = &e820.map[i];
+			if (type && ei->type != type)
+				continue;
+			/* is the region (part) in overlap with the current region ?*/
+			if (ei->addr >= end || ei->addr + ei->size <= start)
+				continue;
+			/* if the region is at the beginning of <start,end> we move
+			 * start to the end of the region since it's ok until there
+			 */
+			if (ei->addr <= start)
+				start = ei->addr + ei->size;
+			/* if start is now at or beyond end, we're done, full
+			 * coverage */
+			if (start >= end)
+				return 1; /* we're done */
+		}
+		return 0;
+	} else {
+		return 1;
 	}
-	return 0;
 }
 
 /*



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-24 19:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-24 19:18 [PATCH 1/1] Fix boot on efi 32 bit Machines [try #2] Mikael Pettersson
  -- strict thread matches above, loose matches on Subject: below --
2006-06-23  9:43 Edgar Hucek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).