qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Re: [6322] add a -vga none cli option (Stefano	Stabellini)
Date: Fri, 16 Jan 2009 12:02:45 +0000	[thread overview]
Message-ID: <49707765.3070706@eu.citrix.com> (raw)
In-Reply-To: <49705B73.9060103@siemens.com>

Jan Kiszka wrote:

> This hunk now generates:
> 
> qemu/hw/pc.c: In function â¬Üpc_init1â¬":
> qemu/hw/pc.c:762: warning: â¬Üvga_bios_offsetâ¬" may be used uninitialized in this function 
> 
> For obvious reasons. Can we simply make the related
> cpu_register_physical_memory conditional as well?
> 
> Jan
> 



You are right that patch caused variable initialization issues, this
patch should fix them.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

diff --git a/hw/pc.c b/hw/pc.c
index d64e442..ff0f16d 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -759,7 +759,7 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
 {
     char buf[1024];
     int ret, linux_boot, i;
-    ram_addr_t ram_addr, vga_ram_addr, bios_offset, vga_bios_offset;
+    ram_addr_t ram_addr, vga_ram_addr = 0x00, bios_offset, vga_bios_offset;
     ram_addr_t below_4g_mem_size, above_4g_mem_size = 0;
     int bios_size, isa_bios_size, vga_bios_size;
     PCIBus *pci_bus;
@@ -831,10 +831,6 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
                                      ram_addr);
     }
 
-
-    /* allocate VGA RAM */
-    vga_ram_addr = qemu_ram_alloc(vga_ram_size);
-
     /* BIOS load */
     if (bios_name == NULL)
         bios_name = BIOS_FILENAME;
@@ -853,6 +849,9 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
     }
 
     if (cirrus_vga_enabled || std_vga_enabled || vmsvga_enabled) {
+        /* allocate VGA RAM */
+        vga_ram_addr = qemu_ram_alloc(vga_ram_size);
+
         /* VGA BIOS load */
         if (cirrus_vga_enabled) {
             snprintf(buf, sizeof(buf), "%s/%s", bios_dir, VGABIOS_CIRRUS_FILENAME);
@@ -870,11 +869,11 @@ vga_bios_error:
             fprintf(stderr, "qemu: could not load VGA BIOS '%s'\n", buf);
             exit(1);
         }
-    }
 
-    /* setup basic memory access */
-    cpu_register_physical_memory(0xc0000, 0x10000,
-                                 vga_bios_offset | IO_MEM_ROM);
+        /* setup basic memory access */
+        cpu_register_physical_memory(0xc0000, 0x10000,
+                vga_bios_offset | IO_MEM_ROM);
+    }
 
     /* map the last 128KB of the BIOS in ISA space */
     isa_bios_size = bios_size;

  reply	other threads:[~2009-01-16 12:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15 20:37 [Qemu-devel] [6322] add a -vga none cli option (Stefano Stabellini) Anthony Liguori
2009-01-16 10:03 ` [Qemu-devel] " Jan Kiszka
2009-01-16 12:02   ` Stefano Stabellini [this message]
2009-01-16 18:36     ` Anthony Liguori
2009-01-16 14:27   ` Anthony Liguori
2009-01-18 21:39 ` Sebastian Herbszt
2009-01-18 23:04   ` Daniel P. Berrange
2009-01-19 12:05     ` Stefano Stabellini

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=49707765.3070706@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.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).