Lines 217-222
Link Here
|
217 |
#define preempt_enable() |
217 |
#define preempt_enable() |
218 |
#endif |
218 |
#endif |
219 |
|
219 |
|
|
|
220 |
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22) |
221 |
#if defined(__i386__) |
222 |
#define ptep_test_and_clear_dirty(vma, addr, ptep) ({ \ |
223 |
int __ret = 0; \ |
224 |
if (pte_dirty(*(ptep))) \ |
225 |
__ret = test_and_clear_bit(_PAGE_BIT_DIRTY, \ |
226 |
&(ptep)->pte_low); \ |
227 |
if (__ret) \ |
228 |
pte_update((vma)->vm_mm, addr, ptep); \ |
229 |
__ret; \ |
230 |
}) |
231 |
|
232 |
static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_USER; } |
233 |
static inline int pte_user(pte_t pte) { return (pte).pte_low & _PAGE_USER; } |
234 |
#ifdef CONFIG_X86_PAE |
235 |
/* |
236 |
* Is the pte executable? |
237 |
*/ |
238 |
static inline int pte_x(pte_t pte) |
239 |
{ |
240 |
return !(pte_val(pte) & _PAGE_NX); |
241 |
} |
242 |
|
243 |
/* |
244 |
* All present user-pages with !NX bit are user-executable: |
245 |
*/ |
246 |
static inline int pte_exec(pte_t pte) |
247 |
{ |
248 |
return pte_user(pte) && pte_x(pte); |
249 |
} |
250 |
#else |
251 |
static inline int pte_exec(pte_t pte) |
252 |
{ |
253 |
return pte_user(pte); |
254 |
} |
255 |
#endif /* PAE */ |
256 |
|
257 |
#elif defined(__x86_64__) |
258 |
static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, |
259 |
unsigned long addr, pte_t *ptep) |
260 |
{ |
261 |
if (!pte_dirty(*ptep)) |
262 |
return 0; |
263 |
return test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte); |
264 |
} |
265 |
static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; } |
266 |
static inline int pte_exec(pte_t pte) { return !(pte_val(pte) & _PAGE_NX); } |
267 |
#endif |
268 |
#endif |
269 |
|
220 |
// ============================================================ |
270 |
// ============================================================ |
221 |
/* globals */ |
271 |
/* globals */ |
222 |
|
272 |
|
Lines 2490-2496
Link Here
|
2490 |
#ifndef ptep_clear_flush_dirty |
2540 |
#ifndef ptep_clear_flush_dirty |
2491 |
#define ptep_clear_flush_dirty(__vma, __address, __ptep) \ |
2541 |
#define ptep_clear_flush_dirty(__vma, __address, __ptep) \ |
2492 |
({ \ |
2542 |
({ \ |
2493 |
int __dirty = ptep_test_and_clear_dirty(__ptep); \ |
2543 |
int __dirty = ptep_test_and_clear_dirty(__vma, __address, __ptep); \ |
2494 |
if (__dirty) \ |
2544 |
if (__dirty) \ |
2495 |
flush_tlb_page(__vma, __address); \ |
2545 |
flush_tlb_page(__vma, __address); \ |
2496 |
__dirty; \ |
2546 |
__dirty; \ |
Lines 2937-2943
Link Here
|
2937 |
{ |
2987 |
{ |
2938 |
return request_irq(irq, |
2988 |
return request_irq(irq, |
2939 |
(void(*)(int, void *, struct pt_regs *))handler, |
2989 |
(void(*)(int, void *, struct pt_regs *))handler, |
2940 |
SA_SHIRQ, dev_name, dev_id); |
2990 |
IRQF_SHARED, dev_name, dev_id); |
2941 |
} |
2991 |
} |
2942 |
|
2992 |
|
2943 |
void ATI_API_CALL __ke_free_irq(unsigned int irq, void *dev_id) |
2993 |
void ATI_API_CALL __ke_free_irq(unsigned int irq, void *dev_id) |