From b15aa47c56d4f8c6e4bf83fef48e7a764dd119a2 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Mon, 14 Feb 2011 11:27:45 +0000 Subject: 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 --- firmware/backlight.c | 2 +- firmware/common/dircache.c | 2 +- firmware/drivers/ata_mmc.c | 4 ++-- firmware/drivers/button.c | 2 +- firmware/drivers/i2c.c | 2 +- firmware/scroll_engine.c | 2 +- firmware/target/arm/ata-sd-pp.c | 2 +- firmware/test/i2c/main.c | 2 +- firmware/test/kernel/main.c | 2 +- firmware/usb.c | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) (limited to 'firmware') 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 { static void backlight_thread(void); static long backlight_stack[DEFAULT_STACK_SIZE/sizeof(long)]; static const char backlight_thread_name[] = "backlight"; -static struct event_queue backlight_queue; +static struct event_queue backlight_queue SHAREDBSS_ATTR; #ifdef BACKLIGHT_DRIVER_CLOSE static unsigned int backlight_thread_id = 0; #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; static unsigned int cache_build_ticks = 0; static unsigned long appflags = 0; -static struct event_queue dircache_queue; +static struct event_queue dircache_queue SHAREDBSS_ATTR; static long dircache_stack[(DEFAULT_STACK_SIZE + 0x400)/sizeof(long)]; static const char dircache_thread_name[] = "dircache"; 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; /* private variables */ -static struct mutex mmc_mutex; +static struct mutex mmc_mutex SHAREDBSS_ATTR; #ifdef HAVE_HOTSWAP static 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)]; static long mmc_stack[(DEFAULT_STACK_SIZE*2)/sizeof(long)]; #endif static const char mmc_thread_name[] = "mmc"; -static struct event_queue mmc_queue; +static struct event_queue mmc_queue SHAREDBSS_ATTR; static bool initialized = false; static bool new_mmc_circuit; 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 @@ #include "lcd-remote.h" #endif -struct event_queue button_queue; +struct event_queue button_queue SHAREDBSS_ATTR; static long lastbtn; /* Last valid button status */ static 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 @@ /* arbitrary delay loop */ #define DELAY do { int _x; for(_x=0;_x<20;_x++);} while (0) -static struct mutex i2c_mtx; +static struct mutex i2c_mtx SHAREDBSS_ATTR; void i2c_begin(void) { 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]; #ifdef HAVE_REMOTE_LCD static struct scrollinfo lcd_remote_scroll[LCD_REMOTE_SCROLLABLE_LINES]; -static struct event_queue scroll_queue; +static struct event_queue scroll_queue SHAREDBSS_ATTR; #endif struct 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] = static long sd_stack [(DEFAULT_STACK_SIZE*2 + 0x1c0)/sizeof(long)]; static const char sd_thread_name[] = "ata/sd"; static struct mutex sd_mtx SHAREDBSS_ATTR; -static struct event_queue sd_queue; +static struct event_queue sd_queue SHAREDBSS_ATTR; #ifdef HAVE_HOTSWAP static 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 */ -struct event_queue mpeg_queue; +struct event_queue mpeg_queue SHAREDBSS_ATTR; 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]; void t1(void); void t2(void); -struct event_queue main_q; +struct event_queue main_q SHAREDBSS_ATTR; int tick_add_task(void (*f)(void)); 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"; static unsigned int usb_thread_entry = 0; static bool usb_monitor_enabled = false; #endif /* USB_FULL_INIT */ -static struct event_queue usb_queue; +static struct event_queue usb_queue SHAREDBSS_ATTR; static bool exclusive_storage_access = false; #ifdef USB_ENABLE_HID static bool usb_hid = true; -- cgit v1.2.3