1 diff -Naur common/lib/modules/fglrx/build_mod/firegl_public.c.old common/lib/modules/fglrx/build_mod/firegl_public.c
2 --- common/lib/modules/fglrx/build_mod/firegl_public.c 2007-10-24 14:10:52.000000000 +0000
3 +++ common/lib/modules/fglrx/build_mod/firegl_public.c 2007-10-24 14:14:39.000000000 +0000
5 #define preempt_enable()
8 +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22)
10 +#define ptep_test_and_clear_dirty(vma, addr, ptep) ({ \
12 + if (pte_dirty(*(ptep))) \
13 + __ret = test_and_clear_bit(_PAGE_BIT_DIRTY, \
14 + &(ptep)->pte_low); \
16 + pte_update((vma)->vm_mm, addr, ptep); \
20 +static inline int pte_read(pte_t pte) { return (pte).pte_low & _PAGE_USER; }
21 +static inline int pte_user(pte_t pte) { return (pte).pte_low & _PAGE_USER; }
22 +#ifdef CONFIG_X86_PAE
24 + * Is the pte executable?
26 +static inline int pte_x(pte_t pte)
28 + return !(pte_val(pte) & _PAGE_NX);
32 + * All present user-pages with !NX bit are user-executable:
34 +static inline int pte_exec(pte_t pte)
36 + return pte_user(pte) && pte_x(pte);
39 +static inline int pte_exec(pte_t pte)
41 + return pte_user(pte);
45 +#elif defined(__x86_64__)
46 +static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma,
47 + unsigned long addr, pte_t *ptep)
49 + if (!pte_dirty(*ptep))
51 + return test_and_clear_bit(_PAGE_BIT_DIRTY, &ptep->pte);
53 +static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
54 +static inline int pte_exec(pte_t pte) { return !(pte_val(pte) & _PAGE_NX); }
58 // ============================================================
62 #ifndef ptep_clear_flush_dirty
63 #define ptep_clear_flush_dirty(__vma, __address, __ptep) \
65 - int __dirty = ptep_test_and_clear_dirty(__ptep); \
66 + int __dirty = ptep_test_and_clear_dirty(__vma, __address, __ptep); \
68 flush_tlb_page(__vma, __address); \
72 return request_irq(irq,
73 (void(*)(int, void *, struct pt_regs *))handler,
74 - SA_SHIRQ, dev_name, dev_id);
75 + IRQF_SHARED, dev_name, dev_id);
78 void ATI_API_CALL __ke_free_irq(unsigned int irq, void *dev_id)