aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firmware/rombios
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-01-23 14:32:41 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-01-23 14:32:41 +0000
commit83833d973b14318d04e0740c8557ffb683679fa1 (patch)
tree8b8b3b9ce4b3a6ea914ef73424be2e7993c8f308 /tools/firmware/rombios
parentb08c16ec2fb2b84deb8dc72359526f7dc92a699e (diff)
downloadxen-83833d973b14318d04e0740c8557ffb683679fa1.tar.gz
xen-83833d973b14318d04e0740c8557ffb683679fa1.tar.bz2
xen-83833d973b14318d04e0740c8557ffb683679fa1.zip
rombios: Indirect through 32-bit jump table from within the 32-bit bios.
This gets rid of shenanigans with relocating the jump table around the place. Also clean up bios_info table while we are updating it. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'tools/firmware/rombios')
-rw-r--r--tools/firmware/rombios/32bit/32bitbios.c17
-rw-r--r--tools/firmware/rombios/32bit/Makefile11
-rw-r--r--tools/firmware/rombios/32bit/tcgbios/Makefile11
-rw-r--r--tools/firmware/rombios/32bitgateway.c11
-rw-r--r--tools/firmware/rombios/rombios.c28
5 files changed, 24 insertions, 54 deletions
diff --git a/tools/firmware/rombios/32bit/32bitbios.c b/tools/firmware/rombios/32bit/32bitbios.c
index e2f72605dd..22f83f4cf0 100644
--- a/tools/firmware/rombios/32bit/32bitbios.c
+++ b/tools/firmware/rombios/32bit/32bitbios.c
@@ -22,14 +22,13 @@
#include "rombios_compat.h"
-/*
- the jumptable that will be copied into the rombios in the 0xf000 segment
- for every function that is to be called from the lower BIOS, make an entry
- here.
- */
-uint32_t jumptable[] __attribute__((section (".biosjumptable"))) =
-{
-#define X(idx, ret, fn, args...) [idx] = (uint32_t)fn,
+asm (
+ " .text \n"
+ " movzwl %bx,%eax \n"
+ " jmp *jumptable(,%eax,4) \n"
+ " .data \n"
+ "jumptable: \n"
+#define X(idx, ret, fn, args...) " .long "#fn"\n"
#include "32bitprotos.h"
#undef X
-};
+ );
diff --git a/tools/firmware/rombios/32bit/Makefile b/tools/firmware/rombios/32bit/Makefile
index bba71524b4..407faff956 100644
--- a/tools/firmware/rombios/32bit/Makefile
+++ b/tools/firmware/rombios/32bit/Makefile
@@ -1,15 +1,12 @@
XEN_ROOT = ../../../..
include $(XEN_ROOT)/tools/firmware/Rules.mk
-SOURCES = util.c
TARGET = 32bitbios_flat.h
-CFLAGS += $(CFLAGS_include) -I.. -DGCC_PROTOS
+CFLAGS += $(CFLAGS_include) -I..
SUBDIRS = tcgbios
-MODULES = tcgbios/tcgbiosext.o
-
.PHONY: all
all: subdirs-all
$(MAKE) $(TARGET)
@@ -18,7 +15,10 @@ all: subdirs-all
clean: subdirs-clean
rm -rf *.o $(TARGET) $(DEPS)
-$(TARGET): 32bitbios.o $(MODULES) util.o pmm.o
+$(TARGET): 32bitbios_all.o
+ sh mkhex highbios_array 32bitbios_all.o > $@
+
+32bitbios_all.o: 32bitbios.o tcgbios/tcgbiosext.o util.o pmm.o
$(LD) $(LDFLAGS_DIRECT) -s -r $^ -o 32bitbios_all.o
@nm 32bitbios_all.o | \
egrep '^ +U ' >/dev/null && { \
@@ -26,6 +26,5 @@ $(TARGET): 32bitbios.o $(MODULES) util.o pmm.o
nm -u 32bitbios_all.o; \
exit 11; \
} || :
- sh mkhex highbios_array 32bitbios_all.o > $@
-include $(DEPS)
diff --git a/tools/firmware/rombios/32bit/tcgbios/Makefile b/tools/firmware/rombios/32bit/tcgbios/Makefile
index 68509c7f02..8ce1d77e35 100644
--- a/tools/firmware/rombios/32bit/tcgbios/Makefile
+++ b/tools/firmware/rombios/32bit/tcgbios/Makefile
@@ -2,20 +2,17 @@ XEN_ROOT = ../../../../..
include $(XEN_ROOT)/tools/firmware/Rules.mk
TARGET = tcgbiosext.o
-FILES = tcgbios tpm_drivers
-OBJECTS = $(foreach f,$(FILES),$(f).o)
-CFLAGS += $(CFLAGS_include) -I.. -I../.. -DGCC_PROTOS
-
-.PHONY: all clean
+CFLAGS += $(CFLAGS_include) -I.. -I../..
+.PHONY: all
all: $(TARGET)
+.PHONY: clean
clean:
rm -rf *.o $(TARGET) $(DEPS)
-$(TARGET): $(OBJECTS)
+$(TARGET): tcgbios.o tpm_drivers.o
$(LD) $(LDFLAGS_DIRECT) -r $^ -o $@
-include $(DEPS)
-
diff --git a/tools/firmware/rombios/32bitgateway.c b/tools/firmware/rombios/32bitgateway.c
index f5125ec7a3..06d812d4a6 100644
--- a/tools/firmware/rombios/32bitgateway.c
+++ b/tools/firmware/rombios/32bitgateway.c
@@ -96,15 +96,6 @@ Upcall:
push ss
push esp
- ; Find the 32-bit function address via a table lookup
- push si
- rol bx, #2
- mov si, #jmptable
- seg cs
- mov eax, dword ptr [si+bx]
- pop si
- push eax
-
; Calculate protected-mode esp from ss:sp
and esp, #0xffff
xor eax, eax
@@ -127,11 +118,11 @@ upcall1:
mov ss, ax
; Marshal arguments and call 32-bit function
- pop eax
mov ecx, #MAX_ARG_BYTES/4
upcall2:
push MAX_ARG_BYTES-4+args_off[esp]
loop upcall2
+ mov eax, [BIOS_INFO_PHYSICAL_ADDRESS + BIOSINFO_OFF_bios32_entry]
call eax
add esp, #MAX_ARG_BYTES
mov ecx, eax ; Result in ecx
diff --git a/tools/firmware/rombios/rombios.c b/tools/firmware/rombios/rombios.c
index 5d40e54a95..9350eca9b0 100644
--- a/tools/firmware/rombios/rombios.c
+++ b/tools/firmware/rombios/rombios.c
@@ -1418,31 +1418,24 @@ fixup_base_mem_in_k()
write_word(0x40, 0x13, base_mem >> 10);
}
-void
-set_rom_write_access(action)
- Bit16u action;
-{
- Bit16u off = (Bit16u)&((struct bios_info *)0)->xen_pfiob;
ASM_START
- mov si,.set_rom_write_access.off[bp]
+_rom_write_access_control:
push ds
- mov ax,#(ACPI_PHYSICAL_ADDRESS >> 4)
+ mov ax,#(BIOS_INFO_PHYSICAL_ADDRESS >> 4)
mov ds,ax
- mov dx,[si]
+ mov ax,[BIOSINFO_OFF_xen_pfiob]
pop ds
- mov ax,.set_rom_write_access.action[bp]
- out dx,al
+ ret
ASM_END
-}
void enable_rom_write_access()
{
- set_rom_write_access(0);
+ outb(rom_write_access_control(), 0);
}
void disable_rom_write_access()
{
- set_rom_write_access(PFFLAG_ROM_LOCK);
+ outb(rom_write_access_control(), PFFLAG_ROM_LOCK);
}
#endif /* HVMASSIST */
@@ -11824,15 +11817,6 @@ static Bit8u vgafont8[128*8]=
#ifdef HVMASSIST
ASM_START
-// space for addresses in 32bit BIOS area; currently 256/4 entries
-// are allocated
-.org 0xcb00
-jmptable:
-db 0x5F, 0x5F, 0x5F, 0x4A, 0x4D, 0x50, 0x54 ;; ___JMPT
-dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;; 64 bytes
-dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;; 128 bytes
-dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;; 192 bytes
-
//
// MP Tables
// just carve out some blank space for HVMLOADER to write the MP tables to