From patchwork Fri Mar 2 11:06:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 130517 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1157444lja; Fri, 2 Mar 2018 03:24:05 -0800 (PST) X-Google-Smtp-Source: AG47ELuisNYGaGGJ+GDpegtA62++Sy2WbzJN68x9rx1I/8xeXBVufu/QhW/BuiubEP6hyUumvs4O X-Received: by 10.129.77.215 with SMTP id a206mr3393231ywb.237.1519989845598; Fri, 02 Mar 2018 03:24:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519989845; cv=none; d=google.com; s=arc-20160816; b=EMfUXiG2j5D8KR5nfHzuisG4lNlSkD8tan90kXQCcknwhtiVk8vEGD18bSuBsSpO77 VjZt6I1X5ZQ2+XC1ffeugTkfkaKoj+yXaGgM2n34yRMAzF7syQ2QpXpKqrte6+SfNlyc rBKAbKEeAl1DHTgJGJ1Lpm7laVFYcfoQof+U7P6128QvcFnRpvrA6x5rrDP67ZuD5jCc PZHsLZYSXhCMET95IAvTHZ+eODCRDMlyDtCrT75y+X+JGe5CypucohLirJJj4ovJ2KVn r308dmVzg62MfuMHk9PygHkoQMhcn5KPUBta5eT2vQjD0ARUWI/LxaiQxWjs0TNxCh9m U9Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=f9Sx02aCDemZWmtyb6y7NqDQlZlLHMp1RuMqWsMAH28=; b=Dg47XpmL+AkFo1oR+4QM1cRmT0vMGpr61QFCIjYntj8lnASmkGHvmIM5qA6CM1M2TD xQYesc6i8e5CDTT0AJyKRHeOdoTPO1Up0yy6rEK/E733Zx4zg3gI/iOShYlvjsQj9iEg oqVoQG4VtEP/xNirucGhaFrW6atiVkD2XEv0wvBElEMEuH4yJaXzXQQOIPuZonSczSld AQWB8ey4zKkmh0UCVPRATZhmjwnfE9f725Bx/8V2CiJDixaAqcRZeyPELkDwuiBQyJXx B0qCr1OSUSxeT6uZPAaVmpzsyCaa+Oz4iwUdxVrqWDfkBlE0fFQJVa3WlzwuphF8sSS+ O2xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c6-v6si1019612ybk.568.2018.03.02.03.24.05 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 02 Mar 2018 03:24:05 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34145 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erinF-0008Vd-0w for patch@linaro.org; Fri, 02 Mar 2018 06:24:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eriWa-0002si-Dk for qemu-devel@nongnu.org; Fri, 02 Mar 2018 06:06:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eriWZ-0004tD-II for qemu-devel@nongnu.org; Fri, 02 Mar 2018 06:06:52 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:46758) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eriWZ-0004sK-AP for qemu-devel@nongnu.org; Fri, 02 Mar 2018 06:06:51 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1eriWY-0001LZ-EB for qemu-devel@nongnu.org; Fri, 02 Mar 2018 11:06:50 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 2 Mar 2018 11:06:14 +0000 Message-Id: <20180302110640.28004-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180302110640.28004-1-peter.maydell@linaro.org> References: <20180302110640.28004-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 13/39] hw/misc/unimp: Move struct to header file X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20180220180325.29818-10-peter.maydell@linaro.org --- include/hw/misc/unimp.h | 10 ++++++++++ hw/misc/unimp.c | 10 ---------- 2 files changed, 10 insertions(+), 10 deletions(-) -- 2.16.2 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);