[PATCHv2 2/2] Update ibm,client-architecture call field based on device tree
Tony Breeds
tony at bakeyournoodle.com
Tue Feb 2 14:48:32 EST 2010
On Mon, Feb 01, 2010 at 04:51:02PM -0600, Joel Schopp wrote:
> static void __init prom_send_capabilities(void)
> {
> ihandle elfloader, root;
> prom_arg_t ret;
> + u32 *cores;
>
> root = call_prom("open", 1, 1, ADDR("/"));
> if (root != 0) {
> + /*
> + * If you add to the struct, please be sure the 100 index
> + * didn't change. The BUILD_BUG_ON is a reminder.
> + */
> + cores = (u32 *) &ibm_architecture_vec[100];
> + if(*cores != NR_CPUS)
> + prom_printf("client-architecture structure corrupted\n");
> + *cores = (NR_CPUS / prom_smt_way());
> + prom_printf("setting client-architecture cores to %x\n", *cores);
I don't know if I'm painting a bike shed of if this is a real concern, but if
*cores isn't NR_CPUS shouldn't we do nothing rather then clobbering it?
Yours Tony
More information about the Linuxppc-dev
mailing list