lkml.org 
[lkml]   [2010]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH RT] fix undefined references to kernel_sem
protect kernel_sem access with CONFIG_LOCK_KERNEL
lib/kernel_lock.c is compiled conditionally.

Signed-off-by: Olaf Hering <olaf@aepfle.de>

---
init/main.c | 4 ++++
kernel/lockdep.c | 2 ++
2 files changed, 6 insertions(+)

--- linux-2.6.33-rt.orig/init/main.c
+++ linux-2.6.33-rt/init/main.c
@@ -629,9 +629,13 @@ asmlinkage void __init start_kernel(void
* the lockdep state, so release the one known lock and
* acquire it again after the self-test is done.
*/
+#ifdef CONFIG_LOCK_KERNEL
mutex_release(&kernel_sem.dep_map, 1, _THIS_IP_);
+#endif
locking_selftest();
+#ifdef CONFIG_LOCK_KERNEL
mutex_acquire(&kernel_sem.dep_map, 0, 0, _THIS_IP_);
+#endif
}

#ifdef CONFIG_BLK_DEV_INITRD
--- linux-2.6.33-rt.orig/kernel/lockdep.c
+++ linux-2.6.33-rt/kernel/lockdep.c
@@ -3608,8 +3608,10 @@ void lockdep_init(void)
for (i = 0; i < CHAINHASH_SIZE; i++)
INIT_LIST_HEAD(chainhash_table + i);

+#ifdef CONFIG_LOCK_KERNEL
/* Hack alert ! */
lockdep_set_novalidate_class(&kernel_sem);
+#endif

lockdep_initialized = 1;
}

\
 
 \ /
  Last update: 2010-05-25 00:19    [W:0.023 / U:20.696 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site