Skip to content

Commit 68c8b73

Browse files
committed
[utest]: Solve the address misalignment issue of atomic operations
In smp_assigned_idle_cores_tc, the finish_flag involves atomic operations and thus requires address alignment. Signed-off-by: Mengchen Teng <[email protected]>
1 parent d79475e commit 68c8b73

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utest/smp/smp_assigned_idle_cores_tc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE
5050
#define THREAD_PRIORITY 20
5151
static rt_thread_t threads[RT_CPUS_NR - 1];
52-
static int tick = 0, finish_flag = 0;
52+
static int tick = 0;
53+
static __attribute__((aligned(sizeof(rt_ubase_t)))) int finish_flag = 0;
5354
static int num = 0;
5455
/* thread entry function */
5556
static void thread_entry(void *parameter)

0 commit comments

Comments
 (0)