From 9fe64a3aa6a56cdc2ab569475abb55c08c52d775 Mon Sep 17 00:00:00 2001 From: Andrew Gallatin Date: Mon, 8 Jan 2001 21:04:33 +0000 Subject: [PATCH] make PCI DEFPA fiddi adapters work on alpha: - add a dma hack similar to the NetBSD one - change PDQ_OS_MEM{RD,WR} to use readl/writel rather than deref'ing a 32 bit va. Note that I did just enough to get this working on alpha. I probably should have updated it to use busspace, but I was too lazy to navigate the twisty minefield of ifdefs that make up this driver. Tested by: wilko (on both x86 and alpha) --- sys/dev/pdq/pdqvar.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dev/pdq/pdqvar.h b/sys/dev/pdq/pdqvar.h index 8320eaec69f9..1819747773d4 100644 --- a/sys/dev/pdq/pdqvar.h +++ b/sys/dev/pdq/pdqvar.h @@ -86,6 +86,8 @@ enum _pdq_type_t { #define PDQ_OS_MEMZERO(p, n) bzero((caddr_t)(p), (n)) #if defined(__NetBSD__) && defined(__alpha__) #define PDQ_OS_VA_TO_PA(pdq, p) (vtophys((vm_offset_t)p) | (pdq->pdq_type == PDQ_DEFTA ? 0 : 0x40000000)) +#elif defined(__FreeBSD__) && defined(__alpha__) +#define PDQ_OS_VA_TO_PA(pdq, p) (vtophys((vm_offset_t)p) | (pdq->pdq_type == PDQ_DEFTA ? 0 : alpha_XXX_dmamap_or)) #else #define PDQ_OS_VA_TO_PA(pdq, p) vtophys(p) #endif @@ -102,6 +104,7 @@ enum _pdq_type_t { #if defined(__FreeBSD__) #include #include +#include #include #include typedef void ifnet_ret_t; @@ -176,8 +179,8 @@ typedef pdq_uint32_t pdq_bus_memoffset_t; #define PDQ_OS_IOWR_32(t, base, offset, data) outl((base) + (offset), data) #define PDQ_OS_IORD_8(t, base, offset) inb((base) + (offset)) #define PDQ_OS_IOWR_8(t, base, offset, data) outb((base) + (offset), data) -#define PDQ_OS_MEMRD_32(t, base, offset) (0 + *((base) + (offset))) -#define PDQ_OS_MEMWR_32(t, base, offset, data) do *((base) + (offset)) = (data); while (0) +#define PDQ_OS_MEMRD_32(t, base, offset) readl((base) + (offset)) +#define PDQ_OS_MEMWR_32(t, base, offset, data) writel((base) + (offset), data) #endif #ifndef PDQ_CSR_OFFSET #define PDQ_CSR_OFFSET(base, offset) (0 + (base) + (offset))