Gentoo Archives: gentoo-user

From: walt <w41ter@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] [PATCH] Using ati-drivers with kernel 3.5
Date: Tue, 12 Jun 2012 19:37:45
Message-Id: jr85m1$dpr$1@dough.gmane.org
1 Like the last time, this patch is an ugly hack and it needs
2 a professional touch before any sane dev would take it seriously.
3
4 But here it is anyway :)
5
6 BTW, I replaced for_each_cpu_mask because I still haven't learned
7 the correct syntax for it. The number "4" is the number of cpus in
8 this particular machine. You should use the correct number for your
9 machine, obviously.
10
11
12 --- firegl_public.c.orig 2012-06-12 11:15:38.025293759 -0700
13 +++ firegl_public.c 2012-06-12 12:02:11.463348365 -0700
14 @@ -2120,9 +2120,9 @@
15 flags = MAP_SHARED;
16 prot = PROT_READ|PROT_WRITE;
17
18 - down_write(&current->mm->mmap_sem);
19 - vaddr = (void *) do_mmap(file, 0, len, prot, flags, pgoff);
20 - up_write(&current->mm->mmap_sem);
21 +// down_write(&current->mm->mmap_sem);
22 + vaddr = (void *) vm_mmap(file, 0, len, prot, flags, pgoff);
23 +// up_write(&current->mm->mmap_sem);
24 if (IS_ERR(vaddr))
25 return 0;
26 else
27 @@ -2133,18 +2133,18 @@
28 {
29 int retcode = 0;
30
31 - down_write(&current->mm->mmap_sem);
32 +// down_write(&current->mm->mmap_sem);
33 #ifdef FGL_LINUX_RHEL_MUNMAP_API
34 - retcode = do_munmap(current->mm,
35 + retcode = vm_munmap(
36 addr,
37 len,
38 1);
39 #else
40 - retcode = do_munmap(current->mm,
41 + retcode = vm_munmap(
42 addr,
43 len);
44 #endif
45 - up_write(&current->mm->mmap_sem);
46 +// up_write(&current->mm->mmap_sem);
47 return retcode;
48 }
49
50 @@ -4156,7 +4156,7 @@
51 {
52 unsigned int p;
53 KCL_DEBUG5(FN_FIREGL_KAS, "%d\n", level_init);
54 - for_each_cpu_mask(p, cpu_possible_map)
55 + for(p=0;p<4;p++)
56 {
57 KCL_DEBUG1(FN_FIREGL_KAS,"Setting initial execution level for CPU # %d\n", p);
58 preempt_disable();