Changeset 1433ecda in mainline for kernel/test/smpcall
- Timestamp:
- 2018-04-04T15:42:37Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/smpcall/smpcall1.c
r47b2d7e3 r1433ecda 53 53 assert(interrupts_disabled()); 54 54 55 size_t *pcall_cnt = (size_t *)p;55 size_t *pcall_cnt = (size_t *)p; 56 56 /* 57 57 * No synchronization. Tests if smp_calls makes changes … … 64 64 static void test_thread(void *p) 65 65 { 66 size_t *pcall_cnt = (size_t *)p;66 size_t *pcall_cnt = (size_t *)p; 67 67 smp_call_t call_info[MAX_CPUS]; 68 68 … … 84 84 * same counter would clobber it without additional synchronization. 85 85 */ 86 size_t local_cnt[MAX_CPUS] = { 0};86 size_t local_cnt[MAX_CPUS] = { 0 }; 87 87 88 88 /* Now start asynchronous calls. */ … … 110 110 { 111 111 /* Number of received calls that were sent by cpu[i]. */ 112 size_t call_cnt[MAX_CPUS] = { 0};112 size_t call_cnt[MAX_CPUS] = { 0 }; 113 113 thread_t *thread[MAX_CPUS] = { NULL }; 114 114 … … 121 121 for (unsigned int id = 0; id < cpu_count; ++id) { 122 122 thread[id] = thread_create(test_thread, &call_cnt[id], TASK, 123 123 THREAD_FLAG_NONE, "smp-call-test"); 124 124 125 125 if (thread[id]) { … … 135 135 136 136 TPRINTF("Running %zu wired threads. Expecting %zu calls. Be patient.\n", 137 137 running_thread_cnt, exp_calls_sum); 138 138 139 139 for (unsigned int i = 0; i < cpu_count; ++i) { … … 161 161 ok = false; 162 162 TPRINTF("Error: %zu instead of %zu cpu%zu's calls were" 163 163 " acknowledged.\n", call_cnt[i], exp_calls, i); 164 164 } 165 165 } … … 170 170 if (calls_sum != exp_calls_sum) { 171 171 TPRINTF("Error: total acknowledged sum: %zu instead of %zu.\n", 172 172 calls_sum, exp_calls_sum); 173 173 174 174 ok = false; … … 177 177 if (ok) { 178 178 TPRINTF("Success: number of received smp_calls is as expected (%zu).\n", 179 179 exp_calls_sum); 180 180 return NULL; 181 181 } else
Note:
See TracChangeset
for help on using the changeset viewer.