[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 16/76] linuxboot_dma: remove duplicate definitions of
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 16/76] linuxboot_dma: remove duplicate definitions of FW_CFG |
Date: |
Tue, 5 Feb 2019 19:14:26 +0100 |
From: Stefano Garzarella <address@hidden>
FW_CFG_DMA_CTL_* bits and struct fw_cfg_dma_access are
defined in the qemu_fw_cfg.h header file already included
in linuxboot_dma.c, so we can remove the definition of
BIOS_CFG_DMA_CTL_* and struct FWCfgDmaAccess.
Signed-off-by: Stefano Garzarella <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Liam Merwick <address@hidden>
Based-on: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
pc-bios/optionrom/linuxboot_dma.c | 20 ++++----------------
1 file changed, 4 insertions(+), 16 deletions(-)
diff --git a/pc-bios/optionrom/linuxboot_dma.c
b/pc-bios/optionrom/linuxboot_dma.c
index d856d41..f728dc8 100644
--- a/pc-bios/optionrom/linuxboot_dma.c
+++ b/pc-bios/optionrom/linuxboot_dma.c
@@ -58,12 +58,6 @@ asm(
" jmp load_kernel\n"
);
-/* QEMU_CFG_DMA_CONTROL bits */
-#define BIOS_CFG_DMA_CTL_ERROR 0x01
-#define BIOS_CFG_DMA_CTL_READ 0x02
-#define BIOS_CFG_DMA_CTL_SKIP 0x04
-#define BIOS_CFG_DMA_CTL_SELECT 0x08
-
#define BIOS_CFG_DMA_ADDR_HIGH 0x514
#define BIOS_CFG_DMA_ADDR_LOW 0x518
@@ -75,12 +69,6 @@ asm(
#define barrier() asm("" : : : "memory")
-typedef struct FWCfgDmaAccess {
- uint32_t control;
- uint32_t length;
- uint64_t address;
-} __attribute__((packed)) FWCfgDmaAccess;
-
static inline void outl(uint32_t value, uint16_t port)
{
asm("outl %0, %w1" : : "a"(value), "Nd"(port));
@@ -153,9 +141,9 @@ static inline uint32_t be32_to_cpu(uint32_t x)
static __attribute__((__noinline__))
void bios_cfg_read_entry(void *buf, uint16_t entry, uint32_t len)
{
- FWCfgDmaAccess access;
- uint32_t control = (entry << 16) | BIOS_CFG_DMA_CTL_SELECT
- | BIOS_CFG_DMA_CTL_READ;
+ struct fw_cfg_dma_access access;
+ uint32_t control = (entry << 16) | FW_CFG_DMA_CTL_SELECT
+ | FW_CFG_DMA_CTL_READ;
access.address = cpu_to_be64((uint64_t)(uint32_t)buf);
access.length = cpu_to_be32(len);
@@ -165,7 +153,7 @@ void bios_cfg_read_entry(void *buf, uint16_t entry,
uint32_t len)
outl(cpu_to_be32((uint32_t)&access), BIOS_CFG_DMA_ADDR_LOW);
- while (be32_to_cpu(access.control) & ~BIOS_CFG_DMA_CTL_ERROR) {
+ while (be32_to_cpu(access.control) & ~FW_CFG_DMA_CTL_ERROR) {
barrier();
}
}
--
1.8.3.1
- [Qemu-devel] [PULL 28/76] contrib/elf2dmp: use GLib in PDB processing, (continued)
- [Qemu-devel] [PULL 28/76] contrib/elf2dmp: use GLib in PDB processing, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 32/76] monitor: do not use QTAILQ_FOREACH_SAFE across critical sections, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 38/76] i386: allow to load initrd below 4 GB for recent linux, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 42/76] scsi-generic: avoid possible out-of-bounds access to r->buf, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 37/76] i386: import & use bootparam.h, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 47/76] vfio: move conditional up to hw/Makefile.objs, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 14/76] pvh: Boot uncompressed kernel using direct boot ABI, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 31/76] configure: enable elf2dmp build for Windows hosts, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 16/76] linuxboot_dma: remove duplicate definitions of FW_CFG,
Paolo Bonzini <=
- [Qemu-devel] [PULL 04/76] vhost-user-test: skip if there is no memory at address 0, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 45/76] arm: disable CONFIG_SERIAL_ISA, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 44/76] qemu-options: Remove deprecated "-virtioconsole" option, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 49/76] build: actually use CONFIG_PAM, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 34/76] ui: vnc: finish removing TABs, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 25/76] target-i386: hvf: remove MPX support, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 17/76] linuxboot_dma: move common functions in a new header, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 05/76] vhost-user-test: reduce usage of global_qtest, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 18/76] optionrom: add new PVH option rom, Paolo Bonzini, 2019/02/05
- [Qemu-devel] [PULL 11/76] elf: Add optional function ptr to load_elf() to parse ELF notes, Paolo Bonzini, 2019/02/05