1 #include <linux/module.h>
6 #include <linux/slab.h>
8 #include <asm/machvec.h>
10 #include "../../../arch/alpha/kernel/pci_impl.h"
22 dma_addr = (
unsigned long)vmf->virtual_address - vma->
vm_start
24 pa = agp->
ops->translate(agp, dma_addr);
26 if (pa == (
unsigned long)-
EINVAL)
27 return VM_FAULT_SIGBUS;
43 static const struct vm_operations_struct alpha_core_agp_vm_ops = {
44 .fault = alpha_core_agp_vm_fault,
48 static int alpha_core_agp_fetch_size(
void)
50 return alpha_core_agp_sizes[0].
size;
53 static int alpha_core_agp_configure(
void)
60 static void alpha_core_agp_cleanup(
void)
64 agp->
ops->cleanup(agp);
70 alpha_mv.mv_pci_tbi(agp->
hose, 0, -1);
81 agp->
ops->configure(agp);
86 static int alpha_core_agp_insert_memory(
struct agp_memory *mem,
off_t pg_start,
98 if ((pg_start + mem->
page_count) > num_entries)
101 status = agp->
ops->bind(agp, pg_start, mem);
103 alpha_core_agp_tlbflush(mem);
108 static int alpha_core_agp_remove_memory(
struct agp_memory *mem,
off_t pg_start,
114 status = agp->
ops->unbind(agp, pg_start, mem);
115 alpha_core_agp_tlbflush(mem);
126 .aperture_sizes = alpha_core_agp_sizes,
127 .num_aperture_sizes = 1,
129 .cant_use_aperture =
true,
132 .fetch_size = alpha_core_agp_fetch_size,
133 .configure = alpha_core_agp_configure,
134 .agp_enable = alpha_core_agp_enable,
135 .cleanup = alpha_core_agp_cleanup,
136 .tlb_flush = alpha_core_agp_tlbflush,
139 .create_gatt_table = alpha_core_agp_create_free_gatt_table,
140 .free_gatt_table = alpha_core_agp_create_free_gatt_table,
141 .insert_memory = alpha_core_agp_insert_memory,
142 .remove_memory = alpha_core_agp_remove_memory,
163 if (agp->
ops->setup(agp))
169 aper_size = alpha_core_agp_sizes;
189 alpha_bridge->
vm_ops = &alpha_core_agp_vm_ops;
192 alpha_bridge->
dev = pdev;
203 static int __init agp_alpha_core_init(
void)
207 if (alpha_mv.agp_info)
212 static void __exit agp_alpha_core_cleanup(
void)