qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Seabios: seperate qemu_cfg from smbios
@ 2009-07-01 15:16 Jes Sorensen
  2009-07-02  1:35 ` [Qemu-devel] " Kevin O'Connor
  0 siblings, 1 reply; 4+ messages in thread
From: Jes Sorensen @ 2009-07-01 15:16 UTC (permalink / raw)
  To: kevin; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 286 bytes --]

Hi,

I am trying to seperate the QEMU_CFG code from smbios.c in Seabios, in
order to add the remaining QEMU_CFG stuff.

This patch seems to boot fine for me, there should be no changes to the
actual code. If you're happy with this, I will start moving over the
other bits.

Cheers,
Jes

[-- Attachment #2: 0002-seperate-qemu-cfg.patch --]
[-- Type: text/x-patch, Size: 3412 bytes --]

Move QEMU_CFG related code out of smbios.c and into seperate files.

Signed-off-by: Jes Sorensen <jes@sgi.com>

---
 Makefile       |    4 ++--
 src/qemu-cfg.c |   29 +++++++++++++++++++++++++++++
 src/qemu-cfg.h |   14 ++++++++++++++
 src/smbios.c   |   22 +---------------------
 4 files changed, 46 insertions(+), 23 deletions(-)

Index: seabios/Makefile
===================================================================
--- seabios.orig/Makefile
+++ seabios/Makefile
@@ -13,8 +13,8 @@ SRCBOTH=output.c util.c floppy.c ata.c m
         pnpbios.c pirtable.c
 SRC16=$(SRCBOTH) system.c disk.c apm.c pcibios.c vgahooks.c font.c
 SRC32=$(SRCBOTH) post.c shadow.c memmap.c coreboot.c boot.c \
-      acpi.c smm.c mptable.c smbios.c pciinit.c optionroms.c mtrr.c \
-      lzmadecode.c
+      acpi.c smm.c mptable.c qemu-cfg.c smbios.c pciinit.c optionroms.c \
+      mtrr.c lzmadecode.c
 
 cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \
               /dev/null 2>&1`"; then echo "$(2)"; else echo "$(3)"; fi ;)
Index: seabios/src/qemu-cfg.c
===================================================================
--- /dev/null
+++ seabios/src/qemu-cfg.c
@@ -0,0 +1,29 @@
+// qemu-cfg.c: QEMU_CFG related code
+//
+// Copyright (C) 2009  Jes Sorensen, SGI <jes@sgi.com>
+// Copyright (C) 2008  Kevin O'Connor <kevin@koconnor.net>
+// Copyright (C) 2006 Fabrice Bellard
+//
+// This file may be distributed under the terms of the GNU LGPLv3 license.
+
+#include "types.h"
+#include "ioport.h"
+#include "qemu-cfg.h"
+
+void
+qemu_cfg_read(u8 *buf, u16 f, int len)
+{
+    outw(f, PORT_QEMU_CFG_CTL);
+    while (len--)
+        *(buf++) = inb(PORT_QEMU_CFG_DATA);
+}
+
+int
+qemu_cfg_port_probe()
+{
+    u8 sig[4] = "QEMU";
+    u8 buf[4];
+    qemu_cfg_read(buf, QEMU_CFG_SIGNATURE, 4);
+    return *(u32*)buf == *(u32*)sig;
+}
+
Index: seabios/src/qemu-cfg.h
===================================================================
--- /dev/null
+++ seabios/src/qemu-cfg.h
@@ -0,0 +1,14 @@
+// qemu-cfg.h: QEMU_CFG related definitions
+//
+// Copyright (C) 2009  Jes Sorensen, SGI <jes@sgi.com>
+// Copyright (C) 2008  Kevin O'Connor <kevin@koconnor.net>
+// Copyright (C) 2006 Fabrice Bellard
+//
+// This file may be distributed under the terms of the GNU LGPLv3 license.
+
+#define QEMU_CFG_SIGNATURE  0x00
+#define QEMU_CFG_ID         0x01
+#define QEMU_CFG_UUID       0x02
+
+void qemu_cfg_read(u8 *buf, u16 f, int len);
+int qemu_cfg_port_probe();
Index: seabios/src/smbios.c
===================================================================
--- seabios.orig/src/smbios.c
+++ seabios/src/smbios.c
@@ -8,33 +8,13 @@
 #include "util.h" // dprintf
 #include "memmap.h" // bios_table_cur_addr
 #include "biosvar.h" // GET_EBDA
+#include "qemu-cfg.h" // QEMU_CFG_UUID
 
 
 /****************************************************************
  * UUID probe
  ****************************************************************/
 
-#define QEMU_CFG_SIGNATURE  0x00
-#define QEMU_CFG_ID         0x01
-#define QEMU_CFG_UUID       0x02
-
-static void
-qemu_cfg_read(u8 *buf, u16 f, int len)
-{
-    outw(f, PORT_QEMU_CFG_CTL);
-    while (len--)
-        *(buf++) = inb(PORT_QEMU_CFG_DATA);
-}
-
-static int
-qemu_cfg_port_probe()
-{
-    u8 sig[4] = "QEMU";
-    u8 buf[4];
-    qemu_cfg_read(buf, QEMU_CFG_SIGNATURE, 4);
-    return *(u32*)buf == *(u32*)sig;
-}
-
 static void
 uuid_probe(u8 *bios_uuid)
 {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] Re: [PATCH] Seabios: seperate qemu_cfg from smbios
  2009-07-01 15:16 [Qemu-devel] [PATCH] Seabios: seperate qemu_cfg from smbios Jes Sorensen
@ 2009-07-02  1:35 ` Kevin O'Connor
  2009-07-02 14:16   ` Jes Sorensen
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin O'Connor @ 2009-07-02  1:35 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: qemu-devel

On Wed, Jul 01, 2009 at 05:16:23PM +0200, Jes Sorensen wrote:
> I am trying to seperate the QEMU_CFG code from smbios.c in Seabios, in
> order to add the remaining QEMU_CFG stuff.
>
> This patch seems to boot fine for me, there should be no changes to the
> actual code. If you're happy with this, I will start moving over the
> other bits.

Thanks Jes.

The patch looks fine to me.  I'd like to see the followup patches
before committing this preliminary patch though.

One note - all header files need header guards due to some bugs in
various gcc implementations of -fwhole-program.

-Kevin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] Re: [PATCH] Seabios: seperate qemu_cfg from smbios
  2009-07-02  1:35 ` [Qemu-devel] " Kevin O'Connor
@ 2009-07-02 14:16   ` Jes Sorensen
  2009-07-02 14:38     ` malc
  0 siblings, 1 reply; 4+ messages in thread
From: Jes Sorensen @ 2009-07-02 14:16 UTC (permalink / raw)
  To: Kevin O'Connor; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 524 bytes --]

On 07/02/2009 03:35 AM, Kevin O'Connor wrote:
> The patch looks fine to me.  I'd like to see the followup patches
> before committing this preliminary patch though.
>
> One note - all header files need header guards due to some bugs in
> various gcc implementations of -fwhole-program.

Hi Kevin,

DOH, stupid me for forgetting that. Here's an updated version of the
patch with that fixed.

I'll send you the seabioa patch for maxcpus using QEMU_CFG next. It's
similar to what I pushed into qemu/bochs already.

Cheers,
Jes

[-- Attachment #2: 0002-seperate-qemu-cfg.patch --]
[-- Type: text/x-patch, Size: 3473 bytes --]

Move QEMU_CFG related code out of smbios.c and into seperate files.

Signed-off-by: Jes Sorensen <jes@sgi.com>

---
 Makefile       |    4 ++--
 src/qemu-cfg.c |   29 +++++++++++++++++++++++++++++
 src/qemu-cfg.h |   19 +++++++++++++++++++
 src/smbios.c   |   22 +---------------------
 4 files changed, 51 insertions(+), 23 deletions(-)

Index: seabios/Makefile
===================================================================
--- seabios.orig/Makefile
+++ seabios/Makefile
@@ -13,8 +13,8 @@ SRCBOTH=output.c util.c floppy.c ata.c m
         pnpbios.c pirtable.c
 SRC16=$(SRCBOTH) system.c disk.c apm.c pcibios.c vgahooks.c font.c
 SRC32=$(SRCBOTH) post.c shadow.c memmap.c coreboot.c boot.c \
-      acpi.c smm.c mptable.c smbios.c pciinit.c optionroms.c mtrr.c \
-      lzmadecode.c
+      acpi.c smm.c mptable.c qemu-cfg.c smbios.c pciinit.c optionroms.c \
+      mtrr.c lzmadecode.c
 
 cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \
               /dev/null 2>&1`"; then echo "$(2)"; else echo "$(3)"; fi ;)
Index: seabios/src/qemu-cfg.c
===================================================================
--- /dev/null
+++ seabios/src/qemu-cfg.c
@@ -0,0 +1,29 @@
+// qemu-cfg.c: QEMU_CFG related code
+//
+// Copyright (C) 2009  Jes Sorensen, SGI <jes@sgi.com>
+// Copyright (C) 2008  Kevin O'Connor <kevin@koconnor.net>
+// Copyright (C) 2006 Fabrice Bellard
+//
+// This file may be distributed under the terms of the GNU LGPLv3 license.
+
+#include "types.h"
+#include "ioport.h"
+#include "qemu-cfg.h"
+
+void
+qemu_cfg_read(u8 *buf, u16 f, int len)
+{
+    outw(f, PORT_QEMU_CFG_CTL);
+    while (len--)
+        *(buf++) = inb(PORT_QEMU_CFG_DATA);
+}
+
+int
+qemu_cfg_port_probe()
+{
+    u8 sig[4] = "QEMU";
+    u8 buf[4];
+    qemu_cfg_read(buf, QEMU_CFG_SIGNATURE, 4);
+    return *(u32*)buf == *(u32*)sig;
+}
+
Index: seabios/src/qemu-cfg.h
===================================================================
--- /dev/null
+++ seabios/src/qemu-cfg.h
@@ -0,0 +1,19 @@
+// qemu-cfg.h: QEMU_CFG related definitions
+//
+// Copyright (C) 2009  Jes Sorensen, SGI <jes@sgi.com>
+// Copyright (C) 2008  Kevin O'Connor <kevin@koconnor.net>
+// Copyright (C) 2006 Fabrice Bellard
+//
+// This file may be distributed under the terms of the GNU LGPLv3 license.
+
+#ifndef __QEMU_CFG_H
+#define __QEMU_CFG_H
+
+#define QEMU_CFG_SIGNATURE  0x00
+#define QEMU_CFG_ID         0x01
+#define QEMU_CFG_UUID       0x02
+
+void qemu_cfg_read(u8 *buf, u16 f, int len);
+int qemu_cfg_port_probe();
+
+#endif
Index: seabios/src/smbios.c
===================================================================
--- seabios.orig/src/smbios.c
+++ seabios/src/smbios.c
@@ -8,33 +8,13 @@
 #include "util.h" // dprintf
 #include "memmap.h" // bios_table_cur_addr
 #include "biosvar.h" // GET_EBDA
+#include "qemu-cfg.h" // QEMU_CFG_UUID
 
 
 /****************************************************************
  * UUID probe
  ****************************************************************/
 
-#define QEMU_CFG_SIGNATURE  0x00
-#define QEMU_CFG_ID         0x01
-#define QEMU_CFG_UUID       0x02
-
-static void
-qemu_cfg_read(u8 *buf, u16 f, int len)
-{
-    outw(f, PORT_QEMU_CFG_CTL);
-    while (len--)
-        *(buf++) = inb(PORT_QEMU_CFG_DATA);
-}
-
-static int
-qemu_cfg_port_probe()
-{
-    u8 sig[4] = "QEMU";
-    u8 buf[4];
-    qemu_cfg_read(buf, QEMU_CFG_SIGNATURE, 4);
-    return *(u32*)buf == *(u32*)sig;
-}
-
 static void
 uuid_probe(u8 *bios_uuid)
 {

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Re: [PATCH] Seabios: seperate qemu_cfg from smbios
  2009-07-02 14:16   ` Jes Sorensen
@ 2009-07-02 14:38     ` malc
  0 siblings, 0 replies; 4+ messages in thread
From: malc @ 2009-07-02 14:38 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: Kevin O'Connor, qemu-devel

On Thu, 2 Jul 2009, Jes Sorensen wrote:

> On 07/02/2009 03:35 AM, Kevin O'Connor wrote:
> > The patch looks fine to me.  I'd like to see the followup patches
> > before committing this preliminary patch though.
> > 
> > One note - all header files need header guards due to some bugs in
> > various gcc implementations of -fwhole-program.
> 
> Hi Kevin,
> 
> DOH, stupid me for forgetting that. Here's an updated version of the
> patch with that fixed.

Please drop the underscores in front of QEMU.

> 
> I'll send you the seabioa patch for maxcpus using QEMU_CFG next. It's
> similar to what I pushed into qemu/bochs already.
> 
> Cheers,
> Jes
> 

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-02 14:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-01 15:16 [Qemu-devel] [PATCH] Seabios: seperate qemu_cfg from smbios Jes Sorensen
2009-07-02  1:35 ` [Qemu-devel] " Kevin O'Connor
2009-07-02 14:16   ` Jes Sorensen
2009-07-02 14:38     ` malc

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).