Re: __setup()'s not processed in bk-current

From: Rusty Russell
Date: Mon Jun 28 2004 - 21:46:24 EST


On Tue, 2004-06-29 at 09:57, Andrew Morton wrote:
> We're now putting 24-byte structures into .init.setup via __setup. But
> x86_64's compiler is emitting a `.align 16' in there, so they end up on
> 32-byte boundaries and do_early_param()'s pointer arithmetic goes wrong.
>
> Fix that up by forcing the compiler to align these structures to sizeof(long).

Um, that's really odd, and at least deserves a comment.

There are a number of places where we assume that we can iterate through
all entries in a section as an array, rth would know if we've just been
lucky...

Thanks,
Rusty.

> diff -puN include/linux/init.h~x86_64-setup-section-alignment-fix include/linux/init.h
> --- 25/include/linux/init.h~x86_64-setup-section-alignment-fix 2004-06-28 16:47:41.000000000 -0700
> +++ 25-akpm/include/linux/init.h 2004-06-28 16:47:41.000000000 -0700
> @@ -119,6 +119,7 @@ struct obs_kernel_param {
> static struct obs_kernel_param __setup_##unique_id \
> __attribute_used__ \
> __attribute__((__section__(".init.setup"))) \
> + __attribute__((aligned((sizeof(long))))) \
> = { __setup_str_##unique_id, fn, early }
>
> #define __setup_null_param(str, unique_id) \
>
> _
--
Anyone who quotes me in their signature is an idiot -- Rusty Russell

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/