Merge branch 'org.openembedded.dev' of git@git.openembedded.net:openembedded into...
[openembedded.git] / packages / ixp4xx / ixp-osal-2.1.1 / 2.6.patch
1  os/linux/src/core/IxOsalOsMsgQ.c      |    2 +-
2  os/linux/src/core/IxOsalOsSemaphore.c |    6 +++---
3  os/linux/src/core/IxOsalOsServices.c  |   20 ++++++++++++++++----
4  os/linux/src/core/IxOsalOsThread.c    |    7 +------
5  4 files changed, 21 insertions(+), 14 deletions(-)
6
7 --- ixp_osal/os/linux/src/core/IxOsalOsMsgQ.c   1970-01-01 00:00:00.000000000 +0000
8 +++ ixp_osal/os/linux/src/core/IxOsalOsMsgQ.c   1970-01-01 00:00:00.000000000 +0000
9 @@ -45,9 +45,9 @@
10   * -- End Intel Copyright Notice --
11   */
12  #include <linux/linkage.h>
13 +#include <linux/spinlock.h>
14  #include <linux/ipc.h>
15  #include <linux/msg.h>
16 -#include <linux/spinlock.h>
17  #include <linux/interrupt.h>
18  
19  #include "IxOsal.h"
20 --- ixp_osal/os/linux/src/core/IxOsalOsSemaphore.c      1970-01-01 00:00:00.000000000 +0000
21 +++ ixp_osal/os/linux/src/core/IxOsalOsSemaphore.c      1970-01-01 00:00:00.000000000 +0000
22 @@ -46,7 +46,7 @@
23   */
24  
25  #include <linux/slab.h>
26 -#include <asm-arm/hardirq.h>
27 +#include <linux/hardirq.h>
28  #include "IxOsal.h"
29  
30  /* Define a large number */
31 @@ -93,7 +93,7 @@ ixOsalSemaphoreWait (IxOsalOsSemaphore *
32  {
33  
34      IX_STATUS ixStatus = IX_SUCCESS;
35 -    UINT32 timeoutTime;
36 +    unsigned long timeoutTime;
37  
38      if (sid == NULL)
39      {
40 @@ -261,7 +261,7 @@ ixOsalMutexInit (IxOsalMutex * mutex)
41  PUBLIC IX_STATUS
42  ixOsalMutexLock (IxOsalMutex * mutex, INT32 timeout)
43  {
44 -    UINT32 timeoutTime;
45 +    unsigned long timeoutTime;
46  
47      if (in_irq ())
48      {
49 --- ixp_osal/os/linux/src/core/IxOsalOsServices.c       1970-01-01 00:00:00.000000000 +0000
50 +++ ixp_osal/os/linux/src/core/IxOsalOsServices.c       1970-01-01 00:00:00.000000000 +0000
51 @@ -54,6 +54,7 @@
52  #include <linux/time.h>
53  #include <linux/sched.h>
54  #include <linux/slab.h>
55 +#include <linux/interrupt.h>
56  
57  #include "IxOsal.h"
58  
59 @@ -89,7 +90,7 @@ static IxOsalInfoType IxOsalInfo[NR_IRQS
60  /*
61   * General interrupt handler
62   */
63 -static void
64 +static irqreturn_t
65  ixOsalOsIsrProxy (int irq, void *dev_id, struct pt_regs *regs)
66  {
67      IxOsalInfoType *isr_proxy_info = (IxOsalInfoType *) dev_id;
68 @@ -98,6 +99,7 @@ ixOsalOsIsrProxy (int irq, void *dev_id,
69                    "ixOsalOsIsrProxy: Interrupt used before ixOsalIrqBind was invoked");
70  
71      isr_proxy_info->routine (isr_proxy_info->parameter);
72 +    return IRQ_HANDLED;
73  }
74  
75  /*
76 @@ -105,11 +107,12 @@ ixOsalOsIsrProxy (int irq, void *dev_id,
77   * This handler saves the interrupted Program Counter (PC)
78   * into a global variable
79   */
80 -static void
81 +static irqreturn_t
82  ixOsalOsIsrProxyWithPC (int irq, void *dev_id, struct pt_regs *regs)
83  {
84      ixOsalLinuxInterruptedPc = regs->ARM_pc;
85      ixOsalOsIsrProxy(irq, dev_id, regs);
86 +    return IRQ_HANDLED;
87  }
88  
89  /**************************************
90 @@ -191,10 +194,15 @@ ixOsalIrqUnbind (UINT32 vector)
91  PUBLIC UINT32
92  ixOsalIrqLock ()
93  {
94 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
95 +    unsigned long flags;
96 +    local_irq_save(flags);
97 +#else
98      UINT32 flags;
99      save_flags (flags);
100      cli ();
101 -    return flags;
102 +#endif
103 +    return (UINT32)flags;
104  }
105  
106  /* Enable interrupts and task scheduling,
107 @@ -204,7 +212,11 @@ ixOsalIrqLock ()
108  PUBLIC void
109  ixOsalIrqUnlock (UINT32 lockKey)
110  {
111 +# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
112 +    local_irq_restore((unsigned long)lockKey);
113 +# else
114      restore_flags (lockKey);
115 +# endif
116  }
117  
118  PUBLIC UINT32
119 @@ -329,7 +341,7 @@ ixOsalBusySleep (UINT32 microseconds)
120  PUBLIC void
121  ixOsalSleep (UINT32 milliseconds)
122  {
123 -    if (milliseconds != 0)
124 +    if (milliseconds*HZ >= 1000)
125      {
126          set_current_state(TASK_INTERRUPTIBLE); 
127          schedule_timeout ((milliseconds * HZ) / 1000);
128 --- ixp_osal/os/linux/src/core/IxOsalOsThread.c 1970-01-01 00:00:00.000000000 +0000
129 +++ ixp_osal/os/linux/src/core/IxOsalOsThread.c 1970-01-01 00:00:00.000000000 +0000
130 @@ -65,12 +65,7 @@ thread_internal (void *unused)
131      void *arg = IxOsalOsThreadData.arg;
132      static int seq = 0;
133  
134 -    daemonize ();
135 -    reparent_to_init ();
136 -
137 -    exit_files (current);
138 -
139 -    snprintf(current->comm, sizeof(current->comm), "IxOsal %d", ++seq);
140 +    daemonize ("IxOsal %d", ++seq);
141  
142      up (&IxOsalThreadMutex);
143