From patchwork Mon Sep 5 21:59:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mian Yousaf Kaukab X-Patchwork-Id: 666591 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3sT7HJ5w38z9s65 for ; Tue, 6 Sep 2016 23:49:00 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=ry5sa94v; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0DBD34B9AD; Tue, 6 Sep 2016 15:48:59 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DzzKUwqzmiQ8; Tue, 6 Sep 2016 15:48:58 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A00E4B381C; Tue, 6 Sep 2016 15:47:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BC5914B71E for ; Mon, 5 Sep 2016 23:57:41 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E6lc71AHTc4k for ; Mon, 5 Sep 2016 23:57:29 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by theia.denx.de (Postfix) with ESMTPS id 46F0C4B6B3 for ; Mon, 5 Sep 2016 23:57:13 +0200 (CEST) Received: by mail-lf0-f68.google.com with SMTP id j41so1673727lfi.3 for ; Mon, 05 Sep 2016 14:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=RVPO54TTX3LPwM8Y83ehD8ZaBkBZZidjGWAFG3x/kuQ=; b=ry5sa94v4+fmAhcj3DTBFnGF3y4NCYMDdunXsricmj0/ocTxkoCQUbdxj2B9k9BcJE EYeaZyWrT5LZgPHba3/1fcl9zXMNfPHsmHd4n9OrL+CxtejQcPVBotkybif+rsx5zaLM xW0quT7W85EyDL59Zjk/SCQuzHzpJOqmJmO/lp/qNcMPLNQnB5JfuzDxXTWYi3T3ryU5 ZAJrwW72PbQtbK6DqJq6/vOpygXN2StkQzPMPH/Qe3rLAhzYxBSXfSpOm4R+MJeVirWk /fjlxMyosdUeNUgb2Wnz6Z2Hl6M875cKEUFZiAqVqOv66t76f5th8+sXeRM53jhZFh+h HSUA== 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; bh=RVPO54TTX3LPwM8Y83ehD8ZaBkBZZidjGWAFG3x/kuQ=; b=FTpw2BLFdSfGGdJMvmQUyf/1WjiKYdQ7Jm1pb8K0/lueWYF6bvvuguijcfx3l+FRox 6mLO2jR5B3N4t44MUDvyWzNOjlu3X5G2/yoE7MaA92qDGJ904V3jHtw2LGFgj6CTel6M NM60TdD4CjTEnya5Lcu/si1ZboeItPHplRXb5wHZb4Qqf4vINSW2BovT/NFDufa3TSPb WFmafDekpxKrhxYwr1NrYpuEb2LCPvyadpBqDzaDLMhSo/AMrs/7L1M7XJvX3/H5i+SE IFw7mnao00X+w2jdxeX83SDY7SoFr9gl9jmQdIqZcGH0J13UIDbIrxYtIobdCUKRESrh X31g== X-Gm-Message-State: AE9vXwORbE/ke8ttT+M7LkZd4Mfc5yZjOeJ2SuNkmxoeo67e+Eh0orpAE+w4OJbLtz/1og== X-Received: by 10.25.99.79 with SMTP id x76mr4694887lfb.29.1473112632765; Mon, 05 Sep 2016 14:57:12 -0700 (PDT) Received: from linux.local (h-23-46.a230.priv.bahnhof.se. [155.4.23.46]) by smtp.gmail.com with ESMTPSA id h64sm2017913lji.29.2016.09.05.14.57.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Sep 2016 14:57:11 -0700 (PDT) From: Mian Yousaf Kaukab To: u-boot@lists.denx.de Date: Mon, 5 Sep 2016 23:59:22 +0200 Message-Id: <1473112762-3137-1-git-send-email-yousaf.kaukab@gmail.com> X-Mailer: git-send-email 2.6.6 X-Mailman-Approved-At: Tue, 06 Sep 2016 15:45:17 +0200 Subject: [U-Boot] [PATCH] efi_loader: provide efi_mem_desc version X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Provide version of struct efi_mem_desc in efi_get_memory_map(). EFI_BOOT_SERVICES.GetMemoryMap() in UEFI specification v2.6 defines memory descriptor version to 1. Linux kernel also expects descriptor version to be 1 and prints following warning during boot if its not: Unexpected EFI_MEMORY_DESCRIPTOR version 0 Signed-off-by: Mian Yousaf Kaukab --- include/efi.h | 2 ++ lib/efi_loader/efi_memory.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/efi.h b/include/efi.h index 83de2d4..5a3b8cf 100644 --- a/include/efi.h +++ b/include/efi.h @@ -159,6 +159,8 @@ struct efi_mem_desc { u64 attribute; }; +#define EFI_MEMORY_DESCRIPTOR_VERSION 1 + /* Allocation types for calls to boottime->allocate_pages*/ #define EFI_ALLOCATE_ANY_PAGES 0 #define EFI_ALLOCATE_MAX_ADDRESS 1 diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index df3547c..80e4e26 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -339,6 +339,9 @@ efi_status_t efi_get_memory_map(unsigned long *memory_map_size, if (descriptor_size) *descriptor_size = sizeof(struct efi_mem_desc); + if (descriptor_version) + *descriptor_version = EFI_MEMORY_DESCRIPTOR_VERSION; + if (*memory_map_size < map_size) return EFI_BUFFER_TOO_SMALL;