mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-06-16 02:15:47 +00:00
kvm tools, bios: Convert int15 code to C
This patch convert the int15 interrupt handler code into C. Cc: Cyrill Gorcunov <gorcunov@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
committed by
Will Deacon
parent
92748de477
commit
677a2bf1ac
@@ -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 " $@
|
||||
|
||||
+3
-6
@@ -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)
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -58,6 +58,8 @@
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
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_ */
|
||||
|
||||
@@ -14,6 +14,5 @@ struct kvm;
|
||||
struct biosregs;
|
||||
|
||||
struct framebuffer *vesa__init(struct kvm *self);
|
||||
void int10_handler(struct biosregs *args);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user