From 54fbd11221e69eb2c840517b1fb7c1613930f899 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 18 Nov 2008 01:52:40 +0000 Subject: [build] Keep gcc 4.4 happy gcc 4.4 adds another few warnings, and also seems to complain if we place %ebp in the clobber list for any inline asm. --- src/arch/i386/firmware/pcbios/memmap.c | 14 ++++++++------ src/arch/i386/image/multiboot.c | 6 ++++-- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'src/arch') diff --git a/src/arch/i386/firmware/pcbios/memmap.c b/src/arch/i386/firmware/pcbios/memmap.c index 848979e9..2e9627c0 100644 --- a/src/arch/i386/firmware/pcbios/memmap.c +++ b/src/arch/i386/firmware/pcbios/memmap.c @@ -158,7 +158,7 @@ static int meme820 ( struct memory_map *memmap ) { uint32_t smap; size_t size; unsigned int flags; - unsigned int discard_d, discard_D; + unsigned int discard_D; /* Clear the E820 buffer. Do this once before starting, * rather than on each call; some BIOSes rely on the contents @@ -171,13 +171,15 @@ static int meme820 ( struct memory_map *memmap ) { * this by telling gcc that all non-output registers * may be corrupted. */ - __asm__ __volatile__ ( REAL_CODE ( "stc\n\t" + __asm__ __volatile__ ( REAL_CODE ( "pushl %%ebp\n\t" + "stc\n\t" "int $0x15\n\t" "pushfw\n\t" - "popw %w0\n\t" ) - : "=r" ( flags ), "=a" ( smap ), - "=b" ( next ), "=D" ( discard_D ), - "=c" ( size ), "=d" ( discard_d ) + "popw %%dx\n\t" + "popl %%ebp\n\t" ) + : "=a" ( smap ), "=b" ( next ), + "=c" ( size ), "=d" ( flags ), + "=D" ( discard_D ) : "a" ( 0xe820 ), "b" ( next ), "D" ( __from_data16 ( &e820buf ) ), "c" ( sizeof ( e820buf ) ), diff --git a/src/arch/i386/image/multiboot.c b/src/arch/i386/image/multiboot.c index a4a340fd..49adf951 100644 --- a/src/arch/i386/image/multiboot.c +++ b/src/arch/i386/image/multiboot.c @@ -282,11 +282,13 @@ static int multiboot_exec ( struct image *image ) { /* Jump to OS with flat physical addressing */ DBGC ( image, "MULTIBOOT %p starting execution at %lx\n", image, entry ); - __asm__ __volatile__ ( PHYS_CODE ( "call *%%edi\n\t" ) + __asm__ __volatile__ ( PHYS_CODE ( "pushl %%ebp\n\t" + "call *%%edi\n\t" + "popl %%ebp\n\t" ) : : "a" ( MULTIBOOT_BOOTLOADER_MAGIC ), "b" ( virt_to_phys ( &mbinfo ) ), "D" ( entry ) - : "ecx", "edx", "esi", "ebp", "memory" ); + : "ecx", "edx", "esi", "memory" ); DBGC ( image, "MULTIBOOT %p returned\n", image ); -- cgit v1.2.3-55-g7522