summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/record01
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-08-28 14:28:14 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-08-28 15:22:27 +0200
commit956a2ef78d4fa5da162833f884fe72eba8f6184f (patch)
tree5eb8fab4d30451be717d99fb208b3627a09924b5 /testsuites/libtests/record01
parentrecord: Introduce <rtems/recordserver.h> (diff)
downloadrtems-956a2ef78d4fa5da162833f884fe72eba8f6184f.tar.bz2
record: Add variants for critical sections
Update #3665.
Diffstat (limited to 'testsuites/libtests/record01')
-rw-r--r--testsuites/libtests/record01/init.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/testsuites/libtests/record01/init.c b/testsuites/libtests/record01/init.c
index e8ff23694d..1789d41f84 100644
--- a/testsuites/libtests/record01/init.c
+++ b/testsuites/libtests/record01/init.c
@@ -265,10 +265,12 @@ static void test_add_2_items(test_context *ctx, Record_Control *control)
static void test_add_3_items(test_context *ctx, Record_Control *control)
{
rtems_record_context rc;
+ rtems_interrupt_level level;
init_context(ctx);
- rtems_record_prepare(&rc);
+ rtems_interrupt_local_disable(level);
+ rtems_record_prepare_critical(&rc, _Per_CPU_Get());
rtems_test_assert(rc.control == control);
rtems_test_assert(rc.head == 0);
rtems_test_assert(_Record_Head(control) == 0);
@@ -290,7 +292,8 @@ static void test_add_3_items(test_context *ctx, Record_Control *control)
rc.now = RTEMS_RECORD_TIME_EVENT(10, 0);
rtems_record_add(&rc, UE(9), 11);
- rtems_record_commit(&rc);
+ rtems_record_commit_critical(&rc);
+ rtems_interrupt_local_enable(level);
rtems_test_assert(rc.head == 3);
rtems_test_assert(memcmp(control->Items, expected_items_7, ITEM_SIZE) == 0);
rtems_test_assert(_Record_Head(control) == 3);