* @(#)isa.c 1.1 (Berkeley) %G%
/* stuff needed for virtual to physical calculations */
static unsigned long sbase
= (unsigned long) &Sysbase
;
struct buf
*dma_bounce
[8];
if ((x
>= sbase
) & (x
< sbase
+ 0x800000)) return 1;
/****************************************************************************/
/* set up DMA read/write operation and virtual address addr for nbytes */
/****************************************************************************/
at_dma(read
,addr
,nbytes
, chan
)
if (kernel_space(addr
)) raw
= 0;
if (dma_bounce
[chan
] == 0)
dma_bounce
[chan
] = geteblk(MAXDMASZ
);
bounce
= dma_bounce
[chan
]->b_un
.b_addr
;
/* copy bounce buffer on write */
if (raw
&& !read
) bcopy(addr
,bounce
,nbytes
);
/* Set read/write bytes */
outb(0xC,0x46); outb(0xB,0x46);
outb(0xC,0x4A); outb(0xB,0x4A);
if (raw
) phys
= (unsigned long) bounce
;
/* translate to physical */
outb(0x4,(phys
>>8) & 0xFF);
outb(0x81,(phys
>>16) & 0xFF);
outb(0x5,(nbytes
>>8) & 0xFF);