summaryrefslogtreecommitdiffstats
path: root/firmware/kernel.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2009-02-03 12:16:45 +0000
committerMichael Sevakis <jethead71@rockbox.org>2009-02-03 12:16:45 +0000
commit3cf148945ed0b484b4610dbc2b4afaa34f2ce2cc (patch)
tree9d25dc10a7ab2f2a2d5dc263136ac121b6efd624 /firmware/kernel.c
parente2a169bce53aff3e5fc300c00d3828129298d469 (diff)
downloadrockbox-3cf148945ed0b484b4610dbc2b4afaa34f2ce2cc.tar.gz
rockbox-3cf148945ed0b484b4610dbc2b4afaa34f2ce2cc.zip
Remove struct spinlock to cleanup some mess and simplify. It's only used in boosting for multiprocesors and a pure two-corelock heirarchy will do just fine.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19910 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/kernel.c')
-rw-r--r--firmware/kernel.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/firmware/kernel.c b/firmware/kernel.c
index ae8f354261..0c2b87b139 100644
--- a/firmware/kernel.c
+++ b/firmware/kernel.c
@@ -962,57 +962,6 @@ void mutex_unlock(struct mutex *m)
}
/****************************************************************************
- * Simpl-er mutex functions ;)
- ****************************************************************************/
-#if NUM_CORES > 1
-void spinlock_init(struct spinlock *l)
-{
- corelock_init(&l->cl);
- l->thread = NULL;
- l->count = 0;
-}
-
-void spinlock_lock(struct spinlock *l)
-{
- const unsigned int core = CURRENT_CORE;
- struct thread_entry *current = cores[core].running;
-
- if(l->thread == current)
- {
- /* current core already owns it */
- l->count++;
- return;
- }
-
- /* lock against other processor cores */
- corelock_lock(&l->cl);
-
- /* take ownership */
- l->thread = current;
-}
-
-void spinlock_unlock(struct spinlock *l)
-{
- /* unlocker not being the owner is an unlocking violation */
- KERNEL_ASSERT(l->thread == cores[CURRENT_CORE].running,
- "spinlock_unlock->wrong thread\n");
-
- if(l->count > 0)
- {
- /* this core still owns lock */
- l->count--;
- return;
- }
-
- /* clear owner */
- l->thread = NULL;
-
- /* release lock */
- corelock_unlock(&l->cl);
-}
-#endif /* NUM_CORES > 1 */
-
-/****************************************************************************
* Simple semaphore functions ;)
****************************************************************************/
#ifdef HAVE_SEMAPHORE_OBJECTS