int enabled;
unsigned long long vme_base;
unsigned long long size;
- dma_addr_t buf_base;
+ void *buf_base;
u32 aspace;
u32 cycle;
};
/* Nothing to do */
}
+static void *fake_pci_to_ptr(dma_addr_t addr)
+{
+ return (void *)(uintptr_t)addr;
+}
+
+static dma_addr_t fake_ptr_to_pci(void *addr)
+{
+ return (dma_addr_t)(uintptr_t)addr;
+}
+
/*
* Generate a VME bus interrupt at the requested level & vector. Wait for
* interrupt to be acked.
bridge->slaves[i].enabled = enabled;
bridge->slaves[i].vme_base = vme_base;
bridge->slaves[i].size = size;
- bridge->slaves[i].buf_base = buf_base;
+ bridge->slaves[i].buf_base = fake_pci_to_ptr(buf_base);
bridge->slaves[i].aspace = aspace;
bridge->slaves[i].cycle = cycle;
*enabled = bridge->slaves[i].enabled;
*vme_base = bridge->slaves[i].vme_base;
*size = bridge->slaves[i].size;
- *buf_base = bridge->slaves[i].buf_base;
+ *buf_base = fake_ptr_to_pci(bridge->slaves[i].buf_base);
*aspace = bridge->slaves[i].aspace;
*cycle = bridge->slaves[i].cycle;
if ((addr >= start) && (addr < end)) {
offset = addr - bridge->slaves[i].vme_base;
- loc = (u8 *)((void *)bridge->slaves[i].buf_base + offset);
+ loc = (u8 *)(bridge->slaves[i].buf_base + offset);
retval = *loc;
break;
if ((addr >= start) && ((addr + 1) < end)) {
offset = addr - bridge->slaves[i].vme_base;
- loc = (u16 *)((void *)bridge->slaves[i].buf_base + offset);
+ loc = (u16 *)(bridge->slaves[i].buf_base + offset);
retval = *loc;
break;
if ((addr >= start) && ((addr + 3) < end)) {
offset = addr - bridge->slaves[i].vme_base;
- loc = (u32 *)((void *)bridge->slaves[i].buf_base + offset);
+ loc = (u32 *)(bridge->slaves[i].buf_base + offset);
retval = *loc;
break;
void *alloc = kmalloc(size, GFP_KERNEL);
if (alloc != NULL)
- *dma = (dma_addr_t)(unsigned long)alloc;
+ *dma = fake_ptr_to_pci(alloc);
return alloc;
}
/* Allocate mem for CR/CSR image */
bridge->crcsr_kernel = kzalloc(VME_CRCSR_BUF_SIZE, GFP_KERNEL);
- bridge->crcsr_bus = (dma_addr_t)bridge->crcsr_kernel;
+ bridge->crcsr_bus = fake_ptr_to_pci(bridge->crcsr_kernel);
if (bridge->crcsr_kernel == NULL)
return -ENOMEM;