Add support for IOMMU/VT-d specific sections.
diff --git a/sections/cper-section-dmar-iommu.c b/sections/cper-section-dmar-iommu.c
new file mode 100644
index 0000000..14d66a3
--- /dev/null
+++ b/sections/cper-section-dmar-iommu.c
@@ -0,0 +1,41 @@
+/**
+ * Describes functions for converting IOMMU specific DMAr CPER sections from binary and JSON format
+ * into an intermediate format.
+ *
+ * Author: Lawrence.Tang@arm.com
+ **/
+#include <stdio.h>
+#include "json.h"
+#include "../edk/Cper.h"
+#include "../cper-utils.h"
+#include "cper-section-dmar-iommu.h"
+
+//Converts a single IOMMU specific DMAr CPER section into JSON IR.
+json_object* cper_section_dmar_iommu_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor)
+{
+ EFI_IOMMU_DMAR_ERROR_DATA* iommu_error = (EFI_IOMMU_DMAR_ERROR_DATA*)section;
+ json_object* section_ir = json_object_new_object();
+
+ //Revision.
+ json_object_object_add(section_ir, "revision", json_object_new_int(iommu_error->Revision));
+
+ //IOMMU registers.
+ json_object_object_add(section_ir, "controlRegister", json_object_new_uint64(iommu_error->Control));
+ json_object_object_add(section_ir, "statusRegister", json_object_new_uint64(iommu_error->Status));
+
+ //IOMMU event log entry.
+ //todo: implement as specified in the IOMMU specification
+
+ //Device table entry.
+ //todo: dump as b64
+
+ //Page table entries.
+ json_object_object_add(section_ir, "pageTableEntry_Level6", json_object_new_uint64(iommu_error->PteL6));
+ json_object_object_add(section_ir, "pageTableEntry_Level5", json_object_new_uint64(iommu_error->PteL5));
+ json_object_object_add(section_ir, "pageTableEntry_Level4", json_object_new_uint64(iommu_error->PteL4));
+ json_object_object_add(section_ir, "pageTableEntry_Level3", json_object_new_uint64(iommu_error->PteL3));
+ json_object_object_add(section_ir, "pageTableEntry_Level2", json_object_new_uint64(iommu_error->PteL2));
+ json_object_object_add(section_ir, "pageTableEntry_Level1", json_object_new_uint64(iommu_error->PteL1));
+
+ return section_ir;
+}
\ No newline at end of file