public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Star Zeng <star.zeng@intel.com>
To: edk2-devel@lists.01.org
Cc: Star Zeng <star.zeng@intel.com>, Jiewen Yao <jiewen.yao@intel.com>
Subject: [PATCH 2/3] MdeModulePkg Ppi/IoMmu.h: Add EFI_NOT_AVAILABLE_YET return status code
Date: Tue,  6 Feb 2018 18:47:38 +0800	[thread overview]
Message-ID: <1517914059-10980-3-git-send-email-star.zeng@intel.com> (raw)
In-Reply-To: <1517914059-10980-1-git-send-email-star.zeng@intel.com>

Install IOMMU PPI for pre-memory phase and return
EFI_NOT_AVAILABLE_YET to indicate that DMA protection has been enabled,
but DMA buffer are not available to be allocated yet.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 MdeModulePkg/Include/Ppi/IoMmu.h | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Include/Ppi/IoMmu.h b/MdeModulePkg/Include/Ppi/IoMmu.h
index ed8cd540a21f..0dfe6f4d4b44 100644
--- a/MdeModulePkg/Include/Ppi/IoMmu.h
+++ b/MdeModulePkg/Include/Ppi/IoMmu.h
@@ -1,7 +1,7 @@
 /** @file
   PEI IOMMU PPI.
 
-Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials are licensed and made available under
 the terms and conditions of the BSD License that accompanies this distribution.
 The full text of the license may be found at
@@ -69,6 +69,8 @@ typedef struct _EDKII_IOMMU_PPI  EDKII_IOMMU_PPI;
   @retval EFI_UNSUPPORTED        The IOMMU does not support the memory range specified by Mapping.
   @retval EFI_OUT_OF_RESOURCES   There are not enough resources available to modify the IOMMU access.
   @retval EFI_DEVICE_ERROR       The IOMMU device reported an error while attempting the operation.
+  @retval EFI_NOT_AVAILABLE_YET  DMA protection has been enabled, but DMA buffer are
+                                 not available to be allocated yet.
 
 **/
 typedef
@@ -97,6 +99,8 @@ EFI_STATUS
   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
   @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.
   @retval EFI_DEVICE_ERROR      The system hardware could not map the requested address.
+  @retval EFI_NOT_AVAILABLE_YET DMA protection has been enabled, but DMA buffer are
+                                not available to be allocated yet.
 
 **/
 typedef
@@ -119,6 +123,9 @@ EFI_STATUS
   @retval EFI_SUCCESS           The range was unmapped.
   @retval EFI_INVALID_PARAMETER Mapping is not a value that was returned by Map().
   @retval EFI_DEVICE_ERROR      The data was not committed to the target system memory.
+  @retval EFI_NOT_AVAILABLE_YET DMA protection has been enabled, but DMA buffer are
+                                not available to be allocated yet.
+
 **/
 typedef
 EFI_STATUS
@@ -144,6 +151,8 @@ EFI_STATUS
                                 MEMORY_WRITE_COMBINE, MEMORY_CACHED and DUAL_ADDRESS_CYCLE.
   @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
   @retval EFI_OUT_OF_RESOURCES  The memory pages could not be allocated.
+  @retval EFI_NOT_AVAILABLE_YET DMA protection has been enabled, but DMA buffer are
+                                not available to be allocated yet.
 
 **/
 typedef
@@ -159,13 +168,15 @@ EFI_STATUS
 /**
   Frees memory that was allocated with AllocateBuffer().
 
-  @param  This                  The protocol instance pointer.
+  @param  This                  The PPI instance pointer.
   @param  Pages                 The number of pages to free.
   @param  HostAddress           The base system memory address of the allocated range.
 
   @retval EFI_SUCCESS           The requested memory pages were freed.
   @retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages
                                 was not allocated with AllocateBuffer().
+  @retval EFI_NOT_AVAILABLE_YET DMA protection has been enabled, but DMA buffer are
+                                not available to be allocated yet.
 
 **/
 typedef
-- 
2.7.0.windows.1



  parent reply	other threads:[~2018-02-06 10:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-06 10:47 [PATCH 0/3] Minor enhancements to IOMMU PPI Star Zeng
2018-02-06 10:47 ` [PATCH 1/3] IntelSiliconPkg IntelVTdPmrPei: Install IoMmu PPI before enabling PMR Star Zeng
2018-02-06 10:47 ` Star Zeng [this message]
2018-02-06 10:47 ` [PATCH 3/3] IntelSiliconPkg IntelVTdPmrPei: Install IOMMU PPI for pre-memory phase Star Zeng
2018-02-06 14:38 ` [PATCH 0/3] Minor enhancements to IOMMU PPI Yao, Jiewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1517914059-10980-3-git-send-email-star.zeng@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox