[coreboot] inline asm peculiarities in v3

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Thu Sep 4 17:32:49 CEST 2008


I decided to look at all cases of inline asm in our v3 code and I found
a few bits which either work by accident or need better documentation.

We use __asm__ and asm, __volatile__ and volatile. Can we please decide
which one we want, then I'll switch the tree over.

> __asm__(".text\n" "real_mode_switch_end:\n");
> extern char real_mode_switch_end[];
AFAICS the compiler and linker are free to place the resulting code
anywhere in the binary independent of each other.

> static void disable_cache_as_ram_bsp(void)
> {
>         __asm__ volatile (
> //              "pushl %eax\n\t"
>                 "pushl %edx\n\t"
>                 "pushl %ecx\n\t"
>         );
>         disable_cache_as_ram();
>         __asm__ volatile (
>                 "popl %ecx\n\t"
>                 "popl %edx\n\t"
> //                "popl %eax\n\t"
>         );
> }
The pushl and popl instructions seem to serve no real purpose. Kill them?

The K8 CAR disabling has inline asm depending on good compiler behaviour
and luck. Patch will be sent separately.



More information about the coreboot mailing list