summaryrefslogtreecommitdiff
path: root/pc-bios
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-06-09 16:50:08 +0300
committerAvi Kivity <avi@redhat.com>2010-06-09 16:50:08 +0300
commit02152f7275ebede652360c3840cf45fe240d34f0 (patch)
tree4cde0b6346683b60ea948415e11265a1518f648c /pc-bios
parent82d4ccb9daf67885a0316b1d763ce5ace57cff36 (diff)
parent590bf491a49670843ee902c47f7ab1de5e9acd06 (diff)
Merge remote branch 'upstream' into next
* upstream: Fix multiboot compilation tcg: Make some tcg-target.c routines static. tcg: Add TYPE parameter to tcg_out_mov. target-mips: break out [ls][wd]c1 and rdhwr insn generation Fix --enable-user-pie compilation. microblaze: Make MSR_UM and MSR_VM part of the tb flags petlogix-3adsp: Tweak displacement of cmdline and fdt blob. migration-exec: fix OpenBSD build warning target-i386: fix decoding of negative 4-byte displacements Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'pc-bios')
-rw-r--r--pc-bios/optionrom/linuxboot.S8
-rw-r--r--pc-bios/optionrom/optionrom.h32
2 files changed, 28 insertions, 12 deletions
diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
index 8aebe51ee..c10936344 100644
--- a/pc-bios/optionrom/linuxboot.S
+++ b/pc-bios/optionrom/linuxboot.S
@@ -106,10 +106,10 @@ copy_kernel:
/* We're now running in 16-bit CS, but 32-bit ES! */
/* Load kernel and initrd */
- read_fw_blob(FW_CFG_KERNEL)
- read_fw_blob(FW_CFG_INITRD)
- read_fw_blob(FW_CFG_CMDLINE)
- read_fw_blob(FW_CFG_SETUP)
+ read_fw_blob_addr32(FW_CFG_KERNEL)
+ read_fw_blob_addr32(FW_CFG_INITRD)
+ read_fw_blob_addr32(FW_CFG_CMDLINE)
+ read_fw_blob_addr32(FW_CFG_SETUP)
/* And now jump into Linux! */
mov $0, %eax
diff --git a/pc-bios/optionrom/optionrom.h b/pc-bios/optionrom/optionrom.h
index 4dcb90645..fbdd48a02 100644
--- a/pc-bios/optionrom/optionrom.h
+++ b/pc-bios/optionrom/optionrom.h
@@ -50,13 +50,7 @@
bswap %eax
.endm
-/*
- * Read a blob from the fw_cfg device.
- * Requires _ADDR, _SIZE and _DATA values for the parameter.
- *
- * Clobbers: %eax, %edx, %es, %ecx, %edi
- */
-#define read_fw_blob(var) \
+#define read_fw_blob_pre(var) \
read_fw var ## _ADDR; \
mov %eax, %edi; \
read_fw var ## _SIZE; \
@@ -65,10 +59,32 @@
mov $BIOS_CFG_IOPORT_CFG, %edx; \
outw %ax, (%dx); \
mov $BIOS_CFG_IOPORT_DATA, %dx; \
- cld; \
+ cld
+
+/*
+ * Read a blob from the fw_cfg device.
+ * Requires _ADDR, _SIZE and _DATA values for the parameter.
+ *
+ * Clobbers: %eax, %edx, %es, %ecx, %edi
+ */
+#define read_fw_blob(var) \
+ read_fw_blob_pre(var); \
/* old as(1) doesn't like this insn so emit the bytes instead: \
rep insb (%dx), %es:(%edi); \
*/ \
+ .dc.b 0xf3,0x6c
+
+/*
+ * Read a blob from the fw_cfg device in forced addr32 mode.
+ * Requires _ADDR, _SIZE and _DATA values for the parameter.
+ *
+ * Clobbers: %eax, %edx, %es, %ecx, %edi
+ */
+#define read_fw_blob_addr32(var) \
+ read_fw_blob_pre(var); \
+ /* old as(1) doesn't like this insn so emit the bytes instead: \
+ addr32 rep insb (%dx), %es:(%edi); \
+ */ \
.dc.b 0x67,0xf3,0x6c
#define OPTION_ROM_START \