mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-02-04 12:41:34 +00:00
testsuites/sptests/spcache01/init.c: Address -Wclobbered warning
This warning indicates the potential for using a local variable which is not guaranteed to be preserved across a setjmp()/longjmp() pair. Updates #5364.
This commit is contained in:
committed by
Kinsey Moore
parent
63c93acec1
commit
b8d245499e
@@ -185,6 +185,15 @@ static uint64_t store(void)
|
||||
return rtems_counter_ticks_to_nanoseconds(d);
|
||||
}
|
||||
|
||||
static bool cache_invalidate_wrapper(void)
|
||||
{
|
||||
if (setjmp(instruction_invalidate_return_context) == 0) {
|
||||
rtems_cache_invalidate_multiple_instruction_lines(do_some_work, 4096);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void test_timing(void)
|
||||
{
|
||||
RTEMS_INTERRUPT_LOCK_DECLARE(, lock)
|
||||
@@ -381,12 +390,7 @@ static void test_timing(void)
|
||||
|
||||
do_longjmp = true;
|
||||
|
||||
if (setjmp(instruction_invalidate_return_context) == 0) {
|
||||
rtems_cache_invalidate_multiple_instruction_lines(do_some_work, 4096);
|
||||
exception = false;
|
||||
} else {
|
||||
exception = true;
|
||||
}
|
||||
exception = cache_invalidate_wrapper();
|
||||
|
||||
do_longjmp = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user