Add "cper-generate", update README, fix minor bugs.
diff --git a/generator/gen-utils.c b/generator/gen-utils.c
new file mode 100644
index 0000000..a0f6e3c
--- /dev/null
+++ b/generator/gen-utils.c
@@ -0,0 +1,32 @@
+/**
+ * Utility functions to assist in generating psuedo-random CPER sections.
+ *
+ * Author: Lawrence.Tang@arm.com
+ **/
+#include <stdlib.h>
+#include <time.h>
+#include "../edk/BaseTypes.h"
+#include "gen-utils.h"
+
+//Generates a random section of the given byte size, saving the result to the given location.
+//Returns the length of the section as passed in.
+size_t generate_random_section(void** location, size_t size)
+{
+ *location = generate_random_bytes(size);
+ return size;
+}
+
+//Generates a random byte allocation of the given size.
+UINT8* generate_random_bytes(size_t size)
+{
+ UINT8* bytes = malloc(size);
+ for (size_t i = 0; i < size; i++)
+ bytes[i] = rand();
+ return bytes;
+}
+
+//Initializes the random seed for rand() using the current time.
+void init_random()
+{
+ srand((unsigned int)time(NULL));
+}
\ No newline at end of file