diff --git a/bios/bios-rom.S b/bios/bios-rom.S index 6dec953..8a53dcd 100644 --- a/bios/bios-rom.S +++ b/bios/bios-rom.S @@ -77,7 +77,7 @@ ENTRY(bios_int15) pushl %ebx pushl %eax - movl %esp, %eax + movl %esp, %eax # it's bioscall case call e820_query_map popl %eax diff --git a/bios/e820.c b/bios/e820.c index 7f3f86f..baa2c5b 100644 --- a/bios/e820.c +++ b/bios/e820.c @@ -18,7 +18,7 @@ static inline uint8_t rdfs8(unsigned long addr) return v; } -void e820_query_map(struct e820_query *query) +bioscall void e820_query_map(struct e820_query *query) { uint8_t map_size; uint16_t fs_seg; diff --git a/include/kvm/bios.h b/include/kvm/bios.h index 1e77770..dd70c44 100644 --- a/include/kvm/bios.h +++ b/include/kvm/bios.h @@ -62,4 +62,10 @@ #define BIOS_NEXT_IRQ_ADDR(addr, size) \ ALIGN((addr + size + 1), 16) +/* + * When interfere with assembler code we need to be sure how + * arguments are passed in real mode. + */ +#define bioscall __attribute__((regparm(3))) + #endif /* BIOS_H_ */