test(fuzzing): adding variable coverage

Adding the capability to produce coverage of the arguments of the
SMC calls as generated by the fuzzer.  The output from the FVP will
be routed to UART3 where a python flow will read the data to create
tables of each SMC call with its fields shown and values given.  The
option is enabled by adding SMC_FUZZ_VARIABLE_COVERAGE=1 to the
corresponding TFTF config.

Change-Id: I2d4d310976aa2c0447efbd8ec0676bb9f8699828
Signed-off-by: Mark Dykes <mark.dykes@arm.com>
diff --git a/lib/libc/putchar.c b/lib/libc/putchar.c
index 037e28a..de69f5c 100644
--- a/lib/libc/putchar.c
+++ b/lib/libc/putchar.c
@@ -11,10 +11,24 @@
 int putchar(int c)
 {
 	int res;
+#ifdef SMC_FUZZ_VARIABLE_COVERAGE
+	if(tftf_get_console_state() == CONSOLE_FLAG_SMC_FUZZER) {
+		if (console_putc_fuzzer((unsigned char)c) >= 0)
+			res = c;
+		else
+			res = EOF;
+	}
+	else {
+		if (console_putc((unsigned char)c) >= 0)
+			res = c;
+		else
+			res = EOF;
+	}
+#else
 	if (console_putc((unsigned char)c) >= 0)
 		res = c;
 	else
 		res = EOF;
-
+#endif
 	return res;
 }