From patchwork Mon Feb 19 06:42:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharata B Rao X-Patchwork-Id: 10227183 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E1D0460392 for ; Mon, 19 Feb 2018 06:44:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2CD92893F for ; Mon, 19 Feb 2018 06:44:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C758E28946; Mon, 19 Feb 2018 06:44:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 600B62893F for ; Mon, 19 Feb 2018 06:44:52 +0000 (UTC) Received: from localhost ([::1]:47821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enfBz-0004uJ-JM for patchwork-qemu-devel@patchwork.kernel.org; Mon, 19 Feb 2018 01:44:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enfAU-0004jU-Hv for qemu-devel@nongnu.org; Mon, 19 Feb 2018 01:43:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enfAR-0001df-Fp for qemu-devel@nongnu.org; Mon, 19 Feb 2018 01:43:18 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49602 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1enfAR-0001dX-Bc for qemu-devel@nongnu.org; Mon, 19 Feb 2018 01:43:15 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1J6cubw033891 for ; Mon, 19 Feb 2018 01:43:13 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 2g7s5hgtvs-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 19 Feb 2018 01:43:12 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 19 Feb 2018 06:43:11 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 19 Feb 2018 06:43:08 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1J6h8WN48431164; Mon, 19 Feb 2018 06:43:08 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4697652041; Mon, 19 Feb 2018 05:35:04 +0000 (GMT) Received: from bharata.in.ibm.com (unknown [9.124.35.166]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 1289352043; Mon, 19 Feb 2018 05:35:02 +0000 (GMT) From: Bharata B Rao To: qemu-devel@nongnu.org Date: Mon, 19 Feb 2018 12:12:53 +0530 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519022574-6817-1-git-send-email-bharata@linux.vnet.ibm.com> References: <1519022574-6817-1-git-send-email-bharata@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18021906-0012-0000-0000-000005B214CA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18021906-0013-0000-0000-0000192E1E90 Message-Id: <1519022574-6817-2-git-send-email-bharata@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-19_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802190084 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.158.5 Subject: [Qemu-devel] [RFC PATCH v0 1/2] pc-dimm: Make pc_dimm_built_list() global 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: , Cc: imammedo@redhat.com, mwb@linux.vnet.ibm.com, qemu-ppc@nongnu.org, Bharata B Rao , nfont@linux.vnet.ibm.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Making pc_dimm_built_list() global allows other parts of QEMU code to build and walk through the DIMM list in address-sorted order. This is needed in the next patch for sPAPR code to create ibm,dynamic-memory-v2 device tree property that will have entries for populated DIMMs as well as available hotpluggable areas. CHECK: List of DIMMs is already available via qmp_pc_dimm_device_list(), but that doesn't provide a sorted list. Signed-off-by: Bharata B Rao --- hw/mem/pc-dimm.c | 2 +- include/hw/mem/pc-dimm.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 6e74b61..9bd61ca 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -261,7 +261,7 @@ static gint pc_dimm_addr_sort(gconstpointer a, gconstpointer b) return 0; } -static int pc_dimm_built_list(Object *obj, void *opaque) +int pc_dimm_built_list(Object *obj, void *opaque) { GSList **list = opaque; diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index d83b957..d880f5e 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -100,4 +100,5 @@ void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplugState *hpms, MemoryRegion *mr, uint64_t align, Error **errp); void pc_dimm_memory_unplug(DeviceState *dev, MemoryHotplugState *hpms, MemoryRegion *mr); +int pc_dimm_built_list(Object *obj, void *opaque); #endif