オープンソース・ソフトウェアの開発とダウンロード

Subversion リポジトリの参照

Diff of /trunk/1.8.x/ccs-patch/security/ccsecurity/compat.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3942 by kumaneko, Fri Sep 3 09:00:40 2010 UTC revision 4049 by kumaneko, Thu Oct 7 07:14:01 2010 UTC
# Line 3  Line 3 
3   *   *
4   * Copyright (C) 2005-2010  NTT DATA CORPORATION   * Copyright (C) 2005-2010  NTT DATA CORPORATION
5   *   *
6   * Version: 1.8.0-pre   2010/09/01   * Version: 1.8.0-pre   2010/10/05
7   *   *
8   * This file is applicable to both 2.4.30 and 2.6.11 and later.   * This file is applicable to both 2.4.30 and 2.6.11 and later.
9   * See README.ccs for ChangeLog.   * See README.ccs for ChangeLog.
# Line 109  Line 109 
109          })          })
110  #endif  #endif
111    
112  #ifndef list_for_each_entry_rcu  #ifndef srcu_dereference
113  #define list_for_each_entry_rcu(pos, head, member)               \  #define srcu_dereference(p, ss) rcu_dereference(p)
         for (pos = list_entry(rcu_dereference((head)->next),     \  
                               typeof(*pos), member);             \  
              prefetch(pos->member.next), &pos->member != (head); \  
              pos = list_entry(rcu_dereference(pos->member.next), \  
                               typeof(*pos), member))  
114  #endif  #endif
115    
116  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)  #ifndef list_for_each_entry_srcu
117  #undef list_for_each_entry_rcu  #define list_for_each_entry_srcu(pos, head, member, ss)               \
118  #define list_for_each_entry_rcu(pos, head, member)                         \          for (pos = list_entry(srcu_dereference((head)->next, ss),     \
119          for (pos = list_entry(srcu_dereference((head)->next, &ccs_ss),     \                                typeof(*pos), member);                  \
120                                typeof(*pos), member);                       \               prefetch(pos->member.next), &pos->member != (head);      \
121               prefetch(pos->member.next), &pos->member != (head);           \               pos = list_entry(srcu_dereference(pos->member.next, ss), \
              pos = list_entry(srcu_dereference(pos->member.next, &ccs_ss), \  
122                                typeof(*pos), member))                                typeof(*pos), member))
123  #endif  #endif
124    
# Line 161  static inline void list_del_rcu(struct l Line 155  static inline void list_del_rcu(struct l
155  }  }
156  #endif  #endif
157    
158    #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
159    #define __wait_event_interruptible_timeout(wq, condition, ret)          \
160    do {                                                                    \
161            wait_queue_t __wait;                                            \
162            init_waitqueue_entry(&__wait, current);                         \
163                                                                            \
164            add_wait_queue(&wq, &__wait);                                   \
165            for (;;) {                                                      \
166                    set_current_state(TASK_INTERRUPTIBLE);                  \
167                    if (condition)                                          \
168                            break;                                          \
169                    if (!signal_pending(current)) {                         \
170                            ret = schedule_timeout(ret);                    \
171                            if (!ret)                                       \
172                                    break;                                  \
173                            continue;                                       \
174                    }                                                       \
175                    ret = -ERESTARTSYS;                                     \
176                    break;                                                  \
177            }                                                               \
178            current->state = TASK_RUNNING;                                  \
179            remove_wait_queue(&wq, &__wait);                                \
180    } while (0)
181    
182    #define wait_event_interruptible_timeout(wq, condition, timeout)        \
183    ({                                                                      \
184            long __ret = timeout;                                           \
185            if (!(condition))                                               \
186                    __wait_event_interruptible_timeout(wq, condition, __ret); \
187            __ret;                                                          \
188    })
189    #endif
190    
191  #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 30)  #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 30)
192  #undef ssleep  #undef ssleep
193  #define ssleep(secs) {                                          \  #define ssleep(secs) {                                          \
194                  set_current_state(TASK_UNINTERRUPTIBLE);        \                  set_current_state(TASK_UNINTERRUPTIBLE);        \
195                    schedule_timeout((HZ * secs) + 1);              \
196            }
197    #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 9)
198    #undef ssleep
199    #define ssleep(secs) {                                          \
200                    set_current_state(TASK_UNINTERRUPTIBLE);        \
201                  schedule_timeout((HZ * secs) + 1);              \                  schedule_timeout((HZ * secs) + 1);              \
202          }          }
203  #endif  #endif

Legend:
Removed from v.3942  
changed lines
  Added in v.4049

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26