From patchwork Tue Feb 20 18:03:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 128955 Delivered-To: patches@linaro.org Received: by 10.46.124.24 with SMTP id x24csp4910285ljc; Tue, 20 Feb 2018 10:03:33 -0800 (PST) X-Google-Smtp-Source: AH8x224BDxSlDSgp2FAdY3cHvW6PX8pkUiMum7TWoXTzE3H+Fucg6tIuLosbCMvswbYgG86PL0Zt X-Received: by 10.223.164.221 with SMTP id h29mr431451wrb.259.1519149813299; Tue, 20 Feb 2018 10:03:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519149813; cv=none; d=google.com; s=arc-20160816; b=Z7ue+vV381Q586Ca/M5EOUPllckdSVG6KsPeNIQHonFKZ9nGjPE2WHETkAPyevg7UX aJdd1ewP7zJQyzl1/56vWpJZ0io9VjwLol6geMFU6cRAMWszBdVl1cdRthnwR7S3bwKA 17k3Nj+xGmRtUrxRoCHXpnJkmp6v74VMzwAmJDeCrqUXXmUTEagZhisGDpNe8vTan4g3 LdkAcVurZLlKKrV8F5rMKKmY85uyM4K1G5qQ/BslVOuGRVSajBfogz5mYmYrtqeVhMGe GnQYP5S91CXUkByUdZ4ZLzZTr8Sq+GL3f3aRHH0iVTcj5HhvipEOBsHzzOydZdX4pK0b bKBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Nu0uc5UQoBK0lrd4Q3Zr+Xjg7pTQ4WDc2ujZf06wKdo=; b=OyNO6jrQsHqhqGO1elB3fuz0d4SH/CZ7qFMXvoRQG6TRB8/7d7dJimXURrQgkbxF0+ FGZSJqUpcOZOQ1ESkMKQ84aKfXyYkfusSUvrROnee9lvtPIIIQ4gJfYiDMN2y8+0c0go q1DQh8HOOze8D8BbFgqV0XeBB5bDM2uEcW6huC8aqnzJo+sfISKrdx3VDLkhUJ5FcxNg YFgi1wxxEOBEtK8B7KFz7UgMBhCQZ4sqwbvGhR0IbeLKGe/Wl4c/7d4vcaYYsUGpWJSS BK0CL8cv5xJ+I2iSb9FVpsyP0m2yLqOlxgyS0yDAFY6P4413MAPc9eMHuEQY4XAzjLlz uwmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id z8si7748819wrg.167.2018.02.20.10.03.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Feb 2018 10:03:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1eoCGK-0008SA-RT; Tue, 20 Feb 2018 18:03:32 +0000 From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH 09/19] hw/misc/unimp: Move struct to header file Date: Tue, 20 Feb 2018 18:03:15 +0000 Message-Id: <20180220180325.29818-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180220180325.29818-1-peter.maydell@linaro.org> References: <20180220180325.29818-1-peter.maydell@linaro.org> Move the definition of the struct for the unimplemented-device from unimp.c to unimp.h, so that users can embed the struct in their own device structs if they prefer. Signed-off-by: Peter Maydell --- include/hw/misc/unimp.h | 10 ++++++++++ hw/misc/unimp.c | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) -- 2.16.1 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson diff --git a/include/hw/misc/unimp.h b/include/hw/misc/unimp.h index 52e068ec3e..2a291ca42d 100644 --- a/include/hw/misc/unimp.h +++ b/include/hw/misc/unimp.h @@ -12,6 +12,16 @@ #define TYPE_UNIMPLEMENTED_DEVICE "unimplemented-device" +#define UNIMPLEMENTED_DEVICE(obj) \ + OBJECT_CHECK(UnimplementedDeviceState, (obj), TYPE_UNIMPLEMENTED_DEVICE) + +typedef struct { + SysBusDevice parent_obj; + MemoryRegion iomem; + char *name; + uint64_t size; +} UnimplementedDeviceState; + /** * create_unimplemented_device: create and map a dummy device * @name: name of the device for debug logging diff --git a/hw/misc/unimp.c b/hw/misc/unimp.c index bcbb585888..1c0ba2f0a7 100644 --- a/hw/misc/unimp.c +++ b/hw/misc/unimp.c @@ -18,16 +18,6 @@ #include "qemu/log.h" #include "qapi/error.h" -#define UNIMPLEMENTED_DEVICE(obj) \ - OBJECT_CHECK(UnimplementedDeviceState, (obj), TYPE_UNIMPLEMENTED_DEVICE) - -typedef struct { - SysBusDevice parent_obj; - MemoryRegion iomem; - char *name; - uint64_t size; -} UnimplementedDeviceState; - static uint64_t unimp_read(void *opaque, hwaddr offset, unsigned size) { UnimplementedDeviceState *s = UNIMPLEMENTED_DEVICE(opaque);