aboutsummaryrefslogtreecommitdiff
path: root/pc-bios
diff options
context:
space:
mode:
authorStefano Garzarella <sgarzare@redhat.com>2019-01-18 13:01:39 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2019-02-05 16:50:16 +0100
commit526d798435045d74e819700d8c5c64900776b980 (patch)
tree2c0f578d17bb54dc3f62c60042d4ba221db7ce49 /pc-bios
parentc5bf7847b7b281bc13795b12d09ca1f35fc62673 (diff)
downloadqemu-526d798435045d74e819700d8c5c64900776b980.zip
qemu-526d798435045d74e819700d8c5c64900776b980.tar.gz
qemu-526d798435045d74e819700d8c5c64900776b980.tar.bz2
linuxboot_dma: remove duplicate definitions of FW_CFG
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 <sgarzare@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Liam Merwick <liam.merwick@oracle.com> Based-on: <1547554687-12687-1-git-send-email-liam.merwick@oracle.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'pc-bios')
-rw-r--r--pc-bios/optionrom/linuxboot_dma.c20
1 files 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();
}
}