diff options
author | gallatin <gallatin@FreeBSD.org> | 2001-01-08 21:04:33 +0000 |
---|---|---|
committer | gallatin <gallatin@FreeBSD.org> | 2001-01-08 21:04:33 +0000 |
commit | 720fb61d9b0bb9da4aae1355836975cdcd6d6481 (patch) | |
tree | 1b1881ddc6cba08581b4cf4785ebd7800a9a8dde /sys/dev/pdq/pdqvar.h | |
parent | 470280a25e93adea60fe0b8555566156f798a25a (diff) | |
download | FreeBSD-src-720fb61d9b0bb9da4aae1355836975cdcd6d6481.zip FreeBSD-src-720fb61d9b0bb9da4aae1355836975cdcd6d6481.tar.gz |
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)
Diffstat (limited to 'sys/dev/pdq/pdqvar.h')
-rw-r--r-- | sys/dev/pdq/pdqvar.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/pdq/pdqvar.h b/sys/dev/pdq/pdqvar.h index 8320eae..1819747 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 <vm/pmap.h> #include <vm/vm_extern.h> +#include <machine/bus.h> #include <machine/cpufunc.h> #include <machine/clock.h> 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)) |