summaryrefslogtreecommitdiffstats
path: root/hw/char
diff options
context:
space:
mode:
authorPeter Maydell2016-05-17 17:49:11 +0200
committerPeter Maydell2016-05-17 17:49:11 +0200
commita257c741491ff1c3c192d13a89c136dd6401c54d (patch)
tree5e1b706fb4f5b082c4cf928caad2a21fe7213a97 /hw/char
parentMerge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' int... (diff)
parents390x/pci: remove whitespace (diff)
downloadqemu-a257c741491ff1c3c192d13a89c136dd6401c54d.tar.gz
qemu-a257c741491ff1c3c192d13a89c136dd6401c54d.tar.xz
qemu-a257c741491ff1c3c192d13a89c136dd6401c54d.zip
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20160517' into staging
First batch of s390x patches for 2.7: - The new machine for 2.7 - Make use of the runtime instrumentation support introduced in the kernel - Enhance our ipl (boot) process: We can now start from devices in subchannel sets > 0 as well. As a bonus, the conversion to diag308 in the bios allows us to get rid of the gr7 hack. - Xiaoqiang Zhao's SCLP qomification patches - Several fixes in the s390x pci implementation # gpg: Signature made Tue 17 May 2016 15:35:32 BST using RSA key ID C6F02FAF # gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>" # gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>" * remotes/cohuck/tags/s390x-20160517: s390x/pci: remove whitespace s390x/pci: add length checking for pci sclp handlers s390x/pci: enhance mpcifc_service_call s390x/pci: fix s390_pci_sclp_deconfigure s390x/pci: introduce S390PCIBusDevice.iommu_enabled s390x/pci: export pci_dereg_ioat and pci_dereg_irqs s390x/pci: separate s390_pcihost_iommu_configure function s390x/pci: separate s390_sclp_configure function s390x/pci: fix reg_irqs() hw/char: QOM'ify sclpconsole.c hw/char: QOM'ify sclpconsole-lm.c s390x/ipl: Remove redundant usage of gr7 s390-ccw.img: rebuild image pc-bios/s390-ccw: Get device address via diag 308/6 s390x/ipl: Add ssid field to IplParameterBlock s390x/ipl: Provide ipl parameter block s390x/ipl: Add type and length checks for IplParameterBlock values s390x/ipl: Extend the IplParameterBlock struct s390x: enable runtime instrumentation s390x: add compat machine for 2.7 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/char')
-rw-r--r--hw/char/sclpconsole-lm.c14
-rw-r--r--hw/char/sclpconsole.c12
2 files changed, 17 insertions, 9 deletions
diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c
index 7d4ff8120a..a22ad8d016 100644
--- a/hw/char/sclpconsole-lm.c
+++ b/hw/char/sclpconsole-lm.c
@@ -44,6 +44,10 @@ typedef struct SCLPConsoleLM {
uint8_t buf[SIZE_CONSOLE_BUFFER];
} SCLPConsoleLM;
+#define TYPE_SCLPLM_CONSOLE "sclplmconsole"
+#define SCLPLM_CONSOLE(obj) \
+ OBJECT_CHECK(SCLPConsoleLM, (obj), TYPE_SCLPLM_CONSOLE)
+
/*
* Character layer call-back functions
*
@@ -116,7 +120,7 @@ static int get_console_data(SCLPEvent *event, uint8_t *buf, size_t *size,
{
int len;
- SCLPConsoleLM *cons = DO_UPCAST(SCLPConsoleLM, event, event);
+ SCLPConsoleLM *cons = SCLPLM_CONSOLE(event);
len = cons->length;
/* data need to fit into provided SCLP buffer */
@@ -190,7 +194,7 @@ static int write_console_data(SCLPEvent *event, const uint8_t *buf, int len)
int ret = 0;
const uint8_t *buf_offset;
- SCLPConsoleLM *scon = DO_UPCAST(SCLPConsoleLM, event, event);
+ SCLPConsoleLM *scon = SCLPLM_CONSOLE(event);
if (!scon->chr) {
/* If there's no backend, we can just say we consumed all data. */
@@ -244,7 +248,7 @@ static int write_event_data(SCLPEvent *event, EventBufferHeader *ebh)
int errors = 0;
MDBO *mdbo;
SclpMsg *data = (SclpMsg *) ebh;
- SCLPConsoleLM *scon = DO_UPCAST(SCLPConsoleLM, event, event);
+ SCLPConsoleLM *scon = SCLPLM_CONSOLE(event);
len = be16_to_cpu(data->mdb.header.length);
if (len < sizeof(data->mdb.header)) {
@@ -313,7 +317,7 @@ static int console_init(SCLPEvent *event)
{
static bool console_available;
- SCLPConsoleLM *scon = DO_UPCAST(SCLPConsoleLM, event, event);
+ SCLPConsoleLM *scon = SCLPLM_CONSOLE(event);
if (console_available) {
error_report("Multiple line-mode operator consoles are not supported");
@@ -336,7 +340,7 @@ static int console_exit(SCLPEvent *event)
static void console_reset(DeviceState *dev)
{
SCLPEvent *event = SCLP_EVENT(dev);
- SCLPConsoleLM *scon = DO_UPCAST(SCLPConsoleLM, event, event);
+ SCLPConsoleLM *scon = SCLPLM_CONSOLE(event);
event->event_pending = false;
scon->length = 0;
diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c
index 45997ff4ae..15a5b2b2b5 100644
--- a/hw/char/sclpconsole.c
+++ b/hw/char/sclpconsole.c
@@ -40,6 +40,10 @@ typedef struct SCLPConsole {
bool notify; /* qemu_notify_event() req'd if true */
} SCLPConsole;
+#define TYPE_SCLP_CONSOLE "sclpconsole"
+#define SCLP_CONSOLE(obj) \
+ OBJECT_CHECK(SCLPConsole, (obj), TYPE_SCLP_CONSOLE)
+
/* character layer call-back functions */
/* Return number of bytes that fit into iov buffer */
@@ -95,7 +99,7 @@ static unsigned int receive_mask(void)
static void get_console_data(SCLPEvent *event, uint8_t *buf, size_t *size,
int avail)
{
- SCLPConsole *cons = DO_UPCAST(SCLPConsole, event, event);
+ SCLPConsole *cons = SCLP_CONSOLE(event);
/* first byte is hex 0 saying an ascii string follows */
*buf++ = '\0';
@@ -157,7 +161,7 @@ static int read_event_data(SCLPEvent *event, EventBufferHeader *evt_buf_hdr,
static ssize_t write_console_data(SCLPEvent *event, const uint8_t *buf,
size_t len)
{
- SCLPConsole *scon = DO_UPCAST(SCLPConsole, event, event);
+ SCLPConsole *scon = SCLP_CONSOLE(event);
if (!scon->chr) {
/* If there's no backend, we can just say we consumed all data. */
@@ -214,7 +218,7 @@ static int console_init(SCLPEvent *event)
{
static bool console_available;
- SCLPConsole *scon = DO_UPCAST(SCLPConsole, event, event);
+ SCLPConsole *scon = SCLP_CONSOLE(event);
if (console_available) {
error_report("Multiple VT220 operator consoles are not supported");
@@ -232,7 +236,7 @@ static int console_init(SCLPEvent *event)
static void console_reset(DeviceState *dev)
{
SCLPEvent *event = SCLP_EVENT(dev);
- SCLPConsole *scon = DO_UPCAST(SCLPConsole, event, event);
+ SCLPConsole *scon = SCLP_CONSOLE(event);
event->event_pending = false;
scon->iov_sclp = 0;