mardyk01 | f5b4635 | 2023-10-24 16:23:23 -0500 | [diff] [blame] | 1 | /* |
mardyk01 | 7b51dbe | 2024-01-17 15:25:36 -0600 | [diff] [blame] | 2 | * Copyright (c) 2024, Arm Limited. All rights reserved. |
mardyk01 | f5b4635 | 2023-10-24 16:23:23 -0500 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <fuzz_helper.h> |
Mark Dykes | 5029797 | 2024-03-15 12:49:22 -0500 | [diff] [blame] | 8 | #include "smcmalloc.h" |
| 9 | |
mardyk01 | f5b4635 | 2023-10-24 16:23:23 -0500 | [diff] [blame] | 10 | #include <power_management.h> |
| 11 | #include <sdei.h> |
| 12 | #include <test_helpers.h> |
| 13 | #include <tftf_lib.h> |
| 14 | #include <timer.h> |
| 15 | |
mardyk01 | 7b51dbe | 2024-01-17 15:25:36 -0600 | [diff] [blame] | 16 | #ifndef sdei_version_funcid |
| 17 | #define sdei_version_funcid 0 |
| 18 | #endif |
| 19 | #ifndef sdei_pe_unmask_funcid |
| 20 | #define sdei_pe_unmask_funcid 0 |
| 21 | #endif |
| 22 | #ifndef sdei_pe_mask_funcid |
| 23 | #define sdei_pe_mask_funcid 0 |
| 24 | #endif |
| 25 | #ifndef sdei_event_status_funcid |
| 26 | #define sdei_event_status_funcid 0 |
| 27 | #endif |
| 28 | #ifndef sdei_event_signal_funcid |
| 29 | #define sdei_event_signal_funcid 0 |
| 30 | #endif |
| 31 | #ifndef sdei_private_reset_funcid |
| 32 | #define sdei_private_reset_funcid 0 |
| 33 | #endif |
| 34 | #ifndef sdei_shared_reset_funcid |
| 35 | #define sdei_shared_reset_funcid 0 |
| 36 | #endif |
| 37 | |
| 38 | |
Alex Liang | 0fa7d21 | 2024-06-18 11:17:01 -0500 | [diff] [blame^] | 39 | #ifndef sdei_event_register_funcid |
| 40 | #define sdei_event_register_funcid 0 |
| 41 | #endif |
| 42 | #ifndef sdei_event_enable_funcid |
| 43 | #define sdei_event_enable_funcid 0 |
| 44 | #endif |
| 45 | #ifndef sdei_event_disable_funcid |
| 46 | #define sdei_event_disable_funcid 0 |
| 47 | #endif |
| 48 | #ifndef sdei_event_context_funcid |
| 49 | #define sdei_event_context_funcid 0 |
| 50 | #endif |
| 51 | #ifndef sdei_event_complete_funcid |
| 52 | #define sdei_event_complete_funcid 0 |
| 53 | #endif |
| 54 | #ifndef sdei_event_complete_and_resume_funcid |
| 55 | #define sdei_event_complete_and_resume_funcid 0 |
| 56 | #endif |
| 57 | #ifndef sdei_event_unregister_funcid |
| 58 | #define sdei_event_unregister_funcid 0 |
| 59 | #endif |
| 60 | #ifndef sdei_event_get_info_funcid |
| 61 | #define sdei_event_get_info_funcid 0 |
| 62 | #endif |
| 63 | #ifndef sdei_event_routing_set_funcid |
| 64 | #define sdei_event_routing_set_funcid 0 |
| 65 | #endif |
| 66 | #ifndef sdei_interrupt_bind_funcid |
| 67 | #define sdei_interrupt_bind_funcid 0 |
| 68 | #endif |
| 69 | #ifndef sdei_interrupt_release_funcid |
| 70 | #define sdei_interrupt_release_funcid 0 |
| 71 | #endif |
| 72 | #ifndef sdei_features_funcid |
| 73 | #define sdei_features_funcid 0 |
| 74 | #endif |
| 75 | #ifndef sdei_signal_hang_funcid |
| 76 | #define sdei_signal_hang_funcid 0 |
| 77 | #endif |
| 78 | #ifndef experiment_funcid |
| 79 | #define experiment_funcid 0 |
| 80 | #endif |
| 81 | #ifndef repeat_interrupt_bind_funcid |
| 82 | #define repeat_interrupt_bind_funcid 0 |
| 83 | #endif |
| 84 | #ifndef sdei_event_get_info_coverage_funcid |
| 85 | #define sdei_event_get_info_coverage_funcid 0 |
| 86 | #endif |
| 87 | #ifndef sdei_routing_set_coverage_funcid |
| 88 | #define sdei_routing_set_coverage_funcid 0 |
| 89 | #endif |
| 90 | #ifndef test_funcid |
| 91 | #define test_funcid 0 |
| 92 | #endif |
| 93 | |
| 94 | |
| 95 | int64_t tftf_test_sdei_noarg(int64_t (*sdei_func)(void), char *funcstr); |
mardyk01 | f5b4635 | 2023-10-24 16:23:23 -0500 | [diff] [blame] | 96 | void tftf_test_sdei_singlearg(int64_t (*sdei_func)(uint64_t), char *funcstr); |
Alex Liang | 0fa7d21 | 2024-06-18 11:17:01 -0500 | [diff] [blame^] | 97 | void run_sdei_fuzz(int funcid, struct memmod *mmod, bool inrange, int cntid); |
| 98 | char *return_str(int64_t ret); |
| 99 | void print_ret(char *funcstr, int64_t ret); |