summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-02-14 11:27:45 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-02-14 11:27:45 +0000
commitb15aa47c56d4f8c6e4bf83fef48e7a764dd119a2 (patch)
tree90e95627f56397cb74e021269a3cb65dd4c6ba2c
parent8f14357064d1b8734e2f4dbe2708ace26d5134d1 (diff)
downloadrockbox-b15aa47c56d4f8c6e4bf83fef48e7a764dd119a2.tar.gz
rockbox-b15aa47c56d4f8c6e4bf83fef48e7a764dd119a2.zip
All kernel objects in code shared amongs targets (core, plugins, codecs) should be declared SHAREDBSS_ATTR as any core could potentially touch them even though they seem only to involve threads on one core. The exception is target code for particular CPUs where proper allocation is fixed. playlist.c was a little odd too-- use one mutex for the current playlist and a separate one for created playlists (still pondering the necessity of more than one).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29305 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/buffering.c4
-rw-r--r--apps/codec_thread.c6
-rw-r--r--apps/mpeg.c2
-rw-r--r--apps/playlist.c37
-rw-r--r--apps/playlist.h2
-rw-r--r--apps/plugins/battery_bench.c2
-rw-r--r--apps/plugins/mikmod/mikmod.c2
-rw-r--r--apps/tagcache.c4
-rw-r--r--firmware/backlight.c2
-rw-r--r--firmware/common/dircache.c2
-rw-r--r--firmware/drivers/ata_mmc.c4
-rw-r--r--firmware/drivers/button.c2
-rw-r--r--firmware/drivers/i2c.c2
-rw-r--r--firmware/scroll_engine.c2
-rw-r--r--firmware/target/arm/ata-sd-pp.c2
-rw-r--r--firmware/test/i2c/main.c2
-rw-r--r--firmware/test/kernel/main.c2
-rw-r--r--firmware/usb.c2
18 files changed, 44 insertions, 37 deletions
diff --git a/apps/buffering.c b/apps/buffering.c
index cbc47c63e7..54c6c05baa 100644
--- a/apps/buffering.c
+++ b/apps/buffering.c
@@ -176,8 +176,8 @@ static void buffering_thread(void);
176static long buffering_stack[(DEFAULT_STACK_SIZE + 0x2000)/sizeof(long)]; 176static long buffering_stack[(DEFAULT_STACK_SIZE + 0x2000)/sizeof(long)];
177static const char buffering_thread_name[] = "buffering"; 177static const char buffering_thread_name[] = "buffering";
178static unsigned int buffering_thread_id = 0; 178static unsigned int buffering_thread_id = 0;
179static struct event_queue buffering_queue; 179static struct event_queue buffering_queue SHAREDBSS_ATTR;
180static struct queue_sender_list buffering_queue_sender_list; 180static struct queue_sender_list buffering_queue_sender_list SHAREDBSS_ATTR;
181 181
182 182
183 183
diff --git a/apps/codec_thread.c b/apps/codec_thread.c
index ef02f70811..03ab5622e2 100644
--- a/apps/codec_thread.c
+++ b/apps/codec_thread.c
@@ -81,15 +81,15 @@ extern bool automatic_skip; /* Who initiated in-progress skip? (C/A-) */
81 */ 81 */
82static bool codec_requested_stop = false; 82static bool codec_requested_stop = false;
83 83
84extern struct event_queue audio_queue; 84extern struct event_queue audio_queue SHAREDBSS_ATTR;
85extern struct event_queue codec_queue; 85extern struct event_queue codec_queue SHAREDBSS_ATTR;
86 86
87extern struct codec_api ci; /* from codecs.c */ 87extern struct codec_api ci; /* from codecs.c */
88 88
89/* Codec thread */ 89/* Codec thread */
90unsigned int codec_thread_id; /* For modifying thread priority later. 90unsigned int codec_thread_id; /* For modifying thread priority later.
91 Used by playback.c and pcmbuf.c */ 91 Used by playback.c and pcmbuf.c */
92static struct queue_sender_list codec_queue_sender_list; 92static struct queue_sender_list codec_queue_sender_list SHAREDBSS_ATTR;
93static long codec_stack[(DEFAULT_STACK_SIZE + 0x2000)/sizeof(long)] 93static long codec_stack[(DEFAULT_STACK_SIZE + 0x2000)/sizeof(long)]
94IBSS_ATTR; 94IBSS_ATTR;
95static const char codec_thread_name[] = "codec"; 95static const char codec_thread_name[] = "codec";
diff --git a/apps/mpeg.c b/apps/mpeg.c
index bdca92048f..690e530d9b 100644
--- a/apps/mpeg.c
+++ b/apps/mpeg.c
@@ -150,7 +150,7 @@ static char mpeg_stack[DEFAULT_STACK_SIZE];
150static struct mp3entry taginfo; 150static struct mp3entry taginfo;
151 151
152#else /* !SIMULATOR */ 152#else /* !SIMULATOR */
153static struct event_queue mpeg_queue; 153static struct event_queue mpeg_queue SHAREDBSS_ATTR;
154static long mpeg_stack[(DEFAULT_STACK_SIZE + 0x1000)/sizeof(long)]; 154static long mpeg_stack[(DEFAULT_STACK_SIZE + 0x1000)/sizeof(long)];
155 155
156static int audiobuflen; 156static int audiobuflen;
diff --git a/apps/playlist.c b/apps/playlist.c
index 41d6ae5ed7..6f6db27b2a 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -192,11 +192,14 @@ static int rotate_index(const struct playlist_info* playlist, int index);
192#ifdef HAVE_DIRCACHE 192#ifdef HAVE_DIRCACHE
193#define PLAYLIST_LOAD_POINTERS 1 193#define PLAYLIST_LOAD_POINTERS 1
194 194
195static struct event_queue playlist_queue; 195static struct event_queue playlist_queue SHAREDBSS_ATTR;
196static long playlist_stack[(DEFAULT_STACK_SIZE + 0x800)/sizeof(long)]; 196static long playlist_stack[(DEFAULT_STACK_SIZE + 0x800)/sizeof(long)];
197static const char playlist_thread_name[] = "playlist cachectrl"; 197static const char playlist_thread_name[] = "playlist cachectrl";
198#endif 198#endif
199 199
200static struct mutex current_playlist_mutex SHAREDBSS_ATTR;
201static struct mutex created_playlist_mutex SHAREDBSS_ATTR;
202
200/* Check if the filename suggests M3U or M3U8 format. */ 203/* Check if the filename suggests M3U or M3U8 format. */
201static bool is_m3u8(const char* filename) 204static bool is_m3u8(const char* filename)
202{ 205{
@@ -1232,9 +1235,9 @@ static void playlist_flush_callback(void *param)
1232 { 1235 {
1233 if (playlist->num_cached > 0) 1236 if (playlist->num_cached > 0)
1234 { 1237 {
1235 mutex_lock(&playlist->control_mutex); 1238 mutex_lock(playlist->control_mutex);
1236 flush_cached_control(playlist); 1239 flush_cached_control(playlist);
1237 mutex_unlock(&playlist->control_mutex); 1240 mutex_unlock(playlist->control_mutex);
1238 } 1241 }
1239 sync_control(playlist, true); 1242 sync_control(playlist, true);
1240 } 1243 }
@@ -1362,7 +1365,7 @@ static int get_filename(struct playlist_info* playlist, int index, int seek,
1362 } 1365 }
1363 else if (max < 0) 1366 else if (max < 0)
1364 { 1367 {
1365 mutex_lock(&playlist->control_mutex); 1368 mutex_lock(playlist->control_mutex);
1366 1369
1367 if (control_file) 1370 if (control_file)
1368 { 1371 {
@@ -1396,7 +1399,7 @@ static int get_filename(struct playlist_info* playlist, int index, int seek,
1396 } 1399 }
1397 } 1400 }
1398 1401
1399 mutex_unlock(&playlist->control_mutex); 1402 mutex_unlock(playlist->control_mutex);
1400 1403
1401 if (max < 0) 1404 if (max < 0)
1402 { 1405 {
@@ -1829,7 +1832,7 @@ static int update_control(struct playlist_info* playlist,
1829 struct playlist_control_cache* cache; 1832 struct playlist_control_cache* cache;
1830 bool flush = false; 1833 bool flush = false;
1831 1834
1832 mutex_lock(&playlist->control_mutex); 1835 mutex_lock(playlist->control_mutex);
1833 1836
1834 cache = &(playlist->control_cache[playlist->num_cached++]); 1837 cache = &(playlist->control_cache[playlist->num_cached++]);
1835 1838
@@ -1861,7 +1864,7 @@ static int update_control(struct playlist_info* playlist,
1861 if (flush || playlist->num_cached == PLAYLIST_MAX_CACHE) 1864 if (flush || playlist->num_cached == PLAYLIST_MAX_CACHE)
1862 result = flush_cached_control(playlist); 1865 result = flush_cached_control(playlist);
1863 1866
1864 mutex_unlock(&playlist->control_mutex); 1867 mutex_unlock(playlist->control_mutex);
1865 1868
1866 return result; 1869 return result;
1867} 1870}
@@ -1881,10 +1884,10 @@ static void sync_control(struct playlist_info* playlist, bool force)
1881 { 1884 {
1882 if (playlist->pending_control_sync) 1885 if (playlist->pending_control_sync)
1883 { 1886 {
1884 mutex_lock(&playlist->control_mutex); 1887 mutex_lock(playlist->control_mutex);
1885 fsync(playlist->control_fd); 1888 fsync(playlist->control_fd);
1886 playlist->pending_control_sync = false; 1889 playlist->pending_control_sync = false;
1887 mutex_unlock(&playlist->control_mutex); 1890 mutex_unlock(playlist->control_mutex);
1888 } 1891 }
1889 } 1892 }
1890} 1893}
@@ -1908,6 +1911,9 @@ void playlist_init(void)
1908{ 1911{
1909 struct playlist_info* playlist = &current_playlist; 1912 struct playlist_info* playlist = &current_playlist;
1910 1913
1914 mutex_init(&current_playlist_mutex);
1915 mutex_init(&created_playlist_mutex);
1916
1911 playlist->current = true; 1917 playlist->current = true;
1912 strlcpy(playlist->control_filename, PLAYLIST_CONTROL_FILE, 1918 strlcpy(playlist->control_filename, PLAYLIST_CONTROL_FILE,
1913 sizeof(playlist->control_filename)); 1919 sizeof(playlist->control_filename));
@@ -1919,7 +1925,8 @@ void playlist_init(void)
1919 playlist->buffer_size = 1925 playlist->buffer_size =
1920 AVERAGE_FILENAME_LENGTH * global_settings.max_files_in_dir; 1926 AVERAGE_FILENAME_LENGTH * global_settings.max_files_in_dir;
1921 playlist->buffer = buffer_alloc(playlist->buffer_size); 1927 playlist->buffer = buffer_alloc(playlist->buffer_size);
1922 mutex_init(&playlist->control_mutex); 1928 playlist->control_mutex = &current_playlist_mutex;
1929
1923 empty_playlist(playlist, true); 1930 empty_playlist(playlist, true);
1924 1931
1925#ifdef HAVE_DIRCACHE 1932#ifdef HAVE_DIRCACHE
@@ -1943,14 +1950,14 @@ void playlist_shutdown(void)
1943 1950
1944 if (playlist->control_fd >= 0) 1951 if (playlist->control_fd >= 0)
1945 { 1952 {
1946 mutex_lock(&playlist->control_mutex); 1953 mutex_lock(playlist->control_mutex);
1947 1954
1948 if (playlist->num_cached > 0) 1955 if (playlist->num_cached > 0)
1949 flush_cached_control(playlist); 1956 flush_cached_control(playlist);
1950 1957
1951 close(playlist->control_fd); 1958 close(playlist->control_fd);
1952 1959
1953 mutex_unlock(&playlist->control_mutex); 1960 mutex_unlock(playlist->control_mutex);
1954 } 1961 }
1955} 1962}
1956 1963
@@ -2705,7 +2712,7 @@ int playlist_create_ex(struct playlist_info* playlist,
2705 2712
2706 playlist->buffer_size = 0; 2713 playlist->buffer_size = 0;
2707 playlist->buffer = NULL; 2714 playlist->buffer = NULL;
2708 mutex_init(&playlist->control_mutex); 2715 playlist->control_mutex = &created_playlist_mutex;
2709 } 2716 }
2710 2717
2711 new_playlist(playlist, dir, file); 2718 new_playlist(playlist, dir, file);
@@ -3441,7 +3448,7 @@ int playlist_save(struct playlist_info* playlist, char *filename)
3441 { 3448 {
3442 result = -1; 3449 result = -1;
3443 3450
3444 mutex_lock(&playlist->control_mutex); 3451 mutex_lock(playlist->control_mutex);
3445 3452
3446 /* Replace the current playlist with the new one and update indices */ 3453 /* Replace the current playlist with the new one and update indices */
3447 close(playlist->fd); 3454 close(playlist->fd);
@@ -3471,7 +3478,7 @@ int playlist_save(struct playlist_info* playlist, char *filename)
3471 } 3478 }
3472 } 3479 }
3473 3480
3474 mutex_unlock(&playlist->control_mutex); 3481 mutex_unlock(playlist->control_mutex);
3475 3482
3476 } 3483 }
3477 3484
diff --git a/apps/playlist.h b/apps/playlist.h
index fb30b7ac8c..9c45769981 100644
--- a/apps/playlist.h
+++ b/apps/playlist.h
@@ -105,7 +105,7 @@ struct playlist_info
105 int num_cached; /* number of cached entries */ 105 int num_cached; /* number of cached entries */
106 bool pending_control_sync; /* control file needs to be synced */ 106 bool pending_control_sync; /* control file needs to be synced */
107 107
108 struct mutex control_mutex; /* mutex for control file access */ 108 struct mutex *control_mutex; /* mutex for control file access */
109 int last_shuffled_start; /* number of tracks when insert last 109 int last_shuffled_start; /* number of tracks when insert last
110 shuffled command start */ 110 shuffled command start */
111}; 111};
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c
index 044db9ff1f..6a0493ceaa 100644
--- a/apps/plugins/battery_bench.c
+++ b/apps/plugins/battery_bench.c
@@ -266,7 +266,7 @@ static struct batt_info
266#define BUF_ELEMENTS (sizeof(bat)/sizeof(struct batt_info)) 266#define BUF_ELEMENTS (sizeof(bat)/sizeof(struct batt_info))
267 267
268static unsigned int thread_id; 268static unsigned int thread_id;
269static struct event_queue thread_q; 269static struct event_queue thread_q SHAREDBSS_ATTR;
270static bool in_usb_mode; 270static bool in_usb_mode;
271static unsigned int buf_idx; 271static unsigned int buf_idx;
272 272
diff --git a/apps/plugins/mikmod/mikmod.c b/apps/plugins/mikmod/mikmod.c
index fe1768376e..c99d11d636 100644
--- a/apps/plugins/mikmod/mikmod.c
+++ b/apps/plugins/mikmod/mikmod.c
@@ -31,7 +31,7 @@
31#define EV_EXIT 9999 31#define EV_EXIT 9999
32#define THREAD_STACK_SIZE DEFAULT_STACK_SIZE + 0x200 32#define THREAD_STACK_SIZE DEFAULT_STACK_SIZE + 0x200
33static unsigned int thread_id; 33static unsigned int thread_id;
34static struct event_queue thread_q; 34static struct event_queue thread_q SHAREDBSS_ATTR;
35/* use long for aligning */ 35/* use long for aligning */
36unsigned long thread_stack[THREAD_STACK_SIZE/sizeof(long)]; 36unsigned long thread_stack[THREAD_STACK_SIZE/sizeof(long)];
37#endif 37#endif
diff --git a/apps/tagcache.c b/apps/tagcache.c
index ae7199ffd6..ea7768139b 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -96,7 +96,7 @@
96 96
97#ifndef __PCTOOL__ 97#ifndef __PCTOOL__
98/* Tag Cache thread. */ 98/* Tag Cache thread. */
99static struct event_queue tagcache_queue; 99static struct event_queue tagcache_queue SHAREDBSS_ATTR;
100static long tagcache_stack[(DEFAULT_STACK_SIZE + 0x4000)/sizeof(long)]; 100static long tagcache_stack[(DEFAULT_STACK_SIZE + 0x4000)/sizeof(long)];
101static const char tagcache_thread_name[] = "tagcache"; 101static const char tagcache_thread_name[] = "tagcache";
102#endif 102#endif
@@ -159,7 +159,7 @@ struct tagcache_command_entry {
159static struct tagcache_command_entry command_queue[TAGCACHE_COMMAND_QUEUE_LENGTH]; 159static struct tagcache_command_entry command_queue[TAGCACHE_COMMAND_QUEUE_LENGTH];
160static volatile int command_queue_widx = 0; 160static volatile int command_queue_widx = 0;
161static volatile int command_queue_ridx = 0; 161static volatile int command_queue_ridx = 0;
162static struct mutex command_queue_mutex; 162static struct mutex command_queue_mutex SHAREDBSS_ATTR;
163#endif 163#endif
164 164
165/* Tag database structures. */ 165/* Tag database structures. */
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 65d535b072..d24fc1342f 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -95,7 +95,7 @@ enum {
95static void backlight_thread(void); 95static void backlight_thread(void);
96static long backlight_stack[DEFAULT_STACK_SIZE/sizeof(long)]; 96static long backlight_stack[DEFAULT_STACK_SIZE/sizeof(long)];
97static const char backlight_thread_name[] = "backlight"; 97static const char backlight_thread_name[] = "backlight";
98static struct event_queue backlight_queue; 98static struct event_queue backlight_queue SHAREDBSS_ATTR;
99#ifdef BACKLIGHT_DRIVER_CLOSE 99#ifdef BACKLIGHT_DRIVER_CLOSE
100static unsigned int backlight_thread_id = 0; 100static unsigned int backlight_thread_id = 0;
101#endif 101#endif
diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c
index 1e0e0223af..45726a3237 100644
--- a/firmware/common/dircache.c
+++ b/firmware/common/dircache.c
@@ -74,7 +74,7 @@ static unsigned long reserve_used = 0;
74static unsigned int cache_build_ticks = 0; 74static unsigned int cache_build_ticks = 0;
75static unsigned long appflags = 0; 75static unsigned long appflags = 0;
76 76
77static struct event_queue dircache_queue; 77static struct event_queue dircache_queue SHAREDBSS_ATTR;
78static long dircache_stack[(DEFAULT_STACK_SIZE + 0x400)/sizeof(long)]; 78static long dircache_stack[(DEFAULT_STACK_SIZE + 0x400)/sizeof(long)];
79static const char dircache_thread_name[] = "dircache"; 79static const char dircache_thread_name[] = "dircache";
80 80
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c
index dfc63021c9..fc2efcd3e4 100644
--- a/firmware/drivers/ata_mmc.c
+++ b/firmware/drivers/ata_mmc.c
@@ -90,7 +90,7 @@ static long last_disk_activity = -1;
90 90
91/* private variables */ 91/* private variables */
92 92
93static struct mutex mmc_mutex; 93static struct mutex mmc_mutex SHAREDBSS_ATTR;
94 94
95#ifdef HAVE_HOTSWAP 95#ifdef HAVE_HOTSWAP
96static long mmc_stack[((DEFAULT_STACK_SIZE*2) + 0x800)/sizeof(long)]; 96static long mmc_stack[((DEFAULT_STACK_SIZE*2) + 0x800)/sizeof(long)];
@@ -98,7 +98,7 @@ static long mmc_stack[((DEFAULT_STACK_SIZE*2) + 0x800)/sizeof(long)];
98static long mmc_stack[(DEFAULT_STACK_SIZE*2)/sizeof(long)]; 98static long mmc_stack[(DEFAULT_STACK_SIZE*2)/sizeof(long)];
99#endif 99#endif
100static const char mmc_thread_name[] = "mmc"; 100static const char mmc_thread_name[] = "mmc";
101static struct event_queue mmc_queue; 101static struct event_queue mmc_queue SHAREDBSS_ATTR;
102static bool initialized = false; 102static bool initialized = false;
103static bool new_mmc_circuit; 103static bool new_mmc_circuit;
104 104
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index 403b521db0..c2df00691b 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -42,7 +42,7 @@
42#include "lcd-remote.h" 42#include "lcd-remote.h"
43#endif 43#endif
44 44
45struct event_queue button_queue; 45struct event_queue button_queue SHAREDBSS_ATTR;
46 46
47static long lastbtn; /* Last valid button status */ 47static long lastbtn; /* Last valid button status */
48static long last_read; /* Last button status, for debouncing/filtering */ 48static long last_read; /* Last button status, for debouncing/filtering */
diff --git a/firmware/drivers/i2c.c b/firmware/drivers/i2c.c
index 8cc7c78a2d..b3a53240b4 100644
--- a/firmware/drivers/i2c.c
+++ b/firmware/drivers/i2c.c
@@ -54,7 +54,7 @@
54/* arbitrary delay loop */ 54/* arbitrary delay loop */
55#define DELAY do { int _x; for(_x=0;_x<20;_x++);} while (0) 55#define DELAY do { int _x; for(_x=0;_x<20;_x++);} while (0)
56 56
57static struct mutex i2c_mtx; 57static struct mutex i2c_mtx SHAREDBSS_ATTR;
58 58
59void i2c_begin(void) 59void i2c_begin(void)
60{ 60{
diff --git a/firmware/scroll_engine.c b/firmware/scroll_engine.c
index 70bbcbeae1..5dd80f1a07 100644
--- a/firmware/scroll_engine.c
+++ b/firmware/scroll_engine.c
@@ -49,7 +49,7 @@ static struct scrollinfo lcd_scroll[LCD_SCROLLABLE_LINES];
49 49
50#ifdef HAVE_REMOTE_LCD 50#ifdef HAVE_REMOTE_LCD
51static struct scrollinfo lcd_remote_scroll[LCD_REMOTE_SCROLLABLE_LINES]; 51static struct scrollinfo lcd_remote_scroll[LCD_REMOTE_SCROLLABLE_LINES];
52static struct event_queue scroll_queue; 52static struct event_queue scroll_queue SHAREDBSS_ATTR;
53#endif 53#endif
54 54
55struct scroll_screen_info lcd_scroll_info = 55struct scroll_screen_info lcd_scroll_info =
diff --git a/firmware/target/arm/ata-sd-pp.c b/firmware/target/arm/ata-sd-pp.c
index b200dc4c22..f83bb60566 100644
--- a/firmware/target/arm/ata-sd-pp.c
+++ b/firmware/target/arm/ata-sd-pp.c
@@ -182,7 +182,7 @@ static struct sd_card_status sd_status[NUM_DRIVES] =
182static long sd_stack [(DEFAULT_STACK_SIZE*2 + 0x1c0)/sizeof(long)]; 182static long sd_stack [(DEFAULT_STACK_SIZE*2 + 0x1c0)/sizeof(long)];
183static const char sd_thread_name[] = "ata/sd"; 183static const char sd_thread_name[] = "ata/sd";
184static struct mutex sd_mtx SHAREDBSS_ATTR; 184static struct mutex sd_mtx SHAREDBSS_ATTR;
185static struct event_queue sd_queue; 185static struct event_queue sd_queue SHAREDBSS_ATTR;
186 186
187#ifdef HAVE_HOTSWAP 187#ifdef HAVE_HOTSWAP
188static int sd_first_drive = 0; 188static int sd_first_drive = 0;
diff --git a/firmware/test/i2c/main.c b/firmware/test/i2c/main.c
index 7a2ff49fcb..ad684829fb 100644
--- a/firmware/test/i2c/main.c
+++ b/firmware/test/i2c/main.c
@@ -288,7 +288,7 @@ bool filling; /* We are filling the buffer with data from disk */
288 288
289 289
290 290
291struct event_queue mpeg_queue; 291struct event_queue mpeg_queue SHAREDBSS_ATTR;
292 292
293 293
294 294
diff --git a/firmware/test/kernel/main.c b/firmware/test/kernel/main.c
index 6a20551bb1..df0e72156a 100644
--- a/firmware/test/kernel/main.c
+++ b/firmware/test/kernel/main.c
@@ -31,7 +31,7 @@ unsigned int s2[256];
31void t1(void); 31void t1(void);
32void t2(void); 32void t2(void);
33 33
34struct event_queue main_q; 34struct event_queue main_q SHAREDBSS_ATTR;
35 35
36int tick_add_task(void (*f)(void)); 36int tick_add_task(void (*f)(void));
37 37
diff --git a/firmware/usb.c b/firmware/usb.c
index 13f66159ac..ebbf0807eb 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -82,7 +82,7 @@ static const char usb_thread_name[] = "usb";
82static unsigned int usb_thread_entry = 0; 82static unsigned int usb_thread_entry = 0;
83static bool usb_monitor_enabled = false; 83static bool usb_monitor_enabled = false;
84#endif /* USB_FULL_INIT */ 84#endif /* USB_FULL_INIT */
85static struct event_queue usb_queue; 85static struct event_queue usb_queue SHAREDBSS_ATTR;
86static bool exclusive_storage_access = false; 86static bool exclusive_storage_access = false;
87#ifdef USB_ENABLE_HID 87#ifdef USB_ENABLE_HID
88static bool usb_hid = true; 88static bool usb_hid = true;