summaryrefslogtreecommitdiff
path: root/firmware/export/kernel.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2010-12-27 10:05:09 +0000
committerMichael Sevakis <jethead71@rockbox.org>2010-12-27 10:05:09 +0000
commit7b4eb44395bced7073e37d0b8b0d83fb2f518482 (patch)
treeaf526b3cf241e9eeb2bd3c1508791078f93f4157 /firmware/export/kernel.h
parent479414faccedeeb1ca7d0b6074bd69f2ef6dd441 (diff)
downloadrockbox-7b4eb44395bced7073e37d0b8b0d83fb2f518482.zip
rockbox-7b4eb44395bced7073e37d0b8b0d83fb2f518482.tar.gz
rockbox-7b4eb44395bced7073e37d0b8b0d83fb2f518482.tar.bz2
rockbox-7b4eb44395bced7073e37d0b8b0d83fb2f518482.tar.xz
Certain data accesses in the kernel should have volatile semantics to be correct and not rely on the whims of the compiler. Change queue clearing to simply catch read up to write rather than reset both to 0 to ensure sane results for queue_count and queue_empty with concurrency. Binsize may or may not increase a bit depending upon whether the output was as intended in all places; wrong stuff was already unlikely to cause any issue.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28909 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/kernel.h')
-rw-r--r--firmware/export/kernel.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h
index c7fcd93..4656d87 100644
--- a/firmware/export/kernel.h
+++ b/firmware/export/kernel.h
@@ -106,7 +106,7 @@ struct queue_sender_list
struct thread_entry *senders[QUEUE_LENGTH]; /* message->thread map */
struct thread_entry *list; /* list of senders in map */
/* Send info for last message dequeued or NULL if replied or not sent */
- struct thread_entry *curr_sender;
+ struct thread_entry * volatile curr_sender;
#ifdef HAVE_PRIORITY_SCHEDULING
struct blocker blocker;
#endif
@@ -126,10 +126,10 @@ struct event_queue
{
struct thread_entry *queue; /* waiter list */
struct queue_event events[QUEUE_LENGTH]; /* list of events */
- unsigned int read; /* head of queue */
- unsigned int write; /* tail of queue */
+ unsigned int volatile read; /* head of queue */
+ unsigned int volatile write; /* tail of queue */
#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME
- struct queue_sender_list *send; /* list of threads waiting for
+ struct queue_sender_list * volatile send; /* list of threads waiting for
reply to an event */
#ifdef HAVE_PRIORITY_SCHEDULING
struct blocker *blocker_p; /* priority inheritance info
@@ -171,7 +171,7 @@ struct semaphore
struct wakeup
{
struct thread_entry *queue; /* waiter list */
- bool signalled; /* signalled status */
+ bool volatile signalled; /* signalled status */
IF_COP( struct corelock cl; ) /* multiprocessor sync */
};
#endif