From patchwork Mon May 2 13:35:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 67033 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp47788qge; Mon, 2 May 2016 06:38:21 -0700 (PDT) X-Received: by 10.50.183.7 with SMTP id ei7mr13232287igc.77.1462196301085; Mon, 02 May 2016 06:38:21 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id g139si16237262iog.99.2016.05.02.06.38.20; Mon, 02 May 2016 06:38:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linaro-uefi-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=linaro-uefi-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 9BCEB61606; Mon, 2 May 2016 13:38:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 6E1E961638; Mon, 2 May 2016 13:36:30 +0000 (UTC) X-Original-To: linaro-uefi@lists.linaro.org Delivered-To: linaro-uefi@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 9B7E76160F; Mon, 2 May 2016 13:36:12 +0000 (UTC) Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by lists.linaro.org (Postfix) with ESMTPS id A036F61602 for ; Mon, 2 May 2016 13:35:54 +0000 (UTC) Received: by mail-wm0-f46.google.com with SMTP id e201so107321775wme.0 for ; Mon, 02 May 2016 06:35:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/TZjU57btU/Zu1eyZhldXWgqI7+HO1uX4vxbj0lNuFw=; b=lGJ0yMl0NFRhmo6KPXyEibKvpHL3Gy+Oe99DcdckZbijko007MXVRkWR1j6FJ3itcN wADEWIiiYFONJa0lymwZ+YlCl2IViW5kyCedxAn/wMwRcZ96KnmXNwhHjO+177xBiJPI 1VCx6sDXvD+QLgWaJe3Wu4bRAnWN832DAftPkK46Ww4YAYJfVT/tPn83OfK8WJCbwcae crMuEYhW+bmv2VUlbWctu/Uh9zAkZgquMDDPrL4/tTtOf+BVeSTDOiJIwbiEh1YI7mrS ZtcOghJm3WlaFXxBF96UtRdzkcV1+1W/fS0VCrA05qCJrJvOqomP3etHiG5wjRa7OmYk JfrQ== X-Gm-Message-State: AOPr4FWLM68Ebj4k+rTNottOj/M3Wmn8n3hw/4/MBNpDfgToH5TV7/1EfLlYU3Z7xngknAaFiqk= X-Received: by 10.28.213.137 with SMTP id m131mr13292123wmg.24.1462196153604; Mon, 02 May 2016 06:35:53 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id d1sm30424544wjb.47.2016.05.02.06.35.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 May 2016 06:35:52 -0700 (PDT) From: Ard Biesheuvel To: linaro-uefi@lists.linaro.org Date: Mon, 2 May 2016 15:35:39 +0200 Message-Id: <1462196143-21998-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1462196143-21998-1-git-send-email-ard.biesheuvel@linaro.org> References: <1462196143-21998-1-git-send-email-ard.biesheuvel@linaro.org> Cc: leo.duran@amd.com Subject: [Linaro-uefi] [RFC PATCH 3/7] Platforms/AMD: AmdStyxHelperLib: add helper to retrieve core info array X-BeenThere: linaro-uefi@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-uefi-bounces@lists.linaro.org Sender: "Linaro-uefi" Add a helper function which retrieves the ARM_CORE_INFO array directly from the HOB rather than going via the ARM_PROCESSOR_TABLE structure in the configuration table array. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- Platforms/AMD/Styx/Common/AmdStyxHelperLib.h | 5 +++++ Platforms/AMD/Styx/Library/AmdStyxHelperLib/AmdStyxHelperLib.c | 21 ++++++++++++++++++++ Platforms/AMD/Styx/Library/AmdStyxHelperLib/AmdStyxHelperLib.inf | 5 ++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/Platforms/AMD/Styx/Common/AmdStyxHelperLib.h b/Platforms/AMD/Styx/Common/AmdStyxHelperLib.h index 8fb6bc4b6c0d..c4598fe7d108 100644 --- a/Platforms/AMD/Styx/Common/AmdStyxHelperLib.h +++ b/Platforms/AMD/Styx/Common/AmdStyxHelperLib.h @@ -39,4 +39,9 @@ AmdStyxGetArmProcessorTable( VOID ); +ARM_CORE_INFO * +AmdStyxGetArmCoreInfoTable ( + OUT UINTN *NumEntries + ); + #endif // _AMDSTYX_HELPER_LIB_H_ diff --git a/Platforms/AMD/Styx/Library/AmdStyxHelperLib/AmdStyxHelperLib.c b/Platforms/AMD/Styx/Library/AmdStyxHelperLib/AmdStyxHelperLib.c index 8189df3cddc6..6e0ed35278e4 100644 --- a/Platforms/AMD/Styx/Library/AmdStyxHelperLib/AmdStyxHelperLib.c +++ b/Platforms/AMD/Styx/Library/AmdStyxHelperLib/AmdStyxHelperLib.c @@ -20,6 +20,9 @@ #include +#include +#include + extern EFI_SYSTEM_TABLE *gST; #pragma pack(push, 1) @@ -78,3 +81,21 @@ AmdStyxGetArmProcessorTable( return NULL; } +ARM_CORE_INFO * +AmdStyxGetArmCoreInfoTable ( + OUT UINTN *NumEntries + ) +{ + EFI_HOB_GUID_TYPE *Hob; + + ASSERT (NumEntries != NULL); + + Hob = GetFirstGuidHob (&gAmdStyxMpCoreInfoGuid); + if (Hob == NULL) { + return NULL; + } + + *NumEntries = GET_GUID_HOB_DATA_SIZE (Hob) / sizeof (ARM_CORE_INFO); + + return GET_GUID_HOB_DATA (Hob); +} diff --git a/Platforms/AMD/Styx/Library/AmdStyxHelperLib/AmdStyxHelperLib.inf b/Platforms/AMD/Styx/Library/AmdStyxHelperLib/AmdStyxHelperLib.inf index 57a6ebe74724..540ecfcc6399 100644 --- a/Platforms/AMD/Styx/Library/AmdStyxHelperLib/AmdStyxHelperLib.inf +++ b/Platforms/AMD/Styx/Library/AmdStyxHelperLib/AmdStyxHelperLib.inf @@ -29,6 +29,9 @@ [Sources.common] AmdStyxHelperLib.c +[LibraryClasses] + HobLib + [Packages] ArmPkg/ArmPkg.dec MdePkg/MdePkg.dec @@ -38,4 +41,4 @@ [Guids] gArmMpCoreInfoGuid - + gAmdStyxMpCoreInfoGuid