From patchwork Fri Aug 10 17:29:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 956359 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 41nBwB50psz9s4Z for ; Sat, 11 Aug 2018 03:30:18 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="O3c5ykI+"; 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 41nBwB3LxtzF0PT for ; Sat, 11 Aug 2018 03:30:18 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="O3c5ykI+"; dkim-atps=neutral X-Original-To: Petitboot@lists.ozlabs.org Delivered-To: Petitboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=geoff@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="O3c5ykI+"; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41nBv32lqYzDrpW for ; Sat, 11 Aug 2018 03:29:19 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Date:Cc:To:Subject:From:References: In-Reply-To:Message-Id:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gXRhPOkI6/ml4S/bU2LugCWrqnByRy5FpNCQOY8+J4o=; b=O3c5ykI+ovMBGtXxbLj/aNomQ gGE1mdeSrTDHU244mX/lfh12MCtMh/oDruH2F4LYnXwN2rZOBI7jYopERuiSWDUCF9ivE6YFk0VrI y4eUQNzllAWmYDMKpmb/X5ACAah0UsCEWtJ5ehGPCFRoZMhQy50u0dgUyCxBNTx3vcgp4l5Ujs8bO U1x6Ld4vHbXOc3Gpa7L69aOj4p+cChZ/djP+ha9iJD319bRg0H2aqZOfdb2sLiblGRgwxq0cHiQ9A ro6pA22KdAo0ESNcv9RdPoDFwwPF1Y/lvm8rpI0wKzDmedtyx1wXD+jIWxZiKG1m4yFQW8bkyA7po Kviju5xsQ==; Received: from geoff by merlin.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1foBDu-0002Q3-HS; Fri, 10 Aug 2018 17:29:14 +0000 Message-Id: <14e587d6127aad17d1951156c2fff625e1177ccd.1533921283.git.geoff@infradead.org> In-Reply-To: References: From: Geoff Levand Patch-Date: Fri, 10 Aug 2018 10:00:12 -0700 Subject: [PATCH v1 1/6] lib/efi: Add EFI_DEFALT_ATTRIBUTES macro To: Samuel Mendoza-Jonas Date: Fri, 10 Aug 2018 17:29:14 +0000 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Petitboot@lists.ozlabs.org MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" For convenience, add a new efi data attributes macro EFI_DEFALT_ATTRIBUTES. Signed-off-by: Geoff Levand --- discover/platform-arm64.c | 5 +---- lib/efi/efivar.h | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/discover/platform-arm64.c b/discover/platform-arm64.c index a70298a..0eb2579 100644 --- a/discover/platform-arm64.c +++ b/discover/platform-arm64.c @@ -70,10 +70,7 @@ static void write_nvram(const struct param_list *pl) struct efi_data efi_data; struct param *param; - efi_data.attributes = - EFI_VARIABLE_NON_VOLATILE | - EFI_VARIABLE_RUNTIME_ACCESS | - EFI_VARIABLE_BOOTSERVICE_ACCESS; + efi_data.attributes = EFI_DEFALT_ATTRIBUTES; param_list_for_each(pl, param) { if (!param->modified) diff --git a/lib/efi/efivar.h b/lib/efi/efivar.h index 0d44100..48edd17 100644 --- a/lib/efi/efivar.h +++ b/lib/efi/efivar.h @@ -30,6 +30,12 @@ #define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020 #define EFI_VARIABLE_APPEND_WRITE 0x00000040 +#define EFI_DEFALT_ATTRIBUTES ( \ + EFI_VARIABLE_NON_VOLATILE | \ + EFI_VARIABLE_RUNTIME_ACCESS | \ + EFI_VARIABLE_BOOTSERVICE_ACCESS \ +) + #ifndef EFIVARFS_MAGIC #define EFIVARFS_MAGIC 0xde5e81e4 #endif