refactor(smc_fuzz): performance enhancement

Add the ability to return integer rather than string from fuzzer
function. This will improve performance especially for larger fuzz
based testing. This will work in tandem with the changes to the CI where
the script flows provide additional support for the change. Modifications
to the device tree files have been made to prevent name clashes with
the function names.

Change-Id: I95aaf23c95943f944d5837e2a8440514aafd6dde
Signed-off-by: mardyk01 <mark.dykes@arm.com>
diff --git a/smc_fuzz/include/fifo3d.h b/smc_fuzz/include/fifo3d.h
index c04567c..95ebb4a 100644
--- a/smc_fuzz/include/fifo3d.h
+++ b/smc_fuzz/include/fifo3d.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2024, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -18,22 +18,28 @@
 	char ***nnfifo;
 	char ***fnamefifo;
 	int **biasfifo;
+	int **fidfifo;
 	int col;
 	int curr_col;
 	int *row;
 };
 
 /*
- * Push function name string into raw data structure
+ * Push function name string into the raw data structure
  */
 void push_3dfifo_fname(struct fifo3d *f3d, char *fname);
 
 /*
- * Push bias value into raw data structure
+ * Push bias value into the raw data structure
  */
 void push_3dfifo_bias(struct fifo3d *f3d, int bias);
 
 /*
+ * Push id for function value into the raw data structure
+ */
+void push_3dfifo_fid(struct fifo3d *f3d, int id);
+
+/*
  * Create new column and/or row for raw data structure for newly
  * found node from device tree
  */
diff --git a/smc_fuzz/include/nfifo.h b/smc_fuzz/include/nfifo.h
new file mode 100644
index 0000000..cef07da
--- /dev/null
+++ b/smc_fuzz/include/nfifo.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2024, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+
+#ifndef NFIFO_H
+#define NFIFO_H
+
+#define CMP_SUCCESS 0
+#define NFIFO_Q_THRESHOLD 10
+
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "smcmalloc.h"
+
+struct nfifo {
+	char **lnme;
+	int nent;
+	int thent;
+};
+
+void nfifoinit(struct nfifo *nf, struct memmod *mmod);
+void pushnme(char *nme, struct nfifo *nf, struct memmod *mmod);
+char *readnme(int ent, struct nfifo *nf, struct memmod *mmod);
+int searchnme(char *nme, struct nfifo *nf, struct memmod *mmod);
+void printent(struct nfifo *nf);
+
+#endif /* NFIFO_H */
diff --git a/smc_fuzz/include/sdei_fuzz_helper.h b/smc_fuzz/include/sdei_fuzz_helper.h
index 71d462d..cf4ddd1 100644
--- a/smc_fuzz/include/sdei_fuzz_helper.h
+++ b/smc_fuzz/include/sdei_fuzz_helper.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023, Arm Limited. All rights reserved.
+ * Copyright (c) 2024, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -11,6 +11,29 @@
 #include <tftf_lib.h>
 #include <timer.h>
 
-void tftf_test_sdei_noarg(int64_t (*sdei_func)(void), char *);
+#ifndef sdei_version_funcid
+#define sdei_version_funcid 0
+#endif
+#ifndef sdei_pe_unmask_funcid
+#define sdei_pe_unmask_funcid 0
+#endif
+#ifndef sdei_pe_mask_funcid
+#define sdei_pe_mask_funcid 0
+#endif
+#ifndef sdei_event_status_funcid
+#define sdei_event_status_funcid 0
+#endif
+#ifndef sdei_event_signal_funcid
+#define sdei_event_signal_funcid 0
+#endif
+#ifndef sdei_private_reset_funcid
+#define sdei_private_reset_funcid 0
+#endif
+#ifndef sdei_shared_reset_funcid
+#define sdei_shared_reset_funcid 0
+#endif
+
+
+void tftf_test_sdei_noarg(int64_t (*sdei_func)(void), char *funcstr);
 void tftf_test_sdei_singlearg(int64_t (*sdei_func)(uint64_t), char *funcstr);
-void run_sdei_fuzz(char *);
+void run_sdei_fuzz(int funcid);
diff --git a/smc_fuzz/include/smcmalloc.h b/smc_fuzz/include/smcmalloc.h
index 129e07c..fe134bf 100644
--- a/smc_fuzz/include/smcmalloc.h
+++ b/smc_fuzz/include/smcmalloc.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2024, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -11,7 +11,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "fifo3d.h"
 
 #define TOTALMEMORYSIZE (0x10000)
 #define BLKSPACEDIV (4)
diff --git a/smc_fuzz/include/tsp_fuzz_helper.h b/smc_fuzz/include/tsp_fuzz_helper.h
index 444d54b..019ee68 100644
--- a/smc_fuzz/include/tsp_fuzz_helper.h
+++ b/smc_fuzz/include/tsp_fuzz_helper.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023, Arm Limited. All rights reserved.
+ * Copyright (c) 2024, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -11,5 +11,18 @@
 #include <tftf_lib.h>
 #include <timer.h>
 
-void tftf_test_tsp_smc(uint64_t tsp_id, char *);
-void run_tsp_fuzz(char *);
+#ifndef tsp_add_op_funcid
+#define tsp_add_op_funcid 0
+#endif
+#ifndef tsp_sub_op_funcid
+#define tsp_sub_op_funcid 0
+#endif
+#ifndef tsp_mul_op_funcid
+#define tsp_mul_op_funcid 0
+#endif
+#ifndef tsp_div_op_funcid
+#define tsp_div_op_funcid 0
+#endif
+
+void tftf_test_tsp_smc(uint64_t tsp_id, char *funcstr);
+void run_tsp_fuzz(int funcid);