blob: b38d6c42ce4849f84288e466bbc1d1c9cd2c14ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
/*
* Copyright (c) 2023, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <arch_helpers.h>
#include <serror.h>
#include <tftf_lib.h>
#ifdef __aarch64__
static volatile uint64_t serror_triggered;
extern void inject_unrecoverable_ras_error(void);
static bool serror_handler(void)
{
serror_triggered = 1;
return true;
}
/*
* Test Kernel First handling paradigm of RAS errors.
*
* Register a custom serror handler in tftf, inject a RAS error and wait
* for finite time to ensure that SError triggered and handled.
*/
test_result_t test_ras_kfh(void)
{
register_custom_serror_handler(serror_handler);
inject_unrecoverable_ras_error();
/* Give reasonable time for SError to be triggered/handled */
waitms(500);
unregister_custom_serror_handler();
if (serror_triggered == false) {
tftf_testcase_printf("SError is not triggered\n");
return TEST_RESULT_FAIL;
}
return TEST_RESULT_SUCCESS;
}
#else
test_result_t test_ras_kfh(void)
{
tftf_testcase_printf("Not supported on AArch32.\n");
return TEST_RESULT_SKIPPED;
}
#endif
|