Re: [PATCH]: Prevent sn2 ptc code from executing on all ia64 subarches

From: Luck, Tony <tony.luck_at_intel.com>
Date: 2005-12-14 04:57:50
On Tue, Dec 13, 2005 at 10:42:28AM -0500, Prarit Bhargava wrote:
> Therefore the could would be something like (this is based off the existing 
> do_initcalls)
> 
> for (call = __initcall_start, platform = __platform_start;
>       call < __initcall_end; call++, platform++) {

Running two separate parallel structures seems complex.
Why not make the entries in the .initcall sections be tuples
instead of just being an array:

struct initcalls {
	initcall_t	call;
#ifdef	CONFIG_PLATFORM_SPECIFIC_INIT
	char		*platform;
#endif
};

#ifndef CONFIG_PLATFORM_SPECIFIC_INIT
#define	arch_match(str) 1
old definition of __define_initcall (modified for structure}
#else
new definition of __define_initcall initializes to "{ fn, 0 }"
plus a __define_initcall_platform() that takes the extra arg
and initializes to "{ fn, plat }"
#endif

Then the do_initcalls loop looks like this:

	struct initcalls *call;

	for (call = __initcall_start; call < __initcall_end; call++) {
		if (!arch_match(call->platform))
			continue;
		(*call->call)();


		...
	}

-Tony
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Dec 14 05:01:32 2005

This archive was generated by hypermail 2.1.8 : 2005-12-14 05:01:42 EST