aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/alpha-agp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/agp/alpha-agp.c')
-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