Subject: Re: [PATCH 7/7] [POWERPC] implement BEGIN/END_FW_FTR_SECTION

From: Benjamin Herrenschmidt <[email-masked]>
Date: Wed, 04 Oct 2006 17:58:03 +1000

> +/*
> + * do_fw_ftr_fixups - goes through the list of firmware feature fixups
> + * and writes nop's over sections of code that don't apply for this firmware.
> + * r3 = data offset (not changed)
> + */
> +_GLOBAL(do_fw_ftr_fixups)
> +	/* Get firmware features */
> +	LOAD_REG_IMMEDIATE(r6,powerpc_firmware_features)
> +	sub	r6,r6,r3
> +	ld	r4,0(r6)
> +	/* Get the fixup table */
> +	LOAD_REG_IMMEDIATE(r6,__start___fw_ftr_fixup)
> +	sub	r6,r6,r3
> +	LOAD_REG_IMMEDIATE(r7,__stop___fw_ftr_fixup)
> +	sub	r7,r7,r3
> +	/* Do the fixup */
> +1:	cmpld	r6,r7
> +	bgelr

 .../...

I'd rather have a single apply_ftr_fixups() that takes the start/stop of
the fixup table and the value to compare against. That could then be
called for fw fixups at boot, fw fixups from modules, cpu fixups at
boot, cpu fixups from modules, and possibly fixups in the vdso's is a
feature I've been thinking of, and which would be easier with just a
single function like that.

Ben.