summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/aim
diff options
context:
space:
mode:
authorraj <raj@FreeBSD.org>2009-04-24 08:57:54 +0000
committerraj <raj@FreeBSD.org>2009-04-24 08:57:54 +0000
commit9d122f9cbab9d826e0409d7b1934c5ed20f9af86 (patch)
tree5bbbd84aac7edd469bdbed3467a582aa85275671 /sys/powerpc/aim
parentb14076b18586d6cafeb16aadb9824f7df7d967d2 (diff)
downloadFreeBSD-src-9d122f9cbab9d826e0409d7b1934c5ed20f9af86.zip
FreeBSD-src-9d122f9cbab9d826e0409d7b1934c5ed20f9af86.tar.gz
Zero PCB during early AIM PowerPC init.
When memory is not zero'ed by firmware, uninitialized PCB can have bogus contents, which appear as a saved onfault condition, Altivec context to restore etc. and lead to corruption/crashes. This commit fixes such issues. Submitted by: Michal Mazur arg ! semihalf dot com Tested by: Andreas Tobler andreast-list ! fgznet dot ch
Diffstat (limited to 'sys/powerpc/aim')
-rw-r--r--sys/powerpc/aim/machdep.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/powerpc/aim/machdep.c b/sys/powerpc/aim/machdep.c
index fb83e3a..4e8909f 100644
--- a/sys/powerpc/aim/machdep.c
+++ b/sys/powerpc/aim/machdep.c
@@ -505,6 +505,7 @@ powerpc_init(u_int startkernel, u_int endkernel, u_int basekernel, void *mdp)
thread0.td_pcb = (struct pcb *)
((thread0.td_kstack + thread0.td_kstack_pages * PAGE_SIZE -
sizeof(struct pcb)) & ~15);
+ bzero((void *)thread0.td_pcb, sizeof(struct pcb));
pc->pc_curpcb = thread0.td_pcb;
/* Initialise the message buffer. */
OpenPOWER on IntegriCloud