[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 10 of 11] tools: hvmloader: build and install hvmloader-rombios



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1302013752 -3600
# Node ID c387185f0a254c794b73d71d282fb941d3de5d98
# Parent  c2fe8249899ee1772973f93897dd7cf960367822
tools: hvmloader: build and install hvmloader-rombios

Retain the hvmloader name as a compatibility symlink.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r c2fe8249899e -r c387185f0a25 .hgignore
--- a/.hgignore Tue Apr 05 15:29:12 2011 +0100
+++ b/.hgignore Tue Apr 05 15:29:12 2011 +0100
@@ -142,7 +142,7 @@
 ^tools/firmware/extboot/signrom$
 ^tools/firmware/hvmloader/acpi/dsdt.*\.c$
 ^tools/firmware/hvmloader/acpi/ssdt_.*\.h$
-^tools/firmware/hvmloader/hvmloader$
+^tools/firmware/hvmloader/hvmloader-rombios$
 ^tools/firmware/hvmloader/roms\.h$
 ^tools/firmware/rombios/BIOS-bochs-[^/]*$
 ^tools/firmware/rombios/_rombios[^/]*_\.c$
diff -r c2fe8249899e -r c387185f0a25 tools/firmware/Makefile
--- a/tools/firmware/Makefile   Tue Apr 05 15:29:12 2011 +0100
+++ b/tools/firmware/Makefile   Tue Apr 05 15:29:12 2011 +0100
@@ -2,7 +2,7 @@ XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 # hvmloader is a 32-bit protected mode binary.
-TARGET      := hvmloader/hvmloader
+TARGET_ROMBIOS      := hvmloader/hvmloader-rombios
 INST_DIR := $(DESTDIR)$(XENFIRMWAREDIR)
 
 SUBDIRS :=
@@ -26,7 +26,8 @@ all:
 .PHONY: install
 install: all
        [ -d $(INST_DIR) ] || $(INSTALL_DIR) $(INST_DIR)
-       [ ! -e $(TARGET) ] || $(INSTALL_DATA) $(TARGET) $(INST_DIR)
+       [ ! -e $(TARGET_ROMBIOS) ] || $(INSTALL_DATA) $(TARGET_ROMBIOS) 
$(INST_DIR)
+       [ ! -e $(TARGET_ROMBIOS) ] || ln -nfs hvmloader-rombios 
$(INST_DIR)/hvmloader
 
 .PHONY: clean
 clean: subdirs-clean
@@ -35,4 +36,4 @@ clean: subdirs-clean
 distclean: subdirs-distclean
 
 subdir-distclean-etherboot: .phony
-       $(MAKE) -C etherboot distclean
\ No newline at end of file
+       $(MAKE) -C etherboot distclean
diff -r c2fe8249899e -r c387185f0a25 tools/firmware/hvmloader/Makefile
--- a/tools/firmware/hvmloader/Makefile Tue Apr 05 15:29:12 2011 +0100
+++ b/tools/firmware/hvmloader/Makefile Tue Apr 05 15:29:12 2011 +0100
@@ -28,32 +28,39 @@ LOADADDR = 0x100000
 
 CFLAGS += $(CFLAGS_xeninclude)
 
-SRCS  = hvmloader.c mp_tables.c util.c smbios.c 
+SRCS  = mp_tables.c util.c smbios.c 
 SRCS += 32bitbios_support.c smp.c cacheattr.c xenbus.c
 ifeq ($(debug),y)
 SRCS += tests.c
 endif
 OBJS  = $(patsubst %.c,%.o,$(SRCS))
 
+TARGETS := hvmloader-rombios
+
 CIRRUSVGA_DEBUG ?= n
 
 .PHONY: all
 all: subdirs-all
-       $(MAKE) hvmloader
+       $(MAKE) $(TARGETS)
 
-hvmloader.o: roms.h
+hvmloader-rombios.o: hvmloader.c roms.h
+       $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -DBIOS_ROM_rombios=1 
-DBIOS_ROM_STR=\"ROMBIOS\" -c -o $@ hvmloader.c
+
 smbios.o: CFLAGS += -D__SMBIOS_DATE__="\"$(shell date +%m/%d/%Y)\""
 
-hvmloader: $(OBJS) acpi/acpi.a
-       $(LD) $(LDFLAGS_DIRECT) -N -Ttext $(LOADADDR) -o hvmloader.tmp $^
-       $(OBJCOPY) hvmloader.tmp hvmloader
-       rm -f hvmloader.tmp
+hvmloader-%: hvmloader-%.o $(OBJS) acpi/acpi.a
+       $(LD) $(LDFLAGS_DIRECT) -N -Ttext $(LOADADDR) -o $@.tmp $^
+       $(OBJCOPY) $@.tmp $@
+       rm -f $@.tmp
 
 roms.h: ../rombios/BIOS-bochs-latest ../vgabios/VGABIOS-lgpl-latest.bin \
        ../vgabios/VGABIOS-lgpl-latest.cirrus.bin ../etherboot/eb-roms.h
        echo "/* Autogenerated file. DO NOT EDIT */" > roms.h
 
+       echo "#ifdef BIOS_ROM_rombios" >> roms.h
        sh ./mkhex biosimg ../rombios/BIOS-bochs-latest >> roms.h
+       echo "#endif" >> roms.h
+
        sh ./mkhex vgabios_stdvga ../vgabios/VGABIOS-lgpl-latest.bin >> roms.h
 ifeq ($(CIRRUSVGA_DEBUG),y)
        sh ./mkhex vgabios_cirrusvga \
@@ -69,5 +76,6 @@ endif
 clean: subdirs-clean
        rm -f roms.h acpi.h
        rm -f hvmloader hvmloader.tmp *.o $(DEPS)
+       rm -f hvmloader-rombios hvmloader-rombios.tmp
 
 -include $(DEPS)
diff -r c2fe8249899e -r c387185f0a25 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c      Tue Apr 05 15:29:12 2011 +0100
+++ b/tools/firmware/hvmloader/hvmloader.c      Tue Apr 05 15:29:12 2011 +0100
@@ -33,8 +33,12 @@
 #include <xen/hvm/ioreq.h>
 #include <xen/memory.h>
 
-#include "../rombios/config.h"
-#include "../rombios/e820.h"
+#if defined(BIOS_ROM_rombios)
+#  include "../rombios/config.h"
+#  include "../rombios/e820.h"
+#else
+#  error "Building for unknown BIOS"
+#endif
 
 asm (
     "    .text                       \n"
@@ -725,7 +729,7 @@ int main(void)
                                         SMBIOS_PHYSICAL_ADDRESS,
                                         SMBIOS_MAXIMUM_SIZE);
 
-    printf("Loading ROMBIOS ...\n");
+    printf("Loading " BIOS_ROM_STR "...\n");
     BUILD_BUG_ON(sizeof(biosimg) > BIOS_MAXIMUM_SIZE);
     memcpy((void *)BIOS_PHYSICAL_ADDRESS, biosimg, sizeof(biosimg));
 
@@ -824,7 +828,7 @@ int main(void)
 
     xenbus_shutdown();
 
-    printf("Invoking ROMBIOS ...\n");
+    printf("Invoking " BIOS_ROM_STR " ...\n");
     return 0;
 }
 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.