diff --git a/apps/uefi/acs.h b/apps/uefi/acs.h index 178cdb59..973a5ad7 100644 --- a/apps/uefi/acs.h +++ b/apps/uefi/acs.h @@ -157,6 +157,7 @@ extern UINT64 g_exception_ret_addr; extern UINT64 g_ret_addr; extern UINT32 g_timeout_pass; extern UINT32 g_timeout_fail; +extern UINT32 g_timer_timeout_us; /* Timer timeout (us) */ extern UINT32 g_build_sbsa; extern UINT32 g_build_pcbsa; extern UINT32 g_print_mmio; diff --git a/apps/uefi/acs_globals.c b/apps/uefi/acs_globals.c index 456ca7d6..08ebced4 100644 --- a/apps/uefi/acs_globals.c +++ b/apps/uefi/acs_globals.c @@ -34,6 +34,7 @@ UINT64 g_exception_ret_addr; UINT64 g_ret_addr; UINT32 g_timeout_pass; UINT32 g_timeout_fail; +UINT32 g_timer_timeout_us; /* Timer timeout (us) */ /* Following g_build_* is retained to have compatibility with tests which use it, and used pass on -a selection hint to tests */ diff --git a/apps/uefi/acs_helpers.c b/apps/uefi/acs_helpers.c index 71909ff7..a6e33ffc 100644 --- a/apps/uefi/acs_helpers.c +++ b/apps/uefi/acs_helpers.c @@ -550,6 +550,7 @@ command_init (void) if (CmdLineArg == NULL) { g_timeout_pass = WAKEUP_WD_PASS_TIMEOUT_DEFAULT; g_timeout_fail = g_timeout_pass * WAKEUP_WD_FAILSAFE_TIMEOUT_MULTIPLIER; + g_timer_timeout_us = TIMER_TIMEOUT_DEFAULT; } else { /* Accept a single value; ignore any trailing delimiters */ CHAR16 buf[64]; @@ -581,8 +582,9 @@ command_init (void) g_timeout_pass = (UINT32)StrDecimalToUintn(buf); g_timeout_fail = g_timeout_pass * WAKEUP_WD_FAILSAFE_TIMEOUT_MULTIPLIER; - if (!(g_timeout_pass >= WAKEUP_WD_PASS_TIMEOUT_THRESHOLD && - g_timeout_pass <= WAKEUP_WD_PASS_TIMEOUT_MAX_THRESHOLD)) { + g_timer_timeout_us = g_timeout_pass; + if (!(g_timeout_pass >= TIMEOUT_THRESHOLD && + g_timeout_pass <= TIMEOUT_MAX_THRESHOLD)) { Print(L"Invalid -timeout: pass timeout range should be within 500ms and 2sec\n"); return SHELL_INVALID_PARAMETER; } diff --git a/apps/uefi/bsa_main.c b/apps/uefi/bsa_main.c index fff98439..eb367913 100644 --- a/apps/uefi/bsa_main.c +++ b/apps/uefi/bsa_main.c @@ -99,8 +99,8 @@ HelpMsg (VOID) "-skipmodule \n" " Skip the specified modules (comma-separated names).\n" " Example: -skipmodule PE,GIC,PCIE\n" - "-timeout \n" - " Set pass timeout (in microseconds) for wakeup tests (500 us - 2 sec)\n" + "-timeout \n" + " Set pass timeout (delay in microseconds) for wakeup & WD & timer tests (500us - 2sec)\n" " Example: -timeout 2000 \n" "-v Verbosity of the prints\n" " 1 prints all, 5 prints only the errors\n"); diff --git a/apps/uefi/mem_test_main.c b/apps/uefi/mem_test_main.c index 8aa6b6d3..12184989 100644 --- a/apps/uefi/mem_test_main.c +++ b/apps/uefi/mem_test_main.c @@ -52,6 +52,7 @@ UINT64 g_exception_ret_addr; UINT64 g_ret_addr; UINT32 g_timeout_pass; UINT32 g_timeout_fail; +UINT32 g_timer_timeout_us; UINT32 g_build_sbsa = 0; UINT32 g_build_pcbsa = 0; UINT32 g_print_mmio; @@ -123,8 +124,8 @@ HelpMsg ( "-no_crypto_ext Pass this flag if cryptography extension not supported due to export restrictions\n" "-p2p Pass this flag to indicate that PCIe Hierarchy Supports Peer-to-Peer\n" "-cache Pass this flag to indicate that if the test system supports PCIe address translation cache\n" - "-timeout \n" - " Set pass timeout (in microseconds) for wakeup tests (500 us - 2 sec)\n" + "-timeout \n" + " Set pass timeout (delay in microseconds) for wakeup & WD & timer tests (500us - 2sec)\n" " Example: -timeout 2000 \n" "-os Enable the execution of operating system tests\n" "-hyp Enable the execution of hypervisor tests\n" @@ -235,6 +236,7 @@ command_init () if (CmdLineArg == NULL) { g_timeout_pass = WAKEUP_WD_PASS_TIMEOUT_DEFAULT; g_timeout_fail = g_timeout_pass * WAKEUP_WD_FAILSAFE_TIMEOUT_MULTIPLIER; + g_timer_timeout_us = TIMER_TIMEOUT_DEFAULT; } else { /* Accept a single value; ignore any trailing delimiters */ CHAR16 buf[64]; @@ -266,8 +268,9 @@ command_init () g_timeout_pass = (UINT32)StrDecimalToUintn(buf); g_timeout_fail = g_timeout_pass * WAKEUP_WD_FAILSAFE_TIMEOUT_MULTIPLIER; - if (!(g_timeout_pass >= WAKEUP_WD_PASS_TIMEOUT_THRESHOLD && - g_timeout_pass <= WAKEUP_WD_PASS_TIMEOUT_MAX_THRESHOLD)) { + g_timer_timeout_us = g_timeout_pass; + if (!(g_timeout_pass >= TIMEOUT_THRESHOLD && + g_timeout_pass <= TIMEOUT_MAX_THRESHOLD)) { Print(L"Invalid -timeout: pass timeout range should be within 500ms and 2sec\n"); return SHELL_INVALID_PARAMETER; } diff --git a/apps/uefi/pc_bsa_main.c b/apps/uefi/pc_bsa_main.c index f1f4a93d..e800f546 100644 --- a/apps/uefi/pc_bsa_main.c +++ b/apps/uefi/pc_bsa_main.c @@ -78,8 +78,8 @@ HelpMsg (VOID) "-skipmodule \n" " Skip the specified modules (comma-separated names).\n" " Example: -skipmodule PE,GIC,PCIE\n" - "-timeout \n" - " Set pass timeout (in microseconds) for wakeup tests (500 us - 2 sec)\n" + "-timeout \n" + " Set pass timeout (delay in microseconds) for wakeup & WD & timer tests (500us - 2sec)\n" " Example: -timeout 2000 \n" "-v Verbosity of the prints\n" " 1 prints all, 5 prints only the errors\n"); diff --git a/apps/uefi/sbsa_main.c b/apps/uefi/sbsa_main.c index af5f17e9..d6844624 100644 --- a/apps/uefi/sbsa_main.c +++ b/apps/uefi/sbsa_main.c @@ -92,8 +92,8 @@ HelpMsg (VOID) " Example: -skipmodule PE,GIC,PCIE\n" "-slc Provide system last level cache type\n" " 1 - PPTT PE-side cache, 2 - HMAT mem-side cache\n" - "-timeout \n" - " Set pass timeout (in microseconds) for wakeup tests (500 us - 2 sec)\n" + "-timeout \n" + " Set pass timeout (delay in microseconds) for wakeup & WD & timer tests (500us - 2sec)\n" " Example: -timeout 2000 \n" "-v Verbosity of the prints\n" " 1 prints all, 5 prints only the errors\n"); diff --git a/apps/uefi/sbsa_nist_main.c b/apps/uefi/sbsa_nist_main.c index 09e20d16..0c7694e1 100644 --- a/apps/uefi/sbsa_nist_main.c +++ b/apps/uefi/sbsa_nist_main.c @@ -51,7 +51,9 @@ UINT32 g_crypto_support = TRUE; UINT64 g_stack_pointer; UINT64 g_exception_ret_addr; UINT64 g_ret_addr; -UINT32 g_wakeup_timeout; +UINT32 g_timeout_pass; +UINT32 g_timeout_fail; +UINT32 g_timer_timeout_us; UINT32 g_its_init = 0; UINT32 g_sys_last_lvl_cache; SHELL_FILE_HANDLE g_acs_log_file_handle; @@ -351,8 +353,8 @@ HelpMsg ( "-no_crypto_ext Pass this flag if cryptography extension not supported due to export restrictions\n" "-p2p Pass this flag to indicate that PCIe Hierarchy Supports Peer-to-Peer\n" "-cache Pass this flag to indicate that if the test system supports PCIe address translation cache\n" - "-timeout \n" - " Set pass timeout (in microseconds) for wakeup tests (500 us - 2 sec)\n" + "-timeout \n" + " Set pass timeout (delay in microseconds) for wakeup & WD & timer tests (500us - 2sec)\n" " Example: -timeout 2000 \n" "-slc Provide system last level cache type\n" " 1 - PPTT PE-side cache, 2 - HMAT mem-side cache\n" @@ -441,16 +443,52 @@ command_init () } } - // Options with Values + /* Parse -timeout */ CmdLineArg = ShellCommandLineGetValue (ParamPackage, L"-timeout"); if (CmdLineArg == NULL) { - g_wakeup_timeout = 1; + g_timeout_pass = WAKEUP_WD_PASS_TIMEOUT_DEFAULT; + g_timeout_fail = g_timeout_pass * WAKEUP_WD_FAILSAFE_TIMEOUT_MULTIPLIER; + g_timer_timeout_us = TIMER_TIMEOUT_DEFAULT; } else { - g_wakeup_timeout = StrDecimalToUintn(CmdLineArg); - Print(L"Wakeup timeout multiple %d.\n", g_wakeup_timeout); - if (g_wakeup_timeout > 5) - g_wakeup_timeout = 5; - } + /* Accept a single value; ignore any trailing delimiters */ + CHAR16 buf[64]; + UINTN len = StrLen(CmdLineArg); + UINTN i; + + if (len >= (sizeof(buf) / sizeof(buf[0]))) + len = (sizeof(buf) / sizeof(buf[0])) - 1; + + for (i = 0; i < len; i++) { + buf[i] = CmdLineArg[i]; + } + buf[i] = L'\0'; + + if (i == 0) { + Print(L"Invalid -timeout: provide a timeout value\n"); + return SHELL_INVALID_PARAMETER; + } + + /* trim leading/trailing spaces */ + while (buf[0] == L' ' || buf[0] == L'\t') { + for (i = 0; buf[i] != L'\0'; i++) buf[i] = buf[i + 1]; + } + i = StrLen(buf); + while (i > 0 && (buf[i - 1] == L' ' || buf[i - 1] == L'\t')) { + buf[i - 1] = L'\0'; + i--; + } + + g_timeout_pass = (UINT32)StrDecimalToUintn(buf); + g_timeout_fail = g_timeout_pass * WAKEUP_WD_FAILSAFE_TIMEOUT_MULTIPLIER; + g_timer_timeout_us = g_timeout_pass; + if (!(g_timeout_pass >= TIMEOUT_THRESHOLD && + g_timeout_pass <= TIMEOUT_MAX_THRESHOLD)) { + Print(L"Invalid -timeout: pass timeout range should be within 500ms and 2sec\n"); + return SHELL_INVALID_PARAMETER; + } + + Print(L"Timeouts (us): PASS=%d, FAIL=%d\n", g_timeout_pass, g_timeout_fail); + } // Options with Values CmdLineArg = ShellCommandLineGetValue (ParamPackage, L"-v"); diff --git a/apps/uefi/vbsa_main.c b/apps/uefi/vbsa_main.c index d676730b..ab9613b1 100644 --- a/apps/uefi/vbsa_main.c +++ b/apps/uefi/vbsa_main.c @@ -86,8 +86,8 @@ HelpMsg (VOID) " Example: -skip B_PE_01,B_GIC_02\n" "-skip-dp-nic-ms \n" " Skip PCIe tests for DisplayPort, Network, Mass Storage devices and Unclassified devices\n" - "-timeout \n" - " Set pass timeout (in microseconds) for wakeup tests (500 us - 2 sec)\n" + "-timeout \n" + " Set pass timeout (delay in microseconds) for wakeup & WD & timer tests (500us - 2sec)\n" " Example: -timeout 2000 \n" "-v Verbosity of the prints\n" " 1 prints all, 5 prints only the errors\n"); diff --git a/apps/uefi/xbsa_main.c b/apps/uefi/xbsa_main.c index c580e146..a2a06602 100644 --- a/apps/uefi/xbsa_main.c +++ b/apps/uefi/xbsa_main.c @@ -119,8 +119,8 @@ HelpMsg (VOID) "-skipmodule \n" " Skip the specified modules (comma-separated names).\n" " Example: -skipmodule PE,GIC,PCIE\n" - "-timeout \n" - " Set pass timeout (in microseconds) for wakeup tests (500 us - 2 sec)\n" + "-timeout \n" + " Set pass timeout (delay in microseconds) for wakeup & WD & timer tests (500us - 2sec)\n" " Example: -timeout 2000 \n" "-v Verbosity of the prints\n" " 1 prints all, 5 prints only the errors\n" diff --git a/docs/common/cli_args.md b/docs/common/cli_args.md index 7c4658df..ec63a34d 100644 --- a/docs/common/cli_args.md +++ b/docs/common/cli_args.md @@ -29,7 +29,7 @@ semantics so individual READMEs can simply reference it. | `-skip-dp-nic-ms` | All | Skip PCIe exerciser coverage for DisplayPort, network, and mass-storage devices when those endpoints are unavailable. | | `-skipmodule ` | All | Exclude the listed modules from the run (for example, `-skipmodule PE,GIC`). | | `-slc ` | SBSA | Provide the system last-level cache implementation (`1` for PPTT PE-side cache, `2` for HMAT memory-side cache). | -| `-timeout <500-2000>` | All | Set pass timeout (in microseconds) for wakeup and watchdog tests (1ms = default, 500us = minimum, 2sec = maximum delay). | +| `-timeout ` | All | Set pass timeout (delay in microseconds) for wakeup and watchdog and & timer tests (1ms = wakeup & WD default , 1sec = timer default, 500us = minimum, 2sec = maximum delay). | | `-v ` | All | Set verbosity: 5=ERROR, 4=WARN, 3=TEST, 2=DEBUG, 1=INFO. | Refer to each specification README for other variant-level constraints, rule diff --git a/pal/baremetal/target/RDN2/include/platform_override_fvp.h b/pal/baremetal/target/RDN2/include/platform_override_fvp.h index d46380ca..fea43506 100644 --- a/pal/baremetal/target/RDN2/include/platform_override_fvp.h +++ b/pal/baremetal/target/RDN2/include/platform_override_fvp.h @@ -261,8 +261,10 @@ #define PLATFORM_OVERRIDE_MAX_SID 24 -/* TIMEOUT should be in Microsecond 5us to 2 sec */ +/* Wakeup/WD timeout (us); range 500us to 2 sec */ #define PLATFORM_OVERRIDE_TIMEOUT 1000 /* time out for DUT */ +/* Timer test timeout (us); range 500us to 2 sec */ +#define PLATFORM_OVERRIDE_TIMER_TIMEOUT 10000 /* FAIL safe timeout (> PLATFORM_OVERRIDE_TIMEOUT) */ #define PLATFORM_OVERRIDE_FAILSAFE_TIMEOUT (PLATFORM_OVERRIDE_TIMEOUT * 2) diff --git a/pal/baremetal/target/RDN2/src/platform_cfg_fvp.c b/pal/baremetal/target/RDN2/src/platform_cfg_fvp.c index 5ed9fe66..28edddee 100644 --- a/pal/baremetal/target/RDN2/src/platform_cfg_fvp.c +++ b/pal/baremetal/target/RDN2/src/platform_cfg_fvp.c @@ -83,6 +83,7 @@ uint32_t g_sys_last_lvl_cache = PLATFORM_OVERRRIDE_SLC; uint32_t g_timeout_pass = PLATFORM_OVERRIDE_TIMEOUT; uint32_t g_timeout_fail = PLATFORM_OVERRIDE_FAILSAFE_TIMEOUT; +uint32_t g_timer_timeout_us = PLATFORM_OVERRIDE_TIMER_TIMEOUT; /* Timer timeout (us) */ const PE_SMBIOS_PROCESSOR_INFO_TABLE platform_smbios_cfg = { .slot_count = PLATFORM_OVERRIDE_SMBIOS_SLOT_COUNT, diff --git a/pal/baremetal/target/RDV3/include/platform_override_fvp.h b/pal/baremetal/target/RDV3/include/platform_override_fvp.h index 2dffaaaf..ee8e42cd 100644 --- a/pal/baremetal/target/RDV3/include/platform_override_fvp.h +++ b/pal/baremetal/target/RDV3/include/platform_override_fvp.h @@ -295,8 +295,10 @@ // This value is arbitrary and may have to be adjusted #define PLATFORM_BM_OVERRIDE_MAX_IRQ_CNT 0xFFFF /* Max IRQs any device may raise */ -/* TIMEOUT should be in Microsecond 5us to 2 sec */ +/* Wakeup/WD timeout (us); range 500us to 2 sec */ #define PLATFORM_OVERRIDE_TIMEOUT 1000 /* time out for DUT */ +/* Timer test timeout (us); range 500us to 2 sec */ +#define PLATFORM_OVERRIDE_TIMER_TIMEOUT 10000 /* FAIL safe timeout (> PLATFORM_OVERRIDE_TIMEOUT) */ #define PLATFORM_OVERRIDE_FAILSAFE_TIMEOUT (PLATFORM_OVERRIDE_TIMEOUT * 2) diff --git a/pal/baremetal/target/RDV3/src/platform_cfg_fvp.c b/pal/baremetal/target/RDV3/src/platform_cfg_fvp.c index d8ed6a54..48c32c9f 100644 --- a/pal/baremetal/target/RDV3/src/platform_cfg_fvp.c +++ b/pal/baremetal/target/RDV3/src/platform_cfg_fvp.c @@ -83,6 +83,7 @@ uint32_t g_sys_last_lvl_cache = PLATFORM_OVERRRIDE_SLC; uint32_t g_timeout_pass = PLATFORM_OVERRIDE_TIMEOUT; uint32_t g_timeout_fail = PLATFORM_OVERRIDE_FAILSAFE_TIMEOUT; +uint32_t g_timer_timeout_us = PLATFORM_OVERRIDE_TIMER_TIMEOUT; /* Timer timeout (us) */ const PE_SMBIOS_PROCESSOR_INFO_TABLE platform_smbios_cfg = { .slot_count = PLATFORM_OVERRIDE_SMBIOS_SLOT_COUNT, diff --git a/pal/baremetal/target/RDV3CFG1/include/platform_override_fvp.h b/pal/baremetal/target/RDV3CFG1/include/platform_override_fvp.h index 40bde381..b897c38b 100644 --- a/pal/baremetal/target/RDV3CFG1/include/platform_override_fvp.h +++ b/pal/baremetal/target/RDV3CFG1/include/platform_override_fvp.h @@ -244,8 +244,10 @@ // This value is arbitrary and may have to be adjusted #define PLATFORM_BM_OVERRIDE_MAX_IRQ_CNT 0xFFFF /* Max IRQs any device may raise */ -/* TIMEOUT should be in Microsecond 5us to 2 sec */ +/* Wakeup/WD timeout (us); range 500us to 2 sec */ #define PLATFORM_OVERRIDE_TIMEOUT 1000 /* time out for DUT */ +/* Timer test timeout (us); range 500us to 2 sec */ +#define PLATFORM_OVERRIDE_TIMER_TIMEOUT 10000 /* FAIL safe timeout (> PLATFORM_OVERRIDE_TIMEOUT) */ #define PLATFORM_OVERRIDE_FAILSAFE_TIMEOUT (PLATFORM_OVERRIDE_TIMEOUT * 2) diff --git a/pal/baremetal/target/RDV3CFG1/src/platform_cfg_fvp.c b/pal/baremetal/target/RDV3CFG1/src/platform_cfg_fvp.c index 08107029..a5855e50 100644 --- a/pal/baremetal/target/RDV3CFG1/src/platform_cfg_fvp.c +++ b/pal/baremetal/target/RDV3CFG1/src/platform_cfg_fvp.c @@ -83,6 +83,7 @@ uint32_t g_sys_last_lvl_cache = PLATFORM_OVERRRIDE_SLC; uint32_t g_timeout_pass = PLATFORM_OVERRIDE_TIMEOUT; uint32_t g_timeout_fail = PLATFORM_OVERRIDE_FAILSAFE_TIMEOUT; +uint32_t g_timer_timeout_us = PLATFORM_OVERRIDE_TIMER_TIMEOUT; /* Timer timeout (us) */ const PE_SMBIOS_PROCESSOR_INFO_TABLE platform_smbios_cfg = { .slot_count = PLATFORM_OVERRIDE_SMBIOS_SLOT_COUNT, diff --git a/test_pool/timer/t005.c b/test_pool/timer/t005.c index 5b82c371..2e0a9c19 100644 --- a/test_pool/timer/t005.c +++ b/test_pool/timer/t005.c @@ -28,6 +28,7 @@ static uint32_t intid; static uint64_t cnt_base_n; static int irq_received; static uint32_t intid_phy; + static void isr_sys_timer() @@ -58,19 +59,21 @@ payload() uint64_t timer_num, timer_cnt; int32_t status; - uint64_t freq = val_get_counter_frequency(); uint64_t ticks; - + uint32_t pe_timeout_us; /* System timer */ - ticks = freq * 1; - if (ticks > 0xFFFFFFFF) - ticks = 0xFFFFFFFF; + if (g_timer_timeout_us == 0) { + val_print(ERROR, "\n Timer timeout is zero; configure a valid timeout"); + val_set_status(index, RESULT_FAIL(3)); + return; + } + ticks = CEIL_TO_MAX_SYS_TIMEOUT(val_get_timeout_to_ticks(g_timer_timeout_us)); sys_timer_ticks = (uint32_t)ticks; /* PE timer */ - ticks = freq * 2; - if (ticks > 0xFFFFFFFF) - ticks = 0xFFFFFFFF; + pe_timeout_us = g_timer_timeout_us * 2; + + ticks = CEIL_TO_MAX_SYS_TIMEOUT(val_get_timeout_to_ticks(pe_timeout_us)); pe_timer_ticks = (uint32_t)ticks; timer_num = val_timer_get_info(TIMER_INFO_NUM_PLATFORM_TIMERS, 0); diff --git a/val/include/acs_cfg.h b/val/include/acs_cfg.h index c9182627..d01be956 100644 --- a/val/include/acs_cfg.h +++ b/val/include/acs_cfg.h @@ -46,6 +46,7 @@ extern uint32_t g_crypto_support; extern uint32_t g_drtm_acs_dlme[]; extern uint64_t g_drtm_acs_dlme_size; extern uint32_t g_el1skiptrap_mask; +extern uint32_t g_timer_timeout_us; #endif diff --git a/val/include/pal_interface.h b/val/include/pal_interface.h index ba4a4107..ba2a5bd2 100644 --- a/val/include/pal_interface.h +++ b/val/include/pal_interface.h @@ -64,7 +64,7 @@ #define TIMEOUT_LARGE PLATFORM_BM_OVERRIDE_TIMEOUT_LARGE #define TIMEOUT_MEDIUM PLATFORM_BM_OVERRIDE_TIMEOUT_MEDIUM #define TIMEOUT_SMALL PLATFORM_BM_OVERRIDE_TIMEOUT_SMALL - #define WAKEUP_WD_SYS_TIMEOUT_MAX PLATFORM_OVERRIDE_SYS_TIMEOUT_MAX + #define SYS_TIMEOUT_MAX PLATFORM_OVERRIDE_SYS_TIMEOUT_MAX #endif // TARGET_BAREMETAL #ifdef TARGET_LINUX @@ -86,7 +86,7 @@ #define MMU_PGT_IAS 48 #define MMU_PGT_OAS 48 - #define WAKEUP_WD_SYS_TIMEOUT_MAX 0XFFFFFFFF + #define SYS_TIMEOUT_MAX 0XFFFFFFFF #endif //TARGET_LINUX #ifdef TARGET_UEFI @@ -128,7 +128,7 @@ #define PCIE_MAX_DEV PLATFORM_OVERRIDE_PCIE_MAX_DEV #define PCIE_MAX_FUNC PLATFORM_OVERRIDE_PCIE_MAX_FUNC #define MAX_IRQ_CNT PLATFORM_OVERRIDE_MAX_IRQ_CNT - #define WAKEUP_WD_SYS_TIMEOUT_MAX PLATFORM_OVERRIDE_SYS_TIMEOUT_MAX + #define SYS_TIMEOUT_MAX PLATFORM_OVERRIDE_SYS_TIMEOUT_MAX #endif // TARGET_UEFI /* The following are common across all platform unless guarded explicitly */ diff --git a/val/include/val_interface.h b/val/include/val_interface.h index f0de6bc0..9a252454 100644 --- a/val/include/val_interface.h +++ b/val/include/val_interface.h @@ -48,15 +48,16 @@ extern uint32_t g_print_level; #define VAL_EXTRACT_BITS(data, start, end) ((data >> start) & ((1ul << (end-start+1))-1)) -#define WAKEUP_WD_PASS_TIMEOUT_THRESHOLD 500 /*minimum timeout that can be - set for wakeup and wd tests*/ -#define WAKEUP_WD_PASS_TIMEOUT_MAX_THRESHOLD 2000000 /*minimum timeout that can be - set for wakeup and wd tests*/ -#define WAKEUP_WD_FAILSAFE_TIMEOUT_MULTIPLIER 100 /*fail safe timeout multipler - multiplied to timeout of ISR - under test*/ -#define WAKEUP_WD_PASS_TIMEOUT_DEFAULT 1000 /*minimum timeout set - by default (1ms)*/ +#define TIMEOUT_THRESHOLD 500 /*minimum timeout that can be + set for wakeup and wd and timer tests*/ +#define TIMEOUT_MAX_THRESHOLD 2000000 /*maximum timeout that can be + set for wakeup and wd and timer tests*/ +#define WAKEUP_WD_FAILSAFE_TIMEOUT_MULTIPLIER 100 /*fail safe timeout multipler + multiplied to timeout of ISR under test*/ +#define WAKEUP_WD_PASS_TIMEOUT_DEFAULT 1000 /*minimum timeout set + by default for wakeup & WD tests (1ms)*/ +#define TIMER_TIMEOUT_DEFAULT 1000000 /*minimum timeout set + by default for timer tests (1s)*/ /* EL1 skip-trap param defines (-el1skiptrap) */ #define EL1SKIPTRAP_PMSIDR (1u << 0) @@ -505,7 +506,7 @@ void val_setup_mair_register(void); #define CEIL_TO_MAX_SYS_TIMEOUT(v) \ ({ \ uint64_t __x = (uint64_t)(v); \ - ((__x >> 32) != 0) ? WAKEUP_WD_SYS_TIMEOUT_MAX : (uint32_t)__x; \ + ((__x >> 32) != 0) ? SYS_TIMEOUT_MAX : (uint32_t)__x; \ }) void val_memory_create_info_table(uint64_t *memory_info_table);