Skip to content

Commit 8ff9910

Browse files
Added memory barrier before thread scheduling for ARMv8-A ThreadX SMP. (#280)
1 parent 08380ca commit 8ff9910

50 files changed

Lines changed: 150 additions & 50 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ports_arch/ARMv8-A/threadx_smp/common/src/tx_thread_context_restore.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
/* FIFO queueing, */
7171
/* resulting in version 6.1.11 */
7272
/* xx-xx-xxxx Tiejun Zhou Modified comment(s), added */
73-
/* #include tx_user.h, */
73+
/* #include tx_user.h, added */
74+
/* memory barrier, */
7475
/* resulting in version 6.x */
7576
/* */
7677
/**************************************************************************/
@@ -294,6 +295,7 @@ __tx_thread_dont_save_ts:
294295

295296
/* Set bit indicating this thread is ready for execution. */
296297

298+
DMB ISH // Ensure that accesses to shared resource have completed
297299
MOV x2, #1 // Build ready flag
298300
STR w2, [x0, #260] // Set thread's ready flag
299301
DMB ISH // Ensure that accesses to shared resource have completed

ports_arch/ARMv8-A/threadx_smp/common/src/tx_thread_system_return.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
/* added ARMv8.2-A support, */
6868
/* resulting in version 6.1.10 */
6969
/* xx-xx-xxxx Tiejun Zhou Modified comment(s), added */
70-
/* #include tx_user.h, */
70+
/* #include tx_user.h, added */
71+
/* memory barrier, */
7172
/* resulting in version 6.x */
7273
/* */
7374
/**************************************************************************/
@@ -173,6 +174,7 @@ __tx_thread_dont_save_ts:
173174

174175
/* Set ready bit in thread control block. */
175176

177+
DMB ISH // Ensure that accesses to shared resource have completed
176178
MOV x3, #1 // Build ready value
177179
STR w3, [x6, #260] // Make the thread ready
178180
DMB ISH //

ports_smp/cortex_a35_smp/ac6/src/tx_thread_context_restore.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
/* FIFO queueing, */
7171
/* resulting in version 6.1.11 */
7272
/* xx-xx-xxxx Tiejun Zhou Modified comment(s), added */
73-
/* #include tx_user.h, */
73+
/* #include tx_user.h, added */
74+
/* memory barrier, */
7475
/* resulting in version 6.x */
7576
/* */
7677
/**************************************************************************/
@@ -294,6 +295,7 @@ __tx_thread_dont_save_ts:
294295

295296
/* Set bit indicating this thread is ready for execution. */
296297

298+
DMB ISH // Ensure that accesses to shared resource have completed
297299
MOV x2, #1 // Build ready flag
298300
STR w2, [x0, #260] // Set thread's ready flag
299301
DMB ISH // Ensure that accesses to shared resource have completed

ports_smp/cortex_a35_smp/ac6/src/tx_thread_system_return.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
/* added ARMv8.2-A support, */
6868
/* resulting in version 6.1.10 */
6969
/* xx-xx-xxxx Tiejun Zhou Modified comment(s), added */
70-
/* #include tx_user.h, */
70+
/* #include tx_user.h, added */
71+
/* memory barrier, */
7172
/* resulting in version 6.x */
7273
/* */
7374
/**************************************************************************/
@@ -173,6 +174,7 @@ __tx_thread_dont_save_ts:
173174

174175
/* Set ready bit in thread control block. */
175176

177+
DMB ISH // Ensure that accesses to shared resource have completed
176178
MOV x3, #1 // Build ready value
177179
STR w3, [x6, #260] // Make the thread ready
178180
DMB ISH //

ports_smp/cortex_a35_smp/gnu/src/tx_thread_context_restore.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
/* FIFO queueing, */
7171
/* resulting in version 6.1.11 */
7272
/* xx-xx-xxxx Tiejun Zhou Modified comment(s), added */
73-
/* #include tx_user.h, */
73+
/* #include tx_user.h, added */
74+
/* memory barrier, */
7475
/* resulting in version 6.x */
7576
/* */
7677
/**************************************************************************/
@@ -294,6 +295,7 @@ __tx_thread_dont_save_ts:
294295

295296
/* Set bit indicating this thread is ready for execution. */
296297

298+
DMB ISH // Ensure that accesses to shared resource have completed
297299
MOV x2, #1 // Build ready flag
298300
STR w2, [x0, #260] // Set thread's ready flag
299301
DMB ISH // Ensure that accesses to shared resource have completed

ports_smp/cortex_a35_smp/gnu/src/tx_thread_system_return.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
/* added ARMv8.2-A support, */
6868
/* resulting in version 6.1.10 */
6969
/* xx-xx-xxxx Tiejun Zhou Modified comment(s), added */
70-
/* #include tx_user.h, */
70+
/* #include tx_user.h, added */
71+
/* memory barrier, */
7172
/* resulting in version 6.x */
7273
/* */
7374
/**************************************************************************/
@@ -173,6 +174,7 @@ __tx_thread_dont_save_ts:
173174

174175
/* Set ready bit in thread control block. */
175176

177+
DMB ISH // Ensure that accesses to shared resource have completed
176178
MOV x3, #1 // Build ready value
177179
STR w3, [x6, #260] // Make the thread ready
178180
DMB ISH //

ports_smp/cortex_a53_smp/ac6/src/tx_thread_context_restore.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
/* FIFO queueing, */
7171
/* resulting in version 6.1.11 */
7272
/* xx-xx-xxxx Tiejun Zhou Modified comment(s), added */
73-
/* #include tx_user.h, */
73+
/* #include tx_user.h, added */
74+
/* memory barrier, */
7475
/* resulting in version 6.x */
7576
/* */
7677
/**************************************************************************/
@@ -294,6 +295,7 @@ __tx_thread_dont_save_ts:
294295

295296
/* Set bit indicating this thread is ready for execution. */
296297

298+
DMB ISH // Ensure that accesses to shared resource have completed
297299
MOV x2, #1 // Build ready flag
298300
STR w2, [x0, #260] // Set thread's ready flag
299301
DMB ISH // Ensure that accesses to shared resource have completed

ports_smp/cortex_a53_smp/ac6/src/tx_thread_system_return.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
/* added ARMv8.2-A support, */
6868
/* resulting in version 6.1.10 */
6969
/* xx-xx-xxxx Tiejun Zhou Modified comment(s), added */
70-
/* #include tx_user.h, */
70+
/* #include tx_user.h, added */
71+
/* memory barrier, */
7172
/* resulting in version 6.x */
7273
/* */
7374
/**************************************************************************/
@@ -173,6 +174,7 @@ __tx_thread_dont_save_ts:
173174

174175
/* Set ready bit in thread control block. */
175176

177+
DMB ISH // Ensure that accesses to shared resource have completed
176178
MOV x3, #1 // Build ready value
177179
STR w3, [x6, #260] // Make the thread ready
178180
DMB ISH //

ports_smp/cortex_a53_smp/gnu/src/tx_thread_context_restore.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
/* FIFO queueing, */
7171
/* resulting in version 6.1.11 */
7272
/* xx-xx-xxxx Tiejun Zhou Modified comment(s), added */
73-
/* #include tx_user.h, */
73+
/* #include tx_user.h, added */
74+
/* memory barrier, */
7475
/* resulting in version 6.x */
7576
/* */
7677
/**************************************************************************/
@@ -294,6 +295,7 @@ __tx_thread_dont_save_ts:
294295

295296
/* Set bit indicating this thread is ready for execution. */
296297

298+
DMB ISH // Ensure that accesses to shared resource have completed
297299
MOV x2, #1 // Build ready flag
298300
STR w2, [x0, #260] // Set thread's ready flag
299301
DMB ISH // Ensure that accesses to shared resource have completed

ports_smp/cortex_a53_smp/gnu/src/tx_thread_system_return.S

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
/* added ARMv8.2-A support, */
6868
/* resulting in version 6.1.10 */
6969
/* xx-xx-xxxx Tiejun Zhou Modified comment(s), added */
70-
/* #include tx_user.h, */
70+
/* #include tx_user.h, added */
71+
/* memory barrier, */
7172
/* resulting in version 6.x */
7273
/* */
7374
/**************************************************************************/
@@ -173,6 +174,7 @@ __tx_thread_dont_save_ts:
173174

174175
/* Set ready bit in thread control block. */
175176

177+
DMB ISH // Ensure that accesses to shared resource have completed
176178
MOV x3, #1 // Build ready value
177179
STR w3, [x6, #260] // Make the thread ready
178180
DMB ISH //

0 commit comments

Comments
 (0)