From 97a2dda645c9e088fac20af50f032dabbccf59d1 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Wed, 6 Apr 2011 21:19:08 +0400 Subject: [PATCH] kvm tools, bios: Introduce bioscall specificator We are to be sure how arguments are passed from bios assembler code to C code. Just for sure. Signed-off-by: Cyrill Gorcunov Signed-off-by: Pekka Enberg --- bios/bios-rom.S | 2 +- bios/e820.c | 2 +- include/kvm/bios.h | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) 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_ */