From patchwork Thu Aug 13 10:44:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 52359 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id B234522EC6 for ; Thu, 13 Aug 2015 10:48:12 +0000 (UTC) Received: by lbcje9 with SMTP id je9sf14850050lbc.3 for ; Thu, 13 Aug 2015 03:48:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=rMSNCsk5XIhYuXtEEfsySyrkaKBp/1c55Gfkz3zaExo=; b=FDFdwxDF/ziTMyIsa7gx3ttIn5qLCkTH4WRkeidzhhBNGHI7n5iNmu1p7axv4qvJY1 2vXMthD7xSrFBMF6pgCGQYJUUbzyn4/i2bEqgqA3EN2rcmTDCAVZDxL/rnsacIUCmGYs aOcbTIhTr5cFY81ZUuKfBk8Be+Uh3fIqaILEHgu1hpZ5AYY69Nzw9iOXiZexHdlk/g+F FacGReQmAew412NhEzn1eXowkUEFvOEzI7BeVbMK/wNaDXT8IzOERBTU9C7428FKfanP ArbB0RgsvXUUq/XGQnxBY++cXkXgoJTMmUbw43JRwC/T9G5yrv3BVOsK17XU2IRD0FVQ ngSQ== X-Gm-Message-State: ALoCoQn9QzsTpHv7mfVynUQHr2JBOO/ngWJijslfdEU2DO9t0uJqQiKQvXq7sQfn5tHigAsVqOhN X-Received: by 10.112.138.2 with SMTP id qm2mr11093960lbb.19.1439462891760; Thu, 13 Aug 2015 03:48:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.7 with SMTP id v7ls163776laa.107.gmail; Thu, 13 Aug 2015 03:48:11 -0700 (PDT) X-Received: by 10.112.125.34 with SMTP id mn2mr32587623lbb.76.1439462891606; Thu, 13 Aug 2015 03:48:11 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id sj10si1778768lac.117.2015.08.13.03.48.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Aug 2015 03:48:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by lalv9 with SMTP id v9so23845269lal.0 for ; Thu, 13 Aug 2015 03:48:11 -0700 (PDT) X-Received: by 10.152.26.163 with SMTP id m3mr35613382lag.86.1439462891526; Thu, 13 Aug 2015 03:48:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp858698lba; Thu, 13 Aug 2015 03:48:10 -0700 (PDT) X-Received: by 10.107.164.92 with SMTP id n89mr28599716ioe.91.1439462890199; Thu, 13 Aug 2015 03:48:10 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 196si1193895iof.67.2015.08.13.03.48.09 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 13 Aug 2015 03:48:10 -0700 (PDT) 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; Received: from localhost ([::1]:41655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPq3N-000218-3U for patch@linaro.org; Thu, 13 Aug 2015 06:48:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPq0L-0005QS-2m for qemu-devel@nongnu.org; Thu, 13 Aug 2015 06:45:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPq0I-0005IA-7e for qemu-devel@nongnu.org; Thu, 13 Aug 2015 06:45:00 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:34909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPq0H-0005DT-Vr for qemu-devel@nongnu.org; Thu, 13 Aug 2015 06:44:58 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZPq08-00071c-6U for qemu-devel@nongnu.org; Thu, 13 Aug 2015 11:44:48 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Aug 2015 11:44:39 +0100 Message-Id: <1439462687-26903-20-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1439462687-26903-1-git-send-email-peter.maydell@linaro.org> References: <1439462687-26903-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 19/27] Merge memory_region_init_reservation() into memory_region_init_io() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 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-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Pavel Fedin Just specifying ops = NULL in some cases can be more convenient than having two functions. Signed-off-by: Pavel Fedin Acked-by: Paolo Bonzini Reviewed-by: Peter Maydell Message-id: 78a379ab1b6b30ab497db7971ad336dad1dbee76.1438758065.git.p.fedin@samsung.com Signed-off-by: Peter Maydell --- include/exec/memory.h | 14 +++++++++++--- memory.c | 10 +--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 94d20ea..b18b351 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -437,6 +437,9 @@ void memory_region_init_alias(MemoryRegion *mr, * memory_region_init_rom_device: Initialize a ROM memory region. Writes are * handled via callbacks. * + * If NULL callbacks pointer is given, then I/O space is not supposed to be + * handled by QEMU itself. Any access via the memory API will cause an abort(). + * * @mr: the #MemoryRegion to be initialized. * @owner: the object that tracks the region's reference count * @ops: callbacks for write access handling. @@ -459,16 +462,21 @@ void memory_region_init_rom_device(MemoryRegion *mr, * A reservation region primariy serves debugging purposes. It claims I/O * space that is not supposed to be handled by QEMU itself. Any access via * the memory API will cause an abort(). + * This function is deprecated. Use memory_region_init_io() with NULL + * callbacks instead. * * @mr: the #MemoryRegion to be initialized * @owner: the object that tracks the region's reference count * @name: used for debugging; not visible to the user or ABI * @size: size of the region. */ -void memory_region_init_reservation(MemoryRegion *mr, - struct Object *owner, +static inline void memory_region_init_reservation(MemoryRegion *mr, + Object *owner, const char *name, - uint64_t size); + uint64_t size) +{ + memory_region_init_io(mr, owner, NULL, mr, name, size); +} /** * memory_region_init_iommu: Initialize a memory region that translates diff --git a/memory.c b/memory.c index 4eb138a..0d8b2d9 100644 --- a/memory.c +++ b/memory.c @@ -1182,7 +1182,7 @@ void memory_region_init_io(MemoryRegion *mr, uint64_t size) { memory_region_init(mr, owner, name, size); - mr->ops = ops; + mr->ops = ops ? ops : &unassigned_mem_ops; mr->opaque = opaque; mr->terminates = true; } @@ -1300,14 +1300,6 @@ void memory_region_init_iommu(MemoryRegion *mr, notifier_list_init(&mr->iommu_notify); } -void memory_region_init_reservation(MemoryRegion *mr, - Object *owner, - const char *name, - uint64_t size) -{ - memory_region_init_io(mr, owner, &unassigned_mem_ops, mr, name, size); -} - static void memory_region_finalize(Object *obj) { MemoryRegion *mr = MEMORY_REGION(obj);