From patchwork Tue Nov 17 00:27:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 324541 Delivered-To: patch@linaro.org Received: by 2002:a17:906:d156:0:0:0:0 with SMTP id br22csp4492420ejb; Mon, 16 Nov 2020 16:30:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxpqXqNv2vN/22pnUDHXtomY2Jvw0TF2cNYXfzdjh2pyyl6v2yNQW42yx5RN1Rm0Oxuuzkn X-Received: by 2002:a05:6402:783:: with SMTP id d3mr18577247edy.168.1605573037419; Mon, 16 Nov 2020 16:30:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605573037; cv=none; d=google.com; s=arc-20160816; b=qeclp7GIoiYLQylFOii76lqOeeQVEPbD1ZWkhqU34e9vqj/I3DvusLxWoHitB0nNYq v+9zuoGpM8ATkIa1BYbUOF5eM0D2Y0jBCOOQvCfJLWRQjxjnEbTYKDa99WrMj5YV4ZNU Nn3jzvOpF4n8WV63NwxR0fpIVPbnp4JK+is+G+jJQyCTUi4xCCCmntqyb2ruDmOmQzp9 6O+WTWDmqGYwRhmukyuz9S0d/yHWp7a/40+A7zzdE5ASgpWFUaBRxDFykMYykMj6doXl wOolNGO83ST8o18VEc3fmedJR/oZkM/6P6EDNeiHM7ZZIaVohS9EssvlY5BnqeiGCF0Q qMow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pfzS9a249CGCsTB62oWKa+nEqo4kbxAX5xW5fvW6X+k=; b=TXc443bH4QC/vqKhHFeAVZs9ohdeebVxIU5abU2kaZ474W79Rusj6JDcOxPLXAb3vW pA74qcdKOCIELz6HjDUhskU/YejjtCMy+OlrVWSOHkhmu6CUrNrf41xjk6yC9DuiRIAT dgO+DuNJpndDdkqG7TLywOlGdN92btWbcrsUJik5W8Yu3Xukri3F+nXcq8Lp4jBVcU6j 6JM23O0Z1Ar8ficxtkZzQZqYuBWUbT4LX4nqp8gNN4PSZqSBa0if57HHgTcvu7iC1VSH mdXYqA/KcxDUXGAfVdnzkkZth3JHGecFdPlvElSPo0N/gmtZoX4EMGXr4A66l3fHGtMy nRsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nj5IsVqz; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id c15si13420537ejr.181.2020.11.16.16.30.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 16:30:37 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nj5IsVqz; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 386D382569; Tue, 17 Nov 2020 01:29:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Nj5IsVqz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8DEA1825A0; Tue, 17 Nov 2020 01:29:21 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,T_SPF_HELO_TEMPERROR autolearn=no autolearn_force=no version=3.4.2 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BFF018255C for ; Tue, 17 Nov 2020 01:29:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pf1-x442.google.com with SMTP id g7so15791707pfc.2 for ; Mon, 16 Nov 2020 16:29:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pfzS9a249CGCsTB62oWKa+nEqo4kbxAX5xW5fvW6X+k=; b=Nj5IsVqz7qtDUZ3AalZ86U7ldq9gnx+4Lhsl/95GVRqfFXA+IqJcQ4MwGcmy/CAD1I rqqEJNqQ63ILBqrGYRMLxfXNqE2rFjyb3IZ9qCyqF+K9p9mzwX3q4bZVHGNmux5RmvuB /npGrr/Ha7w+zwUom4Cw9gad6Ax4bOqG/juQY5FN/UwSczqpqGO78mqfMKSJD2uvN0dn MayPPhFfNW4yErKLJzmpthNqG8dOTPwTYjMzTk1iYXkjgc5mx0FMBF44hLrYvXpFUsq7 yHgZPFKjfSaUJLjrPgw/rK0o5QjwrtuOAUv0bQMN3dEpn6+USNQeFTCNRihoeX+6wMI1 8ISg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pfzS9a249CGCsTB62oWKa+nEqo4kbxAX5xW5fvW6X+k=; b=ZktGdnOYjoaW4xE3GfQzvP9mdNl07IaKSqnwmJa3ZEdzaMI7W9DZlBuYoAAzJzyRQr nJl+RzN2z2zbjK6wR8G4I1pyEKTsjW1jcZNfA16i28csbcY7Mbr3zHNQnJLqvwX18r9W MCWMQ9D5LGJKh0dqeNPMdBQRppYTZiHBrgTZThumXFWw0S+50pKQkctx3WghHTdSx6wv iAjJfUJ8A/B1ekQJIWt63ndXoGQhRSKcZVP801jOeK0MuK02ku1g9CmNR9Wu41jOrOAF YktnMbOxH51p1YRpirO3K4P4y2Jfborw54cGnfuY1efFmAv0L5plmoFkMi8yu9MnjSW3 j/oQ== X-Gm-Message-State: AOAM5330oOeHrTBY6CbvJqz4ub7FJzWpXp75jxyoF1etyCa2mh6FjJVc 2XesqRcmm1+tlT17zUOloa0O+w== X-Received: by 2002:a17:90a:7d06:: with SMTP id g6mr1597416pjl.5.1605572933180; Mon, 16 Nov 2020 16:28:53 -0800 (PST) Received: from localhost.localdomain (p784a5642.tkyea130.ap.so-net.ne.jp. [120.74.86.66]) by smtp.gmail.com with ESMTPSA id t64sm20116506pfd.36.2020.11.16.16.28.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 16:28:52 -0800 (PST) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de Cc: sughosh.ganu@linaro.org, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH v9 03/11] efi_loader: capsule: add memory range capsule definitions Date: Tue, 17 Nov 2020 09:27:57 +0900 Message-Id: <20201117002805.13902-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117002805.13902-1-takahiro.akashi@linaro.org> References: <20201117002805.13902-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Memory range capsule gives us a way to notify that some memory regions should be left untouched across the next reset. See UEFI specification, section 8.5.3. Since how we should handle this kind of capsule is totally up to the system, no implementation will be added in this commit. Signed-off-by: AKASHI Takahiro --- include/efi_api.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.28.0 diff --git a/include/efi_api.h b/include/efi_api.h index c128a0a66ce8..7a2a087c60ed 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -221,6 +221,10 @@ enum efi_reset_type { EFI_GUID(0x39b68c46, 0xf7fb, 0x441b, 0xb6, 0xec, \ 0x16, 0xb0, 0xf6, 0x98, 0x21, 0xf3) +#define EFI_MEMORY_RANGE_CAPSULE_GUID \ + EFI_GUID(0xde9f0ec, 0x88b6, 0x428f, 0x97, 0x7a, \ + 0x25, 0x8f, 0x1d, 0xe, 0x5e, 0x72) + struct efi_capsule_header { efi_guid_t capsule_guid; u32 header_size; @@ -236,6 +240,19 @@ struct efi_capsule_result_variable_header { efi_status_t capsule_status; } __packed; +struct efi_memory_range { + efi_physical_addr_t address; + u64 length; +}; + +struct efi_memory_range_capsule { + struct efi_capsule_header *header; + /* EFI_MEMORY_TYPE: 0x80000000-0xFFFFFFFF */ + enum efi_mem_type os_requested_memory_type; + u64 number_of_memory_ranges; + struct efi_memory_range memory_ranges[]; +} __packed; + #define EFI_RT_SUPPORTED_GET_TIME 0x0001 #define EFI_RT_SUPPORTED_SET_TIME 0x0002 #define EFI_RT_SUPPORTED_GET_WAKEUP_TIME 0x0004