File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -292,6 +292,7 @@ typedef struct {
292292 // PCM frame ring buffer
293293 virtio_snd_ring_buffer_t ring ;
294294} virtio_snd_prop_t ;
295+ #define VSND_COMPILER_BARRIER asm("" ::: "memory")
295296
296297static virtio_snd_config_t vsnd_configs [VSND_DEV_CNT_MAX ];
297298static virtio_snd_prop_t vsnd_props [VSND_DEV_CNT_MAX ] = {
@@ -610,7 +611,7 @@ static void __virtio_snd_frame_dequeue(void *out,
610611 memcpy (out , props -> ring .buffer + idx , size - idx );
611612 memcpy (out + (size - idx ), props -> ring .buffer , n - (size - idx ));
612613 }
613- asm( "" ::: "memory" ) ;
614+ VSND_COMPILER_BARRIER ;
614615
615616 props -> ring .cons .tail = cons_next ;
616617}
@@ -788,7 +789,7 @@ static void __virtio_snd_frame_enqueue(void *payload,
788789 memcpy (props -> ring .buffer + idx , payload , size - idx );
789790 memcpy (props -> ring .buffer , payload , n - (size - idx ));
790791 }
791- asm( "" ::: "memory" ) ;
792+ VSND_COMPILER_BARRIER ;
792793
793794 /* Update prod_tail */
794795 props -> ring .prod .tail = prod_next ;
You can’t perform that action at this time.
0 commit comments