|
|
9ae3a8 |
From 7d299e618bd3833b3874619d7b9b18b65dcc63e2 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
Date: Wed, 6 Nov 2013 14:41:07 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 31/81] hw: import bitmap operations in qdev-core header
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1383748882-22831-3-git-send-email-kwolf@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 55528
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.0 qemu-kvm PATCH v2 02/17] hw: import bitmap operations in qdev-core header
|
|
|
9ae3a8 |
Bugzilla: 1001216
|
|
|
9ae3a8 |
RH-Acked-by: Marcel Apfelbaum <marcel.a@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Marcel Apfelbaum <marcel.a@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Made small tweaks in code to prevent compilation issues
|
|
|
9ae3a8 |
when importing qemu/bitmap.h in qdev-core
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
|
|
|
9ae3a8 |
Message-id: 1375107465-25767-2-git-send-email-marcel.a@redhat.com
|
|
|
9ae3a8 |
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
|
9ae3a8 |
(cherry picked from commit 949fc82314cc84162e64a5323764527a542421ce)
|
|
|
9ae3a8 |
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/core/qdev-properties.c | 13 +++++++------
|
|
|
9ae3a8 |
hw/net/eepro100.c | 2 +-
|
|
|
9ae3a8 |
include/hw/qdev-core.h | 1 +
|
|
|
9ae3a8 |
3 files changed, 9 insertions(+), 7 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/core/qdev-properties.c | 13 +++++++------
|
|
|
9ae3a8 |
hw/net/eepro100.c | 2 +-
|
|
|
9ae3a8 |
include/hw/qdev-core.h | 1 +
|
|
|
9ae3a8 |
3 files changed, 9 insertions(+), 7 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
|
|
|
9ae3a8 |
index 3a324fb..6e1ed1e 100644
|
|
|
9ae3a8 |
--- a/hw/core/qdev-properties.c
|
|
|
9ae3a8 |
+++ b/hw/core/qdev-properties.c
|
|
|
9ae3a8 |
@@ -74,13 +74,14 @@ static void bit_prop_set(DeviceState *dev, Property *props, bool val)
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-static int print_bit(DeviceState *dev, Property *prop, char *dest, size_t len)
|
|
|
9ae3a8 |
+static int prop_print_bit(DeviceState *dev, Property *prop, char *dest,
|
|
|
9ae3a8 |
+ size_t len)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
uint32_t *p = qdev_get_prop_ptr(dev, prop);
|
|
|
9ae3a8 |
return snprintf(dest, len, (*p & qdev_get_prop_mask(prop)) ? "on" : "off");
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-static void get_bit(Object *obj, Visitor *v, void *opaque,
|
|
|
9ae3a8 |
+static void prop_get_bit(Object *obj, Visitor *v, void *opaque,
|
|
|
9ae3a8 |
const char *name, Error **errp)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
DeviceState *dev = DEVICE(obj);
|
|
|
9ae3a8 |
@@ -91,7 +92,7 @@ static void get_bit(Object *obj, Visitor *v, void *opaque,
|
|
|
9ae3a8 |
visit_type_bool(v, &value, name, errp);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-static void set_bit(Object *obj, Visitor *v, void *opaque,
|
|
|
9ae3a8 |
+static void prop_set_bit(Object *obj, Visitor *v, void *opaque,
|
|
|
9ae3a8 |
const char *name, Error **errp)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
DeviceState *dev = DEVICE(obj);
|
|
|
9ae3a8 |
@@ -115,9 +116,9 @@ static void set_bit(Object *obj, Visitor *v, void *opaque,
|
|
|
9ae3a8 |
PropertyInfo qdev_prop_bit = {
|
|
|
9ae3a8 |
.name = "boolean",
|
|
|
9ae3a8 |
.legacy_name = "on/off",
|
|
|
9ae3a8 |
- .print = print_bit,
|
|
|
9ae3a8 |
- .get = get_bit,
|
|
|
9ae3a8 |
- .set = set_bit,
|
|
|
9ae3a8 |
+ .print = prop_print_bit,
|
|
|
9ae3a8 |
+ .get = prop_get_bit,
|
|
|
9ae3a8 |
+ .set = prop_set_bit,
|
|
|
9ae3a8 |
};
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
/* --- bool --- */
|
|
|
9ae3a8 |
diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
|
|
|
9ae3a8 |
index dc99ea6..b69cc60 100644
|
|
|
9ae3a8 |
--- a/hw/net/eepro100.c
|
|
|
9ae3a8 |
+++ b/hw/net/eepro100.c
|
|
|
9ae3a8 |
@@ -47,6 +47,7 @@
|
|
|
9ae3a8 |
#include "hw/nvram/eeprom93xx.h"
|
|
|
9ae3a8 |
#include "sysemu/sysemu.h"
|
|
|
9ae3a8 |
#include "sysemu/dma.h"
|
|
|
9ae3a8 |
+#include "qemu/bitops.h"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
/* QEMU sends frames smaller than 60 bytes to ethernet nics.
|
|
|
9ae3a8 |
* Such frames are rejected by real nics and their emulations.
|
|
|
9ae3a8 |
@@ -105,7 +106,6 @@
|
|
|
9ae3a8 |
#define PCI_IO_SIZE 64
|
|
|
9ae3a8 |
#define PCI_FLASH_SIZE (128 * KiB)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-#define BIT(n) (1 << (n))
|
|
|
9ae3a8 |
#define BITS(n, m) (((0xffffffffU << (31 - n)) >> (31 - n + m)) << m)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
/* The SCB accepts the following controls for the Tx and Rx units: */
|
|
|
9ae3a8 |
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
|
|
|
9ae3a8 |
index cf83d54..9d995bf 100644
|
|
|
9ae3a8 |
--- a/include/hw/qdev-core.h
|
|
|
9ae3a8 |
+++ b/include/hw/qdev-core.h
|
|
|
9ae3a8 |
@@ -4,6 +4,7 @@
|
|
|
9ae3a8 |
#include "qemu/queue.h"
|
|
|
9ae3a8 |
#include "qemu/option.h"
|
|
|
9ae3a8 |
#include "qemu/typedefs.h"
|
|
|
9ae3a8 |
+#include "qemu/bitmap.h"
|
|
|
9ae3a8 |
#include "qom/object.h"
|
|
|
9ae3a8 |
#include "hw/irq.h"
|
|
|
9ae3a8 |
#include "qapi/error.h"
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|