Skip to contentSkip to conversation

SMBIOS -- generate SMBIOS tables

PATCH New Andrew D. Ball 1 participant 1 message Aug 11, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 4/5 SMBIOS -- generate SMBIOS tables

Add code to generate SMBIOS tables to hvmloader.

tools/firmware/hvmloader/Makefile +2 -2
diff -r 1d817bfc5ed9 tools/firmware/hvmloader/Makefile
@@ -31,7 +31,7 @@ DEFINES  =-DDEBUG
 DEFINES  =-DDEBUG
 XENINC   =-I$(XEN_ROOT)/tools/libxc
 
-OBJECTS	 = hvmloader.o acpi_madt.o 
+OBJECTS	 = hvmloader.o acpi_madt.o smbios.o
 
 # Disable PIE/SSP if GCC supports them. They can break us.
 CFLAGS  += $(call test-gcc-flag,$(CC),-nopie)
@@ -42,7 +42,7 @@ CFLAGS  += $(DEFINES) -I. $(XENINC) -fno
 CFLAGS  += $(DEFINES) -I. $(XENINC) -fno-builtin -O2 -msoft-float
 LDFLAGS  = -m32 -nostdlib -Wl,-N -Wl,-Ttext -Wl,$(LOADADDR)
 
-SRCS = hvmloader.c acpi_madt.c mp_tables.c util.c
+SRCS = hvmloader.c acpi_madt.c mp_tables.c util.c smbios.c
 OBJS = $(patsubst %.c,%.o,$(SRCS))
 
 .PHONY: all
tools/firmware/hvmloader/hvmloader.c +5 -9
diff -r 1d817bfc5ed9 tools/firmware/hvmloader/hvmloader.c
@@ -25,6 +25,8 @@
 #include "../acpi/acpi2_0.h"  /* for ACPI_PHYSICAL_ADDRESS */
 #include "hypercall.h"
 #include "util.h"
+#include "smbios.h"
+#include "e820.h"
 #include <xen/version.h>
 #include <xen/hvm/params.h>
 
@@ -116,15 +118,6 @@ check_amd(void)
 }
 
 static void
-cpuid(uint32_t idx, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
-{
-	__asm__ __volatile__(
-		"cpuid"
-		: "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
-		: "0" (idx) );
-}
-
-static void
 wrmsr(uint32_t idx, uint64_t v)
 {
 	__asm__ __volatile__(
@@ -209,6 +202,9 @@ main(void)
 		}
 	}
 
+	puts("Writing SMBIOS tables ...\n");
+	hvm_write_smbios_tables();
+
 	if (check_amd()) {
 		/* AMD implies this is SVM */
                 puts("SVM go ...\n");
tools/firmware/hvmloader/smbios.c new file +616 -0

616 lines not on this page · raw message

tools/firmware/hvmloader/smbios.h new file +48 -0

48 lines not on this page · raw message

tools/firmware/hvmloader/smbios_types.h new file +192 -0

192 lines not on this page · raw message