qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Cc: glommer@redhat.com, avi@redhat.com
Subject: [Qemu-devel] [PATCH 1/6] Make fw_cfg interface 32-bit aware
Date: Wed, 11 Nov 2009 19:09:21 +0100	[thread overview]
Message-ID: <1257962966-22902-2-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1257962966-22902-1-git-send-email-agraf@suse.de>

The fw_cfg interface can only handle up to 16 bits of data for its streams.
While that isn't too much of a problem when handling integers, we would
like to stream full kernel images over that interface!

So let's extend it to 32 bit length variables.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/fw_cfg.c |    8 ++++----
 hw/fw_cfg.h |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c
index a6d811b..3a3f694 100644
--- a/hw/fw_cfg.c
+++ b/hw/fw_cfg.c
@@ -39,7 +39,7 @@
 #define FW_CFG_SIZE 2
 
 typedef struct _FWCfgEntry {
-    uint16_t len;
+    uint32_t len;
     uint8_t *data;
     void *callback_opaque;
     FWCfgCallback callback;
@@ -48,7 +48,7 @@ typedef struct _FWCfgEntry {
 typedef struct _FWCfgState {
     FWCfgEntry entries[2][FW_CFG_MAX_ENTRY];
     uint16_t cur_entry;
-    uint16_t cur_offset;
+    uint32_t cur_offset;
 } FWCfgState;
 
 static void fw_cfg_write(FWCfgState *s, uint8_t value)
@@ -171,12 +171,12 @@ static const VMStateDescription vmstate_fw_cfg = {
     .minimum_version_id_old = 1,
     .fields      = (VMStateField []) {
         VMSTATE_UINT16(cur_entry, FWCfgState),
-        VMSTATE_UINT16(cur_offset, FWCfgState),
+        VMSTATE_UINT32(cur_offset, FWCfgState),
         VMSTATE_END_OF_LIST()
     }
 };
 
-int fw_cfg_add_bytes(void *opaque, uint16_t key, uint8_t *data, uint16_t len)
+int fw_cfg_add_bytes(void *opaque, uint16_t key, uint8_t *data, uint32_t len)
 {
     FWCfgState *s = opaque;
     int arch = !!(key & FW_CFG_ARCH_LOCAL);
diff --git a/hw/fw_cfg.h b/hw/fw_cfg.h
index 30dfec7..359d45a 100644
--- a/hw/fw_cfg.h
+++ b/hw/fw_cfg.h
@@ -28,7 +28,7 @@
 #ifndef NO_QEMU_PROTOS
 typedef void (*FWCfgCallback)(void *opaque, uint8_t *data);
 
-int fw_cfg_add_bytes(void *opaque, uint16_t key, uint8_t *data, uint16_t len);
+int fw_cfg_add_bytes(void *opaque, uint16_t key, uint8_t *data, uint32_t len);
 int fw_cfg_add_i16(void *opaque, uint16_t key, uint16_t value);
 int fw_cfg_add_i32(void *opaque, uint16_t key, uint32_t value);
 int fw_cfg_add_i64(void *opaque, uint16_t key, uint64_t value);
-- 
1.6.0.2

  reply	other threads:[~2009-11-11 18:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-11 18:09 [Qemu-devel] [PATCH 0/6] Fix -kernel with SeaBIOS Alexander Graf
2009-11-11 18:09 ` Alexander Graf [this message]
2009-11-11 21:53   ` [Qemu-devel] Re: [PATCH 1/6] Make fw_cfg interface 32-bit aware Anthony Liguori
2009-11-11 22:15     ` Alexander Graf
2009-11-11 22:22       ` Anthony Liguori
2009-11-12  0:03         ` Alexander Graf
2009-11-12  0:14           ` Anthony Liguori
2009-11-11 18:09 ` [Qemu-devel] [PATCH 2/6] Introduce copy_rom Alexander Graf
2009-11-11 21:57   ` [Qemu-devel] " Anthony Liguori
2009-11-12  0:02     ` Alexander Graf
2009-11-11 18:09 ` [Qemu-devel] [PATCH 3/6] Convert multiboot to fw_cfg backed data storage Alexander Graf
2009-11-11 18:09 ` [Qemu-devel] [PATCH 4/6] Move common option rom code to header file Alexander Graf
2009-11-11 18:09 ` [Qemu-devel] [PATCH 5/6] Convert linux bootrom to external rom and fw_cfg Alexander Graf
2009-11-11 18:09 ` [Qemu-devel] [PATCH 6/6] Add linuxboot to BLOBS Alexander Graf
2009-11-12 14:53 ` [Qemu-devel] [PATCH 0/6] Fix -kernel with SeaBIOS Christoph Hellwig
2009-11-12 14:56   ` Alexander Graf
  -- strict thread matches above, loose matches on Subject: below --
2009-11-12 20:53 [Qemu-devel] [PATCH 0/6] Fix -kernel with SeaBIOS v2 Alexander Graf
2009-11-12 20:53 ` [Qemu-devel] [PATCH 1/6] Make fw_cfg interface 32-bit aware Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1257962966-22902-2-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=glommer@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).