[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/3] Correct fw_cfg_add_callback()
From: |
Laurent Vivier |
Subject: |
[Qemu-devel] [PATCH 1/3] Correct fw_cfg_add_callback() |
Date: |
Tue, 16 Dec 2008 16:20:08 +0100 |
This patch is needed to be able to register firmware configuration
device callback.
It is already included in qemu as commit r5978.
Signed-off-by: Laurent Vivier <address@hidden>
---
qemu/hw/fw_cfg.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/qemu/hw/fw_cfg.c b/qemu/hw/fw_cfg.c
index 4e68670..c3b09c6 100644
--- a/qemu/hw/fw_cfg.c
+++ b/qemu/hw/fw_cfg.c
@@ -57,7 +57,6 @@ static void fw_cfg_write(FWCfgState *s, uint8_t value)
FWCfgEntry *e = &s->entries[arch][s->cur_entry & FW_CFG_ENTRY_MASK];
FW_CFG_DPRINTF("write %d\n", value);
-
if (s->cur_entry & FW_CFG_WRITE_CHANNEL && s->cur_offset < e->len) {
e->data[s->cur_offset++] = value;
if (s->cur_offset == e->len) {
@@ -240,10 +239,12 @@ int fw_cfg_add_callback(void *opaque, uint16_t key,
FWCfgCallback callback,
FWCfgState *s = opaque;
int arch = !!(key & FW_CFG_ARCH_LOCAL);
+ if (!(key & FW_CFG_WRITE_CHANNEL))
+ return 0;
+
key &= FW_CFG_ENTRY_MASK;
- if (key >= FW_CFG_MAX_ENTRY || !(key & FW_CFG_WRITE_CHANNEL)
- || len > 65535)
+ if (key >= FW_CFG_MAX_ENTRY || len > 65535)
return 0;
s->entries[arch][key].data = data;
--
1.5.6.5
- [Qemu-devel] [PATCH 0/3] Add BIOS splash image support, Laurent Vivier, 2008/12/16
- [Qemu-devel] [PATCH 1/3] Correct fw_cfg_add_callback(),
Laurent Vivier <=
- [Qemu-devel] [PATCH 2/3] [BIOS] Add splash image support, Laurent Vivier, 2008/12/16
- Re: [Qemu-devel] [PATCH 3/3] [QEMU] Add BIOS splash image, Blue Swirl, 2008/12/16
- Re: [Qemu-devel] [PATCH 3/3] [QEMU] Add BIOS splash image, Laurent Vivier, 2008/12/16
- Re: [Qemu-devel] [PATCH 3/3] [QEMU] Add BIOS splash image, Blue Swirl, 2008/12/16
- Re: [Qemu-devel] [PATCH 3/3] [QEMU] Add BIOS splash image, Laurent Vivier, 2008/12/16
Re: [Qemu-devel] [PATCH 0/3] Add BIOS splash image support, Blue Swirl, 2008/12/16