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

Subversion リポジトリの参照

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

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

trunk/1.6.x/ccs-patch/include/linux/ccs_compat.h revision 2219 by kumaneko, Tue Mar 3 06:30:38 2009 UTC branches/ccs-patch/include/linux/ccs_compat.h revision 2727 by kumaneko, Fri Jul 3 14:06:48 2009 UTC
# Line 5  Line 5 
5   *   *
6   * Copyright (C) 2005-2009  NTT DATA CORPORATION   * Copyright (C) 2005-2009  NTT DATA CORPORATION
7   *   *
8   * Version: 1.6.7-rc   2009/03/03   * Version: 1.7.0-pre   2009/07/03
9   *   *
10   * 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.
11   * See README.ccs for ChangeLog.   * See README.ccs for ChangeLog.
# Line 66  Line 66 
66  #define mutex_lock(mutex) down(mutex)  #define mutex_lock(mutex) down(mutex)
67  #define mutex_unlock(mutex) up(mutex)  #define mutex_unlock(mutex) up(mutex)
68  #define mutex_lock_interruptible(mutex) down_interruptible(mutex)  #define mutex_lock_interruptible(mutex) down_interruptible(mutex)
69    #define mutex_trylock(mutex) !down_trylock(mutex)
70  #define DEFINE_MUTEX(mutexname) DECLARE_MUTEX(mutexname)  #define DEFINE_MUTEX(mutexname) DECLARE_MUTEX(mutexname)
71  #endif  #endif
72    
# Line 126  Line 127 
127  #endif  #endif
128    
129  #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)  #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
130    static inline void __list_add_rcu(struct list_head *new,
131                                      struct list_head *prev,
132                                      struct list_head *next)
133    {
134            new->next = next;
135            new->prev = prev;
136            rcu_assign_pointer(prev->next, new);
137            next->prev = new;
138    }
139    
140    static inline void list_add_tail_rcu(struct list_head *new,
141                                         struct list_head *head)
142    {
143            __list_add_rcu(new, head->prev, head);
144    }
145    
146    static inline void list_add_rcu(struct list_head *new, struct list_head *head)
147    {
148            __list_add_rcu(new, head, head->next);
149    }
150    
151    #ifndef LIST_POISON2
152    #define LIST_POISON2  ((void *) 0x00200200)
153    #endif
154    
155    static inline void list_del_rcu(struct list_head *entry)
156    {
157            __list_del(entry->prev, entry->next);
158            entry->prev = LIST_POISON2;
159    }
160    #endif
161    
162    #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 30)
163    #undef ssleep
164    #define ssleep(secs) {                              \
165            set_current_state(TASK_UNINTERRUPTIBLE);    \
166            schedule_timeout((HZ * secs) + 1);          \
167    }
168    #endif
169    
170    #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
171  #define s_fs_info u.generic_sbp  #define s_fs_info u.generic_sbp
172  #else  #else
173  #include <linux/audit.h>  #include <linux/audit.h>
# Line 154  Line 196 
196  #define sk_protocol protocol  #define sk_protocol protocol
197  #define sk_type type  #define sk_type type
198  #define sk_receive_queue receive_queue  #define sk_receive_queue receive_queue
199    static inline struct socket *SOCKET_I(struct inode *inode)
200    {
201            return inode->i_sock ? &inode->u.socket_i : NULL;
202    }
203    #endif
204    
205    #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
206    #if defined(__LITTLE_ENDIAN)
207    #define HIPQUAD(addr) \
208            ((unsigned char *)&addr)[3], \
209            ((unsigned char *)&addr)[2], \
210            ((unsigned char *)&addr)[1], \
211            ((unsigned char *)&addr)[0]
212    #elif defined(__BIG_ENDIAN)
213    #define HIPQUAD NIPQUAD
214    #else
215    #error "Please fix asm/byteorder.h"
216    #endif /* __LITTLE_ENDIAN */
217    #endif
218    
219    #ifndef _LINUX_SRCU_H
220    
221    struct srcu_struct {
222            int counter_idx;
223            int counter[2];
224    };
225    
226    static inline int init_srcu_struct(struct srcu_struct *sp)
227    {
228            return 0;
229    }
230    
231    int srcu_read_lock(struct srcu_struct *sp);
232    void srcu_read_unlock(struct srcu_struct *sp, const int idx);
233    void synchronize_srcu(struct srcu_struct *sp);
234    
235  #endif  #endif

Legend:
Removed from v.2219  
changed lines
  Added in v.2727

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