Modify all FreeBSD bootloaders on PowerPC AIM (Book-S) systems to pass a

magic number to the kernel in r7 rather than the (currently unused and
irrelevant) width of the metadata pointer, which I believe was intended
for a never-used approach to the 64-bit port. This enables the kernel,
in a future commit, to switch on the cookie to distinguish a real
metadata pointer from loader(8) from garbage left in r6 by some other
boot loader.

MFC after:	3 weeks
This commit is contained in:
Nathan Whitehorn 2017-11-24 23:41:04 +00:00
parent e96f62322b
commit 28b2cf37b9
4 changed files with 6 additions and 6 deletions

View File

@ -91,7 +91,7 @@ __elfN(ofw_exec)(struct preloaded_file *fp)
mdp, sizeof(mdp));
} else {
OF_chain((void *)reloc, end - (char *)reloc, (void *)entry,
(void *)mdp, sizeof(mdp));
(void *)mdp, 0xfb5d104d);
}
panic("exec returned");

View File

@ -93,11 +93,11 @@ ppc64_ofw_elf_exec(struct preloaded_file *fp)
if (dtbp != 0) {
OF_quiesce();
((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, 0, 0,
mdp, sizeof(mdp));
((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp,
0, 0, mdp, 0xfb5d104d);
} else {
OF_chain((void *)reloc, end - (char *)reloc, (void *)entry,
(void *)mdp, sizeof(mdp));
(void *)mdp, 0xfb5d104d);
}
panic("exec returned");

View File

@ -96,7 +96,7 @@ ppc64_elf_exec(struct preloaded_file *fp)
trampoline[3] = dtb;
trampoline[6] = mdp;
trampoline[7] = sizeof(mdp);
trampoline[7] = 0xfb5d104d;
printf("Kernel entry at %#jx (%#x) ...\n", e->e_entry, trampoline[2]);
printf("DTB at %#x, mdp at %#x\n", dtb, mdp);

View File

@ -89,7 +89,7 @@ ppc64_elf_exec(struct preloaded_file *fp)
dev_cleanup();
entry(0 /* FDT */, 0 /* Phys. mem offset */, 0 /* OF entry */,
(void *)mdp, sizeof(mdp));
(void *)mdp, 0xfb5d104d);
panic("exec returned");
}