aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2008-02-05 01:30:04 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 12:44:22 -0500
commit6d6f8d52fd0ff5d3660368232f71c3224d7508e1 (patch)
tree990a3785e805a6e1822e57b867cdcdb17cd8794a /drivers/char/agp
parent2f78dcfd30955a48a2e738d08e4001ebd0e8402c (diff)
agp: alpha nopage
Convert AGP alpha driver from nopage to fault. NULL is NOPAGE_SIGBUS, so we aren't changing behaviour there. Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/agp')
-rw-r--r--drivers/char/agp/alpha-agp.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/char/agp/alpha-agp.c b/drivers/char/agp/alpha-agp.c
index aa8f3a39a704..e77c17838c8a 100644
--- a/drivers/char/agp/alpha-agp.c
+++ b/drivers/char/agp/alpha-agp.c
@@ -11,29 +11,28 @@
11 11
12#include "agp.h" 12#include "agp.h"
13 13
14static struct page *alpha_core_agp_vm_nopage(struct vm_area_struct *vma, 14static int alpha_core_agp_vm_fault(struct vm_area_struct *vma,
15 unsigned long address, 15 struct vm_fault *vmf)
16 int *type)
17{ 16{
18 alpha_agp_info *agp = agp_bridge->dev_private_data; 17 alpha_agp_info *agp = agp_bridge->dev_private_data;
19 dma_addr_t dma_addr; 18 dma_addr_t dma_addr;
20 unsigned long pa; 19 unsigned long pa;
21 struct page *page; 20 struct page *page;
22 21
23 dma_addr = address - vma->vm_start + agp->aperture.bus_base; 22 dma_addr = (unsigned long)vmf->virtual_address - vma->vm_start
23 + agp->aperture.bus_base;
24 pa = agp->ops->translate(agp, dma_addr); 24 pa = agp->ops->translate(agp, dma_addr);
25 25
26 if (pa == (unsigned long)-EINVAL) 26 if (pa == (unsigned long)-EINVAL)
27 return NULL; /* no translation */ 27 return VM_FAULT_SIGBUS; /* no translation */
28 28
29 /* 29 /*
30 * Get the page, inc the use count, and return it 30 * Get the page, inc the use count, and return it
31 */ 31 */
32 page = virt_to_page(__va(pa)); 32 page = virt_to_page(__va(pa));
33 get_page(page); 33 get_page(page);
34 if (type) 34 vmf->page = page;
35 *type = VM_FAULT_MINOR; 35 return 0;
36 return page;
37} 36}
38 37
39static struct aper_size_info_fixed alpha_core_agp_sizes[] = 38static struct aper_size_info_fixed alpha_core_agp_sizes[] =
@@ -42,7 +41,7 @@ static struct aper_size_info_fixed alpha_core_agp_sizes[] =
42}; 41};
43 42
44struct vm_operations_struct alpha_core_agp_vm_ops = { 43struct vm_operations_struct alpha_core_agp_vm_ops = {
45 .nopage = alpha_core_agp_vm_nopage, 44 .fault = alpha_core_agp_vm_fault,
46}; 45};
47 46
48 47