From: Jes Sorensen <jes@sgi.com>
To: kevin@koconnor.net
Cc: Anthony Liguori <aliguori@us.ibm.com>, Beth Kon <eak@us.ibm.com>,
qemu-devel <qemu-devel@nongnu.org>,
avi@redhat.com
Subject: [Qemu-devel] [PATCH 1/5] Move QEMU_CFG related code out of smbios.c
Date: Mon, 03 Aug 2009 15:32:37 +0200 [thread overview]
Message-ID: <20090803133316.440384755@sgi.com> (raw)
In-Reply-To: 20090803133236.207919528@sgi.com
[-- Attachment #1: 0002-seperate-qemu-cfg.patch --]
[-- Type: text/plain, Size: 3493 bytes --]
This patch moves QEMU_CFG infrastructure out of smbios.c and puts it
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
@@ -16,8 +16,8 @@ SRCBOTH=output.c util.c floppy.c ata.c m
pnpbios.c pirtable.c vgahooks.c pmm.c
SRC16=$(SRCBOTH) system.c disk.c apm.c pcibios.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" // malloc_fseg
#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)
{
next prev parent reply other threads:[~2009-08-04 7:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-03 13:32 [Qemu-devel] [PATCH 0/5] Seabios qemu detect Jes Sorensen
2009-08-03 13:32 ` Jes Sorensen [this message]
2009-08-03 13:32 ` [Qemu-devel] [PATCH 2/5] Reorder call for qemu-cfg probing Jes Sorensen
2009-08-03 13:32 ` [Qemu-devel] [PATCH 3/5] Set emu_ver based on information provided by qemu_cfg Jes Sorensen
2009-08-03 13:32 ` [Qemu-devel] [PATCH 4/5] Set irq0override based on emu_ver Jes Sorensen
2009-08-03 13:32 ` [Qemu-devel] [PATCH 5/5] Remove CONFIG_KVM and use emu_ver to runtime detect QEMU & KVM Jes Sorensen
2009-08-05 1:20 ` [Qemu-devel] Re: [PATCH 0/5] Seabios qemu detect Kevin O'Connor
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=20090803133316.440384755@sgi.com \
--to=jes@sgi.com \
--cc=aliguori@us.ibm.com \
--cc=avi@redhat.com \
--cc=eak@us.ibm.com \
--cc=kevin@koconnor.net \
--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).