aboutsummaryrefslogtreecommitdiffstats
path: root/packages/ixp4xx/ixp-osal-2.1/2.6.patch
blob: 9725b447c8b8c7ddc7697277c04cf4a9ab6735a3 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
 os/linux/src/core/IxOsalOsMsgQ.c      |    2 +-
 os/linux/src/core/IxOsalOsSemaphore.c |    6 +++---
 os/linux/src/core/IxOsalOsServices.c  |   20 ++++++++++++++++----
 os/linux/src/core/IxOsalOsThread.c    |    7 +------
 4 files changed, 21 insertions(+), 14 deletions(-)

--- ixp_osal/os/linux/src/core/IxOsalOsMsgQ.c	1970-01-01 00:00:00.000000000 +0000
+++ ixp_osal/os/linux/src/core/IxOsalOsMsgQ.c	1970-01-01 00:00:00.000000000 +0000
@@ -45,9 +45,9 @@
  * -- End Intel Copyright Notice --
  */
 #include <linux/linkage.h>
+#include <linux/spinlock.h>
 #include <linux/ipc.h>
 #include <linux/msg.h>
-#include <linux/spinlock.h>
 #include <linux/interrupt.h>
 
 #include "IxOsal.h"
--- ixp_osal/os/linux/src/core/IxOsalOsSemaphore.c	1970-01-01 00:00:00.000000000 +0000
+++ ixp_osal/os/linux/src/core/IxOsalOsSemaphore.c	1970-01-01 00:00:00.000000000 +0000
@@ -46,7 +46,7 @@
  */
 
 #include <linux/slab.h>
-#include <asm-arm/hardirq.h>
+#include <linux/hardirq.h>
 #include "IxOsal.h"
 
 /* Define a large number */
@@ -93,7 +93,7 @@ ixOsalSemaphoreWait (IxOsalOsSemaphore *
 {
 
     IX_STATUS ixStatus = IX_SUCCESS;
-    UINT32 timeoutTime;
+    unsigned long timeoutTime;
 
     if (sid == NULL)
     {
@@ -261,7 +261,7 @@ ixOsalMutexInit (IxOsalMutex * mutex)
 PUBLIC IX_STATUS
 ixOsalMutexLock (IxOsalMutex * mutex, INT32 timeout)
 {
-    UINT32 timeoutTime;
+    unsigned long timeoutTime;
 
     if (in_irq ())
     {
--- ixp_osal/os/linux/src/core/IxOsalOsServices.c	1970-01-01 00:00:00.000000000 +0000
+++ ixp_osal/os/linux/src/core/IxOsalOsServices.c	1970-01-01 00:00:00.000000000 +0000
@@ -54,6 +54,7 @@
 #include <linux/time.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
+#include <linux/interrupt.h>
 
 #include "IxOsal.h"
 
@@ -89,7 +90,7 @@ static IxOsalInfoType IxOsalInfo[NR_IRQS
 /*
  * General interrupt handler
  */
-static void
+static irqreturn_t
 ixOsalOsIsrProxy (int irq, void *dev_id, struct pt_regs *regs)
 {
     IxOsalInfoType *isr_proxy_info = (IxOsalInfoType *) dev_id;
@@ -98,6 +99,7 @@ ixOsalOsIsrProxy (int irq, void *dev_id,
 		   "ixOsalOsIsrProxy: Interrupt used before ixOsalIrqBind was invoked");
 
     isr_proxy_info->routine (isr_proxy_info->parameter);
+    return IRQ_HANDLED;
 }
 
 /*
@@ -105,11 +107,12 @@ ixOsalOsIsrProxy (int irq, void *dev_id,
  * This handler saves the interrupted Program Counter (PC)
  * into a global variable
  */
-static void
+static irqreturn_t
 ixOsalOsIsrProxyWithPC (int irq, void *dev_id, struct pt_regs *regs)
 {
     ixOsalLinuxInterruptedPc = regs->ARM_pc;
     ixOsalOsIsrProxy(irq, dev_id, regs);
+    return IRQ_HANDLED;
 }
 
 /**************************************
@@ -191,10 +194,15 @@ ixOsalIrqUnbind (UINT32 vector)
 PUBLIC UINT32
 ixOsalIrqLock ()
 {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
+    unsigned long flags;
+    local_irq_save(flags);
+#else
     UINT32 flags;
     save_flags (flags);
     cli ();
-    return flags;
+#endif
+    return (UINT32)flags;
 }
 
 /* Enable interrupts and task scheduling,
@@ -204,7 +212,11 @@ ixOsalIrqLock ()
 PUBLIC void
 ixOsalIrqUnlock (UINT32 lockKey)
 {
+# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
+    local_irq_restore((unsigned long)lockKey);
+# else
     restore_flags (lockKey);
+# endif
 }
 
 PUBLIC UINT32
@@ -329,7 +341,7 @@ ixOsalBusySleep (UINT32 microseconds)
 PUBLIC void
 ixOsalSleep (UINT32 milliseconds)
 {
-    if (milliseconds != 0)
+    if (milliseconds*HZ >= 1000)
     {
         set_current_state(TASK_INTERRUPTIBLE); 
         schedule_timeout ((milliseconds * HZ) / 1000);
--- ixp_osal/os/linux/src/core/IxOsalOsThread.c	1970-01-01 00:00:00.000000000 +0000
+++ ixp_osal/os/linux/src/core/IxOsalOsThread.c	1970-01-01 00:00:00.000000000 +0000
@@ -65,12 +65,7 @@ thread_internal (void *unused)
     void *arg = IxOsalOsThreadData.arg;
     static int seq = 0;
 
-    daemonize ();
-    reparent_to_init ();
-
-    exit_files (current);
-
-    snprintf(current->comm, sizeof(current->comm), "IxOsal %d", ++seq);
+    daemonize ("IxOsal %d", ++seq);
 
     up (&IxOsalThreadMutex);