blob: 7ef55e84c6e429135e9b3d7a7e724c7a0ef5036e [file] [log] [blame]
mardyk0182389fb2023-09-25 16:34:56 -05001/*
mardyk017b51dbe2024-01-17 15:25:36 -06002 * Copyright (c) 2024, Arm Limited. All rights reserved.
mardyk0182389fb2023-09-25 16:34:56 -05003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Mark Dykes2b6c1402025-03-06 10:01:19 -06007#include <arg_struct_def.h>
Kathleen Capellafb96b982024-04-25 17:09:33 -05008#include <ffa_fuzz_helper.h>
mardyk01f5b46352023-10-24 16:23:23 -05009#include <sdei_fuzz_helper.h>
Mark Dykes50297972024-03-15 12:49:22 -050010#include "smcmalloc.h"
mardyk01f5b46352023-10-24 16:23:23 -050011#include <tsp_fuzz_helper.h>
mardyk0182389fb2023-09-25 16:34:56 -050012
Alex Liang0fa7d212024-06-18 11:17:01 -050013int cntid = 0;
Alex Liang1d40d722024-07-23 16:42:16 -050014#include <vendor_fuzz_helper.h>
15
mardyk0182389fb2023-09-25 16:34:56 -050016/*
17 * Invoke the SMC call based on the function name specified.
18 */
Mark Dykes50297972024-03-15 12:49:22 -050019void runtestfunction(int funcid, struct memmod *mmod)
mardyk0182389fb2023-09-25 16:34:56 -050020{
Alex Liang0fa7d212024-06-18 11:17:01 -050021 bool inrange = (cntid >= SMC_FUZZ_CALL_START) && (cntid < SMC_FUZZ_CALL_END);
22 inrange = inrange && (funcid != EXCLUDE_FUNCID);
Mark Dykes2b6c1402025-03-06 10:01:19 -060023#ifdef SDEI_INCLUDE
Alex Liang0fa7d212024-06-18 11:17:01 -050024 run_sdei_fuzz(funcid, mmod, inrange, cntid);
Mark Dykes2b6c1402025-03-06 10:01:19 -060025#endif
Kathleen Capellafb96b982024-04-25 17:09:33 -050026#ifdef FFA_INCLUDE
27 run_ffa_fuzz(funcid, mmod);
28#endif
mardyk017b51dbe2024-01-17 15:25:36 -060029 run_tsp_fuzz(funcid);
Mark Dykes2b6c1402025-03-06 10:01:19 -060030#ifdef VEN_INCLUDE
Alex Liang1d40d722024-07-23 16:42:16 -050031 run_ven_el3_fuzz(funcid, mmod);
Mark Dykes2b6c1402025-03-06 10:01:19 -060032#endif
Alex Liang0fa7d212024-06-18 11:17:01 -050033
34 cntid++;
mardyk0182389fb2023-09-25 16:34:56 -050035}