/* atmtest4.c */ /* This program tests the allocation of the DMA buffers */ #include #include #include "atmuser.h" int iobuf[1024]; struct dmatype dma[2]; void main( int argc, char **argv) { int fd; int regid; int rc; fd = open("/dev/ape25", O_RDWR); if (fd < 0) { printf("Device /dev/ape25 could not be opened. \n"); exit(1); } rc = ioctl(fd, AIO_MAPDMA, dma); if (rc) { printf("RC = %d \n", rc); exit(13); } printf("DMA buf addrs are %x and %x \n", (dma[0].virt_base), (dma[1].virt_base)); printf("DMA bufs should contain 77777777 and 55555555 \n"); printf("DMA bufs do contain %x and %x \n", *(dma[0].virt_base), *(dma[1].virt_base)); }