Re: 11.2-RC3 powerpc CD image does not boot on PowerMac G4

"Jukka A. Ukkonen" <[email protected]>
Newsgroups gmane.os.freebsd.devel.ppc
Message-ID <[email protected]>
I tried browsing through everything that has been changed in
the ppc SMP code since 10.4. I cannot claim much success, though.
Anyhow I found one odd feature which does not quite make sense
on a 32-bit platform. Obviously I also patched it and tested
the resulting kernel. Even if this was not the reason for boot
failures on SMP ppc systems, it might be worth to patch in the
official source code. Casting 32-bit pointers to 64-bit unsigned
values for comparison only slows things down on 32-bit systems.
Obviously the compiler will optimize the patched code such that
the unused if-branch will completely removed in the resulting
binary.

11.2 still fails to boot on SMP ppc, but I have no idea what to
test next.

--jau

_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ppc
To unsubscribe, send any mail to "[email protected]"
PPC-platform.c.diff (text/x-patch, 810 B)
Index: sys/powerpc/powerpc/platform.c
===================================================================
--- sys/powerpc/powerpc/platform.c	(revision 335668)
+++ sys/powerpc/powerpc/platform.c	(working copy)
@@ -87,8 +87,14 @@
 memr_merge(struct mem_region *from, struct mem_region *to)
 {
 	vm_offset_t end;
-	end = uqmax(to->mr_start + to->mr_size, from->mr_start + from->mr_size);
-	to->mr_start = uqmin(from->mr_start, to->mr_start);
+	if (sizeof(end) == 8) {
+		end = uqmax(to->mr_start + to->mr_size, from->mr_start + from->mr_size);
+		to->mr_start = uqmin(from->mr_start, to->mr_start);
+	}
+	else /* (sizeof(end) == 4) */ {
+		end = ulmax(to->mr_start + to->mr_size, from->mr_start + from->mr_size);
+		to->mr_start = ulmin(from->mr_start, to->mr_start);
+	}
 	to->mr_size = end - to->mr_start;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.