Add initial ARM support, fix bit shifting error.
diff --git a/sections/cper-section-arm.c b/sections/cper-section-arm.c
new file mode 100644
index 0000000..4dcb6c3
--- /dev/null
+++ b/sections/cper-section-arm.c
@@ -0,0 +1,48 @@
+/**
+ * Describes functions for converting ARM 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-arm.h"
+
+//Converts the given processor-generic CPER section into JSON IR.
+json_object* cper_section_arm_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor)
+{
+    EFI_ARM_PROCESSOR_ERROR_RECORD* record = (EFI_ARM_PROCESSOR_ERROR_RECORD*)section;
+    json_object* section_ir = json_object_new_object();
+    
+    //Validation bits.
+    json_object* validation = bitfield_to_ir(record->ValidFields, 4, ARM_PROCESSOR_ERROR_VALID_BITFIELD_NAMES);
+    json_object_object_add(section_ir, "validationBits", validation);
+
+    //Number of error info and context info structures, and length.
+    json_object_object_add(section_ir, "errorInfoNum", json_object_new_int(record->ErrInfoNum));
+    json_object_object_add(section_ir, "contextInfoNum", json_object_new_int(record->ContextInfoNum));
+    json_object_object_add(section_ir, "sectionLength", json_object_new_int(record->SectionLength));
+
+    //Error affinity.
+    json_object* error_affinity = json_object_new_object();
+    json_object_object_add(error_affinity, "value", json_object_new_int(record->ErrorAffinityLevel));
+    json_object_object_add(error_affinity, "type", 
+        json_object_new_string(record->ErrorAffinityLevel < 4 ? "Vendor Defined" : "Reserved"));
+    json_object_object_add(section_ir, "errorAffinity", error_affinity);
+
+    //Processor ID (MPIDR_EL1) and chip ID (MIDR_EL1).
+    json_object_object_add(section_ir, "mpidrEl1", json_object_new_uint64(record->MPIDR_EL1));
+    json_object_object_add(section_ir, "midrEl1", json_object_new_uint64(record->MIDR_EL1));
+
+    //Whether the processor is running, and the state of it if so.
+    json_object_object_add(section_ir, "running", json_object_new_boolean(record->RunningState));
+    if (record->RunningState)
+    {
+        //...       
+    }
+
+    return section_ir;
+}
\ No newline at end of file
diff --git a/sections/cper-section-arm.h b/sections/cper-section-arm.h
new file mode 100644
index 0000000..2112442
--- /dev/null
+++ b/sections/cper-section-arm.h
@@ -0,0 +1,12 @@
+#ifndef CPER_SECTION_ARM_H
+#define CPER_SECTION_ARM_H
+
+#include "json.h"
+#include "../edk/Cper.h"
+
+#define ARM_PROCESSOR_ERROR_VALID_BITFIELD_NAMES (const char*[]) \
+    {"mpidrValid", "errorAffinityLevelValid", "runningStateValid", "vendorSpecificInfoValid"}
+    
+json_object* cper_section_arm_to_ir(void* section, EFI_ERROR_SECTION_DESCRIPTOR* descriptor);
+
+#endif
\ No newline at end of file
diff --git a/sections/cper-section-ia32x64.c b/sections/cper-section-ia32x64.c
index 187446a..cb56ed7 100644
--- a/sections/cper-section-ia32x64.c
+++ b/sections/cper-section-ia32x64.c
@@ -28,11 +28,11 @@
 
     //Flags.
     json_object* flags = json_object_new_object();
-    json_object_object_add(flags, "localAPICIDValid", json_object_new_boolean(record->ValidFields >> 31));
-    json_object_object_add(flags, "cpuIDInfoValid", json_object_new_boolean((record->ValidFields >> 30) & 0b1));
-    int processor_error_info_num = (record->ValidFields >> 29) & 0b111111;
+    json_object_object_add(flags, "localAPICIDValid", json_object_new_boolean(record->ValidFields & 0b1));
+    json_object_object_add(flags, "cpuIDInfoValid", json_object_new_boolean((record->ValidFields >> 1) & 0b1));
+    int processor_error_info_num = (record->ValidFields >> 2) & 0b111111;
     json_object_object_add(flags, "processorErrorInfoNum", json_object_new_int(processor_error_info_num));
-    int processor_context_info_num = (record->ValidFields >> 23) & 0b111111;
+    int processor_context_info_num = (record->ValidFields >> 8) & 0b111111;
     json_object_object_add(flags, "processorContextInfoNum", json_object_new_int(processor_context_info_num));
     json_object_object_add(record_ir, "flags", flags);