Skip to contentSkip to conversation

ACPI support for guest firmware.

PATCH New Arun Sharma 1 participant 1 message Jun 30, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 7/10 ACPI support for guest firmware.

ACPI support for guest firmware.

tools/firmware/Makefile +1 -0
diff -r 3c25261fef1c -r 5a8399ad9309 tools/firmware/Makefile
@@ -7,6 +7,7 @@
 SUBDIRS :=
 SUBDIRS += rombios
 SUBDIRS += vgabios
+SUBDIRS += acpi
 SUBDIRS += vmxassist
 
 .PHONY: all install clean
tools/firmware/vmxassist/vmxloader.c +16 -0
diff -r 3c25261fef1c -r 5a8399ad9309 tools/firmware/vmxassist/vmxloader.c
@@ -23,6 +23,12 @@
  */
 #include "machine.h"
 #include "roms.h"
+
+#ifdef _ACPI_
+#include "acpi.h"
+#include "../acpi/acpi2_0.h"  // for ACPI_PHYSICAL_ADDRESS
+#endif
+
 
 /*
  * C runtime start off
@@ -102,6 +108,16 @@
 		memcpy((void *)0xC0000,
 			vgabios_stdvga, sizeof(vgabios_stdvga));
 	}
+#ifdef _ACPI_
+	puts("Loading ACPI ...\n");
+    if (ACPI_PHYSICAL_ADDRESS+sizeof(acpi) <= 0xF0000 ){
+        /* make sure acpi table does not overlap rombios
+ 		 * currently acpi less than 8K will be OK.
+		 */
+		 memcpy((void *)ACPI_PHYSICAL_ADDRESS, acpi, sizeof(acpi));
+	}
+#endif
+			
 	puts("Loading VMXAssist ...\n");
 	memcpy((void *)TEXTADDR, vmxassist, sizeof(vmxassist));
 	puts("Go ...\n");
tools/firmware/vmxassist/Makefile +7 -4
diff -r 3c25261fef1c -r 5a8399ad9309 tools/firmware/vmxassist/Makefile
@@ -24,8 +24,8 @@
 # The emulator code lives in ROM space
 TEXTADDR=0x000D0000
 
-DEFINES=-DDEBUG -DTEXTADDR=${TEXTADDR}
-XENINC=-I$(XEN_ROOT)/xen/include
+DEFINES=-DDEBUG -DTEXTADDR=${TEXTADDR} -D_ACPI_
+XENINC=-I$(XEN_ROOT)/xen/include -I$(XEN_ROOT)/tools/libxc
 #DEFINES=-DDEBUG -DTEST -DTEXTADDR=${TEXTADDR}
 #XENINC=-I/home/leendert/xen/xeno-unstable.bk/xen/include
 
@@ -44,7 +44,7 @@
 
 all: vmxloader
 
-vmxloader: roms.h vmxloader.c
+vmxloader: roms.h vmxloader.c acpi.h
 	${CC} ${CFLAGS} ${DEFINES} -c vmxloader.c
 	$(CC) -o vmxloader.tmp -m32 -nostdlib -Wl,-N -Wl,-Ttext -Wl,0x100000 vmxloader.o
 	objcopy --change-addresses=0xC0000000 vmxloader.tmp vmxloader
@@ -79,6 +79,9 @@
 	./mkhex vgabios_cirrusvga ../vgabios/VGABIOS-lgpl-latest.cirrus.bin >> roms.h
 	./mkhex vmxassist vmxassist.bin >> roms.h
 
+acpi.h: ../acpi/acpi.bin
+	./mkhex acpi ../acpi/acpi.bin > acpi.h
+
 offsets.h: gen
 	./gen > offsets.h
 
@@ -86,7 +89,7 @@
 	${CC} ${CFLAGS} -o gen gen.c
 
 clean:
-	rm -f vmxassist vmxassist.tmp vmxassist.bin vmxassist.run vmxassist.sym head.s roms.h
+	rm -f vmxassist vmxassist.tmp vmxassist.bin vmxassist.run vmxassist.sym head.s roms.h acpi.h
 	rm -f vmxloader vmxloader.tmp vmxloader.o ${OBJECTS}
 	rm -f gen gen.o offsets.h
 
tools/firmware/acpi/acpi_madt.c new file +91 -0

91 lines not on this page · raw message

tools/firmware/acpi/acpi_madt.h new file +44 -0

44 lines not on this page · raw message

tools/firmware/acpi/README new file +24 -0
diff -r 3c25261fef1c -r 5a8399ad9309 tools/firmware/acpi/README
@@ -0,0 +1,24 @@
+ACPI Table for domain firmware
+
+
+INSTALL
+-----------------
+Simply make is OK.
+# make 
+
+
+Note on DSDT Table
+------------------
+DSDT table source code is acpi_dsdt.asl
+It is already compiled and the output is acpi_dsdt.c
+Usually, user is not expected to change the acpi_dsdt.asl.
+In case that the acpi_dsdt.asl need to be updated, please 
+Follow the instruction:
+
+# make acpi_dsdt.c
+
+Note:
+DSDT compiler "iasl" is needed. By default, it will be downloaded 
+using wget in Makefile. if it failed, please download manually from 
+http://developer.intel.com/technology/iapc/acpi/downloads.htm. 
+then compile and install iasl
tools/firmware/acpi/acpi_dsdt.asl new file +312 -0

312 lines not on this page · raw message

tools/firmware/acpi/acpi2_0.h new file +317 -0

317 lines not on this page · raw message

tools/firmware/acpi/acpi_facs.c new file +72 -0

72 lines not on this page · raw message

tools/firmware/acpi/acpi_facs.h new file +32 -0
diff -r 3c25261fef1c -r 5a8399ad9309 tools/firmware/acpi/acpi_facs.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2004, Intel Corporation.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place - Suite 330, Boston, MA 02111-1307 USA.
+ *
+ */
+#ifndef _FACS_H
+#define _FACS_H
+
+//
+// FACS Definitions
+//
+
+#define ACPI_FIRMWARE_WAKING_VECTOR 0x00000000
+#define ACPI_GLOBAL_LOCK 0x00000000
+
+#define ACPI_FIRMWARE_CONTROL_STRUCTURE_FLAGS 0x00000000
+
+#define ACPI_X_FIRMWARE_WAKING_VECTOR 0x0000000000000000
+
+#endif
tools/firmware/acpi/acpi_dsdt.c new file +161 -0

161 lines not on this page · raw message

tools/firmware/acpi/Makefile new file +68 -0

68 lines not on this page · raw message

tools/firmware/acpi/acpi_rsdt.c new file +68 -0

68 lines not on this page · raw message

tools/firmware/acpi/acpi_build.c new file +232 -0

232 lines not on this page · raw message

tools/firmware/acpi/acpi_fadt.c new file +193 -0

193 lines not on this page · raw message

tools/firmware/acpi/acpi_fadt.h new file +165 -0

165 lines not on this page · raw message

tools/firmware/acpi/acpi_gen.c new file +59 -0

59 lines not on this page · raw message