From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web09.12120.1647966103897669224 for ; Tue, 22 Mar 2022 09:21:44 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=DvdEmG0O; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from localhost.localdomain (unknown [47.202.59.224]) by linux.microsoft.com (Postfix) with ESMTPSA id 8EDEA20DE481; Tue, 22 Mar 2022 09:21:42 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8EDEA20DE481 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1647966103; bh=SpQbDVuQRCLmKm9oTHfxNYpmONot4Ms4iCRBlW/Azuk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DvdEmG0OQarkin24XzhM2BkOOCKXuYIv4Ol/co/PCXHB/ZST5uQZKBa5Gxh9odGb7 yCNyK9Q1xgdy3dDjdOYSnnVCaZt0OLpBxzDi7RwtHfh3AWjMNi7EMwaeoIuBp9OpMT jXnzIWkEPaeWWXveaZ9bCFkcweVtF/R128guAkMw= From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Andrew Fish , Kang Gao , Michael D Kinney , Michael Kubacki , Leif Lindholm , Benjamin You , Liu Yun , Ankit Sinha , Nate DeSimone Subject: [PATCH v1 18/41] PrmPkg/PrmContextBuffer.h: Add ACPI parameter support structures Date: Tue, 22 Mar 2022 12:19:24 -0400 Message-Id: <20220322161947.9319-19-mikuback@linux.microsoft.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20220322161947.9319-1-mikuback@linux.microsoft.com> References: <20220322161947.9319-1-mikuback@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Kubacki Adds a new type ACPI_PARAMETER_BUFFER_DESCRIPTOR that can be used by PRM module configuration code to associate a PRM handler GUID with an ACPI parameter buffer allocated by the PRM module configuration code. The ACPI parameter buffer descriptors for a given PRM module are tracked in the firmware internal structure PRM_MODULE_CONTEXT_BUFFERS produced by the module configuration code. Cc: Andrew Fish Cc: Kang Gao Cc: Michael D Kinney Cc: Michael Kubacki Cc: Leif Lindholm Cc: Benjamin You Cc: Liu Yun Cc: Ankit Sinha Cc: Nate DeSimone Signed-off-by: Michael Kubacki --- PrmPkg/Include/PrmContextBuffer.h | 41 ++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/PrmPkg/Include/PrmContextBuffer.h b/PrmPkg/Include/PrmContex= tBuffer.h index 8f8144545e64..869480101773 100644 --- a/PrmPkg/Include/PrmContextBuffer.h +++ b/PrmPkg/Include/PrmContextBuffer.h @@ -19,6 +19,18 @@ =20 #pragma pack(push, 1) =20 +// +// Associates an ACPI parameter buffer with a particular PRM handler in +// a PRM module. +// +// If either the GUID or address are zero then neither value is used to +// copy the ACPI parameter buffer address to the PRMT ACPI table. +// +typedef struct { + EFI_GUID HandlerGuid; + UINT64 AcpiParameterBufferAddress; +} ACPI_PARAMETER_BUFFER_DESCRIPTOR; + // // This is the context buffer structure that is passed to a PRM handler. // @@ -124,6 +136,35 @@ typedef struct /// This pointer may be NULL if runtime memory ranges are not needed. /// PRM_RUNTIME_MMIO_RANGES *RuntimeMmioRanges; + + /// + /// The number of ACPI parameter buffer descriptors in the array + /// AcpiParameterBufferDescriptors + /// + UINTN AcpiParameterBufferDescriptorC= ount; + + /// + /// A pointer to an array of ACPI parameter buffer descriptors. PRM mo= dule + /// configuration code uses this structure to associate a specific PRM + /// handler with an ACPI parameter buffer. + /// + /// An ACPI parameter buffer is a parameter buffer allocated by the PR= M + /// module configuration code to be used by ACPI as a parameter buffer + /// to the associated PRM handler at OS runtime. + /// + /// This buffer is not required if: + /// 1. A parameter buffer is not used by a PRM handler at all + /// 2. A parameter buffer is used but the PRM handler is never invoked + /// from ACPI (it is directly called by an OS device driver for exa= mple) + /// + /// In case #2 above, the direct PRM handler is responsible for alloca= ting + /// a parameter buffer and passing that buffer to the PRM handler. + /// + /// A PRM module only needs to provide an ACPI_PARAMETER_BUFFER_DESCRI= PTOR + /// for each PRM handler that actually uses an ACPI parameter buffer. = If + /// no handlers use an ACPI parameter buffer this pointer should be NU= LL. + /// + ACPI_PARAMETER_BUFFER_DESCRIPTOR *AcpiParameterBufferDescriptor= s; } PRM_MODULE_CONTEXT_BUFFERS; =20 #pragma pack(pop) --=20 2.28.0.windows.1