Changeset f933b65 in rtems
- Timestamp:
- 08/07/20 16:07:52 (4 years ago)
- Branches:
- master
- Children:
- 20b1bdb
- Parents:
- e812f81
- git-author:
- Sebastian Huber <sebastian.huber@…> (08/07/20 16:07:52)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (08/07/20 16:09:56)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libtest/t-test-rtems-context.c
re812f81 rf933b65 30 30 #include <rtems/test.h> 31 31 32 #include <rtems.h> 32 33 #include <rtems/score/isrlevel.h> 33 34 #include <rtems/score/percpu.h> … … 36 37 #include <inttypes.h> 37 38 39 #ifdef RTEMS_SMP 40 static rtems_id T_runner_scheduler; 41 #endif 42 43 static rtems_task_priority T_runner_priority; 44 45 static void 46 T_initialize_runner_properties(void) 47 { 48 rtems_status_code sc; 49 50 #ifdef RTEMS_SMP 51 sc = rtems_task_get_scheduler(RTEMS_SELF, &T_runner_scheduler); 52 T_quiet_rsc_success(sc); 53 #endif 54 55 sc = rtems_task_set_priority(RTEMS_SELF, RTEMS_CURRENT_PRIORITY, 56 &T_runner_priority); 57 T_quiet_rsc_success(sc); 58 } 59 38 60 static void 39 61 T_do_check_task_context(void) 40 62 { 63 rtems_task_priority prio; 64 rtems_status_code sc; 41 65 uint32_t v; 66 #ifdef RTEMS_SMP 67 rtems_id id; 68 #endif 42 69 43 70 v = _Per_CPU_Get_snapshot()->thread_dispatch_disable_level; … … 52 79 T_check(&T_special, v == 0, 53 80 "Wrong ISR level (%" PRIu32 ")", v); 81 82 #ifdef RTEMS_SMP 83 id = 0; 84 sc = rtems_task_get_scheduler(RTEMS_SELF, &id); 85 T_quiet_rsc_success(sc); 86 T_check(&T_special, id == T_runner_scheduler, 87 "Wrong runner scheduler, expected ID %08" PRIx32 ", actual ID %08" 88 PRIx32, T_runner_scheduler, id); 89 #endif 90 91 prio = 0; 92 sc = rtems_task_set_priority(RTEMS_SELF, RTEMS_CURRENT_PRIORITY, 93 &prio); 94 T_quiet_rsc_success(sc); 95 T_check(&T_special, prio == T_runner_priority, 96 "Wrong runner priority, expected %" PRIu32 ", actual %" 97 PRIu32, T_runner_priority, prio); 54 98 } 55 99 … … 61 105 switch (event) { 62 106 case T_EVENT_RUN_INITIALIZE_LATE: 107 T_initialize_runner_properties(); 108 /* Fall through */ 63 109 case T_EVENT_CASE_END: 64 110 T_do_check_task_context();
Note: See TracChangeset
for help on using the changeset viewer.