From patchwork Thu Aug 16 05:57:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 958110 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41rbGs45gYz9s4v for ; Thu, 16 Aug 2018 15:58:13 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="PYjw1Rzh"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41rbGr68WzzDr42 for ; Thu, 16 Aug 2018 15:58:12 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="PYjw1Rzh"; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41rbGf6hP1zDqmF for ; Thu, 16 Aug 2018 15:58:02 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="PYjw1Rzh"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 41rbGf26wNz9s4v; Thu, 16 Aug 2018 15:58:02 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1534399082; bh=YivbJTN3vHVy/As3qIlXWUIgWyjcCdKAmS/hrGR4/Yg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PYjw1RzhjvDmFR4MgjxUR5XPKgKXPZ+tYp+4qHiUksBcJEWUaJeGC0gcj0dlxIv7A oWrAVjzDWgoLQpJF8ArIpk3PPkiM/zbSme6XxY2aX2L7FEr5DlWH+UktM5ZbCCMH7S uozymLGTvq9ygFb2ysMxvtgY9vDodSF2sRe1esnAxiTrvYEDKuEa1d9pZ1XoPgJHeC PV7jmdwafHzReBiKYUuFB72PRiFLsrKQb/FY+hUOXeh28dhuTEIfbg1oIxmxj2ohkD gLOB0W+N8NOWZMF8wICFbvyzMKH8XBK3mQ/nrPqgEQ3neVS8Vxt1F1comPzuiL7+yD LEPq24p2qv2AQ== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 16 Aug 2018 15:57:53 +1000 Message-Id: <20180816055756.1011374-2-amitay@ozlabs.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180816055756.1011374-1-amitay@ozlabs.org> References: <20180816055756.1011374-1-amitay@ozlabs.org> Subject: [Pdbg] [PATCH 2/5] libpdbg: Add a function to get root of the device tree X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- libpdbg/libpdbg.h | 1 + libpdbg/target.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/libpdbg/libpdbg.h b/libpdbg/libpdbg.h index f0bca0c..a5a52b3 100644 --- a/libpdbg/libpdbg.h +++ b/libpdbg/libpdbg.h @@ -91,6 +91,7 @@ char *pdbg_target_class_name(struct pdbg_target *target); char *pdbg_target_name(struct pdbg_target *target); void *pdbg_target_priv(struct pdbg_target *target); void pdbg_target_priv_set(struct pdbg_target *target, void *priv); +struct pdbg_target *pdbg_target_root(void); /* Procedures */ int fsi_read(struct pdbg_target *target, uint32_t addr, uint32_t *val); diff --git a/libpdbg/target.c b/libpdbg/target.c index be3b845..1d308cc 100644 --- a/libpdbg/target.c +++ b/libpdbg/target.c @@ -413,3 +413,8 @@ void pdbg_target_priv_set(struct pdbg_target *target, void *priv) { target->priv = priv; } + +struct pdbg_target *pdbg_target_root(void) +{ + return dt_root; +}