From patchwork Fri Aug 12 11:07:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pekka Enberg X-Patchwork-Id: 1060762 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7CB7Wdu026271 for ; Fri, 12 Aug 2011 11:07:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753679Ab1HLLHR (ORCPT ); Fri, 12 Aug 2011 07:07:17 -0400 Received: from filtteri2.pp.htv.fi ([213.243.153.185]:54590 "EHLO filtteri2.pp.htv.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750987Ab1HLLHK (ORCPT ); Fri, 12 Aug 2011 07:07:10 -0400 Received: from localhost (localhost [127.0.0.1]) by filtteri2.pp.htv.fi (Postfix) with ESMTP id 2DCA91EB0AC; Fri, 12 Aug 2011 14:07:08 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at pp.htv.fi Received: from smtp5.welho.com ([213.243.153.39]) by localhost (filtteri2.pp.htv.fi [213.243.153.185]) (amavisd-new, port 10024) with ESMTP id PiCHQPt4K6EB; Fri, 12 Aug 2011 14:07:07 +0300 (EEST) Received: from localhost.localdomain (cs181136138.pp.htv.fi [82.181.136.138]) by smtp5.welho.com (Postfix) with ESMTP id C00825BC003; Fri, 12 Aug 2011 14:07:07 +0300 (EEST) From: Pekka Enberg To: kvm@vger.kernel.org Cc: Pekka Enberg , Cyrill Gorcunov , Ingo Molnar , Sasha Levin Subject: [PATCH 7/8] kvm tools, bios: Convert int15 code to C Date: Fri, 12 Aug 2011 14:07:05 +0300 Message-Id: <1313147226-12400-7-git-send-email-penberg@kernel.org> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1313147226-12400-1-git-send-email-penberg@kernel.org> References: <1313147226-12400-1-git-send-email-penberg@kernel.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 12 Aug 2011 11:07:33 +0000 (UTC) This patch convert the int15 interrupt handler code into C. Cc: Cyrill Gorcunov Cc: Ingo Molnar Cc: Sasha Levin Signed-off-by: Pekka Enberg --- tools/kvm/Makefile | 6 ++++-- tools/kvm/bios/bios.S | 9 +++------ tools/kvm/bios/int15.c | 12 ++++++++++++ tools/kvm/include/kvm/bios.h | 5 +++++ tools/kvm/include/kvm/vesa.h | 1 - 5 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 tools/kvm/bios/int15.c diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile index 672027d..5bde355 100644 --- a/tools/kvm/Makefile +++ b/tools/kvm/Makefile @@ -199,15 +199,17 @@ BIOS_CFLAGS += -mregparm=3 bios.o: bios/bios.bin bios/bios-rom.h -bios/bios.bin.elf: bios/bios.S bios/e820.c bios/int10.c bios/rom.ld.S +bios/bios.bin.elf: bios/bios.S bios/e820.c bios/int10.c bios/int15.c bios/rom.ld.S $(E) " CC bios/e820.o" $(Q) $(CC) -include code16gcc.h $(CFLAGS) $(BIOS_CFLAGS) -c -s bios/e820.c -o bios/e820.o $(E) " CC bios/int10.o" $(Q) $(CC) -include code16gcc.h $(CFLAGS) $(BIOS_CFLAGS) -c -s bios/int10.c -o bios/int10.o + $(E) " CC bios/int15.o" + $(Q) $(CC) -include code16gcc.h $(CFLAGS) $(BIOS_CFLAGS) -c -s bios/int15.c -o bios/int15.o $(E) " CC bios/bios.o" $(Q) $(CC) $(CFLAGS) $(BIOS_CFLAGS) -c -s bios/bios.S -o bios/bios.o $(E) " LD " $@ - $(Q) ld -T bios/rom.ld.S -o bios/bios.bin.elf bios/bios.o bios/e820.o bios/int10.o + $(Q) ld -T bios/rom.ld.S -o bios/bios.bin.elf bios/bios.o bios/e820.o bios/int10.o bios/int15.o bios/bios.bin: bios/bios.bin.elf $(E) " OBJCOPY " $@ diff --git a/tools/kvm/bios/bios.S b/tools/kvm/bios/bios.S index fe2d97b..2ee21a9 100644 --- a/tools/kvm/bios/bios.S +++ b/tools/kvm/bios/bios.S @@ -73,16 +73,13 @@ ENTRY(bios_int10) ENTRY_END(bios_int10) ENTRY(bios_int15) - cmp $0xE820, %eax - jne 1f - SAVE_BIOSREGS - movl %esp, %eax # it's bioscall case - call e820_query_map + movl %esp, %eax + call int15_handler RESTORE_BIOSREGS -1: + IRET ENTRY_END(bios_int15) diff --git a/tools/kvm/bios/int15.c b/tools/kvm/bios/int15.c new file mode 100644 index 0000000..e1a1ce4 --- /dev/null +++ b/tools/kvm/bios/int15.c @@ -0,0 +1,12 @@ +#include "kvm/bios.h" + +#include "kvm/e820.h" + +bioscall void int15_handler(struct biosregs *regs) +{ + switch (regs->eax) { + case 0xe820: + e820_query_map(regs); + break; + } +} diff --git a/tools/kvm/include/kvm/bios.h b/tools/kvm/include/kvm/bios.h index 69a5654..469576e 100644 --- a/tools/kvm/include/kvm/bios.h +++ b/tools/kvm/include/kvm/bios.h @@ -58,6 +58,8 @@ #ifndef __ASSEMBLER__ +#include + struct biosregs { u32 eax; u32 ebx; @@ -73,6 +75,9 @@ struct biosregs { u32 eflags; }; +void int10_handler(struct biosregs *regs); +void int15_handler(struct biosregs *regs); + #endif #endif /* BIOS_H_ */ diff --git a/tools/kvm/include/kvm/vesa.h b/tools/kvm/include/kvm/vesa.h index 7b9a5ce..ac041d9 100644 --- a/tools/kvm/include/kvm/vesa.h +++ b/tools/kvm/include/kvm/vesa.h @@ -14,6 +14,5 @@ struct kvm; struct biosregs; struct framebuffer *vesa__init(struct kvm *self); -void int10_handler(struct biosregs *args); #endif