Added x11-drivers/ati-drivers-8.42.3 with Accelerated
[underlay.git] / x11-drivers / ati-drivers / files / 8.42.3 / ati-drivers-2.6.23-2.patch
blob4ab3ac6100ec7ddfd923c4ea41ea68486ac7e5ba
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
4 @@ -217,6 +217,56 @@
5 #define preempt_enable()
6 #endif
8 +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22)
9 +#if defined(__i386__)
10 +#define ptep_test_and_clear_dirty(vma, addr, ptep) ({ \
11 + int __ret = 0; \
12 + if (pte_dirty(*(ptep))) \
13 + __ret = test_and_clear_bit(_PAGE_BIT_DIRTY, \
14 + &(ptep)->pte_low); \
15 + if (__ret) \
16 + pte_update((vma)->vm_mm, addr, ptep); \
17 + __ret; \
18 +})
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
23 +/*
24 + * Is the pte executable?
25 + */
26 +static inline int pte_x(pte_t pte)
28 + return !(pte_val(pte) & _PAGE_NX);
31 +/*
32 + * All present user-pages with !NX bit are user-executable:
33 + */
34 +static inline int pte_exec(pte_t pte)
36 + return pte_user(pte) && pte_x(pte);
38 +#else
39 +static inline int pte_exec(pte_t pte)
41 + return pte_user(pte);
43 +#endif /* PAE */
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))
50 + return 0;
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); }
55 +#endif
56 +#endif
58 // ============================================================
59 /* globals */
61 @@ -2490,7 +2540,7 @@
62 #ifndef ptep_clear_flush_dirty
63 #define ptep_clear_flush_dirty(__vma, __address, __ptep) \
64 ({ \
65 - int __dirty = ptep_test_and_clear_dirty(__ptep); \
66 + int __dirty = ptep_test_and_clear_dirty(__vma, __address, __ptep); \
67 if (__dirty) \
68 flush_tlb_page(__vma, __address); \
69 __dirty; \
70 @@ -2937,7 +2987,7 @@
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)