Message ID | 20110215131245.GE19666@os.inf.tu-dresden.de |
---|---|
State | New |
Headers | show |
On 15 February 2011 13:12, Adam Lackorzynski <adam@os.inf.tu-dresden.de> wrote: > > On Tue Feb 15, 2011 at 13:01:08 +0000, Peter Maydell wrote: >> On 15 February 2011 10:48, Adam Lackorzynski <adam@os.inf.tu-dresden.de> wrote: >> > Make smpboot available not only for Linux but for all setups. >> >> I'm not convinced about this. I think if you're providing a raw >> image for an SMP system (rather than a Linux kernel) then it's >> your job to provide an image which handles the bootup of the >> secondary CPUs, the same way it would be if you were providing >> a ROM image for real hardware. > > Ok, this is one possibility. Another one would be something like this: > @@ -112,7 +112,11 @@ static void secondary_cpu_reset(void *opaque) > /* Set entry point for secondary CPUs. This assumes we're using > the init code from arm_boot.c. Real hardware resets all CPUs > the same. */ > - env->regs[15] = SMP_BOOT_ADDR; > + if (realview_binfo.is_linux) { > + env->regs[15] = SMP_BOOT_ADDR; > + } else { > + env->regs[15] = realview_binfo.entry; > + } > } Moving in the right direction, but it would be cleaner if the secondary CPU reset was handled inside arm_boot.c, I think (there is a TODO in that file to that effect). Then we could get rid of the cpu reset hook from realview.c. -- PMM
diff --git a/hw/realview.c b/hw/realview.c index 6eb6c6a..574bc11 100644 --- a/hw/realview.c +++ b/hw/realview.c @@ -112,7 +112,11 @@ static void secondary_cpu_reset(void *opaque) /* Set entry point for secondary CPUs. This assumes we're using the init code from arm_boot.c. Real hardware resets all CPUs the same. */ - env->regs[15] = SMP_BOOT_ADDR; + if (realview_binfo.is_linux) { + env->regs[15] = SMP_BOOT_ADDR; + } else { + env->regs[15] = realview_binfo.entry; + } } /* The following two lists must be consistent. */