public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Omkar Anand Kulkarni" <omkar.kulkarni@arm.com>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Sami Mujawar <sami.mujawar@arm.com>
Subject: [PATCH v2 4/4] ArmPlatformPkg: Add helpers for HEST table generation
Date: Sat, 10 Jul 2021 21:48:31 +0530	[thread overview]
Message-ID: <20210710161831.30433-5-omkar.kulkarni@arm.com> (raw)
In-Reply-To: <20210710161831.30433-1-omkar.kulkarni@arm.com>

Add helper macros for the generation of the HEST ACPI table. Macros to
initialize the HEST GHESv2 Notification Structure and Error Status
Structure are introduced.

Signed-off-by: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
---
 ArmPlatformPkg/Include/HestAcpiHeader.h | 49 ++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/ArmPlatformPkg/Include/HestAcpiHeader.h b/ArmPlatformPkg/Include/HestAcpiHeader.h
new file mode 100644
index 000000000000..5112ee5b22c5
--- /dev/null
+++ b/ArmPlatformPkg/Include/HestAcpiHeader.h
@@ -0,0 +1,49 @@
+/** @file
+  HEST table helper macros.
+
+  Macro definitions to initialize the HEST ACPI table specific structures.
+
+  Copyright (c) 2021, ARM Limited. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Specification Reference:
+    - ACPI Reference Specification 6.3
+    - UEFI Reference Specification 2.8
+**/
+
+#ifndef HEST_ACPI_HEADER_
+#define HEST_ACPI_HEADER_
+
+#include <IndustryStandard/Acpi.h>
+
+//
+// HEST table GHESv2 type related structures.
+//
+// Helper Macro to initialize the HEST GHESv2 Notification Structure.
+// Refer Table 18-394 in ACPI Specification, Version 6.3.
+#define EFI_ACPI_6_3_HARDWARE_ERROR_NOTIFICATION_STRUCTURE_INIT(Type,         \
+  PollInterval, EventId)                                                      \
+  {                                                                           \
+    Type,                                                                     \
+    sizeof (EFI_ACPI_6_3_HARDWARE_ERROR_NOTIFICATION_STRUCTURE),              \
+    {0, 0, 0, 0, 0, 0, 0}, /* ConfigurationWriteEnable */                     \
+    PollInterval,                                                             \
+    EventId,                                                                  \
+    0,                    /* Poll Interval Threshold Value  */                \
+    0,                    /* Poll Interval Threshold Window */                \
+    0,                    /* Error Threshold Value          */                \
+    0                     /* Error Threshold Window         */                \
+  }
+
+// Helper Macro to initialize the HEST GHESv2 Error Status Structure.
+// Refer Section 5.2.3.2 in ACPI Specification, Version 6.3.
+#define EFI_ACPI_6_3_GENERIC_ERROR_STATUS_STRUCTURE_INIT(Address)     \
+  {                                                                   \
+    0,        /* UINT8 Address Space ID */                            \
+    64,       /* Register Bit Width     */                            \
+    0,        /* Register Bit Offset    */                            \
+    4,        /* Access Size            */                            \
+    Address   /* CPER/Read Ack Addr     */                            \
+  }
+
+#endif /* HEST_ACPI_HEADER_ */
-- 
2.17.1


  parent reply	other threads:[~2021-07-10 16:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-10 16:18 [PATCH v2 0/4] ArmPlatformPkg: Add support to generate HEST ACPI table Omkar Anand Kulkarni
2021-07-10 16:18 ` [PATCH v2 1/4] ArmPlatformPkg: Allow dynamic generation of " Omkar Anand Kulkarni
2021-08-02 12:50   ` Sami Mujawar
2021-08-24  5:22     ` Omkar Anand Kulkarni
2021-07-10 16:18 ` [PATCH v2 2/4] ArmPlatformPkg: add definition for MM_HEST_ERROR_SOURCE_DESC_PROTOCOL Omkar Anand Kulkarni
2021-08-03 14:45   ` Sami Mujawar
2021-08-24  5:23     ` Omkar Anand Kulkarni
2021-07-10 16:18 ` [PATCH v2 3/4] ArmPlatformPkg: retreive error source descriptors from MM Omkar Anand Kulkarni
2021-08-03 14:46   ` Sami Mujawar
2021-08-24  5:29     ` Omkar Anand Kulkarni
2021-07-10 16:18 ` Omkar Anand Kulkarni [this message]
2021-08-03 15:09   ` [PATCH v2 4/4] ArmPlatformPkg: Add helpers for HEST table generation Sami Mujawar
2021-08-24  5:30     ` Omkar Anand Kulkarni
2021-08-02 12:49 ` [PATCH v2 0/4] ArmPlatformPkg: Add support to generate HEST ACPI table Sami Mujawar
2021-08-03 15:14   ` Sami Mujawar
2021-08-24  5:19     ` Omkar Anand Kulkarni

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=20210710161831.30433-5-omkar.kulkarni@arm.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