summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-06-25 20:46:54 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-06-25 20:46:54 +0000
commit6bba70b0ec269c53e46c2f36156fc802b3c763a6 (patch)
tree7b28d9f828087df46dae173ec6f3f0b4ebe9e461
parent2a0f5a4200427ae18c9bb4502f38a4be8174e529 (diff)
downloadrockbox-6bba70b0ec269c53e46c2f36156fc802b3c763a6.zip
rockbox-6bba70b0ec269c53e46c2f36156fc802b3c763a6.tar.gz
rockbox-6bba70b0ec269c53e46c2f36156fc802b3c763a6.tar.bz2
rockbox-6bba70b0ec269c53e46c2f36156fc802b3c763a6.tar.xz
current_tick really does need to be volatile since gcc can optimize away checking the value otherwise - found out the hard way. :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13715 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugin.h2
-rw-r--r--firmware/export/kernel.h2
-rw-r--r--firmware/kernel.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/apps/plugin.h b/apps/plugin.h
index a95d80b..3b9ca03 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -334,7 +334,7 @@ struct plugin_api {
#ifdef HAVE_PRIORITY_SCHEDULING
void (*priority_yield)(void);
#endif
- long* current_tick;
+ volatile long* current_tick;
long (*default_event_handler)(long event);
long (*default_event_handler_ex)(long event, void (*callback)(void *), void *parameter);
struct thread_entry* threads;
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h
index a77ca31..9e3a8d2 100644
--- a/firmware/export/kernel.h
+++ b/firmware/export/kernel.h
@@ -93,7 +93,7 @@ struct mutex
the current_tick variable */
#define current_tick (signed)(USEC_TIMER/10000)
#else
-extern long current_tick;
+extern volatile long current_tick;
#endif
#ifdef SIMULATOR
diff --git a/firmware/kernel.c b/firmware/kernel.c
index 5841f89..fcee53f 100644
--- a/firmware/kernel.c
+++ b/firmware/kernel.c
@@ -26,7 +26,7 @@
#include "panic.h"
#if !defined(CPU_PP) || !defined(BOOTLOADER)
-long current_tick NOCACHEDATA_ATTR = 0;
+volatile long current_tick NOCACHEDATA_ATTR = 0;
#endif
static void (*tick_funcs[MAX_NUM_TICK_TASKS])(void);