summaryrefslogtreecommitdiff
blob: 10e36e2d01b9d83c41a7e85e460a04a94788550d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
--- fritz/src/driver.c_orig	2011-09-04 16:54:30.000000000 +0200
+++ fritz/src/driver.c	2011-09-04 16:55:02.000000000 +0200
@@ -101,7 +101,8 @@
 static unsigned long		crit_flags;
 static atomic_t			scheduler_enabled	= ATOMIC_INIT (0);
 static atomic_t			scheduler_id		= ATOMIC_INIT (-1);
-static spinlock_t		stack_lock		= SPIN_LOCK_UNLOCKED;
+//static spinlock_t		stack_lock		= SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(sched_lock); 
 #if !defined (__fcclassic__)
 static int			card_id			= 0;
 #endif
@@ -815,7 +816,7 @@
 	
 	UNUSED_ARG (data);
 	atomic_set (&scheduler_id, smp_processor_id ());
-	if (spin_trylock (&stack_lock)) {
+	if (spin_trylock (&sched_lock)) {
 		while (!atomic_read (&dont_sched)) {
 			atomic_set (&dont_sched, 1);
 			os_timer_poll ();
@@ -823,7 +824,7 @@
 				scheduler_control (TRUE); 
 			}
 		}
-		spin_unlock (&stack_lock);
+		spin_unlock (&sched_lock);
 	}
 	atomic_set (&scheduler_id, -1);
 } /* scheduler */
@@ -839,9 +840,9 @@
 		if (atomic_read (&scheduler_id) == smp_processor_id ()) {
 			res = IRQ_RETVAL ((*capi_lib->cm_handle_events) ());
 		} else {
-			spin_lock (&stack_lock);
+			spin_lock (&sched_lock);
 			res = IRQ_RETVAL ((*capi_lib->cm_handle_events) ());
-			spin_unlock (&stack_lock);
+			spin_unlock (&sched_lock);
 		}
 		if (res == IRQ_HANDLED) {			
 			atomic_set (&dont_sched, 0);
--- fritz/src/tools.c_orig	2011-09-04 16:54:36.000000000 +0200
+++ fritz/src/tools.c	2011-09-04 16:55:06.000000000 +0200
@@ -529,7 +529,7 @@
 		ERROR("Could not allocate lock structure!!!\n");
 		return 0;
 	}
-	tmp->lock = SPIN_LOCK_UNLOCKED;
+	spin_lock_init(&tmp->lock); 
 	*plock = tmp;
 	return 1;
 } /* lock_init */