Skip to contentSkip to conversation

Fix boot on efi 32 bit Machines

PATCH In review Edgar Hucek 3 participants 4 messages Jun 20, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix boot on efi 32 bit Machines

Fix EFI boot on 32 bit machines with pcie port.
Efi machines does not have an e820 memory map.

arch/i386/kernel/setup.c +21 -17
@@ -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;
 }
 
 /*
#1 lore raw
Quoted 4 lines · On Tue, 20 Jun 2006 15:30:03 +0200 Edgar Hucek wrote:

Fix EFI boot on 32 bit machines with pcie port.
Efi machines does not have an e820 memory map.

Darn, I was going to comment on the patch, but the attachment isn't quoted... :(

1. if you modify this patch, change
+ if(!efi_enabled) {
to

	if (!efi_enabled) {

to be compatible with Linux coding style.

2. There are ways to send inline patches with thunderbird. Take a look at these:
http://mbligh.org/linuxdocs/Email/Clients/Thunderbird
http://lkml.org/lkml/2005/12/27/191
http://lists.osdl.org/pipermail/kernel-janitors/2006-June/006478.html

Thanks,
---
~Randy

#2 lore raw
Quoted 11 lines

Darn, I was going to comment on the patch, but the attachment isn't quoted... :(

1. if you modify this patch, change

arch/i386/kernel/setup.c +1 -0
+	if(!efi_enabled) {

to

	if (!efi_enabled) {

to be compatible with Linux coding style.

Care to name the section this is listed in? It is used all over the place in examples in the CodingStyle document, but I could not find an explanation which explicitly says "space after if".

Jan Engelhardt

#3 lore raw
Quoted 5 lines · On Tue, 20 Jun 2006 23:58:57 +0200 (MEST) Jan Engelhardt wrote:
Quoted 5 lines

Darn, I was going to comment on the patch, but the attachment isn't quoted... :(

Quoted 9 lines
Quoted 6 lines

1. if you modify this patch, change

arch/i386/kernel/setup.c +1 -0
+	if(!efi_enabled) {

to

	if (!efi_enabled) {

to be compatible with Linux coding style.

Care to name the section this is listed in? It is used all over the place in examples in the CodingStyle document, but I could not find an explanation which explicitly says "space after if".

Nope, I didn't say compatible with Documentation/CodingStyle. I'm just basing it on visible evidence in source files and many emails requesting the same.

---
~Randy