mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
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>
This commit is contained in:
parent
2f78dcfd30
commit
6d6f8d52fd
1 changed files with 8 additions and 9 deletions
|
@ -11,29 +11,28 @@
|
||||||
|
|
||||||
#include "agp.h"
|
#include "agp.h"
|
||||||
|
|
||||||
static struct page *alpha_core_agp_vm_nopage(struct vm_area_struct *vma,
|
static int alpha_core_agp_vm_fault(struct vm_area_struct *vma,
|
||||||
unsigned long address,
|
struct vm_fault *vmf)
|
||||||
int *type)
|
|
||||||
{
|
{
|
||||||
alpha_agp_info *agp = agp_bridge->dev_private_data;
|
alpha_agp_info *agp = agp_bridge->dev_private_data;
|
||||||
dma_addr_t dma_addr;
|
dma_addr_t dma_addr;
|
||||||
unsigned long pa;
|
unsigned long pa;
|
||||||
struct page *page;
|
struct page *page;
|
||||||
|
|
||||||
dma_addr = address - vma->vm_start + agp->aperture.bus_base;
|
dma_addr = (unsigned long)vmf->virtual_address - vma->vm_start
|
||||||
|
+ agp->aperture.bus_base;
|
||||||
pa = agp->ops->translate(agp, dma_addr);
|
pa = agp->ops->translate(agp, dma_addr);
|
||||||
|
|
||||||
if (pa == (unsigned long)-EINVAL)
|
if (pa == (unsigned long)-EINVAL)
|
||||||
return NULL; /* no translation */
|
return VM_FAULT_SIGBUS; /* no translation */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the page, inc the use count, and return it
|
* Get the page, inc the use count, and return it
|
||||||
*/
|
*/
|
||||||
page = virt_to_page(__va(pa));
|
page = virt_to_page(__va(pa));
|
||||||
get_page(page);
|
get_page(page);
|
||||||
if (type)
|
vmf->page = page;
|
||||||
*type = VM_FAULT_MINOR;
|
return 0;
|
||||||
return page;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct aper_size_info_fixed alpha_core_agp_sizes[] =
|
static struct aper_size_info_fixed alpha_core_agp_sizes[] =
|
||||||
|
@ -42,7 +41,7 @@ static struct aper_size_info_fixed alpha_core_agp_sizes[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
struct vm_operations_struct alpha_core_agp_vm_ops = {
|
struct vm_operations_struct alpha_core_agp_vm_ops = {
|
||||||
.nopage = alpha_core_agp_vm_nopage,
|
.fault = alpha_core_agp_vm_fault,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue