[coreboot] [patch][v2] remove inline functions in fam10 source

Segher Boessenkool segher at kernel.crashing.org
Fri Apr 25 08:02:49 CEST 2008


> Remove inline from FAM10 CPU initialization functions. This should 
> save some ROM space.

> -static inline u32 get_initial_apicid(void)
> +static u32 get_initial_apicid(void)
>  {
>  	return ((cpuid_ebx(1) >> 24) & 0xff);
>  }

> -static inline void _WRMSR(u32 addr, u32 lo, u32 hi)
> +static void _WRMSR(u32 addr, u32 lo, u32 hi)
>  {
>  	__asm__ volatile (
>  		"wrmsr"

> -static inline u32 bsf(u32 x)
> +static u32 bsf(u32 x)
>  {
>  	u8 i;
>  	u32 ret = 32;

> -static inline u32 read_cr4(void)
> +static u32 read_cr4(void)
>  {
>  	u32 cr4;
>  	__asm__ volatile ("movl %%cr4, %0" : "=r" (cr4));

Things like these (not exhaustive) are usually *smaller* when inlined;
they compile to a single machine instruction (or two or so), and don't
have the space overhead for setting up a call (saving stuff to stack,
etc.)

But don't take my word for it, just measure it after every change :-)

Rest looks good.


Segher





More information about the coreboot mailing list